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

Open
dduan opened this issue Feb 3, 2019 · 1 comment
Open

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

dduan opened this issue Feb 3, 2019 · 1 comment
Assignees

Comments

@dduan
Copy link
Contributor

@dduan 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 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants