From b3762622be3a91988d810f2e5aff1cb8f738d898 Mon Sep 17 00:00:00 2001 From: Ignacio Etcheverry Date: Fri, 4 Sep 2020 01:31:17 +0200 Subject: [PATCH] [3.2] C#: Fix Godot failing to find class namespace Also avoid searching C# files recursively twice. --- .../editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs | 2 +- modules/mono/editor/GodotTools/GodotTools/CsProjOperations.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs index 5b04c8b8131..3e2d5d803e7 100644 --- a/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs +++ b/modules/mono/editor/GodotTools/GodotTools.ProjectEditor/ProjectUtils.cs @@ -178,7 +178,7 @@ namespace GodotTools.ProjectEditor if (root.AreDefaultCompileItemsEnabled()) { var excluded = new List(); - result = GetAllFilesRecursive(Path.GetDirectoryName(projectPath), "*.cs").ToList(); + result.AddRange(existingFiles); foreach (var item in root.Items) { diff --git a/modules/mono/editor/GodotTools/GodotTools/CsProjOperations.cs b/modules/mono/editor/GodotTools/GodotTools/CsProjOperations.cs index a8afb387282..1d800b81512 100644 --- a/modules/mono/editor/GodotTools/GodotTools/CsProjOperations.cs +++ b/modules/mono/editor/GodotTools/GodotTools/CsProjOperations.cs @@ -48,7 +48,7 @@ namespace GodotTools var firstMatch = classes.FirstOrDefault(classDecl => classDecl.BaseCount != 0 && // If it doesn't inherit anything, it can't be a Godot.Object. - classDecl.SearchName != searchName // Filter by the name we're looking for + classDecl.SearchName == searchName // Filter by the name we're looking for ); if (firstMatch == null)