This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.intellij.openapi.application.PathManager | |
import com.intellij.openapi.vfs.VirtualFile | |
import liveplugin.toolwindow.PluginToolWindowManager | |
import java.lang.reflect.Field | |
import java.lang.reflect.Modifier | |
import static liveplugin.PluginUtil.* | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.intellij.openapi.actionSystem.ActionManager | |
import com.intellij.openapi.actionSystem.AnAction | |
import com.intellij.openapi.actionSystem.AnActionEvent | |
import com.intellij.openapi.actionSystem.Constraints | |
import com.intellij.openapi.actionSystem.DefaultActionGroup | |
import com.intellij.openapi.util.Pair | |
import static com.intellij.openapi.actionSystem.IdeActions.* | |
import java.nio.channels.IllegalSelectorException |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.text.SimpleDateFormat | |
import static intellijeval.PluginUtil.* | |
// assuming that each line in file is in the following format: [timestamp] [event id] | |
// will calculate difference between timestapms and group events by their duration | |
registerAction("TimeToInt", "ctrl alt shift G") { event -> | |
currentEditorIn(event.project).with { | |
def lines = document.text.split(/\n/).collect{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.intellij.openapi.actionSystem.AnActionEvent | |
import com.intellij.psi.PsiClass | |
import com.intellij.psi.PsiElement | |
import com.intellij.psi.PsiModifier | |
import com.intellij.psi.util.PsiTreeUtil | |
import static liveplugin.PluginUtil.* | |
def findContextClass = { project -> | |
def editor = currentEditorIn(project); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.intellij.openapi.module.ModuleManager | |
import com.intellij.openapi.roots.CompilerModuleExtension | |
import com.intellij.openapi.roots.ModuleRootManager | |
import com.intellij.openapi.vcs.changes.ChangeListManager | |
import com.intellij.util.io.ZipUtil | |
import java.util.zip.ZipOutputStream | |
import com.intellij.openapi.application.PathManager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def execute(String command, List<String> parameters) { | |
def ant = new AntBuilder() | |
ant.exec(outputproperty:"cmdOut", | |
errorproperty: "cmdErr", | |
resultproperty:"cmdExit", | |
failonerror: "true", | |
executable: command) { | |
arg(line: parameters.join(" ")) | |
} | |
[exitCode: ant.project.properties.cmdExit, stderr: ant.project.properties.cmdErr, stdout: ant.project.properties.cmdOut] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.intellij.codeInsight.folding.impl.EditorFoldingInfo | |
import com.intellij.codeInsight.folding.impl.FoldingUtil | |
import com.intellij.openapi.actionSystem.AnActionEvent | |
import com.intellij.openapi.editor.Document | |
import com.intellij.openapi.editor.Editor | |
import com.intellij.openapi.editor.FoldRegion | |
import com.intellij.openapi.editor.ex.FoldingModelEx | |
import java.util.regex.Pattern |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.intellij.openapi.actionSystem.ActionPlaces | |
import com.intellij.openapi.actionSystem.AnActionEvent | |
import com.intellij.openapi.actionSystem.DataContext | |
import com.intellij.openapi.actionSystem.LangDataKeys | |
import com.intellij.openapi.application.ApplicationManager | |
import com.intellij.openapi.diagnostic.Logger | |
import com.intellij.openapi.editor.Document | |
import com.intellij.openapi.editor.Editor | |
import com.intellij.openapi.editor.SelectionModel | |
import com.intellij.openapi.editor.actionSystem.EditorAction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(classOf[JUnitRunner]) | |
class PrimesTest extends FunSuite { | |
test("sanity check") { | |
assert(2 + 2 === 4) | |
} | |
test("Prime should return list with a length specified in parameters") { | |
assert(Primes.listOfPrimes(0) === List(), "empty list") | |
assert(Primes.listOfPrimes(1) === List(2), "first prime") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import clojure.lang.Compiler | |
import clojure.lang.RT | |
import com.intellij.openapi.application.PathManager | |
import static intellijeval.PluginUtil.* | |
// could use PluginUtil.anotherEditor() instead of hardcoded string | |
String str = """ | |
(ns intellij_clojure) | |
(import com.intellij.openapi.application.ApplicationManager) |