Conversation
6ea48bc to
d3a16fe
Compare
Moved the reload window pop up from jdk downloader to configuration change listener(restartExtension) triggered whenever any configuration is changed and extension is in bad state.
d3a16fe to
d3721f8
Compare
|
While checking for the consistency I find that the export function deactivate(): Thenable<void> {
Telemetry.enqueueCloseEvent();
const process = globalState.getNbProcessManager()?.getProcess();
if (process != null) {
process?.kill();
}
return globalState.getClientPromise().stopClient();
}This function is called by vscode only (when closing window) and is for cleaning up . So we can do the following export function deactivate(): Thenable<void> {
Telemetry.enqueueCloseEvent();
const clientStopped = globalState.getClientPromise().stopClient();
const process = globalState.getNbProcessManager()?.getProcess();
if (process != null) {
process?.kill();
}
return clientStopped;
}Note
|
|
As per the LSP protocol the client manages the server life cycle . So as per the protocol the client sends a Shutdown Request to the server indicating the server to prepare for shutdown . The sever must respond with errors if any that happen during the shutdown . On receiving the Shutdown request's response from the server the client sends an Exit notification which when the server receives must kill itself i.e exit the process .
Implementing the |
Issue
Post activating the extension one of the two cases happen
1)
JDK Found2)
No JDK FoundIn case of "No JDK Found" we enter a bad state where even if the user changes the jdk path to some valid path we cannot restart unless the user reloads .
In case initially JDK found but later user changes the path to an invalid jdk home then also we enter
No JDK Foundstate.Fix
Moved the reload window pop up from jdk downloader to configuration change listener(restartExtension) triggered whenever any configuration is changed and extension is in bad state.
This gives user a prompt to reload window so that extension can come out of the bad state.