Skip to content

Commit 991c1a8

Browse files
Autocompletion: Don't filter overrides when the existing function is the current one
1 parent d7bdc0b commit 991c1a8

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
@@ -3558,7 +3558,11 @@ ::Error GDScriptLanguage::complete_code(const String &p_code, const String &p_pa
35583558
continue;
35593559
}
35603560

3561-
if (options.has(member.function->identifier->name) || completion_context.current_class->has_function(member.function->identifier->name)) {
3561+
if (options.has(member.function->identifier->name)) {
3562+
continue;
3563+
}
3564+
3565+
if (completion_context.current_class->has_function(member.get_name()) && completion_context.current_class->get_member(member.get_name()).function != function_node) {
35623566
continue;
35633567
}
35643568

@@ -3602,7 +3606,10 @@ ::Error GDScriptLanguage::complete_code(const String &p_code, const String &p_pa
36023606
}
36033607

36043608
for (const MethodInfo &mi : virtual_methods) {
3605-
if (options.has(mi.name) || completion_context.current_class->has_function(mi.name)) {
3609+
if (options.has(mi.name)) {
3610+
continue;
3611+
}
3612+
if (completion_context.current_class->has_function(mi.name) && completion_context.current_class->get_member(mi.name).function != function_node) {
36063613
continue;
36073614
}
36083615
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)