smart step into an anonymous class while debugging decompiled code

This commit is contained in:
Egor.Ushakov
2015-02-05 12:48:03 +03:00
parent 69c4449c02
commit 4448cabea2
2 changed files with 4 additions and 1 deletions
@@ -363,7 +363,7 @@ public class PositionManagerImpl implements PositionManager {
continue;
}
int locationLine = lnumber - 1;
PsiFile psiFile = position.getFile();
PsiFile psiFile = position.getFile().getOriginalFile();
if (psiFile instanceof PsiCompiledFile) {
locationLine = bytecodeToSourceLine(psiFile, locationLine);
if (locationLine < 0) continue;
@@ -168,6 +168,9 @@ public abstract class SourcePosition implements Navigatable{
Document document = null;
try {
document = PsiDocumentManager.getInstance(file.getProject()).getDocument(file);
if (document == null) { // may be decompiled psi - try to get document for the original file
document = PsiDocumentManager.getInstance(file.getProject()).getDocument(file.getOriginalFile());
}
}
catch (Throwable e) {
LOG.error(e);