diff --git a/jedi/parsing.py b/jedi/parsing.py index 739a8649..e8721a73 100644 --- a/jedi/parsing.py +++ b/jedi/parsing.py @@ -1426,6 +1426,11 @@ class PyFuzzyParser(object): else: token_type, tok = self.next() + while token_type == tokenize.COMMENT: + # remove newline and comment + self.next() + token_type, tok = self.next() + first_pos = self.start_pos opening_brackets = ['{', '(', '['] closing_brackets = ['}', ')', ']'] diff --git a/test/completion/functions.py b/test/completion/functions.py index c44560c5..193ffa8d 100644 --- a/test/completion/functions.py +++ b/test/completion/functions.py @@ -38,6 +38,14 @@ def variable_rename(param): #? int() variable_rename(1) +def multi_line_func(a, # comment blabla + + b): + return b + +#? str() +multi_line_func(1,'') + # ----------------- # double execution # ----------------- diff --git a/test/completion/thirdparty/pylab_.py b/test/completion/thirdparty/pylab_.py index f16b0f2e..7e27641d 100644 --- a/test/completion/thirdparty/pylab_.py +++ b/test/completion/thirdparty/pylab_.py @@ -1,5 +1,4 @@ import pylab -pylab. # two gotos #! ['module numpy'] @@ -29,3 +28,7 @@ import numpy na = numpy.array([1,2]) #? ['shape'] na.shape + +fig = pylab.figure() +#! +fig.add_subplot