org.eclipse.lsp4j.SymbolKindCapabilities Java Examples

The following examples show how to use org.eclipse.lsp4j.SymbolKindCapabilities. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LSPBindings.java    From netbeans with Apache License 2.0 5 votes vote down vote up
private static InitializeResult initServer(Process p, LanguageServer server, FileObject root) throws InterruptedException, ExecutionException {
   InitializeParams initParams = new InitializeParams();
   initParams.setRootUri(Utils.toURI(root));
   initParams.setRootPath(FileUtil.toFile(root).getAbsolutePath()); //some servers still expect root path
   initParams.setProcessId(0);
   TextDocumentClientCapabilities tdcc = new TextDocumentClientCapabilities();
   DocumentSymbolCapabilities dsc = new DocumentSymbolCapabilities();
   dsc.setHierarchicalDocumentSymbolSupport(true);
   dsc.setSymbolKind(new SymbolKindCapabilities(Arrays.asList(SymbolKind.values())));
   tdcc.setDocumentSymbol(dsc);
   WorkspaceClientCapabilities wcc = new WorkspaceClientCapabilities();
   wcc.setWorkspaceEdit(new WorkspaceEditCapabilities());
   wcc.getWorkspaceEdit().setDocumentChanges(true);
   wcc.getWorkspaceEdit().setResourceOperations(Arrays.asList(ResourceOperationKind.Create, ResourceOperationKind.Delete, ResourceOperationKind.Rename));
   initParams.setCapabilities(new ClientCapabilities(wcc, tdcc, null));
   CompletableFuture<InitializeResult> initResult = server.initialize(initParams);
   while (true) {
       try {
           return initResult.get(100, TimeUnit.MILLISECONDS);
       } catch (TimeoutException ex) {
           if (p != null && !p.isAlive()) {
               InitializeResult emptyResult = new InitializeResult();
               emptyResult.setCapabilities(new ServerCapabilities());
               return emptyResult;
           }
       }
   }
}
 
Example #2
Source File: SymbolCapabilities.java    From lsp4j with Eclipse Public License 2.0 4 votes vote down vote up
public SymbolCapabilities(final SymbolKindCapabilities symbolKind) {
  this.symbolKind = symbolKind;
}
 
Example #3
Source File: SymbolCapabilities.java    From lsp4j with Eclipse Public License 2.0 4 votes vote down vote up
public SymbolCapabilities(final SymbolKindCapabilities symbolKind, final Boolean dynamicRegistration) {
  super(dynamicRegistration);
  this.symbolKind = symbolKind;
}
 
Example #4
Source File: SymbolCapabilities.java    From lsp4j with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * Specific capabilities for the `SymbolKind` in the `workspace/symbol` request.
 */
@Pure
public SymbolKindCapabilities getSymbolKind() {
  return this.symbolKind;
}
 
Example #5
Source File: SymbolCapabilities.java    From lsp4j with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * Specific capabilities for the `SymbolKind` in the `workspace/symbol` request.
 */
public void setSymbolKind(final SymbolKindCapabilities symbolKind) {
  this.symbolKind = symbolKind;
}
 
Example #6
Source File: DocumentSymbolCapabilities.java    From lsp4j with Eclipse Public License 2.0 4 votes vote down vote up
public DocumentSymbolCapabilities(final SymbolKindCapabilities symbolKind) {
  this.symbolKind = symbolKind;
}
 
Example #7
Source File: DocumentSymbolCapabilities.java    From lsp4j with Eclipse Public License 2.0 4 votes vote down vote up
public DocumentSymbolCapabilities(final SymbolKindCapabilities symbolKind, final Boolean dynamicRegistration) {
  super(dynamicRegistration);
  this.symbolKind = symbolKind;
}
 
Example #8
Source File: DocumentSymbolCapabilities.java    From lsp4j with Eclipse Public License 2.0 4 votes vote down vote up
public DocumentSymbolCapabilities(final SymbolKindCapabilities symbolKind, final Boolean dynamicRegistration, final Boolean hierarchicalDocumentSymbolSupport) {
  super(dynamicRegistration);
  this.symbolKind = symbolKind;
  this.hierarchicalDocumentSymbolSupport = hierarchicalDocumentSymbolSupport;
}
 
Example #9
Source File: DocumentSymbolCapabilities.java    From lsp4j with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * Specific capabilities for the `SymbolKind`.
 */
@Pure
public SymbolKindCapabilities getSymbolKind() {
  return this.symbolKind;
}
 
Example #10
Source File: DocumentSymbolCapabilities.java    From lsp4j with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * Specific capabilities for the `SymbolKind`.
 */
public void setSymbolKind(final SymbolKindCapabilities symbolKind) {
  this.symbolKind = symbolKind;
}