1
0
forked from VimPlug/jedi

Merge pull request #1601 from yuan-xy/patch_3

add test case to fix code example in doc
This commit is contained in:
Dave Halter
2020-05-31 11:14:58 +02:00
committed by GitHub
2 changed files with 20 additions and 3 deletions

View File

@@ -759,10 +759,11 @@ class Script(object):
global_var = 3
def bar(foo):
return foo + 1 + global_var
return int(foo + 1 + global_var)
def x(foo):
x = int(bar(foo))
def x():
foo = 3.1
x = bar(foo)
:param new_name: The expression under the cursor will be replaced with
a function with this name.

View File

@@ -1,3 +1,19 @@
# -------------------------------------------------- in-module-0
global_var = 3
def x():
foo = 3.1
#? 11 text {'new_name': 'bar'}
x = int(foo + 1 + global_var)
# ++++++++++++++++++++++++++++++++++++++++++++++++++
global_var = 3
def bar(foo):
return int(foo + 1 + global_var)
def x():
foo = 3.1
#? 11 text {'new_name': 'bar'}
x = bar(foo)
# -------------------------------------------------- in-module-1
glob = 3
#? 11 text {'new_name': 'a'}