The CodeXCavator application supports extensibility through a dynamic plugin system.
The plugins are loaded when the CodeXCavator.Engine assembly is used by the system. It searches for plugin assemblies in a directory named "plugins". This directory must be located in parallel with the CodeXCavator.Engine assembly. Additionally only assemblies, which start with the "Plugin." prefix are loaded automatically ( i.e. "Plugin.ProjectFileActions.dll" ).
Other assemblies located in the plugin directory are ignored.
The plugin system supports extending the following aspects of the application:
File Enumerators:
A plugin may expose an arbitrary number of file enumerators. The classes must be public and derive from the IFileEnumerator interface.
[Extension point: File Enumerators]
File Catalogue Enumerators:
A plugin may expose an arbitrary number of file catalogue enumerators. The classes must be public and derive from the IFileCatalogueEnumerator interface. Additionally you can specify the FileExtension attribute with the file catalogue enumerator class to specify on which file extensions the file catalogue enumerator can be applied.
[Extension point: File Catalogue Enumerators]
File Filters:
A plugin may expose an arbitrary number of file filters. The classes must be public and derive from the IFileFilter interface.
[Extension point: File Filters]
Tokenizers:
A plugin may expose an arbitrary number of tokenizers. The classes must be public and derive from the ITokenizer interface. Additionally you can specify the FileExtension attribute with the tokenizer class to specify on which file extensions the tokenizer can be applied.
[Extension point: Tokenizers]
Highlighters:
A plugin may expose an arbitrary number of syntax highlighters. The classes must be public and derive from the IHighlighter interface. Additionally you can specify the FileExtension attribute with the highlighter class to specify on which file extensions the sytnax highligher can be applied.
[Extension point: Highlighters]
File actions:
A plugin may expose an arbitrary number of file actions. The classes must be public and derive from the IFileAction interface.
[Extension point: File Actions]
File storage providers:
A plugin may expose an arbitrary number of file storage providers. The classes must be public and derive from the IFileStorageProvider interface.
[Extension point: File Storage Providers]
Text searchers:
A plugin may expose an arbitrary number of text searchers. The classes must be public and derive from the ITextSearcher interface.
[Extension point: Text Searchers]
In addition to syntax highlighters added by plugins, you can extend syntax highlighting capability by adding syntax highlighter configuration files to the "Highlighters" directory, which lies in parallel to the CodeXCavator.Engine assembly.
A syntax highlighter configuration file is an xml file matching the following format:
You can define any number of syntax highlighters in a single configuration file by simply putting as many <highlighter></highlighter> tags below the root <highlighters></highlighters> tag as needed.
You can configure the highlighter by putting a <configuration></configuration> tag below the <higlighter></higlighter> tag. How the highlighter must be configured and which tags and attributes are supported depends on the type of the highlighter.
[Built-in Syntax Highlighters]
Example: Xml.xml
<?xml version="1.0" encoding="utf-8" ?>
<Highlighters>
<!-- Xml highlighter -->
<Highlighter Type="RegexHighlighter" FileExtensions=".xml">
<Configuration CaseSensitive="true">
<Patterns>
<Pattern Token="COMMENT_START" RegEx="<\!\-\-" Color="#ff808080"/>
<Pattern Token="COMMENT_END" RegEx="\-\->" Color="#ff808080"/>
<Pattern Token="XML_TAG_START" RegEx="</|<\?|<" Color="#ff0000ff"/>
<Pattern Token="XML_TAG_END" RegEx="/>|\?>|>" Color="#ff0000ff"/>
<Pattern Token="XML_ATTRIBUTE" RegEx="[a-zA-Z_0-9_-]+\s*\=" Color="#ffff0000"/>
<Pattern Token="XML_ATTRIBUTE_VALUE" RegEx="@\"(?:\"\"|[^\"\r\n])*\"|\"(?:\\.|[^\\\"\r\n])*\"" Color="#ffff00ff"/>
<Pattern Token="XML_NAMESPACE_DECL" RegEx="xmlns:" Color="#ff0080ff"/>
<Pattern Token="TAG" RegEx="\+\#[_a-zA-Z][a-zA-Z_0-9\.]*\#\+" Color="#ffff8000"/>
</Patterns>
</Configuration>
</Highlighter>
</Highlighters>
This is an example file, which provides syntax highlighting for xml files. It uses a RegExHighlighter syntax highlighter which highlights source code by using regular expression patterns in order to specify elements, which should be highlighted with a certain color.
[Home][Extension point: File Enumerators][Extension point: File Catalogue Enumerators][Extension point: File Filters][Extension point: Tokenizers][Extension point: Highlighters][Extension point: File Actions][Extension point: File Storage Providers][Extension point: Text Searchers][Built-in Syntax Highlighters]