- Plug-in Capabilities
- Plug-in Structure
In general, plug-ins can extend the following:
- Syntaxes: syntaxes define syntax zones for a coding language using regular expressions, and a plug-in can do one or more of the following:
- define a new language
- add new definitions or replace existing definitions in a language defined in another plug-in
- include syntax definitions from another language (for instance, CSS inside
<style>tags in HTML)
- CodeSense: CodeSense is what Espresso calls auto-complete, and a plug-in can do the following:
- create CodeSense definitions for a new language
- add new CodeSense definitions to an existing language
- define in what context certain completions should be used (based on the syntax zones of the language)
- Itemizers: itemizers build on the syntax definition to enable code folding and the Navigator
- TextActions: a Text Action lives in the Actions menu, and is used to modify the contents of the active document
- FileActions: a File Action lives in the File ⟩ Actions menu, and is used to act on a folder or file
Espresso's plug-in API is quite powerful, but there are some limitations to keep in mind while you're imagining the possibilities:
- Text or file actions must be invoked by the user, either through a menu item, a keyboard shortcut, or an automatic completion. This means that your action cannot execute on its own based on something happening in Espresso (for instance, it's not possible to do something to a file as a result of it being saved unless the user intentionally invokes your action after saving the file).
- Although text actions have quite a lot of power when it comes to modifying the contents of the active document, there is not currently any way to ask Espresso to execute tasks outside the file. For instance, there is no API for opening up a preview window and populating it with a URL.
- Creating custom interface elements is certainly possible if you code your actions in Objective-C, but adding or modifying interface within existing Espresso windows is not supported (aside from attaching custom sheets to the active window).
There may be other limitations within the API, but these are the ones that most often trip people up when they're trying to figure out what they can accomplish. We're always working to improve the plug-in API, as well, so some of these limitations may cease to exist down the road.