zed icon indicating copy to clipboard operation
zed copied to clipboard

Add swift support

Open ceopaludetto opened this issue 1 year ago • 7 comments

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).

ceopaludetto avatar Jan 27 '24 01:01 ceopaludetto

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[bot] avatar Jan 27 '24 01:01 cla-bot[bot]

@cla-bot check

ceopaludetto avatar Jan 27 '24 01:01 ceopaludetto

The cla-bot has been summoned, and re-checked this pull request!

cla-bot[bot] avatar Jan 27 '24 01:01 cla-bot[bot]

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?

ceopaludetto avatar Jan 27 '24 02:01 ceopaludetto

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.

marcusziade avatar Jan 27 '24 12:01 marcusziade

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.

Dog avatar Jan 27 '24 16:01 Dog

We should determine which one is better

  • [#6832]

Cc @matyunya

marcusziade avatar Jan 27 '24 22:01 marcusziade

Closing this for now. We have a Swift extension for tree-sitter, and language server support for extensions will land soon.

ConradIrwin avatar Mar 13 '24 17:03 ConradIrwin

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?

marcusziade avatar Mar 14 '24 02:03 marcusziade

@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.

ConradIrwin avatar Mar 15 '24 03:03 ConradIrwin