Skip to content

Commit ec0f0b6

Browse files
authored
Fix issue #28 (#29)
* Fix issue #28 * Fix travis settings * Bump version
1 parent 952cc47 commit ec0f0b6

File tree

4 files changed

+36
-7
lines changed

4 files changed

+36
-7
lines changed

.travis.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ install:
44
- pwd
55
- git clone https://github.com/junegunn/vader.vim.git test/vader.vim
66
- git clone https://github.com/vim/vim /tmp/vim
7-
- mkdir ~/bin
7+
- mkdir ~/tmp
88
- cd /tmp/vim
99
- sudo apt-get install -y gettext libncurses5-dev libacl1-dev libgpm-dev
10-
- ./configure --with-features=huge --enable-fail-if-missing --enable-pythoninterp --prefix=$HOME/bin/vim
10+
- ./configure --with-features=huge --enable-fail-if-missing --enable-pythoninterp --prefix=$HOME/tmp/vim
1111
- make && make install
1212
- git clone https://github.com/junegunn/vader.vim.git
13-
- export VIM_EXE=$HOME/bin/vim/bin/vim
13+
- export VIM_EXE=$HOME/tmp/vim/bin/vim
1414
- cd $HOME/build/heavenshell/vim-pydocstring
1515

1616
before_script:
17-
- $HOME/bin/vim/bin/vim --version
17+
- $HOME/tmp/vim/bin/vim --version
1818

1919
script:
2020
- cd test

CHANGES.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
Version 0.1.3
22
-------------
3+
Released on Jul 18th 2017
4+
5+
- Fix bug
6+
7+
Do not ignore `.`.
8+
9+
see https://github.com/heavenshell/vim-pydocstring/issues/28
10+
311
Released on July 2nd 2017
412

513
- Fix bug
@@ -10,7 +18,6 @@ Released on July 2nd 2017
1018

1119
Thx @oxo42
1220

13-
1421
Version 0.1.2
1522
-------------
1623
Released on Mar 25th 2017

autoload/pydocstring.vim

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ function! s:parseFunc(type, line)
6161
let arrowIndex = match(a:line, "->")
6262
if arrowIndex != -1
6363
let substring = strpart(a:line, arrowIndex + 2)
64-
let returnType = substitute(substring, '\W*', '', 'g')
64+
" issue #28 `\W*` would deleted `.`.
65+
let returnType = substitute(substring, '[^0-9A-Za-z_.]*', '', 'g')
66+
echomsg returnType
6567
else
6668
let returnType = ''
6769
endif
@@ -71,7 +73,6 @@ function! s:parseFunc(type, line)
7173
endfunction
7274

7375
function! s:parse(line)
74-
let str = substitute(a:line, '\\', '', 'g')
7576
let str = substitute(a:line, '#.*$', '', 'g')
7677
let type = ''
7778

test/basic.vader

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,3 +191,24 @@ Expect python:
191191
"""foo"""
192192
pass
193193

194+
# Test issue #28
195+
#-------------------------------------------------------------------------------
196+
Given python (issue#28):
197+
def moment(weights: tuple, coords: numpy.ndarray) -> numpy.ndarray:
198+
pass
199+
200+
Execute:
201+
Pydocstring
202+
203+
Expect python:
204+
def moment(weights: tuple, coords: numpy.ndarray) -> numpy.ndarray:
205+
"""moment
206+
207+
:param weights:
208+
:type weights: tuple
209+
:param coords:
210+
:type coords: numpy.ndarray
211+
212+
:rtype: numpy.ndarray
213+
"""
214+
pass

0 commit comments

Comments
 (0)