Java Code Examples for com.intellij.execution.process.ProcessEvent#getText()

The following examples show how to use com.intellij.execution.process.ProcessEvent#getText() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: InsightUpdateQueue.java    From reasonml-idea-plugin with MIT License 5 votes vote down vote up
@Override
public void onTextAvailable(@NotNull ProcessEvent event, @NotNull Key outputType) {
    String text = event.getText();
    if (text != null) {
        m_builder.append(text);
        if (text.endsWith("\n")) {
            m_lineProcessor.onRawTextAvailable(m_builder.toString());
            if (LOG.isTraceEnabled()) {
                LOG.trace(m_builder.toString().replace("\n", ""));
            }
            m_builder.setLength(0);
        }
    }
}
 
Example 2
Source File: DuneOutputListener.java    From reasonml-idea-plugin with MIT License 5 votes vote down vote up
@Override
public void onTextAvailable(@NotNull ProcessEvent event, @NotNull Key outputType) {
    String text = event.getText();

    /*
    File "CmtExtractor.ml", line 80, characters 67-70:
    Error: Unbound value cmt
    Hint: Did you mean cmtx?
    */
    if (text.startsWith("File")) {
        m_latestInfo = extractExtendedFilePositions(text);
        if (m_latestInfo != null) {
            m_latestInfo.isError = false;
        }
    } else if (text.startsWith("Error:")) {
        if (m_latestInfo != null) {
            m_latestInfo.isError = true;
            m_latestInfo.message = text.substring(6);
        }
    } else if (text.startsWith("Hint:")) {
        if (m_latestInfo != null) {
            m_latestInfo.message += " (" + text + ")";
        }
    }

    //m_previousText = text;
}
 
Example 3
Source File: FlutterLogEntryParser.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Nullable
FlutterLogEntry parseDaemonEvent(@NotNull ProcessEvent event, @Nullable Key outputType) {
  // TODO(pq): process outputType
  final String text = event.getText();
  if (text.isEmpty()) return null;

  return parseDaemonEvent(text);
}
 
Example 4
Source File: InstallSdkAction.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
void onTextAvailable(ProcessEvent event, Key outputType) {
  final String details = event.getText();
  // Filter out long messages and ones w/ leading whitespace.
  // Conveniently, these are also the unfriendly ones. For example:
  // 6 57.9M    6 3838k    0     0  2978k      0  0:00:19  0:00:01  0:00:18 2978k
  // TODO(pq): consider a more robust approach to filtering.
  if (!details.startsWith(" ") && details.length() < 70) {
    setProgressText(details);
  }
}
 
Example 5
Source File: FlutterLogEntryParser.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Nullable
FlutterLogEntry parseDaemonEvent(@NotNull ProcessEvent event, @Nullable Key outputType) {
  // TODO(pq): process outputType
  final String text = event.getText();
  if (text.isEmpty()) return null;

  return parseDaemonEvent(text);
}
 
Example 6
Source File: InstallSdkAction.java    From flutter-intellij with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
void onTextAvailable(ProcessEvent event, Key outputType) {
  final String details = event.getText();
  // Filter out long messages and ones w/ leading whitespace.
  // Conveniently, these are also the unfriendly ones. For example:
  // 6 57.9M    6 3838k    0     0  2978k      0  0:00:19  0:00:01  0:00:18 2978k
  // TODO(pq): consider a more robust approach to filtering.
  if (!details.startsWith(" ") && details.length() < 70) {
    setProgressText(details);
  }
}
 
Example 7
Source File: LineProcessingProcessAdapter.java    From intellij with Apache License 2.0 5 votes vote down vote up
@Override
public void onTextAvailable(ProcessEvent event, Key outputType) {
  String text = event.getText();
  if (text != null) {
    try {
      myOutputStream.write(text.getBytes(Charsets.UTF_8));
    } catch (IOException e) {
      // Ignore -- cannot happen
    }
  }
}