Register commands with an extension and use onCommand:myExtension.myCommand in activationEvents in the package.json.
Add a language server with an executeCommandProvider for myExtension.myCommand
Start debugging the language server and execute myExtension.myCommand in the command palette.
Result:
The language server is activated correctly, but the command is not executed. Instead a Command 'myExtension.myCommand' not found. error pops up.
Executing the command a second time works as the language server is already running.
This can only be fixed by adding constructor support for commands to the LSP client. In VS Code commands need to be registered in the activate function synchronously to make this work.
Steps to reproduce:
onCommand:myExtension.myCommand
in activationEvents in the package.json.executeCommandProvider
formyExtension.myCommand
myExtension.myCommand
in the command palette.Result: The language server is activated correctly, but the command is not executed. Instead a
Command 'myExtension.myCommand' not found.
error pops up.Executing the command a second time works as the language server is already running.