From 4eda366db441a472fd67a4adf7b1e348e8752c6e Mon Sep 17 00:00:00 2001 From: RUSShyTwo <94763084+RUSShyTwo@users.noreply.github.com> Date: Mon, 22 Nov 2021 21:41:20 +0100 Subject: [PATCH] Symbols that call a function aren't relevant for the completion list --- src/dcd/server/autocomplete/complete.d | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/dcd/server/autocomplete/complete.d b/src/dcd/server/autocomplete/complete.d index c346e27..e9798e0 100644 --- a/src/dcd/server/autocomplete/complete.d +++ b/src/dcd/server/autocomplete/complete.d @@ -664,7 +664,18 @@ bool mightBeRelevantInCompletionScope(const DSymbol* symbol, Scope* scope_) // scope is the scope of the current file so if the symbol is not in there, it's not accessible return false; } - + if (symbol.kind == CompletionKind.functionName && !symbol.type) + { + // if it's a function and is isn't represented by a type + // that mean it is a symbol that calls the function + // so we can just ignore it + // eg: + // void test(){} + // + // te <--- cursor here, the symbol will be the line bellow, it's useless, just show the actual function + // test(); + return false; + } return true; }