mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[cursor-info] Tweak check to not report parent_loc on locals in body
We were checking only for the specific loc of the declaration of the param, but that didn't handle references to a local parameter inside the body. rdar://problem/32019195
This commit is contained in:
@@ -621,7 +621,7 @@ getParamParentNameOffset(const ValueDecl *VD, SourceLoc Cursor) {
|
||||
if (auto PD = dyn_cast<ParamDecl>(VD)) {
|
||||
|
||||
// Avoid returning parent loc for internal-only names.
|
||||
if (PD->getArgumentNameLoc().isValid() && PD->getNameLoc() == Cursor)
|
||||
if (PD->getArgumentNameLoc().isValid() && PD->getArgumentNameLoc() != Cursor)
|
||||
return None;
|
||||
auto *DC = PD->getDeclContext();
|
||||
switch (DC->getContextKind()) {
|
||||
|
||||
Reference in New Issue
Block a user