[PATCH] D66406: [clangd] Update theme when color theme changes in vscode extension.

Johan Vikström via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 29 01:40:57 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL370305: [clangd] Update themeRuleMatcher when color theme changes in vscode extension. (authored by jvikstrom, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D66406?vs=217785&id=217794#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D66406

Files:
  clang-tools-extra/trunk/clangd/clients/clangd-vscode/src/semantic-highlighting.ts


Index: clang-tools-extra/trunk/clangd/clients/clangd-vscode/src/semantic-highlighting.ts
===================================================================
--- clang-tools-extra/trunk/clangd/clients/clangd-vscode/src/semantic-highlighting.ts
+++ clang-tools-extra/trunk/clangd/clients/clangd-vscode/src/semantic-highlighting.ts
@@ -91,6 +91,13 @@
     // highlighter being created.
     this.highlighter = new Highlighter(this.scopeLookupTable);
     this.subscriptions.push(vscode.Disposable.from(this.highlighter));
+    // Adds a listener to reload the theme when it changes.
+    this.subscriptions.push(
+        vscode.workspace.onDidChangeConfiguration((conf) => {
+          if (!conf.affectsConfiguration('workbench.colorTheme'))
+            return;
+          this.loadCurrentTheme();
+        }));
     this.loadCurrentTheme();
     // Event handling for handling with TextDocuments/Editors lifetimes.
     this.subscriptions.push(vscode.window.onDidChangeVisibleTextEditors(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66406.217794.patch
Type: text/x-patch
Size: 989 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190829/0bd34bc8/attachment-0001.bin>


More information about the cfe-commits mailing list