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

feat: monaco-graphql docs, api, improvements #1521

Merged
merged 7 commits into from
May 16, 2020

Conversation

acao
Copy link
Member

@acao acao commented May 11, 2020

These are most of the monaco and LSP changes pulled from #1468. This will make #1468 a lighter PR and allow folks to keep moving this language mode forward as we deliberate on the new GraphiQL RFC

  • configure/change schema options using API (currently static and non configurable in master)
  • add more detailed monaco-graphql docs
  • move language worker to it's own file
  • new monaco.languages.graphql.api class
  • configure formatting options (prettier config!) using API
  • RuleKinds implemented further, improving parser DX
  • improve language service's schema loading mechanisms and API
  • restores typedoc for deploy preview/master build. just append /typedoc to preview url
  • add schema url bar to monaco example for switching schemas

caveats

  • this is for only a single schema per language service instance. to follow the example of monaco-yaml, we would need to be able to retrieve schema per file URI in the workspace, similar to how it's done with graphql config in the LSP server.
  • yes the example is ugly. make it prettier if you want! i'm just using it to test the APIs.

links

(API patterns are following the patterns used by other monaco modes, such as monaco-json, monaco-typescript, monaco-html, etc)

monaco-schema-change

How to Demo:

  1. go to examples/monaco-graphql-webpack
  2. run yarn start

OR

deploy preview url plus /monaco

@acao acao force-pushed the feat/monaco-docs-api branch 2 times, most recently from f0edb38 to 6e4adba Compare May 11, 2020 23:21
- add more detailed `monaco-graphql` docs
- move language worker to it's own file
- new API class
- configure schema options using API
- configure formatting options (prettier!) using API
- RuleKinds implemented further, improving parser DX
- improve language service's schema loading mechanisms and API
@acao acao force-pushed the feat/monaco-docs-api branch from 6e4adba to addce72 Compare May 11, 2020 23:24
@acao acao force-pushed the feat/monaco-docs-api branch from 23af5ee to c9000d1 Compare May 12, 2020 17:08
@acao
Copy link
Member Author

acao commented May 12, 2020

@rebornix what do you think of the monaco.languages.graphql interfaces I added?

@acao
Copy link
Member Author

acao commented May 15, 2020

@cshaver can you confirm for posterity that you've given this a whirl locally and it all works? i recall you referring to something as such

@acao acao force-pushed the feat/monaco-docs-api branch from 133ae69 to b33edf9 Compare May 15, 2020 20:02
@acao acao force-pushed the feat/monaco-docs-api branch from b33edf9 to c4f14af Compare May 15, 2020 20:23
@acao acao merged commit c79158c into graphql:master May 16, 2020
@acao acao deleted the feat/monaco-docs-api branch May 16, 2020 02:42
@acao acao linked an issue May 17, 2020 that may be closed by this pull request
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

Successfully merging this pull request may close these issues.

Proposal: More LSP friendly package names
2 participants