Skip to content

Commit

Permalink
Actually use parso now instead of Jedi.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhalter committed May 19, 2017
1 parent ccbaa12 commit 9bca3d3
Show file tree
Hide file tree
Showing 34 changed files with 49 additions and 52 deletions.
6 changes: 3 additions & 3 deletions jedi/api/__init__.py
Expand Up @@ -13,9 +13,9 @@
import warnings
import sys

from jedi.parser.python import load_grammar
from jedi.parser.python import tree
from jedi.parser.python import parse
from parso.python import load_grammar
from parso.python import tree
from parso.python import parse
from jedi.parser_utils import get_executable_nodes, get_statement_of_position
from jedi import debug
from jedi import settings
Expand Down
4 changes: 2 additions & 2 deletions jedi/api/classes.py
Expand Up @@ -9,7 +9,7 @@
from jedi._compatibility import u
from jedi import settings
from jedi import common
from jedi.parser.cache import parser_cache
from parso.cache import parser_cache
from jedi.cache import memoize_method
from jedi.evaluate import representation as er
from jedi.evaluate import instance
Expand Down Expand Up @@ -60,7 +60,7 @@ def __init__(self, evaluator, name):
self._evaluator = evaluator
self._name = name
"""
An instance of :class:`jedi.parser.reprsentation.Name` subclass.
An instance of :class:`parso.reprsentation.Name` subclass.
"""
self.is_keyword = isinstance(self._name, KeywordName)

Expand Down
4 changes: 2 additions & 2 deletions jedi/api/completion.py
@@ -1,5 +1,5 @@
from jedi.parser import token
from jedi.parser.python import tree
from parso import token
from parso.python import tree
from jedi import debug
from jedi import settings
from jedi.api import classes
Expand Down
6 changes: 3 additions & 3 deletions jedi/api/helpers.py
Expand Up @@ -6,9 +6,9 @@

from jedi._compatibility import u
from jedi.evaluate.helpers import evaluate_call_of_leaf
from jedi.parser.python.parser import Parser
from jedi.parser.python import tree
from jedi.parser import tokenize
from parso.python.parser import Parser
from parso.python import tree
from parso import tokenize
from jedi.cache import time_cache
from jedi import common

Expand Down
2 changes: 1 addition & 1 deletion jedi/api/keywords.py
Expand Up @@ -4,7 +4,7 @@
from jedi._compatibility import is_py3, is_py35
from jedi import common
from jedi.evaluate.filters import AbstractNameDefinition
from jedi.parser.python.tree import Leaf
from parso.python.tree import Leaf

try:
from pydoc_data import topics as pydoc_topics
Expand Down
2 changes: 1 addition & 1 deletion jedi/api/usages.py
@@ -1,5 +1,5 @@
from jedi.api import classes
from jedi.parser.python import tree
from parso.python import tree
from jedi.evaluate import imports
from jedi.evaluate.filters import TreeNameDefinition
from jedi.evaluate.representation import ModuleContext
Expand Down
2 changes: 1 addition & 1 deletion jedi/cache.py
Expand Up @@ -15,7 +15,7 @@
import inspect

from jedi import settings
from jedi.parser.cache import parser_cache
from parso.cache import parser_cache

_time_caches = {}

Expand Down
2 changes: 1 addition & 1 deletion jedi/evaluate/__init__.py
Expand Up @@ -63,7 +63,7 @@
import copy
import sys

from jedi.parser.python import tree
from parso.python import tree
from jedi import debug
from jedi.common import unite
from jedi.evaluate import representation as er
Expand Down
2 changes: 1 addition & 1 deletion jedi/evaluate/analysis.py
Expand Up @@ -2,7 +2,7 @@
Module for statical analysis.
"""
from jedi import debug
from jedi.parser.python import tree
from parso.python import tree
from jedi.evaluate.compiled import CompiledObject


Expand Down
4 changes: 2 additions & 2 deletions jedi/evaluate/compiled/fake.py
Expand Up @@ -10,8 +10,8 @@
from itertools import chain

from jedi._compatibility import is_py3, builtins, unicode, is_py34
from jedi.parser.python import parse
from jedi.parser.python import tree
from parso.python import parse
from parso.python import tree

modules = {}

Expand Down
2 changes: 1 addition & 1 deletion jedi/evaluate/compiled/mixed.py
Expand Up @@ -5,7 +5,7 @@
import inspect
import os

from jedi.parser.python import parse
from parso.python import parse
from jedi.evaluate import compiled
from jedi.cache import underscore_memoization
from jedi.evaluate import imports
Expand Down
2 changes: 1 addition & 1 deletion jedi/evaluate/context.py
@@ -1,6 +1,6 @@
from jedi._compatibility import Python3Method
from jedi.common import unite
from jedi.parser.python.tree import ExprStmt, CompFor
from parso.python.tree import ExprStmt, CompFor
from jedi.parser_utils import clean_scope_docstring, get_doc_with_call_signature


Expand Down
2 changes: 1 addition & 1 deletion jedi/evaluate/docstrings.py
Expand Up @@ -22,7 +22,7 @@
from jedi.common import unite
from jedi.evaluate import context
from jedi.evaluate.cache import memoize_default
from jedi.parser.python import parse
from parso.python import parse
from jedi.common import indent_block
from jedi.evaluate.iterable import SequenceLiteralContext, FakeSequence

Expand Down
2 changes: 1 addition & 1 deletion jedi/evaluate/dynamic.py
Expand Up @@ -17,7 +17,7 @@ def foo(bar):
- execute these calls and check the input. This work with a ``ParamListener``.
"""

from jedi.parser.python import tree
from parso.python import tree
from jedi import settings
from jedi import debug
from jedi.evaluate.cache import memoize_default
Expand Down
2 changes: 1 addition & 1 deletion jedi/evaluate/filters.py
Expand Up @@ -4,7 +4,7 @@
"""
from abc import abstractmethod

from jedi.parser.tree import search_ancestor
from parso.tree import search_ancestor
from jedi.evaluate import flow_analysis
from jedi.common import to_list, unite
from jedi.parser_utils import get_parent_scope
Expand Down
4 changes: 2 additions & 2 deletions jedi/evaluate/finder.py
Expand Up @@ -15,8 +15,8 @@
check for -> a is a string). There's big potential in these checks.
"""

from jedi.parser.python import tree
from jedi.parser.tree import search_ancestor
from parso.python import tree
from parso.tree import search_ancestor
from jedi import debug
from jedi.common import unite
from jedi import settings
Expand Down
2 changes: 1 addition & 1 deletion jedi/evaluate/helpers.py
Expand Up @@ -2,7 +2,7 @@
from itertools import chain
from contextlib import contextmanager

from jedi.parser.python import tree
from parso.python import tree
from jedi.parser_utils import get_parent_scope


Expand Down
8 changes: 4 additions & 4 deletions jedi/evaluate/imports.py
Expand Up @@ -20,10 +20,10 @@
from jedi import debug
from jedi import settings
from jedi.common import source_to_unicode, unite
from jedi.parser.python import parse
from jedi.parser.python import tree
from jedi.parser.tree import search_ancestor
from jedi.parser.cache import parser_cache
from parso.python import parse
from parso.python import tree
from parso.tree import search_ancestor
from parso.cache import parser_cache
from jedi.evaluate import sys_path
from jedi.evaluate import helpers
from jedi.evaluate import compiled
Expand Down
2 changes: 1 addition & 1 deletion jedi/evaluate/param.py
Expand Up @@ -3,7 +3,7 @@
from jedi._compatibility import zip_longest
from jedi import debug
from jedi import common
from jedi.parser.python import tree
from parso.python import tree
from jedi.evaluate import iterable
from jedi.evaluate import analysis
from jedi.evaluate import context
Expand Down
4 changes: 2 additions & 2 deletions jedi/evaluate/pep0484.py
Expand Up @@ -22,8 +22,8 @@
import itertools

import os
from jedi.parser import ParserSyntaxError
from jedi.parser.python import parse, tree
from parso import ParserSyntaxError
from parso.python import parse, tree
from jedi.common import unite
from jedi.evaluate.cache import memoize_default
from jedi.evaluate import compiled
Expand Down
1 change: 0 additions & 1 deletion jedi/evaluate/precedence.py
Expand Up @@ -4,7 +4,6 @@
import operator as op

from jedi._compatibility import unicode
from jedi.parser.python import tree
from jedi import debug
from jedi.evaluate.compiled import CompiledObject, create, builtin_from_name
from jedi.evaluate import analysis
Expand Down
4 changes: 2 additions & 2 deletions jedi/evaluate/representation.py
@@ -1,5 +1,5 @@
"""
Like described in the :mod:`jedi.parser.python.tree` module,
Like described in the :mod:`parso.python.tree` module,
there's a need for an ast like module to represent the states of parsed
modules.

Expand Down Expand Up @@ -44,7 +44,7 @@
from itertools import chain

from jedi._compatibility import use_metaclass
from jedi.parser.python import tree
from parso.python import tree
from jedi import debug
from jedi import common
from jedi.evaluate.cache import memoize_default, CachedMetaClass, NO_DEFAULT
Expand Down
2 changes: 1 addition & 1 deletion jedi/evaluate/stdlib.py
Expand Up @@ -18,7 +18,7 @@
from jedi.evaluate.instance import InstanceFunctionExecution, \
AbstractInstanceContext, CompiledInstance, BoundMethod
from jedi.evaluate import iterable
from jedi.parser.python import parse
from parso.python import parse
from jedi import debug
from jedi.evaluate import precedence
from jedi.evaluate import param
Expand Down
4 changes: 2 additions & 2 deletions jedi/evaluate/sys_path.py
Expand Up @@ -4,8 +4,8 @@
from jedi.evaluate.site import addsitedir

from jedi._compatibility import exec_function, unicode
from jedi.parser.python import tree
from jedi.parser.python import parse
from parso.python import tree
from parso.python import parse
from jedi.evaluate.cache import memoize_default
from jedi import debug
from jedi import common
Expand Down
2 changes: 1 addition & 1 deletion jedi/parser_utils.py
Expand Up @@ -2,7 +2,7 @@
from inspect import cleandoc

from jedi._compatibility import literal_eval, is_py3
from jedi.parser.python import tree
from parso.python import tree

_EXECUTE_NODES = set([
'funcdef', 'classdef', 'import_from', 'import_name', 'test', 'or_test',
Expand Down
1 change: 0 additions & 1 deletion jedi/refactoring.py
Expand Up @@ -16,7 +16,6 @@

from jedi import common
from jedi.evaluate import helpers
from jedi.parser.python import tree as pt


class Refactoring(object):
Expand Down
2 changes: 1 addition & 1 deletion test/run.py
Expand Up @@ -120,7 +120,7 @@
import jedi
from jedi import debug
from jedi._compatibility import unicode, is_py3
from jedi.parser.python import parse
from parso.python import parse
from jedi.api.classes import Definition
from jedi.api.completion import get_user_scope
from jedi import parser_utils
Expand Down
2 changes: 1 addition & 1 deletion test/test_api/test_api.py
Expand Up @@ -7,7 +7,7 @@
from jedi import api
from jedi._compatibility import is_py3
from pytest import raises
from jedi.parser import cache
from parso import cache


def test_preload_modules():
Expand Down
7 changes: 3 additions & 4 deletions test/test_cache.py
Expand Up @@ -9,10 +9,9 @@

import jedi
from jedi import settings, cache
from jedi.parser.cache import _NodeCacheItem, save_module, load_module, \
_get_hashed_path, parser_cache, _load_from_file_system, \
_save_to_file_system
from jedi.parser.python import load_grammar
from parso.cache import _NodeCacheItem, save_module, load_module, \
_get_hashed_path, parser_cache, _load_from_file_system
from parso.python import load_grammar


def test_modulepickling_change_cache_dir(monkeypatch, tmpdir):
Expand Down
2 changes: 1 addition & 1 deletion test/test_evaluate/test_buildout_detection.py
Expand Up @@ -8,7 +8,7 @@
_check_module)
from jedi.evaluate import Evaluator
from jedi.evaluate.representation import ModuleContext
from jedi.parser.python import parse, load_grammar
from parso.python import parse, load_grammar

from ..helpers import cwd_at

Expand Down
2 changes: 1 addition & 1 deletion test/test_evaluate/test_compiled.py
@@ -1,7 +1,7 @@
from textwrap import dedent

from jedi._compatibility import builtins, is_py3
from jedi.parser.python import load_grammar
from parso.python import load_grammar
from jedi.evaluate import compiled, instance
from jedi.evaluate.representation import FunctionContext
from jedi.evaluate import Evaluator
Expand Down
2 changes: 1 addition & 1 deletion test/test_parso_integration/test_basic.py
@@ -1,6 +1,6 @@
from textwrap import dedent

from jedi.parser.python import parse
from parso.python import parse
import jedi


Expand Down
4 changes: 2 additions & 2 deletions test/test_parso_integration/test_parser_utils.py
@@ -1,7 +1,7 @@
from jedi._compatibility import u, is_py3
from jedi import parser_utils
from jedi.parser.python import parse
from jedi.parser.python import tree
from parso.python import parse
from parso.python import tree

import pytest

Expand Down
2 changes: 1 addition & 1 deletion test/test_regression.py
Expand Up @@ -13,7 +13,7 @@
from jedi import api
from jedi import common
from jedi.evaluate import imports
from jedi.parser.python import parse
from parso.python import parse
from .helpers import TestCase, cwd_at

#jedi.set_debug_function()
Expand Down

0 comments on commit 9bca3d3

Please sign in to comment.