Child pages
  • Developing Custom Language Plugins for IntelliJ IDEA
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

The set of IntelliJ IDEA features which are supported for custom languages includes:

  • Syntax highlighting and error highlighting;
  • Go to Declaration (including Quick Definition Lookup);
  • Code completion;
  • Find Usages;
  • Rename and Safe Delete refactorings;
  • Code formatter;
  • Code inspections and intentions;
  • Structure View (including the File Structure Popup);
  • Surround With;
  • Go to Class, Go to Symbol;
  • Brace matching;
  • Code folding;
  • Comment Code;
  • To Do view;
  • and much more.

In addition, IDEA provides a powerful framework on which additional intelligence features, like refactorings and code analysis, can be implemented.

This article will explain the main concepts of the Language API and will guide you through the sequence of steps which are usually required to develop a custom language plugin. You can obtain additional information about the Language API from the JavaDoc comments for the Language API classes and from the source code of the JavaScript plugin, which is included in the IDEA Plugin Development Package.

If you have any questions or comments related to the Language API or any other aspects of IntelliJ IDEA plugin development, feel free to ask them in the jetbrains.intellij.openapi newsgroup on the news.jetbrains.com news server, or in the corresponding Web forum. The newsgroup is monitored by JetBrains developers who will be able to help you with the development.

The information in this document has been updated to cover the API changes and new features of IntelliJ IDEA 8.0.

Registering a File Type

The first step in developing a custom language plugin is registering a file type the language will be associated with. IDEA determines the type of a file by looking at its file name. Thus, a custom language can only be associated with specific file names or extensions - it is not currently possible to create a language which will be applied to files with specific content, like, for example, a specific XML root namespace.

A custom language file type is a class derived from LanguageFileType, which passes a Language implementation class to its base class constructor. To register a file type, the plugin developer provides an implementation of the FileTypeFactory interface, which is registered via the com.intellij.fileTypeFactory extension point.

  • No labels