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

« Previous Version 6 Next »


The purpose of this document is to provide information about general design, API and further evolution of IDEA code formatting subsystem

Table of Contents



The general idea of code formatting approach used by IntelliJ platform is to have the following:

  • language-agnostic API for representing target source file to format as a structure of visual blocks;
  • language-agnostic API that allows to define formatting rules for visual blocks mentioned above;
  • generic formatting algorithm that applies target formatting options to visual blocks mentioned above;
  • language-specific algorithms that build visual blocks from source code;

Here is a diagram that shows the parts mentioned above:

Block API

'Block' is an object with the following responsibilities:

  • it encapsulates target text range;
  • No labels