Skip to content

Ignore shadowed tmLanguage files. #73

@Thom1729

Description

@Thom1729

When there are a sublime-syntax and tmLanguage file with otherwise-identical paths, the sublime-syntax will “shadow” the tmLanguage for syntax-related purposes:

  • It won't appear in the command palette.
  • It won't appear in the syntax menu.
  • It won't be found when including syntaxes by scope.
  • It won't be found when picking a syntax by file extension.

This is true regardless of the contents of the two files (even if one is hidden, or invalid).

(In addition, if you manually set view.settings().set('syntax', 'my.tmLanguage'), the highlighter will use the sublime-syntax. This probably doesn't affect us.)

Currently, neither list_syntaxes nor get_syntax_for_scope acknowledges this. Both will return shadowed tmLanguage definitions. I believe that this behavior is incorrect (i.e. that changing it is a bug fix). Fixing it is probably easy on top of #71 and #72.

get_syntax_for_scope definitely should ignore shadowed tmLanguage files. list_syntaxes probably should as well. We could conceivably add a flag to list_syntaxes to include shadowed syntaxes, but I'm not sure that it would be useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions