Sublime Forum

[Syntax file] Include a specific context from another file

#1

Is there a way to include only a specific context defined in another file ?

I was looking at some issues in the C++ syntax (around constructor initilializer list) and basically it comes from the include of the whole C syntax while in this particular case only some C context should be added.

For example I would like todo something like

-include: scope:source.c.parens

Of course the solution would be to redefine many context coming from C file inside the C++ one, but it’s far from ideal …

0 Likes

Set syntax of a file at a specific context
#2

It’s undocumented, but you can do it like so:

- include: scope:source.c#parens

where “parens” is the context’s name.

2 Likes

#3

Awesome, thanks ! I tried a bunch of stuff except that, of course.

0 Likes