Open DubonYaar opened 2 years ago
This is a known issue (it's due to a limitation in the sandbox restrictions for extensions).
The good news is there's a workaround and it will hopefully be fixed soon. In the meantime, you have to load your .swiftformat file manually in the SwiftFormat for Xcode app to configure the extension.
Thanks, How do I load the .swiftformat manually?
Use the File > Open… menu in the app
@nicklockwood is there any way I can help fix this issue? maybe via a donation? I need this so all my other computers and colleagues are on the same formatting rules as me.
@mesqueeb it's a sandboxing limitation imposed by Apple (Xcode extensions can't access the file system). Others have tried to find workarounds but nothing has worked so far
@nicklockwood how about adding a text input to the app where we can paste a public url to the config (eg on a public git repo) and then each time your app launches it will fetch the latest config from there.
This is something I can try building and PR? Doesn't seem too difficult. Or does the sandbox also prevent https get calls?
This is something I can try building and PR? Doesn't seem too difficult. Or does the sandbox also prevent https get calls?
I'm not sure if http requests are allowed actually - it might work. You can't show any UI though, so you'd have to enter the url through the helper app and then sync it across to the extension via user defaults (same way config works currently)
is this still a known issue? how are people working around this?
is this still a known issue? how are people working around this?
you have to load your .swiftformat file manually in the SwiftFormat for Xcode app to configure the extension.
will this work regardless of location? for example if I load /.swiftformat
into the SwiftFormat for Xcode app, will it apply to /myproject/ContentView.swift
?
looks like the answer is yes :) thanks.
I'm using Swift format for Xcode extension. I've added ".swiftformat" config file in the project folder, starting Swiftformat from Xcode's menu ignores the config file.