SublimeText / PackageDev

Tools to ease the creation of snippets, syntax definitions, etc. for Sublime Text.
MIT License
436 stars 83 forks source link

Syntax in SYNTAX TEST files is not applied #150

Closed deathaxe closed 7 years ago

deathaxe commented 7 years ago

PackageDev seems to actively apply the syntax to a _syntaxtest ..._ file, which works fine if the header looks like that:

; SYNTAX TEST "Packages/CNC Sinumerik 840D language support/gcode/s840d_gcode.sublime-syntax"

If the header contains the syntax file only, Plain Text is assigned as syntax.

; SYNTAX TEST "s840d_gcode.sublime-syntax"

If PackageDev is disabled, in both cases Sublime Text assigns the correct syntax to the opened file.

Therefore I'd expect the same behavior with PackageDev enabled.

keith-hall commented 7 years ago

So I guess it should use sublime.find_resources to find the full path to the syntax file? EDIT: looks like it does already, but only applies the syntax if the entire path (relative to the Packages folder) matches what is in the syntax test header: https://github.com/SublimeText/PackageDev/blob/938bc4317edc20861b9fb280a6e33b0fad419251/plugins_/syntaxtest_dev.py#L387

FichteFoll commented 7 years ago

Does St internally search for files with that name in the entire resources or only in the same directory?

keith-hall commented 7 years ago

Entire resources - I just made a simple test creating syntax_test_test.txt in Packages/ASP/ containing

-- SYNTAX TEST "Markdown.sublime-syntax"
# h1
-- <- markup.heading

and it passed - changing to - markup.heading made it fail