-
Notifications
You must be signed in to change notification settings - Fork 3.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
lsp-sample
is not auto activated in VS Code 1.74
#807
Comments
I guess that the auto activation will only happen for languages that the extension declares it contributes. |
/assign @joyceerhl |
The documentation does not make it apparent that language is not defined. Eg. there is this code in the client which can be assumed that the client is always activated and it sets the language programatically: // Options to control the language client
let clientOptions: LanguageClientOptions = {
// Register the server for plain text documents
documentSelector: [{ scheme: 'file', language: 'plaintext' }],
synchronize: {
// Notify the server about file changes to '.clientrc files contained in the workspace
fileEvents: workspace.createFileSystemWatcher('**/.clientrc')
}
}; |
AFAIK activation has to be driven by the contents of package.json alone, because until it gets activated none of the code of the extension can have any effect in VS Code. |
I'm learning to write an VS Code language server from the https://code.visualstudio.com/api/language-extensions/language-server-extension-guide documentation. I tried to run several lsp samples from https://github.com/microsoft/vscode-extension-samples repository.
Running the lsp-multi-server-sample will activate the code and I can use breakpoints to debug the code.
The simple lsp-sample project will not activate the extension code automatically despite supporting VS Code 1.74 with auto activation of extension contributions (see https://code.visualstudio.com/updates/v1_74#_implicit-activation-events-for-declared-extension-contributions).
Environment
Steps to Reproduce
lsp-sample
projectclient/src/extension.ts
fileI have to add the activation manualy to
package.json
file to fix this and activate the extension."activationEvents": [ + "onLanguage:plaintext" ],
Expected behavior
According the documentation, the extension should be auto activated without setting the
onLanguage:plaintext
activation event.The text was updated successfully, but these errors were encountered: