used psi file instead of the first element
authorliana.bakradze <liana.bakradze@jetbrains.com>
Wed, 19 Aug 2015 19:02:13 +0000 (22:02 +0300)
committerliana.bakradze <liana.bakradze@jetbrains.com>
Wed, 19 Aug 2015 19:02:13 +0000 (22:02 +0300)
python/edu/src/com/jetbrains/python/edu/PyExecuteFileLineMarkerProvider.java

index ba4413b853b9a080a37421e0b3baeb27a9a54e4d..e0c76446ce4e396fe542b2211302d4b5ed993568 100644 (file)
@@ -34,10 +34,10 @@ public class PyExecuteFileLineMarkerProvider implements LineMarkerProvider {
     if (elements.isEmpty()) {
       return;
     }
-    PsiElement element = elements.get(0);
+    PsiElement element = elements.get(0).getContainingFile();
     final RunContextAction runAction = new RunContextAction(DefaultRunExecutor.getRunExecutorInstance());
     final LineMarkerInfo<PsiElement> markerInfo = new LineMarkerInfo<PsiElement>(
-      element, element.getTextRange(), AllIcons.Actions.Execute, Pass.UPDATE_OVERRIDEN_MARKERS,
+      element, 0, AllIcons.Actions.Execute, Pass.UPDATE_OVERRIDEN_MARKERS,
       new Function<PsiElement, String>() {
         @Override
         public String fun(PsiElement e) {