reywood / sublime-project-specific-syntax

Allows syntax settings to be specified per project in Sublime Text
GNU Lesser General Public License v3.0
87 stars 8 forks source link

Language PHP not understood #11

Closed jigarius closed 7 years ago

jigarius commented 8 years ago

I added a rule for PHP, but it gives me an error saying language not found. I have PHP syntax support in my ST3. Here's what I declared:

{ ... "syntax_override": { "\\.module$": ["PHP"] } }

Here is the error I got:

Error loading syntax file "Packages/HTML.tmLanguage": Unable to open Packages/HTML.tmLanguage

victorloux commented 7 years ago

I'm late, but if anyone else has the same problem, just re-read the readme in full:

The value in the key/value pair should be an array containing two or more strings. All but the last string in this array are the names of the package directories containing the syntax file and the last is the name of the syntax.

So your .sublime-project should read:

"\\.module$": ["PHP", "PHP"]

As the doc says, the easiest way to avoid mistakes is to right click on a buffer (in the code of a file) where the desired syntax has been applied, then right click → Sublime Project Specific Syntax → Copy syntax setting to clipboard. And paste inside your .sublime_project's syntax_override object.