[PATCH] D66735: [clangd] Handling text editor/document lifetimes in vscode extension.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 26 05:49:30 PDT 2019


hokein added inline comments.


================
Comment at: clang-tools-extra/clangd/clients/clangd-vscode/src/semantic-highlighting.ts:94
+    vscode.window.onDidChangeVisibleTextEditors(
+        () => this.highlighter.onDidChangeVisibleTextEditors());
+    vscode.workspace.onDidCloseTextDocument(
----------------
I think we can do it like `vscode.window.onDidChangeVisibleTextEditors((TextEditor[] editors) => { // call applyHighlight for each text editor })`.


================
Comment at: clang-tools-extra/clangd/clients/clangd-vscode/src/semantic-highlighting.ts:176
+  // the text document that was closed.
+  public onDidCloseTextDocument(fileUri: string) {
+    // If there exists no entry the call to delete just returns false.
----------------
the name is a bit weird `onDidCloseTextDocument` in the `Highlighter`, I would name it `removeFileHighlights`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66735





More information about the cfe-commits mailing list