This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Migrate Lexer usages in TypeHierarchy to TokenBuffers
ClosedPublic

Authored by kadircet on Feb 19 2020, 10:13 AM.

Details

Summary

Also fixes a bug, resulting from directly using ND.getEndLoc() for end
location of the range. As ND.getEndLoc() points to the begining of the last
token, whereas it should point one past the end, since LSP ranges are half open
(exclusive on the end).

Diff Detail

Event Timeline

kadircet created this revision.Feb 19 2020, 10:13 AM
sammccall accepted this revision.Feb 20 2020, 6:49 AM
sammccall added inline comments.
clang-tools-extra/clangd/XRefs.cpp
613

I think you're trying to test if NameTok has the location you're searching for, but you'd need to check the partition point for equality.

Couldn't you just do NameTokens = spelledForExpanded(expandedTokens(NameLoc))?

This revision is now accepted and ready to land.Feb 20 2020, 6:49 AM
kadircet updated this revision to Diff 246439.Feb 25 2020, 6:36 AM
  • Address comments
This revision was automatically updated to reflect the committed changes.