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

2019-08-14 Thread Johan Vikström via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL368834: [clangd] Loading TokenColorRules as a class mapping the rules to their… (authored by jvikstrom, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed

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

2019-08-14 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. thanks, looks good. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65856/new/ https://reviews.llvm.org/D65856

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

2019-08-14 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 215065. jvikstrom marked 4 inline comments as done. jvikstrom added a comment. Simplified matching code. Use real scopes for test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65856/new/

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

2019-08-14 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/clients/clangd-vscode/src/semantic-highlighting.ts:128 + // Find the rule wich is the longest prefix of scope. + if (rule.scope.length <= scope.length && + scope.substr(0, rule.scope.length)

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

2019-08-13 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 214845. jvikstrom marked an inline comment as done. jvikstrom added a comment. Added fixme for ranking. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65856/new/ https://reviews.llvm.org/D65856 Files:

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

2019-08-13 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/clients/clangd-vscode/src/semantic-highlighting.ts:128 + // Find the rule wich is the longest prefix of scope. + if (rule.scope.length <= scope.length && + scope.substr(0,

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

2019-08-13 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 214844. jvikstrom marked 4 inline comments as done. jvikstrom added a comment. Changed variable name. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65856/new/ https://reviews.llvm.org/D65856 Files:

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

2019-08-13 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/clients/clangd-vscode/src/semantic-highlighting.ts:131 +this.rules.forEach((rule) => { + if (rule.scope.length <= scope.length && + scope.substr(0, rule.scope.length) === rule.scope &&

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

2019-08-13 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/clients/clangd-vscode/src/semantic-highlighting.ts:131 +this.rules.forEach((rule) => { + if (rule.scope.length <= scope.length && + scope.substr(0, rule.scope.length) === rule.scope &&

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

2019-08-13 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 214834. jvikstrom added a comment. Removed stray edits from loadTheme. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65856/new/ https://reviews.llvm.org/D65856 Files:

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

2019-08-13 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 214833. jvikstrom marked 4 inline comments as done. jvikstrom added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65856/new/ https://reviews.llvm.org/D65856 Files:

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

2019-08-13 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/clients/clangd-vscode/src/semantic-highlighting.ts:65 +const name = +vscode.workspace.getConfiguration('workbench').get('colorTheme'); +if (typeof name != 'string') { maybe just

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

2019-08-13 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 214814. jvikstrom added a comment. Added a missing test case. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65856/new/ https://reviews.llvm.org/D65856 Files:

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

2019-08-13 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 214813. jvikstrom added a comment. Lazy load the best theme rule for a scope. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65856/new/ https://reviews.llvm.org/D65856 Files:

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

2019-08-13 Thread Haojian Wu via Phabricator via cfe-commits
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

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

2019-08-13 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 214779. jvikstrom added a comment. Updated patch description. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65856/new/ https://reviews.llvm.org/D65856 Files:

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

2019-08-13 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 214778. jvikstrom added a comment. Updated to use string[][] as scopes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65856/new/ https://reviews.llvm.org/D65856 Files:

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

2019-08-13 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 214774. jvikstrom added a comment. Rebased into master. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65856/new/ https://reviews.llvm.org/D65856 Files:

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

2019-08-07 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom created this revision. jvikstrom added reviewers: hokein, ilya-biryukov. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay. Herald added a project: clang. Maps an array of TM scopes to the most specific scope that is added. Needed to have fast access to a rule