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

GraphQL tag scopes not parsing #146

Open
dndrsn opened this issue Jul 29, 2024 · 3 comments
Open

GraphQL tag scopes not parsing #146

dndrsn opened this issue Jul 29, 2024 · 3 comments

Comments

@dndrsn
Copy link

dndrsn commented Jul 29, 2024

Sublime Text build number

4169

Example Code

import gql from 'graphql-tag';


const query = gql`
  {
    user(id: 5) {
      firstName
      lastName
    }
  }
`;

JS Custom Preferences

{
    "defaults": {
        "eslint_directives": true,
        "flow_types": false,
        "jsx": true
    },
    "configurations": {
        "Default": {
            "custom_templates": {
                "tags": {
                    "css": "scope:source.css",
                    "gql": "scope:source.graphql",
                    "html": "scope:text.html.basic",
                    "yaml": "scope:source.yaml",
                },
                "comments": {
                    "CSS": "scope:source.css",
                    "GraphQL": "scope:source.graphql",
                    "HTML": "scope:text.html.basic",
                    "YAML": "scope:source.yaml",
                }
            }
        }
    }
}

Configuration name

JS Custom - Default

Description

Scopes for GraphQL within the custom tag are not parsing. GraphQL scopes are parsing correctly in standalone GraphQL file. Other languages -- e.g. YAML -- are fully parsing correctly.

Looking at the example above, the scope for the id parameter in a standalone GraphQL file is...
source.graphql meta.block.graphql variable.parameter.graphql

The scope for the id parameter in within the custom tag is...
source.js.default meta.string.js source.graphql

@Tyderion
Copy link

Tyderion commented Aug 5, 2024

no idea if this helps for you, but i had the same problem (with a similar configuration).
I was using the Monokai-Pro theme, and now that i've uninstalled that theme graphql scopes are set correctly

@dndrsn
Copy link
Author

dndrsn commented Aug 17, 2024

Tyderion -- Wow. Thank you. Yes. Disabling that theme -- which I wasn't even using -- resolved the issue.

@deathaxe
Copy link

Monokai Pro ships static plain text dummy syntax definitions for various scopes to support custom icons, which are likely to override real syntaxes. This is likely to cause trouble even with real syntax definitions looking non-functioning.

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

No branches or pull requests

3 participants