Skip to content

Commit 46195e4

Browse files
committed
Updated plugins
1 parent b56966e commit 46195e4

File tree

42 files changed

+1299
-892
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1299
-892
lines changed

sources_non_forked/ale/ale_linters/graphql/eslint.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ call ale#linter#Define('graphql', {
55
\ 'name': 'eslint',
66
\ 'executable': function('ale#handlers#eslint#GetExecutable'),
77
\ 'command': function('ale#handlers#eslint#GetCommand'),
8-
\ 'callback': 'ale#handlers#eslint#Handle',
8+
\ 'callback': 'ale#handlers#eslint#HandleJSON',
99
\})

sources_non_forked/ale/ale_linters/python/mypy.vim

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
call ale#Set('python_mypy_executable', 'mypy')
55
call ale#Set('python_mypy_ignore_invalid_syntax', 0)
6+
call ale#Set('python_mypy_show_notes', 1)
67
call ale#Set('python_mypy_options', '')
78
call ale#Set('python_mypy_use_global', get(g:, 'ale_use_global_executables', 0))
89
call ale#Set('python_mypy_auto_pipenv', 0)
@@ -18,6 +19,15 @@ endfunction
1819

1920
" The directory to change to before running mypy
2021
function! s:GetDir(buffer) abort
22+
" If we find a directory with "mypy.ini" in it use that,
23+
" else try and find the "python project" root, or failing
24+
" that, run from the same folder as the current file
25+
for l:path in ale#path#Upwards(expand('#' . a:buffer . ':p:h'))
26+
if filereadable(l:path . '/mypy.ini')
27+
return l:path
28+
endif
29+
endfor
30+
2131
let l:project_root = ale#python#FindProjectRoot(a:buffer)
2232

2333
return !empty(l:project_root)
@@ -51,7 +61,16 @@ function! ale_linters#python#mypy#Handle(buffer, lines) abort
5161
" Lines like these should be ignored below:
5262
"
5363
" file.py:4: note: (Stub files are from https://github.com/python/typeshed)
54-
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?: (error|warning): (.+)$'
64+
65+
let l:types = 'error|warning'
66+
67+
if ale#Var(a:buffer, 'python_mypy_show_notes')
68+
let l:types = 'error|warning|note'
69+
endif
70+
71+
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?: ('
72+
\ . l:types
73+
\ . '): (.+)$'
5574
let l:output = []
5675

5776
for l:match in ale#util#GetMatches(a:lines, l:pattern)
@@ -65,7 +84,7 @@ function! ale_linters#python#mypy#Handle(buffer, lines) abort
6584
\ 'filename': ale#path#GetAbsPath(l:dir, l:match[1]),
6685
\ 'lnum': l:match[2] + 0,
6786
\ 'col': l:match[3] + 0,
68-
\ 'type': l:match[4] is# 'error' ? 'E' : 'W',
87+
\ 'type': l:match[4] is# 'error' ? 'E' : (l:match[4] is# 'note' ? 'I': 'W'),
6988
\ 'text': l:match[5],
7089
\})
7190
endfor

sources_non_forked/ale/autoload/ale/completion.vim

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,8 @@ function! s:ReplaceCompletionOptions() abort
261261

262262
if &l:completeopt =~# 'preview'
263263
let &l:completeopt = 'menu,menuone,preview,noselect,noinsert'
264+
elseif &l:completeopt =~# 'popup'
265+
let &l:completeopt = 'menu,menuone,popup,noselect,noinsert'
264266
else
265267
let &l:completeopt = 'menu,menuone,noselect,noinsert'
266268
endif
@@ -386,7 +388,6 @@ function! s:CompletionStillValid(request_id) abort
386388
\&& b:ale_completion_info.line == l:line
387389
\&& (
388390
\ b:ale_completion_info.column == l:column
389-
\ || b:ale_completion_info.source is# 'deoplete'
390391
\ || b:ale_completion_info.source is# 'ale-omnifunc'
391392
\ || b:ale_completion_info.source is# 'ale-callback'
392393
\)
@@ -803,7 +804,9 @@ endfunction
803804
function! ale#completion#HandleUserData(completed_item) abort
804805
let l:source = get(get(b:, 'ale_completion_info', {}), 'source', '')
805806

806-
if l:source isnot# 'ale-automatic' && l:source isnot# 'ale-manual' && l:source isnot# 'ale-callback'
807+
if l:source isnot# 'ale-automatic'
808+
\&& l:source isnot# 'ale-manual'
809+
\&& l:source isnot# 'ale-callback'
807810
return
808811
endif
809812

sources_non_forked/ale/autoload/ale/handlers/eslint.vim

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,18 @@ function! ale#handlers#eslint#GetCommand(buffer) abort
4242

4343
let l:options = ale#Var(a:buffer, 'javascript_eslint_options')
4444

45-
return ale#node#Executable(a:buffer, l:executable)
45+
" ESLint 6 loads plugins/configs/parsers from the project root
46+
" By default, the project root is simply the CWD of the running process.
47+
" https://github.com/eslint/rfcs/blob/master/designs/2018-simplified-package-loading/README.md
48+
" https://github.com/dense-analysis/ale/issues/2787
49+
" Identify project root from presence of node_modules dir.
50+
" Note: If node_modules not present yet, can't load local deps anyway.
51+
let l:modules_dir = ale#path#FindNearestDirectory(a:buffer, 'node_modules')
52+
let l:project_dir = !empty(l:modules_dir) ? fnamemodify(l:modules_dir, ':h:h') : ''
53+
let l:cd_command = !empty(l:project_dir) ? ale#path#CdString(l:project_dir) : ''
54+
55+
return l:cd_command
56+
\ . ale#node#Executable(a:buffer, l:executable)
4657
\ . (!empty(l:options) ? ' ' . l:options : '')
4758
\ . ' -f json --stdin --stdin-filename %s'
4859
endfunction

sources_non_forked/ale/autoload/ale/hover.vim

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ function! ale#hover#HandleTSServerResponse(conn_id, response) abort
4242
\&& exists('*balloon_show')
4343
\&& ale#Var(l:options.buffer, 'set_balloons')
4444
call balloon_show(a:response.body.displayString)
45+
elseif g:ale_hover_to_preview
46+
call ale#preview#Show(split(a:response.body.displayString, "\n"), {
47+
\ 'filetype': 'ale-preview.message',
48+
\ 'stay_here': 1,
49+
\})
4550
else
4651
call ale#util#ShowMessage(a:response.body.displayString)
4752
endif
@@ -98,6 +103,11 @@ function! ale#hover#HandleLSPResponse(conn_id, response) abort
98103
\&& exists('*balloon_show')
99104
\&& ale#Var(l:options.buffer, 'set_balloons')
100105
call balloon_show(l:str)
106+
elseif g:ale_hover_to_preview
107+
call ale#preview#Show(split(l:str, "\n"), {
108+
\ 'filetype': 'ale-preview.message',
109+
\ 'stay_here': 1,
110+
\})
101111
else
102112
call ale#util#ShowMessage(l:str)
103113
endif

sources_non_forked/ale/doc/ale-python.txt

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ g:ale_python_black_use_global *g:ale_python_black_use_global*
145145
See |ale-integrations-local-executables|
146146

147147

148-
g:ale_python_black_auto_pipenv *g:ale_python_black_auto_pipenv*
149-
*b:ale_python_black_auto_pipenv*
148+
g:ale_python_black_auto_pipenv *g:ale_python_black_auto_pipenv*
149+
*b:ale_python_black_auto_pipenv*
150150
Type: |Number|
151151
Default: `0`
152152

@@ -263,6 +263,15 @@ to check for errors while you type.
263263
`mypy` will be run from a detected project root, per |ale-python-root|.
264264

265265

266+
g:ale_python_mypy_auto_pipenv *g:ale_python_mypy_auto_pipenv*
267+
*b:ale_python_mypy_auto_pipenv*
268+
Type: |Number|
269+
Default: `0`
270+
271+
Detect whether the file is inside a pipenv, and set the executable to `pipenv`
272+
if true. This is overridden by a manually-set executable.
273+
274+
266275
g:ale_python_mypy_executable *g:ale_python_mypy_executable*
267276
*b:ale_python_mypy_executable*
268277
Type: |String|
@@ -272,6 +281,7 @@ g:ale_python_mypy_executable *g:ale_python_mypy_executable*
272281

273282
Set this to `'pipenv'` to invoke `'pipenv` `run` `mypy'`.
274283

284+
275285
g:ale_python_mypy_ignore_invalid_syntax
276286
*g:ale_python_mypy_ignore_invalid_syntax*
277287
*b:ale_python_mypy_ignore_invalid_syntax*
@@ -292,6 +302,14 @@ g:ale_python_mypy_options *g:ale_python_mypy_options*
292302
invocation.
293303

294304

305+
g:ale_python_mypy_show_notes *g:ale_python_mypy_show_notes*
306+
*b:ale_python_mypy_show_notes*
307+
Type: |Number|
308+
Default: `1`
309+
310+
If enabled, notes on lines will be displayed as 'I' (info) messages.
311+
312+
295313
g:ale_python_mypy_use_global *g:ale_python_mypy_use_global*
296314
*b:ale_python_mypy_use_global*
297315
Type: |Number|
@@ -300,14 +318,6 @@ g:ale_python_mypy_use_global *g:ale_python_mypy_use_global*
300318
See |ale-integrations-local-executables|
301319

302320

303-
g:ale_python_mypy_auto_pipenv *g:ale_python_mypy_auto_pipenv*
304-
*b:ale_python_mypy_auto_pipenv*
305-
Type: |Number|
306-
Default: `0`
307-
308-
Detect whether the file is inside a pipenv, and set the executable to `pipenv`
309-
if true. This is overridden by a manually-set executable.
310-
311321

312322
===============================================================================
313323
prospector *ale-python-prospector*

sources_non_forked/ale/doc/ale.txt

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,11 @@ vimrc, and your issues should go away. >
432432
433433
set completeopt=menu,menuone,preview,noselect,noinsert
434434
<
435+
436+
Or alternatively, if you want to show documentation in popups: >
437+
438+
set completeopt=menu,menuone,popup,noselect,noinsert
439+
<
435440
*ale-symbols*
436441

437442
ALE provides a set of basic completion symbols. If you want to replace those
@@ -525,6 +530,9 @@ the mouse over a symbol in a buffer. Diagnostic information will take priority
525530
over hover information for balloons. If a line contains a problem, that
526531
problem will be displayed in a balloon instead of hover information.
527532

533+
Hover information can be displayed in the preview window instead by setting
534+
|g:ale_hover_to_preview| to `1`.
535+
528536
For Vim 8.1+ terminals, mouse hovering is disabled by default. Enabling
529537
|balloonexpr| commands in terminals can cause scrolling issues in terminals,
530538
so ALE will not attempt to show balloons unless |g:ale_set_balloons| is set to
@@ -1023,6 +1031,16 @@ g:ale_history_log_output *g:ale_history_log_output*
10231031
if you want to save on some memory usage.
10241032

10251033

1034+
g:ale_hover_to_preview *g:ale_hover_to_preview*
1035+
*b:ale_hover_to_preview*
1036+
1037+
Type: |Number|
1038+
Default: `0`
1039+
1040+
If set to `1`, hover messages will be displayed in the preview window,
1041+
instead of in balloons or the message line.
1042+
1043+
10261044
g:ale_keep_list_window_open *g:ale_keep_list_window_open*
10271045
*b:ale_keep_list_window_open*
10281046
Type: |Number|
@@ -1337,7 +1355,7 @@ b:ale_loclist_msg_format *b:ale_loclist_msg_format*
13371355
The strings for configuring `%severity%` are also used for this option.
13381356

13391357

1340-
g:ale_lsp_show_message_format *g:ale_lsp_show_message_format*
1358+
g:ale_lsp_show_message_format *g:ale_lsp_show_message_format*
13411359

13421360
Type: |String|
13431361
Default: `'%severity%:%linter%: %s'`
@@ -1359,7 +1377,7 @@ g:ale_lsp_show_message_format *g:ale_lsp_show_message_
13591377
separately for each buffer like |g:ale_echo_msg_format| can.
13601378

13611379

1362-
g:ale_lsp_show_message_severity *g:ale_lsp_show_message_severity*
1380+
g:ale_lsp_show_message_severity *g:ale_lsp_show_message_severity*
13631381

13641382
Type: |String|
13651383
Default: `'error'`

sources_non_forked/ale/plugin/ale.vim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ let g:ale_close_preview_on_insert = get(g:, 'ale_close_preview_on_insert', 0)
125125
" This flag can be set to 0 to disable balloon support.
126126
let g:ale_set_balloons = get(g:, 'ale_set_balloons', has('balloon_eval') && has('gui_running'))
127127

128+
" Use preview window for hover messages.
129+
let g:ale_hover_to_preview = get(g:, 'ale_hover_to_preview', 0)
130+
128131
" This flag can be set to 0 to disable warnings for trailing whitespace
129132
let g:ale_warn_about_trailing_whitespace = get(g:, 'ale_warn_about_trailing_whitespace', 1)
130133
" This flag can be set to 0 to disable warnings for trailing blank lines

sources_non_forked/ale/rplugin/python3/deoplete/sources/ale.py

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def __init__(self, vim):
2424
self.rank = 1000
2525
self.is_bytepos = True
2626
self.min_pattern_length = 1
27+
self.is_volatile = True
2728
# Do not forget to update s:trigger_character_map in completion.vim in
2829
# updating entries in this map.
2930
self.input_patterns = {
@@ -44,21 +45,16 @@ def gather_candidates(self, context):
4445
if not self.vim.call('ale#completion#CanProvideCompletions'):
4546
return None
4647

47-
if context.get('is_refresh'):
48-
context['is_async'] = False
48+
event = context.get('event')
4949

50-
if context['is_async']:
51-
# Result is the same as for omnifunc, or None.
50+
if event == 'Async':
5251
result = self.vim.call('ale#completion#GetCompletionResult')
52+
return result or []
5353

54-
if result is not None:
55-
context['is_async'] = False
56-
57-
return result
58-
else:
59-
context['is_async'] = True
60-
61-
# Request some completion results.
62-
self.vim.call('ale#completion#GetCompletions', 'deoplete')
54+
if context.get('is_refresh'):
55+
self.vim.command(
56+
"call ale#completion#GetCompletions('ale-callback', " + \
57+
"{'callback': {completions -> deoplete#auto_complete() }})"
58+
)
6359

6460
return []
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Vint
2+
on: [push, pull_request]
3+
jobs:
4+
vint:
5+
strategy:
6+
fail-fast: false
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@master
11+
- name: Run vint with reviewdog
12+
uses: reviewdog/action-vint@v1.0.1
13+
with:
14+
github_token: ${{ secrets.github_token }}
15+
reporter: github-pr-review
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
cmdargs:
2+
severity: style_problem
3+
color: true
4+
env:
5+
neovim: false

0 commit comments

Comments
 (0)