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 subsc
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 $Fun
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:
> > jvikstrom
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:
clang-tools-extra/clangd/SemanticHighlight
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:
clang-tools-extra/clangd/SemanticHighlighting.cp
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:
>
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:
clang-tools-extra/clangd/SemanticHighlighting.c
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 wr
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
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
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/
https://review
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
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:
clang-tools-extra/clangd/SemanticHighlight
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:
clang-t
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:
clang-t
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 expression,
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 referenc
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 Gith
18 matches
Mail list logo