Merge pull request #57107 from Chaosus/shader_fix_completion
This commit is contained in:
commit
0d4b86a30c
@ -9060,6 +9060,19 @@ Error ShaderLanguage::complete(const String &p_code, const ShaderCompileInfo &p_
|
||||
} break;
|
||||
case COMPLETION_MAIN_FUNCTION: {
|
||||
for (const KeyValue<StringName, FunctionInfo> &E : p_info.functions) {
|
||||
if (!E.value.main_function) {
|
||||
continue;
|
||||
}
|
||||
bool found = false;
|
||||
for (int i = 0; i < shader->functions.size(); i++) {
|
||||
if (shader->functions[i].name == E.key) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (found) {
|
||||
continue;
|
||||
}
|
||||
ScriptCodeCompletionOption option(E.key, ScriptCodeCompletionOption::KIND_FUNCTION);
|
||||
r_options->push_back(option);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user