mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
don't select anything when implementing a method with no range or text
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user