You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Remove incorrect items from completion of main functions in shader
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user