You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
Consolidate JSON, JSONParseResults and JSONParser into JSON
Renames JSON.parse_string() to parse() Renames JSON.decode_data() to stringify()
This commit is contained in:
@@ -32,7 +32,6 @@
|
||||
|
||||
#include "../gdscript.h"
|
||||
#include "../gdscript_analyzer.h"
|
||||
#include "core/io/json.h"
|
||||
#include "gdscript_language_protocol.h"
|
||||
#include "gdscript_workspace.h"
|
||||
|
||||
@@ -183,7 +182,7 @@ void ExtendGDScriptParser::parse_class_symbol(const GDScriptParser::ClassNode *p
|
||||
symbol.detail += ": " + m.get_datatype().to_string();
|
||||
}
|
||||
if (m.variable->initializer != nullptr && m.variable->initializer->is_constant) {
|
||||
symbol.detail += " = " + JSON::print(m.variable->initializer->reduced_value);
|
||||
symbol.detail += " = " + m.variable->initializer->reduced_value.to_json_string();
|
||||
}
|
||||
|
||||
symbol.documentation = parse_documentation(LINE_NUMBER_TO_INDEX(m.variable->start_line));
|
||||
@@ -224,10 +223,10 @@ void ExtendGDScriptParser::parse_class_symbol(const GDScriptParser::ClassNode *p
|
||||
}
|
||||
}
|
||||
} else {
|
||||
value_text = JSON::print(default_value);
|
||||
value_text = default_value.to_json_string();
|
||||
}
|
||||
} else {
|
||||
value_text = JSON::print(default_value);
|
||||
value_text = default_value.to_json_string();
|
||||
}
|
||||
if (!value_text.is_empty()) {
|
||||
symbol.detail += " = " + value_text;
|
||||
@@ -353,8 +352,7 @@ void ExtendGDScriptParser::parse_function_symbol(const GDScriptParser::FunctionN
|
||||
parameters += ": " + parameter->get_datatype().to_string();
|
||||
}
|
||||
if (parameter->default_value != nullptr) {
|
||||
String value = JSON::print(parameter->default_value->reduced_value);
|
||||
parameters += " = " + value;
|
||||
parameters += " = " + parameter->default_value->reduced_value.to_json_string();
|
||||
}
|
||||
}
|
||||
r_symbol.detail += parameters + ")";
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#include "gdscript_language_protocol.h"
|
||||
|
||||
#include "core/config/project_settings.h"
|
||||
#include "core/io/json.h"
|
||||
#include "editor/doc_tools.h"
|
||||
#include "editor/editor_log.h"
|
||||
#include "editor/editor_node.h"
|
||||
@@ -194,7 +193,7 @@ Dictionary GDScriptLanguageProtocol::initialize(const Dictionary &p_params) {
|
||||
vformat("GDScriptLanguageProtocol: Can't initialize invalid peer '%d'.", latest_client_id));
|
||||
Ref<LSPeer> peer = clients.get(latest_client_id);
|
||||
if (peer != nullptr) {
|
||||
String msg = JSON::print(request);
|
||||
String msg = Variant(request).to_json_string();
|
||||
msg = format_output(msg);
|
||||
(*peer)->res_queue.push_back(msg.utf8());
|
||||
}
|
||||
@@ -280,7 +279,7 @@ void GDScriptLanguageProtocol::notify_client(const String &p_method, const Varia
|
||||
ERR_FAIL_COND(peer == nullptr);
|
||||
|
||||
Dictionary message = make_notification(p_method, p_params);
|
||||
String msg = JSON::print(message);
|
||||
String msg = Variant(message).to_json_string();
|
||||
msg = format_output(msg);
|
||||
peer->res_queue.push_back(msg.utf8());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user