Adrian Stanciu
e8a9bc09a3
run stable fmt through rustup
2022-08-06 17:25:02 +03:00
Jonas Schievink
fd00bd4d3b
Document CLI flag stability
2022-08-05 15:28:53 +02:00
Lukas Wirth
6a1737242b
Don't switch workspace on vfs file changes from libraries
...
When r-a starts up, it starts switching the workspace before all vfs
events have been processed which causes us to switch workspace multiple
times until all vfs changes have been processed. This scales with the
size of the project and its dependencies. If workspace files from
dependencies as well as the sysroot get loaded, we shouldn't switch
the workspace as those have no impact on the project workspace.
2022-08-05 12:06:42 +02:00
bors
0fe3bcfd35
Auto merge of #12808 - Veykril:check-workspace, r=Veykril
...
feat: Only flycheck workspace that belongs to saved file
Supercedes https://github.com/rust-lang/rust-analyzer/pull/11038
There is still the problem that all the diagnostics are cleared, only clearing diagnostics of the relevant workspace isn't easily doable though I think, will have to dig into that
2022-08-04 12:57:04 +00:00
Lukas Wirth
df7f755e3b
Don't flycheck while the workspace is being loaded
2022-08-04 14:56:44 +02:00
Lukas Wirth
df9d3db82f
Trigger flycheck on all transitive dependencies as well
2022-08-04 13:22:15 +02:00
bors
2bc9a2d9e0
Auto merge of #12933 - Veykril:proc-ignored, r=Veykril
...
Use an empty expander for ignored non-attribute proc-macros
Identity is the wrong behaviour for anything that's not an attribute here
2022-08-03 16:11:08 +00:00
Lukas Wirth
a8a6c160be
Use an empty expander for ignored non-attribute proc-macros
2022-08-03 18:10:15 +02:00
Jonas Schievink
bd7dfac5eb
Fix r-a spelling in some places
2022-08-01 13:47:09 +02:00
Lukas Wirth
c8ff70e924
fix: Fix server panicking on project loading when proc-macros are disabled
2022-07-26 16:30:45 +02:00
Amos Wenger
b1e3daf14b
Find standalone proc-macro-srv on windows too
2022-07-26 12:28:59 +02:00
Lukas Wirth
aa1491ecde
Record derive helper attributes, resolve them in IDE layer
2022-07-26 09:26:51 +02:00
Amos Wenger
74a2fad5e6
Gate and rename binary, use it if it's in the sysroot
2022-07-25 16:22:39 +02:00
Amos Wenger
dadb83282d
Remember the difference between 'sysroot root' and 'sysroot src root', start looking in there for a rust-analyzer-proc-macro-srv binary
2022-07-25 16:07:41 +02:00
Amos Wenger
0d04e63627
Merge remote-tracking branch 'origin/master' into sync-from-rust-2
2022-07-25 14:07:07 +02:00
bors
ac86b8edff
Auto merge of #12856 - Veykril:multi-proc-srv, r=Veykril
...
feat: Spawn a proc-macro-srv instance per workspace
cc https://github.com/rust-lang/rust-analyzer/issues/12855
The idea is to have each server be spawned with the appropriate toolchain, that way workspaces with differing toolchains shouldn't suffer from proc-macro abi mismatches.
2022-07-25 10:41:05 +00:00
Amos Wenger
b351e115d6
Move cfg attrs up to the mod definitions to disable sourcegen
2022-07-24 10:38:34 +02:00
Amos Wenger
0bffdf2627
Disable all source-gen tests at compile time
2022-07-24 10:38:28 +02:00
Lukas Wirth
50b27e57ba
Better error messages when the proc-macro-server fails to start
2022-07-23 20:24:01 +02:00
Lukas Wirth
aeb07745d5
Spawn a proc-macro-srv instance per workspace
2022-07-23 20:10:10 +02:00
Amos Wenger
315b0a7254
Add sysroot-abi feature, copy 1.64 ABI fo rnow
2022-07-20 19:18:39 +02:00
Amos Wenger
244f29b1e7
Remove in-rust-tree feature
...
Since it's unused for now -it'll be re-introduced along with the
upcoming `proc-macro-srv/sysroot` feature.
2022-07-20 15:58:57 +02:00
Amos Wenger
d5b1ae66c2
Remove check_merge_commits test altogether
...
Rationale: Merge commits will probably end up in
`rust-lang/rust-analyzer` when doing "rust=>ra" syncs anyway.
It could be changed to only check for merge commits in non-sync PRs,
but it's "probably not worth the hassle"
2022-07-20 15:57:14 +02:00
Amos Wenger
c520408731
Allow merge commits when 'in-rust-tree' feature is enabled
...
This adds an `in-rust-tree` feature that will be enabled when
rust-analyzer is built from `rust-lang/rust`. Due to the way
"git subtree" works, that test _will_ find merge commits and
fail, so we simply skip it.
2022-07-20 15:49:40 +02:00
Amos Wenger
8318035726
Fix last few warnings manually
2022-07-20 15:05:02 +02:00
Amos Wenger
816f7fe12a
Run cargo fix --edition-idioms
2022-07-20 15:02:08 +02:00
Amos Wenger
23d25a3094
Enable extra warnings required by rust-lang/rust
2022-07-20 15:00:17 +02:00
Lukas Wirth
d73b0d5fc6
Don't filter flychecks by package member status
2022-07-20 11:52:44 +02:00
Lukas Wirth
25391e6d44
Only clear diagnostics of workspaces who have been flychecked
2022-07-20 11:49:36 +02:00
Amos Wenger
1b416473a3
Upgrade to expect-test@1.4.0
...
cf. https://github.com/rust-analyzer/expect-test/issues/33
cf. https://github.com/rust-lang/rust/pull/99444#issuecomment-1188844202
2022-07-19 13:00:45 +02:00
Laurențiu Nicola
474f5eafc7
Work around Code bug with empty diagnostics
2022-07-19 07:45:31 +03:00
Lukas Wirth
a63b5d3c84
feat: Only flycheck workspace that belongs to saved file
2022-07-18 20:30:58 +02:00
bors
dc05192e11
Auto merge of #12807 - Veykril:completion-item-details, r=Veykril
...
Add simple support for completion item details
Supercedes https://github.com/rust-lang/rust-analyzer/pull/9891
This doesn't yet really implement anything new, it just adds the scaffolding for the protocol conversion
2022-07-18 17:28:43 +00:00
Lukas Wirth
d17a5ef8e1
Add simple support for completion item details
2022-07-18 19:27:54 +02:00
bors
fac6a64656
Auto merge of #12804 - jonas-schievink:config-watcher, r=Veykril
...
fix: make file watcher config a drop-down (and clarify the options)
Fixes https://github.com/rust-lang/rust-analyzer/issues/12794
Also renames "notify" to "server", since that's clearer ("notify" is still accepted for compatibility).
2022-07-18 16:41:26 +00:00
bors
22e53f1d33
Auto merge of #12549 - bitgaoshu:goto_where_trait_m_impl, r=Veykril
...
feat: Go to implementation of trait methods
try goto where the trait method implies, #4558
2022-07-18 16:29:23 +00:00
Jonas Schievink
ec1142c0d0
Improve file watcher config
2022-07-18 17:50:56 +02:00
TonalidadeHidrica
dfcbed09d3
Fix obsolete enableRangeFormatting
config
2022-07-11 16:52:35 +09:00
Jonas Schievink
6c6ae965ba
Update remaining GitHub URLs
2022-07-08 15:44:49 +02:00
Hongxu Xu
441e659aa1
Complete associated type only in trait generic arg
...
Fix tidy check does not work for marks in multiline
2022-07-05 21:48:28 +08:00
Florian Diebold
ccf854bc2e
Improve documentation for buildScripts.overrideCommand / checkOnSave.overrideCommand
2022-07-04 18:51:18 +02:00
Laurențiu Nicola
5381811368
Bump tracing-subscriber
2022-07-03 10:12:58 +03:00
Laurențiu Nicola
212f84ab46
Bump crossbeam-channel
2022-07-03 09:56:58 +03:00
Florian Diebold
8b3ec12aac
fix: Report proc macro errors in expressions correctly as well
...
They didn't have a krate before, resulting in the generic "proc macro
not found" error.
Also improve error messages a bit more.
2022-06-28 10:43:22 +02:00
buffet
45b896002a
Fix typo in build.rs
2022-06-26 10:09:45 +00:00
bitgaoshu
e3b1303c4f
fix test in resolve_proc_macro: Foo is Owner
2022-06-25 01:02:39 +08:00
Lukas Wirth
06ee4d6222
fix: Fix auto-ref completions inserting into wrong locations
2022-06-20 18:59:57 +02:00
harpsword
3a78cc5e67
feat: add fold range for multi line match arm list
2022-06-18 16:05:56 +08:00
Lukas Wirth
7d51fc4640
Show proc-macro loading errors in unresolved-proc-macro diagnostics
2022-06-15 17:34:01 +02:00
bors
15c63c4119
Auto merge of #12541 - Veykril:vs-reload, r=Veykril
...
fix: Clear proc-macro changed flag when reloading workspace
2022-06-15 12:29:34 +00:00
Lukas Wirth
664a751f2b
fix: Clear proc-macro changed flag when reloading workspace
2022-06-15 14:29:13 +02:00
Lukas Wirth
325ceaef19
fix: Check for the correct proc-macro settings in missing proc-macro diagnostics
2022-06-14 11:00:06 +02:00
bors
366bd7242e
Auto merge of #12515 - Veykril:rustc-proc-macros, r=Veykril
...
fix: Pass the build data to rustc_private crates
With this all proc-macros should resolve in rustc now when setting up the build script running command properly.
2022-06-12 17:35:55 +00:00
Lukas Wirth
10e9f47dce
fix: Pass the build data to rustc_private crates
2022-06-12 19:29:45 +02:00
Lukas Wirth
0e4eb647f6
More precise proc-macro errors
2022-06-12 18:44:46 +02:00
bors
604b1c8409
Auto merge of #12508 - Veykril:req-retry, r=Veykril
...
fix: Don't respond to cancelled requests when retrying them
Fixes https://github.com/rust-lang/rust-analyzer/issues/12482
2022-06-12 00:56:52 +00:00
Lukas Wirth
ad109f7f0a
fix: Don't respond to cancelled requests when retrying them
2022-06-12 02:56:19 +02:00
Lukas Wirth
a7a1a83463
fix: Fix config patching for callable snippets
2022-06-11 13:41:06 +02:00
bors
ba329913fa
Auto merge of #12449 - Veykril:version, r=Veykril
...
Bring the version command output in line with other rust tools
Inspired by how cargo handles it
Fixes https://github.com/rust-lang/rust-analyzer/issues/12280
![image](https://user-images.githubusercontent.com/3757771/171680176-236451ee-2c6c-449f-8aa5-4a047e8cc907.png )
2022-06-10 23:35:38 +00:00
bors
e9d3fe0484
Auto merge of #12502 - Veykril:deps, r=Veykril
...
internal: Bump Dependencies
2022-06-10 19:51:04 +00:00
Lukas Wirth
76ae5434fa
internal: Bump Dependencies
2022-06-10 17:30:02 +02:00
bjorn3
c81608c6d2
Fix a couple of weak warnings found by rust-analyzer itself
2022-06-08 14:35:11 +00:00
bors
6d3396a492
Auto merge of #12466 - lnicola:worker-thread-stack, r=lnicola
...
Increase worker thread stack and name them
CC #11370
2022-06-05 07:59:42 +00:00
Lukas Wirth
d38b7b88c6
minor: Don't log cancelled diagnostics
2022-06-05 01:38:46 +02:00
Laurențiu Nicola
0b9cd8a468
Increase worker thread stack and name them
2022-06-04 20:48:51 +03:00
Laurențiu Nicola
7066b8e0ca
Shorten main thread name
2022-06-03 07:27:48 +03:00
Lukas Wirth
a2a3ea86ea
Bring the version command output in line with other rust tools
2022-06-02 18:36:02 +02:00
bors
6f7c5589ab
Auto merge of #12443 - Veykril:fmtfix, r=Veykril
...
minor: Fix rustfmt failing on main_loop.rs
2022-06-01 19:23:22 +00:00
Lukas Wirth
343562c54d
minor: Fix rustfmt failing on main_loop.rs
2022-06-01 21:20:54 +02:00
Maan2003
bad931116e
fix(diagnostic): Don't remove diagnostic with empty message
...
Use " " as message if it is empty
2022-06-01 18:38:53 +05:30
Lukas Wirth
d88ae66ed9
Sync handlers cannot be cancelled
2022-06-01 12:18:15 +02:00
Lukas Wirth
e2da967578
fix: Fix completions disappearing when typing two keys in quick succession
2022-06-01 00:20:47 +02:00
Lukas Wirth
ea594c4c44
Use char for trigger character
2022-05-30 14:17:58 +02:00
bors
9ceaff91d3
Auto merge of #12406 - harpsword:fix-add-inlayHints-closures-without-block, r=Veykril
...
fix: add an option to show inlay hint for return type of closures wit…
fix #12321
2022-05-30 11:36:55 +00:00
yue4u
1b5f0462ed
fix: visibility completion
2022-05-30 00:06:48 +09:00
harpsword
55509548e8
fix: add an option to show inlay hint for return type of closures without block
2022-05-28 22:12:30 +08:00
bors
145bad473d
Auto merge of #12341 - vemoo:exclude_dirs, r=Veykril
...
make `files.excludeDirs` work
There's a small issue because if all projects are excluded, this: 01d412f4d7/crates/rust-analyzer/src/main_loop.rs (L114)
will be shown.
I thought about not showing it if `files.excludeDirs` is set, but that is not necessarily correct.
Fixes #7755
2022-05-27 12:35:48 +00:00
Lukas Wirth
5410ace1fe
fix: Clear native diagnostics for files when they are deleted
2022-05-25 15:47:41 +02:00
Lukas Wirth
f02c915eb5
internal: Make autoclosing angle brackets configurable, disabled by default
2022-05-25 12:42:07 +02:00
DQ
f3a5475082
Keep the other is
in reload.rs
docs
2022-05-23 10:29:03 +02:00
DQ
914ff6a395
Fix typo in new reload.rs
docs
...
Just skimmed today's changelog and came across the repetition
2022-05-23 09:35:32 +02:00
Felicián Németh
3bb02f2329
feat: Add on-typing handler for left angle
...
Only advertise this feature in the server capabilities when the client
supports SnippetTextEdit.
Close #11398 .
Co-authored-by: unexge <unexge@gmail.com>
2022-05-22 10:40:37 +02:00
Felicián Németh
636d4880c4
internal: Allow OnTypeFormatting to send SnippetTextEdit
...
But continue to send TextEdit only.
2022-05-22 10:39:18 +02:00
Bernardo Uriarte
1ee8fefcff
take into account excludeDirs when computing linked_projects
2022-05-21 16:18:55 +02:00
Bernardo Uriarte
7009e5ab35
add failing test
2022-05-21 16:11:51 +02:00
Aleksey Kladov
cbdab0e647
internal: document overall approach to reload
2022-05-21 13:11:05 +01:00
Jonas Schievink
3e356c1fd3
Clear cargo check
diagnostics when flycheck is turned off
2022-05-20 15:07:55 +02:00
bors
41388bf81a
Auto merge of #12263 - andylizi:hide-type-hint-closure, r=Veykril
...
feat: hide type inlay hints for initializations of closures
![hide_closure_initialization](https://user-images.githubusercontent.com/12008103/168470158-6cb77b18-068e-4431-a8b5-e2b22d50d263.gif )
This PR adds an option to hide the inlay hints for `let IDENT_PAT = CLOSURE_EXPR;`, which is a somewhat common coding pattern. Currently the inlay hints for the assigned variable and the closure expression itself are both displayed, making it rather repetitive.
In order to be consistent with closure return type hints, only closures with block bodies will be hid by this option.
Personally I'd feel comfortable making it always enabled (or at least when closure return type hints are enabled), but considering the precedent set in #10761 , I introduced an off-by-default option for this.
changelog feature: option to hide type inlay hints for initializations of closures
2022-05-20 12:35:36 +00:00
bors
f5229cebb2
Auto merge of #12301 - harpsword:fix_for_crlf_cargo_range_map, r=jonas-schievink
...
fix: calculate correct postion for Dos line ending in mapping rustc range to ls…
fix #12293
2022-05-20 12:15:22 +00:00
andylizi
2b1c1a934c
feat: hide type inlay hints for initializations of closures
2022-05-20 17:42:56 +08:00
bors
eba26af9f1
Auto merge of #12314 - jonas-schievink:proc-macro-load, r=jonas-schievink
...
minor: simplify
2022-05-19 14:50:08 +00:00
bors
46b5483055
Auto merge of #12313 - equinox:typo-fix, r=lnicola
...
Removed duplicate 'to' in `cachePriming.numThreads` option description
One 'to' too many!
2022-05-19 14:22:09 +00:00
Equinox
7197042ac4
remove duplicate 'to' in cachePriming.numThreads
option description
2022-05-20 02:05:48 +12:00
Jonas Schievink
b2779111b4
simplify
2022-05-19 15:29:35 +02:00
Lukas Wirth
b08bbd7be0
Enable hovering function parameter inlay hints
2022-05-19 14:32:40 +02:00
Lukas Wirth
74230e26ff
internal: Improve inlay hint tooltips
2022-05-19 13:38:37 +02:00
Jonas Schievink
93b62dbe85
Improve docs generation assist
2022-05-18 18:05:21 +02:00
harpsword
dfae0a12ef
fix: calculate right range for Dos line ending in mapping rustc range to lsp range
2022-05-18 21:08:18 +08:00
Lukas Wirth
21f37a6d9e
Allow inlay hint tooltips to trigger hovers
2022-05-17 14:46:43 +02:00
Lukas Wirth
a2ec010185
Trigger hover requests on closing brace hints
2022-05-17 13:39:45 +02:00