summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/SourceCode.h
diff options
context:
space:
mode:
authorHaojian Wu <hokein.wu@gmail.com>2019-10-30 13:21:47 +0100
committerHaojian Wu <hokein.wu@gmail.com>2019-11-06 09:56:02 +0100
commit7ea4c6fa5121b2417875dc1b547162e18be7dbe2 (patch)
tree9c676a130a4a4ffbf6d408213269631eec8b6caf /clang-tools-extra/clangd/SourceCode.h
parentf349cc37cc485fd5fc7b34cb84053af459337ecc (diff)
downloadbcm5719-llvm-7ea4c6fa5121b2417875dc1b547162e18be7dbe2.tar.gz
bcm5719-llvm-7ea4c6fa5121b2417875dc1b547162e18be7dbe2.zip
[clangd] Implement a function to lex the file to find candidate occurrences.
Summary: This will be used for incoming cross-file rename (to detect index staleness issue). Reviewers: ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69615
Diffstat (limited to 'clang-tools-extra/clangd/SourceCode.h')
-rw-r--r--clang-tools-extra/clangd/SourceCode.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang-tools-extra/clangd/SourceCode.h b/clang-tools-extra/clangd/SourceCode.h
index a05d8adf923..d20e03f5b87 100644
--- a/clang-tools-extra/clangd/SourceCode.h
+++ b/clang-tools-extra/clangd/SourceCode.h
@@ -232,6 +232,11 @@ llvm::Error reformatEdit(Edit &E, const format::FormatStyle &Style);
llvm::StringMap<unsigned> collectIdentifiers(llvm::StringRef Content,
const format::FormatStyle &Style);
+/// Collects all ranges of the given identifier in the source code.
+std::vector<Range> collectIdentifierRanges(llvm::StringRef Identifier,
+ llvm::StringRef Content,
+ const LangOptions &LangOpts);
+
/// Collects words from the source code.
/// Unlike collectIdentifiers:
/// - also finds text in comments:
OpenPOWER on IntegriCloud