[PATCH] D64634: [clangd] Fix duplicate highlighting tokens appearing in initializer lists

2019-07-15 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom marked an inline comment as done. jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:36 +// must be deduplicated. +std::sort(Tokens.begin(), Tokens.end()); +for (unsigned I = 1; I < Tokens.size(); ++I) {

[PATCH] D64634: [clangd] Fix duplicate highlighting tokens appearing in initializer lists

2019-07-15 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 209775. jvikstrom added a comment. Removed return type hint for lambda. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64634/new/ https://reviews.llvm.org/D64634 Files:

[PATCH] D64624: [clangd] Added highlighting to enum constants.

2019-07-15 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom marked an inline comment as done. jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:257 + case HighlightingKind::EnumConstant: +return "constant.other.enum.cpp"; case HighlightingKind::Namespace:

[PATCH] D64624: [clangd] Added highlighting to enum constants.

2019-07-15 Thread Johan Vikström via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL366045: [clangd] Added highlighting to enum constants. (authored by jvikstrom, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit:

[PATCH] D64617: [clangd] Added highlighting for members and methods

2019-07-15 Thread Johan Vikström via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL366047: [clangd] Added highlighting for members and methods. (authored by jvikstrom, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit:

[PATCH] D64634: [clangd] Fix duplicate highlighting tokens appearing in initializer lists

2019-07-15 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 209774. jvikstrom added a comment. Readded newline that was removed accidentaly. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64634/new/ https://reviews.llvm.org/D64634 Files:

[PATCH] D64634: [clangd] Fix duplicate highlighting tokens appearing in initializer lists

2019-07-15 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 209773. jvikstrom added a comment. Remove operator< and use std::unique. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64634/new/ https://reviews.llvm.org/D64634 Files:

[PATCH] D64475: [clangd] Duplicate lines of semantic highlightings sent removed.

2019-07-16 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 210079. jvikstrom added a comment. Moved highlighting state to LSP layer. Removed class holding state. Addressed comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64475/new/

[PATCH] D64754: [clangd] Added highlighting for the targets in typedefs.

2019-07-16 Thread Johan Vikström via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL366207: [clangd] Added highlighting for the targets in typedefs and using. (authored by jvikstrom, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to

[PATCH] D64754: [clangd] Added highlighting for the targets in typedefs.

2019-07-16 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 210053. jvikstrom added a comment. Add support for using `A = ...`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64754/new/ https://reviews.llvm.org/D64754 Files:

[PATCH] D64634: [clangd] Fix duplicate highlighting tokens appearing in initializer lists

2019-07-15 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom added a comment. In D64634#1585521 , @ilya-biryukov wrote: > Have we tried figuring out why `RecursiveASTVisitor` visits the argument > lists twice? Is that an expected behavior? The comment for the function that traverses initialization

[PATCH] D64634: [clangd] Fix duplicate highlighting tokens appearing in initializer lists

2019-07-15 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 209852. jvikstrom marked an inline comment as done. jvikstrom added a comment. Address comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64634/new/ https://reviews.llvm.org/D64634 Files:

[PATCH] D64741: [clangd] Added highlighting for tokens that are macro arguments.

2019-07-15 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom created this revision. jvikstrom added reviewers: hokein, sammccall, ilya-biryukov. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay. Herald added a project: clang. Adds semantic highlighting for tokens that are a macro argument. Example: #define D_V(X) int

[PATCH] D64634: [clangd] Fix duplicate highlighting tokens appearing in initializer lists

2019-07-15 Thread Johan Vikström via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL366070: [clangd] Fix duplicate highlighting tokens appearing in initializer lists. (authored by jvikstrom, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed

[PATCH] D63821: [clangd] Added C++ API code for semantic highlighting

2019-06-27 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom marked 2 inline comments as done. jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/ClangdServer.h:60 + // Called by ClangdServer when some \p Highlightings for \p File are ready. + virtual void onHighlightingsReady(PathRef File, +

[PATCH] D63821: [clangd] Added C++ API code for semantic highlighting

2019-06-27 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 206832. jvikstrom marked 9 inline comments as done. jvikstrom added a comment. Separated test and gave consumer an empty definition. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63821/new/

[PATCH] D63874: [clangd] No need to setTraversalScope in SemanticHighlighting.

2019-06-27 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom accepted this revision. jvikstrom added a comment. This revision is now accepted and ready to land. lgtm Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63874/new/ https://reviews.llvm.org/D63874

[PATCH] D63821: [clangd] Added C++ API code for semantic highlighting

2019-06-27 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 206841. jvikstrom marked an inline comment as done. jvikstrom added a comment. Simplified test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63821/new/ https://reviews.llvm.org/D63821 Files:

[PATCH] D63821: [clangd] Added C++ API code for semantic highlighting

2019-06-27 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom marked an inline comment as done. jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/ClangdLSPServer.h:60 + void + onHighlightingsReady(PathRef File, + std::vector Highlightings) override; hokein wrote: > nit:

[PATCH] D63559: [clangd] Added functionality for getting semantic highlights for variable and function declarations

2019-06-26 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 206593. jvikstrom marked 24 inline comments as done. jvikstrom added a comment. Fixed a bunch of small comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63559/new/ https://reviews.llvm.org/D63559

[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 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: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 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] D66083: [clangd] Remove highlightings coming from non topLevelDecls from included files.

2019-08-12 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. It is possible to write include code from other files so that the decls from there do not become

[PATCH] D65998: [clangd] Added the vscode SemanticHighlighting feature code but did not enable it in the client.

2019-08-12 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 214613. jvikstrom marked 4 inline comments as done. jvikstrom added a comment. Mirror the LSP proposal SemanticHighlightingParams/Information types. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65998/new/

[PATCH] D66083: [clangd] Remove highlightings coming from non topLevelDecls from included files.

2019-08-12 Thread Johan Vikström via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. jvikstrom marked 3 inline comments as done. Closed by commit rL368563: [clangd] Remove highlightings coming from non topLevelDecls from included files. (authored by jvikstrom, committed by ). Herald added a project: LLVM.

[PATCH] D64741: [clangd] Added highlighting for tokens that are macro arguments.

2019-08-12 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 214619. jvikstrom added a comment. Rebased to master. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64741/new/ https://reviews.llvm.org/D64741 Files: clang-tools-extra/clangd/SemanticHighlighting.cpp

[PATCH] D65998: [clangd] Added the vscode SemanticHighlighting feature code but did not enable it in the client.

2019-08-12 Thread Johan Vikström via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. jvikstrom marked 5 inline comments as done. Closed by commit rL368568: [clangd] Added the vscode SemanticHighlighting feature code but did not enable… (authored by jvikstrom, committed by ). Herald added a project: LLVM.

[PATCH] D64741: [clangd] Added highlighting for tokens that are macro arguments.

2019-08-12 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom added a comment. @ilya-biryukov @hokein pinging about this cl (I had completely forgotten about it somehow. Just updated it to the new master though) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64741/new/

[PATCH] D64741: [clangd] Added highlighting for tokens that are macro arguments.

2019-08-12 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 214620. jvikstrom added a comment. Moved comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64741/new/ https://reviews.llvm.org/D64741 Files: clang-tools-extra/clangd/SemanticHighlighting.cpp

[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 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] D65510: [clangd] Fix implicit template instatiations appearing as topLevelDecls.

2019-07-31 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. The parser gives implicit template instantiations to the action's HandleTopLevelDecls callback. This

[PATCH] D64475: [clangd] Duplicate lines of semantic highlightings sent removed.

2019-07-31 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom marked an inline comment as done. jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/ClangdLSPServer.cpp:1125 +Old = std::move(FileToHighlightings[File]); +FileToHighlightings[File] = Highlightings; + } hokein wrote: >

[PATCH] D65637: [clangd] [WIP] Semantic highlighting prototype for the vscode extension.

2019-08-02 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom marked an inline comment as done. jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/clients/clangd-vscode/src/TextMate.ts:20 +const split = scope.split('.'); +while(split.length > 0) { +split.splice(-1)

[PATCH] D65510: [clangd] Fix implicit template instatiations appearing as topLevelDecls.

2019-08-02 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom marked 2 inline comments as done. jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/ClangdUnit.cpp:68 + if (const auto *TD = dyn_cast(D)) +return TD->getTemplateSpecializationKind() == TSK_ImplicitInstantiation; + return false;

[PATCH] D65510: [clangd] Fix implicit template instatiations appearing as topLevelDecls.

2019-08-02 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 213041. jvikstrom added a comment. Moved test to ClangdUnitTests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65510/new/ https://reviews.llvm.org/D65510 Files: clang-tools-extra/clangd/AST.h

[PATCH] D65996: [clangd] Highlighting auto variables as the deduced type.

2019-08-12 Thread Johan Vikström via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL368546: [clangd] Highlighting auto variables as the deduced type. (authored by jvikstrom, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit:

[PATCH] D66335: [clangd] Added special HighlightingKind for function parameters.

2019-08-19 Thread Johan Vikström via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL369238: [clangd] Added special HighlightingKind for function parameters. (authored by jvikstrom, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to

[PATCH] D66219: [clangd] Added a colorizer to the vscode extension.

2019-08-14 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. Adds the main colorizer component. It colorizes every time clangd sends a publishSemanticHighlighting

[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] D64741: [clangd] Added highlighting for tokens that are macro arguments.

2019-08-19 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:54 + if (Conflicting.size() > 1) { +Tokens.erase(Tokens.begin() + I, + Tokens.begin() + I + Conflicting.size()); ilya-biryukov wrote:

[PATCH] D64741: [clangd] Added highlighting for tokens that are macro arguments.

2019-08-19 Thread Johan Vikström via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. jvikstrom marked 2 inline comments as done. Closed by commit rL369275: [clangd] Added highlighting for tokens that are macro arguments. (authored by jvikstrom, committed by ). Herald added a project: LLVM. Herald added a

[PATCH] D64741: [clangd] Added highlighting for tokens that are macro arguments.

2019-08-19 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 215907. jvikstrom marked 2 inline comments as done. jvikstrom added a comment. Rewrote conflicting token removal code. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64741/new/ https://reviews.llvm.org/D64741

[PATCH] D66406: [clangd] Update themeRuleMatcher when color theme changes in vscode extension.

2019-08-19 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. Add event listener that listens to configuration changes and reloads the ThemeRuleMatcher when the theme

[PATCH] D66470: [Syntax] Added function to get macro expansion tokens to TokenBuffer.

2019-08-20 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. Herald added a project: clang. Returns the first token in every mapping where the token is an identifier. This API is required to be able to highlight macro

[PATCH] D66470: [Syntax] Added function to get macro expansion tokens to TokenBuffer.

2019-08-20 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 216103. jvikstrom added a comment. Readded dissapeared newline. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66470/new/ https://reviews.llvm.org/D66470 Files: clang/include/clang/Tooling/Syntax/Tokens.h

[PATCH] D66221: [clangd] Added highlighting for non type templates.

2019-08-14 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. Highlights pointers to variables as variables. Function pointers are highlighted as functions. Member

[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 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] D66221: [clangd] Added highlighting for non type templates.

2019-08-16 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom marked an inline comment as done. jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:231 + if (TP->isFunctionPointerType()) { +addToken(Loc, HighlightingKind::Function); +return;

[PATCH] D66335: [clangd] Added special HighlightingKind for function parameters.

2019-08-16 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. This means that function parameters are no longer highlighted as variable.other.cpp but instead as

[PATCH] D66221: [clangd] Added highlighting for non type templates.

2019-08-16 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:231 + if (TP->isFunctionPointerType()) { +addToken(Loc, HighlightingKind::Function); +return; ilya-biryukov wrote: > jvikstrom wrote:

[PATCH] D66221: [clangd] Added highlighting for non type templates.

2019-08-16 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 215544. jvikstrom marked an inline comment as done. jvikstrom added a comment. Highlight as TemplateParameter. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66221/new/ https://reviews.llvm.org/D66221 Files:

[PATCH] D66221: [clangd] Added highlighting for non type templates.

2019-08-16 Thread Johan Vikström via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL369090: [clangd] Added highlighting for non type templates. (authored by jvikstrom, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit:

[PATCH] D64741: [clangd] Added highlighting for tokens that are macro arguments.

2019-08-19 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom added a comment. @ilya-biryukov @hokein ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64741/new/ https://reviews.llvm.org/D64741 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D66219: [clangd] Added a colorizer to the vscode extension.

2019-08-19 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 215886. jvikstrom marked 4 inline comments as done. jvikstrom added a comment. Renamed colorizer to highlighter and added FIXME about highlightings below eof. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D66541: [clangd] Send highlighting diff beyond the end of the file.

2019-08-22 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom accepted this revision. jvikstrom added a comment. This revision is now accepted and ready to land. It feels a bit strange to be sending highlighting (even if they are empty) beyond eof. But I guess the proposal does not specify this and it would make life for the vscode extension

[PATCH] D66219: [clangd] Added a colorizer to the vscode extension.

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

[PATCH] D66219: [clangd] Added a colorizer to the vscode extension.

2019-08-22 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 216621. jvikstrom marked 6 inline comments as done. jvikstrom added a comment. Rewrote the Highlighter class as we can override the highlighting method for the tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D66219: [clangd] Added a colorizer to the vscode extension.

2019-08-22 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom added a comment. I had completely forgotten we could just override the applyHighlightings method in the tests, everything is much simpler now. Basically this entire CL was rewritten just now. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D66516: [clangd] Added highlighting to types dependant on templates.

2019-08-22 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom marked an inline comment as done. jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:177 return; +if (TP->isPointerType() || TP->isLValueReferenceType()) + // When highlighting dependant template types the

[PATCH] D66470: [Syntax] Added function to get macro expansion tokens to TokenBuffer.

2019-08-20 Thread Johan Vikström via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. jvikstrom marked 2 inline comments as done. Closed by commit rL369385: [Syntax] Added function to get macro expansion tokens to TokenBuffer. (authored by jvikstrom, committed by ). Herald added a project: LLVM. Herald added

[PATCH] D66743: [clangd] Cleans up the semantic highlighting resources if clangd crashes.

2019-08-27 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom marked 2 inline comments as done. jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/clients/clangd-vscode/src/semantic-highlighting.ts:114 + // restarts. + public crashDispose() { +this.disposables.forEach((d) => d.dispose());

[PATCH] D66743: [clangd] Cleans up the semantic highlighting resources if clangd crashes.

2019-08-27 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 217367. jvikstrom added a comment. Renamed disposables to subscriptions and removed clangd crashes in api. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66743/new/ https://reviews.llvm.org/D66743 Files:

[PATCH] D66928: [clangd] Collecting main file macro expansion locations in ParsedAST.

2019-08-30 Thread Johan Vikström via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL370452: [clangd] Collecting main file macro expansion locations in ParsedAST. (authored by jvikstrom, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior

[PATCH] D66990: [clangd] Add distinct highlightings for declarations of functions and methods

2019-08-30 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom added a comment. Should we have different highlightings for declarations vs usages? (Although I guess in the end it will be up to the editor if they highlight them differently as the scope is just more specific for declarations) I guess I personally don't really see the reason as it

[PATCH] D66738: [clangd] Added highlighting for structured bindings.

2019-08-30 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom marked an inline comment as done. jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp:443 +$Primitive[[int]] $Variable[[A]][2] = {1,2}; +auto [$Variable[[B1]], $Variable[[B2]]] = $Variable[[A]];

[PATCH] D66995: [clangd] Add highlighting for macro expansions.

2019-08-30 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 218061. jvikstrom added a comment. Removed SourceManager field from HighlightingTokenCollector. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66995/new/ https://reviews.llvm.org/D66995 Files:

[PATCH] D66516: [clangd] Added highlighting to types dependant on templates.

2019-08-30 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom added a comment. Pinging about this @ilya-biryukov Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66516/new/ https://reviews.llvm.org/D66516 ___ cfe-commits mailing list

[PATCH] D66995: [clangd] Add highlighting for macro expansions.

2019-08-30 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. https://github.com/clangd/clangd/issues/134 Repository: rG LLVM Github Monorepo

[PATCH] D66995: [clangd] Add highlighting for macro expansions.

2019-08-30 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:469 + case HighlightingKind::MacroExpansion: +return "entity.name.function.preprocessor.expansion.cpp"; case HighlightingKind::NumKinds: ilya-biryukov wrote: >

[PATCH] D66738: [clangd] Added highlighting for structured bindings.

2019-08-30 Thread Johan Vikström via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL370473: [clangd] Added highlighting for structured bindings. (authored by jvikstrom, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit:

[PATCH] D66995: [clangd] Add highlighting for macro expansions.

2019-08-30 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 218089. jvikstrom added a comment. Renamed MacroExpansion to Macro. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66995/new/ https://reviews.llvm.org/D66995 Files:

[PATCH] D66995: [clangd] Add highlighting for macro expansions.

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

[PATCH] D66995: [clangd] Add highlighting for macro expansions.

2019-08-30 Thread Johan Vikström via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL370482: [clangd] Add highlighting for macro expansions. (authored by jvikstrom, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit:

[PATCH] D66406: [clangd] Update theme when color theme changes in vscode extension.

2019-08-29 Thread Johan Vikström via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL370305: [clangd] Update themeRuleMatcher when color theme changes in vscode extension. (authored by jvikstrom, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits.

[PATCH] D66928: [clangd] Collecting main file macro expansion locations in ParsedAST.

2019-08-29 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 217811. jvikstrom marked 5 inline comments as done. jvikstrom added a comment. Clarified comments. Added tests. Not getting expansions inside other macro expansions. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D66406: [clangd] Update themeRuleMatcher when color theme changes in vscode extension.

2019-08-29 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 217785. jvikstrom marked an inline comment as done. jvikstrom added a comment. Use `conf.affectsConfiguration('workbench.colorTheme')` instead of keeping track of the old color theme manually. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D66928: [clangd] Collecting main file macro expansion locations in ParsedAST.

2019-08-29 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/unittests/ClangdUnitTests.cpp:248 +TEST(ClangdUnitTest, CollectsMainFileMacroExpansions) { + Annotations TestCase(R"cpp( +#define MACRO_ARGS(X, Y) X Y ilya-biryukov wrote: > Could you add

[PATCH] D66928: [clangd] Collecting main file macro expansion locations in ParsedAST.

2019-08-29 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. TokenBuffer does not collect macro expansions inside macro arguments which is needed for semantic

[PATCH] D66516: [clangd] Added highlighting to types dependant on templates.

2019-08-28 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 217618. jvikstrom added a comment. Added a RecursiveASTVisitor for finding 'underlying' types. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66516/new/ https://reviews.llvm.org/D66516 Files:

[PATCH] D66406: [clangd] Update themeRuleMatcher when color theme changes in vscode extension.

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

[PATCH] D66738: [clangd] Added highlighting for structured bindings.

2019-08-28 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 217652. jvikstrom marked 6 inline comments as done. jvikstrom added a comment. Abandoned trying to highlight the same as the bound decl. Reasoning: If you have a reference to a parameter we are not trying to highlight the reference as a parameter, the

[PATCH] D66743: [clangd] Cleans up the semantic highlighting resources if clangd crashes.

2019-08-28 Thread Johan Vikström via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL370202: [clangd] Cleans up the semantic highlighting resources if clangd stops. (authored by jvikstrom, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed

[PATCH] D66881: [clangd][vscode] Don't leak the resources

2019-08-28 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom added a comment. Oh, was not aware we needed to dispose the extension as well. I think you should probably add the SemanticHighlightingFeature to the context.subscriptions as well, right? (because I didn't when I did the cleanup patch for it, sorry) Repository: rG LLVM Github

[PATCH] D66516: [clangd] Added highlighting to types dependant on templates.

2019-08-28 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom marked an inline comment as done. jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:177 return; +if (TP->isPointerType() || TP->isLValueReferenceType()) + // When highlighting dependant template types the

[PATCH] D66928: [clangd] Collecting main file macro expansion locations in ParsedAST.

2019-08-29 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom marked an inline comment as done. jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/ClangdUnit.cpp:107 +class CollectMainFileMacroExpansions : public PPCallbacks { + const SourceManager ilya-biryukov wrote: > Maybe make this

[PATCH] D66928: [clangd] Collecting main file macro expansion locations in ParsedAST.

2019-08-29 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 217920. jvikstrom marked 4 inline comments as done. jvikstrom added a comment. Added test for prepending concatenations. Also added made tests pass. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66928/new/

[PATCH] D66928: [clangd] Collecting main file macro expansion locations in ParsedAST.

2019-08-29 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom marked an inline comment as done. jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/unittests/ClangdUnitTests.cpp:260 +// Macros from token concatenations included. +#define CONCAT(X) X##1() +#define MACRO1() 123

[PATCH] D66516: [clangd] Added highlighting to types dependant on templates.

2019-08-26 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom marked an inline comment as done. jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:177 return; +if (TP->isPointerType() || TP->isLValueReferenceType()) + // When highlighting dependant template types the

[PATCH] D66219: [clangd] Added a colorizer to the vscode extension.

2019-08-26 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:135 + // Update the themeRuleMatcher that is used when highlighting. Also triggers a + // recolorization for all current highlighters. Safe to call

[PATCH] D66219: [clangd] Added a colorizer to the vscode extension.

2019-08-26 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 217099. jvikstrom marked 12 inline comments as done. jvikstrom added a comment. Made tests more readable. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66219/new/ https://reviews.llvm.org/D66219 Files:

[PATCH] D66219: [clangd] Added a colorizer to the vscode extension.

2019-08-26 Thread Johan Vikström via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. jvikstrom marked 10 inline comments as done. Closed by commit rL369893: [clangd] Added a colorizer to the vscode extension. (authored by jvikstrom, committed by ). Herald added a project: LLVM. Herald added a subscriber:

[PATCH] D66516: [clangd] Added highlighting to types dependant on templates.

2019-08-21 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom marked an inline comment as done. jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:177 return; +if (TP->isPointerType() || TP->isLValueReferenceType()) + // When highlighting dependant template types the

<    1   2   3   4   >