Search in sources :

Example 6 with WorkspaceClientCapabilities

use of org.eclipse.lsp4j.WorkspaceClientCapabilities in project eclipse.jdt.ls by eclipse.

the class InitHandlerTest method initialize.

private InitializeResult initialize(boolean dynamicRegistration) throws InterruptedException, ExecutionException {
    InitializeParams params = new InitializeParams();
    ClientCapabilities capabilities = new ClientCapabilities();
    WorkspaceClientCapabilities workspaceCapabilities = new WorkspaceClientCapabilities();
    workspaceCapabilities.setDidChangeConfiguration(new DidChangeConfigurationCapabilities(dynamicRegistration));
    ExecuteCommandCapabilities executeCommand = new ExecuteCommandCapabilities(dynamicRegistration);
    workspaceCapabilities.setExecuteCommand(executeCommand);
    capabilities.setWorkspace(workspaceCapabilities);
    TextDocumentClientCapabilities textDocument = new TextDocumentClientCapabilities();
    SynchronizationCapabilities synchronizationCapabilities = new SynchronizationCapabilities();
    synchronizationCapabilities.setWillSave(Boolean.TRUE);
    synchronizationCapabilities.setWillSaveWaitUntil(Boolean.TRUE);
    capabilities.setTextDocument(textDocument);
    params.setCapabilities(capabilities);
    CompletableFuture<InitializeResult> result = server.initialize(params);
    return result.get();
}
Also used : WorkspaceClientCapabilities(org.eclipse.lsp4j.WorkspaceClientCapabilities) InitializeResult(org.eclipse.lsp4j.InitializeResult) DidChangeConfigurationCapabilities(org.eclipse.lsp4j.DidChangeConfigurationCapabilities) WorkspaceClientCapabilities(org.eclipse.lsp4j.WorkspaceClientCapabilities) TextDocumentClientCapabilities(org.eclipse.lsp4j.TextDocumentClientCapabilities) ClientCapabilities(org.eclipse.lsp4j.ClientCapabilities) SynchronizationCapabilities(org.eclipse.lsp4j.SynchronizationCapabilities) InitializeParams(org.eclipse.lsp4j.InitializeParams) ExecuteCommandCapabilities(org.eclipse.lsp4j.ExecuteCommandCapabilities) TextDocumentClientCapabilities(org.eclipse.lsp4j.TextDocumentClientCapabilities)

Aggregations

ExecuteCommandCapabilities (org.eclipse.lsp4j.ExecuteCommandCapabilities)6 WorkspaceClientCapabilities (org.eclipse.lsp4j.WorkspaceClientCapabilities)6 ClientCapabilities (org.eclipse.lsp4j.ClientCapabilities)5 InitializeParams (org.eclipse.lsp4j.InitializeParams)3 IResourceServiceProvider (org.eclipse.xtext.resource.IResourceServiceProvider)3 Procedure1 (org.eclipse.xtext.xbase.lib.Procedures.Procedure1)3 InitializeResult (org.eclipse.lsp4j.InitializeResult)2 TextDocumentClientCapabilities (org.eclipse.lsp4j.TextDocumentClientCapabilities)2 Function1 (org.eclipse.xtext.xbase.lib.Functions.Function1)2 Test (org.junit.Test)2 List (java.util.List)1 CompletableFuture (java.util.concurrent.CompletableFuture)1 Consumer (java.util.function.Consumer)1 URI (org.eclipse.emf.common.util.URI)1 ApplyWorkspaceEditParams (org.eclipse.lsp4j.ApplyWorkspaceEditParams)1 ApplyWorkspaceEditResponse (org.eclipse.lsp4j.ApplyWorkspaceEditResponse)1 CodeLensOptions (org.eclipse.lsp4j.CodeLensOptions)1 CompletionCapabilities (org.eclipse.lsp4j.CompletionCapabilities)1 CompletionItemCapabilities (org.eclipse.lsp4j.CompletionItemCapabilities)1 CompletionOptions (org.eclipse.lsp4j.CompletionOptions)1