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:
authorRodrigo Moya <rodrigo.moya@xamarin.com>2019-09-15 12:37:10 +0300
committerRodrigo Moya <rodrigo.moya@xamarin.com>2019-09-16 20:56:57 +0300
commit2a3ba646e5b1f1c5487f6bd8739f4b4ef0034daa (patch)
tree3222ad84fd75ff14cd68a82757d24e9c3240cb13 /main/src/core/MonoDevelop.Ide
parentb7bf2893f20b01603c139a1b0573a4d50c00bf80 (diff)
[FileNesting] Avoid computing file nesting tree for all projects
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/982815
Diffstat (limited to 'main/src/core/MonoDevelop.Ide')
-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)