소스 검색

Merge pull request #111290 from HolonProduction/lsp-restart

LSP: Fix repeated restart attempts
Rémi Verschelde 1 주 전
부모
커밋
bc0342b3ef
2개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      modules/gdscript/language_server/gdscript_language_server.cpp
  2. 2 0
      modules/gdscript/language_server/gdscript_language_server.h

+ 2 - 1
modules/gdscript/language_server/gdscript_language_server.cpp

@@ -56,7 +56,8 @@ void GDScriptLanguageServer::_notification(int p_what) {
 		} break;
 
 		case NOTIFICATION_INTERNAL_PROCESS: {
-			if (!started && EditorNode::get_singleton()->is_editor_ready()) {
+			if (!start_attempted && EditorNode::get_singleton()->is_editor_ready()) {
+				start_attempted = true;
 				start();
 			}
 

+ 2 - 0
modules/gdscript/language_server/gdscript_language_server.h

@@ -41,6 +41,8 @@ class GDScriptLanguageServer : public EditorPlugin {
 
 	Thread thread;
 	bool thread_running = false;
+	// There is no notification when the editor is initialized. We need to poll till we attempted to start the server.
+	bool start_attempted = false;
 	bool started = false;
 	bool use_thread = false;
 	String host = "127.0.0.1";