Skip to content

Commit

Permalink
Lower priority of intentions - #487
Browse files Browse the repository at this point in the history
  • Loading branch information
arturbosch committed Aug 13, 2023
1 parent 5b9fe23 commit 0294c3b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#### 2.0.1

- Based on detekt 1.23.1
- Plugin intentions/quick fixes have now lower priority - [#487](https://github.com/detekt/detekt-intellij-plugin/issues/487)

#### 2.0.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import com.intellij.psi.PsiFile
import io.gitlab.arturbosch.detekt.api.CorrectableCodeSmell
import io.gitlab.arturbosch.detekt.api.Finding
import io.gitlab.arturbosch.detekt.api.TextLocation
import io.gitlab.arturbosch.detekt.idea.action.AddToBaselineAction
import io.gitlab.arturbosch.detekt.idea.intention.AddToBaselineAction
import io.gitlab.arturbosch.detekt.idea.config.DetektPluginSettings
import io.gitlab.arturbosch.detekt.idea.intention.AutoCorrectIntention
import io.gitlab.arturbosch.detekt.idea.util.isDetektEnabled
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package io.gitlab.arturbosch.detekt.idea.action
package io.gitlab.arturbosch.detekt.idea.intention

import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer
import com.intellij.codeInsight.intention.IntentionAction
import com.intellij.codeInsight.intention.LowPriorityAction
import com.intellij.openapi.components.service
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.project.Project
Expand All @@ -14,7 +15,7 @@ import io.gitlab.arturbosch.detekt.idea.config.DetektPluginSettings
import io.gitlab.arturbosch.detekt.idea.util.absoluteBaselinePath
import kotlin.io.path.exists

class AddToBaselineAction(private val finding: Finding) : IntentionAction {
class AddToBaselineAction(private val finding: Finding) : IntentionAction, LowPriorityAction {

override fun startInWriteAction(): Boolean = true

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package io.gitlab.arturbosch.detekt.idea.intention

import com.intellij.codeInsight.intention.IntentionAction
import com.intellij.codeInsight.intention.LowPriorityAction
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiFile
import io.gitlab.arturbosch.detekt.idea.DETEKT
import io.gitlab.arturbosch.detekt.idea.action.AutoCorrectAction

class AutoCorrectIntention : IntentionAction {
class AutoCorrectIntention : IntentionAction, LowPriorityAction {

override fun startInWriteAction(): Boolean = true

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
<br>
<ul>
<li>Based on detekt 1.23.1</li>
<li>Plugin intentions/quick fixes have now lower priority.</li>
</ul>
</li>
<li>2.0.0
Expand Down

0 comments on commit 0294c3b

Please sign in to comment.