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

include grammars don't load within captures #242

Open
RedCMD opened this issue Oct 5, 2024 · 0 comments
Open

include grammars don't load within captures #242

RedCMD opened this issue Oct 5, 2024 · 0 comments

Comments

@RedCMD
Copy link

RedCMD commented Oct 5, 2024

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:
#141
#173
#174

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

1 participant