-
Notifications
You must be signed in to change notification settings - Fork 314
Support cross-file rename for clang languages #1031
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
@swift-ci Please test |
/// Rename all occurrences of a symbol named `oldName` to `newName` at the | ||
/// given `positions`. | ||
/// | ||
/// The use case of this method is the positions to rename are already known |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// The use case of this method is the positions to rename are already known | |
/// The use case of this method is for when the positions to rename are already known |
Looks like a copy paste of the clangd comment, so you could update it from there (assuming you fixed that).
""", | ||
] | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add a cross-language test? Or multiple even, eg. swift <-> objc, swift <-> c, and swift <-> c++?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ha, no. This PR is about adding global rename for clang languages, not doing cross-language rename yet. For that we need name translation, which I’ll add in a follow-up PR (and which is currently blocked by rdar://120066209).
rdar://118996461 is tracking the addition of cross-language rename.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC only ObjC is blocked by that right 😅? But cool, didn't realize we didn't have name translation yet, thanks 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but ObjC is really the interesting candidate for name translation. And it’s easiest to design it with all name translations in mind. There will be a follow-up PR soon-ish.
This uses the indexed rename request I added to clangd to perform global rename in clang’s language using SourceKit-LSP’s index: SourceKit-LSP’s index is used to find the locations to rename and the indexed rename request to clangd is used to translate the rename locations to edits. rdar://118996369
efc7914
to
bfb9040
Compare
@swift-ci Please test |
@swift-ci Please test Windows |
This uses the indexed rename request I added to clangd to perform global rename in clang’s language using SourceKit-LSP’s index: SourceKit-LSP’s index is used to find the locations to rename and the indexed rename request to clangd is used to translate the rename locations to edits.
rdar://118996369