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

fix: autocompletion for argument values, more trigger characters #2070

Merged
merged 3 commits into from
Dec 1, 2021

Conversation

acao
Copy link
Member

@acao acao commented Nov 29, 2021

fixes #2068 🎉 and #1894 (i think - @rchl do you agree?)

simplifies the code a bit. untangles a mess that I left when introducing argument value completion last year.

introduces more triggerCharacters to monaco-graphql as a precursor to #1997

fixes this bug across the entire ecosystem by fixing the issue at the core graphql-language-service-server level

@github-actions
Copy link
Contributor

github-actions bot commented Nov 29, 2021

The latest changes of this PR are available as canary in npm (based on the declared changesets):

@codecov
Copy link

codecov bot commented Nov 29, 2021

Codecov Report

Merging #2070 (bb52471) into main (2d91916) will decrease coverage by 2.20%.
The diff coverage is 67.10%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2070      +/-   ##
==========================================
- Coverage   65.70%   63.50%   -2.21%     
==========================================
  Files          85       94       +9     
  Lines        5106     5466     +360     
  Branches     1631     1714      +83     
==========================================
+ Hits         3355     3471     +116     
- Misses       1747     1990     +243     
- Partials        4        5       +1     
Impacted Files Coverage Δ
packages/codemirror-graphql/src/hint.ts 94.73% <ø> (ø)
packages/codemirror-graphql/src/lint.ts 100.00% <ø> (ø)
packages/codemirror-graphql/src/results/mode.ts 47.05% <ø> (ø)
...kages/codemirror-graphql/src/utils/forEachState.ts 100.00% <ø> (ø)
...ckages/codemirror-graphql/src/utils/mode-indent.ts 0.00% <0.00%> (ø)
packages/codemirror-graphql/src/variables/hint.ts 89.70% <ø> (ø)
packages/codemirror-graphql/src/variables/mode.ts 79.48% <ø> (ø)
packages/graphiql/src/components/QueryEditor.tsx 63.96% <ø> (ø)
...graphiql/src/components/__tests__/ExampleSchema.ts 100.00% <ø> (ø)
packages/graphiql/src/utility/fillLeafs.ts 5.33% <ø> (ø)
... and 41 more

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 503c376...bb52471. Read the comment docs.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 29, 2021

@github-actions github-actions bot temporarily deployed to graphiql-cdn-preview November 29, 2021 20:06 Inactive
@github-actions
Copy link
Contributor

github-actions bot commented Nov 29, 2021

@github-actions github-actions bot temporarily deployed to graphiql-webpack-preview November 29, 2021 20:06 Inactive
@github-actions
Copy link
Contributor

github-actions bot commented Nov 29, 2021

@github-actions github-actions bot temporarily deployed to monaco-graphql-webpack-preview November 29, 2021 20:07 Inactive
@acao acao force-pushed the fix/argument-value-completion branch from add665f to 76c69d8 Compare November 29, 2021 20:08
@changeset-bot
Copy link

changeset-bot bot commented Nov 29, 2021

🦋 Changeset detected

Latest commit: bb52471

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
graphql-language-service-interface Patch
monaco-graphql Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@acao acao force-pushed the fix/argument-value-completion branch from 76c69d8 to 992640e Compare November 29, 2021 20:11
@acao acao changed the title fix: autocompletion for argument values fix: autocompletion for argument values, more monaco-graphql trigger characters Nov 29, 2021
also introduce more triggerCharacters to `monaco-graphql`!
@acao acao force-pushed the fix/argument-value-completion branch from 992640e to a3368e0 Compare November 29, 2021 20:13
@github-actions github-actions bot temporarily deployed to graphiql-webpack-preview November 29, 2021 20:16 Inactive
@github-actions github-actions bot temporarily deployed to graphiql-cdn-preview November 29, 2021 20:17 Inactive
@github-actions github-actions bot temporarily deployed to monaco-graphql-webpack-preview November 29, 2021 20:17 Inactive
@github-actions github-actions bot temporarily deployed to graphiql-webpack-preview November 30, 2021 12:09 Inactive
@github-actions github-actions bot temporarily deployed to graphiql-cdn-preview November 30, 2021 12:10 Inactive
@github-actions github-actions bot temporarily deployed to monaco-graphql-webpack-preview November 30, 2021 12:10 Inactive
@acao acao force-pushed the fix/argument-value-completion branch from f4b8541 to 8243bd6 Compare November 30, 2021 12:50
@github-actions github-actions bot temporarily deployed to graphiql-cdn-preview November 30, 2021 12:53 Inactive
@github-actions github-actions bot temporarily deployed to graphiql-webpack-preview November 30, 2021 12:56 Inactive
@github-actions github-actions bot temporarily deployed to graphiql-cdn-preview November 30, 2021 12:57 Inactive
@acao acao force-pushed the fix/argument-value-completion branch from 0ac4269 to 8bdda5b Compare November 30, 2021 12:57
@github-actions github-actions bot temporarily deployed to graphiql-webpack-preview November 30, 2021 12:59 Inactive
@github-actions github-actions bot temporarily deployed to graphiql-cdn-preview November 30, 2021 13:00 Inactive
@acao acao force-pushed the fix/argument-value-completion branch from 8bdda5b to bb52471 Compare November 30, 2021 13:00
@github-actions github-actions bot temporarily deployed to graphiql-webpack-preview November 30, 2021 13:03 Inactive
@github-actions github-actions bot temporarily deployed to graphiql-cdn-preview November 30, 2021 13:04 Inactive
@github-actions github-actions bot temporarily deployed to monaco-graphql-webpack-preview November 30, 2021 13:04 Inactive
@acao acao changed the title fix: autocompletion for argument values, more monaco-graphql trigger characters fix: autocompletion for argument values, more trigger characters Nov 30, 2021
@acao
Copy link
Member Author

acao commented Nov 30, 2021

@rchl introducing more triggerCharacters here just to get it out of the way, what do you think? you can test with the monaco deploy preview

@acao
Copy link
Member Author

acao commented Nov 30, 2021

so, this doesn't impact codemirror-graphql to be clear, because it doesn't use the command or insertText options we've added to the autocompletion

@acao acao merged commit 989fca6 into main Dec 1, 2021
@acao acao deleted the fix/argument-value-completion branch December 1, 2021 09:31
@github-actions github-actions bot mentioned this pull request Dec 1, 2021
@rchl
Copy link
Contributor

rchl commented Dec 1, 2021

Sorry but to test this properly, I'd need this working in my editor. I'm not sure what to expect exactly from the codemirror behavior.

I'll check it out when it's out and report if I see any issues. :)

@acao
Copy link
Member Author

acao commented Dec 1, 2021

@rchl you should expect the monaco demo to complete variables and trigger completion. Codemirror is not changed by this PR

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

Successfully merging this pull request may close these issues.

Small bug when autocompleting variables
2 participants