Which method in vscode-languageserver::IConnection has to be implemented to provide functionality "Go To Definition" over multiple files?
I was studying Language Server Node Example and vscode "API documentation", but I didn't find any info.
Which method in vscode-languageserver::IConnection has to be implemented to provide functionality "Go To Definition" over multiple files?
I was studying Language Server Node Example and vscode "API documentation", but I didn't find any info.
The following code snippet illustrates how to implement "Go To Definition" using vscode-languageserver:
connection.onInitialize((params): InitializeResult => {
  ...
  return {
    capabilities: {
      definitionProvider: true,
      ...
    }
  }
});
    
connection.onDefinition((textDocumentIdentifier: TextDocumentIdentifier): Definition => {
  return Location.create(textDocumentIdentifier.uri, {
    start: { line: 2, character: 5 },
    end: { line: 2, character: 6 }
  });
});
I think you have to create a class implementing the DefinitionProvider  and then register it using registerDefinitionProvider.
