Search in sources :

Example 6 with Registration

use of org.eclipse.lsp4j.Registration 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 Registration

use of org.eclipse.lsp4j.Registration 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

Registration (org.eclipse.lsp4j.Registration)7 RegistrationParams (org.eclipse.lsp4j.RegistrationParams)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 Consumer (java.util.function.Consumer)1 Collectors (java.util.stream.Collectors)1 ExecuteCommandOptions (org.eclipse.lsp4j.ExecuteCommandOptions)1 ExecuteCommandParams (org.eclipse.lsp4j.ExecuteCommandParams)1 DidChangeWatchedFilesRegistrationOptions (org.springframework.ide.vscode.commons.languageserver.json.DidChangeWatchedFilesRegistrationOptions)1 FileSystemWatcher (org.springframework.ide.vscode.commons.languageserver.json.FileSystemWatcher)1 BasicFileObserver (org.springframework.ide.vscode.commons.util.BasicFileObserver)1 Disposable (reactor.core.Disposable)1