[PATCH] D66735: [clangd] Handling text editor/document lifetimes in vscode extension.

2019-08-26 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. Just reapplies highlightings for all files when visible text editors change. Could find the correct text

[PATCH] D66735: [clangd] Handling text editor/document lifetimes in vscode extension.

2019-08-26 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 217131. jvikstrom added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66735/new/ https://reviews.llvm.org/D66735 Files:

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

2019-08-26 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. Structured bindings are in a BindingDecl. The decl the declRefExpr points to are the BindingDecls. So

[PATCH] D66735: [clangd] Handling text editor/document lifetimes in vscode extension.

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/clients/clangd-vscode/src/semantic-highlighting.ts:94 +vscode.window.onDidChangeVisibleTextEditors( +() =>

[PATCH] D66735: [clangd] Handling text editor/document lifetimes in vscode extension.

2019-08-26 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 217134. jvikstrom added a comment. Fixed changes that weren't supposed to be made. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66735/new/ https://reviews.llvm.org/D66735 Files:

[PATCH] D66735: [clangd] Handling text editor/document lifetimes in 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 4 inline comments as done. Closed by commit rG1c9aa70b042b: [clangd] Handling text editor/document lifetimes in vscode extension. (authored by jvikstrom). Repository: rG LLVM Github Monorepo CHANGES

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

2019-08-26 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. Disposes of the vscode listeners when clangd crashes and reuses the old highlighter when it restarts. The

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

2019-08-21 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, kristof.beyls, javed.absar. Herald added a project: clang. Types dependant on templates did not get highlighted properly. This is

[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 217396. jvikstrom added a comment. Dispose of all resources when disposing. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66743/new/ https://reviews.llvm.org/D66743 Files:

[PATCH] D65395: [clangd] Added a skeleton for a semantic highlighting feature to the vscode extension.

2019-07-30 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 212302. jvikstrom added a comment. Removed the experimental capability and added it to the normal capabilites using type intersection. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65395/new/

[PATCH] D64922: [clangd] Added option to enable semantic highlighting via an experimental capability

2019-07-30 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom abandoned this revision. jvikstrom added a comment. In D64922#1603759 , @nridge wrote: > I believe this is not necessary. You can add text document capabilities in > the vscode client extension like this: > > class SemanticHighlightingFeature

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

2019-07-30 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:294 + // ArrayRefs to the current line in the highlights. + ArrayRef NewLine(New.begin(), + /*length*/0UL); ilya-biryukov wrote:

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

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

[PATCH] D65443: [clangd] Fix a regression in rL366996.

2019-07-30 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom accepted this revision. jvikstrom added inline comments. This revision is now accepted and ready to land. Comment at: clang-tools-extra/clangd/refactor/tweaks/AnnotateHighlightings.cpp:43 + if (!CommonDecl) { +// Now we hit the TUDecl case where commonAncestor()

[PATCH] D65395: [clangd] Added a skeleton for a semantic highlighting feature to the vscode extension.

2019-07-31 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom added a comment. In D65395#1607889 , @hokein wrote: > The skeleton looks good, but apparently it does nothing (only enable the > feature), do you have a small working prototype? I've got a prototype that colors all the highlightings red, but

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

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

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

2019-07-31 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp:408 +} + } // namespace ilya-biryukov wrote: > ilya-biryukov wrote: > > Could you also add a separate test that checks diffs when the number of > >

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

2019-07-31 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 212522. jvikstrom marked 2 inline comments as done. jvikstrom added a comment. Stopped using expensive getLineNumber function. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64475/new/

[PATCH] D65395: [clangd] Added a skeleton for a semantic highlighting feature to the vscode extension.

2019-07-31 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 212523. jvikstrom added a comment. Added check that clangd server actually supports semantic highlighting. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65395/new/ https://reviews.llvm.org/D65395 Files:

[PATCH] D65735: [AST] Fix RecursiveASTVisitor visiting implicit constructor initializers.

2019-08-05 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 213291. jvikstrom marked 4 inline comments as done. jvikstrom added a comment. Moved test to its own test file (also addressed comments about the test). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D65735: [AST] Fix RecursiveASTVisitor visiting implicit constructor initializers.

2019-08-05 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 213294. jvikstrom added a comment. Call the base Traverse.. function in the visitor. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65735/new/ https://reviews.llvm.org/D65735 Files:

[PATCH] D65735: [AST] Fix RecursiveASTVisitor visiting implicit constructor initializers.

2019-08-05 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. RecursiveASTVisitor was visiting implcit constructor initializers. This caused semantic highlighting in clangd to emit error logs.

[PATCH] D65738: [clangd] Added a TextMate theme parser to the vscode extension.

2019-08-07 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 rL368136: [clangd] Added a TextMate theme parser to the vscode extension. (authored by jvikstrom, committed by ). Herald added a project: LLVM. Herald added a

[PATCH] D65738: [clangd] Added a TextMate theme parser that updates when the current theme changes.

2019-08-07 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/clients/clangd-vscode/test/assets/firstIncludedTheme.jsonc:3 +// Some comment +"include": "secondIncludedTheme.jsonc", +"tokenColors": [ hokein wrote: > nit: any reason use

[PATCH] D65738: [clangd] Added a TextMate theme parser that updates when the current theme changes.

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

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

2019-08-07 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 213808. jvikstrom marked 4 inline comments as done. jvikstrom added a comment. Added more ways to specialize/instantiate templates to test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65510/new/

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

2019-08-07 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/unittests/ClangdUnitTests.cpp:144 + EXPECT_THAT(AST.getLocalTopLevelDecls(), + ElementsAre(DeclNamed("f"), DeclNamed("f"), DeclNamed("f"), + DeclNamed("V"),

[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

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

2019-08-07 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:188 +AllOf(DeclNamed("d"), WithTemplateArgs("")), +AllOf(DeclNamed("foo"),

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

2019-08-07 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 213878. jvikstrom added a comment. Changed tests to also look at template parameters. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65510/new/ https://reviews.llvm.org/D65510 Files:

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

2019-08-07 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:144 + EXPECT_THAT(AST.getLocalTopLevelDecls(), + ElementsAre(DeclNamed("f"), DeclNamed("f"), DeclNamed("f"), +

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

2019-08-08 Thread Johan Vikström via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. jvikstrom marked 4 inline comments as done. Closed by commit rL368261: [clangd] Fix implicit template instatiations appearing as topLevelDecls. (authored by jvikstrom, committed by ). Herald added a project: LLVM. Herald

[PATCH] D65926: [clangd] Fixed printTemplateSpecializationArgs not printing partial variable specialization arguments.

2019-08-08 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. printTemplateSpecializationArgs was not printing partial variable specialization args. This adds an

[PATCH] D65928: [clangd] Added an early return from VisitMemberExpr in SemanticHighlighting if the MemberLoc is invalid.

2019-08-08 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. Conversion operators contain invalid MemberLocs which causes SemanticHighlighting to emit a lot of error

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

2019-08-01 Thread Johan Vikström via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL367521: [clangd] Duplicate lines of semantic highlightings sent removed. (authored by jvikstrom, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to

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

2019-08-02 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 213011. jvikstrom added a comment. Readded guard against rules without scopes that somehow disappeared. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65637/new/ https://reviews.llvm.org/D65637 Files:

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

2019-08-02 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 213013. jvikstrom added a comment. Fixed bug that made it impossible to find colors that were a perfect match to the scope we are looking for (ex: fixes function being color as functions and not as entity.name) Explanation for the bug: When adding the

[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] D65637: [clangd] [WIP] Semantic highlighting prototype for the vscode extension.

2019-08-02 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 213015. jvikstrom added a comment. Fix matching logic on TM scopes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65637/new/ https://reviews.llvm.org/D65637 Files:

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

2019-08-02 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. Contains all the functionality for the highlighting, is going to get cleaned up a lot though.

[PATCH] D65395: [clangd] Added a skeleton for a semantic highlighting feature to the vscode extension.

2019-07-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. This adds a SemanticHighlighting feature to the vscode extension that does not do anything. It adds the

[PATCH] D65735: [AST] Fix RecursiveASTVisitor visiting implicit constructor initializers.

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

[PATCH] D65735: [AST] Fix RecursiveASTVisitor visiting implicit constructor initializers.

2019-08-05 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom marked an inline comment as done. jvikstrom added inline comments. Comment at: clang/unittests/Tooling/RecursiveASTVisitorTests/ImplicitCtorInitializer.cpp:29 +if (!Init->isWritten()) + VisitedImplicitInitializer = true; +Match("initializer",

[PATCH] D65735: [AST] Fix RecursiveASTVisitor visiting implicit constructor initializers.

2019-08-05 Thread Johan Vikström via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. jvikstrom marked an inline comment as done. Closed by commit rL367839: [AST] Fix RecursiveASTVisitor visiting implicit constructor initializers. (authored by jvikstrom, committed by ). Herald added a project: LLVM. Herald

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

2019-08-05 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 213388. jvikstrom marked an inline comment as done. jvikstrom added a comment. Move isImplicitTemplateInstantiation and isExplicitTemplateSpecialization, also share implementation. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

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

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

[PATCH] D65738: [clangd] Added a TextMate theme parser that updates when the current theme changes.

2019-08-05 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 a TextMate parser module to the vscode extension. It watches for changes to the vscode configuration

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

2019-08-06 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 213608. jvikstrom marked an inline comment as done. jvikstrom added a comment. Added tests for making sure explicit specializations, explicit instantiations, partial instantiations, explicit declarations and template variables are in topLevelDecls. Also

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

2019-08-06 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/unittests/ClangdUnitTests.cpp:110 +template +void f(T) {} +void s() { ilya-biryukov wrote: > Could you also check that: > > 1.

[PATCH] D65926: [clangd] Fixed printTemplateSpecializationArgs not printing partial variable specialization arguments.

2019-08-09 Thread Johan Vikström via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL368403: [clangd] Fixed printTemplateSpecializationArgs not printing partial variable… (authored by jvikstrom, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits.

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

2019-08-09 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 214334. jvikstrom added a comment. Added comment to decodeTokens function. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65998/new/ https://reviews.llvm.org/D65998 Files:

[PATCH] D65938: [AST] No longer visiting CXXMethodDecl bodies created by compiler when method was default created.

2019-08-09 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 rL368402: [AST] No longer visiting CXXMethodDecl bodies created by compiler when method… (authored by jvikstrom, committed by ). Herald added a project: LLVM.

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

2019-08-09 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. jvikstrom updated this revision to Diff 214319. jvikstrom added a comment. Finished comment. Done in

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

2019-08-09 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 214319. jvikstrom added a comment. Finished comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65996/new/ https://reviews.llvm.org/D65996 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-09 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. jvikstrom updated this revision to Diff 214334. jvikstrom added a comment. Added comment to decodeTokens

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

2019-08-09 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 214372. 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/D65996/new/ https://reviews.llvm.org/D65996 Files:

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

2019-08-09 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 214373. jvikstrom added a comment. Removed ending whitespace on a line. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65996/new/ https://reviews.llvm.org/D65996 Files:

[PATCH] D66001: [clangd] Added highlighting for constructor initializers.

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

[PATCH] D66001: [clangd] Added highlighting for constructor initializers.

2019-08-09 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. Constructor initializers were not being highlighted. This adds highlighting for them by using

[PATCH] D66001: [clangd] Added highlighting for constructor initializers.

2019-08-09 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 214346. jvikstrom added a comment. Fixed case where initializer was base class initializer which would cause crash. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66001/new/ https://reviews.llvm.org/D66001

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

2019-08-09 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 214364. 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/D65998/new/ https://reviews.llvm.org/D65998 Files:

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

2019-08-09 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:62 + + handleNotification(params: HighlightingInformation) { +const tokenLines = params.lines.map((line): HighlightingLine => { hokein

[PATCH] D65738: [clangd] Added a TextMate theme parser that updates when the current theme changes.

2019-08-06 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 213528. jvikstrom marked 2 inline comments as done. jvikstrom added a comment. Narrowed CL down to loading/parsing a text mate theme. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65738/new/

[PATCH] D65738: [clangd] Added a TextMate theme parser that updates when the current theme changes.

2019-08-06 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom added a comment. In D65738#1614897 , @hokein wrote: > Haven't looked at the patch in details. > > Looks like the patch is doing different things, and the test just covers a > small set of the code. > > 1. find and parse the theme definition

[PATCH] D65738: [clangd] Added a TextMate theme parser that updates when the current theme changes.

2019-08-06 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 213567. jvikstrom marked 6 inline comments as done. jvikstrom added a comment. Renamed file to semantic-highlighting.ts. Added test for parsing theme files. Inlined the parsing into the loading function. Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D65738: [clangd] Added a TextMate theme parser that updates when the current theme changes.

2019-08-06 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 213568. jvikstrom added a comment. Clarified comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65738/new/ https://reviews.llvm.org/D65738 Files:

[PATCH] D65943: [clangd] Added semantic highlighting support for primitives.

2019-08-08 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 a new HighlightingKind "Primitive". Adds a special case for TypeLocs that have an underlying TypePtr

[PATCH] D65926: [clangd] Fixed printTemplateSpecializationArgs not printing partial variable specialization arguments.

2019-08-08 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 214132. jvikstrom marked 2 inline comments as done. jvikstrom added a comment. Merged test with PrintASTTest.cpp. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65926/new/ https://reviews.llvm.org/D65926

[PATCH] D65928: [clangd] Added an early return from VisitMemberExpr in SemanticHighlighting if the MemberLoc is invalid.

2019-08-08 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:56 +if (isa(MD)) + // If the member is a conversion operator the loc will be invalid. This + // causes the addToken function

[PATCH] D65938: [AST] No longer visiting CXXMethodDecl bodies created by compiler when method was default created.

2019-08-08 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom created this revision. jvikstrom added reviewers: hokein, ilya-biryukov, gribozavr. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, mgorny. Herald added a project: clang. Clang generates function bodies and puts them in the AST for default methods if it is defaulted

[PATCH] D65928: [clangd] Added an early return from VisitMemberExpr in SemanticHighlighting if the MemberLoc is invalid.

2019-08-08 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 214117. jvikstrom marked an inline comment as done. jvikstrom added a comment. Added test for conversion operators. Also changed comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65928/new/

[PATCH] D65928: [clangd] Added an early return from VisitMemberExpr in SemanticHighlighting if the MemberLoc is invalid.

2019-08-08 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 rL368287: [clangd] Added an early return from VisitMemberExpr in SemanticHighlighting if… (authored by jvikstrom, committed by ). Herald added a project: LLVM.

[PATCH] D65928: [clangd] Added an early return from VisitMemberExpr in SemanticHighlighting if the MemberLoc is invalid.

2019-08-08 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 214110. jvikstrom marked an inline comment as done. jvikstrom added a comment. Changed to do an isa check instead of checking if MemberLoc is invalid. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65928/new/

[PATCH] D65926: [clangd] Fixed printTemplateSpecializationArgs not printing partial variable specialization arguments.

2019-08-08 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/unittests/ASTTests.cpp:40 +TEST(PrintTemplateSpecializationArgs, PrintsTemplateArgs) { + TestTU TU; hokein wrote: > looks like the related tests are in `PrintASTTests.cpp`, could you move

[PATCH] D65943: [clangd] Added semantic highlighting support for primitives.

2019-08-08 Thread Johan Vikström via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. jvikstrom marked an inline comment as done. Closed by commit rL368291: [clangd] Added semantic highlighting support for primitives. (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-07-17 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 210359. jvikstrom marked 2 inline comments as done. jvikstrom added a comment. Ignore tokens outside of main file. Added testcase for assert. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64741/new/

[PATCH] D64855: [clangd] Added highlightings for template parameters and specializations.

2019-07-18 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 210503. jvikstrom added a comment. Added testcases and made highlighting work for template template parameters as well. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64855/new/

[PATCH] D64855: [clangd] Added highlightings for template parameters and specializations.

2019-07-18 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/unittests/SemanticHighlightingTests.cpp:179 +R"cpp( + template + class $Class[[A]] { hokein wrote: > hokein wrote: > > could you add

[PATCH] D64855: [clangd] Added highlightings for template parameters and specializations.

2019-07-18 Thread Johan Vikström via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. jvikstrom marked an inline comment as done. Closed by commit rL366420: [clangd] Added highlightings for template parameters and specializations. (authored by jvikstrom, committed by ). Herald added a project: LLVM. Herald

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

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

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

2019-07-18 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:46 +// removed. +for (unsigned I = 0; I < Tokens.size(); ++I) { + ArrayRef TokRef(Tokens); hokein wrote: > we

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

2019-07-18 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 210530. jvikstrom added a comment. Added comment saying conflicting tokens are not highlighted in the test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64741/new/ https://reviews.llvm.org/D64741 Files:

[PATCH] D64922: [clangd] Added option to enable semantic highlighting via an experimental capability

2019-07-18 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 option to enable semantic highlighting as an experimental capability. The reason for this

[PATCH] D64922: [clangd] Added option to enable semantic highlighting via an experimental capability

2019-07-18 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 210559. jvikstrom added a comment. Made Protocol comment be doxygen. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64922/new/ https://reviews.llvm.org/D64922 Files:

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

2019-07-18 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom marked 6 inline comments as done. jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/ClangdLSPServer.cpp:458 +// edit there are stale previous highlightings. +std::lock_guard Lock(HighlightingsMutex); +FileToHighlightings.erase(File);

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

2019-07-18 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 210567. jvikstrom edited the summary of this revision. jvikstrom added a comment. Added additional note to FIXME on how to solve and also move(ing) Old. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

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

2019-07-18 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 210601. jvikstrom added a comment. Remove braces. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64475/new/ https://reviews.llvm.org/D64475 Files: clang-tools-extra/clangd/ClangdLSPServer.cpp

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

2019-07-18 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 210600. jvikstrom marked 7 inline comments as done. jvikstrom added a comment. Address comments and fixed bug where we'd send diffs outside of the file. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

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

2019-07-18 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 210606. jvikstrom added a comment. Fixed test case that was actually (kinda) broken even though it didn't fail. (The last two edits in semantic-highlighting test. They removed the `= 2` part and did not insert an extra `;` which produced invalid code. It

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

2019-07-18 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 210613. jvikstrom added a comment. Removed one lock from onSemanticHighlighting. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64475/new/ https://reviews.llvm.org/D64475 Files:

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

2019-07-18 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:292 + /*length*/0UL); + auto NewEnd = NewHighlightings.end(); + auto OldEnd = OldHighlightings.end(); ilya-biryukov wrote: >

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

2019-07-17 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:170 +return; + Loc = SM.getSpellingLoc(Loc); +} hokein wrote: > hokein wrote: > > jvikstrom wrote: > > > hokein wrote: > > > > The Loc here maybe not

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

2019-07-17 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/ClangdLSPServer.cpp:1110 PathRef File, std::vector Highlightings) { + llvm::ArrayRef Prev; + { hokein wrote: > this seems unsafe, we get a reference of the map value, we might access it

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

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

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

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

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

2019-07-17 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:170 +return; + Loc = SM.getSpellingLoc(Loc); +} hokein wrote: > The Loc here maybe not in the main file,

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

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. In `typedef int A` the `A` was not highlighted previously. This patch gives `A` the same kind

[PATCH] D64855: [clangd] Added highlightings for template parameters and specializations.

2019-07-17 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. Template parameters and specializations were not being highlighted before. This adds

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

2019-07-17 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp:281 + )cpp"}}, +{{5}, + { hokein wrote: > so the empty lines are stored separately, which is not easy to figure out

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

2019-07-17 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom added a comment. In D64741#1587204 , @ilya-biryukov wrote: > How should this behave when if the same token is used multiple times inside a > macro and the uses are different? Could we add this to tests? > E.g. > > #define W(a) class a {

<    1   2   3   4   >