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

Add swift support #6831

Closed
wants to merge 1 commit into from
Closed

Add swift support #6831

wants to merge 1 commit into from

Conversation

ceopaludetto
Copy link

This PR adds the Swift tree-sitter grammar copied from nvim-treesitter. It also adds the sourcekit-lsp.

This PR resolves zed-industries/extensions#139

Release Notes:

  • Added Swift support (#5278).

Copy link

cla-bot bot commented Jan 27, 2024

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

@ceopaludetto ceopaludetto marked this pull request as draft January 27, 2024 01:32
@ceopaludetto
Copy link
Author

@cla-bot check

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jan 27, 2024
Copy link

cla-bot bot commented Jan 27, 2024

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

Copy link
Contributor

@mikayla-maki mikayla-maki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

(where_keyword) @keyword

(parameter
external_name: (simple_identifier) @variable.parameter)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have a @variable.parameter, you can see what we do have in syntax.rs

@ceopaludetto
Copy link
Author

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?

@marcusziade
Copy link

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.

@Dog
Copy link

Dog commented Jan 27, 2024

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.

@marcusziade
Copy link

We should determine which one is better

Cc @matyunya

@ConradIrwin
Copy link
Member

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

@marcusziade
Copy link

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?

@ConradIrwin
Copy link
Member

@maxbrunsfeld is working on it (often in https://zed.dev/channel/language-servers-4159). A prototype landed here: #9085 if you want to take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Swift
6 participants