mirror of
https://github.com/chylex/IntelliJ-Inspection-Lens.git
synced 2025-01-30 21:46:06 +01:00
Compare commits
No commits in common. "603b35abdbe620167b356cc7af2357fd585f1793" and "8936f0e5beb60fd3091436d863083d8efc164d1c" have entirely different histories.
603b35abdb
...
8936f0e5be
@ -2,13 +2,8 @@ package com.chylex.intellij.inspectionlens.editor.lens
|
||||
|
||||
import com.intellij.codeInsight.daemon.impl.IntentionsUI
|
||||
import com.intellij.codeInsight.hint.HintManager
|
||||
import com.intellij.codeInsight.intention.actions.ShowIntentionActionsAction
|
||||
import com.intellij.codeInsight.intention.impl.ShowIntentionActionsHandler
|
||||
import com.intellij.lang.LangBundle
|
||||
import com.intellij.openapi.actionSystem.ActionManager
|
||||
import com.intellij.openapi.actionSystem.ActionPlaces
|
||||
import com.intellij.openapi.actionSystem.IdeActions
|
||||
import com.intellij.openapi.actionSystem.ex.ActionUtil
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.psi.PsiDocumentManager
|
||||
@ -23,19 +18,6 @@ internal object IntentionsPopup {
|
||||
}
|
||||
|
||||
private fun tryShow(editor: Editor): Boolean {
|
||||
// If the IDE uses the default Show Intentions action and handler,
|
||||
// use the handler directly to bypass additional logic from the action.
|
||||
val action = ActionManager.getInstance().getAction(IdeActions.ACTION_SHOW_INTENTION_ACTIONS)
|
||||
if (action.javaClass === ShowIntentionActionsAction::class.java) {
|
||||
return tryShowWithDefaultHandler(editor)
|
||||
}
|
||||
else {
|
||||
ActionUtil.invokeAction(action, editor.component, ActionPlaces.EDITOR_INLAY, null, null)
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
private fun tryShowWithDefaultHandler(editor: Editor): Boolean {
|
||||
val project = editor.project ?: return false
|
||||
val file = PsiUtilBase.getPsiFileInEditor(editor, project) ?: return false
|
||||
|
||||
|
@ -67,7 +67,7 @@ class LensRenderer(private var info: HighlightInfo, settings: LensSettingsState)
|
||||
|
||||
val font = editor.colorsScheme.getFont(EditorFontType.PLAIN)
|
||||
val x = r.x + TEXT_HORIZONTAL_PADDING
|
||||
val y = r.y + editor.ascent
|
||||
val y = r.y + editor.ascent + 1
|
||||
val w = inlay.widthInPixels - UNDERLINE_WIDTH_REDUCTION - extraRightPadding
|
||||
val h = editor.descent
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user