Skip to content

fix(vscode-graphql-syntax): highlight the opening quote of descriptions - #4669

Open
shubhamrai9122-creator wants to merge 1 commit into
graphql:mainfrom
shubhamrai9122-creator:fix/description-opening-quote-scope
Open

shubhamrai9122-creator wants to merge 1 commit into
graphql:mainfrom
shubhamrai9122-creator:fix/description-opening-quote-scope

Conversation

@shubhamrai9122-creator

Copy link
Copy Markdown

Fixes #4235

The single-line description rule (graphql-description-string) gave its opening " an extra punctuation.whitespace.comment.leading.graphql scope. That scope comes from the # comment rule, where it marks the whitespace before # (for Atom's reflow command). Here it landed on the quote itself, so themes that style punctuation coloured the opening quote differently from the rest of the description, while the closing quote looked right.

The rule now has no beginCaptures, so both quotes get only comment.line.documentation.graphql, matching block descriptions, whose """ already have just comment.block.documentation.graphql.

  • The descriptions-and-values.graphql test now checks that every quote of a single-line description ends in the description scope. It fails without the grammar change.
  • The snapshot update is limited to those quote tokens: 20 lines lose punctuation.whitespace.comment.leading.graphql, and nothing else changes.
  • vitest run in vscode-graphql-syntax (18 passing), plus oxfmt, oxlint and cspell on the changed files. Added a patch changeset.

The single-line description rule gave its opening quote the
punctuation.whitespace.comment.leading scope, copied from the hash
comment rule where it marks leading whitespace. Themes that colour
punctuation drew the opening quote differently from the rest of the
description. Both quotes now get only the description's scope, as the
quotes of block descriptions do.

Signed-off-by: shubhamrai9122-creator <shubhamrai9122@gmail.com>
@changeset-bot

changeset-bot Bot commented Oct 26, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e4f4dd8

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

This PR includes changesets to release 1 package
Name Type
vscode-graphql-syntax 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

This branch has not been deployed

No deployments
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.

Incorrect description syntax highlight

1 participant