Search in sources :

Example 1 with DidChangeWatchedFilesRegistrationOptions

use of org.springframework.ide.vscode.commons.languageserver.json.DidChangeWatchedFilesRegistrationOptions 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

Arrays (java.util.Arrays)1 Collection (java.util.Collection)1 List (java.util.List)1 Consumer (java.util.function.Consumer)1 Collectors (java.util.stream.Collectors)1 Registration (org.eclipse.lsp4j.Registration)1 RegistrationParams (org.eclipse.lsp4j.RegistrationParams)1 Unregistration (org.eclipse.lsp4j.Unregistration)1 UnregistrationParams (org.eclipse.lsp4j.UnregistrationParams)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