summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2023-07-03 15:51:30 +0200
committerGitHub <noreply@github.com>2023-07-03 15:51:30 +0200
commite044e13d5a77bcecb9a5c97f94065fcf5dd0ce30 (patch)
treee0ae6d41fc5e8b2f12c2b857ce685a63d93a3b7d
parent73a529df4cf164fa892b4ce9520be27c592afe9c (diff)
parent22aad32c69de6ef500ba8327bb9b8a09c071f45e (diff)
downloadredot-engine-e044e13d5a77bcecb9a5c97f94065fcf5dd0ce30.tar.gz
Merge pull request #78928 from neikeq/issue-78913
C#: Fix NodePaths completion error for not calling from main thread
-rw-r--r--modules/mono/editor/GodotTools/GodotTools/Ides/MessagingServer.cs7
1 files changed, 5 insertions, 2 deletions
diff --git a/modules/mono/editor/GodotTools/GodotTools/Ides/MessagingServer.cs b/modules/mono/editor/GodotTools/GodotTools/Ides/MessagingServer.cs
index 62db6e3af5..51c7a8aa22 100644
--- a/modules/mono/editor/GodotTools/GodotTools/Ides/MessagingServer.cs
+++ b/modules/mono/editor/GodotTools/GodotTools/Ides/MessagingServer.cs
@@ -385,9 +385,12 @@ namespace GodotTools.Ides
// However, it doesn't fix resource loading if the rest of the path is also case insensitive.
string scriptFileLocalized = FsPathUtils.LocalizePathWithCaseChecked(request.ScriptFile);
+ // The node API can only be called from the main thread.
+ await Godot.Engine.GetMainLoop().ToSignal(Godot.Engine.GetMainLoop(), "process_frame");
+
var response = new CodeCompletionResponse { Kind = request.Kind, ScriptFile = request.ScriptFile };
- response.Suggestions = await Task.Run(() =>
- Internal.CodeCompletionRequest(response.Kind, scriptFileLocalized ?? request.ScriptFile));
+ response.Suggestions = Internal.CodeCompletionRequest(response.Kind,
+ scriptFileLocalized ?? request.ScriptFile);
return response;
}
}