Search in sources :

Example 1 with JavaLanguageServerPlugin.logException

use of org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin.logException 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);
}
Also used : CoreException(org.eclipse.core.runtime.CoreException) Preferences(org.eclipse.jdt.ls.core.internal.preferences.Preferences) Map(java.util.Map) CoreException(org.eclipse.core.runtime.CoreException) OperationCanceledException(org.eclipse.core.runtime.OperationCanceledException) JavaLanguageServerPlugin.logException(org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin.logException)

Aggregations

Map (java.util.Map)1 CoreException (org.eclipse.core.runtime.CoreException)1 OperationCanceledException (org.eclipse.core.runtime.OperationCanceledException)1 JavaLanguageServerPlugin.logException (org.eclipse.jdt.ls.core.internal.JavaLanguageServerPlugin.logException)1 Preferences (org.eclipse.jdt.ls.core.internal.preferences.Preferences)1