-
Notifications
You must be signed in to change notification settings - Fork 412
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
Backticks on identifiers should be separate tokens #1936
Comments
Tracked in Apple’s issue tracker as rdar://112672035 |
Or perhaps they should be excluded from |
It makes sense that the backticks are part of the identifier token because the I absolutely agree that we need to have an API on The suggestion is that we introduce something like the following and then you could use struct Identifier {
var name: String
init(_ token: TokenSyntax) {
// FIXME: Handle backticks
self.name = token.text
}
}
extension TokenSyntax {
var identifier: Identifier {
Identifier(self)
}
} |
Oh, sure—I am maybe fixating on a specific technical solution here. Feel free to come up with a better idea! :) |
This looks interesting! I'm currently looking at macros and getting in to swift syntax and would love to contribute my first issue/fix and this one seems a nice isolated one to kick things off Aware this is 8 months ago so things might have changed but sounds like this is all still viable as above if I were to look in to it? 👨🏻💻 |
Yes, the issue is still open and still applies. |
I'm just looking in to this now, from what I can tell from this issue and the one linked by @ahoppen here: #1816 (comment) ... It looks like the criteria here is:
I'm going to look at this now and see how I get on |
What you should do is fork the repository (via GitHub) to your account, then move the branch to your fork. From there, GitHub will let you open a PR back to the original repo. If that's not working, we can look into it. |
Hi there! It's fantastic to hear that you've prepared changes to contribute! To submit a Pull Request, you don't need permissions. Here's a quick guide on how to proceed:
Once you've pushed your branch, you should see an option on this repository's page to create a PR from a branch in your fork. For more detailed guidance on contributing to this project, I recommend checking out these resources: Thanks for your contribution! |
Amazing thanks both! 👌🏻 Apologies, I did read the contributing guides but didn't see anything re forking the repo. Did I scroll straight past it and it was right in front of me? Or are these steps not included? If it's the latter, is it worth putting those instructions in that CONTRIBUTING guide @Matejkob ? |
You're welcome, and no worries at all! To the best of my knowledge, you're right: neither of the documents explicitly mentions the step about forking the repository. I included those links thinking they might offer additional insights on other aspects of contributing, not realizing the forking step wasn't covered. My apologies for any confusion that may have caused. It's a good suggestion to add a section about forking to the |
Can you file an issue against the Swift repo about that oversight? Thanks! 😄 |
No worries at all! Issue opened below for the following repos: |
For completeness sakes, PR for this issue is opened here: #2576 |
@grynspan PR here swiftlang/swift#72731 |
Closing as completed by #2576. |
Description
If I have an expression like so:
Then the syntax node representing
z
contains the surrounding backticks. I then need to strip these off manually to get at the actual symbol name so I can use it in other contexts likecontext.makeUniqueName()
or diagnostic messages. These backticks should probably be represented by separate tokens, no?Steps to Reproduce
No response
The text was updated successfully, but these errors were encountered: