String (@NotNull VirtualFile file) { if (file.getLength() <= MAX_PREVIEW_LENGTH) { try { return StringUtil.convertLineSeparators(VfsUtilCore.loadText(file)); } catch (IOException e) { // Ignore } } Language language = getLanguage(file); if (language != null) { LanguageCodeStyleSettingsProvider provider = LanguageCodeStyleSettingsProvider.forLanguage(language); if (provider != null) { String sample = provider.getCodeSample(LanguageCodeStyleSettingsProvider.SettingsType.INDENT_SETTINGS); if (sample != null) return sample; } } return "No preview"; }