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-5977] [SourceKit] Introduce "source.lang.swift.expr.tuple" in structure #48536

Closed
marcelofabri opened this issue Sep 25, 2017 · 2 comments
Closed
Assignees

Comments

@marcelofabri
Copy link
Contributor

Previous ID SR-5977
Radar None
Original Reporter @marcelofabri
Type Improvement
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Source Tooling
Labels Improvement
Assignee @marcelofabri
Priority Medium

md5: 7aa7f518d7a72cdc9ef2c76883710d77

Issue Description:

Similar to source.lang.swift.expr.array and source.lang.swift.expr.dictionary, SourceKit should provide information about tuples inside a structure. I propose a new expression kind source.lang.swift.expr.tuple.

This would provide key.elements as the other mentioned kinds. Those elements should also provide information about elements names.

This new information would make possible for tools like SwiftLint to evaluate this information.

For SwiftLint in special, this would be useful to improve the Large Tuple Rule, as it currently only evaluates tuples in variable or function declarations. It can't catch cases like using tuples as arguments in generic functions. While it'd probably be possible to implement that in the current state, having SourceKit to provide this information would make it much more reliable.

@marcelofabri
Copy link
Contributor Author

I was able to come up with an initial implementation for this, but unfortunately it also removes source.lang.swift.expr.argument from the structure as they apparently are tuples too.

@marcelofabri
Copy link
Contributor Author

#12089

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
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

1 participant