From eb481198218399c9f86e5bfe1879757e1aa9a86e Mon Sep 17 00:00:00 2001 From: George Marques Date: Sun, 1 Jul 2018 13:17:40 -0300 Subject: [PATCH] Added system for GDScript warnings - Count and panel per script. - Ability to disable warnings per script using special comments. - Ability to disable warnings globally using Project Settings. - Option to treat enabled warnings as errors. --- core/script_language.h | 9 +- editor/code_editor.cpp | 23 + editor/code_editor.h | 4 + editor/plugins/script_text_editor.cpp | 75 ++- editor/plugins/script_text_editor.h | 3 + .../gdnative/nativescript/nativescript.cpp | 2 +- modules/gdnative/nativescript/nativescript.h | 2 +- .../pluginscript/pluginscript_language.cpp | 2 +- .../pluginscript/pluginscript_language.h | 2 +- modules/gdscript/gdscript.cpp | 172 +++++++ modules/gdscript/gdscript.h | 45 +- modules/gdscript/gdscript_editor.cpp | 15 +- modules/gdscript/gdscript_parser.cpp | 429 ++++++++++++++++-- modules/gdscript/gdscript_parser.h | 24 + modules/gdscript/gdscript_tokenizer.cpp | 21 +- modules/gdscript/gdscript_tokenizer.h | 22 + modules/mono/csharp_script.h | 2 +- modules/visual_script/visual_script.cpp | 2 +- modules/visual_script/visual_script.h | 2 +- 19 files changed, 810 insertions(+), 46 deletions(-) diff --git a/core/script_language.h b/core/script_language.h index 4e81b9b6263..71d550d4046 100644 --- a/core/script_language.h +++ b/core/script_language.h @@ -207,13 +207,20 @@ public: virtual void finish() = 0; /* EDITOR FUNCTIONS */ + struct Warning { + int line; + int code; + String string_code; + String message; + }; + virtual void get_reserved_words(List *p_words) const = 0; virtual void get_comment_delimiters(List *p_delimiters) const = 0; virtual void get_string_delimiters(List *p_delimiters) const = 0; virtual Ref