[PATCH] D67537: [clangd] Client-side support for inactive regions

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 22 08:12:13 PST 2020


hokein added a comment.

sorry for the looong delay, I was OOO for a few weeks before.

The patch looks fine, my concern is that how do we support this `line` extension when LSP provides a standard implementation -- there is some significant progress about semantic highlighting on VSCode,  VSCode now provides an experimental semantic token API <https://github.com/microsoft/vscode/wiki/Semantic-Highlighting-Overview>, but no LSP binding yet (is not far away I think). When it is ready, we'd like to switch to that and get rid of our own implementation. Looking at the API there, it seems like we could make the line-style scope name `meta.disable` clangd specific, and define our own style.



================
Comment at: clang-tools-extra/clangd/clients/clangd-vscode/src/semantic-highlighting.ts:293
       });
+      if (line.isInactive) {
+        inactiveRanges.push(new vscode.Range(
----------------
 another solution that requires minimal changes (but more hacky) is that, since clangd emits a `meta.disabled` token with line-set-only range, we could inject the `inactiveCodeDecorationType` to the `meta.disabled` slot of `Highlighter::decorationTypes`, and everything should work.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D67537





More information about the cfe-commits mailing list