0

I try to execute built-in command 'vscode.executeReferenceProvider' from language-server. The command is provided in the context of 'onCodeLensResolve' method as property of 'CodeLens' object.

private onCodeLens(params: LSP.CodeLensParams): LSP.CodeLens[] {
        let handler = new CodeLensHandler(this.analyzer.declarationCache, this.analyzer.referencesCache);
        return handler.getCodeLens(params.textDocument);
    }
// .....
let target = URI.parse(uri)
        let command: Command = Command.create(
            `${refs.length} references`,
            'vscode.executeReferenceProvider',
            target,
            CommonUtils.position(declaration.range.startPosition));

Error:

Running the contributed command: 'vscode.executeReferenceProvider' failed. Illegal argument 'uri' - Uri of a text document

  • Just to be clear, by "language-server host" you mean on the vscode extension side? In that case this seems unrelated to the LSP. – Gama11 Jan 20 '20 at 11:48
  • By language server host I mean LSP implementation. Turn out that it is not possible to execute this type of command from LSP implementation (see: https://github.com/microsoft/vscode-languageserver-node/issues/555) – Alexey Nikiforov Jan 21 '20 at 10:56

0 Answers0