forked from VimPlug/jedi
Remove _no_python2_support
This commit is contained in:
@@ -10,7 +10,6 @@ arguments.
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import warnings
|
import warnings
|
||||||
from functools import wraps
|
|
||||||
|
|
||||||
import parso
|
import parso
|
||||||
from parso.python import tree
|
from parso.python import tree
|
||||||
@@ -51,18 +50,6 @@ from jedi.inference.utils import to_list
|
|||||||
sys.setrecursionlimit(3000)
|
sys.setrecursionlimit(3000)
|
||||||
|
|
||||||
|
|
||||||
def _no_python2_support(func):
|
|
||||||
# TODO remove when removing Python 2/3.5
|
|
||||||
@wraps(func)
|
|
||||||
def wrapper(self, *args, **kwargs):
|
|
||||||
if self._inference_state.grammar.version_info < (3, 6) or sys.version_info < (3, 6):
|
|
||||||
raise NotImplementedError(
|
|
||||||
"No support for refactorings/search on Python 2/3.5"
|
|
||||||
)
|
|
||||||
return func(self, *args, **kwargs)
|
|
||||||
return wrapper
|
|
||||||
|
|
||||||
|
|
||||||
class Script(object):
|
class Script(object):
|
||||||
"""
|
"""
|
||||||
A Script is the base for completions, goto or whatever you want to do with
|
A Script is the base for completions, goto or whatever you want to do with
|
||||||
@@ -404,7 +391,6 @@ class Script(object):
|
|||||||
# Avoid duplicates
|
# Avoid duplicates
|
||||||
return list(set(helpers.sorted_definitions(defs)))
|
return list(set(helpers.sorted_definitions(defs)))
|
||||||
|
|
||||||
@_no_python2_support
|
|
||||||
def search(self, string, **kwargs):
|
def search(self, string, **kwargs):
|
||||||
"""
|
"""
|
||||||
Searches a name in the current file. For a description of how the
|
Searches a name in the current file. For a description of how the
|
||||||
@@ -682,7 +668,6 @@ class Script(object):
|
|||||||
]
|
]
|
||||||
return sorted(defs, key=lambda x: x.start_pos)
|
return sorted(defs, key=lambda x: x.start_pos)
|
||||||
|
|
||||||
@_no_python2_support
|
|
||||||
def rename(self, line=None, column=None, **kwargs):
|
def rename(self, line=None, column=None, **kwargs):
|
||||||
"""
|
"""
|
||||||
Renames all references of the variable under the cursor.
|
Renames all references of the variable under the cursor.
|
||||||
@@ -698,7 +683,6 @@ class Script(object):
|
|||||||
definitions = self.get_references(line, column, include_builtins=False)
|
definitions = self.get_references(line, column, include_builtins=False)
|
||||||
return refactoring.rename(self._inference_state, definitions, new_name)
|
return refactoring.rename(self._inference_state, definitions, new_name)
|
||||||
|
|
||||||
@_no_python2_support
|
|
||||||
def extract_variable(self, line, column, **kwargs):
|
def extract_variable(self, line, column, **kwargs):
|
||||||
"""
|
"""
|
||||||
Moves an expression to a new statemenet.
|
Moves an expression to a new statemenet.
|
||||||
@@ -741,7 +725,6 @@ class Script(object):
|
|||||||
new_name, (line, column), until_pos
|
new_name, (line, column), until_pos
|
||||||
)
|
)
|
||||||
|
|
||||||
@_no_python2_support
|
|
||||||
def extract_function(self, line, column, **kwargs):
|
def extract_function(self, line, column, **kwargs):
|
||||||
"""
|
"""
|
||||||
Moves an expression to a new function.
|
Moves an expression to a new function.
|
||||||
@@ -792,7 +775,6 @@ class Script(object):
|
|||||||
new_name, (line, column), until_pos
|
new_name, (line, column), until_pos
|
||||||
)
|
)
|
||||||
|
|
||||||
@_no_python2_support
|
|
||||||
def inline(self, line=None, column=None):
|
def inline(self, line=None, column=None):
|
||||||
"""
|
"""
|
||||||
Inlines a variable under the cursor. This is basically the opposite of
|
Inlines a variable under the cursor. This is basically the opposite of
|
||||||
|
|||||||
Reference in New Issue
Block a user