Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions indexer/ClangAstMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
F(Enum) \
F(Field) \
F(Function) \
F(FunctionTemplate) \
F(Namespace) \
F(NonTypeTemplateParm) \
F(Record) \
Expand Down
5 changes: 5 additions & 0 deletions indexer/Indexer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,11 @@ void TuIndexer::saveFunctionDecl(const clang::FunctionDecl &functionDecl) {
}
}

void TuIndexer::saveFunctionTemplateDecl(const clang::FunctionTemplateDecl &) {
// Handled by saveFunctionDecl.
return;
}

void TuIndexer::saveNamespaceDecl(const clang::NamespaceDecl &namespaceDecl) {
auto optSymbol = this->symbolFormatter.getNamespaceSymbol(namespaceDecl);
if (!optSymbol.has_value()) {
Expand Down
5 changes: 5 additions & 0 deletions indexer/SymbolFormatter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,11 @@ SymbolFormatter::getFunctionSymbol(const clang::FunctionDecl &functionDecl) {
});
}

std::optional<std::string_view> SymbolFormatter::getFunctionTemplateSymbol(
const clang::FunctionTemplateDecl &functionTemplateDecl) {
return this->getFunctionSymbol(*functionTemplateDecl.getTemplatedDecl());
}

std::optional<std::string_view>
SymbolFormatter::getFieldSymbol(const clang::FieldDecl &fieldDecl) {
if (fieldDecl.getDeclName().isEmpty()) {
Expand Down
4 changes: 4 additions & 0 deletions test/index/functions/ctors_dtors.snapshot.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,13 @@
C c3{move(c1)};
// ^ reference [..] C#
// ^^ definition local 10
// ^^^^ reference [..] move(721d19cf58c53974).
// ^^ reference local 7
D d3{move(d1)};
// ^ reference [..] D#
// ^^ definition local 11
// ^^ reference [..] D#D(ece7426db7e2c886).
// ^^^^ reference [..] move(721d19cf58c53974).
// ^^ reference local 8

C c4 = {};
Expand Down Expand Up @@ -130,10 +132,12 @@
C c10 = move(c1);
// ^ reference [..] C#
// ^^^ definition local 20
// ^^^^ reference [..] move(721d19cf58c53974).
// ^^ reference local 7
D d10 = move(d1);
// ^ reference [..] D#
// ^^^ definition local 21
// ^^^^ reference [..] D#D(ece7426db7e2c886).
// ^^^^ reference [..] move(721d19cf58c53974).
// ^^ reference local 8
}
4 changes: 4 additions & 0 deletions test/index/functions/templates.snapshot.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@
// ^^ reference [..] T0#g0(b07662a27bd562f9).

h0<int>(0);
// ^^ reference [..] h0(9b289cee16747614).
h0<void *>(0);
// ^^ reference [..] h0(9b289cee16747614).
h1<int>(0);
// ^^ reference [..] h1(9b289cee16747614).
h1<char>(0);
// ^^ reference [..] h1(9b289cee16747614).
}