mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
C#: Fix NodePaths completion error for not calling from main thread
The node API we use for code completion changed and no longer allows being called from threads other than the main one.
This commit is contained in:
parent
46424488ed
commit
22aad32c69
1 changed files with 5 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue