bors[bot]
254022c13c
Merge #10304
...
10304: internal: Generate ast nodes for each ast trait r=Veykril a=Veykril
Generate a `DynTrait` node per ast trait that implements the trait itself as well as conversions via the `AstNode` trait. This is a trick already employed in `hir_def::attr` with `AttrsOwner` where it was manually implemented for.
This basically gives us stack trait objects for these(only useful for `hir_def::attr` currently) as well as simple conversions of `SyntaxNode` to a trait, in cases where only a result of a function call of such a trait is of interest.
It doesn't have many uses yet but as its autogenerated it doesn't add any maintenance costs.
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-09-21 14:15:53 +00:00
Lukas Wirth
83e97adfff
Simplify
2021-09-21 16:15:30 +02:00
Lukas Wirth
b36f12dba5
Simplify
2021-09-21 16:05:21 +02:00
Lukas Wirth
6d6e0b8f21
Generate ast nodes for each ast trait
2021-09-21 15:52:11 +02:00
bors[bot]
168b00fbba
Merge #10303
...
10303: internal: Add a mirror function-like proc-macro expander for tests r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-09-21 12:56:37 +00:00
Lukas Wirth
ba84b91e78
Add a mirror function-like proc-macro expander for tests
2021-09-21 14:55:54 +02:00
bors[bot]
063df5a482
Merge #10301
...
10301: minor: Merge iter_for_each_to_for and for_to_iter_for_each assists modules r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-09-21 08:34:51 +00:00
Lukas Wirth
8b1e8197fe
Merge iter_for_each_to_for and for_to_iter_for_each assists modules
2021-09-21 10:34:11 +02:00
bors[bot]
6a98383fa5
Merge #10299
...
10299: minor: Rename some assists r=Veykril a=Veykril
Trying to make our assist names a bit more uniform
`fill_match_arms` -> `add_missing_match_arms`
`infer_function_return_type` -> `add_return_type`
`replace_impl_trait_with_generic` -> `introduce_named_generic`
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-09-20 22:54:39 +00:00
Lukas Wirth
8b2be8572f
Rename some assists
2021-09-21 00:54:09 +02:00
longfangsong
cd599ec202
Address comments
2021-09-20 21:37:18 +08:00
bors[bot]
f1d7f98ed0
Merge #10293
...
10293: fix: Don't bail on parse errors in macro input for builtin expansion r=Veykril a=Veykril
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/8158
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-09-19 22:33:42 +00:00
Lukas Wirth
e7e87fc69d
Don't bail on parse errors in macro input for builtin expansion
2021-09-20 00:33:13 +02:00
bors[bot]
b7bedf16a1
Merge #10289
...
10289: fix: Only strip derive attributes when preparing macro input r=Veykril a=Veykril
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10246
cc https://github.com/rust-analyzer/rowan/pull/114 , follow up to https://github.com/rust-analyzer/rust-analyzer/pull/10025
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-09-19 21:46:51 +00:00
bors[bot]
05d291881a
Merge #10292
...
10292: minor: Simplify r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-09-19 21:39:36 +00:00
Lukas Wirth
a6dde501df
Only strip derive attributes when preparing macro input
2021-09-19 23:38:38 +02:00
Lukas Wirth
9c39363ada
Simplify
2021-09-19 23:34:07 +02:00
bors[bot]
06ea89d3de
Merge #10290
...
10290: minor: Simplify r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-09-19 17:01:23 +00:00
Lukas Wirth
3987bf5d6f
Simplify
2021-09-19 19:00:06 +02:00
bors[bot]
b02027d4fe
Merge #10287
...
10287: internal: more focused tests for const arguments r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-09-19 13:35:46 +00:00
Aleksey Kladov
a6181bfdb7
internal: more focused tests for const arguments
2021-09-19 16:35:10 +03:00
bors[bot]
bd2cd6a15f
Merge #10283
...
10283: minor: simplify generics parsing r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-09-19 11:51:38 +00:00
Aleksey Kladov
09531b703d
minor: simplify
2021-09-19 14:50:53 +03:00
hamidreza kalbasi
0777698f29
internal: definition based hover functions
2021-09-19 16:15:44 +04:30
Aleksey Kladov
0005678649
minor: simplify
2021-09-19 14:26:35 +03:00
bors[bot]
e458f66214
Merge #10282
...
10282: fix: don't allow two turbo-fishes in generic arguments r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-09-19 09:10:32 +00:00
Aleksey Kladov
f99bdf4cc0
fix: don't allow two turbo-fishes in generic arguments
2021-09-19 12:09:50 +03:00
bors[bot]
1c81c36219
Merge #10280
...
10280: internal: type argument parsing refactoring r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-09-19 08:54:02 +00:00
Aleksey Kladov
8ae1f9c335
internal: add erroneous test for double turbo fish
...
We parse `f` successfully, but that is a bug.
2021-09-19 11:42:10 +03:00
Aleksey Kladov
8009ccc27d
minor: improve readability
2021-09-19 11:34:25 +03:00
Aleksey Kladov
25adc5e9f0
minor: reduce duplication
2021-09-19 11:19:31 +03:00
bors[bot]
7729473dd2
Merge #10276
...
10276: internal: parser cleanup r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-09-18 13:09:51 +00:00
Aleksey Kladov
fbb6a6a95b
fix: correctly handle jointness
2021-09-18 16:09:12 +03:00
Aleksey Kladov
c0556bd8c1
minor: improve readability
2021-09-18 15:56:26 +03:00
Aleksey Kladov
ed84717869
internal: better naming
2021-09-18 15:55:07 +03:00
Aleksey Kladov
3dc2aeea0f
internal: parser cleanup
2021-09-18 15:46:28 +03:00
Aleksey Kladov
af9fd37cd9
internal: minimize use_tree parser tests
...
The code here is intentionally dense and does exactly what is written.
Explaining semantic difference between Rust 2015 and 2018 doesn't help
with understanding syntax. Better to just add more targeted tests.
2021-09-18 15:22:49 +03:00
bors[bot]
dd12521ac9
Merge #10275
...
10275: internal: parser cleanups r=Veykril a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-09-18 12:20:55 +00:00
Aleksey Kladov
1d2e9818d6
internal: parser cleanups
2021-09-18 14:53:46 +03:00
bors[bot]
ba16c16005
Merge #10274
...
10274: feat: Make inlay hints work in attributed items r=Veykril a=Veykril
Attempt at #10043(previous attempt #10231 )
![image](https://user-images.githubusercontent.com/3757771/133887500-091675db-f473-44f8-9bf5-8313ecfbc9e7.png )
Slight difference to the first approach, chaining hints now work but attribute inputs do not as they are basically the same as normal macros in that they take a token tree.
Fixes #10043
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-09-18 11:43:10 +00:00
Aleksey Kladov
aaadaa40bd
internal: more focused trait item parsing tests
2021-09-18 14:34:29 +03:00
Lukas Wirth
6465868449
Make inlay hints work in attributed items
2021-09-18 13:19:29 +02:00
bors[bot]
6cb33c3047
Merge #10273
...
10273: minor: Add multi-token mapping test for goto_definition r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-09-18 10:00:47 +00:00
Lukas Wirth
11a17c803f
Add multi-token mapping test for goto_definition
2021-09-18 12:00:12 +02:00
bors[bot]
a435e49d34
Merge #10252
...
10252: fix: make `goto_definition` multi-token mapping aware r=Veykril a=XFFXFF
Implement #10070 in [`goto_definition`](https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/goto_definition.rs )
Co-authored-by: zhoufan <1247714429@qq.com>
2021-09-18 01:21:43 +00:00
zhoufan
227450f9b9
do comment handling on the original token
2021-09-18 08:22:57 +08:00
bors[bot]
7c03200d70
Merge #10267
...
10267: Narrow "if-let to match" assist available range r=Veykril a=rainy-me
ref: https://github.com/rust-analyzer/rust-analyzer/issues/10220
Co-authored-by: rainy-me <github@rainy.me>
2021-09-17 22:44:39 +00:00
bors[bot]
8e612459de
Merge #10270
...
10270: intenral: more item parsing cleanup r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-09-17 22:05:16 +00:00
Aleksey Kladov
3474e3b3b1
intenral: more local tests for statics
2021-09-18 01:02:43 +03:00
Aleksey Kladov
1feb8e89d5
minor: cleanup const parsing
2021-09-18 00:58:35 +03:00