Skip to content

Commit

Permalink
daily commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ruchee committed Jan 5, 2018
1 parent ee86160 commit f8d6b9a
Show file tree
Hide file tree
Showing 15 changed files with 168 additions and 46 deletions.
22 changes: 16 additions & 6 deletions vimfiles/bundle/syntastic/autoload/syntastic/preprocess.vim
Original file line number Diff line number Diff line change
Expand Up @@ -634,17 +634,27 @@ endfunction " }}}2
function! syntastic#preprocess#mypy(errors) abort " {{{2
let out = []
for e in a:errors
" new format
let parts = matchlist(e, '\v^(.{-1,}):(\d+): error: (.+)')
if len(parts) > 3
call add(out, join(parts[1:3], ':'))
" column numbers
let parts = matchlist(e, '\v^(.{-1,}):(\d+):(\d+): ([ew])%(rror|arning): (.+)')
if len(parts) > 5
let parts[3] += 1
call add(out, join(parts[1:5], ':'))
continue
endif

" old format
" no column numbers
let parts = matchlist(e, '\v^(.{-1,}):(\d+): ([ew])%(rror|arning): (.+)')
if len(parts) > 4
call add(out, join(parts[1:4], ':'))
continue
endif

" obsolete format
let parts = matchlist(e, '\v^(.{-1,}), line (\d+): (.+)')
if len(parts) > 3
call add(out, join(parts[1:3], ':'))
let parts[4] = parts[3]
let parts[3] = 'e'
call add(out, join(parts[1:4], ':'))
endif
endfor
return out
Expand Down
2 changes: 1 addition & 1 deletion vimfiles/bundle/syntastic/plugin/syntastic.vim
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if has('reltime')
lockvar! g:_SYNTASTIC_START
endif

let g:_SYNTASTIC_VERSION = '3.8.0-100'
let g:_SYNTASTIC_VERSION = '3.8.0-101'
lockvar g:_SYNTASTIC_VERSION

" Sanity checks {{{1
Expand Down
13 changes: 10 additions & 3 deletions vimfiles/bundle/syntastic/syntax_checkers/python/mypy.vim
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,21 @@ let s:save_cpo = &cpo
set cpo&vim

function! SyntaxCheckers_python_mypy_GetLocList() dict
let makeprg = self.makeprgBuild({})
if !exists('s:mypy_new')
" creative versioning: version string has changed from v0.4.6 to v0.470
" XXX the test should be fine for now, since 470 > 4
let s:mypy_new = syntastic#util#versionIsAtLeast(self.getVersion(), [0, 4, 5])
endif

let errorformat = '%f:%l:%m'
let makeprg = self.makeprgBuild({ 'args_after': (s:mypy_new ? '--show-column-numbers' : '') })

let errorformat =
\ '%f:%l:%c:%t:%m,' .
\ '%f:%l:%t:%m'

return SyntasticMake({
\ 'makeprg': makeprg,
\ 'errorformat': errorformat,
\ 'defaults': { 'type': 'E' },
\ 'returns': [0, 1],
\ 'preprocess': 'mypy' })
endfunction
Expand Down
25 changes: 21 additions & 4 deletions vimfiles/bundle/vim-elixir/ftplugin/elixir.vim
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
if (exists("b:did_ftplugin"))
if exists('b:did_ftplugin')
finish
endif
let b:did_ftplugin = 1

" Matchit support
if exists("loaded_matchit") && !exists("b:match_words")
if exists('loaded_matchit') && !exists('b:match_words')
let b:match_ignorecase = 0

let b:match_words = '\:\@<!\<\%(do\|fn\)\:\@!\>' .
Expand All @@ -30,7 +30,24 @@ let &l:path =
setlocal includeexpr=elixir#util#get_filename(v:fname)
setlocal suffixesadd=.ex,.exs,.eex,.erl,.yrl,.hrl

let &l:define = 'def\(macro|guard|delegate\)p'

silent! setlocal formatoptions-=t formatoptions+=croqlj

let b:block_begin = '\<\(do$\|fn\>\)'
let b:block_end = '\<end\>'

nnoremap <buffer> <silent> <expr> ]] ':silent keeppatterns /'.b:block_begin.'<CR>'
nnoremap <buffer> <silent> <expr> [[ ':silent keeppatterns ?'.b:block_begin.'<CR>'
nnoremap <buffer> <silent> <expr> ][ ':silent keeppatterns /'.b:block_end .'<CR>'
nnoremap <buffer> <silent> <expr> [] ':silent keeppatterns ?'.b:block_end .'<CR>'
onoremap <buffer> <silent> <expr> ]] ':silent keeppatterns /'.b:block_begin.'<CR>'
onoremap <buffer> <silent> <expr> [[ ':silent keeppatterns ?'.b:block_begin.'<CR>'
onoremap <buffer> <silent> <expr> ][ ':silent keeppatterns /'.b:block_end .'<CR>'
onoremap <buffer> <silent> <expr> [] ':silent keeppatterns ?'.b:block_end .'<CR>'
silent! setlocal formatoptions-=t formatoptions+=croqlj

let b:undo_ftplugin = 'setlocal sw< sts< et< isk< com< cms< path< inex< sua< '.
\ '| unlet! b:match_ignorecase b:match_words'
let b:undo_ftplugin = 'setlocal sw< sts< et< isk< com< cms< path< inex< sua< def<'.
\ '| unlet! b:match_ignorecase b:match_words b:block_begin b:block_end'
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ simplify_return({abstype, _, [Type|_]}) ->
{erlangName, Attrs, _} = Type,
Name = proplists:get_value(name, Attrs),
Name ++ "()";
simplify_return({record, _, [Type]}) ->
simplify_return({record, _, [Type|_]}) ->
simplify_return(Type) ++ "()";
simplify_return({nonempty_list, _, [Type]}) ->
"[" ++ simplify_return(Type) ++ "]";
Expand Down
17 changes: 17 additions & 0 deletions vimfiles/bundle/vim-go/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
## unplanned

BUG FIXES:

* Create quickfix list correctly when tests timeout.
[[GH-1633]](https://github.com/fatih/vim-go/pull/1633)
* Apply `g:go_test_timeout` when running `:GoTestFunc`.
[[GH-1631]](https://github.com/fatih/vim-go/pull/1631)
* The user's configured `g:go_doc_url` variable wasn't working correctly in the
case when the "gogetdoc" command isn't installed.
[[GH-1629]](https://github.com/fatih/vim-go/pull/1629)
* Highlight format specifiers with an index (e.g. `%[2]d`).
[[GH-1634]](https://github.com/fatih/vim-go/pull/1634)

## 1.16 - (December 29, 2017)

FEATURES:

* Add `g:go_doc_url` to change the `godoc` server from `godoc.org` to a custom
Expand Down Expand Up @@ -63,6 +77,9 @@ BUG FIXES:
[[GH-1606]](https://github.com/fatih/vim-go/pull/1606).
* Fix template creation for files in directories that don't exist yet.
[[GH-1618]](https://github.com/fatih/vim-go/pull/1618).
* Fix behavior of terminal windows and resize terminal windows correctly for
all valid `g:go_term_mode` values.
[[GH-1611]](https://github.com/fatih/vim-go/pull/1611).

BACKWARDS INCOMPATIBILITIES:

Expand Down
Binary file removed vimfiles/bundle/vim-go/assets/screenshot.png
Binary file not shown.
32 changes: 13 additions & 19 deletions vimfiles/bundle/vim-go/autoload/go/doc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,7 @@ function! go#doc#OpenBrowser(...) abort
let name = out["name"]
let decl = out["decl"]

let godoc_url = get(g:, 'go_doc_url', 'https://godoc.org')
if godoc_url isnot 'https://godoc.org'
" strip last '/' character if available
let last_char = strlen(godoc_url) - 1
if godoc_url[last_char] == '/'
let godoc_url = strpart(godoc_url, 0, last_char)
endif

" custom godoc installations expects it
let godoc_url .= "/pkg"
endif

let godoc_url = s:custom_godoc_url()
let godoc_url .= "/" . import
if decl !~ "^package"
let godoc_url .= "#" . name
Expand All @@ -61,7 +50,7 @@ function! go#doc#OpenBrowser(...) abort
let exported_name = pkgs[1]

" example url: https://godoc.org/github.com/fatih/set#Set
let godoc_url = "https://godoc.org/" . pkg . "#" . exported_name
let godoc_url = s:custom_godoc_url() . "/" . pkg . "#" . exported_name
call go#tool#OpenBrowser(godoc_url)
endfunction

Expand Down Expand Up @@ -217,13 +206,18 @@ function! s:godocWord(args) abort
return [pkg, exported_name]
endfunction

function! s:godocNotFound(content) abort
if len(a:content) == 0
return 1
function! s:custom_godoc_url() abort
let godoc_url = get(g:, 'go_doc_url', 'https://godoc.org')
if godoc_url isnot 'https://godoc.org'
" strip last '/' character if available
let last_char = strlen(godoc_url) - 1
if godoc_url[last_char] == '/'
let godoc_url = strpart(godoc_url, 0, last_char)
endif
" custom godoc installations expect /pkg before package names
let godoc_url .= "/pkg"
endif

return a:content =~# '^.*: no such file or directory\n$'
return godoc_url
endfunction


" vim: sw=2 ts=2 et
18 changes: 10 additions & 8 deletions vimfiles/bundle/vim-go/autoload/go/term.vim
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ function! go#term#newmode(bang, cmd, mode) abort

let id = termopen(a:cmd, job)

if l:winnr !=# winnr()
exe l:winnr . "wincmd w"
endif

execute cd . fnameescape(dir)

let job.id = id
Expand All @@ -58,19 +54,25 @@ function! go#term#newmode(bang, cmd, mode) abort
let height = get(g:, 'go_term_height', winheight(0))
let width = get(g:, 'go_term_width', winwidth(0))

" we are careful how to resize. for example it's vertical we don't change
" we are careful how to resize. for example it's vsplit we don't change
" the height. The below command resizes the buffer
if a:mode == "split"
exe 'resize ' . height
elseif a:mode == "vertical"

if mode =~ "vertical" || mode =~ "vsplit" || mode =~ "vnew"
exe 'vertical resize ' . width
elseif mode =~ "split" || mode =~ "new"
exe 'resize ' . height
endif

" we also need to resize the pty, so there you go...
call jobresize(id, width, height)

let s:jobs[id] = job
stopinsert

if l:winnr !=# winnr()
exe l:winnr . "wincmd w"
endif

return id
endfunction

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Run a few parallel tests, all in parallel, using multiple techniques for
// causing the test to take a while so that the stacktraces resulting from a
// test timeout will contain several goroutines to avoid giving a false sense
// of confidence or creating error formats that don't account for the more
// complex scenarios that can occur with timeouts.

package main

import (
"testing"
"time"
)

func TestSleep(t *testing.T) {
t.Parallel()
time.Sleep(15 * time.Second)
t.Log("expected panic if run with timeout < 15s")
}

func TestRunning(t *testing.T) {
t.Parallel()
c := time.After(15 * time.Second)
Loop:
for {
select {
case <-c:
break Loop
default:
}
}

t.Log("expected panic if run with timeout < 15s")
}

func TestRunningAlso(t *testing.T) {
t.Parallel()
c := time.After(15 * time.Second)
Loop:
for {
select {
case <-c:
break Loop
default:
}
}
t.Log("expected panic if run with timeout < 15s")
}
8 changes: 8 additions & 0 deletions vimfiles/bundle/vim-go/autoload/go/test.vim
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ function! go#test#Func(bang, ...) abort

if a:0
call extend(args, a:000)
else
" only add this if no custom flags are passed
let timeout = get(g:, 'go_test_timeout', '10s')
call add(args, printf("-timeout=%s", timeout))
endif

call call('go#test#Test', args)
Expand Down Expand Up @@ -314,6 +318,10 @@ function! s:errorformat() abort

" set the format for panics.

" handle panics from test timeouts
let format .= ",%+Gpanic: test timed out after %.%\\+"

" handle non-timeout panics
" In addition to 'panic', check for 'fatal error' to support older versions
" of Go that used 'fatal error'.
"
Expand Down
10 changes: 10 additions & 0 deletions vimfiles/bundle/vim-go/autoload/go/test_test.vim
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ func! Test_GoTestCompilerError() abort
call s:test('compilerror/compilerror_test.go', expected)
endfunc

func! Test_GoTestTimeout() abort
let expected = [
\ {'lnum': 0, 'bufnr': 0, 'col': 0, 'valid': 1, 'vcol': 0, 'nr': -1, 'type': '', 'pattern': '', 'text': 'panic: test timed out after 500ms'}
\ ]

let g:go_test_timeout="500ms"
call s:test('timeout/timeout_test.go', expected)
unlet g:go_test_timeout
endfunc

func! s:test(file, expected, ...) abort
if has('nvim')
" nvim mostly shows test errors correctly, but the the expected errors are
Expand Down
2 changes: 1 addition & 1 deletion vimfiles/bundle/vim-go/doc/vim-go.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ The following plugins are supported for use with vim-go:
* Real-time completion (Vim):
https://github.com/Shougo/neocomplete.vim

* Real-time completion (Neovim):
* Real-time completion (Neovim and Vim 8):
https://github.com/Shougo/deoplete.nvim and
https://github.com/zchee/deoplete-go

Expand Down
14 changes: 13 additions & 1 deletion vimfiles/bundle/vim-go/syntax/go.vim
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,19 @@ else
endif

if g:go_highlight_format_strings != 0
syn match goFormatSpecifier /\([^%]\(%%\)*\)\@<=%[-#0 +]*\%(\*\|\d\+\)\=\%(\.\%(\*\|\d\+\)\)*[vTtbcdoqxXUeEfgGsp]/ contained containedin=goString
" [n] notation is valid for specifying explicit argument indexes
" 1. Match a literal % not preceded by a %.
" 2. Match any number of -, #, 0, space, or +
" 3. Match * or [n]* or any number or nothing before a .
" 4. Match * or [n]* or any number or nothing after a .
" 5. Match [n] or nothing before a verb
" 6. Match a formatting verb
syn match goFormatSpecifier /\
\([^%]\(%%\)*\)\
\@<=%[-#0 +]*\
\%(\%(\%(\[\d\+\]\)\=\*\)\|\d\+\)\=\
\%(\.\%(\%(\%(\[\d\+\]\)\=\*\)\|\d\+\)\=\)\=\
\%(\[\d\+\]\)\=[vTtbcdoqxXUeEfFgGsp]/ contained containedin=goString,goRawString
hi def link goFormatSpecifier goSpecialString
endif

Expand Down
2 changes: 0 additions & 2 deletions vimfiles/bundle/vim-xml/ftplugin/html.vim

This file was deleted.

0 comments on commit f8d6b9a

Please sign in to comment.