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

[vscode-graphql-syntax] literal string variables don't highlight properly #3217

Open
1 task done
dimaMachina opened this issue Jun 8, 2023 · 2 comments
Open
1 task done

Comments

@dimaMachina
Copy link
Collaborator

dimaMachina commented Jun 8, 2023

originally posted in shuding/nextra#1949

Is there an existing issue for this?

  • I have searched the existing issues

I noticed a bug with syntax highlighting of GraphQL queries where strings that immediately follow a [ are not properly colored.

If you look at

https://docs.bundlr.network/developer-docs/graphql#owners

You'll notice this GraphQL.

The first string, the one following the [ is grey, while the second string is green as it should be. If I delete the [ before the first string, it ends up highlighted green as it should be. Also if I add a space after the [, the string is green as it should be.

My guess is that there's a bug in the file graphql.tmLanguage.json, but I'm not sure.

Has anyone else seen this?

query getByOwner {
	transactions(owners: ["0xBcb812C6e26F4F0F78Bd7B6222461FF24F2942AE", "0xaC568a981B1370B2e1bAA8cE30BD5AC9E28C572D"]) {
		edges {
			node {
				id
				address
			}
		}
	}
}
@acao
Copy link
Member

acao commented Jun 9, 2023

yes this is where the issue would be. we badly need to add tests for the syntax extension, because minor improvements sometimes cause regressions, or we overlook lots of edge cases like these. i can pull up the vscode docs for writing tests for the grammar configs

@dimaMachina
Copy link
Collaborator Author

Yeah! I would like to add image snapshots tests before fixing some issues

@acao acao changed the title [vscode-graphql-syntax] Problem with GraphQL Syntax Highlighting [vscode-graphql-syntax] literal string variables don't highlight properly Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants