Search in sources :

Example 6 with ExecuteCommandOptions

use of org.eclipse.lsp4j.ExecuteCommandOptions in project ballerina by ballerina-lang.

the class BallerinaLanguageServer method initialize.

public CompletableFuture<InitializeResult> initialize(InitializeParams params) {
    final InitializeResult res = new InitializeResult(new ServerCapabilities());
    final SignatureHelpOptions signatureHelpOptions = new SignatureHelpOptions(Arrays.asList("(", ","));
    final List<String> commandList = new ArrayList<>(Arrays.asList(CommandConstants.CMD_IMPORT_PACKAGE, CommandConstants.CMD_ADD_DOCUMENTATION, CommandConstants.CMD_ADD_ALL_DOC));
    final ExecuteCommandOptions executeCommandOptions = new ExecuteCommandOptions(commandList);
    final CompletionOptions completionOptions = new CompletionOptions();
    completionOptions.setTriggerCharacters(Arrays.asList(":", ".", ">"));
    res.getCapabilities().setCompletionProvider(completionOptions);
    res.getCapabilities().setTextDocumentSync(TextDocumentSyncKind.Full);
    res.getCapabilities().setSignatureHelpProvider(signatureHelpOptions);
    res.getCapabilities().setHoverProvider(true);
    res.getCapabilities().setDocumentSymbolProvider(true);
    res.getCapabilities().setDefinitionProvider(true);
    res.getCapabilities().setReferencesProvider(true);
    res.getCapabilities().setCodeActionProvider(true);
    res.getCapabilities().setExecuteCommandProvider(executeCommandOptions);
    res.getCapabilities().setDocumentFormattingProvider(true);
    res.getCapabilities().setRenameProvider(true);
    return CompletableFuture.supplyAsync(() -> res);
}
Also used : CompletionOptions(org.eclipse.lsp4j.CompletionOptions) SignatureHelpOptions(org.eclipse.lsp4j.SignatureHelpOptions) InitializeResult(org.eclipse.lsp4j.InitializeResult) ArrayList(java.util.ArrayList) ServerCapabilities(org.eclipse.lsp4j.ServerCapabilities) ExecuteCommandOptions(org.eclipse.lsp4j.ExecuteCommandOptions)

Aggregations

ExecuteCommandOptions (org.eclipse.lsp4j.ExecuteCommandOptions)6 ServerCapabilities (org.eclipse.lsp4j.ServerCapabilities)5 CompletionOptions (org.eclipse.lsp4j.CompletionOptions)4 InitializeResult (org.eclipse.lsp4j.InitializeResult)4 CodeLensOptions (org.eclipse.lsp4j.CodeLensOptions)3 ArrayList (java.util.ArrayList)2 Map (java.util.Map)2 ClientCapabilities (org.eclipse.lsp4j.ClientCapabilities)2 SaveOptions (org.eclipse.lsp4j.SaveOptions)2 SignatureHelpOptions (org.eclipse.lsp4j.SignatureHelpOptions)2 TextDocumentSyncOptions (org.eclipse.lsp4j.TextDocumentSyncOptions)2 WorkspaceFoldersOptions (org.eclipse.lsp4j.WorkspaceFoldersOptions)2 WorkspaceServerCapabilities (org.eclipse.lsp4j.WorkspaceServerCapabilities)2 Procedure1 (org.eclipse.xtext.xbase.lib.Procedures.Procedure1)2 IOException (java.io.IOException)1 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1 URL (java.net.URL)1 HashMap (java.util.HashMap)1 CoreException (org.eclipse.core.runtime.CoreException)1