summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/SemanticSelection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang-tools-extra/clangd/SemanticSelection.cpp')
-rw-r--r--clang-tools-extra/clangd/SemanticSelection.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang-tools-extra/clangd/SemanticSelection.cpp b/clang-tools-extra/clangd/SemanticSelection.cpp
index cbbf31f1b05..49fc7703db0 100644
--- a/clang-tools-extra/clangd/SemanticSelection.cpp
+++ b/clang-tools-extra/clangd/SemanticSelection.cpp
@@ -39,7 +39,8 @@ llvm::Expected<std::vector<Range>> getSemanticRanges(ParsedAST &AST,
}
// Get node under the cursor.
- SelectionTree ST(AST.getASTContext(), AST.getTokens(), *Offset);
+ SelectionTree ST = SelectionTree::createRight(
+ AST.getASTContext(), AST.getTokens(), *Offset, *Offset);
for (const auto *Node = ST.commonAncestor(); Node != nullptr;
Node = Node->Parent) {
if (const Decl *D = Node->ASTNode.get<Decl>()) {
OpenPOWER on IntegriCloud