Skip to content

Add Refactoring Actions to Reformat Integer Literals #1070

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

Merged
merged 2 commits into from
Nov 14, 2022

Conversation

CodaFi
Copy link
Contributor

@CodaFi CodaFi commented Nov 10, 2022

No description provided.

Add two refactoring action that insert and remove separators from integer literals at base-appropriate locations.
@CodaFi CodaFi requested a review from ahoppen as a code owner November 10, 2022 20:42
@CodaFi
Copy link
Contributor Author

CodaFi commented Nov 10, 2022

@swift-ci test

@allevato
Copy link
Member

Strategy-wise, I'm curious how you all envision this new package which is likely to contain rules that overlap with those already in swift-format; for example, this is similar (but not identical) to https://github.com/apple/swift-format/blob/main/Sources/SwiftFormatRules/GroupNumericLiterals.swift.

One possibility is that I can imagine swift-format being a frontend for these, by us creating an adaptor for refactoring actions so that they can be applied by our pipeline and controlled in someone's configuration.

But mainly, I want to make sure we're not duplicating work or having two similar but still different implementations of mostly the same concept in both repositories.

@CodaFi
Copy link
Contributor Author

CodaFi commented Nov 10, 2022

I'd very much like for SwiftRefactor to become the de-facto host for syntactic SwiftSyntax transformations. I anticipate this library having a broad set of clients - from IDEs powered by sourcekit-lsp turning these into code actions to code-correcting formatters like swift-format and SwiftLint acting as porcelain over the raw refactoring actions.

@CodaFi CodaFi merged commit 1d555c8 into swiftlang:main Nov 14, 2022
@CodaFi CodaFi deleted the literally branch November 14, 2022 21:28
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

Successfully merging this pull request may close these issues.

2 participants