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

How is swiftformat.options configured? #17

Closed
xxxIxxxx opened this issue Nov 15, 2021 · 4 comments
Closed

How is swiftformat.options configured? #17

xxxIxxxx opened this issue Nov 15, 2021 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@xxxIxxxx
Copy link

image

It doesn't seem to work that way.
So can you add a configuration list like this one?
Thanks big guy!

好像不是这样用的。
那么可以加一个像这样的配置列表吗?
谢谢大佬!

@vknabel
Copy link
Owner

vknabel commented Jan 10, 2022

Hi @xxxIxxxx, sorry for the late response!

The correct config would be: "swiftformat.options": ["--stripunusedargs", "closure-only"].
Does it work for you that way? It seems like you configured "swiftformat.options": ["--stripunusedargs closure-only"] instead.

@vknabel vknabel added the question Further information is requested label Jan 10, 2022
@xxxIxxxx
Copy link
Author

Thanks for the reply, I tried it and it still doesn't work

 "--stripunusedargs", "closure-only"    or    "--stripunusedargs","closure-only"
❌ SwiftFormat failed. error: File not found at /"--stripunusedargs".

 --stripunusedargs, closure-only    or    --stripunusedargs,closure-only
❌ SwiftFormat failed. error: Unknown option --stripunusedargs, closure-only. Did you mean --stripunusedargs?

 --stripunusedargs
❌ SwiftFormat failed. error: --stripunusedargs option expects a value.

1

@vknabel
Copy link
Owner

vknabel commented Jan 11, 2022

That's weird.

You are on Linux, right?

What happens if you uncheck Swiftformat: Only enable on Swift PM Projects, remove the dependency from your Package.swift, run swift package clean and reopen the VS Code window?

Maybe there is a bug when using the Package directly from your Swift PM project.

@vknabel vknabel added bug Something isn't working and removed question Further information is requested labels Jan 11, 2022
@vknabel vknabel self-assigned this Jan 11, 2022
@xxxIxxxx
Copy link
Author

macOS

Unchecking it doesn't work, I only have an A.swift file

1

@vknabel vknabel closed this as completed Dec 12, 2022
vknabel added a commit that referenced this issue Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants