Skip to content

Commit 4a90220

Browse files
committed
Merge pull request #107852 from HolonProduction/completion-filter-current-impl
Autocompletion: Don't filter overrides when the existing function is the current one
2 parents 1632c98 + 991c1a8 commit 4a90220

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

modules/gdscript/gdscript_editor.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3567,7 +3567,11 @@ ::Error GDScriptLanguage::complete_code(const String &p_code, const String &p_pa
35673567
continue;
35683568
}
35693569

3570-
if (options.has(member.function->identifier->name) || completion_context.current_class->has_function(member.function->identifier->name)) {
3570+
if (options.has(member.function->identifier->name)) {
3571+
continue;
3572+
}
3573+
3574+
if (completion_context.current_class->has_function(member.get_name()) && completion_context.current_class->get_member(member.get_name()).function != function_node) {
35713575
continue;
35723576
}
35733577

@@ -3611,7 +3615,10 @@ ::Error GDScriptLanguage::complete_code(const String &p_code, const String &p_pa
36113615
}
36123616

36133617
for (const MethodInfo &mi : virtual_methods) {
3614-
if (options.has(mi.name) || completion_context.current_class->has_function(mi.name)) {
3618+
if (options.has(mi.name)) {
3619+
continue;
3620+
}
3621+
if (completion_context.current_class->has_function(mi.name) && completion_context.current_class->get_member(mi.name).function != function_node) {
36153622
continue;
36163623
}
36173624
String method_hint = mi.name;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
scene="res://completion/get_node/get_node.tscn"
2+
[output]
3+
include=[
4+
{"display": "_get(property: StringName) -> Variant:"},
5+
]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
extends Object
2+
3+
func _get

0 commit comments

Comments
 (0)