mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
NonProjectFileWritingAccessProvider — do not use Project.DIRECTORY_STORE_FOLDER
This commit is contained in:
@@ -226,7 +226,7 @@ abstract class ProjectStoreBase(override final val project: ProjectImpl) : Compo
|
||||
|
||||
val filePath = file.path
|
||||
if (!isDirectoryBased) {
|
||||
return filePath == projectFilePath
|
||||
return filePath == projectFilePath || filePath == workspaceFilePath
|
||||
}
|
||||
return FileUtil.isAncestor(PathUtilRt.getParentPath(projectFilePath), filePath, false)
|
||||
}
|
||||
|
||||
+3
-9
@@ -150,17 +150,11 @@ public class NonProjectFileWritingAccessProvider extends WritingAccessProvider {
|
||||
if (!Registry.is("ide.hide.excluded.files") && fileIndex.isExcluded(file) && !fileIndex.isUnderIgnored(file)) return true;
|
||||
|
||||
if (project instanceof ProjectEx && !project.isDefault()) {
|
||||
if (ProjectKt.isDirectoryBased(project)) {
|
||||
VirtualFile baseDir = project.getBaseDir();
|
||||
VirtualFile dotIdea = baseDir == null ? null : baseDir.findChild(Project.DIRECTORY_STORE_FOLDER);
|
||||
if (dotIdea != null && VfsUtilCore.isAncestor(dotIdea, file, false)) return true;
|
||||
}
|
||||
|
||||
IProjectStore store = ProjectKt.getStateStore(project);
|
||||
String filePath = file.getPath();
|
||||
if (FileUtil.namesEqual(filePath, store.getWorkspaceFilePath()) || FileUtil.namesEqual(filePath, store.getProjectFilePath())) {
|
||||
if (ProjectKt.getStateStore(project).isProjectFile(file)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
String filePath = file.getPath();
|
||||
for (Module module : ModuleManager.getInstance(project).getModules()) {
|
||||
if (FileUtil.namesEqual(filePath, module.getModuleFilePath())) {
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user