Search code examples
eclipselanguage-server-protocol

There is a way to use lsp4e for calling language server methods directly?


I'm new to the lsp4e & lsp technologies and as far as I have seen the framework provides almost everything for working with eclipse. However there is a way to use this features at will? i.e I would like to use the LS to get all the functions on a file, I think this will be done with textDocument/documentSymbol but how can I get this using the lsp4e framework?

NOTE: I checked for SymbolKind and seems it was not the one I was looking for however that input helped me finding a sample of DocumentSymbol

DocumentSymbolParams params = new DocumentSymbolParams(
new TextDocumentIdentifier(documentUri.toString()));
CompletableFuture<List<Either<SymbolInformation, DocumentSymbol>>> symbols = 
languageServer.getTextDocumentService().documentSymbol(params);

Solution

  • I checked for SymbolKind and seems it was not the one I was looking for. However that input helped me finding a sample of DocumentSymbol

    DocumentSymbolParams params = new DocumentSymbolParams(
    new TextDocumentIdentifier(documentUri.toString()));
    CompletableFuture<List<Either<SymbolInformation, DocumentSymbol>>> symbols = 
    languageServer.getTextDocumentService().documentSymbol(params);