zed
zed copied to clipboard
Add swift support
This PR adds the Swift tree-sitter grammar copied from nvim-treesitter. It also adds the sourcekit-lsp.
This PR resolves #5278
Release Notes:
- Added Swift support (#5278).
We require contributors to sign our Contributor License Agreement, and we don't have @ceopaludetto on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.
@cla-bot check
The cla-bot has been summoned, and re-checked this pull request!
Thank you for the PR! I think it would be nice to see integration with Zed's outline view, via an
outline.scm
file. Also, I don't think we can add any Swift PR until we've discussed what to do about: alex-pinkus/tree-sitter-swift#240
Yeah, the highlight slowness is a big problem as discussed in zed-industries/extensions#139. But can Swift be added behind a feature flag(something like "unstable swift support") until the issue is resolved?
The slowdown is only one initial load thing according to the author. If that's the case, I'd use this and deal with it. It's still a value add. Can be iterated upon later.
If there isn't support for feature flags (I haven't checked) then perhaps just have it be off by default in settings. Then the documentation can give the caveats and warning. That way people can use the language without needing the jump through building from source, and the impression isn't given its fully supported.
We should determine which one is better
- [#6832]
Cc @matyunya
Closing this for now. We have a Swift extension for tree-sitter, and language server support for extensions will land soon.
Closing this for now. We have a Swift extension for tree-sitter, and language server support for extensions will land soon.
Can I follow the LSP dev somewhere?
@maxbrunsfeld is working on it (often in https://zed.dev/channel/language-servers-4159). A prototype landed here: https://github.com/zed-industries/zed/pull/9085 if you want to take a look.