Skip to content

Commit 7bc2a92

Browse files
authored
Merge pull request #135 from poohcom1/fix-declaration-file
Fixed declaration file errors
2 parents 6910e00 + 2a4af4f commit 7bc2a92

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tools/editor_tools.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "editor_tools.h"
22
#include "../ecmascript_language.h"
33
#include "core/math/expression.h"
4+
#include "core/os/keyboard.h"
45
#include "editor/filesystem_dock.h"
56

67
#define TS_IGNORE "//@ts-ignore\n"
@@ -156,6 +157,7 @@ static String format_doc_text(const String &p_bbcode, const String &p_indent = "
156157
line = line.replace("[constant ", "`");
157158
line = line.replace("[", "`");
158159
line = line.replace("]", "`");
160+
line = line.replace("*/", "* /"); // To solve issues with accidental multiline comment ends
159161
}
160162

161163
if (!in_code_block && i < lines.size() - 1) {
@@ -606,6 +608,17 @@ void ECMAScriptPlugin::_export_typescript_declare_file(const String &p_path) {
606608
dict["description"] = format_doc_text(enums[i]->description, "\t\t\t ");
607609
dict["name"] = format_property_name(enums[i]->name);
608610
dict["value"] = enums[i]->value;
611+
612+
// Exceptions
613+
614+
/**
615+
* KEY_MASK_CMD docs has value listed as "platform-dependent",
616+
* so we have to retreive the actual value manually
617+
*/
618+
if (dict["name"] == "KEY_MASK_CMD") {
619+
dict["value"] = KEY_MASK_CMD;
620+
}
621+
609622
enum_str += apply_pattern(const_str, dict);
610623
}
611624
enum_str += "\t}\n";

0 commit comments

Comments
 (0)