-
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
Add Astro Support #6896
Add Astro Support #6896
Conversation
SCM files are left to be added. |
Hey, maintainer of the Astro language server here, you'll need to pass a path to a TypeScript install's Let me know if there's any way I can assist, been liking Zed a fair amount recently 🫡 |
In spite of adding the queries, From the tree-sitter-astro repo: And these are defined in the
|
Can't really speak to the syntax highlighting and tree sitter issues, but the Astro LSP part looks great to me! I'd suggest holding on for now because it's a bit buggy, but in the future, it should probably also install the Astro TypeScript plugin, for |
From this comment, I think there's an issue with CSS highlighting within the |
That was before Astro had its own treesitter plugin! The TSX treesitter plugin of course cannot highlight CSS (or script tags, for that matter), hence why there's an Astro specific plugin. |
Oh, got it. Misinterpreted the message. |
@Princesseuh when you say a bit buggy, do you mean that it's not suggesting autocompletion at all? I'm not getting HTML tag suggestions from the language server. In VScode same thing happens, and I think I have configured correctly. |
@alvgaona You appear to be using the wrong tree-sitter injections; the ones in the tree-sitter-astro repository are outdated. (I should really update those...) https://github.com/nvim-treesitter/nvim-treesitter/blob/e24dab6696aa2a6682a117e241adc32c38e93d53/queries/astro/injections.scm has the up-to-date injections. |
I'm only talking about the TypeScript plugin in that message, which only works in .ts files and does not do any completions in anything, it allows .ts files to understand .astro files. Completions for HTML tags should work, though if something doesn't work in VS Code, it's totally normal if it doesn't work in Zed (though it might be an issue) |
@virchau13 for some reason, those injections aren't working either. I'll keep looking into it. |
Tried this locally and it works pretty nicely, awesome work! With Zed's UI being otherwise so fast, it really highlights the performance issue the Astro language server can sometimes have in some contexts, but that's definitely not your fault (it's mine, ha) |
Beautiful. Glad you tried it! |
@virchau13 I installed EDIT: this was cause due to missing CSS and SCSS parsers in neovim. Dismiss the message. |
@alvgaona You may be missing the |
You're so right. In nvim works when I install the css and scss parsers. 😮💨 |
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 is looking good. I left a few questions.
…ro-language-server
However, tried several injections for CSS in Zed and none is kicking in for Astro files. I don't understand the difference between Svelte, HTML and Vue injections, TBH 💢 |
Thanks for making those adjustments @alvgaona. And that icon looks sweet @iamnbutler. This will ship in Zed 0.123. |
Hi. Is this already available in zed? |
@romu70 Looks like it is in Zed Preview v0.123.1 (and will probably land in stable next Wednesday) |
Thanks so much for all of this work! Just tried this out in the preview and highlighting is working great, Astro files are finally usable in Zed 🎉 Not sure if this is the place to ask, but are completions planned for this as well? Would be awesome to get code completion within each area of the Astro files. |
Completions should normally already work, as this also includes the Astro language server |
Running 0.123.1 /.2 I don't seem to get completions in .astro file. I get the syntax highlighting—which is great. I've also noticed that typescript warnings and errors that show up in .astro files in VSCode with the astro extension don't show up in .astro files in Zed. Have I missed a config step somewhere? Or should it be enough to just be running this pre-release? |
Currently running 0.128.3. Got the same issue as @BryanSchuetz |
See this issue for more: #8186 |
Attempt to add
@astrojs/language-server
and virchau13/tree-sitter-astro.