mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-30 18:27:49 +08:00
code_formatting.md: add hint about inspecting formatting blocks
This commit is contained in:
parent
61d8e594a7
commit
b6db963733
BIN
images/custom_language_support/psi_viewer_formatting_blocks.png
Normal file
BIN
images/custom_language_support/psi_viewer_formatting_blocks.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 197 KiB |
@ -27,6 +27,11 @@ Its children cover individual classes in the file, blocks on the next level cove
|
||||
The formatter modifies only the characters between blocks, and the tree of blocks must be built so that the bottom-level blocks cover all non-whitespace characters in the file.
|
||||
Otherwise, the characters between blocks may be deleted by the formatter.
|
||||
|
||||
For better understanding how to build the blocks structure, use [PsiViewer](https://plugins.jetbrains.com/docs/intellij/explore-api.html#31-use-internal-mode-and-psiviewer) and inspect formatting
|
||||
blocks built for an existing language:
|
||||
|
||||
{width="720"}
|
||||
|
||||
If the formatting operation does not affect the entire file (for example, if the formatter is called to format the pasted block of text), a complete tree of blocks is not built.
|
||||
Rather, only blocks for the text range covered by the formatting operation and their parents are built.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user