summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Roubinsky <chaosus89@gmail.com>2020-03-18 16:27:48 +0300
committerGitHub <noreply@github.com>2020-03-18 16:27:48 +0300
commitcc8d21a4215ea6f747aa03fde73a8cb5a02dc89c (patch)
treea7f441803036c1a02850ef7456b3af3f63942dbc
parentf62fc10bb63935169b894cf1ee0ae434be956628 (diff)
parent387d6859d72f2214e6c4c5fbde0162df02a53a24 (diff)
Merge pull request #37142 from Chaosus/shader_qual
Show shader method out/inout qualifier in intellisense
-rw-r--r--servers/visual/shader_language.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp
index 8e11ac3e2e..e73f8b8fc4 100644
--- a/servers/visual/shader_language.cpp
+++ b/servers/visual/shader_language.cpp
@@ -6805,6 +6805,14 @@ Error ShaderLanguage::complete(const String &p_code, const Map<StringName, Funct
calltip += CharType(0xFFFF);
}
+ if (shader->functions[i].function->arguments[j].qualifier != ArgumentQualifier::ARGUMENT_QUALIFIER_IN) {
+ if (shader->functions[i].function->arguments[j].qualifier == ArgumentQualifier::ARGUMENT_QUALIFIER_OUT) {
+ calltip += "out ";
+ } else { // ArgumentQualifier::ARGUMENT_QUALIFIER_INOUT
+ calltip += "inout ";
+ }
+ }
+
calltip += get_datatype_name(shader->functions[i].function->arguments[j].type);
calltip += " ";
calltip += shader->functions[i].function->arguments[j].name;
@@ -6835,6 +6843,16 @@ Error ShaderLanguage::complete(const String &p_code, const Map<StringName, Funct
continue;
}
+ int idx2 = 0;
+ int out_arg = -1;
+ while (builtin_func_out_args[idx2].name != nullptr) {
+ if (builtin_func_out_args[idx2].name == builtin_func_defs[idx].name) {
+ out_arg = builtin_func_out_args[idx2].argument;
+ break;
+ }
+ idx2++;
+ }
+
if (completion_function == builtin_func_defs[idx].name) {
if (builtin_func_defs[idx].tag != completion_class) {
@@ -6865,6 +6883,10 @@ Error ShaderLanguage::complete(const String &p_code, const Map<StringName, Funct
calltip += CharType(0xFFFF);
}
+ if (out_arg >= 0 && i == out_arg) {
+ calltip += "out ";
+ }
+
calltip += get_datatype_name(builtin_func_defs[idx].args[i]);
if (i == completion_argument) {