Commit 7087d68 1 parent ce62c8e commit 7087d68 Copy full SHA for 7087d68
File tree 2 files changed +9
-4
lines changed
autoload/doge/preprocessors
2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -16,5 +16,13 @@ function! doge#preprocessors#python#insert_position(lnum_insert_pos) abort
16
16
return a: lnum_insert_pos
17
17
endfunction
18
18
19
+
20
+ " A callback function being called after the parameter tokens have been
21
+ " extracted. This function will adjust the input if needed.
22
+ function ! doge#preprocessors#python#parameter_tokens (tokens) abort
23
+ " Filer out the 'self' variable in methods.
24
+ return filter (a: tokens , {_, token - > token[' name' ] !=# ' self' })
25
+ endfunction
26
+
19
27
let &cpoptions = s: save_cpo
20
28
unlet s: save_cpo
Original file line number Diff line number Diff line change @@ -11,14 +11,13 @@ Do (trigger doge):
11
11
:3\<CR>
12
12
\<C-d>
13
13
14
- Expect python (generated comment with :param tags):
14
+ Expect python (generated comment with no :param tags):
15
15
class MyClass(object):
16
16
17
17
def __init__(self: MyClass):
18
18
"""
19
19
[TODO:description]
20
20
21
- :param self MyClass: [TODO:description]
22
21
"""
23
22
pass
24
23
# ==============================================================================
@@ -41,7 +40,6 @@ Expect python (generated comment with :param tags):
41
40
"""
42
41
[TODO:description]
43
42
44
- :param self MyClass: [TODO:description]
45
43
:param p1 Sequence[T]: [TODO:description]
46
44
:rtype Generator[int, float, str]: [TODO:description]
47
45
"""
@@ -67,7 +65,6 @@ Expect python (generated comment with :param tags):
67
65
"""
68
66
[TODO:description]
69
67
70
- :param self [TODO:type]: [TODO:description]
71
68
:param args str: [TODO:description]
72
69
:param kwargs str: [TODO:description]
73
70
:rtype str: [TODO:description]
You can’t perform that action at this time.
0 commit comments