Navigation Menu

Skip to content
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

[SR-9850] There's no obvious way to get content of a syntax node #422

Closed
dduan opened this issue Feb 3, 2019 · 2 comments
Closed

[SR-9850] There's no obvious way to get content of a syntax node #422

dduan opened this issue Feb 3, 2019 · 2 comments
Assignees

Comments

@dduan
Copy link
Contributor

dduan commented Feb 3, 2019

Previous ID SR-9850
Radar None
Original Reporter @dduan
Type Improvement
Additional Detail from JIRA
Votes 0
Component/s SwiftSyntax
Labels Improvement
Assignee @nkcsgexi
Priority Medium

md5: 7a905c33db7bd997093527302f0f11ec

Issue Description:

Each syntax node has a contentLength property, which does not count the length of trivia. It would be great to have a way to get the text corresponding to this content. Currently, achieving this task is not super easy.

@harlanhaskins @akyrtzi

@akyrtzi
Copy link
Member

akyrtzi commented Feb 3, 2019

We could add a `write(to:Target, withLeadingTrivia:Bool, withTrailingTrivia:Bool)` function to provide more control on getting the text.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 9, 2022
@ahoppen
Copy link
Collaborator

ahoppen commented Jun 21, 2022

Just going through some old bugs that are still open. Isn’t this implemented with node.description? I’m speculatively closing this. If this issue is about something that isn’t supported by the description property, please re-open it.

@ahoppen ahoppen closed this as completed Jun 21, 2022
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

No branches or pull requests

4 participants