Sublime Forum

Attempting to modify syntax definitions

#1

Hi,
I’m trying to get language variables in the Python syntax definition to also be parsed as language variables when parameters - i.e. the current system highlights

self.colour = "blue"
^^^^

but not

def cool_method(self, name):
                ^^^^

I went into Python.sublime-syntax and added the line

    - include: language-variables

at line 550 (under - include: illegal-names, inside function-parameters).

When I try to load my modified syntax definition, I get this dialog:

Error loading syntax file “Packages/Python/Python.sublime-syntax”: Unable to read Packages/Python/Python.sublime-syntax

What am I doing wrong?

0 Likes

#2

Huh…

For some reason it works only when I rename the sublime-package file to something other than Python.sublime-package. That’s odd.

Now I have two Pythons in the language selector. One does what I want, one doesn’t :confused:

Edit: If I delete the old Python.sublime-package and keep the new one renamed, it still gives me that error but it highlights my Python code this time.

0 Likes

#3

maybe don’t mess with .sublime-package files and just use
https://packagecontrol.io/packages/PackageResourceViewer

0 Likes