don't select anything when implementing a method with no range or text

This commit is contained in:
peter
2013-02-25 14:54:08 +01:00
parent d1fde5c3c3
commit 3ef2029865
@@ -420,6 +420,7 @@ public class ImplementationViewComponent extends JPanel {
}
@Nullable
public static String getNewText(PsiElement elt) {
Project project = elt.getProject();
PsiFile psiFile = getContainingFile(elt);
@@ -427,6 +428,10 @@ public class ImplementationViewComponent extends JPanel {
final Document doc = PsiDocumentManager.getInstance(project).getDocument(psiFile);
if (doc == null) return null;
if (elt.getText() == null || elt.getTextRange() == null) {
return null;
}
final ImplementationTextSelectioner implementationTextSelectioner =
LanguageImplementationTextSelectioner.INSTANCE.forLanguage(elt.getLanguage());
int start = implementationTextSelectioner.getTextStartOffset(elt);