Skip to content

Commit

Permalink
Adding hover popup instrumentation (#57)
Browse files Browse the repository at this point in the history
* Adding hover popup instrumentation

* Moving popup open logging to proper location

* Updating plugin version: 1.2.1 -> 1.2.2
  • Loading branch information
jyoo980 authored Jul 14, 2022
1 parent 729cc37 commit ba041d9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
pluginGroup = com.github.jyoo980.reachhover
pluginName = reach-hover
# SemVer format -> https://semver.org
pluginVersion = 1.2.1
pluginVersion = 1.2.2

# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
# for insight into build numbers and IntelliJ Platform versions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,5 @@ enum class EventType {
FILE_CLOSED,
MOUSE_CLICK,
CURSOR_JUMP,
POPUP_EVENT,
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.github.jyoo980.reachhover.services

import com.github.jyoo980.reachhover.analytics.EventType
import com.github.jyoo980.reachhover.analytics.LogWriter
import com.github.jyoo980.reachhover.model.ReachabilityHoverContext
import com.github.jyoo980.reachhover.ui.ReachabilityPopupBuilder
import com.intellij.openapi.application.ApplicationManager
Expand Down Expand Up @@ -27,13 +29,18 @@ class ReachabilityInfoPopupManager {
JBPopupFactory.getInstance()
.createComponentPopupBuilder(popupUI, null)
.setCancelOnClickOutside(true)
.setCancelCallback {
LogWriter.write("ReachHover popup closed", EventType.POPUP_EVENT)
true
}
.createPopup()
currentPopupRef = WeakReference(popup)

ApplicationManager.getApplication().invokeLater {
currentContext?.editor?.let { EditorMouseHoverPopupControl.disablePopups(it) }
}
popup.show(popupContext.location)
LogWriter.write("ReachHover popup shown", EventType.POPUP_EVENT)
}

fun resetPopupState() {
Expand Down

0 comments on commit ba041d9

Please sign in to comment.