-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Swift syntax highlighting #6832
Conversation
We require contributors to sign our Contributor License Agreement, and we don't have @matyunya 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! |
There was a problem hiding this 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! Unfortunately, I don't think we can merge this until we've discussed what to do about alex-pinkus/tree-sitter-swift#240
"async" @keyword | ||
"await" @keyword | ||
(where_keyword) @keyword | ||
(parameter external_name: (simple_identifier) @parameter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, we do not use @parameter
, see the theme/src/styles/syntax.rs file for a list of options.
@@ -0,0 +1,18 @@ | |||
(import_declaration (identifier) @definition.import) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think our tree sitter integration uses a locals file.
@@ -0,0 +1,51 @@ | |||
(class_declaration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not use a tags query, however tags are analogous to the outline.scm
queries we have.
@@ -0,0 +1,19 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This query is also not applicable to zed.
Thank you for swift response! Will try to dive in. |
We should determine which one is better |
On my way with faster/more correct grammar |
btw, is it possible that the problem with initial load time has something to do with missing parser artefacts? I never noticed the particular problem as I included the artefacts in my fork before even trying to run it. |
How did you include the artefacts? |
Commited output of |
Since this PR only adds syntax highlighting, we're able to offer this as an extension. There is a Swift extension available already, although it's temporarily disabled while we work through a crash that it causes. |
This PR adds Swift tree-sitter grammar built from https://github.com/alex-pinkus/tree-sitter-swift.
Here's example of syntax highlighting:
Attempted to attach SourceKit LSP but it only returns empty responses.