Package com.intellij.execution.console

Examples of com.intellij.execution.console.LanguageConsoleImpl


            if (processHandler == null)
                return;
        }

        // implement a command
        LanguageConsoleImpl languageConsole = processHandler.getLanguageConsole();
        languageConsole.setInputText(command);

        Editor editor = languageConsole.getCurrentEditor();
        CaretModel caretModel = editor.getCaretModel();
        caretModel.moveToOffset(command.length());

        HaskellConsole console = (HaskellConsole) languageConsole;
        HaskellConsoleExecuteActionHandler handler = console.getExecuteHandler();
View Full Code Here


        if (handler == null) {
            presentation.setEnabled(false);
            return;
        }

        LanguageConsoleImpl console = handler.getLanguageConsole();
        if (!(console instanceof HaskellConsole)) {
            presentation.setEnabled(false);
            return;
        }
View Full Code Here

public final class ErlangConsoleView extends LanguageConsoleViewImpl {
  @Nullable private ConsoleHistoryModel myConsoleHistoryModel;
  @Nullable private OutputStreamWriter myProcessInputWriter;

  public ErlangConsoleView(@NotNull Project project) {
    super(new LanguageConsoleImpl(project, "Erlang Console", ErlangLanguage.INSTANCE) {
      @Override
      protected void doAddPromptToHistory() {
      }
    });
    LanguageConsoleImpl console = getConsole();
    console.setPrompt(">");
    PsiFile originalFile = console.getFile().getOriginalFile();
    originalFile.putUserData(ErlangPsiImplUtil.ERLANG_CONSOLE, console);
    originalFile.putUserData(ErlangVarProcessor.ERLANG_VARIABLE_CONTEXT, new HashMap<String, ErlangQVar>());
  }
View Full Code Here

  public void execute() {
    if (myProcessInputWriter == null || myConsoleHistoryModel == null) {
      return;
    }
    LanguageConsoleImpl console = getConsole();
    EditorEx consoleEditor = console.getConsoleEditor();
    Document editorDocument = consoleEditor.getDocument();
    String text = editorDocument.getText();

    PsiFile file = console.getFile();
    final Map<String, ErlangQVar> context = file.getOriginalFile().getUserData(ErlangVarProcessor.ERLANG_VARIABLE_CONTEXT);
    if (context != null) { // todo: process only successful statements
      file.accept(new ErlangRecursiveVisitor() {
        @Override
        public void visitQVar(@NotNull ErlangQVar o) {
          String name = o.getName();
          if (!context.containsKey(name)) context.put(name, o);
        }

        @Override
        public void visitFunctionCallExpression(@NotNull ErlangFunctionCallExpression o) {
          String name = o.getNameIdentifier().getText();
          int size = o.getArgumentList().getExpressionList().size();
          if (name.equals("f") && size == 0) context.clear();
        }
      });
    }

    console.addCurrentToHistory(new TextRange(0, text.length()), true, true);
    myConsoleHistoryModel.addToHistory(text);
    for (String line : text.split("\n")) {
      try {
        myProcessInputWriter.write(line + "\n");
        myProcessInputWriter.flush();
View Full Code Here

    final ClojureConsoleProcessHandler processHandler = findRunningClojureConsole(project);

    LOG.assertTrue(processHandler != null);

    // implement a command
    final LanguageConsoleImpl languageConsole = processHandler.getLanguageConsole();
    languageConsole.setInputText(command);

    final Editor editor = languageConsole.getCurrentEditor();
    final CaretModel caretModel = editor.getCaretModel();
    caretModel.moveToOffset(command.length());


    LOG.assertTrue(languageConsole instanceof ClojureConsole);
View Full Code Here

    if (handler == null) {
      presentation.setEnabled(false);
      return;
    }

    final LanguageConsoleImpl console = handler.getLanguageConsole();
    if (!(console instanceof ClojureConsole)) {
      presentation.setEnabled(false);
      return;
    }
View Full Code Here

TOP

Related Classes of com.intellij.execution.console.LanguageConsoleImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.