mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
Bug 537385. Add initialization options for inactive regions and semantic highlights
Change-Id: I79ef622fa3ae48f055a55d9347a53eddc4fc6b8b Signed-off-by: Manish Khurana <mkmanishkhurana98@gmail.com>
This commit is contained in:
parent
52fab3d8af
commit
c00975241d
1 changed files with 8 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue