mirror of
https://github.com/chylex/IntelliJ-Keyboard-Master.git
synced 2025-04-22 17:15:43 +02:00
Add actions to go to next/previous highlighted error in other mode
This commit is contained in:
parent
a3aee8cd84
commit
6f7cb51300
src/main
kotlin/com/chylex/intellij/keyboardmaster/feature/action/gotoError
GotoErrorInOtherModeHandler.ktGotoNextErrorInOtherModeAction.ktGotoPreviousErrorInOtherModeAction.kt
resources/META-INF
@ -0,0 +1,21 @@
|
||||
package com.chylex.intellij.keyboardmaster.feature.action.gotoError
|
||||
|
||||
import com.intellij.codeInsight.daemon.DaemonCodeAnalyzerSettings
|
||||
import com.intellij.codeInsight.daemon.impl.GotoNextErrorHandler
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.psi.PsiFile
|
||||
|
||||
class GotoErrorInOtherModeHandler(forward: Boolean) : GotoNextErrorHandler(forward) {
|
||||
override fun invoke(project: Project, editor: Editor, file: PsiFile) {
|
||||
val settings = DaemonCodeAnalyzerSettings.getInstance()
|
||||
val oldMode = settings.isNextErrorActionGoesToErrorsFirst
|
||||
|
||||
settings.isNextErrorActionGoesToErrorsFirst = !oldMode
|
||||
try {
|
||||
super.invoke(project, editor, file)
|
||||
} finally {
|
||||
settings.isNextErrorActionGoesToErrorsFirst = oldMode
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.chylex.intellij.keyboardmaster.feature.action.gotoError
|
||||
|
||||
import com.intellij.codeInsight.CodeInsightActionHandler
|
||||
import com.intellij.codeInsight.daemon.impl.actions.GotoNextErrorAction
|
||||
|
||||
class GotoNextErrorInOtherModeAction : GotoNextErrorAction() {
|
||||
override fun getHandler(): CodeInsightActionHandler {
|
||||
return GotoErrorInOtherModeHandler(forward = true)
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.chylex.intellij.keyboardmaster.feature.action.gotoError
|
||||
|
||||
import com.intellij.codeInsight.CodeInsightActionHandler
|
||||
import com.intellij.codeInsight.daemon.impl.actions.GotoPreviousErrorAction
|
||||
|
||||
class GotoPreviousErrorInOtherModeAction : GotoPreviousErrorAction() {
|
||||
override fun getHandler(): CodeInsightActionHandler {
|
||||
return GotoErrorInOtherModeHandler(forward = false)
|
||||
}
|
||||
}
|
@ -22,4 +22,18 @@
|
||||
<applicationConfigurable parentId="tools" instance="com.chylex.intellij.keyboardmaster.configuration.PluginConfigurable" id="com.chylex.keyboardmaster" displayName="Keyboard Master" />
|
||||
<postStartupActivity implementation="com.chylex.intellij.keyboardmaster.PluginStartup" order="last" />
|
||||
</extensions>
|
||||
|
||||
<actions>
|
||||
<!-- Go to Highlighted Error -->
|
||||
<action id="KM.GotoNextErrorInOtherMode"
|
||||
text="Next Highlighted Error in Other Mode"
|
||||
class="com.chylex.intellij.keyboardmaster.feature.action.gotoError.GotoNextErrorInOtherModeAction">
|
||||
<add-to-group group-id="GoToErrorGroup" anchor="after" relative-to-action="GotoNextError" />
|
||||
</action>
|
||||
<action id="KM.GotoPreviousErrorInOtherMode"
|
||||
text="Previous Highlighted Error in Other Mode"
|
||||
class="com.chylex.intellij.keyboardmaster.feature.action.gotoError.GotoPreviousErrorInOtherModeAction">
|
||||
<add-to-group group-id="GoToErrorGroup" anchor="after" relative-to-action="GotoPreviousError" />
|
||||
</action>
|
||||
</actions>
|
||||
</idea-plugin>
|
||||
|
Loading…
Reference in New Issue
Block a user