Skip to content

[SourceKit] When cursor points to an external argument name in a function-like decl, we should return the information about the function-like decl instead of being empty. rdar://32018814 #9356

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 6, 2017

Conversation

nkcsgexi
Copy link
Contributor

@nkcsgexi nkcsgexi commented May 5, 2017

The is revised PR based on @benlangmuir 's comments.

…tion-like decl, we should return the information about the function-like decl instead of being empty. rdar://32018814
@nkcsgexi
Copy link
Contributor Author

nkcsgexi commented May 5, 2017

@swift-ci please smoke test

@nkcsgexi
Copy link
Contributor Author

nkcsgexi commented May 5, 2017

@swift-ci please smoke test

@nkcsgexi nkcsgexi requested a review from benlangmuir May 5, 2017 22:34
/// \param Name the argument name.
/// \param StartLoc the source loc of the argument name start.
/// \param D the function-like decl.
virtual bool visitExternalArgumentName(Identifier Name, SourceLoc StartLoc,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe "visitDeclarationArgumentName" to distinguish it from the call argument case above a bit more?


// CHECK1: source.lang.swift.decl.function.constructor
// CHECK2: source.lang.swift.decl.function.method.instance
// CHECK3: source.lang.swift.decl.function.subscript
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is already cursor_label.swift; should this go in that file as well? It would also be good to keep them together to make sure that all the cases are tested with both external an local name. For example, I see that the local name tests don't check the kind of entity, whereas these tests don't check for parent_loc (which presumably should not be on anything here).

Copy link
Contributor

@benlangmuir benlangmuir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@nkcsgexi
Copy link
Contributor Author

nkcsgexi commented May 5, 2017

@swift-ci please smoke test

@nkcsgexi nkcsgexi merged commit a149538 into swiftlang:master May 6, 2017
@nkcsgexi nkcsgexi deleted the cursor-on-argument branch May 6, 2017 00:12
nkcsgexi added a commit that referenced this pull request May 6, 2017
…tion-like decl, we should return the information about the function-like decl instead of being empty. rdar://32018814 (#9356)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants