summaryrefslogtreecommitdiff
path: root/modules/gdscript
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-05-17 09:36:55 +0200
committerGitHub <noreply@github.com>2018-05-17 09:36:55 +0200
commitb0649d2718f48c812e29884c633a823b1cb78571 (patch)
treeaf387da3148b4ac5f6b287a2e9a8aca36d718f41 /modules/gdscript
parent5e20a229eb347058800d00b29ba63bb809aedca0 (diff)
parent825d49dfe24ca4ec39aa13dc134300180a3ff641 (diff)
Merge pull request #18405 from flashyincceo/gdscript-constants-help
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 87e1276492..30ef167466 100644
--- a/modules/gdscript/gdscript_editor.cpp
+++ b/modules/gdscript/gdscript_editor.cpp
@@ -2636,6 +2636,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);