]>
git.lizzy.rs Git - rust.git/log
Lukas Wirth [Tue, 22 Feb 2022 09:45:29 +0000 (10:45 +0100)]
simplify and document
Lukas Wirth [Mon, 21 Feb 2022 12:34:05 +0000 (13:34 +0100)]
Simplify
Lukas Wirth [Mon, 21 Feb 2022 12:21:25 +0000 (13:21 +0100)]
Fix syntax highlighting not highlighting derives anymore
Lukas Wirth [Mon, 21 Feb 2022 11:57:57 +0000 (12:57 +0100)]
Make replace_derive_with_manual_impl work again
Lukas Wirth [Mon, 21 Feb 2022 10:51:53 +0000 (11:51 +0100)]
Fix `expand_macro` not working for derive attributes
Lukas Wirth [Mon, 21 Feb 2022 01:42:58 +0000 (02:42 +0100)]
internal: Expand the derive attribute into a pseudo expansion
bors[bot] [Tue, 22 Feb 2022 09:08:22 +0000 (09:08 +0000)]
Merge #11527
11527: internal: Split unresolve proc-macro error out of mbe r=Veykril a=Veykril
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Mon, 21 Feb 2022 18:14:06 +0000 (19:14 +0100)]
internal: Split unresolve proc-macro error out of mbe
bors[bot] [Tue, 22 Feb 2022 08:56:34 +0000 (08:56 +0000)]
Merge #11525
11525: fix(assist): Drop generic args in path before insert use in `replace_qualified_name_with_use` r=Veykril a=tysg
Fixes #11505. also removed an unnecessary `clone_for_update` call.
Co-authored-by: Tianyi Song <42670338+tysg@users.noreply.github.com>
bors[bot] [Tue, 22 Feb 2022 08:38:57 +0000 (08:38 +0000)]
Merge #11524
11524: doc: state that only the latest stable toolchain is supported r=lnicola a=jtroo
This closes #11226. The content seemed to make more sense in the
installation section as opposed to the Troubleshooting section.
Co-authored-by: Jan Tache <j.andreitabs@gmail.com>
Tianyi Song [Fri, 28 Jan 2022 08:15:23 +0000 (16:15 +0800)]
Drop generic args in path before insert use
Jan Tache [Tue, 22 Feb 2022 07:01:05 +0000 (23:01 -0800)]
Change Rust Analyzer->rust-analyzer to match style
Jan Tache [Tue, 22 Feb 2022 06:37:19 +0000 (22:37 -0800)]
doc: state that only the latest stable toolchain is supported
This closes #11226. The content seemed to make more sense in the
installation section as opposed to the Troubleshooting section.
bors[bot] [Mon, 21 Feb 2022 21:57:44 +0000 (21:57 +0000)]
Merge #11490
11490: Correctly fix formatting doc tests with generics r=Veykril a=KarlWithK
Before the doc_test would be outputted like this:
```zsh
"Foo<T, U>::t"
```
However, this would cause problems with shell redirection. I've changed it
so when generics are involved we simply wrap the expression under quotes as so:
```zsh
"\"Foo<T, U>::t\""
```
Note:
At the cost of adding this, I had to allocate a new string via
`format!{}`. However, I argue this is alright as this for just for
outputting the name of the doc test.
The following tests have been changed:
```
runnables::tests::doc_test_type_params
runnables::tests::test_doc_runnables_impl_mod
runnables::tests::test_runnables_doc_test_in_impl
```
Closes https://github.com/rust-analyzer/rust-analyzer/issues/11489
Co-authored-by: KarlWithK <jocelinc60@outlook.com>
Co-authored-by: SeniorMars <jocelinc60@outlook.com>
SeniorMars [Mon, 21 Feb 2022 21:23:09 +0000 (15:23 -0600)]
Update crates/ide/src/runnables.rs
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
bors[bot] [Mon, 21 Feb 2022 17:08:19 +0000 (17:08 +0000)]
Merge #11522
11522: fix: Make code lenses work on attributed items r=Veykril a=Veykril
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11213
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Mon, 21 Feb 2022 17:07:47 +0000 (18:07 +0100)]
fix: Make code lenses work on attributed items
bors[bot] [Mon, 21 Feb 2022 16:56:37 +0000 (16:56 +0000)]
Merge #11455
11455: Handle proc-macro functions as the proc-macro they resolve to r=Veykril a=Veykril
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11212
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Mon, 21 Feb 2022 16:56:11 +0000 (17:56 +0100)]
Move fn to proc-macro conversion to name classification
bors[bot] [Mon, 21 Feb 2022 13:08:31 +0000 (13:08 +0000)]
Merge #11481
11481: Display parameter names when hovering over a function pointer r=Veykril a=Vannevelj
Implements #11474
The idea is pretty straightforward: previously we constructed the hover based on just the parameter types, now we pass in the parameter names as well. I went for a quick-hit approach here but I expect someone will be able to point me to a better way of resolving the identifier.
I haven't figured out yet how to actually run my rust-analyzer locally so I can see it in action but the unit test indicates it should work.
Co-authored-by: Jeroen Vannevel <jer_vannevel@outlook.com>
bors[bot] [Mon, 21 Feb 2022 12:52:11 +0000 (12:52 +0000)]
Merge #11517
11517: fix: Fix qualfiied record literal completion triggering too eagerly r=Veykril a=Veykril
Supercedes https://github.com/rust-analyzer/rust-analyzer/pull/10909
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10889
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Mon, 21 Feb 2022 12:50:16 +0000 (13:50 +0100)]
fix: Fix qualfiied record literal completion triggering too eagerly
bors[bot] [Mon, 21 Feb 2022 12:44:10 +0000 (12:44 +0000)]
Merge #11516
11516: fix: Don't count commas when looking for the derive attribute in diagnostics r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Mon, 21 Feb 2022 12:43:42 +0000 (13:43 +0100)]
fix: Don't count commas when looking for the derive attribute in diagnostics
Jeroen Vannevel [Mon, 21 Feb 2022 10:29:38 +0000 (10:29 +0000)]
parameters.split_last()
bors[bot] [Mon, 21 Feb 2022 10:29:16 +0000 (10:29 +0000)]
Merge #11142
11142: Updated the Sublime Text section r=Veykril a=AmjadHD
rust-analyzer/rust-analyzer.github.io#160
Co-authored-by: Amjad Ben Hedhili <amjadhedhili@outlook.com>
bors[bot] [Mon, 21 Feb 2022 10:21:39 +0000 (10:21 +0000)]
Merge #11424
11424: Pass required features to cargo when using run action r=Veykril a=WaffleLapkin
When using `F1`->`Rust Analyzer: Run` action on an `example`, pass its `required-features` to `cargo run`. This allows to run examples that were otherwise impossible to run with RA.
Co-authored-by: Maybe Waffle <waffle.lapkin@gmail.com>
bors[bot] [Mon, 21 Feb 2022 09:31:38 +0000 (09:31 +0000)]
Merge #11375
11375: feat: Support if- and while- let chains r=Veykril a=ChayimFriedman2
Closes #11320.
Co-authored-by: Chayim Refael Friedman <chayimfr@gmail.com>
bors[bot] [Mon, 21 Feb 2022 09:23:20 +0000 (09:23 +0000)]
Merge #11514
11514: chore(manual): update coc-rust-analyzer manual r=Veykril a=fannheyward
Semantic tokens highlighting is added in coc.nvim now.
Co-authored-by: Heyward Fann <fannheyward@users.noreply.github.com>
Chayim Refael Friedman [Mon, 21 Feb 2022 06:15:21 +0000 (08:15 +0200)]
Change `single_let()` and `is_pattern_cond()` to free functions
Chayim Refael Friedman [Tue, 1 Feb 2022 09:35:36 +0000 (11:35 +0200)]
Upgrade ungrammar to 1.15.0
Chayim Refael Friedman [Sun, 30 Jan 2022 10:23:36 +0000 (12:23 +0200)]
Validate `let` expressions
Emit an error if they're found in an invalid position.
Chayim Refael Friedman [Mon, 24 Jan 2022 02:50:07 +0000 (04:50 +0200)]
Update tests
Unfortunately, we lost some recovery for expressions.
Chayim Refael Friedman [Sun, 23 Jan 2022 22:37:59 +0000 (00:37 +0200)]
Fix various IDE features
As a side benefit, we got `let` guard support for `move_guard` for free.
Chayim Refael Friedman [Sun, 23 Jan 2022 03:59:35 +0000 (05:59 +0200)]
Type-inference for `let` expressions
Chayim Refael Friedman [Sun, 23 Jan 2022 03:39:26 +0000 (05:39 +0200)]
Lower `let` expressions
Chayim Refael Friedman [Sun, 23 Jan 2022 02:21:09 +0000 (04:21 +0200)]
Parse `let` expressions in order to support `let` chains
We still need to reject freestanding `let` expressions: see https://github.com/rust-analyzer/rust-analyzer/issues/11320#issuecomment-
1018212465 .
Heyward Fann [Mon, 21 Feb 2022 03:04:39 +0000 (11:04 +0800)]
chore(manual): update coc-rust-analyzer manual
Semantic tokens highlighting is added now
bors[bot] [Sun, 20 Feb 2022 23:16:59 +0000 (23:16 +0000)]
Merge #11512
11512: internal: Remove `name` fields from `MacroCallKind` r=Veykril a=Veykril
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Sun, 20 Feb 2022 23:02:10 +0000 (00:02 +0100)]
internal: Remove name fields from MacroCallKind
bors[bot] [Sun, 20 Feb 2022 21:54:12 +0000 (21:54 +0000)]
Merge #11511
11511: internal: Wrap MacroCallKind::Attr attr_args field in an Arc r=Veykril a=Veykril
This is stored in `MacroCallLoc` which is returned from a query, so cloning should be made cheap.
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Sun, 20 Feb 2022 21:53:04 +0000 (22:53 +0100)]
internal: Wrap MacroCallKind::Attr attr_args field in an Arc
bors[bot] [Sat, 19 Feb 2022 10:09:22 +0000 (10:09 +0000)]
Merge #11504
11504: Fix a typo in server_capabilities.experimental r=lnicola a=nemethf
Commit
27c4be6b4f68 wasn't really complex, but I still managed to make a mistake there, which this PR fixes. Sorry.
Co-authored-by: Felicián Németh <felician.nemeth@gmail.com>
Felicián Németh [Sat, 19 Feb 2022 09:58:10 +0000 (10:58 +0100)]
Fix a typo in server_capabilities.experimental
bors[bot] [Fri, 18 Feb 2022 17:32:36 +0000 (17:32 +0000)]
Merge #11498
11498: minor: Update issue template r=lnicola a=lnicola
- remove fixed #11098
- ask about settings and environment variables
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
Laurențiu Nicola [Fri, 18 Feb 2022 17:30:15 +0000 (19:30 +0200)]
Update issue template
Jeroen Vannevel [Fri, 18 Feb 2022 09:12:52 +0000 (09:12 +0000)]
re-added FIXME
KarlWithK [Fri, 18 Feb 2022 02:27:37 +0000 (20:27 -0600)]
Correctly fix formatting doc tests with generics
Before the doc_test would be outputted like this:
"Foo<T, U>::t"
However, this would cause shells with shell redirection. I've changed it
so when generics are involved we simply wrap the expression under escape
chanters as so:
"\"Foo<T, U>::t\""
Note:
At the cost of adding this, I had to allocate a new string via
format!{}. However, I argue this is alright as this for just for
outputting the name of the doc test.
The following tests have been changed:
runnables::tests::doc_test_type_params
runnables::tests::test_doc_runnables_impl_mod
runnables::tests::test_runnables_doc_test_in_impl
bors[bot] [Wed, 16 Feb 2022 15:13:54 +0000 (15:13 +0000)]
Merge #11484
11484: Infer the array size for slice patterns r=flodiebold a=ChayimFriedman2
Fixes #11478 (feat or fix?),
I don't know much about the type-checking in RA, so maybe I did some obvious mistake.
Co-authored-by: Chayim Refael Friedman <chayimfr@gmail.com>
Chayim Refael Friedman [Wed, 16 Feb 2022 11:21:21 +0000 (11:21 +0000)]
Infer the array size for slice patterns
Jeroen Vannevel [Tue, 15 Feb 2022 19:37:24 +0000 (19:37 +0000)]
removed double map
Jeroen Vannevel [Tue, 15 Feb 2022 19:27:56 +0000 (19:27 +0000)]
simplified write
Jeroen Vannevel [Tue, 15 Feb 2022 19:22:36 +0000 (19:22 +0000)]
test names
Jeroen Vannevel [Tue, 15 Feb 2022 19:20:50 +0000 (19:20 +0000)]
add test for function pointer without identifier
Jeroen Vannevel [Tue, 15 Feb 2022 19:12:23 +0000 (19:12 +0000)]
use Name instead of String
Jeroen Vannevel [Tue, 15 Feb 2022 14:58:06 +0000 (14:58 +0000)]
removed unwrap
Jeroen Vannevel [Tue, 15 Feb 2022 14:55:21 +0000 (14:55 +0000)]
cleaning
Jeroen Vannevel [Tue, 15 Feb 2022 14:47:51 +0000 (14:47 +0000)]
fmt
Jeroen Vannevel [Tue, 15 Feb 2022 14:47:23 +0000 (14:47 +0000)]
cleanup
Jeroen Vannevel [Tue, 15 Feb 2022 14:39:22 +0000 (14:39 +0000)]
rough, but appears to work
bors[bot] [Tue, 15 Feb 2022 09:36:22 +0000 (09:36 +0000)]
Merge #11475
11475: Impr mbe: remove unecessary temporary vec r=bellau a=bellau
It's a micro optimization. I don't know if it's really necessary (less alloc is always better).
Co-authored-by: bellau <laurent.belmonte@gmail.com>
bors[bot] [Tue, 15 Feb 2022 09:29:28 +0000 (09:29 +0000)]
Merge #11480
11480: fix: keyword hover works on non-keyword tokens if expanded to keyword r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
bellau [Mon, 14 Feb 2022 20:06:13 +0000 (21:06 +0100)]
Impr mbe: remove unecessary temporary vec
Lukas Wirth [Tue, 15 Feb 2022 09:09:19 +0000 (10:09 +0100)]
fix: keyword hover works on non-keyword tokens if expanded to keyword
bors[bot] [Tue, 15 Feb 2022 01:50:25 +0000 (01:50 +0000)]
Merge #11477
11477: fix: Fix cases where `Merge Imports` would drop imports. r=DropDemBits a=DropDemBits
Fixes #11466
Co-authored-by: DropDemBits <r3usrlnd@gmail.com>
DropDemBits [Tue, 15 Feb 2022 01:41:01 +0000 (20:41 -0500)]
Apply review fixes
DropDemBits [Tue, 15 Feb 2022 00:41:49 +0000 (19:41 -0500)]
fix: Don't drop glob with nested self
DropDemBits [Mon, 14 Feb 2022 23:46:16 +0000 (18:46 -0500)]
fix: Don't drop tree when the other has `self`
bors[bot] [Mon, 14 Feb 2022 21:07:41 +0000 (21:07 +0000)]
Merge #11369
11369: feat: Add type hint for keyword expression hovers r=Veykril a=danii
Adds the return type of keywords to tool-tips where it makes sense. This applies to: `if`, `else`, `match`, `loop`, `unsafe` and `await`. Thanks to `@Veykril` for sharing the idea of putting return type highlighting on other keywords!
![image](https://user-images.githubusercontent.com/
39541871 /
151611737 -
12325c23 -a1f9-4fca-ae48-
279b374bdcdf .png)
Closes #11359
Co-authored-by: Daniel Conley <himself@danii.dev>
Daniel Conley [Mon, 14 Feb 2022 20:26:40 +0000 (15:26 -0500)]
Hide Keyword Expression Hover For Units `()`
Cleaned up the code for keyword expression hovers.
Added a check to hide units `()` in keyword expression hovers.
bors[bot] [Mon, 14 Feb 2022 17:35:12 +0000 (17:35 +0000)]
Merge #11458
11458: Fix Immovable generator syntax (static ||) not recognized #11448 r=Veykril a=bellau
Co-authored-by: bellau <laurent.belmonte@gmail.com>
bors[bot] [Mon, 14 Feb 2022 12:05:21 +0000 (12:05 +0000)]
Merge #11470
11470: correct the description of Struct GlobalState r=lnicola a=doki23
Fixes #11469
The description of GlobalState should be 'more than one impl'
Co-authored-by: doki <11144133+doki23@users.noreply.github.com>
doki [Mon, 14 Feb 2022 11:30:21 +0000 (19:30 +0800)]
correct the description of Struct GlobalState
bellau [Mon, 14 Feb 2022 06:41:50 +0000 (07:41 +0100)]
Fix style
bors[bot] [Sun, 13 Feb 2022 16:15:37 +0000 (16:15 +0000)]
Merge #11464
11464: minor: Bump deps r=lnicola a=lnicola
bors r+
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
Laurențiu Nicola [Sat, 12 Feb 2022 07:25:26 +0000 (09:25 +0200)]
Bump deps
bors[bot] [Sun, 13 Feb 2022 12:43:16 +0000 (12:43 +0000)]
Merge #11442 #11460
11442: fix(rename): Use text range of a mod name after macro expansion r=Veykril a=tysg
Fixes #11417.
11460: fix: documentation of SsrParams r=Veykril a=nemethf
Fix #11429 by extending the documentation of SsrParms with the
mandatory field 'selections'. Copy its description from lsp_ext.rs.
Co-authored-by: Tianyi Song <42670338+tysg@users.noreply.github.com>
Co-authored-by: Felicián Németh <felician.nemeth@gmail.com>
bors[bot] [Sun, 13 Feb 2022 12:35:11 +0000 (12:35 +0000)]
Merge #11459
11459: fix: add missing experimental capabilities r=Veykril a=nemethf
Fix #11389 by extending server_capabilities.experimental with
matchingBrace, externalDocs, moveItems. Also, sort entries
alphabetically.
Co-authored-by: Felicián Németh <felician.nemeth@gmail.com>
Tianyi Song [Sun, 13 Feb 2022 10:14:39 +0000 (18:14 +0800)]
Address PR comments
bellau [Sun, 13 Feb 2022 08:11:35 +0000 (09:11 +0100)]
oops, remove println
bellau [Sun, 13 Feb 2022 08:09:44 +0000 (09:09 +0100)]
fix handle static async and static async move
bellau [Sat, 12 Feb 2022 16:31:17 +0000 (17:31 +0100)]
Fix style
bellau [Sat, 12 Feb 2022 15:07:58 +0000 (16:07 +0100)]
support static move too
Felicián Németh [Sat, 12 Feb 2022 14:47:54 +0000 (15:47 +0100)]
fix: documentation of SsrParams
Fix #11429 by extending the documentation of SsrParms with the
mandatory field 'selections'. Copy its description from lsp_ext.rs.
Felicián Németh [Sat, 12 Feb 2022 14:32:43 +0000 (15:32 +0100)]
fix: add missing experimental capabilities
Fix #11389 by extending server_capabilities.experimental with
matchingBrace, externalDocs, moveItems. Also, sort entries
alphabetically.
bellau [Sat, 12 Feb 2022 14:35:06 +0000 (15:35 +0100)]
Fix styles
bellau [Sat, 12 Feb 2022 14:17:10 +0000 (15:17 +0100)]
Fix Immovable generator syntax (static ||) not recognized #11448
bors[bot] [Sat, 12 Feb 2022 12:48:46 +0000 (12:48 +0000)]
Merge #11444
11444: feat: Fix up syntax errors in attribute macro inputs to make completion work more often r=flodiebold a=flodiebold
This implements the "fix up syntax nodes" workaround mentioned in #11014. It isn't much more than a proof of concept; I have only implemented a few cases, but it already helps quite a bit.
Some notes:
- I'm not super happy about how much the fixup procedure needs to interact with the syntax node -> token tree conversion code (e.g. needing to share the token map). This could maybe be simplified with some refactoring of that code.
- It would maybe be nice to have the fixup procedure reuse or share information with the parser, though I'm not really sure how much that would actually help.
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
bors[bot] [Fri, 11 Feb 2022 21:21:57 +0000 (21:21 +0000)]
Merge #11453
11453: internal: Make `ascend_call_token` iterative instead of recursive r=Veykril a=Veykril
bors r+
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Fri, 11 Feb 2022 21:12:16 +0000 (22:12 +0100)]
internal: Make `ascend_call_token` iterative instead of recursive
Lukas Wirth [Fri, 11 Feb 2022 21:06:03 +0000 (22:06 +0100)]
Handle proc-macro functions as the proc-macro they resolve to
Tianyi Song [Fri, 28 Jan 2022 08:15:23 +0000 (16:15 +0800)]
Use text range of name after macro expansion
Florian Diebold [Wed, 9 Feb 2022 16:52:15 +0000 (17:52 +0100)]
Format again
Florian Diebold [Wed, 9 Feb 2022 16:43:37 +0000 (17:43 +0100)]
Reduce visibility
Florian Diebold [Wed, 9 Feb 2022 15:36:06 +0000 (16:36 +0100)]
Add back an assertion
Florian Diebold [Wed, 9 Feb 2022 15:30:10 +0000 (16:30 +0100)]
Various fixes
Florian Diebold [Wed, 9 Feb 2022 11:00:03 +0000 (12:00 +0100)]
Rename syntax_node_to_token_tree_censored
Florian Diebold [Wed, 9 Feb 2022 10:58:52 +0000 (11:58 +0100)]
Replace expressions with errors in them
bors[bot] [Wed, 9 Feb 2022 07:24:33 +0000 (07:24 +0000)]
Merge #11441
11441: minor: Bump deps r=lnicola a=lnicola
bors r+
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
Laurențiu Nicola [Wed, 9 Feb 2022 07:22:25 +0000 (09:22 +0200)]
Bump lsp-types