-
Notifications
You must be signed in to change notification settings - Fork 278
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
Options to control swift-format #1811
Comments
Synced to Apple’s issue tracker as rdar://139514618 |
What would be the benefit of that? If you don’t want it, you can choose to not invoke formatting. Or am I missing something?
What would be the use case? I would prefer to not add configuration options unless we know that they solve real-world problems.
Which arguments would you pass here?
What would be the reason to not have
Similar here, when would this be useful? |
@ahoppen right. I didn't make these up, I just looked at what options the vknabel formatter extension gives and assumed there are reasons for existence of those options.
I'm not 100% sure how it plays in VSCode but someone might want to use one of the vknabel extensions and format their Swift files, just not use the swift-extension's formatter. But then you can choose another formatter in VSCode UI so i can get behind not having this option for now.
swift-format is bundled with the toolchains which means it's not updated too frequently. Maybe someone wants to use an updated version of swift-format.
Not sure what I'd pass here ... I guess in swift-format's case there may not be too many options to modify (yet?). But I can see this being useful in the future. Maybe there is an experimental flag or something added?
I personally don't mind it but the root directory can get pretty crowded with 20 different config files sitting there in the bigger projects. VSCode does show the
This should be helpful to avoid swift-format running with its default configuration just because no config exists. |
For me personally it would be important to be able to disable/enable swift-format's "Format Document" behavior when no Because if a project has It could be valuable to have options to disable each of |
Thanks for your detailed reply. I don’t think there are any concrete needs for the options you mentioned in the original post and I’d prefer to not add options just for the sake of having more options. If there are use cases that are enabled by the options, I’m happy to add them.
I think this option makes sense to add. |
If we want to do minimal options for now unless a need appears, then I want to mention that i think We currently use This has already happened to us with different |
There should be some options to control swift-format that is bundled with the toolchains.
I'm not sure how this'll play with the fact that the formatter is called by sourcekit-lsp, not directly by the vscode extension. Perhaps @ahoppen can enlighten me.
Some possible options:
swift-format
..swift-format
.Package.swift
or if there is no.swift-format
file.The text was updated successfully, but these errors were encountered: