diff --git a/jedi/builtin.py b/jedi/builtin.py index 4fa207c7..899524a2 100644 --- a/jedi/builtin.py +++ b/jedi/builtin.py @@ -9,7 +9,6 @@ if is_py3k: import types import inspect -import settings import common import debug import parsing @@ -70,10 +69,7 @@ class CachedModule(object): def _load_module(self): source = self._get_source() p = self.path or self.name - if settings.fast_parser: - self._parser = fast_parser.FastParser(source, p) - else: - self._parser = parsing.PyFuzzyParser(source, p) + self._parser = fast_parser.FastParser(source, p) p_time = None if not self.path else os.path.getmtime(self.path) if self.path or self.name: diff --git a/jedi/fast_parser.py b/jedi/fast_parser.py index e748f5a4..a4f15a4a 100644 --- a/jedi/fast_parser.py +++ b/jedi/fast_parser.py @@ -138,6 +138,8 @@ class Module(parsing.Simple, parsing.Module): class CachedFastParser(type): """ This is a metaclass for caching `FastParser`. """ def __call__(self, code, module_path=None, user_position=None): + if not settings.fast_parser: + return parsing.PyFuzzyParser(code, module_path, user_position) if module_path is None or module_path not in parser_cache: p = super(CachedFastParser, self).__call__(code, module_path, user_position) diff --git a/jedi/modules.py b/jedi/modules.py index 5eb2aa75..5db2d682 100644 --- a/jedi/modules.py +++ b/jedi/modules.py @@ -72,12 +72,8 @@ class ModuleWithCursor(Module): # Call the parser already here, because it will be used anyways. # Also, the position is here important (which will not be used by # default), therefore fill the cache here. - if settings.fast_parser: - self._parser = fast_parser.FastParser(self.source, self.path, - self.position) - else: - self._parser = parsing.PyFuzzyParser(self.source, self.path, - self.position) + self._parser = fast_parser.FastParser(self.source, self.path, + self.position) if self.path is not None: builtin.CachedModule.cache[self.path] = time.time(), \ self._parser diff --git a/jedi/settings.py b/jedi/settings.py index 789ac955..d7dd54e2 100644 --- a/jedi/settings.py +++ b/jedi/settings.py @@ -21,7 +21,7 @@ add_bracket_after_function = False # 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 +fast_parser = False # This is just a debugging option. Always reparsing means that the fast parser # is basically useless. So don't use it.