String (boolean addGeneralInfo) { StringBuilder output = new StringBuilder(); FileEditorManagerImpl fileEditorManager = (FileEditorManagerImpl)FileEditorManager.getInstance(project); VirtualFile baseDir = ProjectUtil.guessProjectDir(project); if (baseDir != null) { Holder holder = analyzeFiles(baseDir); output.append("Filesystem Info:\n"); output.append("File system is case sensitive: ").append(baseDir.getFileSystem().isCaseSensitive()).append('\n'); output.append("File is case sensitive: ").append(baseDir.isCaseSensitive()).append('\n'); output.append("Are there symlinks: ").append(holder.isSymlink()).append('\n'); output.append("Number of files: ").append(holder.getNumOfFiles()).append('\n'); output.append('\n'); } output.append("Project Info:\n"); output.append("Number of opened files: ").append(fileEditorManager.getOpenedFiles().size()).append('\n'); ReadAction.run(() -> { Editor selectedTextEditor = fileEditorManager.getSelectedTextEditor(true); if (selectedTextEditor != null) { Document document = selectedTextEditor.getDocument(); output.append("File size (in lines): ").append(document.getLineCount()).append('\n'); output.append("File size in characters: ").append(document.getTextLength()).append('\n'); PsiFile psiFile = PsiDocumentManager.getInstance(project).getPsiFile(document); if (psiFile != null) { output.append("Number of injections: ") .append(InjectedLanguageManager.getInstance(project).getCachedInjectedDocumentsInRange(psiFile, psiFile .getTextRange()).size()).append('\n'); } } }); if (addGeneralInfo) { output.append('\n'); output.append(new CompositeGeneralTroubleInfoCollector().collectInfo(project)); } return output.toString(); }