Skip to content

feat: add astro support for VSCode extension - #3475

Merged
acao merged 4 commits into
graphql:mainfrom
XiNiHa:feat/astro
Jan 24, 2024
Merged

feat: add astro support for VSCode extension#3475
acao merged 4 commits into
graphql:mainfrom
XiNiHa:feat/astro

Conversation

@XiNiHa

@XiNiHa XiNiHa commented Dec 16, 2023

Copy link
Copy Markdown
Contributor

Adds Astro syntax grammar support, language server parsing support, and misc wirings.

@changeset-bot

changeset-bot Bot commented Dec 16, 2023

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: deccc6a

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

This PR includes changesets to release 4 packages
Name Type
graphql-language-service-server Minor
vscode-graphql Minor
vscode-graphql-syntax Minor
graphql-language-service-cli 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

linux-foundation-easycla Bot commented Dec 16, 2023

Copy link
Copy Markdown

CLA Signed

The committers listed above are authorized under a signed CLA.

@XiNiHa
XiNiHa force-pushed the feat/astro branch 2 times, most recently from 8d0ed2d to 0b16e7a Compare December 16, 2023 16:53

@acao acao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome work! you even covered the esbuild script, very comprehensive, thank you!

@acao

acao commented Jan 7, 2024

Copy link
Copy Markdown
Member

@XiNiHa just a few issues with dependencies, spelling and linting to clear up it looks like

@acao

acao commented Jan 7, 2024

Copy link
Copy Markdown
Member

I'm about to merge a refactor for all of this that you will appreciate i'm sure, though it will cause a merge conflict

@acao

acao commented Jan 7, 2024

Copy link
Copy Markdown
Member

@XiNiHa enjoy! let me know if you want me to redo it

@XiNiHa

XiNiHa commented Jan 10, 2024

Copy link
Copy Markdown
Contributor Author

Sorry for being late to fix things up ;( I'll try to look at stuffs around this weekend

@acao

acao commented Jan 13, 2024

Copy link
Copy Markdown
Member

@XiNiHa no worries, take your time!

also I improved the grammars a bit. let me know if you want to pair on this or have any questions.

@XiNiHa
XiNiHa force-pushed the feat/astro branch 2 times, most recently from 5a798e0 to c776e7e Compare January 20, 2024 15:05
@XiNiHa

XiNiHa commented Jan 20, 2024

Copy link
Copy Markdown
Contributor Author

The language server doesn't work due to ardatan/graphql-tools#5781 not being merged yet.

@acao

acao commented Jan 21, 2024

Copy link
Copy Markdown
Member

@XiNiHa we have our own code parsing currently, but graphql-tools are also parsing files on their own, we don't use that result

@acao

acao commented Jan 21, 2024

Copy link
Copy Markdown
Member

two things!

  1. can you add astro tests in findGraphQLParser-test.js
  2. I'm not sure why the graphql-language-service-server tests are failing for a missing astrojs-compiler-sync, even though it is added to package.json and seems to be reflected in yarn. can you try running yarn install again to update the lockfile?

@XiNiHa

XiNiHa commented Jan 22, 2024

Copy link
Copy Markdown
Contributor Author

I'm not sure why the graphql-language-service-server tests are failing for a missing astrojs-compiler-sync

Looks like a typo in the package.json of astrojs-compiler-sync, will make a PR on there

@acao

acao commented Jan 23, 2024

Copy link
Copy Markdown
Member

awesome work!

sidenote: i think the issue with svelte2tsx is twofold - the language server needs to specify typescript as a dependency so that it works in non vscode contexts, and with vscode, we need to upgrade vsce as you have done and mark typescript as external. if we try to make it internal to the esbuild bundle it breaks as well. i can show you how to debug definitively - the vscode extension runner does not reflect the esbuild bundled state

@codecov

codecov Bot commented Jan 23, 2024

Copy link
Copy Markdown

Codecov Report

Attention: 20 lines in your changes are missing coverage. Please review.

Comparison is base (88ae243) 55.94% compared to head (deccc6a) 55.74%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3475      +/-   ##
==========================================
- Coverage   55.94%   55.74%   -0.21%     
==========================================
  Files         113      114       +1     
  Lines        5291     5312      +21     
  Branches     1441     1444       +3     
==========================================
+ Hits         2960     2961       +1     
- Misses       1903     1923      +20     
  Partials      428      428              
Files Coverage Δ
...s/graphql-language-service-server/src/constants.ts 100.00% <ø> (ø)
...hql-language-service-server/src/findGraphQLTags.ts 82.71% <ø> (ø)
...aphql-language-service-server/src/parsers/astro.ts 4.76% <4.76%> (ø)

@acao

acao commented Jan 24, 2024

Copy link
Copy Markdown
Member

@XiNiHa this looks great! I will go ahead and merge, and then test the .vsix bundle manually just to be 100% certain. I think we can merge this and fix the svelte parsing in a single release

@acao

acao commented Jan 24, 2024

Copy link
Copy Markdown
Member

I will take care of adding the tests in a follow up PR, but I might ping you later to make sure I've covered all the cases

@acao
acao merged commit 98af530 into graphql:main Jan 24, 2024
@acao acao mentioned this pull request Jan 24, 2024
@XiNiHa
XiNiHa deleted the feat/astro branch January 25, 2024 02:55
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