-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reload part of the server configuration without restarts #3666
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, though the protocol for config reloading is somewhat imperfect...
d7283b3
to
7b9187c
Compare
a327c27
to
3918ef3
Compare
Ah, sorry, there wil be a conflict ;) |
I just tested, at least |
Highlighting may be broken for some other reason. I think we should just
delete old, non semantic-tokens based code already.
…On Tue, 24 Mar 2020 at 15:51, Edwin Cheng ***@***.***> wrote:
I just tested, at least "rust-analyzer.highlightingOn" do not works. (No
reload notification or do not change any highlight)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3666 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANB3M2T3TQ4COZEGKUA46DRJDCFRANCNFSM4LQV3ECA>
.
|
@matklad Agreed. OTHO , And I also tested:
|
Thanks a lot for testing, nice catches. I've moved the whole As for the check interruption, this gets interesting: it looks like we try to do the graceful shutdown in the |
@SomeoneToIgnore - never used vscode framework, but give this a shot, in editors/code/src/config.ts, line 77, I've noticed this bug, so if you need help, holler, don't mind helping out. (and of course, i could be way wrong and the scheduling could very well be benign) |
@eriktrom what bug are you talking about? What do you mean by passing the callback to the event listener? Maybe you meant registering the event listener callback which is this line: @SomeoneToIgnore if you feel that there is something that is broken on the frontend that doesn't support the reloading, you can pass this task to me. Anyway, my guess is that the server doesn't send the because the communication channel was closed abruptly in the From my perspective, it looks like the arr two solutions:
And properly handle it here by sending the And send the
Looks like it is very intuitive to do it the second way. What do you think @kiljacken @matklad @SomeoneToIgnore |
sorry let me clarify succinctly: fe379be#diff-519236f72123ff858d99b50e506bf6ccL56-L57 fe379be#diff-519236f72123ff858d99b50e506bf6ccL70-L87 in the constructor. the callback I'm not sure how vscode does its internal scheduling, so I just commented offhand as though it didn't and therefore, take with grain of salt. BTW - I love rust-analyzer :) thanks so much for ur work. |
I believe your analysis is correct. I didn't really consider cancelling the check thread without starting a new run immediately afterwards which masks the underlying issue. I believe we are robust against multiple |
@Veetaha @SomeoneToIgnore One thing I want to clarify here is that the |
@@ -93,6 +93,12 @@ export async function activate(context: vscode.ExtensionContext) { | |||
activateHighlighting(ctx); | |||
} | |||
activateInlayHints(ctx); | |||
|
|||
vscode.workspace.onDidChangeConfiguration( | |||
_ => ctx?.client?.sendNotification('workspace/didChangeConfiguration', { settings: "" }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, is there perhaps some way to make the client library we use do this automatically?
@@ -20,6 +20,7 @@ export class Ctx { | |||
const res = new Ctx(config, extCtx, client, serverPath); | |||
res.pushCleanup(client.start()); | |||
await client.onReady(); | |||
client.onRequest('workspace/configuration', _ => [configToServerOptions(config)]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, is there some kind of build-in handler here, which just fetches the relevant section from the config?
@@ -624,7 +661,17 @@ fn on_notification( | |||
Err(not) => not, | |||
}; | |||
let not = match notification_cast::<req::DidChangeConfiguration>(not) { | |||
Ok(_params) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, yeah, given that we already have no-op handler to avoid errors, I think clients do send this notification already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It did not trigger for me when I tried to change the settings on master
, so it looks like they don't.
But I find this surprising also, I would have expected it to be working by default.
fe379be
to
e21d734
Compare
Co-Authored-By: Veetaha <veetaha2@gmail.com>
Co-Authored-By: Veetaha <veetaha2@gmail.com>
e21d734
to
8e78371
Compare
I've finally found some time to dig and fix the progress bar issue. We cannot use the way discussed at #3666 (comment) due to the way the main loop works: it uses the Instead, I clean up all diagnostics and stop the progress bad on With this fixed, I've addressed all feedback up to here. The last portion of the feedback remaining is the one from @matklad about the automatic config requests/responses handling, the one that I've outlined in the PR header as
I still have no idea if there's a better way and will gladly put a |
bors r+ |
Build succeeded |
Partially addresses #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 returnsany[]
(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.