Add more investigation info to getFilesForElements
Relates to #EA-209630
This commit is contained in:
@@ -60,9 +60,9 @@ public class KtElementImpl extends ASTWrapperPsiElement implements KtElement {
|
||||
public KtFile getContainingKtFile() {
|
||||
PsiFile file = getContainingFile();
|
||||
if(!(file instanceof KtFile)) {
|
||||
String fileString = (file != null && file.isValid()) ? file.getText() : "";
|
||||
String fileString = (file != null && file.isValid()) ? (" " + file.getText()) : "";
|
||||
throw new IllegalStateException("KtElement not inside KtFile: " + file + fileString +
|
||||
"for element " + this + " of type " + this.getClass() + " node = " + getNode());
|
||||
" for element " + this + " of type " + this.getClass() + " node = " + getNode());
|
||||
}
|
||||
return (KtFile) file;
|
||||
}
|
||||
|
||||
@@ -69,9 +69,9 @@ public class KtElementImplStub<T extends StubElement<?>> extends StubBasedPsiEle
|
||||
PsiFile file = getContainingFile();
|
||||
if (!(file instanceof KtFile)) {
|
||||
// KtElementImpl.copy() might be the reason for this exception
|
||||
String fileString = file.isValid() ? file.getText() : "";
|
||||
String fileString = file.isValid() ? (" " + file.getText()) : "";
|
||||
throw new IllegalStateException("KtElement not inside KtFile: " + file + fileString +
|
||||
"for element " + this + " of type " + this.getClass() + " node = " + getNode());
|
||||
" for element " + this + " of type " + this.getClass() + " node = " + getNode());
|
||||
}
|
||||
return (KtFile) file;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user