Search in sources :

Example 6 with RegistrationParams

use of org.eclipse.lsp4j.RegistrationParams in project sts4 by spring-projects.

the class SimpleLanguageServer method initialized.

@Override
public void initialized() {
    async.withLog(log, () -> {
        Registration registration = new Registration(WORKSPACE_FOLDERS_CAPABILITY_ID, WORKSPACE_FOLDERS_CAPABILITY_NAME, null);
        RegistrationParams registrationParams = new RegistrationParams(Collections.singletonList(registration));
        getClient().registerCapability(registrationParams);
        // triggers onInitialized handlers.
        this.initialized.complete(null);
    });
}
Also used : RegistrationParams(org.eclipse.lsp4j.RegistrationParams) Registration(org.eclipse.lsp4j.Registration)

Example 7 with RegistrationParams

use of org.eclipse.lsp4j.RegistrationParams in project sts4 by spring-projects.

the class SimpleServerFileObserver method subscribe.

private void subscribe(String subscriptionId, List<String> globPattern, int kind) {
    if (server.canRegisterFileWatchersDynamically()) {
        List<FileSystemWatcher> watchers = globPattern.stream().map(pattern -> new FileSystemWatcher(pattern, kind)).collect(Collectors.toList());
        Registration registration = new Registration(subscriptionId, WORKSPACE_DID_CHANGE_WATCHED_FILES, new DidChangeWatchedFilesRegistrationOptions(watchers));
        server.getClient().registerCapability(new RegistrationParams(Arrays.asList(registration)));
    }
}
Also used : Consumer(java.util.function.Consumer) FileSystemWatcher(org.springframework.ide.vscode.commons.languageserver.json.FileSystemWatcher) Arrays(java.util.Arrays) List(java.util.List) RegistrationParams(org.eclipse.lsp4j.RegistrationParams) UnregistrationParams(org.eclipse.lsp4j.UnregistrationParams) DidChangeWatchedFilesRegistrationOptions(org.springframework.ide.vscode.commons.languageserver.json.DidChangeWatchedFilesRegistrationOptions) Collection(java.util.Collection) Unregistration(org.eclipse.lsp4j.Unregistration) Collectors(java.util.stream.Collectors) Registration(org.eclipse.lsp4j.Registration) BasicFileObserver(org.springframework.ide.vscode.commons.util.BasicFileObserver) FileSystemWatcher(org.springframework.ide.vscode.commons.languageserver.json.FileSystemWatcher) RegistrationParams(org.eclipse.lsp4j.RegistrationParams) Registration(org.eclipse.lsp4j.Registration) DidChangeWatchedFilesRegistrationOptions(org.springframework.ide.vscode.commons.languageserver.json.DidChangeWatchedFilesRegistrationOptions)

Aggregations

RegistrationParams (org.eclipse.lsp4j.RegistrationParams)7 Registration (org.eclipse.lsp4j.Registration)6 Unregistration (org.eclipse.lsp4j.Unregistration)3 UnregistrationParams (org.eclipse.lsp4j.UnregistrationParams)3 List (java.util.List)2 ImmutableList (com.google.common.collect.ImmutableList)1 JsonElement (com.google.gson.JsonElement)1 Arrays (java.util.Arrays)1 Collection (java.util.Collection)1 CompletableFuture (java.util.concurrent.CompletableFuture)1 Consumer (java.util.function.Consumer)1 Collectors (java.util.stream.Collectors)1 ApplyWorkspaceEditParams (org.eclipse.lsp4j.ApplyWorkspaceEditParams)1 ApplyWorkspaceEditResponse (org.eclipse.lsp4j.ApplyWorkspaceEditResponse)1 ClientCapabilities (org.eclipse.lsp4j.ClientCapabilities)1 CompletionCapabilities (org.eclipse.lsp4j.CompletionCapabilities)1 CompletionItemCapabilities (org.eclipse.lsp4j.CompletionItemCapabilities)1 ExecuteCommandCapabilities (org.eclipse.lsp4j.ExecuteCommandCapabilities)1 ExecuteCommandOptions (org.eclipse.lsp4j.ExecuteCommandOptions)1 ExecuteCommandParams (org.eclipse.lsp4j.ExecuteCommandParams)1