Skip to content
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

vscode-graphql, LSP, IDE initiative #1615

Closed
9 of 10 tasks
acao opened this issue Jul 15, 2020 · 6 comments
Closed
9 of 10 tasks

vscode-graphql, LSP, IDE initiative #1615

acao opened this issue Jul 15, 2020 · 6 comments

Comments

@acao
Copy link
Member

acao commented Jul 15, 2020

Getting things in better shape for vscode-graphql which I am now maintainer of!

graphql-language-service-interface

  • finish upgrading to graphq-config@3.0.x - schema loading, file loading, etc
  • new options argument for getAutocompleteSuggestions
    • allow use of implicit fragment definitions for completion
    • option to return all completion options on empty or even invalid input (ala codemirror-graphql, etc)
  • getOutline for workspaces
  • getDefinition for workspaces
  • when autocompleting a field that expands:
    • automatically append {}
    • move cursor inside new brackets (this part may require monoco/vscode-languageserver)
    • automatically complete for descending required fields on enter? (might be for monaco or vscode-languageserver)

graphql-language-service-server

  • offset outline/definitions positions for embedded graphql
  • build caches for all files immediately on initialization and on each relevant workspace folder/file event, or at least cache all definitions on onRequestWorkspaceSymbol. use invalidateCache()
  • handle RequestWorkspaceDefinition event similarly
  • supporting the last two might require more configuration on the extension side as well

vscode-graphql

is becoming our go-to reference implementation, and this work is towards 3.x.x releases:

external issues:

  • graphql-config endpoints extension no longer supports env, so we still have to figure out how to replace use of env
@acao acao pinned this issue Jul 15, 2020
@felippepuhle
Copy link

felippepuhle commented Aug 13, 2020

@acao is there a way we can implement customValidationRules? We're using Relay and I was thinking what's the best way to create an extension for this case.

We already have a lot of validation rules here, we just need to extract them on a generic way.

I'm a nvim user and I created coc-graphql a few weeks ago. CoC plugins have basically the same config as any other vscode plugin, it shouldn't be hard to reuse the same code on both plugins.

@acao
Copy link
Member Author

acao commented Aug 26, 2020

@felippepuhle awesome! very excited about coc-graphql. i just cut an alpha of the lsp server last night that should be quite an enhancement!

customValidationRules can be defined in the graphql-config that's picked up by the LSP server. here's where we apply them

previously, it would load from a specified file path, but in graphql-config@3 we support commonjs. so now you can require() a file that provides an array of custom rules, or you can define them implicitly in the graphql.config.js file, your choice!

@felippepuhle
Copy link

That's awesome! I'll take a look ASAP, thanks!

@tvvignesh
Copy link

@acao The extension is becoming way better than it used to be thanks. But one important thing which I am looking for is support for Federation: #2351

Any plans for the same?

@acao acao unpinned this issue Nov 9, 2021
@acao
Copy link
Member Author

acao commented Nov 26, 2021

@tvvignesh this is possible now that i've squashed some bugs i introduced during this initiative!

@acao
Copy link
Member Author

acao commented Nov 26, 2021

the follow up!
#2062

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants