Skip to content

Bug in graphql lexer #1084

@jmooring

Description

@jmooring

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

A simple example...

```graphql
query {
  a
  b
}
```

Is rendered to:

Image

The problem is that "a" is assigned class "nc" (NameClass) while "b" is assigned class "py" (NameProperty). The first line after the opening brace always has the wrong class.

To Reproduce

https://swapoff.org/chroma/playground/#eyJsYW5ndWFnZSI6IkdyYXBoUUwiLCJzdHlsZSI6Im1vbm9rYWlsaWdodCIsInRleHQiOiJxdWVyeSB7XG4gIGFcbiAgYlxufVxuIiwiY2xhc3NlcyI6ZmFsc2V9


EDIT 2025-05-30T10:32:30-07:00: This may or may not be helpful, but the https://pygments.org/demo/ renders this example as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions