From 7d3fd315d34b77a36133460553382bff1298e159 Mon Sep 17 00:00:00 2001 From: David Halter Date: Wed, 19 Dec 2012 01:55:32 +0100 Subject: [PATCH] dots without any other actual relevant code shouldn't just complete, fixes #46 --- jedi/api.py | 2 ++ test/completion/basic.py | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/jedi/api.py b/jedi/api.py index 3b49b40e..535df83a 100644 --- a/jedi/api.py +++ b/jedi/api.py @@ -108,6 +108,8 @@ class Script(object): debug.speed('complete start') path = self.module.get_path_until_cursor() + if re.search('^\.|\.\.$', path): + return [] path, dot, like = self._get_completion_parts(path) try: diff --git a/test/completion/basic.py b/test/completion/basic.py index 526d1bbc..26d59cf7 100644 --- a/test/completion/basic.py +++ b/test/completion/basic.py @@ -9,6 +9,16 @@ int() int(str) +# ----------------- +# should not complete +# ----------------- +#? [] +. +#? [] +str.. +#? [] +a(0):. + # ----------------- # if/else/elif # -----------------