Search in sources :

Example 1 with IdeScriptEngineManager

use of org.jetbrains.ide.script.IdeScriptEngineManager in project intellij-community by JetBrains.

the class RunIdeConsoleAction method update.

@Override
public void update(AnActionEvent e) {
    IdeScriptEngineManager manager = IdeScriptEngineManager.getInstance();
    e.getPresentation().setVisible(e.getProject() != null);
    e.getPresentation().setEnabled(manager.isInitialized() && !manager.getLanguages().isEmpty());
}
Also used : IdeScriptEngineManager(org.jetbrains.ide.script.IdeScriptEngineManager)

Example 2 with IdeScriptEngineManager

use of org.jetbrains.ide.script.IdeScriptEngineManager in project intellij-community by JetBrains.

the class IdeStartupScripts method prepareScriptEngines.

@NotNull
private static List<Pair<VirtualFile, IdeScriptEngine>> prepareScriptEngines(@NotNull List<VirtualFile> scripts) {
    IdeScriptEngineManager scriptEngineManager = IdeScriptEngineManager.getInstance();
    List<Pair<VirtualFile, IdeScriptEngine>> result = ContainerUtil.newArrayList();
    for (VirtualFile script : scripts) {
        String extension = script.getExtension();
        IdeScriptEngine engine = extension != null ? scriptEngineManager.getEngineForFileExtension(extension, null) : null;
        result.add(Pair.create(script, engine));
    }
    return result;
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) IdeScriptEngineManager(org.jetbrains.ide.script.IdeScriptEngineManager) Pair(com.intellij.openapi.util.Pair) IdeScriptEngine(org.jetbrains.ide.script.IdeScriptEngine) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

IdeScriptEngineManager (org.jetbrains.ide.script.IdeScriptEngineManager)2 Pair (com.intellij.openapi.util.Pair)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 NotNull (org.jetbrains.annotations.NotNull)1 IdeScriptEngine (org.jetbrains.ide.script.IdeScriptEngine)1