title |
---|
Additional Minor Features |
In order to implement brace matching, once the syntax highlighting lexer has been implemented, all that is required is to implement the PairedBraceMatcher interface and to return an array of brace pairs ( BracePair ) for the language. Each brace pair specifies the characters for the opening and closing braces and the lexer token types for these characters. (In principle, it is possible to return multi-character tokens, like "begin" and "end", as the start and end tokens of a brace pair. The IDE will match such braces, but the highlighting for such braces will not be fully correct.)
Certain types of braces can be marked as structural. Structural braces have higher priority than regular braces: they are matched with each other even if there are unmatched braces of other types between them, and an opening non-structural braces is not matched with a closing one if one of them is inside a pair of matched structural braces and another is outside.
The code folding is controlled by the plugin through the FoldingBuilder interface. The interface returns the list of text ranges which are foldable (as an array of FoldingDescriptor objects), the replacement text which is shown for each range when it is folded, and the default state of each folding region (folded or unfolded).
The Comment Code feature is controlled through the Commenter interface. The interface can return the prefix for the line comment, and the prefix and suffix for the block comment, if such features are supported by the language.
Example: Commenter for Properties language plugin
To support smart/semantic Join Lines see JoinLinesHandlerDelegate.
Smart Enter (e.g. autocomplete missing semicolon/parentheses) can be provided via SmartEnterProcessor.
Naming suggestions for Rename Refactoring can be provided via NameSuggestionProvider.
Semantic highlight usages (e.g. exit points) can be achieved using HighlightUsagesHandlerFactory.
View | Parameter Info is provided via
ParameterInfoHandler
(extension point codeInsight.parameterInfo
).
The To Do view is supported automatically if the plugin provides a correct implementation of the ParserDefinition.getCommentTokens() method.
The View | Context Info feature is supported for custom languages since IntelliJ IDEA 10.5.
In order for it to work, you need to have a structure view implementation based on a
TreeBasedStructureViewBuilder,
and additionally to provide an implementation of
DeclarationRangeHandler
for your language and to register it in the declarationRangeHandler
extension point.
Spellchecking can be provided via EP spellchecker.support
(
SpellcheckingStrategy
) where you can return
Tokenizer
to use, possibly depending on the passed in
PsiElement
(or EMPTY_TOKENIZER
for no spellchecking).
New in IntelliJ IDEA 13: user-configurable reference injections can be provided via referenceInjector
extension point (
ReferenceInjector
) (IntelliLang plugin required).