Skip to content

Latest commit

 

History

History
119 lines (95 loc) · 8.84 KB

IntellijApiCheatSheet.md

File metadata and controls

119 lines (95 loc) · 8.84 KB

IntelliJ API mini cheat sheet

You can explore source code on GitHub, Upsourse or clone it:

git clone https://github.com/JetBrains/intellij-community.git

"Manager" postfix in class names in general means the class is "Facade" for some subsystem. Classes and interfaces might also have implementation with "Ex" postfix meaning that they have extended functionality (e.g. ApplicationManagerEx).

"Core" classes

  • Application - provides access to core application-wide functionality and methods for working with the IDEA thread model
  • MessageBus - core of subscribe/publish messaging infrastructure
  • Project - represents project in IntelliJ, used in many APIs for project-specific functionality
  • ProjectManager - open/close/get list of projects
  • ProjectManagerListener - callback on project open/close
  • DumbAware - marker interface for actions and toolwindows that can work while indices are being updated

Actions

  • AnAction - all user interactions are performed through actions (see also EditorAction)
  • AnActionEvent - container for the information necessary to execute or update AnAction
  • ActionManager - register/unregister/find actions
  • IntentionAction - interface for intention actions (Alt-Enter actions in editor)
  • IntentionManager - register/unregister intentions

Editing files

Syntax tree

Project structure

UI elements

Threading rules

  • EDT read: just do it
  • EDT write: runWriteAction{...}
  • Other threads read: runReadAction{...}
  • Other threads write: N/A (i.e. invokeOnEDT{...})
  • See also General Threading Rules.

Other useful APIs

  • com.intellij.codeInsight.completion.CompletionContributor
  • com.intellij.lang.LanguageExtension
  • com.intellij.patterns.PsiElementPattern (and com.intellij.patterns.PlatformPatterns, com.intellij.patterns.StandardPatterns)
  • com.intellij.psi.util.PsiUtilCore