]>
git.lizzy.rs Git - rust.git/log
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
bors[bot] [Fri, 17 Sep 2021 22:44:39 +0000 (22:44 +0000)]
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>
bors[bot] [Fri, 17 Sep 2021 22:05:16 +0000 (22:05 +0000)]
Merge #10270
10270: intenral: more item parsing cleanup r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Fri, 17 Sep 2021 22:02:43 +0000 (01:02 +0300)]
intenral: more local tests for statics
Aleksey Kladov [Fri, 17 Sep 2021 21:58:35 +0000 (00:58 +0300)]
minor: cleanup const parsing
Aleksey Kladov [Fri, 17 Sep 2021 21:54:03 +0000 (00:54 +0300)]
minor: better test placement
Aleksey Kladov [Fri, 17 Sep 2021 21:50:27 +0000 (00:50 +0300)]
internal: cleanup adt parsing
bors[bot] [Fri, 17 Sep 2021 21:39:06 +0000 (21:39 +0000)]
Merge #10269
10269: internal: cleanup item parsing r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Fri, 17 Sep 2021 21:33:42 +0000 (00:33 +0300)]
internal: cleanup item parsing
Aleksey Kladov [Fri, 17 Sep 2021 21:14:20 +0000 (00:14 +0300)]
minor: parser cleanup
bors[bot] [Fri, 17 Sep 2021 20:35:02 +0000 (20:35 +0000)]
Merge #10268
10268: intenral: simplify parser r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Fri, 17 Sep 2021 20:31:37 +0000 (23:31 +0300)]
minor: simplify
rainy-me [Fri, 17 Sep 2021 20:27:24 +0000 (05:27 +0900)]
Narrow "if-let to match" assist available range
Aleksey Kladov [Fri, 17 Sep 2021 20:27:26 +0000 (23:27 +0300)]
minor: cleanup
bors[bot] [Fri, 17 Sep 2021 19:27:32 +0000 (19:27 +0000)]
Merge #10265
10265: internal: parser cleanups r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Fri, 17 Sep 2021 19:26:39 +0000 (22:26 +0300)]
minor: simplify
Aleksey Kladov [Fri, 17 Sep 2021 19:21:07 +0000 (22:21 +0300)]
internal: more local parsing tests for macros
Aleksey Kladov [Fri, 17 Sep 2021 19:15:12 +0000 (22:15 +0300)]
internal: more focused parsing tests
Aleksey Kladov [Fri, 17 Sep 2021 18:53:24 +0000 (21:53 +0300)]
internal: more local test for mod item
Aleksey Kladov [Fri, 17 Sep 2021 18:49:01 +0000 (21:49 +0300)]
internal: more local parsing tests
Aleksey Kladov [Fri, 17 Sep 2021 18:40:28 +0000 (21:40 +0300)]
internal: parser cleanups
bors[bot] [Fri, 17 Sep 2021 18:35:36 +0000 (18:35 +0000)]
Merge #10260
10260: fix: fix names generation in `Generate function` r=Veykril a=iDawer
- Improve fn name computation (close #10176).
- Handle tuple indexing expressions in argument position (should close #10241)
Co-authored-by: Dawer <7803845+iDawer@users.noreply.github.com>
bors[bot] [Fri, 17 Sep 2021 18:28:55 +0000 (18:28 +0000)]
Merge #10264
10264: fix: Don't seek outside of character boundaries in completion handler r=Veykril a=iDawer
Fixes #10219 panic when entering `:` in `$0` places:
```rust
fn main() {
"⊞$0";
}
```
```rust
struct S {
д$0 u8
}
```
Co-authored-by: Dawer <7803845+iDawer@users.noreply.github.com>
Dawer [Fri, 17 Sep 2021 18:04:20 +0000 (23:04 +0500)]
fix completion handler trying to seek outside of character boundaries.
With this patch, in these examples
```rust
fn main() {
"⊞$0";
}
```
```rust
struct S {
д$0 u8
}
```
entering ':' character in `$0` places shouldn't cause panics.
bors[bot] [Thu, 16 Sep 2021 21:04:42 +0000 (21:04 +0000)]
Merge #10257
10257: assists: turn while into loop r=Veykril a=agluszak
Implements an assist to turn a `while` loop into a `loop` loop, as requested in #10214.
I'm not sure sure what the guidelines are regarding naming assists convert_x_to_y vs replace_x_with_y.
This is my first commit to rust-analyzer :D Thank you `@matklad` for your awesome Explaining rust-analyzer series <3
Closes #10214
Co-authored-by: Andrzej Głuszak <gluszak.andrzej@gmail.com>
Andrzej Głuszak [Thu, 16 Sep 2021 13:36:44 +0000 (15:36 +0200)]
assists: turn while into loop
Dawer [Thu, 16 Sep 2021 18:45:41 +0000 (23:45 +0500)]
Handle tuple indexing expression in argument position in `Generate function`
Dawer [Thu, 16 Sep 2021 16:03:37 +0000 (21:03 +0500)]
Imrove fn name computation in `Generate function`
bors[bot] [Thu, 16 Sep 2021 05:27:24 +0000 (05:27 +0000)]
Merge #10254
10254: Fix a comment typo in autoderef.rs r=lnicola a=teor2345
There's a minor typo in a comment in autoderef.rs, although the meaning is clear if your pronounce the words out loud
Co-authored-by: teor <teor@riseup.net>
bors[bot] [Thu, 16 Sep 2021 05:19:38 +0000 (05:19 +0000)]
Merge #10251
10251: Fix typescript syntax errors r=lnicola a=Wilfred
Remove unwanted `:` and fix the naming of the boolean type.
Co-authored-by: Wilfred Hughes <me@wilfred.me.uk>
teor [Thu, 16 Sep 2021 03:47:01 +0000 (13:47 +1000)]
Fix a comment typo in autoderef.rs
zhoufan [Thu, 16 Sep 2021 01:44:22 +0000 (09:44 +0800)]
fix: multi-token mapping aware goto definition
Wilfred Hughes [Thu, 16 Sep 2021 00:53:36 +0000 (17:53 -0700)]
Fix typescript syntax errors
Remove unwanted `:` and fix the naming of the boolean type.
bors[bot] [Thu, 16 Sep 2021 00:26:32 +0000 (00:26 +0000)]
Merge #10250
10250: internal: Improve call_hierarchy and incoming/outgoing_calls r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Thu, 16 Sep 2021 00:25:02 +0000 (02:25 +0200)]
Improve call_hierarchy and incoming/outgoing_calls
bors[bot] [Wed, 15 Sep 2021 18:23:46 +0000 (18:23 +0000)]
Merge #10248
10248: internal: remove dead code r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 15 Sep 2021 18:22:06 +0000 (21:22 +0300)]
internal: remove dead code