diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-12-08 13:10:28 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-12-08 13:10:28 +0000 |
commit | 4d4f11925f793c45560c45c088d4b3139c2c171c (patch) | |
tree | f8c5e3c14a0bb55d4b435b8389bccf305975d39a /editors | |
parent | 021e97ea03cf67ad7785ab39580e04bc69506b8c (diff) | |
parent | bf24cb3e8db94a84fb4a24c407797ab6ff5ee109 (diff) |
Merge #6706
6706: Move import text edit calculation into a completion resolve request r=matklad a=SomeoneToIgnore
Part of https://github.com/rust-analyzer/rust-analyzer/issues/6612 (presumably fixing it)
Part of https://github.com/rust-analyzer/rust-analyzer/issues/6366 (does not cover all possible resolve capabilities we can do)
Closes https://github.com/rust-analyzer/rust-analyzer/issues/6594
Further improves imports on completion performance by deferring the computations for import inserts.
To use the new mode, you have to have the experimental completions enabled and use the LSP 3.16-compliant client that reports `additionalTextEdits` in its `CompletionItemCapabilityResolveSupport` field in the client capabilities.
rust-analyzer VSCode extension does this already hence picks up the changes completely.
Performance implications are descrbed in: https://github.com/rust-analyzer/rust-analyzer/issues/6633#issuecomment-737295182
Co-authored-by: Kirill Bulatov <[email protected]>
Diffstat (limited to 'editors')
-rw-r--r-- | editors/code/package.json | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/editors/code/package.json b/editors/code/package.json index af228f983..dbde37005 100644 --- a/editors/code/package.json +++ b/editors/code/package.json | |||
@@ -460,10 +460,13 @@ | |||
460 | "default": true, | 460 | "default": true, |
461 | "markdownDescription": "Whether to show postfix snippets like `dbg`, `if`, `not`, etc." | 461 | "markdownDescription": "Whether to show postfix snippets like `dbg`, `if`, `not`, etc." |
462 | }, | 462 | }, |
463 | "rust-analyzer.completion.enableExperimental": { | 463 | "rust-analyzer.completion.autoimport.enable": { |
464 | "type": "boolean", | 464 | "type": "boolean", |
465 | "default": true, | 465 | "default": true, |
466 | "markdownDescription": "Display additional completions with potential false positives and performance issues" | 466 | "markdownDescription": [ |
467 | "Toggles the additional completions that automatically add imports when completed.", | ||
468 | "Note that your client have to specify the `additionalTextEdits` LSP client capability to truly have this feature enabled" | ||
469 | ] | ||
467 | }, | 470 | }, |
468 | "rust-analyzer.callInfo.full": { | 471 | "rust-analyzer.callInfo.full": { |
469 | "type": "boolean", | 472 | "type": "boolean", |