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(
----------------
jvikstrom wrote:
> hokein wrote:
> > I think we can do it like 
> > `vscode.window.onDidChangeVisibleTextEditors((TextEditor[] editors) => { // 
> > call applyHighlight for each text editor })`.
> There might be TextEditors that are not a c++ file/haven't gotten 
> highlightings yet.
> 
> So we'd still need to do the this.files.has(fileUri) check which we also do 
> in the initialize function. 
> 
> Maybe I should just expose the reapplyAllHighlightings function and call that 
> one instead?
if the file is not a c++, the current implementation of `applyHighlights` is 
tolerant with that I think, it doesn't do anything (we get an empty decoration 
ranges).

I think we can do the ` this.files.has(fileUri)` check in `applyHighlights`. 




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66735



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to