I have discussed this issue in the forum off and on over the last year with no success and I am now making another attempt. I will try to go step by step, methodically, to exhaust all possibilities.
Background
I am trying to write a very simple udl for Komodo that operates on text files and does little more than colorize tags of the form [x] where x is a single letter and the tag starts a line. I have been successful with Atom using .cson and with VS Code using .tmlanguage templates. I had a udl working in Komodo 8 using koext but 9 broke it and I have not been able to get it to work since then.
Step 1 - Try to use the method in the Komodo 11 documentation:
After filling out the template this method fails with
and
So the method fails to create the support files. Attempts to fix the failure include different template settings and a fresh reinstall of Komodo 11.0.2. Those methods did not work. The directories where the files are written are standard directories with full write privilege. The .ktf files in the .komodotools directory are created. The udl and python files are not, as the errors above indicate.
Step 2.
Before proceeding further try to figure out why the recommended method fails.
Does anyone have a suggestion? I have seen file write bugs for extension creation on Windows dating back a number of years? Were they fixed? Is this a Mozilla problem that ActiveState can’t address?
I set up Komodo so Python 3 was the default Python so I changed the Python environment to Python 2 and left the Python 3 envir. as Python 3. The idea was that koext.py throws errors if run with Python 3 and I wondered if the UDL setup code was running Python behind the scenes and silently throwing the same error, causing the failure.
This idea was not correct. The same error messages are returned if the Python env. is set for Python 2.
Copy the full SDK folder from the program folder into a folder with write and exec permissions.
Open a terminal. I use Anaconda. Activate Python 2.7. (Python 3 does not work)
Run python luddite.py from the bin directory. It will explain the process below - which generally works.
Modify the install.rdf file so the max version is 11 - then generate the xpi
Import the addon using the legacy option in the tools menu.
A couple of niggling and not so niggling issues:
a. the search box in the legacy addon menu has a white font color that is the same as the background so it is illegible.
b. UDL still cannot fold based on indent which is generally a problem for markup and python type languages.
(py27) C:_lib\sdk\bin>python luddite.py
luddite: compile and build Komodo language extensions
usage:
luddite SUBCOMMAND [ARGS...]
luddite help SUBCOMMAND
Language syntax-highlighting in Komodo requires a lexer. For most of
Komodo's core supported languages these lexers are written in C++.
However, as of Komodo 4, you can define custom lexers for languages that
Komodo doesn't support out of the box. This system is called UDL -- for
User-Defined Languages.
Luddite is a tool for building and packaging a Komodo language
extension. The typical process is:
1. Use the 'koext' tool (also part of the Komodo SDK) to start a Komodo
extension source tree and create stub files for a new Komodo language.
koext startext fuzzy_language
cd fuzzy_language/
koext startlang fuzzy
2. Author the 'udl/LANG-mainlex.udl' file defining syntax highlighting
rules for your language and the 'components/koFuzzy_UDL_Language.py'
language service as appropriate.
The 'luddite lex' and 'luddite lexhtml' commands can help you debug
your .udl code.
3. Build the extension. 'koext' knows how to compile your UDL code into
the '.lexres' files that Komodo uses at runtime.
koext build
4. Upload and announce your new extension on Komodo's add-ons site:
http://community.activestate.com/addons
For more information on writing .udl files see Komodo's UDL
documentation.
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-v, --verbose more verbose output
-q, --quiet quieter output
Commands:
deprecated_compile (compile)
compile a .udl file into lang resources
help (?) give detailed help on a specific sub-command
just_compile compile a .udl file into a .lexres file
lex lex the given file (for debugging)
lexhtml lex the given file to styled HTML (for debugging)