4076: Improve remove derive attrs r=matklad a=edwin0cheng
This PR implemented a proper `remove_derive_attrs` function which **merely** remove any `#[derive(*)]` attributes.
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
4038: Group generated ast boilerplate apart from the interesting part r=matklad a=Veetaha
Boilerplate `AstNode` and `From` impls are moved to the end further from the interesting part in `generated.rs`
Co-authored-by: veetaha <veetaha2@gmail.com>
4069: More detailed Sublime Text install instructions r=lnicola a=nnmm
* People might typically jump directly to their editor and wonder where the part about installing rust-analyzer is – at least I did. I added a link to the relevant section for ST.
* Make ST instructions more detailed and user friendly (especially beginners), include troubleshooting tips.
* Minor grammar improvements throughout.
Co-authored-by: Nikolai Morin <nnmmgit@gmail.com>
* People might typically jump directly to their editor and wonder where the part about installing rust-analyzer is – at least I did. I added a link to the relevant section for ST.
* Make ST instructions more detailed and user friendly (especially beginners), include troubleshooting tips.
* Minor grammar improvements throughout.
4060: Update Chalk, and cache Chalk env elaboration through a query r=matklad a=flodiebold
This should fix some of the worst performance problems.
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
4057: Fix panic in split_imports assist r=matklad a=matklad
The fix is admittedly quit literally just papering over.
Long-term, I see two more principled approaches:
* we switch to a fully tree-based impl, without parse . to_string
step; with this approach, there shouldn't be any panics. The results
might be nonsensical, but so was the original input.
* we preserve the invariant that re-parsing constructed node is an
identity, and make all the `make_xxx` method return an `Option`.
closes#4044
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
The fix is admittedly quit literally just papering over.
Long-term, I see two more principled approaches:
* we switch to a fully tree-based impl, without parse . to_string
step; with this approach, there shouldn't be any panics. The results
might be nonsensical, but so was the original input.
* we preserve the invariant that re-parsing constructed node is an
identity, and make all the `make_xxx` method return an `Option`.
closes#4044
4045: Update regex r=kjeremy a=kjeremy
Changelog says it reduces unnecessary recompilation of transitive dependencies in some cases.
https://github.com/rust-lang/regex/pull/665
Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
4035: Convert bool to ident instead of literal in mbe r=matklad a=edwin0cheng
Fixed#1249
Currently we treat boolean literal as `tt::Literal` , which makes parsing $lit:lit matcher easily.
However, proc-macro2 treat boolean literal as `ident` :
4173a21dc4/src/lib.rs (L939)
OT: I am quite happy we finally need to fix this bug :)
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
4034: Add semantic tag for unresolved references r=matklad a=matklad
This is a quick way to implement unresolved reference diagnostics.
For example, adding to VS Code config
"editor.tokenColorCustomizationsExperimental": {
"unresolvedReference": "#FF0000"
},
will highlight all unresolved refs in red.
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This is a quick way to implement unresolved reference diagnostics.
For example, adding to VS Code config
"editor.tokenColorCustomizationsExperimental": {
"unresolvedReference": "#FF0000"
},
will highlight all unresolved refs in red.
3894: Match check enum record r=flodiebold a=JoshMcguigan
This PR implements match statement exhaustiveness checking for record type enums.
It also make a minor addition to the test infrastructure to allow testing against a single diagnostic, so you can be sure your test is triggering (or not) whichever diagnostic you expect.
Co-authored-by: Josh Mcguigan <joshmcg88@gmail.com>
4029: Fix various proc-macro bugs r=matklad a=edwin0cheng
This PRs does the following things:
1. Fixed#4001 by splitting `LIFETIME` lexer token to two mbe tokens. It is because rustc token stream expects `LIFETIME` as a combination of punct and ident, but RA `tt:TokenTree` treats it as a single `Ident` previously.
2. Fixed#4003, by skipping `proc-macro` for completion. It is because currently we don't have `AstNode` for `proc-macro`. We would need to redesign how to implement `HasSource` for `proc-macro`.
3. Fixed a bug how empty `TokenStream` merging in `proc-macro-srv` such that no L_DOLLAR and R_DOLLAR will be emitted accidentally.
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>