Sublime Forum

Does syntax definition inheritance include commands?

#1

If a new syntax definition “extends” and existing one, does the new syntax type inherit the commands.
For example, I have a syntax definition with:

extends: Packages/Perl/Perl.sublime-syntax

The syntax highlighting for the new syntax definition works fine, but the comment command does nothing.

0 Likes

#2

Preferences such as those from Perl/Comments.tmPreferences are applied to scopes. If your inherited syntax’s main scope begins with source.perl, it should work.

%YAML 1.2
---
# http://www.sublimetext.com/docs/3/syntax.html
name: My Extended Perl
scope: source.perl.myextended

extends: Packages/Perl/Perl.sublime-syntax

...
2 Likes

#3

Works, impressive! Thank you! (Your username should be “expert” instead of such a rough one :slight_smile: )

0 Likes