Thom1729 / Sublime-JS-Custom

Customizable JavaScript syntax highlighting for Sublime Text.
MIT License
137 stars 9 forks source link

GraphQL tag scopes not parsing #146

Open dndrsn opened 1 month ago

dndrsn commented 1 month ago

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 commented 1 month ago

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 commented 4 weeks ago

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