0

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);
MPar
  • 58
  • 6
  • 1
    I guess this is done by lsp4j which implements LSP independent of Eclipse so it can be used also in a plain Java application. Eclipse lsp4e is based on lsp4j and integrates it into the Eclipse IDE (extends the _Generic Text Editor_, adds the _Language Servers_ preference pages, etc.). Have a look where [`SymbolKind`](https://github.com/eclipse/lsp4j/blob/master/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/SymbolKind.java) is used since this is what you want to get, right? – howlger Apr 17 '21 at 08:07
  • 1
    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>> symbols = languageServer.getTextDocumentService().documentSymbol(params);``` – MPar Apr 21 '21 at 17:37
  • Great. You might give a self-answer. – howlger Apr 21 '21 at 17:46

1 Answers1

0

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);
MPar
  • 58
  • 6