[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] D64634: [clangd] Fix duplicate highlighting tokens appearing in initializer lists

2019-07-15 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision. ilya-biryukov added a comment. This revision is now accepted and ready to land. LGTM (I think @hokein 's comments were addressed too) > So it seems to be expected. (and looking at the documentation for > InitListExpr it seems to be difficult to change

[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] D64634: [clangd] Fix duplicate highlighting tokens appearing in initializer lists

2019-07-15 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. Have we tried figuring out why `RecursiveASTVisitor` visits the argument lists twice? Is that an expected behavior? Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:37 +llvm::sort(Tokens, + [](const

[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] 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] 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-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein 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) { nit: we could write it like ```

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

2019-07-12 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, mgrang, jkorous, MaskRay. Herald added a project: clang. The RecursiveASTVisitor sometimes visits exprs in initializer lists twice. Added