-
Notifications
You must be signed in to change notification settings - Fork 314
implement DocumentFormattingRequest #361
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
implement DocumentFormattingRequest #361
Conversation
@Trzyipolkostkicukru sorry for not providing feedback on this earlier. Thanks to Karl for bringing it up on https://forums.swift.org/t/the-current-state-of-swift-for-server-and-linux/47732/23. While some of the information on the original PR is still relevant here, I also realize I didn't write down all of the things that were in my head. Here are what I see as the blockers to adding a dependency on swift-format in sourcekit-lsp. TestingIntegration of swift-format into Swift's CI system, including testing sourcekit-lsp when we change swift-format. For sourcekit-lsp's use case this doesn't require that swift-format the command-line tool is installed in the toolchain, just that it's getting tested properly. @shahmishal do you have any updates you can share? WorkflowThere is a workflow challenge for developing tools that are part of the toolchain and built on top of swift-syntax, like swift-format is. Swift-syntax has an unstable dependency on One potential solution to this would be if we could use a binary dependency for the parser library in swift-syntax, which would allow us to pull down a matching combination of swift-syntax and parser library during development that is still very close to the main branch. Unfortunately, there is not yet swiftpm support for binary dependencies on Linux. |
Now that swift-parser support binary dependencies will you consider adding formatting to swift-lsp ? |
While swift-syntax is starting to create releases that ship the parser library as a binary dependency (link), SwiftPM still doesn’t support binary dependencies on Linux, so the problem that @benlangmuir mentioned as the “Workflow” problem unfortunately still exists on Linux. |
Is there already an issue for this in the SwiftPM's repo? |
@IOOI-SqAR I wasn't able to find one. The most recent discussion that I am aware of is https://forums.swift.org/t/binary-dependencies-on-linux/27623/1 |
Hi @benlangmuir ! In Order to discuss this topic in the swift forums I created this: https://forums.swift.org/t/support-binary-dependencies-on-linux-and-windows/57021 (I just don't wanted to raise this old thread you mentioned from the dead). |
sourcekit-lsp does not support formatting Swift Ref: swiftlang/sourcekit-lsp#576 Ref: swiftlang/sourcekit-lsp#361
Apologies if my understanding is incorrect, but it seems swift-format mainline no longer depends on the Swift toolchain. Is this PR able to proceed? |
Yes, I don’t see a reason that would still block this PR now that the SwiftSyntax dependency on the parser library has been removed. |
I picked this PR up in #769 and I’m thus closing this one. |
Rebased to main branch and squashed.