From 55b28fe8981cd6995d27aec00198136a744b1b0a Mon Sep 17 00:00:00 2001 From: ryuukk Date: Mon, 6 Feb 2023 20:29:21 +0100 Subject: [PATCH] added support for functions --- dsymbol/src/dsymbol/conversion/second.d | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) mode change 100644 => 100755 dsymbol/src/dsymbol/conversion/second.d diff --git a/dsymbol/src/dsymbol/conversion/second.d b/dsymbol/src/dsymbol/conversion/second.d old mode 100644 new mode 100755 index f538442..6ab991a --- a/dsymbol/src/dsymbol/conversion/second.d +++ b/dsymbol/src/dsymbol/conversion/second.d @@ -95,6 +95,7 @@ void secondPass(SemanticSymbol* currentSymbol, Scope* moduleScope, ref ModuleCac moduleScope, cache); break; case variableName: + case functionName: if (currentSymbol.acSymbol.tmplArgNames.length > 0 && currentSymbol.acSymbol.type) { auto tArgNames = currentSymbol.acSymbol.tmplArgNames; @@ -148,6 +149,13 @@ void resolveTemplate(DSymbol* sym, DSymbol* type, scope const istring[] tmplArgN newPart.doc = part.doc; newPart.callTip = part.callTip; newPart.type = argSymbol; + if (part.kind == CompletionKind.functionName) + { + if (part.type && part.type.kind == CompletionKind.typeTmpParam) + { + newPart.type = argSymbol; + } + } newType.addChild(newPart, true); } else @@ -155,7 +163,8 @@ void resolveTemplate(DSymbol* sym, DSymbol* type, scope const istring[] tmplArgN if (part.tmplArgNames.length > 0) { auto innerArg = part.tmplArgNames[0]; - resolveTemplate(part, part.type, [argName], moduleScope, cache); + if (innerArg == currentT.name) + resolveTemplate(part, part.type, [argName], moduleScope, cache); } newType.addChild(part, false); }