Skip to content

[refactoring] Avoid producing empty string/comment categorized edit ranges when renaming init. Also disallow renaming inits with no arguments. #14980

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

Conversation

nathawes
Copy link
Contributor

@nathawes nathawes commented Mar 5, 2018

When renaming an initializer we don't try to pick up argument labels and also don't record the base name location, since you can't actually rename it. This means there are no ranges to rename, but we still return a categorized edit of type string/comment with no location information. This patch changes the category returned to unmatched, rather than string/comment, to indicate they shouldn't be handled.

Also stop showing rename as available on initializers that take no arguments, since nothing can be renamed.

Resolves rdar://problem/37905156.

@nathawes
Copy link
Contributor Author

nathawes commented Mar 5, 2018

@swift-ci please smoke test

@nathawes nathawes force-pushed the rdar37905156-rename-init-gives-empty-categorised-edit-ranges branch from b9c507d to 22aa81e Compare March 6, 2018 02:37
@nathawes nathawes changed the title [WIP][refactoring] Avoid producing empty string/comment categorized edit ranges when renaming init. Also disallow renaming inits with no arguments. [refactoring] Avoid producing empty string/comment categorized edit ranges when renaming init. Also disallow renaming inits with no arguments. Mar 6, 2018
…ming init. Also disallow renaming inits with no arguments.
@nathawes nathawes force-pushed the rdar37905156-rename-init-gives-empty-categorised-edit-ranges branch from 22aa81e to 91ec998 Compare March 6, 2018 02:38
@nathawes
Copy link
Contributor Author

nathawes commented Mar 6, 2018

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Mar 6, 2018

Build failed
Swift Test OS X Platform
Git Sha - b9c507d11c8d02d0078388657596b7ae07baaca2

@swift-ci
Copy link
Contributor

swift-ci commented Mar 6, 2018

Build failed
Swift Test Linux Platform
Git Sha - b9c507d11c8d02d0078388657596b7ae07baaca2

@nathawes
Copy link
Contributor Author

nathawes commented Mar 6, 2018

@swift-ci please smoke test osx

@nathawes nathawes merged commit 743d3a5 into swiftlang:master Mar 6, 2018
@nathawes nathawes deleted the rdar37905156-rename-init-gives-empty-categorised-edit-ranges branch March 6, 2018 23:40
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