Prototype of google popup search mini-plugin
September 2, 2021 ยท View on GitHub
import com.intellij.ide.BrowserUtil import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.progress.ProgressIndicator import groovy.json.JsonSlurper
import static liveplugin.PluginUtil.registerAction import static liveplugin.PluginUtil.show import static liveplugin.PluginUtil.showPopupSearch
registerAction("GoogleSearchAction", "ctrl alt shift G") { AnActionEvent event -> def itemProvider = { String pattern, ProgressIndicator indicator -> googleSuggestionsFor(pattern) } showPopupSearch("Google quick search", event.project, itemProvider) { String item -> BrowserUtil.open("http://www.google.com/search?q=${item}") } }
List
if (!isIdeStartup) show("Loaded GoogleSearchAction
Use ctrl+alt+shift+G to run it")