In rust-analyzer, we avoid defualt impls for types which don't have
sensible, "empty" defaults. In particular, we avoid using invalid
indices for defaults and similar hacks.
Rather than a "Stable" and "Nightly" ABI we instead name ABIs based on
the version of the rust compiler in which they were introduced. We place
these ABIs in a new module - `proc_macro_srv::abis` - where we also add
some mchinery to abstract over ABIs. This should make it easy to add new
ABIs at a later date as the rust compiler evolves.
9579: fix: Set more `CARGO_` env vars r=jonas-schievink a=jonas-schievink
Set `CARGO_CRATE_NAME` to the package name, with `-` replaced by `_`. This is wrong, but better than not setting the variable at all.
Also set `CARGO_PKG_HOMEPAGE` since it's easy.
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
9535: internal: remove proc macro management thread r=jonas-schievink a=jonas-schievink
Communication with the proc macro server process has always happened one request at a time, so the additional thread isn't really needed (it just forwarded each request, and sent back the response). This removes some indirection that was a bit hard to understand (a channel was allocated and sent over another channel to return the response).
Hope I'm not missing anything here
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
9569: internal: Explicitly check for reference locals or fields in Name classification r=Veykril a=Veykril
Closes#7524
Inlines all the calls to reference related name classification as well as emits both goto definition targets for field shorthands.
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
9572: fix: Work around older synstructure derives r=lnicola a=flodiebold
Fixes#9562, until the proper fixrust-lang/chalk#717 works which requires mystor/synstructure#47 to be released.
Also add an unrelated test, for #9560.
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
This treats the consts generated by older synstructure versions like
unnamed consts. We should remove this at some point (at least after
Chalk has switched).
9567: remove unneded special case r=matklad a=matklad
bors r+
🤖
9568: feat: add 'for' postfix completion r=lnicola a=mahdi-frms
![Peek 2021-07-11 16-45](https://user-images.githubusercontent.com/62165556/125194692-a0aaf780-e267-11eb-952a-81de7955d9a1.gif)
adds #9561
used ```ele``` as identifier for each element in the iteration
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Co-authored-by: mahdi-frms <mahdif1380@outlook.com>
9563: internal: move some presentation-specific concerns out of IDE crate r=Veykril a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
9553: minor: Disambiguate replace with if let assist labels r=Veykril a=Veykril
Turns out we have two assists for replacing something with `if let` constructs, so having the cursor on a `let` keyword inside a match gave you two identical assist labels which is rather confusing.
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
9555: feat: Enable `auto_import` on ident patterns r=Veykril a=Veykril
Helpful for when you want to import a type in a pattern right before destructuring it.
9556: Bump deps r=lnicola a=lnicola
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>