Details
- Reviewers
sammccall - Commits
- rG2bb7774ddf00: [clangd] Get rid of getBeginningOfIdentifier helper
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Hooray!
clang-tools-extra/clangd/Hover.cpp | ||
---|---|---|
538 | first -> last I think, better explained as rightmost. See SelectionTree::create(). | |
538 | actually, if this is really only used for macros and auto, you could pull out those specific cases (define AutoLoc and IdentifierLoc and initialize them by looping over the touching tokens). Seems a bit simpler/more direct/less risk of reuse for other things? | |
541 | This deserves a comment, it's a different strategy than SelectionTree that should yield the same result. ("In general we prefer the touching token that works over the one that doesn't, see SelectionTree::create(). This location is used only for triggering on macros and auto, so simply choosing the lone identifier-or-keyword token is equivalent") | |
541 | you also need to check for keyword (or specifically kw auto) |
Did you want to delete the lexer check in getDeducedType or is that another patch?
clang-tools-extra/clangd/Hover.cpp | ||
---|---|---|
533 | again, I'd stick with "touching" to match syntax::tokens | |
542 | nit: we don't tend to use SLoc to refer to SourceLocations outside SourceManager, or ID to refer to identifiers. |
again, I'd stick with "touching" to match syntax::tokens