Skip to content

Commit

Permalink
Remove incorrect items from completion of main functions in shader
Browse files Browse the repository at this point in the history
  • Loading branch information
Chaosus committed Jan 24, 2022
1 parent 31a7ddb commit 0e66587
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions servers/rendering/shader_language.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 0e66587

Please sign in to comment.