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