From 9a4a4f4074e3bee97e46353cb09e9dc8855aca1b Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 16 Jul 2018 00:38:56 +0200 Subject: [PATCH] Skip duplicate call signatures I am seeing `p` twice for os.path.dirname, which seems to come from Lib/posixpath.py and Lib/ntpath.py, as can be seen with `os.path.join`, where I still see two with this patch: ``` (path, *paths) import os (a, *p) os.path.join() ``` --- pythonx/jedi_vim.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pythonx/jedi_vim.py b/pythonx/jedi_vim.py index be42671..b88f439 100644 --- a/pythonx/jedi_vim.py +++ b/pythonx/jedi_vim.py @@ -475,6 +475,7 @@ def show_call_signatures(signatures=()): if int(vim_eval("g:jedi#show_call_signatures")) == 2: return cmdline_call_signatures(signatures) + seen_sigs = [] for i, signature in enumerate(signatures): line, column = signature.bracket_start # signatures are listed above each other @@ -497,6 +498,11 @@ def show_call_signatures(signatures=()): except (IndexError, TypeError): pass + # Skip duplicates. + if params in seen_sigs: + continue + seen_sigs.append(params) + # This stuff is reaaaaally a hack! I cannot stress enough, that # this is a stupid solution. But there is really no other yet. # There is no possibility in VIM to draw on the screen, but there