9181: Don't complete values in type position r=jonas-schievink a=Veykril
Will add some proper tests in a bit
9182: fix: don't complete derive macros as fn-like macros r=jonas-schievink a=jonas-schievink
Part of https://github.com/rust-analyzer/rust-analyzer/issues/8518
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
9180: fix: fix some IDE functionality inside attribute macros r=jonas-schievink a=jonas-schievink
In `SourceToDefCtx::find_container`, we might encounter a container that has an attribute macro. We need to skip that item, instead of bailing out and creating an empty `Resolver`, otherwise all names in the macro stay unresolved.
Part of https://github.com/rust-analyzer/rust-analyzer/issues/9142
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
9153: QOL: VSCode status bar icon on click now shows server status r=matklad a=Milo123459
Now, when you click the little status bar text, it will automatically reload the server. I don't think I've ever seen anyone click it randomly, and, it's there to save you a few clicks.
Co-authored-by: Milo <50248166+Milo123459@users.noreply.github.com>
9169: internal: steps towards attribute macro token mapping r=jonas-schievink a=jonas-schievink
This doesn't work yet, but we seem to be getting a bit further along (for example, we now stop highlighting `use` items inside item with attribute macros as if they were written verbatim).
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
9144: Extend convert_tuple_struct_to_named_struct to also apply to enum tuple variants r=matklad a=joshuawarner32
This is largely copied and adapted from the existing `convert_tuple_struct_to_named_struct` code.
Not sure if maybe some of this code can/should be shared between those two assists - but the differences are significant enough to make it at least seem like a non-trivial refactor.
Co-authored-by: Joshua Warner <joshuawarner32@gmail.com>
9166: Clarify label documentation r=matklad a=flodiebold
Also some other cleanups while I'm there.
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
9164: internal: Reduce the number of direct fields in `CompletionContext` some more r=Veykril a=Veykril
Doesn't make the code much simpler yet.
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
9106: feat: goto definition on an impl fn goes to that fn in the trait r=lf- a=lf-
e.g. if you have a trait T and `impl T for S` for some struct, if you
goto definition on some function name inside the impl, it will go to the
definition of that function inside the `trait T` block, rather than the
current behaviour of not going anywhere at all.
![ra goto def trait the other way](https://user-images.githubusercontent.com/6652840/120403989-39aa3280-c2fa-11eb-9359-639346878acd.gif)
Co-authored-by: Jade <software@lfcode.ca>
e.g. if you have a trait T and `impl T for S` for some struct, if you
goto definition on some function name inside the impl, it will go to the
definition of that function inside the `trait T` block, rather than the
current behaviour of not going anywhere at all.
9155: internal: replace attribute with equivalent whitespace r=jonas-schievink a=jonas-schievink
This is needed to that the `TokenMap` we create contains offsets that match the source. Currently the offsets don't match because the attribute is removed, shifting all subsequent token offsets by the attribute's text length.
Currently this fix has no visible effect because we don't remap tokens in attribute macros.
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>