forked from VimPlug/jedi
Fix inline case where a name was removed without the code being used, fixes #1582
This commit is contained in:
@@ -173,6 +173,8 @@ def inline(inference_state, names):
|
|||||||
raise RefactoringError("No definition found to inline")
|
raise RefactoringError("No definition found to inline")
|
||||||
if len(definitions) > 1:
|
if len(definitions) > 1:
|
||||||
raise RefactoringError("Cannot inline a name with multiple definitions")
|
raise RefactoringError("Cannot inline a name with multiple definitions")
|
||||||
|
if len(names) == 1:
|
||||||
|
raise RefactoringError("There are no references to this name")
|
||||||
|
|
||||||
tree_name = definitions[0].tree_name
|
tree_name = definitions[0].tree_name
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,11 @@
|
|||||||
1
|
1
|
||||||
# ++++++++++++++++++++++++++++++++++++++++++++++++++
|
# ++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
There is no name under the cursor
|
There is no name under the cursor
|
||||||
|
# -------------------------------------------------- no-reference-error
|
||||||
|
#? 0 error
|
||||||
|
a = 1
|
||||||
|
# ++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
There are no references to this name
|
||||||
# -------------------------------------------------- multi-equal-error
|
# -------------------------------------------------- multi-equal-error
|
||||||
def test():
|
def test():
|
||||||
#? 4 error
|
#? 4 error
|
||||||
|
|||||||
Reference in New Issue
Block a user