[SourceKit] Disable completion-like cursor info for ParamDecls

This commit is contained in:
Alex Hoppen
2022-12-15 17:15:21 +01:00
parent 04d44bfc04
commit e47aea448e
2 changed files with 12 additions and 1 deletions

View File

@@ -150,7 +150,10 @@ private:
} }
if (auto VD = dyn_cast<ValueDecl>(D)) { if (auto VD = dyn_cast<ValueDecl>(D)) {
if (VD->hasName()) { // FIXME: ParamDecls might be closure parameters that can have ambiguous
// types. The current infrastructure of just asking for the VD's type
// doesn't work here. We need to inspect the constraints system solution.
if (VD->hasName() && !isa<ParamDecl>(D)) {
assert(Result == nullptr); assert(Result == nullptr);
Result = std::make_unique<NodeFinderDeclResult>(VD); Result = std::make_unique<NodeFinderDeclResult>(VD);
return Action::Stop(); return Action::Stop();

View File

@@ -0,0 +1,8 @@
func save(_ record: Int, _ x: (String) -> Void) {}
func test() {
let record = 2
// RUN: %sourcekitd-test -req=cursor -pos=%(line + 1):19 %s -- %s
save(record) { (record) in
}
}