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

Add block strings to GraphQL grammar #282

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pubmodmatt
Copy link
Contributor

@pubmodmatt pubmodmatt commented Feb 21, 2025

The GraphQL TextMate grammar did not have separate handling for block strings, which are different from normal string values in that they may contain unescaped characters like quotes. Block strings were matching the string.quoted.double.graphql scope, which did not handle these unescaped characters, leading to incorrect results:

Screenshot 2025-02-21 at 12 35 43 PM

A new string.quoted.triple.block.graphql scope is defined, which matches everything up to the closing """:

Screenshot 2025-02-21 at 12 36 42 PM

This becomes more important with Apollo Connectors, where the selection attribute is often a block string containing mapping selection syntax that may contain special characters.

@pubmodmatt pubmodmatt self-assigned this Feb 21, 2025
@pubmodmatt pubmodmatt requested a review from phryneas February 21, 2025 21:18
Copy link
Contributor

You can download the latest build of the extension for this PR here:
vscode-apollo-0.0.0-build-1740172715.pr-282.commit-3df2853.zip.

To install the extension, download the file, unzip it and install it in VS Code by selecting "Install from VSIX..." in the Extensions view.

Alternatively, run

code --install-extension vscode-apollo-0.0.0-build-1740172715.pr-282.commit-3df2853.vsix --force

from the command line.

For older builds, please see the edit history of this comment.

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