js tests
authorAlexey Kudravtsev <cdr@intellij.com>
Thu, 5 Nov 2009 15:18:38 +0000 (18:18 +0300)
committerAlexey Kudravtsev <cdr@intellij.com>
Thu, 5 Nov 2009 15:18:38 +0000 (18:18 +0300)
platform/lang-impl/src/com/intellij/codeInsight/daemon/impl/GeneralHighlightingPass.java

index ff8aaabe403908f5859805f0099517c3b41ceb93..16a1d2fe938678bcf56be21c8e462ea9746f7f55 100644 (file)
@@ -285,6 +285,19 @@ public class GeneralHighlightingPass extends ProgressableTextEditorHighlightingP
       HighlightInfo patched =
         new HighlightInfo(info.forcedTextAttributes, info.type, hostRange.getStartOffset(), hostRange.getEndOffset(),
                           info.description, info.toolTip, info.type.getSeverity(null), info.isAfterEndOfLine, null, false);
+      
+      if (info.quickFixActionRanges != null) {
+        for (Pair<HighlightInfo.IntentionActionDescriptor, TextRange> pair : info.quickFixActionRanges) {
+          TextRange quickfixTextRange = pair.getSecond();
+          List<TextRange> editableQF = injectedLanguageManager.intersectWithAllEditableFragments(injectedPsi, quickfixTextRange);
+          for (TextRange editableRange : editableQF) {
+            HighlightInfo.IntentionActionDescriptor descriptor = pair.getFirst();
+            if (patched.quickFixActionRanges == null) patched.quickFixActionRanges = new ArrayList<Pair<HighlightInfo.IntentionActionDescriptor, TextRange>>();
+            TextRange hostEditableRange = documentWindow.injectedToHost(editableRange);
+            patched.quickFixActionRanges.add(Pair.create(descriptor, hostEditableRange));
+          }
+        }
+      }
       addHighlightInfo(hostRange, patched);
     }
   }