Sublime-JS-Custom icon indicating copy to clipboard operation
Sublime-JS-Custom copied to clipboard

GraphQL tag scopes not parsing

Open dndrsn opened this issue 6 months ago • 3 comments

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

dndrsn avatar Jul 29 '24 19:07 dndrsn