GraphQL
Check for existing issues
- [X] Completed
Language
graphql
Tree Sitter parser link
No response
Language server link
https://github.com/graphql/graphiql/tree/main/packages/graphql-language-service-server
Misc notes
No response
Is this something we could help contribute?
Not until there’s a plug-in API available.
@hovsater ok, is there an issue we can track for that?
Yeah, there’s https://github.com/zed-industries/zed/issues/5269 currently tracking that. 🙂
I'd also like to have Relay LSP support (which is done by an extension in VSCode) which can be utilized by calling the Relay compiler binary with the lsp command (ref)
Why not add GraphQL support natively instead of plugins?
We will be going open source FairlySoon™️. After that, users will be able to propose languages we should bake into the editor, open PRs to do so, or help out with a plugin system so that we can have language extensibility!
when you say "users will be able to propose languages", does this now count as a language proposal? because this would be really nice to have.
In the micro, this lack of language-specific syntax highlighting is my biggest deal breaker for adopting Zed. I like the editor and its performance is excellent. However, without a plugin system or some way to extend the editor issues like this will continue to spoil adoption rates.
Zed extensions was just launched today, so there's an opportunity to add a GraphQL language extension!
It looks like not having a well-maintained Tree-sitter parser for GraphQL is the biggest blocker right now, since the official GraphQL syntax extension for VSCode is based on TextMate grammar
I made an extension with the parser recommended by tree-sitter website. Not sure how good the parser is but it seems to be not maintained anymore. If you find any bugs with parsing/highlighting you can report them in extenion's repo. I am going to work on it
could we get this to support graphql inline and not just graphql files? In typescript on vscode we get this with the gql function and things like this leading comment /* GraphQL */
could we get this to support graphql inline and not just graphql files?
Maybe feels like a separate, general, extension for setting another language/grammar on a block inside of an existing grammar?
could we get this to support graphql inline and not just graphql files? In typescript on vscode we get this with the gql function and things like this leading comment
/* GraphQL */
zed does have injections.scm. However, I've found #8795 to be a blocker to doing things the "right" way.
The following is almost a workaround (the fatal flaw is that it de-registers the TypeScript LSP):
- Copy
languages/typescriptandlanguages/tsxfrom https://github.com/llllvvuu/zed-extension-graphql/tree/feat/tsx into~/Library/Application Support/Zed/extensions/installed/graphql/languages - Make the following edit to
~/Library/Application Support/Zed/extensions/installed/graphql/extension.json:
- "GraphQL": "languages/graphql"
+ "GraphQL": "languages/graphql",
+ "TSX": "languages/tsx",
+ "TypeScript": "languages/typescript"
The GraphQL extension was added in https://github.com/zed-industries/extensions/pull/91.
Going to close this issue out.
Any further requests/issues can be directed to the extension repo: https://github.com/11bit/zed-extension-graphql.