summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang-tools-extra/clangd/index/IndexAction.cpp3
-rw-r--r--clang-tools-extra/clangd/index/IndexAction.h2
2 files changed, 3 insertions, 2 deletions
diff --git a/clang-tools-extra/clangd/index/IndexAction.cpp b/clang-tools-extra/clangd/index/IndexAction.cpp
index 96c007d4a8f..61db161bd5b 100644
--- a/clang-tools-extra/clangd/index/IndexAction.cpp
+++ b/clang-tools-extra/clangd/index/IndexAction.cpp
@@ -183,7 +183,8 @@ std::unique_ptr<FrontendAction> createStaticIndexingAction(
index::IndexingOptions::SystemSymbolFilterKind::All;
Opts.CollectIncludePath = true;
Opts.CountReferences = true;
- Opts.Origin = SymbolOrigin::Static;
+ if (Opts.Origin == SymbolOrigin::Unknown)
+ Opts.Origin = SymbolOrigin::Static;
Opts.StoreAllDocumentation = false;
if (RefsCallback != nullptr) {
Opts.RefFilter = RefKind::All;
diff --git a/clang-tools-extra/clangd/index/IndexAction.h b/clang-tools-extra/clangd/index/IndexAction.h
index 748b26e1671..f2b45deba02 100644
--- a/clang-tools-extra/clangd/index/IndexAction.h
+++ b/clang-tools-extra/clangd/index/IndexAction.h
@@ -22,7 +22,7 @@ namespace clangd {
// - include paths are always collected, and canonicalized appropriately
// - references are always counted
// - all references are collected (if RefsCallback is non-null)
-// - the symbol origin is always Static
+// - the symbol origin is set to Static if not specified by caller
std::unique_ptr<FrontendAction> createStaticIndexingAction(
SymbolCollector::Options Opts,
std::function<void(SymbolSlab)> SymbolsCallback,
OpenPOWER on IntegriCloud