diff --git a/jedi/api.py b/jedi/api.py index a91e3e76..7b325933 100644 --- a/jedi/api.py +++ b/jedi/api.py @@ -56,7 +56,7 @@ class Script(object): :type source_encoding: str """ def __init__(self, source, line, column, source_path, - source_encoding='utf-8', fast=True): + source_encoding='utf-8', fast=None): api_classes._clear_caches() debug.reset_time() self.source = modules.source_to_unicode(source, source_encoding) diff --git a/jedi/modules.py b/jedi/modules.py index 4a66d477..462e6989 100644 --- a/jedi/modules.py +++ b/jedi/modules.py @@ -91,9 +91,13 @@ class ModuleWithCursor(Module): :param path: The module path of the file or None. :param position: The position, the user is currently in. Only important \ for the main file. + :param fast: Use `fast_parser.FastParser` or not. If None, respect + `settings.fast_parser`. """ - def __init__(self, path, source, position, fast=True): + def __init__(self, path, source, position, fast=None): super(ModuleWithCursor, self).__init__(path, source) + if fast is None: + fast = settings.fast_parser self._parserclass = fast_parser.FastParser if fast else \ parsing.Parser self.position = position