mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-23 22:01:26 +08:00
all the import changes
This commit is contained in:
@@ -13,8 +13,8 @@ import os
|
||||
import warnings
|
||||
from itertools import chain
|
||||
|
||||
from jedi import parsing
|
||||
from jedi import parsing_representation as pr
|
||||
from jedi.parser import Parser
|
||||
from jedi.parser import representation as pr
|
||||
from jedi import debug
|
||||
from jedi import settings
|
||||
from jedi import helpers
|
||||
@@ -244,7 +244,7 @@ class Script(object):
|
||||
|
||||
def _get_under_cursor_stmt(self, cursor_txt):
|
||||
offset = self._line - 1, self._column
|
||||
r = parsing.Parser(cursor_txt, no_docstr=True, offset=offset)
|
||||
r = Parser(cursor_txt, no_docstr=True, offset=offset)
|
||||
try:
|
||||
stmt = r.module.statements[0]
|
||||
except IndexError:
|
||||
@@ -668,7 +668,7 @@ def defined_names(source, path=None, source_encoding='utf-8'):
|
||||
|
||||
:rtype: list of api_classes.Definition
|
||||
"""
|
||||
parser = parsing.Parser(
|
||||
parser = Parser(
|
||||
modules.source_to_unicode(source, source_encoding),
|
||||
module_path=path,
|
||||
)
|
||||
|
||||
@@ -11,7 +11,7 @@ import functools
|
||||
from jedi._compatibility import unicode, next
|
||||
from jedi import settings
|
||||
from jedi import common
|
||||
from jedi import parsing_representation as pr
|
||||
from jedi.parser import representation as pr
|
||||
from jedi import cache
|
||||
import keywords
|
||||
import recursion
|
||||
|
||||
@@ -34,7 +34,7 @@ import inspect
|
||||
|
||||
from jedi import common
|
||||
from jedi import debug
|
||||
from jedi import parsing
|
||||
from jedi.parser import Parser
|
||||
from jedi import modules
|
||||
import evaluate
|
||||
|
||||
@@ -435,7 +435,7 @@ class Builtin(object):
|
||||
class Container(object):
|
||||
FunctionType = types.FunctionType
|
||||
source = _generate_code(Container, depth=0)
|
||||
parser = parsing.Parser(source, None)
|
||||
parser = Parser(source, None)
|
||||
module = parser.module
|
||||
module.parent = self.scope
|
||||
typ = evaluate.follow_path(iter(['FunctionType']), module, module)
|
||||
|
||||
@@ -17,7 +17,7 @@ annotations.
|
||||
import re
|
||||
|
||||
from jedi import cache
|
||||
from jedi import parsing
|
||||
from jedi.parser import Parser
|
||||
import evaluate
|
||||
import evaluate_representation as er
|
||||
|
||||
@@ -51,7 +51,7 @@ def follow_param(param):
|
||||
param_str)
|
||||
user_position = (2, 0)
|
||||
|
||||
p = parsing.Parser(param_str, None, user_position,
|
||||
p = Parser(param_str, None, user_position,
|
||||
no_docstr=True)
|
||||
if p.user_stmt is None:
|
||||
return []
|
||||
@@ -124,7 +124,7 @@ def find_return_types(func):
|
||||
if not type_str:
|
||||
return []
|
||||
|
||||
p = parsing.Parser(type_str, None, (1, 0), no_docstr=True)
|
||||
p = Parser(type_str, None, (1, 0), no_docstr=True)
|
||||
if p.user_stmt is None:
|
||||
return []
|
||||
p.user_stmt.parent = func
|
||||
|
||||
@@ -56,12 +56,12 @@ from __future__ import with_statement
|
||||
import os
|
||||
|
||||
from jedi import cache
|
||||
from jedi import parsing_representation as pr
|
||||
from jedi.parser import representation as pr
|
||||
from jedi import modules
|
||||
from jedi import settings
|
||||
from jedi import common
|
||||
from jedi import debug
|
||||
from jedi import fast_parser
|
||||
from jedi.parser import fast as fast_parser
|
||||
import api_classes
|
||||
import evaluate
|
||||
import imports
|
||||
|
||||
@@ -76,7 +76,7 @@ import itertools
|
||||
from jedi._compatibility import next, hasattr, is_py3k, unicode, reraise, u
|
||||
from jedi import common
|
||||
from jedi import cache
|
||||
from jedi import parsing_representation as pr
|
||||
from jedi.parser import representation as pr
|
||||
from jedi import debug
|
||||
import evaluate_representation as er
|
||||
import recursion
|
||||
|
||||
@@ -15,7 +15,7 @@ import copy
|
||||
import itertools
|
||||
|
||||
from jedi._compatibility import use_metaclass, next, hasattr, unicode
|
||||
from jedi import parsing_representation as pr
|
||||
from jedi.parser import representation as pr
|
||||
from jedi import cache
|
||||
from jedi import helpers
|
||||
from jedi import debug
|
||||
|
||||
@@ -3,7 +3,7 @@ from __future__ import with_statement
|
||||
import copy
|
||||
|
||||
from jedi import common
|
||||
from jedi import parsing_representation as pr
|
||||
from jedi.parser import representation as pr
|
||||
|
||||
|
||||
def fast_parent_copy(obj):
|
||||
|
||||
@@ -22,7 +22,7 @@ from jedi._compatibility import find_module
|
||||
from jedi import modules
|
||||
from jedi import common
|
||||
from jedi import debug
|
||||
from jedi import parsing_representation as pr
|
||||
from jedi.parser import representation as pr
|
||||
from jedi import cache
|
||||
import builtin
|
||||
import evaluate
|
||||
|
||||
@@ -5,7 +5,7 @@ Module to handle interpreted Python objects.
|
||||
import itertools
|
||||
import tokenize
|
||||
|
||||
from jedi import parsing_representation as pr
|
||||
from jedi.parser import representation as pr
|
||||
|
||||
|
||||
class ObjectImporter(object):
|
||||
|
||||
@@ -4,7 +4,7 @@ import pydoc
|
||||
import keyword
|
||||
|
||||
from jedi._compatibility import is_py3k
|
||||
from jedi import parsing_representation as pr
|
||||
from jedi.parser import representation as pr
|
||||
from jedi import common
|
||||
import builtin
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ from ast import literal_eval
|
||||
|
||||
from jedi._compatibility import exec_function, unicode
|
||||
from jedi import cache
|
||||
from jedi import parsing_representation as pr
|
||||
from jedi import fast_parser
|
||||
from jedi.parser import representation as pr
|
||||
from jedi.parser import fast
|
||||
from jedi import debug
|
||||
from jedi import common
|
||||
|
||||
@@ -54,7 +54,7 @@ class CachedModule(object):
|
||||
def _load_module(self):
|
||||
source = self._get_source()
|
||||
p = self.path or self.name
|
||||
p = fast_parser.FastParser(source, p)
|
||||
p = fast.FastParser(source, p)
|
||||
cache.save_module(self.path, self.name, p)
|
||||
return p
|
||||
|
||||
@@ -112,7 +112,7 @@ 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.
|
||||
self._parser = fast_parser.FastParser(self.source, self.path,
|
||||
self._parser = fast.FastParser(self.source, self.path,
|
||||
self.position)
|
||||
# don't pickle that module, because it's changing fast
|
||||
cache.save_module(self.path, self.name, self._parser,
|
||||
|
||||
@@ -7,7 +7,7 @@ Next to :mod:`cache` this module also makes |jedi| not thread-safe. Why?
|
||||
``ExecutionRecursionDecorator`` uses class variables to count the function
|
||||
calls.
|
||||
"""
|
||||
from jedi import parsing_representation as pr
|
||||
from jedi.parser import representation as pr
|
||||
from jedi import debug
|
||||
from jedi import settings
|
||||
import evaluate_representation as er
|
||||
|
||||
@@ -19,7 +19,7 @@ import difflib
|
||||
from jedi import common
|
||||
from jedi import modules
|
||||
from jedi import helpers
|
||||
from jedi import parsing_representation as pr
|
||||
from jedi.parser import representation as pr
|
||||
|
||||
|
||||
class Refactoring(object):
|
||||
|
||||
@@ -3,7 +3,7 @@ Tests ``from __future__ import absolute_import`` (only important for
|
||||
Python 2.X)
|
||||
"""
|
||||
import jedi
|
||||
from jedi.parsing import Parser
|
||||
from jedi.parser import Parser
|
||||
from . import helpers
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from jedi.parsing import Parser
|
||||
from jedi.parser import Parser
|
||||
from jedi import parsing_representation as pr
|
||||
|
||||
def test_user_statement_on_import():
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from jedi.parsing import Parser
|
||||
from jedi.parser import Parser
|
||||
|
||||
def test_get_code():
|
||||
"""Use the same code that the parser also generates, to compare"""
|
||||
|
||||
Reference in New Issue
Block a user