Skip to content

feat(vscode): add GraphQL operations and fragments to the outline - #410

Merged
JoviDeCroock merged 1 commit into
JoviDeCroock/vscode-graphqlsp-pluginfrom
feat/document-symbols
Aug 23, 2026
Merged

feat(vscode): add GraphQL operations and fragments to the outline#410
JoviDeCroock merged 1 commit into
JoviDeCroock/vscode-graphqlsp-pluginfrom
feat/document-symbols

Conversation

@JoviDeCroock

@JoviDeCroock JoviDeCroock commented Jul 4, 2026

Copy link
Copy Markdown
Member

What / Why

GraphQL documents embedded in JavaScript and TypeScript were invisible to VS Code's Outline view and in-file symbol picker. This PR adds GraphQL operations and fragments as document symbols, including named operations, anonymous operations, and fragment type conditions.

This PR is stacked on #416, which introduces the VS Code extension.

Implementation

  • Registers a VS Code DocumentSymbolProvider for JavaScript, JSX, TypeScript, and TSX.
  • Detects documents in graphql(...) / gql(...) calls and tagged templates.
  • Supports the custom graphqlsp.template editor setting.
  • Masks template interpolations while preserving offsets, so symbols after interpolations map back to the source file correctly.
  • Returns GraphQL symbols through the extension host, where VS Code actually requests document symbols. The previous tsserver getNavigationTree approach was removed because VS Code routes navtree through its syntax server, where language-service plugins are not loaded.
  • Preserves TypeScript's normal symbols; VS Code shows separate GraphQLSP and TypeScript groups.

Test plan

  • Extension document-symbol unit tests: 5 passed.
  • Full e2e suite: 77 passed.
  • VS Code extension build and VSIX packaging pass.
  • Manually verified GraphQL operations/fragments in VS Code Outline.

Limitation

Custom template names configured only in tsconfig.json are not visible to the extension host. Custom names set through graphqlsp.template are supported.

@changeset-bot

changeset-bot Bot commented Jul 4, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 7a74d42

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@JoviDeCroock
JoviDeCroock force-pushed the feat/document-symbols branch 2 times, most recently from cad5654 to dc013f3 Compare August 22, 2026 13:35
@JoviDeCroock
JoviDeCroock changed the base branch from main to JoviDeCroock/vscode-graphqlsp-plugin August 22, 2026 13:35
@JoviDeCroock JoviDeCroock changed the title feat: add GraphQL operations and fragments to the outline (navigation tree) feat(vscode): add GraphQL operations and fragments to the outline Aug 22, 2026
@JoviDeCroock
JoviDeCroock force-pushed the JoviDeCroock/vscode-graphqlsp-plugin branch from f694902 to 1f5f3f9 Compare August 22, 2026 16:12
@JoviDeCroock
JoviDeCroock force-pushed the feat/document-symbols branch from dc013f3 to 7a74d42 Compare August 22, 2026 16:12
@JoviDeCroock
JoviDeCroock merged commit 8b15398 into JoviDeCroock/vscode-graphqlsp-plugin Aug 23, 2026
2 checks passed
@JoviDeCroock
JoviDeCroock deleted the feat/document-symbols branch August 23, 2026 06:11
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