-
Notifications
You must be signed in to change notification settings - Fork 341
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
Add reload command. #845
Add reload command. #845
Conversation
I saw that you named it "Reload", it more like a restart than a "Reload". Normally restart is associated with the need of the service to shutdown then starting versus a reload that keep the service running but refresh the configuration. |
Can we have this merge please ? The number of times I switch branches and ESLint will throw warnings/errors on a If at least I could :
But now I have to reload my window or restart VSCode. The fact that this happens when I switch branch is irritating, but at least if we could get some sort of reload for ESLint, that would be great ! |
@@ -1221,6 +1221,11 @@ function realActivate(context: ExtensionContext): void { | |||
}); | |||
}), | |||
Commands.registerCommand('eslint.showOutputChannel', () => { client.outputChannel.show(); }), | |||
Commands.registerCommand('eslint.reload', () => { | |||
client.stop().then(() => { | |||
client.start(); |
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.
async () => {
await client.stop();
await client.start();
}
Would love to have this feature. |
I'll publish a fork some time in the next week. I've needed this at work enough to justify spending the time on it there. I'd also like to experiment on:
|
I looked into this today and this is not as easy as calling stop & start. Stop removes a lot of state from the client which makes the start not be successful in all cases. The right fix is actually to create a new client and not reuse the old instance. Need to think what needs to be done to make this successful. |
client/src/extension.ts |
Sebastianokunkelo:master |
@threehams I delivered this for 2.1.17 in a slightly different form. |
Add reload command to restart the client without having to restart VS Code.
Fixes #164.