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

Symbol support for single document #1244

Merged
merged 7 commits into from
Feb 16, 2020
Merged

Symbol support for single document #1244

merged 7 commits into from
Feb 16, 2020

Conversation

acao
Copy link
Member

@acao acao commented Jan 19, 2020

Originally based on
graphql/graphql-language-service#195

Works a charm with https://github.com/prisma-labs/vscode-graphql

HTD:

  1. clone vscode-graphql, npm install
  2. from graphiql/packages/graphql-language-service-server, yarn link
  3. yarn build graphiql
  4. open vscode-graphql in vscode, yarn link graphql-language-service-server and launch 'Extension' in debugger panel
  5. An instance of vscode will open. open a directory containing a .graphqlconfig with a url (see server tests for an example file) and a .graphql file in the same directory. You'll see schema-driven completion, diagnostics, etc
  6. Finally, test the new capabilities: ensure that you can peek object/input object/fragment/query argument definitions of any type, and that you can see an outline in vscode of at least the fragment and operation definitions.

Screen Shot 2020-01-26 at 7 11 52 PM

TODO:

  • handle document-wide symbol requests for operations
  • add outline support for SDL/IDL/schema definition types
  • handle document-wide symbol requests for schema types (thanks to above) (symbols are where the outline items get their icons for example. much more to come there!)
  • show outlines in vscode!
  • more tests for GLS interface symbol/outline support
  • workspace-wide symbols (in another PR possibly?)
  • handle references request (in another PR possibly?)

@codecov
Copy link

codecov bot commented Jan 19, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@0f99f17). Click here to learn what that means.
The diff coverage is 69.56%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1244   +/-   ##
=========================================
  Coverage          ?   60.95%           
=========================================
  Files             ?       75           
  Lines             ?     3468           
  Branches          ?      670           
=========================================
  Hits              ?     2114           
  Misses            ?     1216           
  Partials          ?      138
Impacted Files Coverage Δ
...aphql-language-service-interface/src/getOutline.ts 86.84% <ø> (ø)
...graphql-language-service-server/src/startServer.ts 0% <0%> (ø)
...ages/graphql-language-service-server/src/Logger.ts 21.73% <100%> (ø)
...raphql-language-service-server/src/GraphQLCache.ts 55.08% <100%> (ø)
...ql-language-service-server/src/MessageProcessor.ts 60.35% <63.15%> (ø)
...ge-service-interface/src/GraphQLLanguageService.ts 51.35% <85%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0f99f17...968a13c. Read the comment docs.

@acao
Copy link
Member Author

acao commented Jan 19, 2020

seems there was an issue where the last amended push on publish didn't end up in master

@acao acao force-pushed the symbol-support branch 5 times, most recently from c71f888 to 80be9e5 Compare January 20, 2020 00:30
@acao acao force-pushed the symbol-support branch 13 times, most recently from 497cb07 to 821a0c2 Compare January 28, 2020 21:52
@acao
Copy link
Member Author

acao commented Feb 4, 2020

@divyenduz do you wanna give this a spin and let me know if im missing anything?

@acao
Copy link
Member Author

acao commented Feb 4, 2020

@divyenduz
Copy link
Contributor

divyenduz commented Feb 4, 2020

I gave it a spin, looks good to me. I might not know it completely but fields (success) and arguments (title, content) look alike, is that expected?

CleanShot 2020-02-05 at 00 17 32@2x

Ah, more variations in icon are possible (wrench for deleteCount for example) but it is a good to have: https://code.visualstudio.com/docs/getstarted/userinterface#_outline-view

@acao
Copy link
Member Author

acao commented Feb 14, 2020

ah yes, these icons are reflections of the symbol types!

the purpose here is that the purple icon is a field with arguments, as it acts as a method. in this case, title and content are arguments for the field createPost right? i wasnt sure how else to represent a field with arguments other than with a SymbolKind.Method and SymbolKind.Field for arguments?

acao and others added 4 commits February 14, 2020 00:28
 - example-graphiql-cdn@0.0.8-alpha.0
 - example-graphiql-webpack@1.0.0-alpha.0
 - codemirror-graphql@0.12.0-alpha.0
 - graphiql@1.0.0-alpha.0
 - graphql-language-service-interface@2.4.0-alpha.0
 - graphql-language-service-parser@1.5.3-alpha.0
 - graphql-language-service-server@2.4.0-alpha.0
 - graphql-language-service-types@1.6.0-alpha.0
 - graphql-language-service-utils@2.4.0-alpha.0
 - graphql-language-service@2.4.0-alpha.0
@acao acao merged commit f729f9a into master Feb 16, 2020
@github-actions github-actions bot deleted the symbol-support branch February 16, 2020 11:12
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.

2 participants