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

Support for file watcher in SwiftFormat for Xcode #1906

Open
wvteijlingen opened this issue Oct 21, 2024 · 0 comments
Open

Support for file watcher in SwiftFormat for Xcode #1906

wvteijlingen opened this issue Oct 21, 2024 · 0 comments

Comments

@wvteijlingen
Copy link

wvteijlingen commented Oct 21, 2024

I would like to use SwiftFormat with a "format on save" capability. However, as Xcode does not natively support this functionality, it requires manual implementation using a file watcher.

One current workaround involves using a file watcher that employs Apple Script to simulate a click on the Editor > SwiftFormat > Format File menu option in Xcode. While this approach works, the limitation is that "SwiftFormat for Xcode" cannot detect the .swiftformat configuration file.

Would it be possible to either:

  1. Extend "SwiftFormat for Xcode" to load a configuration file programmatically, perhaps through a CLI command? This would allow the watcher script to locate the configuration file, load it into "SwiftFormat for Xcode," and then simulate the menu interaction.
  2. Or, incorporate native file watcher functionality into "SwiftFormat for Xcode"? This could include a feature allowing users to select a project folder, at which point the application would automatically load the configuration file (if available) and initiate the watcher.
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

1 participant