Skip to content

include grammars don't load within captures #242

@RedCMD

Description

@RedCMD

Embedded grammars are not loaded from disk when inside a captures rule

If the embedded grammar was pre-loaded by another include in the same grammar
OR loaded via another grammar in another language in another file
then it works as expected

  1. Don't open a file that loads the C grammar
  2. Open a file with the following grammar loaded
  3. notice no syntax highlighting. test(5);

image

  1. Close the file
  2. Reload VSCode
  3. Open a C file
  4. Reopen the file with the following grammar loaded
  5. notice syntax highlighting now working

image

{
	"scopeName": "source.capture.load",
	"patterns": [
		{
			"match": ".+",
			"captures": { "0": { "patterns": [ { "include": "source.c" } ] } }
		}
	]
}

from my testing getExternalGrammar() is never run when directly inside captures

related:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions