summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManish Khurana2018-07-25 10:50:12 -0400
committerNathan Ridge2018-07-25 21:20:39 -0400
commitc00975241d100f62448be00f809ff45ff43bafe9 (patch)
tree06a5ac5d714d4640f6db86cd9013cf3a7667eac7
parent52fab3d8afa819a16c7f34c95a2ca3ccc4ee671e (diff)
downloadorg.eclipse.cdt-c00975241d100f62448be00f809ff45ff43bafe9.tar.gz
org.eclipse.cdt-c00975241d100f62448be00f809ff45ff43bafe9.tar.xz
org.eclipse.cdt-c00975241d100f62448be00f809ff45ff43bafe9.zip
Bug 537385. Add initialization options for inactive regions and semantic highlights
Change-Id: I79ef622fa3ae48f055a55d9347a53eddc4fc6b8b Signed-off-by: Manish Khurana <mkmanishkhurana98@gmail.com>
-rw-r--r--lsp4e-cpp/org.eclipse.lsp4e.cpp.language/src/org/eclipse/lsp4e/cpp/language/CqueryLanguageServer.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/lsp4e-cpp/org.eclipse.lsp4e.cpp.language/src/org/eclipse/lsp4e/cpp/language/CqueryLanguageServer.java b/lsp4e-cpp/org.eclipse.lsp4e.cpp.language/src/org/eclipse/lsp4e/cpp/language/CqueryLanguageServer.java
index 2f71e59e8f..80d637e82b 100644
--- a/lsp4e-cpp/org.eclipse.lsp4e.cpp.language/src/org/eclipse/lsp4e/cpp/language/CqueryLanguageServer.java
+++ b/lsp4e-cpp/org.eclipse.lsp4e.cpp.language/src/org/eclipse/lsp4e/cpp/language/CqueryLanguageServer.java
@@ -9,8 +9,12 @@
package org.eclipse.lsp4e.cpp.language;
import java.net.URI;
+
+import org.eclipse.cdt.internal.ui.editor.CEditor;
+import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
+
import com.google.gson.JsonObject;
public class CqueryLanguageServer implements ICPPLanguageServer {
@@ -21,6 +25,10 @@ public class CqueryLanguageServer implements ICPPLanguageServer {
IPath cacheDirectory = Path.fromOSString(rootPath.getPath()).append(".lsp4e-cpp/cquery_index"); //$NON-NLS-1$
JsonObject result = (defaultInitOptions instanceof JsonObject) ? (JsonObject) defaultInitOptions : new JsonObject();
result.addProperty("cacheDirectory", cacheDirectory.toString()); //$NON-NLS-1$
+ result.addProperty("emitInactiveRegions", CUIPlugin.getDefault().getPreferenceStore().getBoolean(CEditor.INACTIVE_CODE_ENABLE)); //$NON-NLS-1$
+ JsonObject semanticHighlights = new JsonObject();
+ semanticHighlights.addProperty("enabled", CUIPlugin.getDefault().getPreferenceStore().getBoolean(org.eclipse.cdt.ui.PreferenceConstants.EDITOR_SEMANTIC_HIGHLIGHTING_ENABLED)); //$NON-NLS-1$
+ result.add("highlight", semanticHighlights); //$NON-NLS-1$
return result;
}