Commit Graph

14561 Commits

Author SHA1 Message Date
Chinedu Francis Nwafili
47c5ec4b94
Use --workspace when loading extern resources
https://github.com/rust-analyzer/rust-analyzer/issues/5040#issuecomment-759853153
2021-01-14 06:03:41 -05:00
bors[bot]
d76143da19
Merge #7211
7211: Fixed expr meta var after path colons in mbe r=matklad a=edwin0cheng

Fixes #7207

Added `L_DOLLAR` in `ITEM_RECOVERY_SET` , but I don't know whether it is a good idea.

r? @matklad 

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2021-01-14 10:52:12 +00:00
bors[bot]
d635806ea5
Merge #7257
7257: vfs documentation r=matklad a=arnaudgolfouse

This documents every item in the `vfs` crate, except for a few private, windows-specific items.

Co-authored-by: Arnaud <arnaud.golfouse@free.fr>
2021-01-14 10:13:57 +00:00
bors[bot]
184f4cbf5d
Merge #7110
7110: Deduplicate macros when offering completion r=matklad a=AdnoC

Closes https://github.com/rust-analyzer/rust-analyzer/issues/7081

When iterating over the names within the `hir_def::resolver::Scope` for a module, track what macros are in the `hir_def::item_scope::ItemScope::legacy_macros` collection for the module. When iterating over names from the prelude, do not proccess the name if it had been in the `legacy_macros` collection.

This is implemented with a `FxHashSet` in the `Scope::process_names` function that is populated when iterating over `legacy_macros` and checked when iterating over the prelude.

Alternative implementation could instead query the `legacy_macros` `FxHashMap` directly when processing names in the prelude.

Also, I'd like to add a test for this, but I'm not sure where it could be added.

Co-authored-by: AdnoC <adam.r.cutler@gmail.com>
2021-01-14 10:00:46 +00:00
bors[bot]
39167b97d8
Merge #7260
7260: Render Fn* trait objects and impl types as rust does r=matklad a=Veykril

Also fixes raw ptr impl types being rendered ambiguously with multiple predicates.
This moves out the `FamousDefs::Fixture` into its own file as well, cause I figured it is big enough to get its own file at this point + we also get highlighting this way when editing it.

Fixes #3012

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-01-14 09:07:15 +00:00
bors[bot]
6835f2e37c
Merge #6809
6809: Add quick fix to sort impl methods by trait definition r=fisherdarling a=fisherdarling

Closes  #6110

Co-authored-by: Fisher Darling <fdarlingco@gmail.com>
2021-01-13 23:22:34 +00:00
Fisher Darling
ba00bb4af9 Sort impls by trait definition
Closes #6110
2021-01-13 16:04:37 -07:00
bors[bot]
dab210d9b2
Merge #7263
7263: Use upstream TextSize API r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-01-13 18:35:08 +00:00
Aleksey Kladov
3d78f502bd Use upstream TextSize API 2021-01-13 21:32:24 +03:00
bors[bot]
42e00032c6
Merge #7220
7220: same level folder rename for will_rename_files r=kjeremy a=ShuiRuTian

use tricky way to support folder rename.

Another step after #7009 and for #4471

Co-authored-by: ShuiRuTian <158983297@qq.com>
Co-authored-by: Song Gao <158983297@qq.com>
2021-01-13 17:40:45 +00:00
ShuiRuTian
727a7827fd fix windows test. 2021-01-13 22:56:31 +08:00
Lukas Wirth
3d6480bc31 Render Fn* trait objects and impl types as rust does 2021-01-13 13:29:47 +01:00
bors[bot]
f84f5cb0ea
Merge #7262
7262: Don't show internal server error on rename r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-01-13 12:09:26 +00:00
Aleksey Kladov
f0e802f490 Don't show internal server error on rename
Doesn't quite work due to https://github.com/microsoft/vscode-languageserver-node/issues/730

Note that this intentionally removes `impl std::Error for RenameError`
-- we nether want to blindly bubble the rename error.
2021-01-13 15:07:30 +03:00
bors[bot]
e41b363027
Merge #7251
7251: Group references by FileId r=matklad a=Veykril

Fixes #4901

This doesn't address https://github.com/rust-analyzer/rust-analyzer/pull/7032/files#diff-a7e1e771e911237bb893e1b0f5e0f2c2a856b54ca06f95ef0818a922f1a8b5ebR266

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-01-13 10:38:30 +00:00
ShuiRuTian
76e6589016 unwrap. 2021-01-13 12:10:45 +08:00
Arnaud
4b71c8332d Document vfs private items 2021-01-12 18:01:47 +01:00
Arnaud
311ec70d03 Document vfs public items 2021-01-12 18:01:36 +01:00
ShuiRuTian
6a15876fc4 skip slow tests. 2021-01-13 00:58:28 +08:00
ShuiRuTian
5f8fa66b77 use path rather than hard code. 2021-01-13 00:53:17 +08:00
ShuiRuTian
e1c9c9b604 fix and add tests. 2021-01-13 00:30:49 +08:00
Lukas Wirth
e9e3ab549d Move FamousDefs fixture out into its own file 2021-01-12 17:26:08 +01:00
Lukas Wirth
aff9102afb Rename FileReferences -> UsageSearchResult 2021-01-12 15:56:24 +01:00
Lukas Wirth
2c1777a2e2 Ensure uniqueness of file ids in reference search via hashmap 2021-01-12 15:51:02 +01:00
Lukas Wirth
fbdb32adfc Group references by FileId 2021-01-12 01:03:04 +01:00
bors[bot]
52fa926f00
Merge #7250
7250: Improve analysis stats legibility r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-01-11 19:18:34 +00:00
Aleksey Kladov
9fd4e5c66c Improve analysis stats legibility 2021-01-11 22:17:30 +03:00
bors[bot]
5a0b8a2714
Merge #7249
7249: Add build benchmark xtask command r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-01-11 18:40:23 +00:00
Aleksey Kladov
c62f1c762f Add build benchmark xtask command 2021-01-11 21:39:16 +03:00
ShuiRuTian
cf3042f881 format 2021-01-12 00:21:43 +08:00
ShuiRuTian
d877390882 fix as suggestion. 2021-01-12 00:21:03 +08:00
Song Gao
1b004dcf88
Update crates/rust-analyzer/src/handlers.rs
Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2021-01-12 00:16:12 +08:00
Song Gao
497e9da433
Update crates/rust-analyzer/src/handlers.rs
Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2021-01-12 00:15:56 +08:00
bors[bot]
3aa153b46c
Merge #7247
7247: cargo update r=kjeremy a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
2021-01-11 14:08:00 +00:00
kjeremy
d229f0a1b2 cargo update 2021-01-11 09:06:30 -05:00
bors[bot]
8ad325a806
Merge #7051 #7219 #7245 #7246
7051: Check dbg! macro in tidy_test r=matklad a=edwin0cheng

Same as `check_todo` but for dbg! macro

r? @matklad 

7219: Refactor rename name checking r=matklad a=Veykril

Improves the user facing error messages a bit and prevents renaming to `_` when the name is referenced as this would change source to not compile anymore since `_` is only a pattern, not a proper identifier.

7245: Encourage gifs r=matklad a=matklad

bors r+
🤖

7246: Unfreeze cargo_metadata r=matklad a=kjeremy

It now pulls in a newer version of semver-parser.

This does add a dependency on `cargo-platform` in the interest of correctness.

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Co-authored-by: kjeremy <kjeremy@gmail.com>
2021-01-11 13:37:28 +00:00
Aleksey Kladov
2d0464a6f3 Encourage gifs 2021-01-11 16:29:29 +03:00
kjeremy
1da68e87af Unfreeze cargo_metadata
It now pulls in a newer version of semver-parser.
2021-01-11 08:27:16 -05:00
bors[bot]
b84c49b9af
Merge #7244
7244: Goto for inner doc links works for module inner doc comments r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-01-11 13:25:51 +00:00
Aleksey Kladov
8adf5cc0e3 Goto for inner doc links works for module inner doc comments 2021-01-11 16:24:50 +03:00
bors[bot]
8c33ffecc1
Merge #7235
7235: Postfix completions like ifl now works with references r=Veykril a=Maan2003

Closes #7230 

Co-authored-by: Manmeet <manmeetmann2003@gmail.com>
Co-authored-by: Manmeet Maan <manmeetmann2003@gmail.com>
2021-01-11 11:27:54 +00:00
ShuiRuTian
f7cb9e9fbe move logic from client to server. 2021-01-11 14:45:35 +08:00
Manmeet Maan
f05c14594a Fix formatting 2021-01-11 11:47:38 +05:30
Manmeet Maan
430dc5cd24 Apply Suggestions from code review 2021-01-11 11:32:55 +05:30
Lukas Wirth
f7af0b4b96 Add some more marks to rename tests 2021-01-11 00:28:21 +01:00
Lukas Wirth
2347944aae Use local error macros in references/rename 2021-01-10 21:59:44 +01:00
bors[bot]
60c501fa19
Merge #7241
7241: Honor client's dynamic registration caps r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-01-10 19:41:06 +00:00
Aleksey Kladov
bb453edebe Honor client's dynamic registration caps
cc https://github.com/rust-analyzer/rust-analyzer/pull/5516#issuecomment-757520828
2021-01-10 22:38:35 +03:00
bors[bot]
607b9ea160
Merge #7218
7218: Fix typos r=Veykril a=regexident

Apart from the very last commit on this PR (which fixes a public type's name) all changes are non-breaking.

Co-authored-by: Vincent Esche <regexident@gmail.com>
2021-01-10 18:16:29 +00:00
bors[bot]
3e32e39da7
Merge #7240
7240: Make default memory stats less verbose r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-01-10 17:59:06 +00:00