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);
}
Aggregations