How to get syntax highlighting for .enaml files in PyCharm?

627 Views Asked by At

I am trying to learn Enaml, which is an extension to the Python language that allows you to define hierarchical trees of objects used for graphical user interfaces.

Since enaml is a super-set of the Python language, its syntax can be different from Python's one and IDEs do not highlight it. Is there any way to get enaml-syntax highlighting in PyCharm? Or maybe in some other IDE?

(I know that the package 'enaml-pygments' exists, but I have no idea how to make it work for automatic enaml-syntax highlighting in an IDE.)

5

There are 5 best solutions below

0
Chris Colbert On

There are highlighters for a few editors in the Enaml repo. Maybe one of them can be used by PyCharm: https://github.com/nucleic/enaml/tree/master/tools

0
Apperò On

Today I found this settings menu that partially addresses the issue of adding any syntax to PyCharm: https://blog.jetbrains.com/idea/2010/09/custom-file-types-in-intellij-idea/

Unfortunately it captures only the most simple features of a syntax.

0
vahndi On

I've added most of the keywords to this repo which you can import into PyCharm:

0
Till On

I'm using Atom to work with Python/Enaml code. With the language-enaml package you get syntax highlighting plus some autoextension and docstring feature for Enaml (https://atom.io/packages/language-enaml). Add in git integration and packages like build-python to run you code from the editor and you have quite a nice IDE.

1
yahya almohajire On

https://github.com/vahndi/pycharm-enaml-keywords

Open PyCharm Go to File, Import Settings..., browse to the .jar file and click OK Select All, OK