EA-95434 - assert: LanguageConsoleImpl$Helper.getDocument

Trace virtual file properties in order to investigate the assertion failure
more closely.
This commit is contained in:
Eldar Abusalimov
2017-05-04 19:14:50 +03:00
parent 2c4303606e
commit 38e35971a0
@@ -541,7 +541,10 @@ public class LanguageConsoleImpl extends ConsoleViewImpl implements LanguageCons
public Document getDocument() {
Document document = FileDocumentManager.getInstance().getDocument(virtualFile);
if (document == null) {
throw new AssertionError("no document for: " + virtualFile);
Language language = (virtualFile instanceof LightVirtualFile) ? ((LightVirtualFile)virtualFile).getLanguage() : null;
throw new AssertionError(String.format("no document for: %s (fileType: %s, language: %s, length: %s, valid: %s)",
virtualFile,
virtualFile.getFileType(), language, virtualFile.getLength(), virtualFile.isValid()));
}
return document;
}