com.intellij.openapi.util.text.StringUtil



API Populatity

4 Client projects

Project: com.intellij

Project JetBrains/intellij-community in file ...ains.python.console.PyConsoleHighlightingUtil.java (2010-04-20)
@@ -9,6 +9,7 @@ import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.application.ModalityState;
 import com.intellij.openapi.editor.markup.TextAttributes;
 import com.intellij.openapi.util.Key;
+import com.intellij.openapi.util.text.StringUtil;
 import com.jetbrains.python.PyHighlighter;
 
 import java.util.regex.Matcher;
@@ -36,6 +37,7 @@ public class PyConsoleHighlightingUtil {
                                                         ColoredProcessHandler.getByKey(PyHighlighter.PY_NUMBER));
 
   public static void processOutput(final LanguageConsoleImpl console, String string, final Key attributes) {
+    string = StringUtil.convertLineSeparators(string);
     final ConsoleViewContentType type =
       attributes == ProcessOutputTypes.STDERR ? ConsoleViewContentType.ERROR_OUTPUT : ConsoleViewContentType.NORMAL_OUTPUT;
     // Highlight output by pattern
Project JetBrains/intellij-community in file ...intellij.tasks.impl.TaskCompletionContributor.java (2011-12-26)
@@ -11,6 +11,7 @@ import com.intellij.openapi.progress.ProcessCanceledException;
 import com.intellij.openapi.progress.ProgressManager;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.Key;
+import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.psi.PsiDocumentManager;
 import com.intellij.psi.PsiFile;
 import com.intellij.tasks.Task;
@@ -107,6 +108,7 @@ public class TaskCompletionContributor extends CompletionContributor {
           public void handleInsert(InsertionContext context, LookupElement item) {
             Document document = context.getEditor().getDocument();
             String s = task.getId() + ": " + task.getSummary();
+            s = StringUtil.convertLineSeparators(s);
             document.replaceString(context.getStartOffset(), context.getTailOffset(), s);
             context.getEditor().getCaretModel().moveToOffset(context.getStartOffset() + s.length());
             consumer.consume(task);
Project JetBrains/intellij-community in file ...ation.JoinConcatenatedStringLiteralsIntention.java (2005-07-11)
@@ -2,6 +2,7 @@ package com.siyeh.ipp.concatenation;
 
 import com.intellij.psi.*;
 import com.intellij.util.IncorrectOperationException;
+import com.intellij.openapi.util.text.StringUtil;
 import com.siyeh.ipp.base.Intention;
 import com.siyeh.ipp.base.PsiElementPredicate;
 import org.jetbrains.annotations.NotNull;
@@ -66,6 +67,7 @@ public class JoinConcatenatedStringLiteralsIntention extends Intention{
         } else{
             result += rhsText;
         }
+	    result = StringUtil.escapeStringCharacters(result);
         return result;
     }