Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLluis Sanchez <lluis@xamarin.com>2019-09-17 13:30:06 +0300
committerGitHub <noreply@github.com>2019-09-17 13:30:06 +0300
commitcd3bdcf6caf35ebefdf67252747bbed3eef89eaa (patch)
tree6c3a2ae9d60650c92237fdcbf6d1e9f2d0a6a037
parentbfcb4f851ddbaf6c4d50909ec479a8d1127ef635 (diff)
parent6218f40c9b10135356c08e0f047e73bdca1185f3 (diff)
Merge pull request #8738 from mono/backport-pr-8730-to-release-8.3
[release-8.3] [FileNesting] Avoid computing file nesting tree for all projects
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.FileNesting/FileNestingService.cs16
1 files changed, 12 insertions, 4 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.FileNesting/FileNestingService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.FileNesting/FileNestingService.cs
index 53536d493d..473affb4e5 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.FileNesting/FileNestingService.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.FileNesting/FileNestingService.cs
@@ -95,17 +95,26 @@ namespace MonoDevelop.Ide.Projects.FileNesting
public static ProjectFile GetParentFile (ProjectFile inputFile)
{
+ if (!AppliesToProject (inputFile.Project)) {
+ return null;
+ }
return GetProjectNestingInfo (inputFile.Project).GetParentForFile (inputFile);
}
public static bool HasChildren (ProjectFile inputFile)
{
+ if (!AppliesToProject (inputFile.Project)) {
+ return false;
+ }
var children = GetProjectNestingInfo (inputFile.Project).GetChildrenForFile (inputFile);
return (children?.Count ?? 0) > 0;
}
public static ProjectFileCollection GetChildren (ProjectFile inputFile)
{
+ if (!AppliesToProject (inputFile.Project)) {
+ return null;
+ }
return GetProjectNestingInfo (inputFile.Project).GetChildrenForFile (inputFile);
}
}
@@ -229,10 +238,9 @@ namespace MonoDevelop.Ide.Projects.FileNesting
void NotifyNestingRulesChanged (ProjectFileNestingInfo nestingInfo)
{
- if (nestingInfo == null || !FileNestingService.AppliesToProject (nestingInfo.File.Project))
- return;
-
- FileNestingService.NotifyNestingRulesChanged (nestingInfo.File, nestingInfo.Parent);
+ if (fileNestingEnabled) {
+ FileNestingService.NotifyNestingRulesChanged (nestingInfo.File, nestingInfo.Parent);
+ }
}
void OnUserPropertiesChanged (object sender, Core.PropertyBagChangedEventArgs e)