This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Get rid of Lexer usage in CodeComplete
AbandonedPublic

Authored by kadircet on Feb 19 2020, 8:58 AM.

Details

Reviewers
sammccall

Diff Detail

Event Timeline

kadircet created this revision.Feb 19 2020, 8:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 19 2020, 8:58 AM
sammccall added inline comments.Feb 19 2020, 9:15 AM
clang-tools-extra/clangd/CodeComplete.cpp
593

what if beginLoc and endLoc are in different files?
(this is most of what Lexer deals with, I think)

I think you want TokenBuffer::expandedTokens(SourceRange), then spelledForExpanded, and then FileRange(...).text().

kadircet marked an inline comment as done.Feb 20 2020, 5:00 AM
kadircet added inline comments.
clang-tools-extra/clangd/CodeComplete.cpp
593

right, thinking about it again, I suppose it is better to keep lexer here as there's syntax::FileRange doesn't support macroIDs.
We would need to handle it ourselves in here which wouldn't reduce technical debt at all.

kadircet abandoned this revision.Feb 21 2020, 12:31 PM