]>
git.lizzy.rs Git - rust.git/log
bors[bot] [Thu, 14 Jan 2021 10:00:46 +0000 (10:00 +0000)]
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>
bors[bot] [Thu, 14 Jan 2021 09:07:15 +0000 (09:07 +0000)]
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>
bors[bot] [Wed, 13 Jan 2021 23:22:34 +0000 (23:22 +0000)]
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>
Fisher Darling [Thu, 10 Dec 2020 19:42:04 +0000 (12:42 -0700)]
Sort impls by trait definition
Closes #6110
bors[bot] [Wed, 13 Jan 2021 18:35:08 +0000 (18:35 +0000)]
Merge #7263
7263: Use upstream TextSize API r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 13 Jan 2021 17:10:46 +0000 (20:10 +0300)]
Use upstream TextSize API
bors[bot] [Wed, 13 Jan 2021 17:40:45 +0000 (17:40 +0000)]
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>
ShuiRuTian [Wed, 13 Jan 2021 14:56:31 +0000 (22:56 +0800)]
fix windows test.
Lukas Wirth [Tue, 12 Jan 2021 19:19:13 +0000 (20:19 +0100)]
Render Fn* trait objects and impl types as rust does
bors[bot] [Wed, 13 Jan 2021 12:09:26 +0000 (12:09 +0000)]
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>
Aleksey Kladov [Wed, 13 Jan 2021 11:09:51 +0000 (14:09 +0300)]
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.
bors[bot] [Wed, 13 Jan 2021 10:38:30 +0000 (10:38 +0000)]
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>
ShuiRuTian [Wed, 13 Jan 2021 04:10:45 +0000 (12:10 +0800)]
unwrap.
ShuiRuTian [Tue, 12 Jan 2021 16:58:28 +0000 (00:58 +0800)]
skip slow tests.
ShuiRuTian [Tue, 12 Jan 2021 16:53:17 +0000 (00:53 +0800)]
use path rather than hard code.
ShuiRuTian [Tue, 12 Jan 2021 16:30:49 +0000 (00:30 +0800)]
fix and add tests.
Lukas Wirth [Tue, 12 Jan 2021 16:26:08 +0000 (17:26 +0100)]
Move FamousDefs fixture out into its own file
Lukas Wirth [Tue, 12 Jan 2021 14:56:24 +0000 (15:56 +0100)]
Rename FileReferences -> UsageSearchResult
Lukas Wirth [Tue, 12 Jan 2021 14:51:02 +0000 (15:51 +0100)]
Ensure uniqueness of file ids in reference search via hashmap
Lukas Wirth [Mon, 11 Jan 2021 23:05:07 +0000 (00:05 +0100)]
Group references by FileId
bors[bot] [Mon, 11 Jan 2021 19:18:34 +0000 (19:18 +0000)]
Merge #7250
7250: Improve analysis stats legibility r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Mon, 11 Jan 2021 19:17:30 +0000 (22:17 +0300)]
Improve analysis stats legibility
bors[bot] [Mon, 11 Jan 2021 18:40:23 +0000 (18:40 +0000)]
Merge #7249
7249: Add build benchmark xtask command r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Mon, 11 Jan 2021 18:39:16 +0000 (21:39 +0300)]
Add build benchmark xtask command
ShuiRuTian [Mon, 11 Jan 2021 16:21:43 +0000 (00:21 +0800)]
format
ShuiRuTian [Mon, 11 Jan 2021 16:21:03 +0000 (00:21 +0800)]
fix as suggestion.
Song Gao [Mon, 11 Jan 2021 16:16:12 +0000 (00:16 +0800)]
Update crates/rust-analyzer/src/handlers.rs
Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
Song Gao [Mon, 11 Jan 2021 16:15:56 +0000 (00:15 +0800)]
Update crates/rust-analyzer/src/handlers.rs
Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
bors[bot] [Mon, 11 Jan 2021 14:08:00 +0000 (14:08 +0000)]
Merge #7247
7247: cargo update r=kjeremy a=kjeremy
Co-authored-by: kjeremy <kjeremy@gmail.com>
kjeremy [Mon, 11 Jan 2021 14:06:30 +0000 (09:06 -0500)]
cargo update
bors[bot] [Mon, 11 Jan 2021 13:37:28 +0000 (13:37 +0000)]
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>
Aleksey Kladov [Mon, 11 Jan 2021 13:29:29 +0000 (16:29 +0300)]
Encourage gifs
kjeremy [Mon, 11 Jan 2021 13:27:16 +0000 (08:27 -0500)]
Unfreeze cargo_metadata
It now pulls in a newer version of semver-parser.
bors[bot] [Mon, 11 Jan 2021 13:25:51 +0000 (13:25 +0000)]
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>
Aleksey Kladov [Mon, 11 Jan 2021 13:24:50 +0000 (16:24 +0300)]
Goto for inner doc links works for module inner doc comments
bors[bot] [Mon, 11 Jan 2021 11:27:54 +0000 (11:27 +0000)]
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>
ShuiRuTian [Mon, 11 Jan 2021 06:45:35 +0000 (14:45 +0800)]
move logic from client to server.
Manmeet Maan [Mon, 11 Jan 2021 06:17:38 +0000 (11:47 +0530)]
Fix formatting
Manmeet Maan [Mon, 11 Jan 2021 06:02:55 +0000 (11:32 +0530)]
Apply Suggestions from code review
Lukas Wirth [Sun, 10 Jan 2021 21:27:43 +0000 (22:27 +0100)]
Add some more marks to rename tests
Lukas Wirth [Sun, 10 Jan 2021 20:59:44 +0000 (21:59 +0100)]
Use local error macros in references/rename
bors[bot] [Sun, 10 Jan 2021 19:41:06 +0000 (19:41 +0000)]
Merge #7241
7241: Honor client's dynamic registration caps r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sun, 10 Jan 2021 19:38:35 +0000 (22:38 +0300)]
Honor client's dynamic registration caps
cc https://github.com/rust-analyzer/rust-analyzer/pull/5516#issuecomment-
757520828
bors[bot] [Sun, 10 Jan 2021 18:16:29 +0000 (18:16 +0000)]
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>
bors[bot] [Sun, 10 Jan 2021 17:59:06 +0000 (17:59 +0000)]
Merge #7240
7240: Make default memory stats less verbose r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sun, 10 Jan 2021 17:58:02 +0000 (20:58 +0300)]
Make default memory stats less verbose
Vincent Esche [Sun, 10 Jan 2021 16:12:02 +0000 (17:12 +0100)]
Updated tests via `cargo xtask codegen`
bors[bot] [Sun, 10 Jan 2021 16:31:32 +0000 (16:31 +0000)]
Merge #7239
7239: Replace SyntaxKind usage with T! macro where applicable r=lnicola a=Veykril
https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/dev/style.md#token-names
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Sun, 10 Jan 2021 15:40:52 +0000 (16:40 +0100)]
Replace SyntaxKind usage with T! macro where applicable
bors[bot] [Sun, 10 Jan 2021 16:04:06 +0000 (16:04 +0000)]
Merge #7238
7238: Fix typo, parentheses is plural r=lnicola a=lnicola
bors r+
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
Laurențiu Nicola [Sun, 10 Jan 2021 15:56:53 +0000 (17:56 +0200)]
Fix typo, parentheses is plural
bors[bot] [Sun, 10 Jan 2021 15:53:39 +0000 (15:53 +0000)]
Merge #7237
7237: Use T! for bool keywords r=matklad a=lnicola
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
Laurențiu Nicola [Sun, 10 Jan 2021 15:47:12 +0000 (17:47 +0200)]
Use T! for bool keywords
bors[bot] [Sun, 10 Jan 2021 15:09:21 +0000 (15:09 +0000)]
Merge #7236
7236: Fix progress token is already registered crash r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sun, 10 Jan 2021 15:02:02 +0000 (18:02 +0300)]
Fix progress token is already registered crash
After we started reporting progress when running cargo check during
loading, it is possible to crash the client with two identical progress
tokens.
This points to a deeper issue: we might be running several cargo checks
concurrently, which doesn't make sense.
This commit linearizes all workspace fetches, making sure no updates are
lost.
As an additional touch, it also normalizes progress & result reporting,
to make sure they stand in sync.
Manmeet [Sun, 10 Jan 2021 14:42:17 +0000 (20:12 +0530)]
Postfix like ifl now works with references
bors[bot] [Sun, 10 Jan 2021 14:06:03 +0000 (14:06 +0000)]
Merge #7234
7234: Allow `true` and `false` keywords in const generics r=lnicola a=callym
This should fix #7232 - hopefully I've done it right, it passes the tests and the rast file looks like it's picking up the true and false in the test
Co-authored-by: Callym <hi@callym.com>
Callym [Sun, 10 Jan 2021 13:58:09 +0000 (13:58 +0000)]
Allow `true` and `false` keywords in const generics
bors[bot] [Sun, 10 Jan 2021 12:45:07 +0000 (12:45 +0000)]
Merge #6238
6238: Split punctuation semantic highlighting up into more tags r=matklad a=Veykril
Open question would be the name of the delimiter modifiers. I chose them this was as I see them this way but from what I remember people tend to mix the names however they like. So maybe using `delimSquare`, `delimCurly`, `delimRound` would be better. That would also go well with `angle` becoming `delimAngle`?
Closes #6152
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Lukas Wirth [Sun, 10 Jan 2021 12:33:03 +0000 (13:33 +0100)]
Split punctuation semantic highlighting up into more tags
bors[bot] [Sun, 10 Jan 2021 11:45:59 +0000 (11:45 +0000)]
Merge #7206 #7231
7206: Use hir::GenericParam in ide_db::Definition instead of relisting all 3 r=Veykril a=Veykril
Basically just this:
```diff
pub enum Definition {
Macro(MacroDef),
Field(Field),
ModuleDef(ModuleDef),
SelfType(Impl),
Local(Local),
- TypeParam(TypeParam),
- LifetimeParam(LifetimeParam),
- ConstParam(ConstParam),
+ GenericParam(GenericParam),
Label(Label),
}
```
7231: Cleaner API r=matklad a=matklad
bors r+
🤖
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sun, 10 Jan 2021 11:36:15 +0000 (14:36 +0300)]
Cleaner API
bors[bot] [Sun, 10 Jan 2021 11:35:19 +0000 (11:35 +0000)]
Merge #7228
7228: Avoid string copy in complete_attribute r=Veykril a=lnicola
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
Lukas Wirth [Fri, 8 Jan 2021 11:28:02 +0000 (12:28 +0100)]
Use hir::GenericParam in ide_db::Definition instead of relisting all 3
bors[bot] [Sun, 10 Jan 2021 11:24:52 +0000 (11:24 +0000)]
Merge #7229
7229: Cleanup r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sun, 10 Jan 2021 11:24:01 +0000 (14:24 +0300)]
Cleanup
Laurențiu Nicola [Sun, 10 Jan 2021 10:19:00 +0000 (12:19 +0200)]
Avoid string copy in complete_attribute
bors[bot] [Sun, 10 Jan 2021 10:02:10 +0000 (10:02 +0000)]
Merge #6980
6980: Implement to support intra-doc link r=matklad a=sasurau4
Helps with #6168
This PR is very limited implementation to support intra-doc. It only support links indicate same file function.
I want someone to feedback me about this implementation. If the approach is good, I will continue this PR to support other symbols like enum and struct.
Co-authored-by: Daiki Ihara <sasurau4@gmail.com>
bors[bot] [Sun, 10 Jan 2021 09:34:24 +0000 (09:34 +0000)]
Merge #7224
7224: Remove unnecessary allocation when checking whether to hide argument name hint r=jhpratt a=jhpratt
The case-insensitive prefix/suffix check can be performed
character-by-character. This allows the check to be done without having
to allocate a new string. As a side effect, it's also no longer
necessary to convert the entire string to lowercase, as it's done as
needed. As the only case equality we're handling is ASCII, this
operation can be further optimized by using byte equality, rather than
character equality.
cc @SomeoneToIgnore, as it's an update on my PR from yesterday.
Co-authored-by: Jacob Pratt <jacob@jhpratt.dev>
Jacob Pratt [Sun, 10 Jan 2021 09:14:39 +0000 (04:14 -0500)]
Skip leading underscores unconditionally
bors[bot] [Sun, 10 Jan 2021 09:00:54 +0000 (09:00 +0000)]
Merge #7226
7226: Replace state with function r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sun, 10 Jan 2021 08:57:17 +0000 (11:57 +0300)]
Replace state with function
Jacob Pratt [Sun, 10 Jan 2021 08:05:52 +0000 (03:05 -0500)]
Short-circuit boolean operation
ShuiRuTian [Sun, 10 Jan 2021 06:39:44 +0000 (14:39 +0800)]
update rs format
ShuiRuTian [Sun, 10 Jan 2021 06:27:18 +0000 (14:27 +0800)]
fix condition.
ShuiRuTian [Sun, 10 Jan 2021 06:15:59 +0000 (14:15 +0800)]
update format.
ShuiRuTian [Sun, 10 Jan 2021 06:10:36 +0000 (14:10 +0800)]
fix issue.
Jacob Pratt [Sun, 10 Jan 2021 02:36:38 +0000 (21:36 -0500)]
Remove unnecessary allocation
The case-insensitive prefix/suffix check can be performed
character-by-character. This allows the check to be done without having
to allocate a new string. As a side effect, it's also no longer
necessary to convert the entire string to lowercase, as it's done as
needed. As the only case equality we're handling is ASCII, this
operation can be further optimized by using byte equality, rather than
character equality.
bors[bot] [Sat, 9 Jan 2021 20:08:41 +0000 (20:08 +0000)]
Merge #7223
7223: Refactor highlighting r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 9 Jan 2021 20:07:32 +0000 (23:07 +0300)]
Refactor highlighting
ShuiRuTian [Sat, 9 Jan 2021 17:39:40 +0000 (01:39 +0800)]
not track my analytics
ShuiRuTian [Sat, 9 Jan 2021 17:29:08 +0000 (01:29 +0800)]
beta version for folder rename
Lukas Wirth [Sat, 9 Jan 2021 15:59:00 +0000 (16:59 +0100)]
Refactor rename name checking
Vincent Esche [Fri, 8 Jan 2021 14:42:40 +0000 (15:42 +0100)]
Fixed typos in public type names
Vincent Esche [Fri, 8 Jan 2021 14:41:46 +0000 (15:41 +0100)]
Fixed typos in private type names
Vincent Esche [Fri, 8 Jan 2021 14:41:32 +0000 (15:41 +0100)]
Fixed typos in local bindings
Vincent Esche [Fri, 8 Jan 2021 14:41:08 +0000 (15:41 +0100)]
Fixed typos in tests
Vincent Esche [Fri, 8 Jan 2021 14:40:38 +0000 (15:40 +0100)]
Fixed typos in code asserts
Vincent Esche [Fri, 8 Jan 2021 14:47:32 +0000 (15:47 +0100)]
Fixed typos in `log::warn!` message
Vincent Esche [Fri, 8 Jan 2021 14:46:48 +0000 (15:46 +0100)]
Fixed typos in code comments
bors[bot] [Sat, 9 Jan 2021 14:32:27 +0000 (14:32 +0000)]
Merge #7217
7217: Simplify r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 9 Jan 2021 14:31:22 +0000 (17:31 +0300)]
Simplify
bors[bot] [Sat, 9 Jan 2021 13:09:15 +0000 (13:09 +0000)]
Merge #7216
7216: Highlighting improvements r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 9 Jan 2021 13:07:41 +0000 (16:07 +0300)]
Better highlight for fixtures
Aleksey Kladov [Sat, 9 Jan 2021 12:54:38 +0000 (15:54 +0300)]
Simplify
Aleksey Kladov [Sat, 9 Jan 2021 12:18:49 +0000 (15:18 +0300)]
Better names
Aleksey Kladov [Sat, 9 Jan 2021 12:12:21 +0000 (15:12 +0300)]
Reduce duplication
Aleksey Kladov [Sat, 9 Jan 2021 11:48:15 +0000 (14:48 +0300)]
Shorten names
Aleksey Kladov [Sat, 9 Jan 2021 11:45:47 +0000 (14:45 +0300)]
Reorder modules
Aleksey Kladov [Sat, 9 Jan 2021 11:44:01 +0000 (14:44 +0300)]
Shorten frequent names