-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Automatically add "restart" commands for language servers #3215
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,10 +40,6 @@ export namespace TypeScriptCommands { | |
label: 'TypeScript: Open Server Log', | ||
id: 'typescript.server.openLog' | ||
}; | ||
export const restartServer: Command = { | ||
label: 'TypeScript: Restart Server', | ||
id: 'typescript.server.restart' | ||
}; | ||
} | ||
|
||
@injectable() | ||
|
@@ -83,11 +79,6 @@ export class TypeScriptFrontendContribution implements CommandContribution, Menu | |
isEnabled: () => !!this.clientContribution.logFileUri, | ||
isVisible: () => !!this.clientContribution.logFileUri | ||
}); | ||
commands.registerCommand(TypeScriptCommands.restartServer, { | ||
execute: () => this.clientContribution.restart(), | ||
isEnabled: () => this.clientContribution.running, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could implement There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll do that. |
||
isVisible: () => this.clientContribution.running | ||
}); | ||
} | ||
|
||
registerMenus(menus: MenuModelRegistry): void { | ||
|
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.
I think it should be available only if the server actually running, i.e. like in typescript extension right now.
We also need to remove an existing command from the typescript extension to avoid duplicate.
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.
This is what this code does, doesn't it?
activate
is only called when starting the language client/server.Ok.
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.
If the language server stops, we should remove the command, but I don't know how to make a language server stop for good.