This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Produce semantic token for name referring to UnresolvedUsingValueDecl
ClosedPublic

Authored by nridge on Mar 21 2021, 11:14 PM.

Details

Summary

For now, use the token kind Unknown. We may be able to improve on this
using HeuristicResolver.

Diff Detail

Event Timeline

nridge created this revision.Mar 21 2021, 11:14 PM
nridge requested review of this revision.Mar 21 2021, 11:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 21 2021, 11:14 PM
nridge added inline comments.Mar 21 2021, 11:41 PM
clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp
656

Not sure how I feel about this being a _decl.

I know it is in the technical sense, but as a user I think of it more as a reference to Base::member.

Adding some potential reviewers.

sammccall accepted this revision.Apr 23 2021, 3:00 PM
sammccall added inline comments.
clang-tools-extra/clangd/unittests/SemanticHighlightingTests.cpp
656

Yeah, I agree, and the combination of decl and dependentName is pretty funny.

We have non-dependent equivalent cases (using ::foo, not the renaming versions) and they don't seem to be marked as decl. (I think what's happening is that findExplicitReferences yields the *UsingShadowDecl*s rather than the *UsingDecl*, as only the former are directly bound to a specific e.g. overload being referenced)

So with that as precedent, it seems like it would be legitimate to special-case UnresolvedUsingValueDecl when adding the decl modifier.

This revision is now accepted and ready to land.Apr 23 2021, 3:00 PM
nridge updated this revision to Diff 340381.Apr 25 2021, 1:41 PM

Address review comment

This revision was landed with ongoing or failed builds.Apr 25 2021, 1:45 PM
This revision was automatically updated to reflect the committed changes.