Colorizing of @language directive

19 views
Skip to first unread message

tbp1...@gmail.com

unread,
Nov 19, 2020, 4:32:44 PM11/19/20
to leo-editor
For a line in the body starting with @language, the directive is colored for common languages but not all.  Specifically, it gets colored for plsql but not sql.   I would like to include sql in the colored directives.  I noticed that there was a syntax rules file plsql.py in the leo/modes directory but no similar sql.py file.

When I copied plsql.py to sql.py, the @language directive became colored as I wanted although the actual code in the body did not get colorized.

I have two questions:

1. Is there any reason not to add a sql.py rules file to the modes directory?
2. What change do I need to make to have Leo's colorizer color kick in and colorize SQL code that follows an @language sql directive?

tbp1...@gmail.com

unread,
Nov 19, 2020, 4:54:16 PM11/19/20
to leo-editor
I seem to have answered my own question #2.  I noticed that the sql.py file I had created by copying plsql.py had a lot of names that started with "plsql", including the name of a dictionary to be created.  I changed all instances of "plsql" to "sql", and now Leo colorizes SQL code that follows an @language sql directive, as I wanted.

I got interested in this because I had some SQL bits that I wanted VR3 to render in a colorized manner.  That change was easy, but then the @language sql didn't behave as desired.
Reply all
Reply to author
Forward
0 new messages