Skip to content

Commit bc0342b

Browse files
committed
Merge pull request godotengine#111290 from HolonProduction/lsp-restart
LSP: Fix repeated restart attempts
2 parents 900bd07 + 400c77f commit bc0342b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

modules/gdscript/language_server/gdscript_language_server.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ void GDScriptLanguageServer::_notification(int p_what) {
5656
} break;
5757

5858
case NOTIFICATION_INTERNAL_PROCESS: {
59-
if (!started && EditorNode::get_singleton()->is_editor_ready()) {
59+
if (!start_attempted && EditorNode::get_singleton()->is_editor_ready()) {
60+
start_attempted = true;
6061
start();
6162
}
6263

modules/gdscript/language_server/gdscript_language_server.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ class GDScriptLanguageServer : public EditorPlugin {
4141

4242
Thread thread;
4343
bool thread_running = false;
44+
// There is no notification when the editor is initialized. We need to poll till we attempted to start the server.
45+
bool start_attempted = false;
4446
bool started = false;
4547
bool use_thread = false;
4648
String host = "127.0.0.1";

0 commit comments

Comments
 (0)