-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Dart support #7220
Dart support #7220
Conversation
We require contributors to sign our Contributor License Agreement, and we don't have @agent3bood 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! |
b2d551c
to
2098693
Compare
Hey @agent3bood thanks a lot , was really waiting for it |
5aa5e5a
to
b8a1416
Compare
Like the CI, I am having issues building: $ cargo run --release
Updating crates.io index
Updating git submodule `git@github.com:tree-sitter/tree-sitter`
error: failed to get `tree-sitter-dart` as a dependency of package `zed v0.122.0 (/Users/brettmorgan/Documents/GitHub/zed/crates/zed)` |
Waiting for this to be merged soon, hopefully! |
# Conflicts: # crates/lsp/src/lsp.rs
can't wait for the merge and then to use flutter with ZED. |
Building works on my machine, could it be related to CI not having github in known_hosts? Or ssh key not setup? |
Yeah, I don't have SSH keys setup. The more interesting question is, why is the CI failing? Surely they have SSH keys setup for the CI bots? |
# Conflicts: # crates/zed/src/languages.rs
@@ -230,6 +230,7 @@ tree-sitter-clojure = { git = "https://github.com/prcastro/tree-sitter-clojure", | |||
tree-sitter-c-sharp = { git = "https://github.com/tree-sitter/tree-sitter-c-sharp", rev = "dd5e59721a5f8dae34604060833902b882023aaf" } | |||
tree-sitter-cpp = { git = "https://github.com/tree-sitter/tree-sitter-cpp", rev = "f44509141e7e483323d2ec178f2d2e6c0fc041c1" } | |||
tree-sitter-css = { git = "https://github.com/tree-sitter/tree-sitter-css", rev = "769203d0f9abe1a9a691ac2b9fe4bb4397a73c51" } | |||
tree-sitter-dart = { git = "https://github.com/agent3bood/tree-sitter-dart", rev = "48934e3bf757a9b78f17bdfaa3e2b4284656fdc7" } |
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 hope this can be merged and released asap !!
but, just for curiosity:
why did you linked your fork of "official" Dart tree-sitter repository instead of it self?
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.
There is no official package for Dart, the website links to "https://github.com/UserNobody14/tree-sitter-dart", which I forked to fix some issues on it.
Wow. Finally. <3 |
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 left some suggestions on the highlight query. Also, could you grab a screenshot of the outline query? Thank you!
; Methods | ||
; -------------------- | ||
(function_type | ||
name: (identifier) @method) |
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 think this needs to be function
or function.method
for us to pick it up.
(getter_signature | ||
(identifier) @method) | ||
(setter_signature | ||
name: (identifier) @method) |
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.
Same with these usages of @method
.
; Parameters | ||
; -------------------- | ||
(formal_parameter | ||
name: (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.
I don't think we give special highlighting @parameter
, because in general, we don't have a way of highlighting all of the occurrences of the parameter consistently. Could you remove these parameter ones?
|
||
; Keywords | ||
; -------------------- | ||
["import" "library" "export"] @include |
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 we highlight this group either. Maybe just use keyword
for these? Or if you want to allow themes to target them specifically, you could do keyword.include
.
"catch" | ||
"finally" | ||
(break_statement) | ||
] @exception |
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.
Same thing with conditional
, repeat
, and exception
: I think just use keyword
. You could add a suffix like keyword.conditional
, but we usually don't do that in our queries, so I don't think any themes will target that.
["do" "while" "continue" "for"] @repeat | ||
|
||
; Error | ||
(ERROR) @error |
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.
Can you remove this? We usually don't highlight errors in our highlight queries, because sometimes there are false positives. Also, I don't think themes target this.
Huge thanks for this effort! As soon as this gets merged in, I am poised to give Zed a try. |
@maxbrunsfeld Updated the highlights as suggested. Also check the file outline view bellow. ![]() |
LGTM |
Let's gooo 🚀🚀🚀 |
repeat > Lets' go 🚀🧨 |
When ship? 🚢🚢🚢 |
with extensions in pre (love it) - Lets' go for Flutter! 🚀🚀🚀 |
we all agree that this will change the course of the human timeline right ? |
As Dart developers we're all excited about this. Please stop spamming the issue - and in general only comment on Github issues if you contribute to solving it in some meaningful way. |
@agent3bood Just my opinion: downgrade to a extensions: https://github.com/zed-industries/extensions |
Looks like that will be the better option, just need a couple of days to check it out. |
Looks like zed extensions does not support adding language server to the editor, we will wait for this to be merged.
|
Yes, we can move this into an extension later, once we have the extension APIs needed for adding new language servers. Thanks for your work on this @agent3bood. |
This will ship in Zed 0.124. |
This is my first contribution, feedback is welcome.
Release Notes: