[PATCH] D65856: [clangd] Added class for mapping TokenColorRules to their associated clangd TextMate scope

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 13 03:55:17 PDT 2019


hokein added a comment.

I think we could make the layering clearer:

- we now have a list of theme color rules, and scope names provided by clangd; and we we want to find the best match theme rule for a particular clangd scope;
- we could define a function like `getBestThemeRule(clangd_scope_name: string)` - when we render a token, we get the index of the lookup table, find the exact clangd scope name, and call the function to get the corresponding theme rule;
- we need to cache the result to avoid re-computing, we could make the function as a class method;


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D65856





More information about the cfe-commits mailing list