use of org.eclipse.lsp4j.InitializeResult in project eclipse.jdt.ls by eclipse.
the class InitHandlerTest method testRegisterDelayedCapability.
@Test
public void testRegisterDelayedCapability() throws Exception {
ClientPreferences mockCapabilies = mock(ClientPreferences.class);
when(preferenceManager.getClientPreferences()).thenReturn(mockCapabilies);
when(mockCapabilies.isDocumentSymbolDynamicRegistered()).thenReturn(Boolean.TRUE);
when(mockCapabilies.isWorkspaceSymbolDynamicRegistered()).thenReturn(Boolean.TRUE);
when(mockCapabilies.isDocumentSymbolDynamicRegistered()).thenReturn(Boolean.TRUE);
when(mockCapabilies.isCodeActionDynamicRegistered()).thenReturn(Boolean.TRUE);
when(mockCapabilies.isDefinitionDynamicRegistered()).thenReturn(Boolean.TRUE);
when(mockCapabilies.isHoverDynamicRegistered()).thenReturn(Boolean.TRUE);
when(mockCapabilies.isReferencesDynamicRegistered()).thenReturn(Boolean.TRUE);
when(mockCapabilies.isDocumentHighlightDynamicRegistered()).thenReturn(Boolean.TRUE);
InitializeResult result = initialize(true);
assertNull(result.getCapabilities().getDocumentSymbolProvider());
server.initialized(new InitializedParams());
verify(client, times(7)).registerCapability(any());
}
use of org.eclipse.lsp4j.InitializeResult in project freemarker-languageserver by angelozerr.
the class FreemarkerLanguageServer method initialize.
@Override
public CompletableFuture<InitializeResult> initialize(InitializeParams params) {
ServerCapabilities capabilities = new ServerCapabilities();
capabilities.setTextDocumentSync(TextDocumentSyncKind.Full);
capabilities.setDocumentSymbolProvider(true);
InitializeResult result = new InitializeResult(capabilities);
return CompletableFuture.completedFuture(result);
}
use of org.eclipse.lsp4j.InitializeResult in project sts4 by spring-projects.
the class DelegatingStreamConnectionProvider method handleMessage.
@Override
public void handleMessage(Message message, LanguageServer languageServer, URI rootURI) {
if (message instanceof ResponseMessage) {
ResponseMessage responseMessage = (ResponseMessage) message;
if (responseMessage.getResult() instanceof InitializeResult) {
this.languageServer = languageServer;
sendConfiguration();
// Add config listener
BootLanguageServerPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(configListener);
// Add resource listener
ResourcesPlugin.getWorkspace().addResourceChangeListener(fResourceListener = new ResourceListener(languageServer, Arrays.asList(FileSystems.getDefault().getPathMatcher("glob:**/pom.xml"), FileSystems.getDefault().getPathMatcher("glob:**/*.gradle"), FileSystems.getDefault().getPathMatcher("glob:**/*.java"))));
}
}
}
use of org.eclipse.lsp4j.InitializeResult in project sts4 by spring-projects.
the class CloudFoundryManifestLanguageServer method handleMessage.
@Override
public void handleMessage(Message message, LanguageServer languageServer, URI rootPath) {
if (message instanceof ResponseMessage) {
ResponseMessage responseMessage = (ResponseMessage) message;
if (responseMessage.getResult() instanceof InitializeResult) {
this.languageServer = languageServer;
this.rootPath = rootPath;
updateLanguageServer();
addLanguageServer(this);
}
}
}
use of org.eclipse.lsp4j.InitializeResult in project vscode-nextgenas by BowlerHatLLC.
the class ActionScriptLanguageServer method initialize.
/**
* Tells Visual Studio Code about the language server's capabilities.
*/
@Override
public CompletableFuture<InitializeResult> initialize(InitializeParams params) {
Path workspaceRoot = Paths.get(params.getRootPath()).toAbsolutePath().normalize();
projectConfigStrategy.setASConfigPath(workspaceRoot.resolve(ASCONFIG_JSON));
textDocumentService.setWorkspaceRoot(workspaceRoot);
InitializeResult result = new InitializeResult();
ServerCapabilities serverCapabilities = new ServerCapabilities();
serverCapabilities.setTextDocumentSync(TextDocumentSyncKind.Incremental);
serverCapabilities.setCodeActionProvider(true);
CompletionOptions completionOptions = new CompletionOptions();
completionOptions.setTriggerCharacters(Arrays.asList(".", ":", " ", "<"));
serverCapabilities.setCompletionProvider(completionOptions);
serverCapabilities.setDefinitionProvider(true);
serverCapabilities.setDocumentSymbolProvider(true);
serverCapabilities.setDocumentHighlightProvider(false);
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);
result.setCapabilities(serverCapabilities);
return CompletableFuture.completedFuture(result);
}
Aggregations