Merge pull request #37171 from Chaosus/shader_fix_time
Fix shader TIME auto-completion
This commit is contained in:
commit
b0aecb466d
1 changed files with 20 additions and 11 deletions
|
@ -6722,18 +6722,27 @@ Error ShaderLanguage::complete(const String &p_code, const Map<StringName, Funct
|
|||
block = block->parent_block;
|
||||
}
|
||||
|
||||
if (comp_ident && skip_function != StringName() && p_functions.has(skip_function)) {
|
||||
|
||||
for (Map<StringName, BuiltInInfo>::Element *E = p_functions[skip_function].built_ins.front(); E; E = E->next()) {
|
||||
ScriptCodeCompletionOption::Kind kind = ScriptCodeCompletionOption::KIND_MEMBER;
|
||||
if (E->get().constant) {
|
||||
kind = ScriptCodeCompletionOption::KIND_CONSTANT;
|
||||
}
|
||||
matches.insert(E->key(), kind);
|
||||
}
|
||||
}
|
||||
|
||||
if (comp_ident) {
|
||||
if (p_functions.has("global")) {
|
||||
for (Map<StringName, BuiltInInfo>::Element *E = p_functions["global"].built_ins.front(); E; E = E->next()) {
|
||||
ScriptCodeCompletionOption::Kind kind = ScriptCodeCompletionOption::KIND_MEMBER;
|
||||
if (E->get().constant) {
|
||||
kind = ScriptCodeCompletionOption::KIND_CONSTANT;
|
||||
}
|
||||
matches.insert(E->key(), kind);
|
||||
}
|
||||
}
|
||||
|
||||
if (skip_function != StringName() && p_functions.has(skip_function)) {
|
||||
for (Map<StringName, BuiltInInfo>::Element *E = p_functions[skip_function].built_ins.front(); E; E = E->next()) {
|
||||
ScriptCodeCompletionOption::Kind kind = ScriptCodeCompletionOption::KIND_MEMBER;
|
||||
if (E->get().constant) {
|
||||
kind = ScriptCodeCompletionOption::KIND_CONSTANT;
|
||||
}
|
||||
matches.insert(E->key(), kind);
|
||||
}
|
||||
}
|
||||
|
||||
for (const Map<StringName, ShaderNode::Varying>::Element *E = shader->varyings.front(); E; E = E->next()) {
|
||||
matches.insert(E->key(), ScriptCodeCompletionOption::KIND_VARIABLE);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue