|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.intellij.lang.Language
public abstract class Language
The base class for all programming language support implementations. Specific language implementations should inherit from this class
and its register instance wrapped with LanguageFileType instance through
FileTypeManager.getInstance().registerFileType
There should be exactly one instance of each Language. It is usually created when creating LanguageFileType and can be retrieved later
with findInstance(Class).
| Field Summary | |
|---|---|
static Language |
ANY
|
| Constructor Summary | |
|---|---|
protected |
Language(java.lang.String id)
|
protected |
Language(java.lang.String ID,
java.lang.String... mimeTypes)
|
| Method Summary | ||
|---|---|---|
static
|
findInstance(java.lang.Class<T> klass)
|
|
Annotator |
getAnnotator()
Override this method to provide on-the-fly error highlighting with quickfixes as well as parse tree based syntax annotations like highlighting instance variables in java. |
|
Commenter |
getCommenter()
Override this method to provide comment-by-block and/or comment-by-line actions implementations for your language. |
|
ExternalAnnotator |
getExternalAnnotator()
Same as getAnnotator() but is being run once against whole file. |
|
FindUsagesProvider |
getFindUsagesProvider()
Override this method to provide find usages capability for the elements of your language For this functionality to work properly ParserDefinition implementation is necessary. |
|
FoldingBuilder |
getFoldingBuilder()
Override this method to provide code folding capabilities when editing files of this language. |
|
FormattingModelBuilder |
getFormattingModelBuilder()
Override this method to provide code formatter (aka pretty print, aka code beauitifier) for your language implementation. |
|
java.lang.String |
getID()
Returns a user-readable name of the language. |
|
java.lang.String[] |
getMimeTypes()
Returns the list of MIME types corresponding to the language. |
|
NamesValidator |
getNamesValidator()
Override this method to customize algorithm of identifier validation and language keyword set. |
|
PairedBraceMatcher |
getPairedBraceMatcher()
Override this method to provide paired brace matching and highlighting ability for editors of the language. |
|
ParserDefinition |
getParserDefinition()
Override this method to provide parser implementation. |
|
TokenSet |
getReadableTextContainerElements()
Word completion feature related method. |
|
RefactoringSupportProvider |
getRefactoringSupportProvider()
Override this method to provide common refactorings implementation for the elements of your language. |
|
static java.util.Collection<Language> |
getRegisteredLanguages()
|
|
StructureViewBuilder |
getStructureViewBuilder(PsiFile psiFile)
Override this method to provide structure view and file structure popup content for the files of your language. |
|
SurroundDescriptor[] |
getSurroundDescriptors()
Override this method to provide 'surround with...' feature implementation for editors of the files in your language. |
|
SyntaxHighlighter |
getSyntaxHighlighter(Project project)
Override this method to provide syntax highlighting (coloring) capabilities for your language implementation. |
|
java.lang.String |
toString()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Language ANY
| Constructor Detail |
|---|
protected Language(java.lang.String id)
protected Language(java.lang.String ID,
java.lang.String... mimeTypes)
| Method Detail |
|---|
public static java.util.Collection<Language> getRegisteredLanguages()
public static <T extends Language> T findInstance(java.lang.Class<T> klass)
klass - java.lang.Class of the particular language. Serves key purpose.
klass language registered if any.@NotNull public SyntaxHighlighter getSyntaxHighlighter(Project project)
project - might be necessary to gather various project settings from.
SyntaxHighlighter interface implementation for this particular language.@Nullable public FormattingModelBuilder getFormattingModelBuilder()
FormattingModelBuilder interface implementation for this particular language or null
if no formatting capabilities provided.@Nullable public ParserDefinition getParserDefinition()
ParserDefinition interface implementation for this particular language or null
if no parsing capabilities provided.@Nullable public FoldingBuilder getFoldingBuilder()
getParserDefinition() should return parser implementation for folding building to work properly.
FoldingBuilder interface implementation for this particular language or null
if no folding capabilities provided.@Nullable public PairedBraceMatcher getPairedBraceMatcher()
SyntaxHighlighter implementation is necessary.
PairedBraceMatcher interface implementation for this particular language or null
if no brace matching capabilities provided.@Nullable public Commenter getCommenter()
ParserDefinition implementation is necessary.
Commenter interface implementation for this particular language or null
if no auto-commenting capabilities provided.@NotNull public TokenSet getReadableTextContainerElements()
@Nullable public Annotator getAnnotator()
ParserDefinition implementation is necessary.
Note that syntax errors flagged by parser in ParserDefinition are highlighted automatically.
Annotator is run against changed parts of the parse tree incrementally.
Annotator interface implementation for this particular language or null
if no error and syntax highlighting capabilities provided.@Nullable public ExternalAnnotator getExternalAnnotator()
getAnnotator() but is being run once against whole file. It's most proper to use when integrating external
validation tools like xerces schema validator for XML.
@NotNull public FindUsagesProvider getFindUsagesProvider()
ParserDefinition implementation is necessary.
Default implementation returns mock find usages provider uncapable to search anything.
FindUsagesProvider interface implementation for this particular language.@Nullable public StructureViewBuilder getStructureViewBuilder(PsiFile psiFile)
psiFile -
StructureViewBuilder interface implementation for this particular language or null
if no file structure implementation.@Nullable public RefactoringSupportProvider getRefactoringSupportProvider()
FindUsagesProvider and ParserDefinition.
RefactoringSupportProvider interface implementation for this particular language or null
if no safe delete refactoring implementation is necessary.@NotNull public NamesValidator getNamesValidator()
NamesValidator interface implementation for this particular language. null value must
not be returned.@NotNull public SurroundDescriptor[] getSurroundDescriptors()
SurroundDescriptor interface implementations for this particular language.public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String[] getMimeTypes()
@NotNull public java.lang.String getID()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||