Sublime Forum

Scope "include" does not seem to work

#1

I am trying to create an extension of the LaTeX syntax, which I will call here LyTeX.

At this initial point, all I want is to “inherit” the standard LaTeX syntax patterns and have .lytex files highlighted just like .latex files. To this end I created the following LyTeX.JSON-tmlanguage file:

{ "name": "LyTeX", "fileTypes": "lytex"], "scopeName": "text.lytex", "patterns": {"include": "text.tex.latex"} ], "uuid": "36eee982-a340-44fd-9b79-4d30f30a0fe0" }

I have built the corresponding .tmlanguage file, which has been loaded correctly. Files with the .lytex extension are indeed associated with the LyTeX syntax as expected.

The problem however is that I get no syntax highlighting whatsoever. Scope Hunter in fact indicates that my .lytex files are never endowed with the text.lytex scope, instead appearing as “text.plain” scopes, which probably explains the lack of highlighting.

How can I get this to work? Why, in other words, is the “text.lytex” scope never assigned?

Thank you.

0 Likes