[PATCH] D67096: [clangd][vscode] Add a flag to enable semantic highlighting in clangd

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 5 02:26:32 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL371038: [clangd][vscode] Add a flag to enable semantic highlighting in clangd (authored by hokein, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D67096?vs=218864&id=218865#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67096/new/

https://reviews.llvm.org/D67096

Files:
  clang-tools-extra/trunk/clangd/clients/clangd-vscode/package.json
  clang-tools-extra/trunk/clangd/clients/clangd-vscode/src/extension.ts


Index: clang-tools-extra/trunk/clangd/clients/clangd-vscode/src/extension.ts
===================================================================
--- clang-tools-extra/trunk/clangd/clients/clangd-vscode/src/extension.ts
+++ clang-tools-extra/trunk/clangd/clients/clangd-vscode/src/extension.ts
@@ -109,12 +109,14 @@
 
   const clangdClient = new ClangdLanguageClient('Clang Language Server',
                                                 serverOptions, clientOptions);
-  const semanticHighlightingFeature =
+  if (getConfig<boolean>('semanticHighlighting')) {
+    const semanticHighlightingFeature =
       new semanticHighlighting.SemanticHighlightingFeature(clangdClient,
-                                                           context);
-  context.subscriptions.push(
+        context);
+    context.subscriptions.push(
       vscode.Disposable.from(semanticHighlightingFeature));
-  clangdClient.registerFeature(semanticHighlightingFeature);
+    clangdClient.registerFeature(semanticHighlightingFeature);
+  }
   console.log('Clang Language Server is now active!');
   context.subscriptions.push(clangdClient.start());
   context.subscriptions.push(vscode.commands.registerCommand(
Index: clang-tools-extra/trunk/clangd/clients/clangd-vscode/package.json
===================================================================
--- clang-tools-extra/trunk/clangd/clients/clangd-vscode/package.json
+++ clang-tools-extra/trunk/clangd/clients/clangd-vscode/package.json
@@ -89,6 +89,11 @@
                 "clangd.trace": {
                     "type": "string",
                     "description": "Names a file that clangd should log a performance trace to, in chrome trace-viewer JSON format."
+                },
+                "clangd.semanticHighlighting": {
+                    "type": "boolean",
+                    "default": "false",
+                    "description": "Enable semantic highlighting in clangd"
                 }
             }
         },


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67096.218865.patch
Type: text/x-patch
Size: 1977 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190905/1c1e461c/attachment.bin>


More information about the cfe-commits mailing list