mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
replace too long paths with "current" (IDEA-63015)
This commit is contained in:
@@ -440,10 +440,12 @@ public class AnalysisScope {
|
||||
return AnalysisScopeBundle.message("scope.project", myProject.getName());
|
||||
|
||||
case FILE:
|
||||
return AnalysisScopeBundle.message("scope.file", ProjectUtil.calcRelativeToProjectPath(((PsiFileSystemItem)myElement).getVirtualFile(), myElement.getProject()));
|
||||
final String relativePath = getRelativePath();
|
||||
return relativePath != null ? AnalysisScopeBundle.message("scope.file", relativePath) : "Current File";
|
||||
|
||||
case DIRECTORY:
|
||||
return AnalysisScopeBundle.message("scope.directory", ProjectUtil.calcRelativeToProjectPath(((PsiFileSystemItem)myElement).getVirtualFile(), myElement.getProject()));
|
||||
final String relativeDirPath = getRelativePath();
|
||||
return relativeDirPath != null ? AnalysisScopeBundle.message("scope.directory", relativeDirPath) : "Current Directory";
|
||||
|
||||
|
||||
case VIRTUAL_FILES:
|
||||
@@ -453,6 +455,15 @@ public class AnalysisScope {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private String getRelativePath() {
|
||||
final String relativePath = ProjectUtil.calcRelativeToProjectPath(((PsiFileSystemItem)myElement).getVirtualFile(), myElement.getProject());
|
||||
if (relativePath.length() > 100) {
|
||||
return null;
|
||||
}
|
||||
return relativePath;
|
||||
}
|
||||
|
||||
private static String pathToName(String path) {
|
||||
String name = path;
|
||||
if (path != null) {
|
||||
|
||||
Reference in New Issue
Block a user