use of org.eclipse.lsp4j.DidChangeConfigurationParams in project eclipse.jdt.ls by eclipse.
the class JDTLanguageServerTest method testRegisterDynamicCapabilities.
@Test
public void testRegisterDynamicCapabilities() throws Exception {
setDynamicCapabilities(true);
Map<String, Object> map = new HashMap<>();
map.put(Preferences.REFERENCES_CODE_LENS_ENABLED_KEY, true);
map.put(Preferences.JAVA_FORMAT_ENABLED_KEY, true);
map.put(Preferences.SIGNATURE_HELP_ENABLED_KEY, true);
map.put(Preferences.EXECUTE_COMMAND_ENABLED_KEY, true);
DidChangeConfigurationParams params = new DidChangeConfigurationParams(map);
server.didChangeConfiguration(params);
verify(client, times(5)).registerCapability(any());
// On 2nd call, no registration call should be emitted
reset(client);
server.didChangeConfiguration(params);
verify(client, never()).registerCapability(any());
// unregister capabilities
reset(client);
map.put(Preferences.REFERENCES_CODE_LENS_ENABLED_KEY, false);
map.put(Preferences.JAVA_FORMAT_ENABLED_KEY, false);
map.put(Preferences.SIGNATURE_HELP_ENABLED_KEY, false);
map.put(Preferences.EXECUTE_COMMAND_ENABLED_KEY, false);
params = new DidChangeConfigurationParams(map);
server.didChangeConfiguration(params);
verify(client, times(5)).unregisterCapability(any());
// On 2nd call, no unregistration calls should be emitted
reset(client);
server.didChangeConfiguration(params);
verify(client, never()).unregisterCapability(any());
}
use of org.eclipse.lsp4j.DidChangeConfigurationParams in project eclipse.jdt.ls by eclipse.
the class JDTLanguageServerTest method testNoDynamicCapabilities.
@Test
public void testNoDynamicCapabilities() throws Exception {
setDynamicCapabilities(false);
Map<String, Object> map = new HashMap<>();
map.put(Preferences.REFERENCES_CODE_LENS_ENABLED_KEY, true);
map.put(Preferences.JAVA_FORMAT_ENABLED_KEY, true);
map.put(Preferences.SIGNATURE_HELP_ENABLED_KEY, true);
map.put(Preferences.EXECUTE_COMMAND_ENABLED_KEY, true);
DidChangeConfigurationParams params = new DidChangeConfigurationParams(map);
server.didChangeConfiguration(params);
verify(client, never()).registerCapability(any());
// unregister capabilities
map.put(Preferences.REFERENCES_CODE_LENS_ENABLED_KEY, false);
map.put(Preferences.JAVA_FORMAT_ENABLED_KEY, false);
map.put(Preferences.SIGNATURE_HELP_ENABLED_KEY, false);
map.put(Preferences.EXECUTE_COMMAND_ENABLED_KEY, false);
params = new DidChangeConfigurationParams(map);
server.didChangeConfiguration(params);
verify(client, never()).unregisterCapability(any());
}
use of org.eclipse.lsp4j.DidChangeConfigurationParams in project eclipse.jdt.ls by eclipse.
the class JDTLanguageServerTest method testAutobuilding.
@Test
public void testAutobuilding() throws Exception {
boolean enabled = isAutoBuilding();
try {
assertTrue("Autobuilding is off", isAutoBuilding());
Map<String, Object> map = new HashMap<>();
map.put(Preferences.AUTOBUILD_ENABLED_KEY, false);
DidChangeConfigurationParams params = new DidChangeConfigurationParams(map);
server.didChangeConfiguration(params);
assertFalse("Autobuilding is on", isAutoBuilding());
} finally {
projManager.setAutoBuilding(enabled);
}
}
use of org.eclipse.lsp4j.DidChangeConfigurationParams in project sts4 by spring-projects.
the class CloudFoundryManifestLanguageServer method updateLanguageServer.
protected void updateLanguageServer() {
DidChangeConfigurationParams params = new DidChangeConfigurationParams(getInitializationOptions(rootPath));
languageServer.getWorkspaceService().didChangeConfiguration(params);
}
use of org.eclipse.lsp4j.DidChangeConfigurationParams in project sts4 by spring-projects.
the class DelegatingStreamConnectionProvider method sendConfiguration.
private void sendConfiguration() {
Map<String, Object> settings = new HashMap<>();
Map<String, Object> bootJavaObj = new HashMap<>();
Map<String, Object> bootHint = new HashMap<>();
bootHint.put("on", BootLanguageServerPlugin.getDefault().getPreferenceStore().getBoolean(Constants.PREF_BOOT_HINTS));
bootJavaObj.put("boot-hints", bootHint);
settings.put("boot-java", bootJavaObj);
this.languageServer.getWorkspaceService().didChangeConfiguration(new DidChangeConfigurationParams(settings));
}
Aggregations