mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-28 01:07:49 +08:00
Add information about ordering intentions and quick fixes with HighPriorityAction and LowPriorityAction
This commit is contained in:
parent
e11b487e3a
commit
45584e7782
@ -98,6 +98,15 @@ The change to the PSI tree is accomplished by the usual approach to modification
|
|||||||
* Substituting the original left and right operands into the new `PsiMethodCallExpression`.
|
* Substituting the original left and right operands into the new `PsiMethodCallExpression`.
|
||||||
* Replacing the original binary expression with the `PsiMethodCallExpression`.
|
* Replacing the original binary expression with the `PsiMethodCallExpression`.
|
||||||
|
|
||||||
|
> In case of providing multiple quick fixes for a single element, their ordering is indeterministic due to performance reasons.
|
||||||
|
> It is possible to push specific items up or down by implementing
|
||||||
|
> [`HighPriorityAction`](%gh-ic%/platform/analysis-api/src/com/intellij/codeInsight/intention/HighPriorityAction.java)
|
||||||
|
> or
|
||||||
|
> [`LowPriorityAction`](%gh-ic%/platform/analysis-api/src/com/intellij/codeInsight/intention/LowPriorityAction.java)
|
||||||
|
> respectively.
|
||||||
|
>
|
||||||
|
{style="note"}
|
||||||
|
|
||||||
### Inspection Description
|
### Inspection Description
|
||||||
|
|
||||||
The inspection description is an HTML file.
|
The inspection description is an HTML file.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# Intentions
|
|
||||||
|
|
||||||
<!-- Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
|
<!-- Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
|
||||||
|
|
||||||
|
# Intentions
|
||||||
|
|
||||||
<link-summary>Intention actions allowing to fix code issues or transform the code to a different form.</link-summary>
|
<link-summary>Intention actions allowing to fix code issues or transform the code to a different form.</link-summary>
|
||||||
|
|
||||||
<tldr>
|
<tldr>
|
||||||
@ -33,6 +33,15 @@ The [conditional_operator_intention](%gh-sdk-samples%/conditional_operator_inten
|
|||||||
- How to invoke a quick fix action for a token element under cursor using the [`PsiElementBaseIntentionAction`](%gh-ic%/platform/lang-api/src/com/intellij/codeInsight/intention/PsiElementBaseIntentionAction.java) class.
|
- How to invoke a quick fix action for a token element under cursor using the [`PsiElementBaseIntentionAction`](%gh-ic%/platform/lang-api/src/com/intellij/codeInsight/intention/PsiElementBaseIntentionAction.java) class.
|
||||||
- How to create a JUnit test for this plugin using the [`IdeaTestFixtureFactory`](%gh-ic%/platform/testFramework/src/com/intellij/testFramework/fixtures/IdeaTestFixtureFactory.java) class.
|
- How to create a JUnit test for this plugin using the [`IdeaTestFixtureFactory`](%gh-ic%/platform/testFramework/src/com/intellij/testFramework/fixtures/IdeaTestFixtureFactory.java) class.
|
||||||
|
|
||||||
|
> In case of providing multiple intention actions for a single element, their ordering is indeterministic due to performance reasons.
|
||||||
|
> It is possible to push specific items up or down by implementing
|
||||||
|
> [`HighPriorityAction`](%gh-ic%/platform/analysis-api/src/com/intellij/codeInsight/intention/HighPriorityAction.java)
|
||||||
|
> or
|
||||||
|
> [`LowPriorityAction`](%gh-ic%/platform/analysis-api/src/com/intellij/codeInsight/intention/LowPriorityAction.java)
|
||||||
|
> respectively.
|
||||||
|
>
|
||||||
|
{style="note"}
|
||||||
|
|
||||||
## Sample Plugin
|
## Sample Plugin
|
||||||
|
|
||||||
When launched, this plugin adds the <control>Convert ternary operator if statement</control> item to the <control>Conditional Operator</control> node in the Intentions List:
|
When launched, this plugin adds the <control>Convert ternary operator if statement</control> item to the <control>Conditional Operator</control> node in the Intentions List:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user