diff options
author | Lluis Sanchez <lluis@xamarin.com> | 2019-09-17 13:29:49 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-17 13:29:49 +0300 |
commit | b6cb10a856dee9245d5f74fb5209ced8f4643e9e (patch) | |
tree | dde43620fc8c90cbe5e4ed2162dd5aa2132d2e0e /main/src | |
parent | 265704b3fc3e0e3eddf1dffca4d35ba60c0018dd (diff) | |
parent | 2a3ba646e5b1f1c5487f6bd8739f4b4ef0034daa (diff) |
Merge pull request #8730 from mono/pr-avoid-file-nesting-for-all-projects
[FileNesting] Avoid computing file nesting tree for all projects
Diffstat (limited to 'main/src')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects.FileNesting/FileNestingService.cs | 16 |
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) |