extensions icon indicating copy to clipboard operation
extensions copied to clipboard

GraphQL

Open smbkr opened this issue 3 years ago • 15 comments

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

smbkr avatar Dec 07 '22 13:12 smbkr

Is this something we could help contribute?

fbjork avatar Mar 28 '23 09:03 fbjork

Not until there’s a plug-in API available.

hovsater avatar Mar 28 '23 09:03 hovsater

@hovsater ok, is there an issue we can track for that?

fbjork avatar Mar 28 '23 09:03 fbjork

Yeah, there’s https://github.com/zed-industries/zed/issues/5269 currently tracking that. 🙂

hovsater avatar Mar 28 '23 09:03 hovsater

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)

XiNiHa avatar Oct 04 '23 00:10 XiNiHa

Why not add GraphQL support natively instead of plugins?

fbjork avatar Nov 10 '23 10:11 fbjork

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!

JosephTLyons avatar Nov 10 '23 21:11 JosephTLyons

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.

dannyhw avatar Feb 05 '24 19:02 dannyhw

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.

ejkg avatar Feb 14 '24 13:02 ejkg

Zed extensions was just launched today, so there's an opportunity to add a GraphQL language extension!

shellscape avatar Feb 14 '24 22:02 shellscape

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

XiNiHa avatar Feb 15 '24 07:02 XiNiHa

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

11bit avatar Feb 23 '24 06:02 11bit

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 */

dannyhw avatar Feb 26 '24 13:02 dannyhw

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?

brookback avatar Feb 27 '24 03:02 brookback

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):

  1. Copy languages/typescript and languages/tsx from https://github.com/llllvvuu/zed-extension-graphql/tree/feat/tsx into ~/Library/Application Support/Zed/extensions/installed/graphql/languages
  2. 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"

llllvvuu avatar Mar 04 '24 04:03 llllvvuu

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.

maxdeviant avatar Jul 01 '24 14:07 maxdeviant