mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-30 10:17:50 +08:00
formatter.md: cleanup
This commit is contained in:
parent
6c7b59d68e
commit
d8ecd49f43
@ -16,7 +16,7 @@ The formatter controls spaces, indents, wrap, and alignment.
|
||||
The formatting model represents the formatting structure of a file as a tree of [`Block`](upsource:///platform/lang-api/src/com/intellij/formatting/Block.java) objects, with associated indent, wrap, alignment and spacing settings.
|
||||
The goal is to cover each PSI element with such a block.
|
||||
Since each block builds its children's blocks, it can generate extra blocks or skip any PSI elements.
|
||||
Define `SimpleBlock` based on [`AbstractBlock`](upsource:///platform/lang-impl/src/com/intellij/psi/formatter/common/AbstractBlock.java)
|
||||
Define `SimpleBlock` based on [`AbstractBlock`](upsource:///platform/lang-impl/src/com/intellij/psi/formatter/common/AbstractBlock.java).
|
||||
|
||||
```java
|
||||
{% include /code_samples/simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleBlock.java %}
|
||||
@ -24,7 +24,8 @@ Define `SimpleBlock` based on [`AbstractBlock`](upsource:///platform/lang-impl/s
|
||||
|
||||
## 15.2. Define a Formatting Model Builder
|
||||
Define a formatter that removes extra spaces except for the single spaces around the property separator.
|
||||
For example, reformat "foo = bar" to `foo = bar`.
|
||||
For example, reformat "foo = bar" to "foo = bar".
|
||||
|
||||
Create `SimpleFormattingModelBuilder` by subclassing [`FormattingModelBuilder`](upsource:///platform/lang-api/src/com/intellij/formatting/FormattingModelBuilder.java).
|
||||
|
||||
```java
|
||||
|
Loading…
x
Reference in New Issue
Block a user