mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-28 01:07:49 +08:00
Add missing 'link-summary'
This commit is contained in:
parent
7d45c2580a
commit
31910f7a6f
@ -1,6 +1,8 @@
|
||||
[//]: # (title: Code Formatter)
|
||||
# Code Formatter
|
||||
|
||||
<!-- Copyright 2000-2022 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
|
||||
<!-- Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
|
||||
|
||||
<link-summary>Implementing a code formatter that aligns whitespaces according to the defined set of rules, and performs non-whitespace formatting modifications.</link-summary>
|
||||
|
||||
<tldr>
|
||||
|
||||
@ -64,7 +66,7 @@ For every block, the plugin specifies the following properties:
|
||||
The plugin can specify that a particular block is never wrapped, always wrapped, or wrapped only if it exceeds the right margin.
|
||||
|
||||
* The _alignment_ ([`Alignment`](%gh-ic%/platform/code-style-api/src/com/intellij/formatting/Alignment.java)) specifies which blocks should be aligned with each other.
|
||||
If two blocks with the alignment property set to the same object instance are placed in different lines, and if the second block is the first non-whitespace block in its line, the formatter inserts white spaces before the second block, so that it starts from the same column as the first one.
|
||||
If two blocks with the alignment property set to the same object instance are placed in different lines, and if the second block is the first non-whitespace block in its line, the formatter inserts whitespaces before the second block, so that it starts from the same column as the first one.
|
||||
|
||||
For each of these properties, several particular use settings exist, described in the JavaDoc comments for the respective classes.
|
||||
See also [`SpacingBuilder`](%gh-ic%/platform/code-style-api/src/com/intellij/formatting/SpacingBuilder.java), which aids in building rule-based configuration.
|
||||
@ -80,7 +82,7 @@ Code formatting can be suppressed per region via [special comments](https://yout
|
||||
|
||||
## Non-Whitespace Modifications
|
||||
|
||||
Sometimes a plugin requires performing non-whitespace characters modifications like reordering methods, changing letter cases, or adding missing braces.
|
||||
Sometimes a plugin requires performing non-whitespace character modifications like reordering methods, changing letter cases, or adding missing braces.
|
||||
The formatting framework provides extension points allowing to achieve these goals.
|
||||
|
||||
### Pre-Processor
|
||||
@ -96,7 +98,7 @@ To register a formatting pre-processor, a plugin has to provide an implementatio
|
||||
|
||||
### Post-Processor
|
||||
|
||||
It's similar to the pre-processor but is run after the actual formatting is performed.
|
||||
It is similar to the pre-processor but is run after the actual formatting is performed.
|
||||
It can be used for adding, removing, or converting elements like braces, semicolons, quotes, changing letter-cases, etc.
|
||||
|
||||
To register a formatting post-processor, a plugin has to provide an implementation of [`PostFormatProcessor`](%gh-ic%/platform/code-style-api/src/com/intellij/psi/impl/source/codeStyle/PostFormatProcessor.java) and register it in the `com.intellij.postFormatProcessor` extension point.
|
||||
@ -122,7 +124,7 @@ The return value of `createIndentOptions()` determines the default indent size.
|
||||
|
||||
_2021.3_
|
||||
|
||||
Register [`AsyncDocumentFormattingService`](%gh-ic%/platform/code-style-api/src/com/intellij/formatting/service/AsyncDocumentFormattingService.java) implementation in extension point [`com.intellij.formattingService`](https://jb.gg/ipe?extensions=com.intellij.formattingService) to invoke external formatter instead of IDE's builtin formatter.
|
||||
Register [`AsyncDocumentFormattingService`](%gh-ic%/platform/code-style-api/src/com/intellij/formatting/service/AsyncDocumentFormattingService.java) implementation in the [`com.intellij.formattingService`](https://jb.gg/ipe?extensions=com.intellij.formattingService) extension point to invoke external formatter instead of IDE's builtin formatter.
|
||||
|
||||
**Example**:
|
||||
[`ShExternalFormatter`](%gh-ic%/plugins/sh/core/src/com/intellij/sh/formatter/ShExternalFormatter.java) from _Shell Script_ plugin
|
||||
|
@ -1,6 +1,8 @@
|
||||
[//]: # (title: Documentation)
|
||||
# Documentation
|
||||
|
||||
<!-- Copyright 2000-2022 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
|
||||
<!-- Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
|
||||
|
||||
<link-summary>Providing code documentation displayed in the popup invoked by hovering over a symbol or invoking the "View | Quick Documentation" action.</link-summary>
|
||||
|
||||
<tldr>
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
[//]: # (title: Implementing Parser and PSI)
|
||||
# Implementing Parser and PSI
|
||||
|
||||
<!-- Copyright 2000-2022 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
|
||||
<!-- Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
|
||||
|
||||
<link-summary>Introduction to parsing custom language files code and representing it with AST and PSI trees.</link-summary>
|
||||
|
||||
Parsing files in IntelliJ Platform is a two-step process.
|
||||
|
||||
@ -74,7 +76,7 @@ To better understand the process of building a PSI tree for a simple expression,
|
||||
|
||||
In general, there is no single right way to implement a PSI for a custom language, and the plugin author can choose the PSI structure and set of methods that are the most convenient for the code which uses the PSI (error analysis, refactorings, and so on).
|
||||
However, one base interface needs to be used by a custom language PSI implementation to support features like [](rename_refactoring.md) and [](find_usages.md).
|
||||
Every element which can be renamed or referenced (a class definition, a method definition and so on) needs to implement the [`PsiNamedElement`](%gh-ic%/platform/core-api/src/com/intellij/psi/PsiNamedElement.java) interface, with methods `getName()` and `setName()`.
|
||||
Every element which can be renamed or referenced (a class definition, a method definition, and so on) needs to implement the [`PsiNamedElement`](%gh-ic%/platform/core-api/src/com/intellij/psi/PsiNamedElement.java) interface, with methods `getName()` and `setName()`.
|
||||
|
||||
Several functions which can be used for implementing and using the PSI can be found in the `com.intellij.psi.util` package, and in particular in the [`PsiUtilCore`](%gh-ic%/platform/core-api/src/com/intellij/psi/util/PsiUtilCore.java) and [`PsiTreeUtil`](%gh-ic%/platform/core-api/src/com/intellij/psi/util/PsiTreeUtil.java) classes.
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
[//]: # (title: Rename Refactoring)
|
||||
# Rename Refactoring
|
||||
|
||||
<!-- Copyright 2000-2022 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
|
||||
<!-- Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
|
||||
|
||||
<link-summary>Rename refactoring workflow, validation and customization.</link-summary>
|
||||
|
||||
<tldr>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user