Search in sources :

Example 6 with CodeActionOptions

use of org.eclipse.lsp4j.CodeActionOptions in project n4js by eclipse.

the class XLanguageServerImpl method createServerCapabilities.

/**
 * Configure the server capabilities for this instance.
 *
 * @param params
 *            the initialization parameters
 * @return the server capabilities
 */
protected ServerCapabilities createServerCapabilities(InitializeParams params) {
    ServerCapabilities serverCapabilities = new ServerCapabilities();
    serverCapabilities.setHoverProvider(true);
    serverCapabilities.setDefinitionProvider(true);
    serverCapabilities.setReferencesProvider(true);
    serverCapabilities.setDocumentSymbolProvider(true);
    serverCapabilities.setWorkspaceSymbolProvider(true);
    Set<? extends IResourceServiceProvider> allLanguages = getAllLanguages();
    if (allLanguages.stream().anyMatch((serviceProvider) -> serviceProvider.get(ICodeLensService.class) != null)) {
        CodeLensOptions codeLensOptions = new CodeLensOptions();
        codeLensOptions.setResolveProvider(allLanguages.stream().anyMatch((serviceProvider) -> serviceProvider.get(ICodeLensResolver.class) != null));
        serverCapabilities.setCodeLensProvider(codeLensOptions);
    }
    boolean supportsCodeActions = allLanguages.stream().anyMatch((serviceProvider) -> serviceProvider.get(ICodeActionService2.class) != null);
    if (supportsCodeActions) {
        Optional<List<String>> supportedKinds = getSupportedCodeActionKinds();
        if (supportedKinds.isPresent()) {
            serverCapabilities.setCodeActionProvider(new CodeActionOptions(supportedKinds.get()));
        } else {
            serverCapabilities.setCodeActionProvider(true);
        }
    } else {
        serverCapabilities.setCodeActionProvider(false);
    }
    serverCapabilities.setSignatureHelpProvider(new SignatureHelpOptions(ImmutableList.of("(", ",")));
    serverCapabilities.setTextDocumentSync(TextDocumentSyncKind.Incremental);
    CompletionOptions completionOptions = new CompletionOptions();
    completionOptions.setResolveProvider(false);
    completionOptions.setTriggerCharacters(ImmutableList.of("."));
    serverCapabilities.setCompletionProvider(completionOptions);
    serverCapabilities.setDocumentFormattingProvider(true);
    serverCapabilities.setDocumentRangeFormattingProvider(true);
    serverCapabilities.setDocumentHighlightProvider(true);
    ClientCapabilities clientCapabilities = null;
    if (params != null) {
        clientCapabilities = params.getCapabilities();
    }
    TextDocumentClientCapabilities textDocument = null;
    if (clientCapabilities != null) {
        textDocument = clientCapabilities.getTextDocument();
    }
    RenameCapabilities rename = null;
    if (textDocument != null) {
        rename = textDocument.getRename();
    }
    Boolean prepareSupport = null;
    if (rename != null) {
        prepareSupport = rename.getPrepareSupport();
    }
    boolean clientPrepareSupport = Objects.equal(Boolean.TRUE, prepareSupport);
    if (clientPrepareSupport && allLanguages.stream().anyMatch(serviceProvider -> serviceProvider.get(IRenameService2.class) != null)) {
        RenameOptions renameOptions = new RenameOptions();
        renameOptions.setPrepareProvider(true);
        serverCapabilities.setRenameProvider(Either.<Boolean, RenameOptions>forRight(renameOptions));
    } else {
        serverCapabilities.setRenameProvider(Either.forLeft(allLanguages.stream().anyMatch((serviceProvider) -> serviceProvider.get(IRenameService2.class) != null)));
    }
    WorkspaceClientCapabilities workspace = null;
    if (clientCapabilities != null) {
        workspace = clientCapabilities.getWorkspace();
    }
    ExecuteCommandCapabilities executeCommand = null;
    if (workspace != null) {
        executeCommand = workspace.getExecuteCommand();
    }
    if (executeCommand != null) {
        commandRegistry.initialize(allLanguages, clientCapabilities, client);
        ExecuteCommandOptions executeCommandOptions = new ExecuteCommandOptions();
        executeCommandOptions.setCommands(commandRegistry.getCommands());
        serverCapabilities.setExecuteCommandProvider(executeCommandOptions);
    }
    for (IResourceServiceProvider language : allLanguages) {
        ICapabilitiesContributor capabilitiesContributor = language.get(ICapabilitiesContributor.class);
        if (capabilitiesContributor != null) {
            capabilitiesContributor.contribute(serverCapabilities, params);
        }
    }
    return serverCapabilities;
}
Also used : CodeLensOptions(org.eclipse.lsp4j.CodeLensOptions) ParamHelper(org.eclipse.n4js.xtext.ide.server.util.ParamHelper) DidChangeTextDocumentParams(org.eclipse.lsp4j.DidChangeTextDocumentParams) WorkspaceSymbolParams(org.eclipse.lsp4j.WorkspaceSymbolParams) LanguageServer(org.eclipse.lsp4j.services.LanguageServer) UriExtensions(org.eclipse.xtext.ide.server.UriExtensions) DidSaveTextDocumentParams(org.eclipse.lsp4j.DidSaveTextDocumentParams) Optional(com.google.common.base.Optional) Map(java.util.Map) RenameParams(org.eclipse.lsp4j.RenameParams) Endpoint(org.eclipse.lsp4j.jsonrpc.Endpoint) IRenameService2(org.eclipse.xtext.ide.server.rename.IRenameService2) TextDocumentService(org.eclipse.lsp4j.services.TextDocumentService) SignatureHelpOptions(org.eclipse.lsp4j.SignatureHelpOptions) ISignatureHelpService(org.eclipse.xtext.ide.server.signatureHelp.ISignatureHelpService) Set(java.util.Set) DocumentOnTypeFormattingParams(org.eclipse.lsp4j.DocumentOnTypeFormattingParams) ICapabilitiesContributor(org.eclipse.xtext.ide.server.ICapabilitiesContributor) WorkspaceService(org.eclipse.lsp4j.services.WorkspaceService) LocationLink(org.eclipse.lsp4j.LocationLink) ExecuteCommandOptions(org.eclipse.lsp4j.ExecuteCommandOptions) JsonRpcMethod(org.eclipse.lsp4j.jsonrpc.json.JsonRpcMethod) WorkspaceFolder(org.eclipse.lsp4j.WorkspaceFolder) Singleton(com.google.inject.Singleton) LanguageClientAware(org.eclipse.lsp4j.services.LanguageClientAware) LspLogger(org.eclipse.n4js.xtext.ide.server.util.LspLogger) URI(org.eclipse.emf.common.util.URI) IResourceServiceProvider(org.eclipse.xtext.resource.IResourceServiceProvider) HoverParams(org.eclipse.lsp4j.HoverParams) DocumentRangeFormattingParams(org.eclipse.lsp4j.DocumentRangeFormattingParams) Hover(org.eclipse.lsp4j.Hover) ResourceSet(org.eclipse.emf.ecore.resource.ResourceSet) IHoverService(org.eclipse.xtext.ide.server.hover.IHoverService) LinkedHashMap(java.util.LinkedHashMap) TextEdit(org.eclipse.lsp4j.TextEdit) Lists(com.google.common.collect.Lists) DocumentFormattingParams(org.eclipse.lsp4j.DocumentFormattingParams) ImmutableMultimap(com.google.common.collect.ImmutableMultimap) InitializeResult(org.eclipse.lsp4j.InitializeResult) DocumentHighlight(org.eclipse.lsp4j.DocumentHighlight) ServiceEndpoints(org.eclipse.lsp4j.jsonrpc.services.ServiceEndpoints) DidChangeWatchedFilesParams(org.eclipse.lsp4j.DidChangeWatchedFilesParams) DocumentHighlightParams(org.eclipse.lsp4j.DocumentHighlightParams) PrepareRenameResult(org.eclipse.lsp4j.PrepareRenameResult) ICodeActionService2(org.eclipse.xtext.ide.server.codeActions.ICodeActionService2) SignatureHelp(org.eclipse.lsp4j.SignatureHelp) TreeMap(java.util.TreeMap) WorkspaceEdit(org.eclipse.lsp4j.WorkspaceEdit) RenameOptions(org.eclipse.lsp4j.RenameOptions) ServerIncidentLogger(org.eclipse.n4js.xtext.ide.server.util.ServerIncidentLogger) CompletionOptions(org.eclipse.lsp4j.CompletionOptions) SignatureHelpParams(org.eclipse.lsp4j.SignatureHelpParams) ClientCapabilities(org.eclipse.lsp4j.ClientCapabilities) ILanguageServerAccess(org.eclipse.xtext.ide.server.ILanguageServerAccess) LanguageClient(org.eclipse.lsp4j.services.LanguageClient) Inject(com.google.inject.Inject) WorkspaceClientCapabilities(org.eclipse.lsp4j.WorkspaceClientCapabilities) MessageType(org.eclipse.lsp4j.MessageType) ICodeLensService(org.eclipse.xtext.ide.server.codelens.ICodeLensService) Logger(org.apache.log4j.Logger) CodeLens(org.eclipse.lsp4j.CodeLens) Location(org.eclipse.lsp4j.Location) Either(org.eclipse.lsp4j.jsonrpc.messages.Either) TextDocumentClientCapabilities(org.eclipse.lsp4j.TextDocumentClientCapabilities) DidCloseTextDocumentParams(org.eclipse.lsp4j.DidCloseTextDocumentParams) Objects(com.google.common.base.Objects) IHeadlessExtensionRegistrationHelper(org.eclipse.n4js.xtext.ide.server.util.IHeadlessExtensionRegistrationHelper) CodeAction(org.eclipse.lsp4j.CodeAction) LinkedListMultimap(com.google.common.collect.LinkedListMultimap) XChunkedResourceDescriptions(org.eclipse.n4js.xtext.ide.server.util.XChunkedResourceDescriptions) ImmutableSet(com.google.common.collect.ImmutableSet) ImmutableMap(com.google.common.collect.ImmutableMap) CodeActionOptions(org.eclipse.lsp4j.CodeActionOptions) PrepareRenameParams(org.eclipse.lsp4j.PrepareRenameParams) ICodeLensResolver(org.eclipse.xtext.ide.server.codelens.ICodeLensResolver) Collectors(java.util.stream.Collectors) DefinitionParams(org.eclipse.lsp4j.DefinitionParams) ServerCapabilities(org.eclipse.lsp4j.ServerCapabilities) PublishingIssueAcceptor(org.eclipse.n4js.xtext.ide.server.issues.PublishingIssueAcceptor) CompletionItem(org.eclipse.lsp4j.CompletionItem) RenameCapabilities(org.eclipse.lsp4j.RenameCapabilities) ILanguageServerShutdownAndExitHandler(org.eclipse.xtext.ide.server.ILanguageServerShutdownAndExitHandler) List(java.util.List) Command(org.eclipse.lsp4j.Command) DidOpenTextDocumentParams(org.eclipse.lsp4j.DidOpenTextDocumentParams) Resource(org.eclipse.emf.ecore.resource.Resource) InitializeParams(org.eclipse.lsp4j.InitializeParams) CompletionParams(org.eclipse.lsp4j.CompletionParams) Stopwatch(com.google.common.base.Stopwatch) DocumentSymbolParams(org.eclipse.lsp4j.DocumentSymbolParams) CompletableFuture(java.util.concurrent.CompletableFuture) Range(org.eclipse.lsp4j.Range) Multimap(com.google.common.collect.Multimap) Function(java.util.function.Function) SymbolInformation(org.eclipse.lsp4j.SymbolInformation) CodeActionParams(org.eclipse.lsp4j.CodeActionParams) ExecuteCommandCapabilities(org.eclipse.lsp4j.ExecuteCommandCapabilities) ImmutableList(com.google.common.collect.ImmutableList) ExecuteCommandParams(org.eclipse.lsp4j.ExecuteCommandParams) MessageParams(org.eclipse.lsp4j.MessageParams) CancelIndicator(org.eclipse.xtext.util.CancelIndicator) CodeLensParams(org.eclipse.lsp4j.CodeLensParams) CompletionList(org.eclipse.lsp4j.CompletionList) DidChangeConfigurationParams(org.eclipse.lsp4j.DidChangeConfigurationParams) ImplementationParams(org.eclipse.lsp4j.ImplementationParams) TextDocumentSyncKind(org.eclipse.lsp4j.TextDocumentSyncKind) TypeDefinitionParams(org.eclipse.lsp4j.TypeDefinitionParams) XtextResource(org.eclipse.xtext.resource.XtextResource) InitializedParams(org.eclipse.lsp4j.InitializedParams) ILanguageServerExtension(org.eclipse.xtext.ide.server.ILanguageServerExtension) Provider(com.google.inject.Provider) CodeActionKind(org.eclipse.lsp4j.CodeActionKind) ExecutableCommandRegistry(org.eclipse.xtext.ide.server.commands.ExecutableCommandRegistry) JsonRpcMethodProvider(org.eclipse.lsp4j.jsonrpc.json.JsonRpcMethodProvider) Collections(java.util.Collections) DocumentSymbol(org.eclipse.lsp4j.DocumentSymbol) XtextResourceSet(org.eclipse.xtext.resource.XtextResourceSet) ReferenceParams(org.eclipse.lsp4j.ReferenceParams) ICodeLensResolver(org.eclipse.xtext.ide.server.codelens.ICodeLensResolver) RenameOptions(org.eclipse.lsp4j.RenameOptions) RenameCapabilities(org.eclipse.lsp4j.RenameCapabilities) ClientCapabilities(org.eclipse.lsp4j.ClientCapabilities) WorkspaceClientCapabilities(org.eclipse.lsp4j.WorkspaceClientCapabilities) TextDocumentClientCapabilities(org.eclipse.lsp4j.TextDocumentClientCapabilities) ICapabilitiesContributor(org.eclipse.xtext.ide.server.ICapabilitiesContributor) TextDocumentClientCapabilities(org.eclipse.lsp4j.TextDocumentClientCapabilities) CompletionOptions(org.eclipse.lsp4j.CompletionOptions) WorkspaceClientCapabilities(org.eclipse.lsp4j.WorkspaceClientCapabilities) SignatureHelpOptions(org.eclipse.lsp4j.SignatureHelpOptions) IResourceServiceProvider(org.eclipse.xtext.resource.IResourceServiceProvider) CodeActionOptions(org.eclipse.lsp4j.CodeActionOptions) List(java.util.List) ImmutableList(com.google.common.collect.ImmutableList) CompletionList(org.eclipse.lsp4j.CompletionList) IRenameService2(org.eclipse.xtext.ide.server.rename.IRenameService2) ServerCapabilities(org.eclipse.lsp4j.ServerCapabilities) CodeLensOptions(org.eclipse.lsp4j.CodeLensOptions) ExecuteCommandCapabilities(org.eclipse.lsp4j.ExecuteCommandCapabilities) ExecuteCommandOptions(org.eclipse.lsp4j.ExecuteCommandOptions)

Example 7 with CodeActionOptions

use of org.eclipse.lsp4j.CodeActionOptions in project OberonEmulator by schierlm.

the class Server method fillCapabilities.

protected void fillCapabilities(ServerCapabilities cap, InitializeParams params) {
    cap.setTextDocumentSync(TextDocumentSyncKind.Full);
    cap.setSemanticTokensProvider(new SemanticTokensWithRegistrationOptions(new SemanticTokensLegend(Bridge.TOKEN_TYPES, Bridge.TOKEN_MODIFIERS), new SemanticTokensServerFull(false), false));
    cap.setDocumentSymbolProvider(new DocumentSymbolOptions("Oberon"));
    cap.setCompletionProvider(new CompletionOptions(false, null));
    cap.setDefinitionProvider(true);
    cap.setDocumentHighlightProvider(true);
    cap.setReferencesProvider(true);
    cap.setLinkedEditingRangeProvider(true);
    cap.setSignatureHelpProvider(new SignatureHelpOptions(Arrays.asList("("), Arrays.asList(",", ")")));
    cap.setFoldingRangeProvider(true);
    cap.setHoverProvider(true);
    cap.setRenameProvider(new RenameOptions(true));
    cap.setDocumentFormattingProvider(true);
    cap.setCallHierarchyProvider(true);
    CodeActionOptions cao = new CodeActionOptions(Arrays.asList(CodeActionKind.QuickFix));
    cao.setResolveProvider(true);
    cap.setCodeActionProvider(cao);
}
Also used : CompletionOptions(org.eclipse.lsp4j.CompletionOptions) RenameOptions(org.eclipse.lsp4j.RenameOptions) SignatureHelpOptions(org.eclipse.lsp4j.SignatureHelpOptions) DocumentSymbolOptions(org.eclipse.lsp4j.DocumentSymbolOptions) CodeActionOptions(org.eclipse.lsp4j.CodeActionOptions) SemanticTokensLegend(org.eclipse.lsp4j.SemanticTokensLegend) SemanticTokensServerFull(org.eclipse.lsp4j.SemanticTokensServerFull) SemanticTokensWithRegistrationOptions(org.eclipse.lsp4j.SemanticTokensWithRegistrationOptions)

Example 8 with CodeActionOptions

use of org.eclipse.lsp4j.CodeActionOptions in project lsp4e by eclipse.

the class LanguageServerWrapper method registerCapability.

void registerCapability(RegistrationParams params) {
    params.getRegistrations().forEach(reg -> {
        if ("workspace/didChangeWorkspaceFolders".equals(reg.getMethod())) {
            // $NON-NLS-1$
            Assert.isNotNull(serverCapabilities, // $NON-NLS-1$
            "Dynamic capability registration failed! Server not yet initialized?");
            if (initiallySupportsWorkspaceFolders) {
            // Can treat this as a NOP since nothing can disable it dynamically if it was
            // enabled on initialization.
            } else if (supportsWorkspaceFolders(serverCapabilities)) {
                LanguageServerPlugin.logWarning(// $NON-NLS-1$
                "Dynamic registration of 'workspace/didChangeWorkspaceFolders' ignored. It was already enabled before", null);
            } else {
                addRegistration(reg, () -> setWorkspaceFoldersEnablement(false));
                setWorkspaceFoldersEnablement(true);
            }
        } else if ("workspace/executeCommand".equals(reg.getMethod())) {
            // $NON-NLS-1$
            // TODO? retrieve the GSon used by LS
            Gson gson = new Gson();
            ExecuteCommandOptions executeCommandOptions = gson.fromJson((JsonObject) reg.getRegisterOptions(), ExecuteCommandOptions.class);
            List<String> newCommands = executeCommandOptions.getCommands();
            if (!newCommands.isEmpty()) {
                addRegistration(reg, () -> unregisterCommands(newCommands));
                registerCommands(newCommands);
            }
        } else if ("textDocument/formatting".equals(reg.getMethod())) {
            // $NON-NLS-1$
            Either<Boolean, DocumentFormattingOptions> documentFormattingProvider = serverCapabilities.getDocumentFormattingProvider();
            if (documentFormattingProvider == null || documentFormattingProvider.isLeft()) {
                serverCapabilities.setDocumentFormattingProvider(Boolean.TRUE);
                addRegistration(reg, () -> serverCapabilities.setDocumentFormattingProvider(documentFormattingProvider));
            } else {
                serverCapabilities.setDocumentFormattingProvider(documentFormattingProvider.getRight());
                addRegistration(reg, () -> serverCapabilities.setDocumentFormattingProvider(documentFormattingProvider));
            }
        } else if ("textDocument/rangeFormatting".equals(reg.getMethod())) {
            // $NON-NLS-1$
            Either<Boolean, DocumentRangeFormattingOptions> documentRangeFormattingProvider = serverCapabilities.getDocumentRangeFormattingProvider();
            if (documentRangeFormattingProvider == null || documentRangeFormattingProvider.isLeft()) {
                serverCapabilities.setDocumentRangeFormattingProvider(Boolean.TRUE);
                addRegistration(reg, () -> serverCapabilities.setDocumentRangeFormattingProvider(documentRangeFormattingProvider));
            } else {
                serverCapabilities.setDocumentRangeFormattingProvider(documentRangeFormattingProvider.getRight());
                addRegistration(reg, () -> serverCapabilities.setDocumentRangeFormattingProvider(documentRangeFormattingProvider));
            }
        } else if ("textDocument/codeAction".equals(reg.getMethod())) {
            // $NON-NLS-1$
            final Either<Boolean, CodeActionOptions> beforeRegistration = serverCapabilities.getCodeActionProvider();
            serverCapabilities.setCodeActionProvider(Boolean.TRUE);
            addRegistration(reg, () -> serverCapabilities.setCodeActionProvider(beforeRegistration));
        }
    });
}
Also used : CodeActionOptions(org.eclipse.lsp4j.CodeActionOptions) Gson(com.google.gson.Gson) JsonObject(com.google.gson.JsonObject) Either(org.eclipse.lsp4j.jsonrpc.messages.Either) ArrayList(java.util.ArrayList) List(java.util.List) ExecuteCommandOptions(org.eclipse.lsp4j.ExecuteCommandOptions) DocumentFormattingOptions(org.eclipse.lsp4j.DocumentFormattingOptions)

Example 9 with CodeActionOptions

use of org.eclipse.lsp4j.CodeActionOptions in project vscode-as3mxml by BowlerHatLLC.

the class ActionScriptLanguageServer method initialize.

/**
 * Tells Visual Studio Code about the language server's capabilities.
 *
 * Optional initialization options:
 *
 * - supportsSimpleSnippets: The client offers partial support for snippets,
 * such as $0
 */
@Override
public CompletableFuture<InitializeResult> initialize(InitializeParams params) {
    actionScriptServices.setClientCapabilities(params.getCapabilities());
    actionScriptServices.setLanguageClient(languageClient);
    // setting everything above must happen before adding workspace folders
    List<WorkspaceFolder> folders = params.getWorkspaceFolders();
    if (folders != null) {
        for (WorkspaceFolder folder : params.getWorkspaceFolders()) {
            actionScriptServices.addWorkspaceFolder(folder);
        }
    } else if (params.getRootUri() != null) {
        // some clients don't support workspace folders, but if they pass in
        // a root URI, we can treat it like a workspace folder
        WorkspaceFolder folder = new WorkspaceFolder();
        folder.setUri(params.getRootUri());
        actionScriptServices.addWorkspaceFolder(folder);
    }
    boolean supportsSimpleSnippets = false;
    if (params.getInitializationOptions() != null) {
        JsonObject initializationOptions = (JsonObject) params.getInitializationOptions();
        if (initializationOptions.has("supportsSimpleSnippets")) {
            supportsSimpleSnippets = initializationOptions.get("supportsSimpleSnippets").getAsBoolean();
        }
    }
    actionScriptServices.setClientSupportsSimpleSnippets(supportsSimpleSnippets);
    InitializeResult result = new InitializeResult();
    ServerCapabilities serverCapabilities = new ServerCapabilities();
    serverCapabilities.setTextDocumentSync(TextDocumentSyncKind.Incremental);
    serverCapabilities.setCodeActionProvider(new CodeActionOptions(Lists.newArrayList(CodeActionKind.QuickFix, CodeActionKind.Refactor, CodeActionKind.RefactorRewrite, CodeActionKind.SourceOrganizeImports)));
    CompletionOptions completionOptions = new CompletionOptions();
    completionOptions.setTriggerCharacters(Arrays.asList(".", ":", " ", "<"));
    serverCapabilities.setCompletionProvider(completionOptions);
    serverCapabilities.setDefinitionProvider(true);
    serverCapabilities.setTypeDefinitionProvider(true);
    serverCapabilities.setImplementationProvider(true);
    serverCapabilities.setDocumentSymbolProvider(true);
    serverCapabilities.setDocumentHighlightProvider(false);
    serverCapabilities.setDocumentFormattingProvider(true);
    serverCapabilities.setDocumentRangeFormattingProvider(false);
    serverCapabilities.setHoverProvider(true);
    serverCapabilities.setReferencesProvider(true);
    serverCapabilities.setRenameProvider(true);
    SignatureHelpOptions signatureHelpOptions = new SignatureHelpOptions();
    signatureHelpOptions.setTriggerCharacters(Arrays.asList("(", ","));
    serverCapabilities.setSignatureHelpProvider(signatureHelpOptions);
    serverCapabilities.setWorkspaceSymbolProvider(true);
    WorkspaceServerCapabilities workspaceCapabilities = new WorkspaceServerCapabilities();
    WorkspaceFoldersOptions workspaceFoldersOptions = new WorkspaceFoldersOptions();
    workspaceFoldersOptions.setSupported(true);
    workspaceFoldersOptions.setChangeNotifications(true);
    workspaceCapabilities.setWorkspaceFolders(workspaceFoldersOptions);
    serverCapabilities.setWorkspace(workspaceCapabilities);
    ExecuteCommandOptions executeCommandOptions = new ExecuteCommandOptions();
    executeCommandOptions.setCommands(Arrays.asList(ICommandConstants.ADD_IMPORT, ICommandConstants.ADD_MXML_NAMESPACE, ICommandConstants.ORGANIZE_IMPORTS_IN_URI, ICommandConstants.ORGANIZE_IMPORTS_IN_DIRECTORY, ICommandConstants.QUICK_COMPILE, ICommandConstants.GET_ACTIVE_PROJECT_URIS));
    serverCapabilities.setExecuteCommandProvider(executeCommandOptions);
    result.setCapabilities(serverCapabilities);
    return CompletableFuture.completedFuture(result);
}
Also used : CompletionOptions(org.eclipse.lsp4j.CompletionOptions) SignatureHelpOptions(org.eclipse.lsp4j.SignatureHelpOptions) InitializeResult(org.eclipse.lsp4j.InitializeResult) CodeActionOptions(org.eclipse.lsp4j.CodeActionOptions) JsonObject(com.google.gson.JsonObject) ServerCapabilities(org.eclipse.lsp4j.ServerCapabilities) WorkspaceServerCapabilities(org.eclipse.lsp4j.WorkspaceServerCapabilities) WorkspaceFoldersOptions(org.eclipse.lsp4j.WorkspaceFoldersOptions) ExecuteCommandOptions(org.eclipse.lsp4j.ExecuteCommandOptions) WorkspaceServerCapabilities(org.eclipse.lsp4j.WorkspaceServerCapabilities) WorkspaceFolder(org.eclipse.lsp4j.WorkspaceFolder)

Aggregations

CodeActionOptions (org.eclipse.lsp4j.CodeActionOptions)9 ServerCapabilities (org.eclipse.lsp4j.ServerCapabilities)5 ArrayList (java.util.ArrayList)4 CompletionOptions (org.eclipse.lsp4j.CompletionOptions)4 ExecuteCommandOptions (org.eclipse.lsp4j.ExecuteCommandOptions)4 List (java.util.List)3 SignatureHelpOptions (org.eclipse.lsp4j.SignatureHelpOptions)3 JsonObject (com.google.gson.JsonObject)2 Collections (java.util.Collections)2 CompletableFuture (java.util.concurrent.CompletableFuture)2 CodeAction (org.eclipse.lsp4j.CodeAction)2 InitializeResult (org.eclipse.lsp4j.InitializeResult)2 RenameOptions (org.eclipse.lsp4j.RenameOptions)2 WorkspaceFolder (org.eclipse.lsp4j.WorkspaceFolder)2 Either (org.eclipse.lsp4j.jsonrpc.messages.Either)2 Objects (com.google.common.base.Objects)1 Optional (com.google.common.base.Optional)1 Stopwatch (com.google.common.base.Stopwatch)1 ImmutableList (com.google.common.collect.ImmutableList)1 ImmutableMap (com.google.common.collect.ImmutableMap)1