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

Adds support for #graphql in the language server #1941

Merged
merged 7 commits into from
Sep 30, 2021

Conversation

arcanis
Copy link
Contributor

@arcanis arcanis commented Aug 19, 2021

The #graphql-annotated strings weren't properly detected by the language server:

image

Fixes graphql/vscode-graphql#294

@changeset-bot
Copy link

changeset-bot bot commented Aug 19, 2021

🦋 Changeset detected

Latest commit: f66abfd

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-server Patch
graphql-language-service 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

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Aug 19, 2021

CLA Signed

The committers are authorized under a signed CLA.

@n1ru4l
Copy link
Collaborator

n1ru4l commented Aug 20, 2021

@arcanis Do you think you could also add auto-complete support for the following?

/* GraphQL */  `
  query foo {
    a
  }
`

@n1ru4l
Copy link
Collaborator

n1ru4l commented Aug 20, 2021

@arcanis You should also add a changeset 😇

@arcanis
Copy link
Contributor Author

arcanis commented Aug 20, 2021

Should be fine! :) Can you try running the tests?

@n1ru4l
Copy link
Collaborator

n1ru4l commented Aug 20, 2021

@arcanis Unfortunately, I have no rights on this repo :( I already asked in the graphiql discord channel whether anyone can help us out getting this released

@acao
Copy link
Member

acao commented Aug 23, 2021

@n1ru4l I'm not sure how it got to be that my permission is needed to run github actions. I will fix that

@arcanis we are getting this on compile in CI:

findGraphQLTags.ts(14,3): error TS2724: '"../../../node_modules/@babel/types/lib"' has no exported member named 'TemplateExpression'.

if the build is working for you, perhaps you need to update your node modules locally

Also, I need to add development instructions for testing language server changes properly, my bad! Here are some steps to test this locally:

  1. clone this repo, yarn and yarn build or yarn watch
  2. yarn link inside graphql-language-service-server
  3. clone vscode-graphql, yarn and yarn link graphql-language-service-server
  4. then follow this: https://github.com/graphql/vscode-graphql#development

this will all be much more straightforward when we merge the extension into the monorepo

@arcanis
Copy link
Contributor Author

arcanis commented Aug 23, 2021

I'm not sure how it got to be that my permission is needed to run github actions. I will fix that

It's a new change in GH's rules. To avoid malicious actors running crypto mining on public repos' workflows, they now require first-time contributors' workflows to be approved manually.

Thanks for the debug steps! I'll give it a look tonight, should be fixed tomorrow 👍

@arcanis
Copy link
Contributor Author

arcanis commented Sep 2, 2021

I made a fix and tsc / eslint pass, but I wasn't able to test it within a packaged extension. Something between vsce and npm link breaks.

@arcanis
Copy link
Contributor Author

arcanis commented Sep 19, 2021

Ping? 😊

@acao
Copy link
Member

acao commented Sep 19, 2021

sorry @arcanis ! hopefully can get to this later this week, more urgent OSS matters happening right now!

@acao
Copy link
Member

acao commented Sep 19, 2021

@stonexer @zth @divyenduz @ardatan anyone want to help me advance this?

@codecov
Copy link

codecov bot commented Sep 19, 2021

Codecov Report

Merging #1941 (f66abfd) into main (2d91916) will increase coverage by 0.18%.
The diff coverage is 68.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1941      +/-   ##
==========================================
+ Coverage   65.70%   65.89%   +0.18%     
==========================================
  Files          85       86       +1     
  Lines        5106     5143      +37     
  Branches     1631     1640       +9     
==========================================
+ Hits         3355     3389      +34     
- Misses       1747     1750       +3     
  Partials        4        4              
Impacted Files Coverage Δ
...ackages/graphiql-toolkit/src/create-fetcher/lib.ts 50.90% <20.00%> (-8.67%) ⬇️
packages/graphiql/src/utility/HistoryStore.ts 62.26% <62.26%> (ø)
packages/graphiql/src/components/QueryHistory.tsx 73.91% <76.47%> (+6.69%) ⬆️
...iql/src/components/DocExplorer/MarkdownContent.tsx 100.00% <100.00%> (ø)
packages/graphiql/src/components/GraphiQL.tsx 58.34% <100.00%> (+0.83%) ⬆️
...hql-language-service-server/src/findGraphQLTags.ts 67.64% <100.00%> (+7.00%) ⬆️
packages/graphiql/src/utility/QueryStore.ts 42.85% <0.00%> (+2.04%) ⬆️
packages/graphiql/src/components/ToolbarButton.tsx 92.85% <0.00%> (+21.42%) ⬆️

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 e103cac...f66abfd. Read the comment docs.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Sep 30, 2021

CLA Signed

The committers are authorized under a signed CLA.

@dotansimha
Copy link
Member

Thanks @arcanis ! Awesome work. Sorry for the delay - I fixed the CI issues and we are good to go!

@dotansimha dotansimha merged commit 2fd5bf7 into graphql:main Sep 30, 2021
@github-actions github-actions bot mentioned this pull request Sep 30, 2021
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.

Allow custom pattern instead of just gql
4 participants