From 44d676570d7634759ec8ba9bdb1bc375fa0086fe Mon Sep 17 00:00:00 2001 From: Nicolas Merget Date: Wed, 25 Sep 2024 00:03:00 +0200 Subject: [PATCH] feat: open .mjs files generated from .ts file inside external editor --- ...criptInternal.svg => JavaScriptModule.svg} | 0 javascript.h | 1 + src/language/javascript_todo_texteditor.cpp | 75 ++++++++++++++++++- 3 files changed, 74 insertions(+), 2 deletions(-) rename icons/{JavaScriptInternal.svg => JavaScriptModule.svg} (100%) diff --git a/icons/JavaScriptInternal.svg b/icons/JavaScriptModule.svg similarity index 100% rename from icons/JavaScriptInternal.svg rename to icons/JavaScriptModule.svg diff --git a/javascript.h b/javascript.h index 98bfc4eb..68c7eb30 100644 --- a/javascript.h +++ b/javascript.h @@ -14,6 +14,7 @@ #define EXT_TSCLASS "ts" #define EXT_JSMODULE "js" #define EXT_JSON "json" +#define EXT_GENERATE "//generatedPath=" class JavaScript : public Script { GDCLASS(JavaScript, Script); diff --git a/src/language/javascript_todo_texteditor.cpp b/src/language/javascript_todo_texteditor.cpp index c8d2dec1..e3702ae9 100644 --- a/src/language/javascript_todo_texteditor.cpp +++ b/src/language/javascript_todo_texteditor.cpp @@ -2,13 +2,84 @@ #include "javascript_language.h" +#include +#include +#include + int JavaScriptLanguage::find_function(const String &p_function, const String &p_code) const { return -1; } String JavaScriptLanguage::make_function(const String &p_class, const String &p_name, const PackedStringArray &p_args) const { return ""; } void JavaScriptLanguage::auto_indent_code(String &p_code, int p_from_line, int p_to_line) const {} bool JavaScriptLanguage::supports_documentation() const { return false; } bool JavaScriptLanguage::can_inherit_from_file() const { return false; } -Error JavaScriptLanguage::open_in_external_editor(const Ref