diff --git a/jedi/fast_parser.py b/jedi/fast_parser.py index 05ed3e32..e748f5a4 100644 --- a/jedi/fast_parser.py +++ b/jedi/fast_parser.py @@ -1,8 +1,9 @@ import re import operator -import parsing from _compatibility import use_metaclass, reduce, property +import settings +import parsing parser_cache = {} @@ -211,7 +212,9 @@ class FastParser(use_metaclass(CachedFastParser)): parts[0] += parts[1] parts.pop(1) - #self.parsers[:] = [] + if settings.fast_parser_always_reparse: + self.parsers[:] = [] + # dict comprehensions are not available in py2.5/2.6 :-( hashes = dict((p.hash, p) for p in self.parsers) diff --git a/jedi/settings.py b/jedi/settings.py index 4a2c467a..789ac955 100644 --- a/jedi/settings.py +++ b/jedi/settings.py @@ -18,9 +18,15 @@ add_bracket_after_function = False # parser # ---------------- -# Use the fast parser, may cause problems sometimes. +# Use the fast parser. This means that reparsing is only being done if +# something has been changed e.g. to a function. If this happens, only the +# function is being reparsed. fast_parser = True +# This is just a debugging option. Always reparsing means that the fast parser +# is basically useless. So don't use it. +fast_parser_always_reparse = False + # ---------------- # dynamic stuff # ----------------