Skip to content

Commit 43673a0

Browse files
committed
Fixed declaration file errors
- Added checks for multiline comment endings - Added exception for KEY_MASK_CMD due to missing value
1 parent 6910e00 commit 43673a0

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tools/editor_tools.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ static String format_doc_text(const String &p_bbcode, const String &p_indent = "
156156
line = line.replace("[constant ", "`");
157157
line = line.replace("[", "`");
158158
line = line.replace("]", "`");
159+
line = line.replace("*/", "* /"); // To solve issues with accidental multiline comment ends
159160
}
160161

161162
if (!in_code_block && i < lines.size() - 1) {
@@ -606,6 +607,21 @@ void ECMAScriptPlugin::_export_typescript_declare_file(const String &p_path) {
606607
dict["description"] = format_doc_text(enums[i]->description, "\t\t\t ");
607608
dict["name"] = format_property_name(enums[i]->name);
608609
dict["value"] = enums[i]->value;
610+
611+
// Exceptions
612+
613+
/**
614+
* KEY_MASK_CMD docs has value listed as "platform-dependent",
615+
* so the actual values have to be manually changed depending on the platform.
616+
*/
617+
if (dict["name"] == "KEY_MASK_CMD") {
618+
#ifdef APPLE_STYLE_KEYS
619+
dict["value"] = (1 << 27);
620+
#else
621+
dict["value"] = (1 << 28);
622+
#endif
623+
}
624+
609625
enum_str += apply_pattern(const_str, dict);
610626
}
611627
enum_str += "\t}\n";

0 commit comments

Comments
 (0)