From 532d106f087cacd008a209c680eb4c80a12e88f1 Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Wed, 5 Oct 2016 10:47:49 -0700 Subject: [PATCH] Add enough logic to TypeReconstruction to allow LLDB to discover the type of methods in protocol extensions, such as e.g. extension Collection { func group(f: Key) -> Key {...} } I have a matching test case for this over in LLDB --- lib/IDE/TypeReconstruction.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/IDE/TypeReconstruction.cpp b/lib/IDE/TypeReconstruction.cpp index c6cba873a95c4..a2bbe6e4f7015 100644 --- a/lib/IDE/TypeReconstruction.cpp +++ b/lib/IDE/TypeReconstruction.cpp @@ -243,6 +243,10 @@ class DeclsLookupSource { } } else if (_type == LookupKind::SwiftModule) _module->lookupValue(path, name, kind, result); + else if (_type == LookupKind::Extension) { + auto results = _extension._decl->lookupDirect(DeclName(name)); + result.append(results.begin(), results.end()); + } return; } @@ -1322,6 +1326,7 @@ static void VisitNodeFunction( case Demangle::Node::Kind::Module: case Demangle::Node::Kind::Structure: case Demangle::Node::Kind::Protocol: + case Demangle::Node::Kind::Extension: nodes.push_back((*pos)); VisitNode(ast, nodes, decl_scope_result, generic_context); break;