summaryrefslogtreecommitdiff
path: root/modules/gdscript
diff options
context:
space:
mode:
authorPeter Folkins <folkins.peter@gmail.com>2018-04-24 20:50:21 -0500
committerPeter Folkins <folkins.peter@gmail.com>2018-04-24 20:50:21 -0500
commit825d49dfe24ca4ec39aa13dc134300180a3ff641 (patch)
tree7899dc4d90480c19ffa172eea330265d54d99a51 /modules/gdscript
parenta096df5e450ad028c1149b7378b65fd8a8c18b9c (diff)
Fix Ctrl+click on @GDScript constants
Diffstat (limited to 'modules/gdscript')
-rw-r--r--modules/gdscript/gdscript_editor.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp
index 0d52f0a995..6f4d62592e 100644
--- a/modules/gdscript/gdscript_editor.cpp
+++ b/modules/gdscript/gdscript_editor.cpp
@@ -2628,6 +2628,13 @@ Error GDScriptLanguage::lookup_code(const String &p_code, const String &p_symbol
}
}
+ if ("PI" == p_symbol || "TAU" == p_symbol || "INF" == p_symbol || "NAN" == p_symbol) {
+ r_result.type = ScriptLanguage::LookupResult::RESULT_CLASS_CONSTANT;
+ r_result.class_name = "@GDScript";
+ r_result.class_member = p_symbol;
+ return OK;
+ }
+
GDScriptParser p;
p.parse(p_code, p_base_path, false, "", true);