]>
git.lizzy.rs Git - rust.git/log
Aleksey Kladov [Sat, 25 Sep 2021 16:51:54 +0000 (19:51 +0300)]
feat: allow attributes on all expressions
Attrs are syntactically valid on any expression, even if they are not
allowed semantically everywhere yet.
Aleksey Kladov [Sat, 25 Sep 2021 16:11:45 +0000 (19:11 +0300)]
fix: correct extend_to logic in parser
Previously we swapped to events in the buffer, but that might be wrong
if there aer `forward_parent` links pointing to the swapped-out node.
Let's do the same via parent links instead, keeping the nodes in place
Aleksey Kladov [Sat, 25 Sep 2021 15:07:51 +0000 (18:07 +0300)]
simplify attribute parsing
bors[bot] [Sat, 25 Sep 2021 12:11:37 +0000 (12:11 +0000)]
Merge #10347
10347: minor: Update `semanticTokenModifiers` in package.json r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Sat, 25 Sep 2021 12:10:46 +0000 (14:10 +0200)]
Update `semanticTokenModifiers` in package.json
bors[bot] [Sat, 25 Sep 2021 11:56:23 +0000 (11:56 +0000)]
Merge #10346
10346: minor: align code with code-style r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 25 Sep 2021 11:55:42 +0000 (14:55 +0300)]
minor: align code with code-style
bors[bot] [Sat, 25 Sep 2021 11:37:30 +0000 (11:37 +0000)]
Merge #10345
10345: minore: improve consistency r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 25 Sep 2021 11:36:46 +0000 (14:36 +0300)]
minore: improve consistency
Aleksey Kladov [Sat, 25 Sep 2021 11:24:08 +0000 (14:24 +0300)]
minor: more condensed tests
bors[bot] [Sat, 25 Sep 2021 11:20:54 +0000 (11:20 +0000)]
Merge #10344
10344: minor: link my own pratt parsing article :-) r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 25 Sep 2021 11:18:59 +0000 (14:18 +0300)]
minor: link my own pratt parsing article :-)
bors[bot] [Sat, 25 Sep 2021 11:11:33 +0000 (11:11 +0000)]
Merge #10343
10343: internal: parser cleanups r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 25 Sep 2021 11:10:25 +0000 (14:10 +0300)]
internal: add => () rule; emphasize `n_items` rule
Aleksey Kladov [Sat, 25 Sep 2021 11:02:33 +0000 (14:02 +0300)]
minor: more focusted tests
Aleksey Kladov [Sat, 25 Sep 2021 10:27:53 +0000 (13:27 +0300)]
minor: more readable code
bors[bot] [Fri, 24 Sep 2021 19:18:15 +0000 (19:18 +0000)]
Merge #10339
10339: fix: Fix item-level macro errors (eg. `compile_error!`) r=jonas-schievink a=jonas-schievink
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/8459
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Fri, 24 Sep 2021 19:17:25 +0000 (21:17 +0200)]
Fix item-level lazy macro errors
bors[bot] [Fri, 24 Sep 2021 18:42:44 +0000 (18:42 +0000)]
Merge #10338
10338: fix: Fix diagnostics in unnamed consts r=jonas-schievink a=jonas-schievink
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Fri, 24 Sep 2021 18:41:24 +0000 (20:41 +0200)]
Fix diagnostics in unnamed consts
bors[bot] [Fri, 24 Sep 2021 17:07:18 +0000 (17:07 +0000)]
Merge #10334
10334: Give rustfmt spawn error context. r=jonas-schievink a=aDotInTheVoid
This mean if you misconfigure to
```json
{
"rust-analyzer.rustfmt.overrideCommand": [
"./nonono"
]
}
```
The error message is
```
[Error - 17:54:33] Request textDocument/formatting failed.
Message: Failed to spawn "./nonono"
Code: -32603
```
instead of
```
[Error - 17:56:12] Request textDocument/formatting failed.
Message: No such file or directory (os error 2)
Code: -32603
```
I'm not sure how to test this, or if it needs a test.
Co-authored-by: Nixon Enraght-Moony <nixon.emoony@gmail.com>
bors[bot] [Fri, 24 Sep 2021 16:57:37 +0000 (16:57 +0000)]
Merge #10335
10335: internal: Avoid some `Arc` cloning r=jonas-schievink a=jonas-schievink
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Fri, 24 Sep 2021 16:57:08 +0000 (18:57 +0200)]
Avoid some `Arc` cloning
Nixon Enraght-Moony [Fri, 24 Sep 2021 16:51:47 +0000 (17:51 +0100)]
Give rustfmt spawn error context.
bors[bot] [Fri, 24 Sep 2021 15:12:17 +0000 (15:12 +0000)]
Merge #10105
10105: RfC: Use `todo!()` instead of `()` for missing fields r=jonas-schievink a=jo-so
Most commonly a field of a struct can be initialized with its default value than an empty tuple.
Co-authored-by: Jörg Sommer <joerg@jo-so.de>
bors[bot] [Fri, 24 Sep 2021 14:59:02 +0000 (14:59 +0000)]
Merge #10332
10332: minor: Allow overwriting RUST_BACKTRACE for the server manually r=jonas-schievink a=Veykril
Trying to figure out why we aren't getting backtraces for windows builds from CI, this let's one set the backtraces to `FULL`
Might be cc https://github.com/rust-lang/rust/issues/87481
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
bors[bot] [Fri, 24 Sep 2021 14:51:19 +0000 (14:51 +0000)]
Merge #10331
10331: minor: Include macro path in eager macro resolve error r=jonas-schievink a=jonas-schievink
bors r+
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
bors[bot] [Fri, 24 Sep 2021 14:02:16 +0000 (14:02 +0000)]
Merge #10329
10329: Fix link to "Auto Import" r=lnicola a=carlos-menezes
https://github.com/rust-analyzer/rust-analyzer.github.io/pull/147#issuecomment-
926600543
Co-authored-by: Carlos Menezes <carlos-menezes212@hotmail.com>
Carlos Menezes [Fri, 24 Sep 2021 13:53:11 +0000 (14:53 +0100)]
Add missing files
Lukas Wirth [Fri, 24 Sep 2021 13:38:00 +0000 (15:38 +0200)]
Allow setting RUST_BACKTRACE for the server manually
Jonas Schievink [Fri, 24 Sep 2021 13:34:57 +0000 (15:34 +0200)]
Include macro path in eager macro resolve error
Carlos Menezes [Fri, 24 Sep 2021 12:59:44 +0000 (13:59 +0100)]
Fix link to "Auto Import"
bors[bot] [Fri, 24 Sep 2021 12:21:12 +0000 (12:21 +0000)]
Merge #10328
10328: fix: Fix incorrect mod.rs handling in unlinked_file fixes r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Fri, 24 Sep 2021 12:20:43 +0000 (14:20 +0200)]
Fix incorrect mod.rs handling in unlinked_file fixes
bors[bot] [Thu, 23 Sep 2021 18:36:44 +0000 (18:36 +0000)]
Merge #10322
10322: internal: Split the hover module up r=Veykril a=Veykril
cc https://github.com/rust-analyzer/rust-analyzer/issues/10107
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Thu, 23 Sep 2021 17:54:57 +0000 (19:54 +0200)]
Split the hover module up
bors[bot] [Thu, 23 Sep 2021 18:06:08 +0000 (18:06 +0000)]
Merge #10321
10321: fix: Change the global setting when toggling inlay hints r=lnicola a=lnicola
Closes #10318
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
bors[bot] [Thu, 23 Sep 2021 17:56:55 +0000 (17:56 +0000)]
Merge #10320
10320: feat: Hover/GotoDef works in macro invocations and on doc attribute strings r=Veykril a=Veykril
![image](https://user-images.githubusercontent.com/
3757771 /
134554781 -
b903d33d -674f-4ed4-8acb-
71ff5913f1cb .png)
cc https://github.com/rust-analyzer/rust-analyzer/issues/10271
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Laurențiu Nicola [Thu, 23 Sep 2021 17:45:45 +0000 (20:45 +0300)]
Change the global setting when toggling inlay hints
Lukas Wirth [Thu, 23 Sep 2021 17:17:29 +0000 (19:17 +0200)]
Support goto_def for intra-doc-links in macro invocations
Lukas Wirth [Thu, 23 Sep 2021 15:32:39 +0000 (17:32 +0200)]
Make hover work for intra doc links in macro invocations
bors[bot] [Thu, 23 Sep 2021 14:28:27 +0000 (14:28 +0000)]
Merge #10319
10319: internal: Cleanup hover a bit r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Thu, 23 Sep 2021 13:37:52 +0000 (15:37 +0200)]
Cleanup
bors[bot] [Thu, 23 Sep 2021 04:55:34 +0000 (04:55 +0000)]
Merge #10315
10315: Fix title of User Manual page r=lnicola a=terrynsun
Asciidoc uses the first line of a doc as the title, so you can't put
comments before the heading.
---
I had an old copy of the Manual page open and I noticed that the "User Manual" heading (and page title) had disappeared in the live version:
![image](https://user-images.githubusercontent.com/
2858750 /
134455658 -
3885b754 -9eae-4dca-a6d4-
4b1453910850 .png)
With this change (and how it was a few days ago):
![image](https://user-images.githubusercontent.com/
2858750 /
134455865 -
5acc7538 -ccf8-4346-941f-
3a5561b3181e .png)
Co-authored-by: Terry Sun <terrynsun@gmail.com>
Terry Sun [Thu, 23 Sep 2021 04:37:17 +0000 (21:37 -0700)]
Fix title of User Manual page
Asciidoc uses the first line of a doc as the title, so you can't put
comments before the heading.
bors[bot] [Wed, 22 Sep 2021 20:04:30 +0000 (20:04 +0000)]
Merge #10313
10313: Mark large benchmark data files as binary to filter greps r=lnicola a=joshtriplett
When doing a git grep (of rust-analyzer or of rust-lang/rust with
--recurse-submodules), if the grep happens to match within the large
benchmark data files, the resulting long single lines can cause a text
pager or editor to slow down and distract from more useful matches.
These test data files aren't formatted for human consumption, so mark
them as binary, which causes git grep to instead just state that they
match without printing the matching "line".
Co-authored-by: Josh Triplett <josh@joshtriplett.org>
Josh Triplett [Wed, 22 Sep 2021 19:51:58 +0000 (12:51 -0700)]
Mark large benchmark data files as binary to filter greps
When doing a git grep (of rust-analyzer or of rust-lang/rust with
--recurse-submodules), if the grep happens to match within the large
benchmark data files, the resulting long single lines can cause a text
pager or editor to slow down and distract from more useful matches.
These test data files aren't formatted for human consumption, so mark
them as binary, which causes git grep to instead just state that they
match without printing the matching "line".
bors[bot] [Wed, 22 Sep 2021 15:23:23 +0000 (15:23 +0000)]
Merge #10284
10284: internal: definition based hover functions r=Veykril a=HKalbasi
This is part of #10181 but since it is blocked and `hover.rs` is moving quickly so will cause conflicts, I submitted this PR.
This PR extract some parts of `hover` to `find_definition` (maybe this need to be moved to some other file?) and `hover_for_definition`, with those functions I will be able to calculate definition of every token, and calculate hover (and probably other queries) for each definition only once.
Co-authored-by: hamidreza kalbasi <hamidrezakalbasi@protonmail.com>
hamidreza kalbasi [Wed, 22 Sep 2021 15:05:54 +0000 (18:35 +0330)]
move function to defs.rs
hamidreza kalbasi [Wed, 22 Sep 2021 08:14:23 +0000 (11:44 +0330)]
remove dead code
hamidreza kalbasi [Wed, 22 Sep 2021 08:07:26 +0000 (11:37 +0330)]
use find_definition in go to
bors[bot] [Tue, 21 Sep 2021 22:54:56 +0000 (22:54 +0000)]
Merge #10306
10306: Generate function assist creates bad param names for const/static item args r=XFFXFF a=XFFXFF
Try to fix #10278
Co-authored-by: zhoufan <1247714429@qq.com>
zhoufan [Tue, 21 Sep 2021 22:32:23 +0000 (06:32 +0800)]
Change the style of the code
zhoufan [Tue, 21 Sep 2021 16:15:57 +0000 (00:15 +0800)]
Generate function assist creates bad param names for const/static item args
hamidreza kalbasi [Tue, 21 Sep 2021 15:25:57 +0000 (19:55 +0430)]
fix derive hover in macro
bors[bot] [Tue, 21 Sep 2021 14:15:53 +0000 (14:15 +0000)]
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>
Lukas Wirth [Tue, 21 Sep 2021 14:15:30 +0000 (16:15 +0200)]
Simplify
Lukas Wirth [Tue, 21 Sep 2021 13:56:06 +0000 (15:56 +0200)]
Simplify
Lukas Wirth [Tue, 21 Sep 2021 13:52:11 +0000 (15:52 +0200)]
Generate ast nodes for each ast trait
bors[bot] [Tue, 21 Sep 2021 12:56:37 +0000 (12:56 +0000)]
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>
Lukas Wirth [Tue, 21 Sep 2021 12:55:54 +0000 (14:55 +0200)]
Add a mirror function-like proc-macro expander for tests
bors[bot] [Tue, 21 Sep 2021 08:34:51 +0000 (08:34 +0000)]
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>
Lukas Wirth [Tue, 21 Sep 2021 08:34:11 +0000 (10:34 +0200)]
Merge iter_for_each_to_for and for_to_iter_for_each assists modules
bors[bot] [Mon, 20 Sep 2021 22:54:39 +0000 (22:54 +0000)]
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>
Lukas Wirth [Mon, 20 Sep 2021 21:53:05 +0000 (23:53 +0200)]
Rename some assists
bors[bot] [Sun, 19 Sep 2021 22:33:42 +0000 (22:33 +0000)]
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>
Lukas Wirth [Sun, 19 Sep 2021 22:22:30 +0000 (00:22 +0200)]
Don't bail on parse errors in macro input for builtin expansion
bors[bot] [Sun, 19 Sep 2021 21:46:51 +0000 (21:46 +0000)]
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>
bors[bot] [Sun, 19 Sep 2021 21:39:36 +0000 (21:39 +0000)]
Merge #10292
10292: minor: Simplify r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Sun, 19 Sep 2021 16:30:29 +0000 (18:30 +0200)]
Only strip derive attributes when preparing macro input
Lukas Wirth [Sun, 19 Sep 2021 21:34:07 +0000 (23:34 +0200)]
Simplify
bors[bot] [Sun, 19 Sep 2021 17:01:23 +0000 (17:01 +0000)]
Merge #10290
10290: minor: Simplify r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Sun, 19 Sep 2021 17:00:06 +0000 (19:00 +0200)]
Simplify
bors[bot] [Sun, 19 Sep 2021 13:35:46 +0000 (13:35 +0000)]
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>
Aleksey Kladov [Sun, 19 Sep 2021 13:35:10 +0000 (16:35 +0300)]
internal: more focused tests for const arguments
bors[bot] [Sun, 19 Sep 2021 11:51:38 +0000 (11:51 +0000)]
Merge #10283
10283: minor: simplify generics parsing r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sun, 19 Sep 2021 11:32:02 +0000 (14:32 +0300)]
minor: simplify
hamidreza kalbasi [Sun, 19 Sep 2021 11:45:44 +0000 (16:15 +0430)]
internal: definition based hover functions
Aleksey Kladov [Sun, 19 Sep 2021 11:26:35 +0000 (14:26 +0300)]
minor: simplify
bors[bot] [Sun, 19 Sep 2021 09:10:32 +0000 (09:10 +0000)]
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>
Aleksey Kladov [Sun, 19 Sep 2021 09:09:50 +0000 (12:09 +0300)]
fix: don't allow two turbo-fishes in generic arguments
bors[bot] [Sun, 19 Sep 2021 08:54:02 +0000 (08:54 +0000)]
Merge #10280
10280: internal: type argument parsing refactoring r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sun, 19 Sep 2021 08:42:10 +0000 (11:42 +0300)]
internal: add erroneous test for double turbo fish
We parse `f` successfully, but that is a bug.
Aleksey Kladov [Sun, 19 Sep 2021 08:34:25 +0000 (11:34 +0300)]
minor: improve readability
Aleksey Kladov [Sun, 19 Sep 2021 08:19:31 +0000 (11:19 +0300)]
minor: reduce duplication
bors[bot] [Sat, 18 Sep 2021 13:09:51 +0000 (13:09 +0000)]
Merge #10276
10276: internal: parser cleanup r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 18 Sep 2021 13:09:12 +0000 (16:09 +0300)]
fix: correctly handle jointness
Aleksey Kladov [Sat, 18 Sep 2021 12:56:26 +0000 (15:56 +0300)]
minor: improve readability
Aleksey Kladov [Sat, 18 Sep 2021 12:54:55 +0000 (15:54 +0300)]
internal: better naming
Aleksey Kladov [Sat, 18 Sep 2021 12:46:28 +0000 (15:46 +0300)]
internal: parser cleanup
Aleksey Kladov [Sat, 18 Sep 2021 12:22:49 +0000 (15:22 +0300)]
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.
bors[bot] [Sat, 18 Sep 2021 12:20:55 +0000 (12:20 +0000)]
Merge #10275
10275: internal: parser cleanups r=Veykril a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 18 Sep 2021 11:53:46 +0000 (14:53 +0300)]
internal: parser cleanups
bors[bot] [Sat, 18 Sep 2021 11:43:10 +0000 (11:43 +0000)]
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>
Aleksey Kladov [Sat, 18 Sep 2021 11:34:29 +0000 (14:34 +0300)]
internal: more focused trait item parsing tests
Lukas Wirth [Sat, 18 Sep 2021 11:19:29 +0000 (13:19 +0200)]
Make inlay hints work in attributed items
bors[bot] [Sat, 18 Sep 2021 10:00:47 +0000 (10:00 +0000)]
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>
Lukas Wirth [Sat, 18 Sep 2021 09:59:57 +0000 (11:59 +0200)]
Add multi-token mapping test for goto_definition
bors[bot] [Sat, 18 Sep 2021 01:21:43 +0000 (01:21 +0000)]
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>
zhoufan [Sat, 18 Sep 2021 00:22:57 +0000 (08:22 +0800)]
do comment handling on the original token