[PATCH] D64199: [clangd] Added highlighting for variable references (declrefs)

2019-07-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 rL365205: [clangd] Added highlighting for variable references (declrefs) (authored by jvikstrom, committed by ). Herald added a project: LLVM. Herald added a

[PATCH] D64199: [clangd] Added highlighting for variable references (declrefs)

2019-07-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. thanks, looks good. Comment at: clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp:52 R"cpp( -struct A { - double SomeMember; -}; -struct { -} $Variable[[HStruct]]; -void

[PATCH] D64199: [clangd] Added highlighting for variable references (declrefs)

2019-07-05 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom marked 4 inline comments as done. jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:61 +} +if(isa(D)) { + addToken(Loc, HighlightingKind::Function); hokein wrote: > sammccall wrote: > >

[PATCH] D64199: [clangd] Added highlighting for variable references (declrefs)

2019-07-05 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 208143. jvikstrom added a comment. Separated into three testcases. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64199/new/ https://reviews.llvm.org/D64199 Files:

[PATCH] D64199: [clangd] Added highlighting for variable references (declrefs)

2019-07-05 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 208140. jvikstrom added a comment. Made tests more readable. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64199/new/ https://reviews.llvm.org/D64199 Files:

[PATCH] D64199: [clangd] Added highlighting for variable references (declrefs)

2019-07-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. the implementation looks good, a few comments on the test. Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:61 +} +if(isa(D)) { + addToken(Loc, HighlightingKind::Function); sammccall wrote: > jvikstrom wrote: >

[PATCH] D64199: [clangd] Added highlighting for variable references (declrefs)

2019-07-05 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 208123. jvikstrom added a comment. Added additional testcase. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64199/new/ https://reviews.llvm.org/D64199 Files:

[PATCH] D64199: [clangd] Added highlighting for variable references (declrefs)

2019-07-04 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:38 + bool VisitNamedDecl(NamedDecl *ND) { +if (ND->getDeclName().isEmpty()) + // Don't add symbols that don't have any length. jvikstrom wrote: > sammccall

[PATCH] D64199: [clangd] Added highlighting for variable references (declrefs)

2019-07-04 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added a comment. This revision is now accepted and ready to land. (LG from my side) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64199/new/ https://reviews.llvm.org/D64199

[PATCH] D64199: [clangd] Added highlighting for variable references (declrefs)

2019-07-04 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom added inline comments. Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:38 + bool VisitNamedDecl(NamedDecl *ND) { +if (ND->getDeclName().isEmpty()) + // Don't add symbols that don't have any length. sammccall wrote: > I think you

[PATCH] D64199: [clangd] Added highlighting for variable references (declrefs)

2019-07-04 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 208041. jvikstrom marked 2 inline comments as done. jvikstrom added a comment. Added testcae. Added another bailout from VisitNamedDecl. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64199/new/

[PATCH] D64199: [clangd] Added highlighting for variable references (declrefs)

2019-07-04 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:38 + bool VisitNamedDecl(NamedDecl *ND) { +if (ND->getDeclName().isEmpty()) + // Don't add symbols that don't have any length. I think you might want to bail

[PATCH] D64199: [clangd] Added highlighting for variable references (declrefs)

2019-07-04 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 208030. jvikstrom added a comment. Removed debug prints from test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64199/new/ https://reviews.llvm.org/D64199 Files:

[PATCH] D64199: [clangd] Added highlighting for variable references (declrefs)

2019-07-04 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 208029. jvikstrom added a comment. Removed VisitVarDecl and VisitFuncDecl in favor of VisitNamedDecl. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64199/new/ https://reviews.llvm.org/D64199 Files:

[PATCH] D64199: [clangd] Added highlighting for variable references (declrefs)

2019-07-04 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom updated this revision to Diff 208028. jvikstrom added a comment. Added overload for addToken and added more code to the test cases. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D64199/new/ https://reviews.llvm.org/D64199 Files:

[PATCH] D64199: [clangd] Added highlighting for variable references (declrefs)

2019-07-04 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:46 + + bool VisitDeclRefExpr(DeclRefExpr *Ref) { +if (Ref->getNameInfo().getName().getNameKind() == hokein wrote: > The `DeclRefExpr` is a very general

[PATCH] D64199: [clangd] Added highlighting for variable references (declrefs)

2019-07-04 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:46 + + bool VisitDeclRefExpr(DeclRefExpr *Ref) { +if (Ref->getNameInfo().getName().getNameKind() == The `DeclRefExpr` is a very general expression, which can

[PATCH] D64199: [clangd] Added highlighting for variable references (declrefs)

2019-07-04 Thread Johan Vikström via Phabricator via cfe-commits
jvikstrom created this revision. jvikstrom added reviewers: hokein, sammccall. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov. Herald added a project: clang. Added highlighting for variable references using VisitDeclRefExpr. Repository: rG LLVM