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(language-service): improve outline in embedded graphql #3848

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

forivall
Copy link

@forivall forivall commented Jan 6, 2025

In VSCode, I noticed that the editor sticky scroll headers were showing the wrong headers, and I tracked it down to the GraphQL language support. This also fixes the locations when you navigate to graphql sections using breadcrumbs or the outline panel.

I also emit outlines for all embedded graphql documents, rather than just the first one. This only works properly when the location data is correct (i tried this before fixing the location data, and it lead to some interesting results)

This PR also includes some additional typing and performance improvements, but I saw some mentions of an ongoing refactoring in the commit history, so I have just the targeted changes in a branch: main...forivall:graphiql:outline-embedded-offset-simple

I only added tests for my performance improvement, but let me know if you need more tests!

Copy link

changeset-bot bot commented Jan 6, 2025

🦋 Changeset detected

Latest commit: 1f72129

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

Copy link

linux-foundation-easycla bot commented Jan 6, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

Copy link

codecov bot commented Jan 6, 2025

Codecov Report

Attention: Patch coverage is 86.36364% with 9 lines in your changes missing coverage. Please review.

Project coverage is 64.21%. Comparing base (614ff8b) to head (8acf672).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ql-language-service-server/src/MessageProcessor.ts 81.81% 4 Missing ⚠️
...ckages/graphql-language-service/src/utils/Range.ts 83.33% 3 Missing ⚠️
...aphql-language-service/src/interface/getOutline.ts 90.47% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3848      +/-   ##
==========================================
+ Coverage   63.98%   64.21%   +0.22%     
==========================================
  Files          35       35              
  Lines        3088     3124      +36     
  Branches      951      950       -1     
==========================================
+ Hits         1976     2006      +30     
- Misses       1107     1113       +6     
  Partials        5        5              
Files with missing lines Coverage Δ
...guage-service-server/src/GraphQLLanguageService.ts 87.84% <100.00%> (+0.06%) ⬆️
...aphql-language-service-server/src/parseDocument.ts 100.00% <ø> (ø)
...ql-language-service/src/interface/getDefinition.ts 92.59% <100.00%> (ø)
...aphql-language-service/src/interface/getOutline.ts 76.92% <90.47%> (+3.84%) ⬆️
...ckages/graphql-language-service/src/utils/Range.ts 85.71% <83.33%> (-2.17%) ⬇️
...ql-language-service-server/src/MessageProcessor.ts 88.72% <81.81%> (-0.26%) ⬇️

@forivall forivall changed the title fix(language-service): improve types, nullable member access fix(language-service): improve outline in embedded graphql Jan 6, 2025
@forivall forivall mentioned this pull request Jan 6, 2025
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.

1 participant