IDEA Plugin Dev - Service

Card Puncher Data Processing

Add the appropriate child element (, or ) to the section of the plugin.xml file.
  • For the newly added child element, set the following attributes:
    • serviceInterface: specifies the service interface class.
    • serviceImplementation: specifies the service implementation class.
Note that the interface and implementation classes can be the same.To clarify the service declaration procedure, consider the following fragment of the plugin.xml file:
<extensions defaultExtensionNs="com.intellij">
  <!-- Declare the application level service -->
  <applicationService serviceInterface="Mypackage.MyServiceInterfaceClass" serviceImplementation="Mypackage.MyServiceImplClass" />

  <!-- Declare the project level service -->
  <projectService serviceInterface="Mypackage.MyProjectServiceInterfaceClass" serviceImplementation="Mypackage.MyProjectServiceImplClass" />
To instantiate your service, in Java code, use the following syntax:
MyServiceImplClass service = ServiceManager.getService(MyServiceImplClass.class);
Documentation / Reference

Discover More
Card Puncher Data Processing
Idea - Plugin Development

How to develop IDEA plugin. The most common types of plugins include: Custom language support (File type recognition, Lexical analysis, Syntax highlighting, Formatting, Code insight and code completion,...

Share this page:
Follow us:
Task Runner