Komodo add-ons (previously known as extensions) are used to extend the functionality of the IDE. Komodo is based upon the Mozilla framework, so it has the same add-on capabilities as Firefox does, which means the Mozilla extension documentation also applies to Komodo as well. These Mozilla resources are a great place to begin understanding the fundamentals of add-ons.
Add-ons are managed through the Komodo Packages interface.
There are two types of Add-ons you can create:
Note The type of add-on you want to create determines the steps you need to follow to create it.
The best way to start creating a new Komodo feature is by utilizing the Komodo userscript system, which you can use to quickly and easily create new functionality for Komodo, such as adding user interfaces, responding to keypresses, opening files, or performing text manipulation in the Komodo editor.
If you wish - you may then turn your userscripts into a Komodo add-on (so it's easily installable and will automatically update when you make changes to it). To get started, use the Project -> New -> New Project from Template and select the Create Komodo Extension project. When using a Komodo add-on project, you'll find there is a "Build and Install" userscript added to your Komodo toolbox, which you can use to create and install the add-on xpi file.
Language add-ons are used to extend Komodo's knowledge of programming languages (like Java, Matlab, Mel). This can control things like Language Detection, Code Coloring, Editor Indentation, Syntax Checking, Code Intelligence (completions and calltips) and Debugging.
The easiest way to create a new Komodo language is to use the Project -> New Project from Template and select the Create Komodo Language project. Fill out the add-on details, then you can customize the language details (like the comment styles, keywords and code intelligence) and create the project. You'll find there is a "Build and Install" macro added to your Komodo toolbox, which you can use to create and install the add-on xpi file.
Once you've got the basics of the language down, you can further tweak the generated files to your liking and then re-build and re-install the add-on to test it out. Below is a description for the generated files and folders of the add-on:
Komodo's system for defining multi-language syntax lexing (coloring) is called UDL (User Defined Languages). UDL files are written in a language called Luddite, which then gets compiled into a Scintilla lexer package for use inside Komodo. All udl files are stored inside the "udl" folder of your extension.
Code Intelligence is enabled in a Komodo language add-on by adding a pylib/codeintellangname.py_ file to your extension. It works by first triggering a completion event and then responding to an evalutation request.
You should install these useful add-ons when developing your own Komodo add-on:
To install them hit the "Go to Anything" search field in your toolbar, or use the shortcut Ctrl+Shift+O (or CMD+Shift+O if you're on OSX), then select "Packages" and search for the package name you wish to install, and press enter on it to install it.
To create an add-on select from the menu
Project > New from template > Create Komodo Extension. This will then open up a window to select a working directory where the project files will be generated and stored.
It will then open up a new windows titled 'Welcome to the New Komodo Extension'.
This dialog holds the following fields:
Once completed click on next and it will display a new window with instructions
Go ahead and read it and then press Finish.
Once you finish the short wizard to generate your add-on Komodo will create a couple of files and tools for you to work with.
There are four main files.
This is the projectname overlay file that will be displayed when the extension is installed.
This file is used to register your content with the Chrome engine.
This is a development register file for your content with the Chrome engine.
This file contains general information about your extension and the developers information.
More information can be found on Mozilla Developer Website
Several tools are installed in your toolbox when creating a Komodo add-on.
This macro will build and create an xpi file of the project
This macro will build and create an xpi file of the project as well as install it on Komodo. Note that this will require a restart of Komodo.
This will allow changes to be made to the install.rdf file.
This will open up the help file to explain Komodo Extensions
After generating your add-on (see above) use the toolbox to run the tool 'Build and Install'. This will display the classic Add-ons manager window.
After installing the extension you will be prompted to restart Komodo in order for the changes to take effect.
Now you're set to start creating your own add-on. The easiest way to get started is to reference existing add-ons or check the additional resources below to find out how to write a Komodo add-on. Note that Komodo is based on the same system as Firefox, so most things that apply to Firefox add-on development also apply to Komodo.
These projects can serve as a good foundation to work-by-example.
GitHub provides a fast source code search engine. You can use this tool to find code examples for working with different parts of Komodo.
Thanks to Komodo being based upon the Mozilla framework, Komodo has the same add-on capabilities as the Firefox browser, making Komodo add-on development a breeze - you can even re-purpose existing Firefox add-ons to work within Komodo.
These are the Komodo add-ons that are included in the regular Komodo builds. You will also find these add-ons in the "extensions" or "distribution/bundles/" directory of your Komodo installation.
There are many Komodo add-ons that have been developed, which are not included in the regular Komodo installers. A lot of these are hosted on GitHub and are great examples for building Komodo add-ons.
© 2017 ActiveState Software Inc. All rights reserved. ActiveState®,
Komodo®, ActivePerl®, ActivePython®, and ActiveTcl® are registered
trademarks of ActiveState.
All other marks are property of their respective owners.