Show shader method out/inout qualifier in intellisense

This commit is contained in:
Yuri Roubinsky 2020-03-18 15:43:05 +03:00
parent 602d0d2785
commit 387d6859d7
1 changed files with 22 additions and 0 deletions

View File

@ -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) {