use of org.eclipse.jdt.ls.core.internal.preferences.Preferences in project eclipse.jdt.ls by eclipse.
the class JDTLanguageServer method didChangeConfiguration.
/* (non-Javadoc)
* @see org.eclipse.lsp4j.services.WorkspaceService#didChangeConfiguration(org.eclipse.lsp4j.DidChangeConfigurationParams)
*/
@Override
public void didChangeConfiguration(DidChangeConfigurationParams params) {
logInfo(">> workspace/didChangeConfiguration");
Object settings = JSONUtility.toModel(params.getSettings(), Map.class);
if (settings instanceof Map) {
@SuppressWarnings("unchecked") Preferences prefs = Preferences.createFrom((Map<String, Object>) settings);
preferenceManager.update(prefs);
}
syncCapabilitiesToSettings();
boolean jvmChanged = false;
try {
jvmChanged = configureVM();
} catch (Exception e) {
JavaLanguageServerPlugin.logException(e.getMessage(), e);
}
try {
boolean autoBuildChanged = pm.setAutoBuilding(preferenceManager.getPreferences().isAutobuildEnabled());
if (jvmChanged) {
buildWorkspace(true);
} else if (autoBuildChanged) {
buildWorkspace(false);
}
} catch (CoreException e) {
JavaLanguageServerPlugin.logException(e.getMessage(), e);
}
pm.registerWatchers();
logInfo(">>New configuration: " + settings);
}
use of org.eclipse.jdt.ls.core.internal.preferences.Preferences in project eclipse.jdt.ls by eclipse.
the class ImportOrganizeTest method setOrganizeImportSettings.
protected void setOrganizeImportSettings(String[] order) {
Preferences prefs = JavaLanguageServerPlugin.getPreferencesManager().getPreferences();
List<String> importOrder = new ArrayList<>();
if (order != null) {
importOrder.addAll(Arrays.asList(order));
}
prefs.setImportOrder(importOrder);
}
Aggregations