feat: complete locals in record field#22440
Open
A4-Tacks wants to merge 1 commit into
Open
Conversation
Example
---
```rust
fn outer() {
let foo = 3;
{
let bar = 3;
struct Foo {
b$0
}
let baz = 3;
let qux = 3;
}
let fez = 3;
}
```
Completes:
```text
bn bar: i32,
bn baz: i32,
bn foo: i32,
kw pub
kw pub(crate)
kw pub(super)
```
Contributor
|
I feel like local structs, especially in the middle of a function, are rare enough to not justify this. |
Member
Author
|
This can be temporary, first creating a structure within the function and then move it to the top level This assist is very useful when refactoring large functions |
Contributor
|
I've never done that and I fail to even imagine how it'll be useful. I don't want this, but CC @rust-lang/rust-analyzer. |
Member
|
I agree, this seems to have little value and in fact might even be confusing at times due to showing non fields here, |
Member
Author
This was originally only a completion for visibility, I think there's no problem |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Example
Completes: