Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Add reload command. #845

wants to merge 1 commit into from

Conversation

threehams
Copy link

Add reload command to restart the client without having to restart VS Code.

Fixes #164.

@msftclas
Copy link

msftclas commented Dec 18, 2019

CLA assistant check
All CLA requirements met.

@dbaeumer dbaeumer added this to the 2.1.0 milestone Dec 18, 2019
@Davilink
Copy link

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.

@MLefebvreICO
Copy link

Can we have this merge please ?

The number of times I switch branches and ESLint will throw warnings/errors on a typescript-eslint rule is getting frustrating ..

If at least I could :

  1. F1
  2. Reload Typescript server
  3. F1
  4. Reload EsLint server
  5. Continue working

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();
Copy link

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();
}

@rdperottoni
Copy link

Would love to have this feature.

@threehams
Copy link
Author

threehams commented Jul 17, 2020

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:

  • better auto-reload when switching branches locally
  • timing out auto-fix to prevent "Getting code actions"

@dbaeumer
Copy link
Member

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.

Base automatically changed from master to main March 2, 2021 14:45
@Sebastianokunkelo
Copy link

client/src/extension.ts

@Sebastianokunkelo
Copy link

Sebastianokunkelo:master

@dbaeumer
Copy link
Member

@threehams I delivered this for 2.1.17 in a slightly different form.

@dbaeumer dbaeumer closed this Mar 16, 2021
@dbaeumer dbaeumer modified the milestones: 2.2.0, 2.1.17 Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

command to restart server or plugins without quitting vscode
8 participants