diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-03-30 13:45:49 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-03-30 13:45:49 +0100 |
commit | 671926ac93f0ff921758a919eaf87c056979189f (patch) | |
tree | 111c2cc751cb7fcca38eb7518e1d39af394ee243 /editors/code/src/inlay_hints.ts | |
parent | 9e12b9e6fdc03ea6bc35a88cfb5d5d6751672ec8 (diff) | |
parent | 4c897d8d2dd047e0906d585318866c9ae7a21610 (diff) |
Merge #3666
3666: Reload part of the server configuration without restarts r=matklad a=SomeoneToIgnore
Partially addresses https://github.com/rust-analyzer/rust-analyzer/issues/2857
Closes #3751
Reloads all server configuration that's not related to VFS without restarts.
The VFS-related parameters are not considered, since VFS is planned to be rewritten/replaced in the future and I have a suspicion that with the current code, swapping the VFS and the file watchers on the fly will cause big troubles.
I have to store and process the config request id separately, since the `workspace/configuration` response returns `any[]` (https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_configuration), if there's a better way to handle those responses, let me know.
Co-authored-by: Kirill Bulatov <[email protected]>
Diffstat (limited to 'editors/code/src/inlay_hints.ts')
-rw-r--r-- | editors/code/src/inlay_hints.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/editors/code/src/inlay_hints.ts b/editors/code/src/inlay_hints.ts index 542d1f367..6a8bd942e 100644 --- a/editors/code/src/inlay_hints.ts +++ b/editors/code/src/inlay_hints.ts | |||
@@ -17,7 +17,11 @@ export function activateInlayHints(ctx: Ctx) { | |||
17 | ) { | 17 | ) { |
18 | return this.dispose(); | 18 | return this.dispose(); |
19 | } | 19 | } |
20 | if (!this.updater) this.updater = new HintsUpdater(ctx); | 20 | if (this.updater) { |
21 | this.updater.syncCacheAndRenderHints(); | ||
22 | } else { | ||
23 | this.updater = new HintsUpdater(ctx); | ||
24 | } | ||
21 | }, | 25 | }, |
22 | dispose() { | 26 | dispose() { |
23 | this.updater?.dispose(); | 27 | this.updater?.dispose(); |
@@ -124,7 +128,7 @@ class HintsUpdater implements Disposable { | |||
124 | this.syncCacheAndRenderHints(); | 128 | this.syncCacheAndRenderHints(); |
125 | } | 129 | } |
126 | 130 | ||
127 | private syncCacheAndRenderHints() { | 131 | syncCacheAndRenderHints() { |
128 | // FIXME: make inlayHints request pass an array of files? | 132 | // FIXME: make inlayHints request pass an array of files? |
129 | this.sourceFiles.forEach((file, uri) => this.fetchHints(file).then(hints => { | 133 | this.sourceFiles.forEach((file, uri) => this.fetchHints(file).then(hints => { |
130 | if (!hints) return; | 134 | if (!hints) return; |