Commit Graph

932 Commits

Author SHA1 Message Date
Lukas Wirth
83e49200d8 Add LifetimeParam and ConstParam to CompletionItemKind 2021-01-19 20:25:29 +01:00
bors[bot]
342bf41022
Merge #7297 #7338
7297: Propose trait associated items and autoimport traits on completion r=matklad a=SomeoneToIgnore

![trait_imports](https://user-images.githubusercontent.com/2690773/104819998-6faeb480-583a-11eb-8b45-b7351b51b90e.gif)

Closes #7248

7338: Parse `impl const Trait` r=Veykril a=Veykril

Closes #7313

bors r+

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-01-18 19:40:11 +00:00
Lukas Wirth
21a6384ce6 Remove obsolete RangeInfo usage in rename 2021-01-18 20:28:20 +01:00
Jonas Schievink
9b5fa1c61a Add back jemalloc support 2021-01-18 19:39:46 +01:00
Aleksey Kladov
add87f5424 Avoid blocking the main loop when editing Cargo.toml
I've noticed a bunch of "main loop too long" warnings in console when
typing in Cargo.toml. Profiling showed that the culprit is `rustc
--print cfg` call.

I moved it to the background project loading phase, where it belongs.
This highlighted a problem: we generally use single `cfg`, while it
really should be per crate.
2021-01-18 14:52:12 +03:00
Aleksey Kladov
e13065b8ac Add profile call 2021-01-18 13:30:12 +03:00
Kirill Bulatov
db335a1bbf Add flyimport completion for trait assoc items 2021-01-16 20:44:12 +02:00
Kirill Bulatov
6742f38e49 Share import_assets and related entities 2021-01-16 19:33:36 +02:00
Jonas Schievink
36500fe496 Don't duplicate rustc diagnostics fixes 2021-01-15 18:11:54 +01:00
Lukas Wirth
d5095329a1 Phase out SourceFileEdits in favour of a plain HashMap 2021-01-14 22:43:36 +01:00
Lukas Wirth
f51457a643 Group file source edits by FileId 2021-01-14 18:35:22 +01:00
Aleksey Kladov
8dc68ecdfc Introduce more appropriate assertion mechanism
rust-analyzer is a long-running program, so we *should* handle assertion
failures.

See also https://www.sqlite.org/assert.html.
2021-01-14 18:25:19 +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
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
ShuiRuTian
76e6589016 unwrap. 2021-01-13 12:10:45 +08: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
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
Aleksey Kladov
9fd4e5c66c Improve analysis stats legibility 2021-01-11 22:17:30 +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
ShuiRuTian
f7cb9e9fbe move logic from client to server. 2021-01-11 14:45:35 +08: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
Aleksey Kladov
a0957723fe Make default memory stats less verbose 2021-01-10 20:58:02 +03:00
Aleksey Kladov
2ed258ba42 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.
2021-01-10 18:02:02 +03:00
Lukas Wirth
78fe6133c4 Split punctuation semantic highlighting up into more tags 2021-01-10 13:33:03 +01:00
ShuiRuTian
b9d52444cf update rs format 2021-01-10 14:39:44 +08:00
ShuiRuTian
b0e300c793 fix condition. 2021-01-10 14:27:18 +08:00
ShuiRuTian
09ed9d0444 fix issue. 2021-01-10 14:10:36 +08:00
ShuiRuTian
0d86e22229 beta version for folder rename 2021-01-10 01:29:08 +08:00
Vincent Esche
4702c01553 Fixed typos in tests 2021-01-09 15:41:29 +01:00
Vincent Esche
21f8239ac8 Fixed typos in code comments 2021-01-09 15:41:29 +01:00
Aleksey Kladov
3dfa2768ac Shorten names 2021-01-09 14:48:15 +03:00
Aleksey Kladov
64a6ee4535 Shorten frequent names 2021-01-09 14:44:01 +03:00
Aleksey Kladov
6fb52af521 Rename dummy -> none 2021-01-09 14:41:31 +03:00
Aleksey Kladov
e30c1c3fbf Simplify highlighting infra
This also fixes the killer whale bug
2021-01-08 23:47:35 +03:00
ShuiRuTian
c08391ce32 support folder rename for initial request. 2021-01-08 17:49:13 +08:00
bors[bot]
4ddf075673
Merge #7193
7193: Show progress for fetching workspace (cargo-metadata and loadOutDirsFromCheck) r=matklad a=edwin0cheng


![Peek 2021-01-07 21-57](https://user-images.githubusercontent.com/11014119/103902132-0db4c780-5135-11eb-94d3-32429445be87.gif)


Fixes #7188 
Fixes #3300

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2021-01-07 18:07:01 +00:00
Edwin Cheng
2b2d699b35 Report progress for cargo metadata and output-dir 2021-01-08 01:18:58 +08:00
bors[bot]
7967ce85cf
Merge #7184
7184: Changes Cursor Marker To $0 r=matklad a=kevaundray



Co-authored-by: Kevaundray Wedderburn <kevtheappdev@gmail.com>
2021-01-07 12:27:17 +00:00
Kevaundray Wedderburn
72b9a4fbd3 Change <|> to $0 - Rebase 2021-01-07 12:09:23 +00:00
Aleksey Kladov
037caec62c Use american spelling for config
As per

171c3c08fe/docs/dev/style.md (variable-naming)

Also implement config aliasing, for pain-free settings migrations in the future
2021-01-07 15:07:19 +03:00