TextWithImports (@Nullable XExpression expression) { if (expression == null) return null; if (expression.getCustomInfo() == null && expression.getLanguage() == null) { return new TextWithImportsImpl(getKind(expression.getMode()), expression.getExpression()); } else { return new TextWithImportsImpl(getKind(expression.getMode()), expression.getExpression(), StringUtil.notNullize(expression.getCustomInfo()), LanguageUtil.getLanguageFileType(expression.getLanguage())); } }