Browse Source

Merge pull request #32667 from GodotExplorer/lsp-fix-native-func-sign

LSP: Fix signature of void returned functions in native methods
Rémi Verschelde 6 năm trước cách đây
mục cha
commit
b540d17fe3
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      modules/gdscript/language_server/gdscript_workspace.cpp

+ 5 - 1
modules/gdscript/language_server/gdscript_workspace.cpp

@@ -269,7 +269,11 @@ Error GDScriptWorkspace::initialize() {
 				params += params.empty() ? "..." : ", ...";
 			}
 
-			symbol.detail = "func " + class_name + "." + data.name + "(" + params + ") -> " + data.return_type;
+			String return_type = data.return_type;
+			if (return_type.empty()) {
+				return_type = "void";
+			}
+			symbol.detail = "func " + class_name + "." + data.name + "(" + params + ") -> " + return_type;
 			symbol.documentation = data.description;
 			class_symbol.children.push_back(symbol);
 		}