1
0
Fork 0
mirror of synced 2024-12-22 06:51:06 -05:00

Updated plugins

This commit is contained in:
Amir 2022-08-08 15:45:56 +02:00
parent b41536726f
commit 765adb9da3
216 changed files with 4784 additions and 2112 deletions

View file

@ -18,9 +18,30 @@ function! ale_linters#ansible#ansible_lint#Handle(buffer, version, lines) abort
endif endif
endfor endfor
let l:version_group = ale#semver#GTE(a:version, [5, 0, 0]) ? '>=5.0.0' : '<5.0.0' let l:version_group = ale#semver#GTE(a:version, [6, 0, 0]) ? '>=6.0.0' :
\ ale#semver#GTE(a:version, [5, 0, 0]) ? '>=5.0.0' :
\ '<5.0.0'
let l:output = [] let l:output = []
if '>=6.0.0' is# l:version_group
let l:error_codes = { 'blocker': 'E', 'critical': 'E', 'major': 'W', 'minor': 'W', 'info': 'I' }
let l:linter_issues = json_decode(join(a:lines, ''))
for l:issue in l:linter_issues
if ale#path#IsBufferPath(a:buffer, l:issue.location.path)
call add(l:output, {
\ 'lnum': exists('l:issue.location.lines.begin.column') ? l:issue.location.lines.begin.line :
\ l:issue.location.lines.begin,
\ 'col': exists('l:issue.location.lines.begin.column') ? l:issue.location.lines.begin.column : 0,
\ 'text': l:issue.check_name,
\ 'detail': l:issue.description,
\ 'code': l:issue.severity,
\ 'type': l:error_codes[l:issue.severity],
\})
endif
endfor
endif
if '>=5.0.0' is# l:version_group if '>=5.0.0' is# l:version_group
" Matches patterns line the following: " Matches patterns line the following:
" test.yml:3:148: syntax-check 'var' is not a valid attribute for a Play " test.yml:3:148: syntax-check 'var' is not a valid attribute for a Play
@ -73,10 +94,13 @@ endfunction
function! ale_linters#ansible#ansible_lint#GetCommand(buffer, version) abort function! ale_linters#ansible#ansible_lint#GetCommand(buffer, version) abort
let l:commands = { let l:commands = {
\ '>=6.0.0': '%e --nocolor -f json -x yaml %s',
\ '>=5.0.0': '%e --nocolor --parseable-severity -x yaml %s', \ '>=5.0.0': '%e --nocolor --parseable-severity -x yaml %s',
\ '<5.0.0': '%e --nocolor -p %t' \ '<5.0.0': '%e --nocolor -p %t'
\} \}
let l:command = ale#semver#GTE(a:version, [5, 0]) ? l:commands['>=5.0.0'] : l:commands['<5.0.0'] let l:command = ale#semver#GTE(a:version, [6, 0]) ? l:commands['>=6.0.0'] :
\ ale#semver#GTE(a:version, [5, 0]) ? l:commands['>=5.0.0'] :
\ l:commands['<5.0.0']
return l:command return l:command
endfunction endfunction

View file

@ -9,8 +9,9 @@ function! ale_linters#awk#gawk#GetCommand(buffer) abort
" gawk from attempting to execute the body of the script " gawk from attempting to execute the body of the script
" it is linting. " it is linting.
return '%e --source ' . ale#Escape('BEGIN { exit } END { exit 1 }') return '%e --source ' . ale#Escape('BEGIN { exit } END { exit 1 }')
\ . ' --lint'
\ . ale#Pad(ale#Var(a:buffer, 'awk_gawk_options')) \ . ale#Pad(ale#Var(a:buffer, 'awk_gawk_options'))
\ . ' -f %t --lint /dev/null' \ . ' -f %t /dev/null'
endfunction endfunction
call ale#linter#Define('awk', { call ale#linter#Define('awk', {

View file

@ -4,15 +4,16 @@
call ale#Set('dart_analyze_executable', 'dart') call ale#Set('dart_analyze_executable', 'dart')
function! ale_linters#dart#dart_analyze#Handle(buffer, lines) abort function! ale_linters#dart#dart_analyze#Handle(buffer, lines) abort
let l:pattern = '\v^ ([a-z]+) - (.+):(\d+):(\d+) - (.+) - (.+)$' let l:pattern = '\v([a-z]+) - (.+):(\d+):(\d+) - (.+) - (.+)$'
let l:output = [] let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern) for l:match in ale#util#GetMatches(a:lines, l:pattern)
let [l:type, l:filename, l:lnum, l:col, l:message, l:code] = l:match[1:6]
call add(l:output, { call add(l:output, {
\ 'type': l:match[1] is# 'error' ? 'E' : 'W', \ 'type': l:type is# 'error' ? 'E' : l:type is# 'info' ? 'I' : 'W',
\ 'text': l:match[6] . ': ' . l:match[5], \ 'text': l:code . ': ' . l:message,
\ 'lnum': str2nr(l:match[3]), \ 'lnum': str2nr(l:lnum),
\ 'col': str2nr(l:match[4]), \ 'col': str2nr(l:col),
\}) \})
endfor endfor
@ -22,7 +23,7 @@ endfunction
call ale#linter#Define('dart', { call ale#linter#Define('dart', {
\ 'name': 'dart_analyze', \ 'name': 'dart_analyze',
\ 'executable': {b -> ale#Var(b, 'dart_analyze_executable')}, \ 'executable': {b -> ale#Var(b, 'dart_analyze_executable')},
\ 'command': '%e analyze %s', \ 'command': '%e analyze --fatal-infos %s',
\ 'callback': 'ale_linters#dart#dart_analyze#Handle', \ 'callback': 'ale_linters#dart#dart_analyze#Handle',
\ 'lint_file': 1, \ 'lint_file': 1,
\}) \})

View file

@ -1,36 +0,0 @@
" Author: w0rp <devw0rp@gmail.com>
" Description: Check Dart files with dartanalyzer
call ale#Set('dart_dartanalyzer_executable', 'dartanalyzer')
function! ale_linters#dart#dartanalyzer#GetCommand(buffer) abort
let l:path = ale#path#FindNearestFile(a:buffer, '.packages')
return '%e'
\ . (!empty(l:path) ? ' --packages ' . ale#Escape(l:path) : '')
\ . ' %s'
endfunction
function! ale_linters#dart#dartanalyzer#Handle(buffer, lines) abort
let l:pattern = '\v^ ([a-z]+) . (.+) at (.+):(\d+):(\d+) . (.+)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'type': l:match[1] is# 'error' ? 'E' : 'W',
\ 'text': l:match[6] . ': ' . l:match[2],
\ 'lnum': str2nr(l:match[4]),
\ 'col': str2nr(l:match[5]),
\})
endfor
return l:output
endfunction
call ale#linter#Define('dart', {
\ 'name': 'dartanalyzer',
\ 'executable': {b -> ale#Var(b, 'dart_dartanalyzer_executable')},
\ 'command': function('ale_linters#dart#dartanalyzer#GetCommand'),
\ 'callback': 'ale_linters#dart#dartanalyzer#Handle',
\ 'lint_file': 1,
\})

View file

@ -12,6 +12,7 @@ function! ale_linters#erlang#elvis#Handle(buffer, lines) abort
\ 'lnum': str2nr(l:match[1]), \ 'lnum': str2nr(l:match[1]),
\ 'text': s:AbbreviateMessage(l:match[2]), \ 'text': s:AbbreviateMessage(l:match[2]),
\ 'type': 'W', \ 'type': 'W',
\ 'sub_type': 'style',
\}) \})
endfor endfor

View file

@ -24,7 +24,7 @@ function! ale_linters#go#golangci_lint#GetCommand(buffer) abort
endfunction endfunction
function! ale_linters#go#golangci_lint#GetMatches(lines) abort function! ale_linters#go#golangci_lint#GetMatches(lines) abort
let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?:?:?:?\s\*?(.+)$' let l:pattern = '\v^([a-zA-Z]?:?[^:]+):(\d+):?(\d+)?:?:?:?\s\*?(.+)\s+\((.+)\)$'
return ale#util#GetMatches(a:lines, l:pattern) return ale#util#GetMatches(a:lines, l:pattern)
endfunction endfunction
@ -34,14 +34,20 @@ function! ale_linters#go#golangci_lint#Handler(buffer, lines) abort
let l:output = [] let l:output = []
for l:match in ale_linters#go#golangci_lint#GetMatches(a:lines) for l:match in ale_linters#go#golangci_lint#GetMatches(a:lines)
if l:match[5] is# 'typecheck'
let l:msg_type = 'E'
else
let l:msg_type = 'W'
endif
" l:match[1] will already be an absolute path, output from " l:match[1] will already be an absolute path, output from
" golangci_lint " golangci_lint
call add(l:output, { call add(l:output, {
\ 'filename': ale#path#GetAbsPath(l:dir, l:match[1]), \ 'filename': ale#path#GetAbsPath(l:dir, l:match[1]),
\ 'lnum': l:match[2] + 0, \ 'lnum': l:match[2] + 0,
\ 'col': l:match[3] + 0, \ 'col': l:match[3] + 0,
\ 'type': 'E', \ 'type': l:msg_type,
\ 'text': l:match[4], \ 'text': l:match[4] . ' (' . l:match[5] . ')',
\}) \})
endfor endfor

View file

@ -11,10 +11,17 @@ function! ale_linters#handlebars#embertemplatelint#GetExecutable(buffer) abort
endfunction endfunction
function! ale_linters#handlebars#embertemplatelint#GetCommand(buffer, version) abort function! ale_linters#handlebars#embertemplatelint#GetCommand(buffer, version) abort
if ale#semver#GTE(a:version, [4, 0, 0])
" --json was removed in favor of --format=json in ember-template-lint@4.0.0
return '%e --format=json --filename %s'
endif
if ale#semver#GTE(a:version, [1, 6, 0])
" Reading from stdin was introduced in ember-template-lint@1.6.0 " Reading from stdin was introduced in ember-template-lint@1.6.0
return ale#semver#GTE(a:version, [1, 6, 0]) return '%e --json --filename %s'
\ ? '%e --json --filename %s' endif
\ : '%e --json %t'
return '%e --json %t'
endfunction endfunction
function! ale_linters#handlebars#embertemplatelint#GetCommandWithVersionCheck(buffer) abort function! ale_linters#handlebars#embertemplatelint#GetCommandWithVersionCheck(buffer) abort

View file

@ -4,6 +4,7 @@
" <devildead13@gmail.com>). It search more project root files. " <devildead13@gmail.com>). It search more project root files.
" "
call ale#Set('haskell_hls_executable', 'haskell-language-server-wrapper') call ale#Set('haskell_hls_executable', 'haskell-language-server-wrapper')
call ale#Set('haskell_hls_config', {})
function! ale_linters#haskell#hls#FindRootFile(buffer) abort function! ale_linters#haskell#hls#FindRootFile(buffer) abort
let l:serach_root_files = [ let l:serach_root_files = [
@ -60,4 +61,5 @@ call ale#linter#Define('haskell', {
\ 'command': function('ale_linters#haskell#hls#GetCommand'), \ 'command': function('ale_linters#haskell#hls#GetCommand'),
\ 'executable': {b -> ale#Var(b, 'haskell_hls_executable')}, \ 'executable': {b -> ale#Var(b, 'haskell_hls_executable')},
\ 'project_root': function('ale_linters#haskell#hls#GetProjectRoot'), \ 'project_root': function('ale_linters#haskell#hls#GetProjectRoot'),
\ 'lsp_config': {b -> ale#Var(b, 'haskell_hls_config')},
\}) \})

View file

@ -11,10 +11,7 @@ function! ale_linters#html#angular#GetProjectRoot(buffer) abort
endfunction endfunction
function! ale_linters#html#angular#GetExecutable(buffer) abort function! ale_linters#html#angular#GetExecutable(buffer) abort
return ale#path#FindExecutable(a:buffer, 'html_angular', [ return 'node'
\ 'node_modules/@angular/language-server/bin/ngserver',
\ 'node_modules/@angular/language-server/index.js',
\])
endfunction endfunction
function! ale_linters#html#angular#GetCommand(buffer) abort function! ale_linters#html#angular#GetCommand(buffer) abort
@ -34,9 +31,16 @@ function! ale_linters#html#angular#GetCommand(buffer) abort
\ fnamemodify(l:language_service_dir, ':h:h') \ fnamemodify(l:language_service_dir, ':h:h')
\ . '/typescript' \ . '/typescript'
\) \)
let l:executable = ale_linters#html#angular#GetExecutable(a:buffer) let l:script = ale#path#FindExecutable(a:buffer, 'html_angular', [
\ 'node_modules/@angular/language-server/bin/ngserver',
\ 'node_modules/@angular/language-server/index.js',
\])
return ale#node#Executable(a:buffer, l:executable) if !filereadable(l:script)
return ''
endif
return ale#Escape('node') . ' ' . ale#Escape(l:script)
\ . ' --ngProbeLocations ' . ale#Escape(l:language_service_dir) \ . ' --ngProbeLocations ' . ale#Escape(l:language_service_dir)
\ . ' --tsProbeLocations ' . ale#Escape(l:typescript_dir) \ . ' --tsProbeLocations ' . ale#Escape(l:typescript_dir)
\ . ' --stdio' \ . ' --stdio'

View file

@ -192,4 +192,9 @@ call ale#linter#Define('java', {
\ 'command': function('ale_linters#java#eclipselsp#RunWithVersionCheck'), \ 'command': function('ale_linters#java#eclipselsp#RunWithVersionCheck'),
\ 'language': 'java', \ 'language': 'java',
\ 'project_root': function('ale#java#FindProjectRoot'), \ 'project_root': function('ale#java#FindProjectRoot'),
\ 'initialization_options': {
\ 'extendedClientCapabilities': {
\ 'classFileContentsSupport': v:true
\ }
\ }
\}) \})

View file

@ -20,6 +20,6 @@ endfunction
call ale#linter#Define('make', { call ale#linter#Define('make', {
\ 'name': 'checkmake', \ 'name': 'checkmake',
\ 'executable': 'checkmake', \ 'executable': 'checkmake',
\ 'command': 'checkmake %s --format="{{.LineNumber}}:{{.Rule}}:{{.Violation}}"', \ 'command': 'checkmake %s --format="{{.LineNumber}}:{{.Rule}}:{{.Violation}}{{\"\r\n\"}}"',
\ 'callback': 'ale_linters#make#checkmake#Handle', \ 'callback': 'ale_linters#make#checkmake#Handle',
\}) \})

View file

@ -5,7 +5,7 @@
function! ale_linters#nix#nix#Command(buffer, output, meta) abort function! ale_linters#nix#nix#Command(buffer, output, meta) abort
let l:version = a:output[0][22:] let l:version = a:output[0][22:]
if l:version =~# '^\(2.4\|3\).*' if l:version =~# '^\(2.[4-9]\|3\).*'
return 'nix-instantiate --log-format internal-json --parse -' return 'nix-instantiate --log-format internal-json --parse -'
else else
return 'nix-instantiate --parse -' return 'nix-instantiate --parse -'

View file

@ -1,4 +1,4 @@
" Author: medains <https://github.com/medains>, ardis <https://github.com/ardisdreelath> " Author: medains <https://github.com/medains>, ardis <https://github.com/ardisdreelath>, Arizard <https://github.com/Arizard>
" Description: phpstan for PHP files " Description: phpstan for PHP files
" Set to change the ruleset " Set to change the ruleset
@ -6,6 +6,7 @@ let g:ale_php_phpstan_executable = get(g:, 'ale_php_phpstan_executable', 'phpsta
let g:ale_php_phpstan_level = get(g:, 'ale_php_phpstan_level', '') let g:ale_php_phpstan_level = get(g:, 'ale_php_phpstan_level', '')
let g:ale_php_phpstan_configuration = get(g:, 'ale_php_phpstan_configuration', '') let g:ale_php_phpstan_configuration = get(g:, 'ale_php_phpstan_configuration', '')
let g:ale_php_phpstan_autoload = get(g:, 'ale_php_phpstan_autoload', '') let g:ale_php_phpstan_autoload = get(g:, 'ale_php_phpstan_autoload', '')
let g:ale_php_phpstan_memory_limit = get(g:, 'ale_php_phpstan_memory_limit', '')
call ale#Set('php_phpstan_use_global', get(g:, 'ale_use_global_executables', 0)) call ale#Set('php_phpstan_use_global', get(g:, 'ale_use_global_executables', 0))
function! ale_linters#php#phpstan#GetCommand(buffer, version) abort function! ale_linters#php#phpstan#GetCommand(buffer, version) abort
@ -19,6 +20,11 @@ function! ale_linters#php#phpstan#GetCommand(buffer, version) abort
\ ? ' -a ' . ale#Escape(l:autoload) \ ? ' -a ' . ale#Escape(l:autoload)
\ : '' \ : ''
let l:memory_limit = ale#Var(a:buffer, 'php_phpstan_memory_limit')
let l:memory_limit_option = !empty(l:memory_limit)
\ ? ' --memory-limit ' . ale#Escape(l:memory_limit)
\ : ''
let l:level = ale#Var(a:buffer, 'php_phpstan_level') let l:level = ale#Var(a:buffer, 'php_phpstan_level')
let l:config_file_exists = ale#path#FindNearestFile(a:buffer, 'phpstan.neon') let l:config_file_exists = ale#path#FindNearestFile(a:buffer, 'phpstan.neon')
let l:dist_config_file_exists = ale#path#FindNearestFile(a:buffer, 'phpstan.neon.dist') let l:dist_config_file_exists = ale#path#FindNearestFile(a:buffer, 'phpstan.neon.dist')
@ -41,6 +47,7 @@ function! ale_linters#php#phpstan#GetCommand(buffer, version) abort
\ . l:configuration_option \ . l:configuration_option
\ . l:autoload_option \ . l:autoload_option
\ . l:level_option \ . l:level_option
\ . l:memory_limit_option
\ . ' %s' \ . ' %s'
endfunction endfunction

View file

@ -6,6 +6,12 @@ call ale#Set('php_psalm_options', '')
call ale#Set('php_psalm_use_global', get(g:, 'ale_use_global_executables', 0)) call ale#Set('php_psalm_use_global', get(g:, 'ale_use_global_executables', 0))
function! ale_linters#php#psalm#GetProjectRoot(buffer) abort function! ale_linters#php#psalm#GetProjectRoot(buffer) abort
let l:composer_path = ale#path#FindNearestFile(a:buffer, 'composer.json')
if (!empty(l:composer_path))
return fnamemodify(l:composer_path, ':h')
endif
let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git') let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git')
return !empty(l:git_path) ? fnamemodify(l:git_path, ':h:h') : '' return !empty(l:git_path) ? fnamemodify(l:git_path, ':h:h') : ''

View file

@ -29,7 +29,7 @@ function! ale_linters#python#pydocstyle#GetCommand(buffer) abort
return ale#Escape(l:executable) . l:exec_args return ale#Escape(l:executable) . l:exec_args
\ . ale#Pad(ale#Var(a:buffer, 'python_pydocstyle_options')) \ . ale#Pad(ale#Var(a:buffer, 'python_pydocstyle_options'))
\ . ' %s:t' \ . ' %s'
endfunction endfunction
function! ale_linters#python#pydocstyle#Handle(buffer, lines) abort function! ale_linters#python#pydocstyle#Handle(buffer, lines) abort

View file

@ -22,6 +22,22 @@ function! ale_linters#python#pylama#GetExecutable(buffer) abort
return ale#python#FindExecutable(a:buffer, 'python_pylama', ['pylama']) return ale#python#FindExecutable(a:buffer, 'python_pylama', ['pylama'])
endfunction endfunction
function! ale_linters#python#pylama#RunWithVersionCheck(buffer) abort
let l:executable = ale_linters#python#pylama#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry$'
\ ? ' run pylama'
\ : ''
let l:command = ale#Escape(l:executable) . l:exec_args . ' --version'
return ale#semver#RunWithVersionCheck(
\ a:buffer,
\ l:executable,
\ l:command,
\ function('ale_linters#python#pylama#GetCommand'),
\)
endfunction
function! ale_linters#python#pylama#GetCwd(buffer) abort function! ale_linters#python#pylama#GetCwd(buffer) abort
if ale#Var(a:buffer, 'python_pylama_change_directory') if ale#Var(a:buffer, 'python_pylama_change_directory')
" Pylama loads its configuration from the current directory only, and " Pylama loads its configuration from the current directory only, and
@ -35,27 +51,33 @@ function! ale_linters#python#pylama#GetCwd(buffer) abort
return '' return ''
endfunction endfunction
function! ale_linters#python#pylama#GetCommand(buffer) abort function! ale_linters#python#pylama#GetCommand(buffer, version) abort
let l:executable = ale_linters#python#pylama#GetExecutable(a:buffer) let l:executable = ale_linters#python#pylama#GetExecutable(a:buffer)
let l:exec_args = l:executable =~? 'pipenv\|poetry$' let l:exec_args = l:executable =~? 'pipenv\|poetry$'
\ ? ' run pylama' \ ? ' run pylama'
\ : '' \ : ''
" json format is added in version 8.1.4
" https://github.com/klen/pylama/blob/develop/Changelog
let l:format_json_args = ale#semver#GTE(a:version, [8, 1, 4])
\ ? ' --format json'
\ : ''
" Note: Using %t to lint changes would be preferable, but many pylama " Note: Using %t to lint changes would be preferable, but many pylama
" checks use surrounding paths (e.g. C0103 module name, E0402 relative " checks use surrounding paths (e.g. C0103 module name, E0402 relative
" import beyond top, etc.). Neither is ideal. " import beyond top, etc.). Neither is ideal.
return ale#Escape(l:executable) . l:exec_args return ale#Escape(l:executable) . l:exec_args
\ . ale#Pad(ale#Var(a:buffer, 'python_pylama_options')) \ . ale#Pad(ale#Var(a:buffer, 'python_pylama_options'))
\ . l:format_json_args
\ . ' %s' \ . ' %s'
endfunction endfunction
function! ale_linters#python#pylama#Handle(buffer, lines) abort function! ale_linters#python#pylama#Handle(buffer, version, lines) abort
if empty(a:lines) if empty(a:lines)
return [] return []
endif endif
let l:output = ale#python#HandleTraceback(a:lines, 1) let l:output = ale#python#HandleTraceback(a:lines, 1)
let l:pattern = '\v^.{-}:([0-9]+):([0-9]+): +%(([A-Z][0-9]+):? +)?(.*)$'
" First letter of error code is a pylint-compatible message type " First letter of error code is a pylint-compatible message type
" http://pylint.pycqa.org/en/latest/user_guide/output.html#source-code-analysis-section " http://pylint.pycqa.org/en/latest/user_guide/output.html#source-code-analysis-section
@ -75,6 +97,30 @@ function! ale_linters#python#pylama#Handle(buffer, lines) abort
\ 'D': 'style', \ 'D': 'style',
\} \}
if ale#semver#GTE(a:version, [8, 1, 4])
try
let l:errors = json_decode(join(a:lines, ''))
catch
return l:output
endtry
if empty(l:errors)
return l:output
endif
for l:error in l:errors
call add(l:output, {
\ 'lnum': l:error['lnum'],
\ 'col': l:error['col'],
\ 'code': l:error['number'],
\ 'type': get(l:pylint_type_to_ale_type, l:error['etype'], 'W'),
\ 'sub_type': get(l:pylint_type_to_ale_sub_type, l:error['etype'], ''),
\ 'text': printf('%s [%s]', l:error['message'], l:error['source']),
\})
endfor
else
let l:pattern = '\v^.{-}:([0-9]+):([0-9]+): +%(([A-Z][0-9]+):? +)?(.*)$'
for l:match in ale#util#GetMatches(a:lines, l:pattern) for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, { call add(l:output, {
\ 'lnum': str2nr(l:match[1]), \ 'lnum': str2nr(l:match[1]),
@ -85,6 +131,7 @@ function! ale_linters#python#pylama#Handle(buffer, lines) abort
\ 'text': l:match[4], \ 'text': l:match[4],
\}) \})
endfor endfor
endif
return l:output return l:output
endfunction endfunction
@ -93,7 +140,15 @@ call ale#linter#Define('python', {
\ 'name': 'pylama', \ 'name': 'pylama',
\ 'executable': function('ale_linters#python#pylama#GetExecutable'), \ 'executable': function('ale_linters#python#pylama#GetExecutable'),
\ 'cwd': function('ale_linters#python#pylama#GetCwd'), \ 'cwd': function('ale_linters#python#pylama#GetCwd'),
\ 'command': function('ale_linters#python#pylama#GetCommand'), \ 'command': function('ale_linters#python#pylama#RunWithVersionCheck'),
\ 'callback': 'ale_linters#python#pylama#Handle', \ 'callback': {buffer, lines -> ale#semver#RunWithVersionCheck(
\ buffer,
\ ale_linters#python#pylama#GetExecutable(buffer),
\ '%e --version',
\ {buffer, version -> ale_linters#python#pylama#Handle(
\ buffer,
\ l:version,
\ lines)},
\ )},
\ 'lint_file': 1, \ 'lint_file': 1,
\}) \})

View file

@ -19,6 +19,10 @@ function! ale_linters#ruby#reek#GetCommand(buffer, version) abort
\ . l:display_name_args \ . l:display_name_args
endfunction endfunction
function! s:GetDocumentationLink(error) abort
return get(a:error, 'documentation_link', get(a:error, 'wiki_link', ''))
endfunction
function! s:BuildText(buffer, error) abort function! s:BuildText(buffer, error) abort
let l:parts = [] let l:parts = []
@ -29,7 +33,7 @@ function! s:BuildText(buffer, error) abort
call add(l:parts, a:error.message) call add(l:parts, a:error.message)
if ale#Var(a:buffer, 'ruby_reek_show_wiki_link') if ale#Var(a:buffer, 'ruby_reek_show_wiki_link')
call add(l:parts, '[' . a:error.wiki_link . ']') call add(l:parts, '[' . s:GetDocumentationLink(a:error) . ']')
endif endif
return join(l:parts, ' ') return join(l:parts, ' ')

View file

@ -9,9 +9,21 @@ function! ale_linters#rust#analyzer#GetCommand(buffer) abort
endfunction endfunction
function! ale_linters#rust#analyzer#GetProjectRoot(buffer) abort function! ale_linters#rust#analyzer#GetProjectRoot(buffer) abort
" Try to find nearest Cargo.toml for cargo projects
let l:cargo_file = ale#path#FindNearestFile(a:buffer, 'Cargo.toml') let l:cargo_file = ale#path#FindNearestFile(a:buffer, 'Cargo.toml')
return !empty(l:cargo_file) ? fnamemodify(l:cargo_file, ':h') : '' if !empty(l:cargo_file)
return fnamemodify(l:cargo_file, ':h')
endif
" Try to find nearest rust-project.json for non-cargo projects
let l:rust_project = ale#path#FindNearestFile(a:buffer, 'rust-project.json')
if !empty(l:rust_project)
return fnamemodify(l:rust_project, ':h')
endif
return ''
endfunction endfunction
call ale#linter#Define('rust', { call ale#linter#Define('rust', {

View file

@ -1,7 +1,7 @@
" Author: Daniel Schemala <istjanichtzufassen@gmail.com> " Author: Daniel Schemala <istjanichtzufassen@gmail.com>
" Description: rustc for rust files " Description: rustc for rust files
call ale#Set('rust_rustc_options', '-Z no-codegen') call ale#Set('rust_rustc_options', '--emit=mir -o /dev/null')
function! ale_linters#rust#rustc#RustcCommand(buffer) abort function! ale_linters#rust#rustc#RustcCommand(buffer) abort
" Try to guess the library search path. If the project is managed by cargo, " Try to guess the library search path. If the project is managed by cargo,

View file

@ -21,7 +21,13 @@ function! ale_linters#terraform#terraform#GetType(severity) abort
endfunction endfunction
function! ale_linters#terraform#terraform#GetDetail(error) abort function! ale_linters#terraform#terraform#GetDetail(error) abort
return get(a:error, 'detail', get(a:error, 'summary', '')) let l:detail = get(a:error, 'detail', '')
if strlen(l:detail) > 0
return l:detail
else
return get(a:error, 'summary', '')
endif
endfunction endfunction
function! ale_linters#terraform#terraform#Handle(buffer, lines) abort function! ale_linters#terraform#terraform#Handle(buffer, lines) abort

View file

@ -4,6 +4,7 @@
call ale#Set('tex_texlab_executable', 'texlab') call ale#Set('tex_texlab_executable', 'texlab')
call ale#Set('tex_texlab_options', '') call ale#Set('tex_texlab_options', '')
call ale#Set('tex_texlab_config', {})
function! ale_linters#tex#texlab#GetProjectRoot(buffer) abort function! ale_linters#tex#texlab#GetProjectRoot(buffer) abort
let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git') let l:git_path = ale#path#FindNearestDirectory(a:buffer, '.git')
@ -21,4 +22,5 @@ call ale#linter#Define('tex', {
\ 'executable': {b -> ale#Var(b, 'tex_texlab_executable')}, \ 'executable': {b -> ale#Var(b, 'tex_texlab_executable')},
\ 'command': function('ale_linters#tex#texlab#GetCommand'), \ 'command': function('ale_linters#tex#texlab#GetCommand'),
\ 'project_root': function('ale_linters#tex#texlab#GetProjectRoot'), \ 'project_root': function('ale_linters#tex#texlab#GetProjectRoot'),
\ 'lsp_config': {b -> ale#Var(b, 'tex_texlab_config')},
\}) \})

View file

@ -157,7 +157,7 @@ function! ale#Queue(delay, ...) abort
endif endif
endfunction endfunction
let s:current_ale_version = [3, 1, 0] let s:current_ale_version = [3, 2, 0]
" A function used to check for ALE features in files outside of the project. " A function used to check for ALE features in files outside of the project.
function! ale#Has(feature) abort function! ale#Has(feature) abort

View file

@ -16,13 +16,12 @@ endfunction
function! ale#code_action#HandleCodeAction(code_action, options) abort function! ale#code_action#HandleCodeAction(code_action, options) abort
let l:current_buffer = bufnr('') let l:current_buffer = bufnr('')
let l:changes = a:code_action.changes let l:changes = a:code_action.changes
let l:should_save = get(a:options, 'should_save')
for l:file_code_edit in l:changes for l:file_code_edit in l:changes
call ale#code_action#ApplyChanges( call ale#code_action#ApplyChanges(
\ l:file_code_edit.fileName, \ l:file_code_edit.fileName,
\ l:file_code_edit.textChanges, \ l:file_code_edit.textChanges,
\ l:should_save, \ a:options,
\) \)
endfor endfor
endfunction endfunction
@ -63,28 +62,28 @@ function! s:ChangeCmp(left, right) abort
return 0 return 0
endfunction endfunction
function! ale#code_action#ApplyChanges(filename, changes, should_save) abort function! ale#code_action#ApplyChanges(filename, changes, options) abort
let l:current_buffer = bufnr('') let l:should_save = get(a:options, 'should_save')
let l:conn_id = get(a:options, 'conn_id')
let l:orig_buffer = bufnr('')
" The buffer is used to determine the fileformat, if available. " The buffer is used to determine the fileformat, if available.
let l:buffer = bufnr(a:filename) let l:buffer = bufnr(a:filename)
let l:is_current_buffer = l:buffer > 0 && l:buffer == l:current_buffer
if l:buffer > 0 if l:buffer != l:orig_buffer
call ale#util#Execute('silent edit ' . a:filename)
let l:buffer = bufnr('')
endif
let l:lines = getbufline(l:buffer, 1, '$') let l:lines = getbufline(l:buffer, 1, '$')
" Add empty line if there's trailing newline, like readfile() does. " Add empty line if there's trailing newline, like readfile() does.
if getbufvar(l:buffer, '&eol') if getbufvar(l:buffer, '&eol')
let l:lines += [''] let l:lines += ['']
endif endif
else
let l:lines = readfile(a:filename, 'b')
endif
if l:is_current_buffer
let l:pos = getpos('.')[1:2] let l:pos = getpos('.')[1:2]
else
let l:pos = [1, 1]
endif
" Changes have to be sorted so we apply them from bottom-to-top " Changes have to be sorted so we apply them from bottom-to-top
for l:code_edit in reverse(sort(copy(a:changes), function('s:ChangeCmp'))) for l:code_edit in reverse(sort(copy(a:changes), function('s:ChangeCmp')))
@ -155,46 +154,25 @@ function! ale#code_action#ApplyChanges(filename, changes, should_save) abort
endif endif
endfor endfor
if l:buffer > 0 " Make sure to add a trailing newline if and only if it should be added.
" Make sure ale#util#{Writefile,SetBufferContents} add trailing
" newline if and only if it should be added.
if l:lines[-1] is# '' && getbufvar(l:buffer, '&eol') if l:lines[-1] is# '' && getbufvar(l:buffer, '&eol')
call remove(l:lines, -1) call remove(l:lines, -1)
else else
call setbufvar(l:buffer, '&eol', 0) call setbufvar(l:buffer, '&eol', 0)
endif endif
elseif exists('+fixeol') && &fixeol && l:lines[-1] is# ''
" Not in buffer, ale#util#Writefile can't check &eol and always adds
" newline if &fixeol: remove to prevent double trailing newline.
call remove(l:lines, -1)
endif
if a:should_save || l:buffer < 0
call ale#util#Writefile(l:buffer, l:lines, a:filename)
else
call ale#util#SetBufferContents(l:buffer, l:lines) call ale#util#SetBufferContents(l:buffer, l:lines)
endif
if l:is_current_buffer call ale#lsp#NotifyForChanges(l:conn_id, l:buffer)
if a:should_save
call ale#util#Execute(':e!') if l:should_save
call ale#util#Execute('silent w!')
endif endif
call setpos('.', [0, l:pos[0], l:pos[1], 0]) call setpos('.', [0, l:pos[0], l:pos[1], 0])
endif
if a:should_save && l:buffer > 0 && !l:is_current_buffer if l:orig_buffer != l:buffer && bufexists(l:orig_buffer)
" Set up a one-time use event that will delete itself to reload the call ale#util#Execute('silent buf ' . string(l:orig_buffer))
" buffer next time it's entered to view the changes made to it.
execute 'augroup ALECodeActionReloadGroup' . l:buffer
autocmd!
execute printf(
\ 'autocmd BufEnter <buffer=%d>'
\ . ' call ale#code_action#ReloadBuffer()',
\ l:buffer
\)
augroup END
endif endif
endfunction endfunction
@ -300,7 +278,7 @@ function! ale#code_action#BuildChangesList(changes_map) abort
endfor endfor
call add(l:changes, { call add(l:changes, {
\ 'fileName': ale#path#FromURI(l:file_name), \ 'fileName': ale#util#ToResource(l:file_name),
\ 'textChanges': l:text_changes, \ 'textChanges': l:text_changes,
\}) \})
endfor endfor

View file

@ -391,8 +391,8 @@ function! s:OnReady(
\ 'character': l:nearest_error.col - 1, \ 'character': l:nearest_error.col - 1,
\ }, \ },
\ 'end': { \ 'end': {
\ 'line': l:nearest_error.end_lnum - 1, \ 'line': get(l:nearest_error, 'end_lnum', 1) - 1,
\ 'character': l:nearest_error.end_col, \ 'character': get(l:nearest_error, 'end_col', 0)
\ }, \ },
\ }, \ },
\ }, \ },
@ -457,7 +457,7 @@ function! s:ExecuteGetCodeFix(linter, range, MenuCallback) abort
let [l:end_line, l:end_column] = getpos("'>")[1:2] let [l:end_line, l:end_column] = getpos("'>")[1:2]
endif endif
let l:column = min([l:column, len(getline(l:line))]) let l:column = max([min([l:column, len(getline(l:line))]), 1])
let l:end_column = min([l:end_column, len(getline(l:end_line))]) let l:end_column = min([l:end_column, len(getline(l:end_line))])
let l:Callback = function( let l:Callback = function(

View file

@ -16,7 +16,7 @@ onoremap <silent> <Plug>(ale_show_completion_menu) <Nop>
let g:ale_completion_delay = get(g:, 'ale_completion_delay', 100) let g:ale_completion_delay = get(g:, 'ale_completion_delay', 100)
let g:ale_completion_excluded_words = get(g:, 'ale_completion_excluded_words', []) let g:ale_completion_excluded_words = get(g:, 'ale_completion_excluded_words', [])
let g:ale_completion_max_suggestions = get(g:, 'ale_completion_max_suggestions', 50) let g:ale_completion_max_suggestions = get(g:, 'ale_completion_max_suggestions', 50)
let g:ale_completion_autoimport = get(g:, 'ale_completion_autoimport', 0) let g:ale_completion_autoimport = get(g:, 'ale_completion_autoimport', 1)
let g:ale_completion_tsserver_remove_warnings = get(g:, 'ale_completion_tsserver_remove_warnings', 0) let g:ale_completion_tsserver_remove_warnings = get(g:, 'ale_completion_tsserver_remove_warnings', 0)
let s:timer_id = -1 let s:timer_id = -1
@ -133,11 +133,13 @@ let s:should_complete_map = {
\ 'typescript': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$|\.$|''$|"$', \ 'typescript': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$|\.$|''$|"$',
\ 'rust': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$|\.$|::$', \ 'rust': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$|\.$|::$',
\ 'cpp': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$|\.$|::$|-\>$', \ 'cpp': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$|\.$|::$|-\>$',
\ 'c': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$|\.$|-\>$',
\} \}
" Regular expressions for finding the start column to replace with completion. " Regular expressions for finding the start column to replace with completion.
let s:omni_start_map = { let s:omni_start_map = {
\ '<default>': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$', \ '<default>': '\v[a-zA-Z$_][a-zA-Z$_0-9]*$',
\ 'racket': '\k\+',
\} \}
" A map of exact characters for triggering LSP completions. Do not forget to " A map of exact characters for triggering LSP completions. Do not forget to
@ -147,6 +149,7 @@ let s:trigger_character_map = {
\ 'typescript': ['.', '''', '"'], \ 'typescript': ['.', '''', '"'],
\ 'rust': ['.', '::'], \ 'rust': ['.', '::'],
\ 'cpp': ['.', '::', '->'], \ 'cpp': ['.', '::', '->'],
\ 'c': ['.', '->'],
\} \}
function! s:GetFiletypeValue(map, filetype) abort function! s:GetFiletypeValue(map, filetype) abort
@ -581,7 +584,7 @@ function! ale#completion#ParseLSPCompletions(response) abort
continue continue
endif endif
if get(l:item, 'insertTextFormat') is s:LSP_INSERT_TEXT_FORMAT_PLAIN if get(l:item, 'insertTextFormat', s:LSP_INSERT_TEXT_FORMAT_PLAIN) is s:LSP_INSERT_TEXT_FORMAT_PLAIN
\&& type(get(l:item, 'textEdit')) is v:t_dict \&& type(get(l:item, 'textEdit')) is v:t_dict
let l:text = l:item.textEdit.newText let l:text = l:item.textEdit.newText
elseif type(get(l:item, 'insertText')) is v:t_string elseif type(get(l:item, 'insertText')) is v:t_string
@ -776,7 +779,8 @@ function! s:OnReady(linter, lsp_details) abort
if a:linter.lsp is# 'tsserver' if a:linter.lsp is# 'tsserver'
if get(g:, 'ale_completion_tsserver_autoimport') is 1 if get(g:, 'ale_completion_tsserver_autoimport') is 1
execute 'echom `g:ale_completion_tsserver_autoimport` is deprecated. Use `g:ale_completion_autoimport` instead.''' " no-custom-checks
echom '`g:ale_completion_tsserver_autoimport` is deprecated. Use `g:ale_completion_autoimport` instead.'
endif endif
let l:message = ale#lsp#tsserver_message#Completions( let l:message = ale#lsp#tsserver_message#Completions(
@ -911,7 +915,8 @@ function! ale#completion#Import() abort
endif endif
let [l:line, l:column] = getpos('.')[1:2] let [l:line, l:column] = getpos('.')[1:2]
let l:column = searchpos('\V' . escape(l:word, '/\'), 'bn', l:line)[1] let l:column = searchpos('\V' . escape(l:word, '/\'), 'bnc', l:line)[1]
let l:column = l:column + len(l:word) - 1
if l:column isnot 0 if l:column isnot 0
let l:started = ale#completion#GetCompletions('ale-import', { let l:started = ale#completion#GetCompletions('ale-import', {

View file

@ -10,12 +10,21 @@ let g:ale_echo_msg_format = get(g:, 'ale_echo_msg_format', '%code: %%s')
let s:cursor_timer = -1 let s:cursor_timer = -1
" A wrapper for echon so we can test messages we echo in Vader tests.
function! ale#cursor#Echom(message) abort
" no-custom-checks
exec "norm! :echom a:message\n"
endfunction
function! ale#cursor#TruncatedEcho(original_message) abort function! ale#cursor#TruncatedEcho(original_message) abort
let l:message = a:original_message let l:message = a:original_message
" Change tabs to spaces. " Change tabs to spaces.
let l:message = substitute(l:message, "\t", ' ', 'g') let l:message = substitute(l:message, "\t", ' ', 'g')
" Remove any newlines in the message. " Remove any newlines in the message.
let l:message = substitute(l:message, "\n", '', 'g') let l:message = substitute(l:message, "\n", '', 'g')
" Convert indentation groups into single spaces for better legibility when
" put on a single line
let l:message = substitute(l:message, ' \+', ' ', 'g')
" We need to remember the setting for shortmess and reset it again. " We need to remember the setting for shortmess and reset it again.
let l:shortmess_options = &l:shortmess let l:shortmess_options = &l:shortmess
@ -27,7 +36,7 @@ function! ale#cursor#TruncatedEcho(original_message) abort
silent! setlocal shortmess+=T silent! setlocal shortmess+=T
try try
exec "norm! :echomsg l:message\n" call ale#cursor#Echom(l:message)
catch /^Vim\%((\a\+)\)\=:E523/ catch /^Vim\%((\a\+)\)\=:E523/
" Fallback into manual truncate (#1987) " Fallback into manual truncate (#1987)
let l:winwidth = winwidth(0) let l:winwidth = winwidth(0)
@ -87,7 +96,9 @@ function! ale#cursor#EchoCursorWarning(...) abort
elseif get(l:info, 'echoed') elseif get(l:info, 'echoed')
" We'll only clear the echoed message when moving off errors once, " We'll only clear the echoed message when moving off errors once,
" so we don't continually clear the echo line. " so we don't continually clear the echo line.
execute 'echo' "
" no-custom-checks
echo
let l:info.echoed = 0 let l:info.echoed = 0
endif endif
endif endif
@ -150,7 +161,8 @@ function! s:ShowCursorDetailForItem(loc, options) abort
" Clear the echo message if we manually displayed details. " Clear the echo message if we manually displayed details.
if !l:stay_here if !l:stay_here
execute 'echo' " no-custom-checks
echo
endif endif
endif endif
endfunction endfunction

View file

@ -62,7 +62,8 @@ let s:global_variable_list = [
\] \]
function! s:Echo(message) abort function! s:Echo(message) abort
execute 'echo a:message' " no-custom-checks
echo a:message
endfunction endfunction
function! s:GetLinterVariables(filetype, exclude_linter_names) abort function! s:GetLinterVariables(filetype, exclude_linter_names) abort

View file

@ -68,18 +68,27 @@ function! ale#definition#HandleLSPResponse(conn_id, response) abort
for l:item in l:result for l:item in l:result
if has_key(l:item, 'targetUri') if has_key(l:item, 'targetUri')
" LocationLink items use targetUri " LocationLink items use targetUri
let l:filename = ale#path#FromURI(l:item.targetUri) let l:uri = l:item.targetUri
let l:line = l:item.targetRange.start.line + 1 let l:line = l:item.targetRange.start.line + 1
let l:column = l:item.targetRange.start.character + 1 let l:column = l:item.targetRange.start.character + 1
else else
" LocationLink items use uri " LocationLink items use uri
let l:filename = ale#path#FromURI(l:item.uri) let l:uri = l:item.uri
let l:line = l:item.range.start.line + 1 let l:line = l:item.range.start.line + 1
let l:column = l:item.range.start.character + 1 let l:column = l:item.range.start.character + 1
endif endif
call ale#definition#UpdateTagStack() call ale#definition#UpdateTagStack()
let l:uri_handler = ale#uri#GetURIHandler(l:uri)
if l:uri_handler is# v:null
let l:filename = ale#path#FromFileURI(l:uri)
call ale#util#Open(l:filename, l:line, l:column, l:options) call ale#util#Open(l:filename, l:line, l:column, l:options)
else
call l:uri_handler.OpenURILink(l:uri, l:line, l:column, l:options, a:conn_id)
endif
break break
endfor endfor
endif endif
@ -112,6 +121,12 @@ function! s:OnReady(line, column, options, capability, linter, lsp_details) abor
\ a:line, \ a:line,
\ a:column \ a:column
\) \)
elseif a:capability is# 'implementation'
let l:message = ale#lsp#tsserver_message#Implementation(
\ l:buffer,
\ a:line,
\ a:column
\)
endif endif
else else
" Send a message saying the buffer has changed first, or the " Send a message saying the buffer has changed first, or the
@ -125,6 +140,8 @@ function! s:OnReady(line, column, options, capability, linter, lsp_details) abor
let l:message = ale#lsp#message#Definition(l:buffer, a:line, a:column) let l:message = ale#lsp#message#Definition(l:buffer, a:line, a:column)
elseif a:capability is# 'typeDefinition' elseif a:capability is# 'typeDefinition'
let l:message = ale#lsp#message#TypeDefinition(l:buffer, a:line, a:column) let l:message = ale#lsp#message#TypeDefinition(l:buffer, a:line, a:column)
elseif a:capability is# 'implementation'
let l:message = ale#lsp#message#Implementation(l:buffer, a:line, a:column)
else else
" XXX: log here? " XXX: log here?
return return
@ -166,6 +183,14 @@ function! ale#definition#GoToType(options) abort
endfor endfor
endfunction endfunction
function! ale#definition#GoToImpl(options) abort
for l:linter in ale#linter#Get(&filetype)
if !empty(l:linter.lsp)
call s:GoToLSPDefinition(l:linter, a:options, 'implementation')
endif
endfor
endfunction
function! ale#definition#GoToCommandHandler(command, ...) abort function! ale#definition#GoToCommandHandler(command, ...) abort
let l:options = {} let l:options = {}
@ -191,6 +216,8 @@ function! ale#definition#GoToCommandHandler(command, ...) abort
if a:command is# 'type' if a:command is# 'type'
call ale#definition#GoToType(l:options) call ale#definition#GoToType(l:options)
elseif a:command is# 'implementation'
call ale#definition#GoToImpl(l:options)
else else
call ale#definition#GoTo(l:options) call ale#definition#GoTo(l:options)
endif endif

View file

@ -347,6 +347,12 @@ function! ale#engine#FixLocList(buffer, linter_name, from_other_source, loclist)
if has_key(l:old_item, 'end_lnum') if has_key(l:old_item, 'end_lnum')
let l:item.end_lnum = str2nr(l:old_item.end_lnum) let l:item.end_lnum = str2nr(l:old_item.end_lnum)
" When the error ends after the end of the file, put it at the
" end. This is only done for the current buffer.
if l:item.bufnr == a:buffer && l:item.end_lnum > l:last_line_number
let l:item.end_lnum = l:last_line_number
endif
endif endif
if has_key(l:old_item, 'sub_type') if has_key(l:old_item, 'sub_type')

View file

@ -156,4 +156,10 @@ function! ale#events#Init() abort
endif endif
endif endif
augroup END augroup END
augroup AleURISchemes
autocmd!
autocmd BufNewFile,BufReadPre jdt://** call ale#uri#jdt#ReadJDTLink(expand('<amatch>'))
augroup END
endfunction endfunction

View file

@ -77,7 +77,8 @@ function! ale#fix#ApplyFixes(buffer, output) abort
call remove(g:ale_fix_buffer_data, a:buffer) call remove(g:ale_fix_buffer_data, a:buffer)
if !l:data.ignore_file_changed_errors if !l:data.ignore_file_changed_errors
execute 'echoerr ''The file was changed before fixing finished''' " no-custom-checks
echoerr 'The file was changed before fixing finished'
endif endif
return return
@ -358,7 +359,8 @@ function! ale#fix#Fix(buffer, fixing_flag, ...) abort
\ 'There is no fixer named `%s`. Check :ALEFixSuggest', \ 'There is no fixer named `%s`. Check :ALEFixSuggest',
\ l:function_name, \ l:function_name,
\) \)
execute 'echom l:echo_message' " no-custom-checks
echom l:echo_message
endif endif
return 0 return 0
@ -366,7 +368,8 @@ function! ale#fix#Fix(buffer, fixing_flag, ...) abort
if empty(l:callback_list) if empty(l:callback_list)
if a:fixing_flag is# '' if a:fixing_flag is# ''
execute 'echom ''No fixers have been defined. Try :ALEFixSuggest''' " no-custom-checks
echom 'No fixers have been defined. Try :ALEFixSuggest'
endif endif
return 0 return 0

View file

@ -37,6 +37,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['python'], \ 'suggested_filetypes': ['python'],
\ 'description': 'Fix PEP8 issues with black.', \ 'description': 'Fix PEP8 issues with black.',
\ }, \ },
\ 'buf-format': {
\ 'function': 'ale#fixers#buf_format#Fix',
\ 'suggested_filetypes': ['proto'],
\ 'description': 'Fix .proto files with buf format.',
\ },
\ 'buildifier': { \ 'buildifier': {
\ 'function': 'ale#fixers#buildifier#Fix', \ 'function': 'ale#fixers#buildifier#Fix',
\ 'suggested_filetypes': ['bzl'], \ 'suggested_filetypes': ['bzl'],
@ -73,6 +78,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['dhall'], \ 'suggested_filetypes': ['dhall'],
\ 'description': 'Standard code formatter for the Dhall language and removing dead code', \ 'description': 'Standard code formatter for the Dhall language and removing dead code',
\ }, \ },
\ 'dune': {
\ 'function': 'ale#fixers#dune#Fix',
\ 'suggested_filetypes': ['dune'],
\ 'description': 'Fix dune files with dune format',
\ },
\ 'fecs': { \ 'fecs': {
\ 'function': 'ale#fixers#fecs#Fix', \ 'function': 'ale#fixers#fecs#Fix',
\ 'suggested_filetypes': ['javascript', 'css', 'html'], \ 'suggested_filetypes': ['javascript', 'css', 'html'],
@ -131,6 +141,11 @@ let s:default_registry = {
\ 'description': 'Apply prettier-eslint to a file.', \ 'description': 'Apply prettier-eslint to a file.',
\ 'aliases': ['prettier-eslint'], \ 'aliases': ['prettier-eslint'],
\ }, \ },
\ 'pyflyby': {
\ 'function': 'ale#fixers#pyflyby#Fix',
\ 'suggested_filetypes': ['python'],
\ 'description': 'Tidy Python imports with pyflyby.',
\ },
\ 'importjs': { \ 'importjs': {
\ 'function': 'ale#fixers#importjs#Fix', \ 'function': 'ale#fixers#importjs#Fix',
\ 'suggested_filetypes': ['javascript'], \ 'suggested_filetypes': ['javascript'],
@ -191,6 +206,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['ruby'], \ 'suggested_filetypes': ['ruby'],
\ 'description': 'Fix ruby files with standardrb --fix', \ 'description': 'Fix ruby files with standardrb --fix',
\ }, \ },
\ 'statix': {
\ 'function': 'ale#fixers#statix#Fix',
\ 'suggested_filetypes': ['nix'],
\ 'description': 'Fix common Nix antipatterns with statix fix',
\ },
\ 'stylelint': { \ 'stylelint': {
\ 'function': 'ale#fixers#stylelint#Fix', \ 'function': 'ale#fixers#stylelint#Fix',
\ 'suggested_filetypes': ['css', 'sass', 'scss', 'sugarss', 'stylus'], \ 'suggested_filetypes': ['css', 'sass', 'scss', 'sugarss', 'stylus'],
@ -216,6 +236,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['php'], \ 'suggested_filetypes': ['php'],
\ 'description': 'Fix PHP files with php-cs-fixer.', \ 'description': 'Fix PHP files with php-cs-fixer.',
\ }, \ },
\ 'pint': {
\ 'function': 'ale#fixers#pint#Fix',
\ 'suggested_filetypes': ['php'],
\ 'description': 'Fix PHP files with Laravel Pint.',
\ },
\ 'astyle': { \ 'astyle': {
\ 'function': 'ale#fixers#astyle#Fix', \ 'function': 'ale#fixers#astyle#Fix',
\ 'suggested_filetypes': ['c', 'cpp'], \ 'suggested_filetypes': ['c', 'cpp'],
@ -246,6 +271,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['go'], \ 'suggested_filetypes': ['go'],
\ 'description': 'Fix Go files with go fmt.', \ 'description': 'Fix Go files with go fmt.',
\ }, \ },
\ 'gofumpt': {
\ 'function': 'ale#fixers#gofumpt#Fix',
\ 'suggested_filetypes': ['go'],
\ 'description': 'Fix Go files with gofumpt, a stricter go fmt.',
\ },
\ 'goimports': { \ 'goimports': {
\ 'function': 'ale#fixers#goimports#Fix', \ 'function': 'ale#fixers#goimports#Fix',
\ 'suggested_filetypes': ['go'], \ 'suggested_filetypes': ['go'],
@ -421,6 +451,16 @@ let s:default_registry = {
\ 'suggested_filetypes': ['hcl', 'terraform'], \ 'suggested_filetypes': ['hcl', 'terraform'],
\ 'description': 'Fix tf and hcl files with terraform fmt.', \ 'description': 'Fix tf and hcl files with terraform fmt.',
\ }, \ },
\ 'packer': {
\ 'function': 'ale#fixers#packer#Fix',
\ 'suggested_filetypes': ['hcl', 'packer'],
\ 'description': 'Fix Packer HCL files with packer fmt.',
\ },
\ 'crystal': {
\ 'function': 'ale#fixers#crystal#Fix',
\ 'suggested_filetypes': ['cr'],
\ 'description': 'Fix cr (crystal).',
\ },
\ 'ktlint': { \ 'ktlint': {
\ 'function': 'ale#fixers#ktlint#Fix', \ 'function': 'ale#fixers#ktlint#Fix',
\ 'suggested_filetypes': ['kt', 'kotlin'], \ 'suggested_filetypes': ['kt', 'kotlin'],
@ -481,6 +521,11 @@ let s:default_registry = {
\ 'suggested_filetypes': ['lua'], \ 'suggested_filetypes': ['lua'],
\ 'description': 'Fix Lua files with luafmt.', \ 'description': 'Fix Lua files with luafmt.',
\ }, \ },
\ 'dprint': {
\ 'function': 'ale#fixers#dprint#Fix',
\ 'suggested_filetypes': ['javascript', 'typescript', 'json', 'markdown'],
\ 'description': 'Pluggable and configurable code formatting platform',
\ },
\ 'stylua': { \ 'stylua': {
\ 'function': 'ale#fixers#stylua#Fix', \ 'function': 'ale#fixers#stylua#Fix',
\ 'suggested_filetypes': ['lua'], \ 'suggested_filetypes': ['lua'],
@ -501,10 +546,20 @@ let s:default_registry = {
\ 'suggested_filetypes': ['pascal'], \ 'suggested_filetypes': ['pascal'],
\ 'description': 'Fix Pascal files with ptop.', \ 'description': 'Fix Pascal files with ptop.',
\ }, \ },
\ 'opafmt': {
\ 'function': 'ale#fixers#opafmt#Fix',
\ 'suggested_filetypes': ['rego'],
\ 'description': 'Fix rego files with opa fmt.',
\ },
\ 'vfmt': { \ 'vfmt': {
\ 'function': 'ale#fixers#vfmt#Fix', \ 'function': 'ale#fixers#vfmt#Fix',
\ 'suggested_filetypes': ['v'], \ 'suggested_filetypes': ['v'],
\ 'description': 'A formatter for V source code.', \ 'description': 'A formatter for V source code.',
\ },
\ 'zigfmt': {
\ 'function': 'ale#fixers#zigfmt#Fix',
\ 'suggested_filetypes': ['zig'],
\ 'description': 'Official formatter for Zig',
\ } \ }
\} \}

View file

@ -5,27 +5,13 @@ scriptencoding utf-8
call ale#Set('sh_shfmt_executable', 'shfmt') call ale#Set('sh_shfmt_executable', 'shfmt')
call ale#Set('sh_shfmt_options', '') call ale#Set('sh_shfmt_options', '')
function! s:DefaultOption(buffer) abort
if getbufvar(a:buffer, '&expandtab') == 0
" Tab is used by default
return ''
endif
let l:tabsize = getbufvar(a:buffer, '&shiftwidth')
if l:tabsize == 0
let l:tabsize = getbufvar(a:buffer, '&tabstop')
endif
return ' -i ' . l:tabsize
endfunction
function! ale#fixers#shfmt#Fix(buffer) abort function! ale#fixers#shfmt#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'sh_shfmt_executable') let l:executable = ale#Var(a:buffer, 'sh_shfmt_executable')
let l:options = ale#Var(a:buffer, 'sh_shfmt_options') let l:options = ale#Var(a:buffer, 'sh_shfmt_options')
return { return {
\ 'command': ale#Escape(l:executable) \ 'command': ale#Escape(l:executable)
\ . (empty(l:options) ? s:DefaultOption(a:buffer) : ' ' . l:options) \ . ' -filename=%s'
\ . (empty(l:options) ? '' : ' ' . l:options)
\} \}
endfunction endfunction

View file

@ -4,6 +4,22 @@
call ale#Set('c_uncrustify_executable', 'uncrustify') call ale#Set('c_uncrustify_executable', 'uncrustify')
call ale#Set('c_uncrustify_options', '') call ale#Set('c_uncrustify_options', '')
let s:languages = {
\ 'c': 'C',
\ 'cpp': 'CPP',
\ 'cs': 'CS',
\ 'objc': 'OC',
\ 'objcpp': 'OC+',
\ 'd': 'D',
\ 'java': 'JAVA',
\ 'vala': 'VALA',
\ 'p': 'PAWN',
\}
function! ale#fixers#uncrustify#Language(buffer) abort
return get(s:languages, &filetype, 'C')
endfunction
function! ale#fixers#uncrustify#Fix(buffer) abort function! ale#fixers#uncrustify#Fix(buffer) abort
let l:executable = ale#Var(a:buffer, 'c_uncrustify_executable') let l:executable = ale#Var(a:buffer, 'c_uncrustify_executable')
let l:options = ale#Var(a:buffer, 'c_uncrustify_options') let l:options = ale#Var(a:buffer, 'c_uncrustify_options')
@ -11,6 +27,7 @@ function! ale#fixers#uncrustify#Fix(buffer) abort
return { return {
\ 'command': ale#Escape(l:executable) \ 'command': ale#Escape(l:executable)
\ . ' --no-backup ' \ . ' --no-backup '
\ . (empty(l:options) ? '' : ' ' . l:options) \ . '-l' . ale#Pad(ale#fixers#uncrustify#Language(a:buffer))
\ . ale#Pad(l:options)
\} \}
endfunction endfunction

View file

@ -7,7 +7,8 @@
function! ale#floating_preview#Show(lines, ...) abort function! ale#floating_preview#Show(lines, ...) abort
if !exists('*nvim_open_win') && !has('popupwin') if !exists('*nvim_open_win') && !has('popupwin')
execute 'echom ''Floating windows not supported in this vim instance.''' " no-custom-checks
echom 'Floating windows not supported in this vim instance.'
return return
endif endif
@ -105,18 +106,20 @@ function! s:NvimPrepareWindowContent(lines) abort
let l:width += 2 let l:width += 2
let l:height += 2 let l:height += 2
let l:hor = g:ale_floating_window_border[0] let l:left = get(g:ale_floating_window_border, 0, '|')
let l:top = g:ale_floating_window_border[1] let l:top = get(g:ale_floating_window_border, 1, '-')
let l:top_left = g:ale_floating_window_border[2] let l:top_left = get(g:ale_floating_window_border, 2, '+')
let l:top_right = g:ale_floating_window_border[3] let l:top_right = get(g:ale_floating_window_border, 3, '+')
let l:bottom_right = g:ale_floating_window_border[4] let l:bottom_right = get(g:ale_floating_window_border, 4, '+')
let l:bottom_left = g:ale_floating_window_border[5] let l:bottom_left = get(g:ale_floating_window_border, 5, '+')
let l:right = get(g:ale_floating_window_border, 6, l:left)
let l:bottom = get(g:ale_floating_window_border, 7, l:top)
let l:lines = [l:top_left . repeat(l:top, l:width - 2) . l:top_right] let l:lines = [l:top_left . repeat(l:top, l:width - 2) . l:top_right]
for l:line in a:lines for l:line in a:lines
let l:line_width = strchars(l:line) let l:line_width = strchars(l:line)
let l:lines = add(l:lines, l:hor . l:line . repeat(' ', l:width - l:line_width - 2). l:hor) let l:lines = add(l:lines, l:left . l:line . repeat(' ', l:width - l:line_width - 2). l:right)
endfor endfor
" Truncate the lines " Truncate the lines
@ -124,7 +127,7 @@ function! s:NvimPrepareWindowContent(lines) abort
let l:lines = l:lines[0:l:max_height] let l:lines = l:lines[0:l:max_height]
endif endif
let l:lines = add(l:lines, l:bottom_left . repeat(l:top, l:width - 2) . l:bottom_right) let l:lines = add(l:lines, l:bottom_left . repeat(l:bottom, l:width - 2) . l:bottom_right)
return [l:lines, l:width, l:height] return [l:lines, l:width, l:height]
endfunction endfunction
@ -157,14 +160,14 @@ function! s:VimCreate(options) abort
\ 'padding': [0, 1, 0, 1], \ 'padding': [0, 1, 0, 1],
\ 'border': [], \ 'border': [],
\ 'borderchars': empty(g:ale_floating_window_border) ? [' '] : [ \ 'borderchars': empty(g:ale_floating_window_border) ? [' '] : [
\ g:ale_floating_window_border[1], \ get(g:ale_floating_window_border, 1, '-'),
\ g:ale_floating_window_border[0], \ get(g:ale_floating_window_border, 6, '|'),
\ g:ale_floating_window_border[1], \ get(g:ale_floating_window_border, 7, '-'),
\ g:ale_floating_window_border[0], \ get(g:ale_floating_window_border, 0, '|'),
\ g:ale_floating_window_border[2], \ get(g:ale_floating_window_border, 2, '+'),
\ g:ale_floating_window_border[3], \ get(g:ale_floating_window_border, 3, '+'),
\ g:ale_floating_window_border[4], \ get(g:ale_floating_window_border, 4, '+'),
\ g:ale_floating_window_border[5], \ get(g:ale_floating_window_border, 5, '+'),
\ ], \ ],
\ 'moved': 'any', \ 'moved': 'any',
\ }) \ })

View file

@ -11,8 +11,9 @@ endfunction
function! ale#handlers#alex#CreateCommandCallback(flags) abort function! ale#handlers#alex#CreateCommandCallback(flags) abort
return {b -> ale#node#Executable(b, ale#handlers#alex#GetExecutable(b)) return {b -> ale#node#Executable(b, ale#handlers#alex#GetExecutable(b))
\ . ' %s ' \ . ' --stdin '
\ . a:flags} \ . a:flags
\}
endfunction endfunction
function! ale#handlers#alex#Handle(buffer, lines) abort function! ale#handlers#alex#Handle(buffer, lines) abort
@ -38,6 +39,7 @@ endfunction
" Define a linter for a specific filetype. Accept flags to adapt to the filetype. " Define a linter for a specific filetype. Accept flags to adapt to the filetype.
" no flags treat input as markdown " no flags treat input as markdown
" --html treat input as HTML " --html treat input as HTML
" --mdx treat input as MDX
" --text treat input as plaintext " --text treat input as plaintext
function! ale#handlers#alex#DefineLinter(filetype, flags) abort function! ale#handlers#alex#DefineLinter(filetype, flags) abort
call ale#Set('alex_executable', 'alex') call ale#Set('alex_executable', 'alex')
@ -49,6 +51,5 @@ function! ale#handlers#alex#DefineLinter(filetype, flags) abort
\ 'command': ale#handlers#alex#CreateCommandCallback(a:flags), \ 'command': ale#handlers#alex#CreateCommandCallback(a:flags),
\ 'output_stream': 'stderr', \ 'output_stream': 'stderr',
\ 'callback': 'ale#handlers#alex#Handle', \ 'callback': 'ale#handlers#alex#Handle',
\ 'lint_file': 1,
\}) \})
endfunction endfunction

View file

@ -19,6 +19,18 @@ function! ale#handlers#cppcheck#GetBufferPathIncludeOptions(buffer) abort
endfunction endfunction
function! ale#handlers#cppcheck#GetCompileCommandsOptions(buffer) abort function! ale#handlers#cppcheck#GetCompileCommandsOptions(buffer) abort
" The compile_commands.json doesn't apply to headers and cppheck will
" bail out if it cannot find a file matching the filter, below. Skip out
" now, for headers. Also, suppress FPs; cppcheck is not meant to
" process lone header files.
let b:buffer_name = bufname(a:buffer)
let b:file_extension = fnamemodify(b:buffer_name, ':e')
if b:file_extension is# 'h' || b:file_extension is# 'hpp'
return ale#handlers#cppcheck#GetBufferPathIncludeOptions(a:buffer)
\ . ' --suppress=unusedStructMember'
endif
" If the current buffer is modified, using compile_commands.json does no " If the current buffer is modified, using compile_commands.json does no
" good, so include the file's directory instead. It's not quite as good as " good, so include the file's directory instead. It's not quite as good as
" using --project, but is at least equivalent to running cppcheck on this " using --project, but is at least equivalent to running cppcheck on this
@ -35,8 +47,10 @@ function! ale#handlers#cppcheck#GetCompileCommandsOptions(buffer) abort
" then use the file to set up import paths, etc. " then use the file to set up import paths, etc.
let [l:dir, l:json_path] = ale#c#FindCompileCommands(a:buffer) let [l:dir, l:json_path] = ale#c#FindCompileCommands(a:buffer)
" By default, cppcheck processes every config in compile_commands.json.
" Use --file-filter to limit to just the buffer file.
return !empty(l:json_path) return !empty(l:json_path)
\ ? '--project=' . ale#Escape(l:json_path[len(l:dir) + 1: ]) \ ? '--project=' . ale#Escape(l:json_path[len(l:dir) + 1: ]) . ' --file-filter=' . ale#Escape(bufname(a:buffer))
\ : '' \ : ''
endfunction endfunction
@ -50,7 +64,12 @@ function! ale#handlers#cppcheck#HandleCppCheckFormat(buffer, lines) abort
"test.cpp:974:{column}: error:{inconclusive:inconclusive} Array 'n[3]' accessed at index 3, which is out of bounds. [arrayIndexOutOfBounds]\ "test.cpp:974:{column}: error:{inconclusive:inconclusive} Array 'n[3]' accessed at index 3, which is out of bounds. [arrayIndexOutOfBounds]\
" n[3]=3; " n[3]=3;
" ^ " ^
let l:pattern = '\v(\f+):(\d+):(\d+|\{column\}): (\w+):(\{inconclusive:inconclusive\})? ?(.*) \[(\w+)\]\' "
"" OR if using the misra addon:
"test.c:1:16: style: misra violation (use --rule-texts=<file> to get proper output) [misra-c2012-2.7]\'
"void test( int parm ) {}
" ^
let l:pattern = '\v(\f+):(\d+):(\d+|\{column\}): (\w+):(\{inconclusive:inconclusive\})? ?(.*) \[(%(\w[-.]?)+)\]\'
let l:output = [] let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern) for l:match in ale#util#GetMatches(a:lines, l:pattern)

View file

@ -19,6 +19,16 @@ let s:temp_regex_prefix =
\ . substitute(s:temp_dir, '\\', '\\\\', 'g') \ . substitute(s:temp_dir, '\\', '\\\\', 'g')
\ . '\.\{-}' \ . '\.\{-}'
function! s:PanicOutput(lines) abort
return [{
\ 'lnum': 1,
\ 'col': 1,
\ 'text': 'ghc panic!',
\ 'type': 'E',
\ 'detail' : join(a:lines, "\n"),
\}]
endfunction
function! ale#handlers#haskell#HandleGHCFormat(buffer, lines) abort function! ale#handlers#haskell#HandleGHCFormat(buffer, lines) abort
" Look for lines like the following. " Look for lines like the following.
" "
@ -34,6 +44,14 @@ function! ale#handlers#haskell#HandleGHCFormat(buffer, lines) abort
let l:corrected_lines = [] let l:corrected_lines = []
" If ghc panic error, put the whole message in details and exit.
let l:panic_position = match(a:lines,'ghc: panic!')
let l:panic_end = match(a:lines,'Please report this as a GHC bug:')
if l:panic_position >= 0
return s:PanicOutput(a:lines[l:panic_position : l:panic_end])
endif
" Group the lines into smaller lists. " Group the lines into smaller lists.
for l:line in a:lines for l:line in a:lines
if len(matchlist(l:line, l:pattern)) > 0 if len(matchlist(l:line, l:pattern)) > 0

View file

@ -63,26 +63,35 @@ function! ale#handlers#sml#Handle(buffer, lines) abort
let l:match2 = matchlist(l:line, l:pattern2) let l:match2 = matchlist(l:line, l:pattern2)
if len(l:match2) != 0 if len(l:match2) != 0
call add(l:out, { if l:match2[1] =~# 'stdIn$'
\ 'filename': l:match2[1], let l:loc = {'bufnr': a:buffer}
else
let l:loc = {'filename': l:match2[1]}
endif
call add(l:out, extend(l:loc, {
\ 'lnum': l:match2[2] + 0, \ 'lnum': l:match2[2] + 0,
\ 'col' : l:match2[3] - 1, \ 'col' : l:match2[3] - 1,
\ 'text': l:match2[4], \ 'text': l:match2[4],
\ 'type': l:match2[4] =~# '^Warning' ? 'W' : 'E', \ 'type': l:match2[4] =~# '^Warning' ? 'W' : 'E',
\}) \}))
continue continue
endif endif
let l:match = matchlist(l:line, l:pattern) let l:match = matchlist(l:line, l:pattern)
if len(l:match) != 0 if len(l:match) != 0
call add(l:out, { if l:match[1] =~# 'stdIn$'
\ 'filename': l:match[1], let l:loc = {'bufnr': a:buffer}
else
let l:loc = {'filename': l:match[1]}
endif
call add(l:out, extend(l:loc, {
\ 'lnum': l:match[2] + 0, \ 'lnum': l:match[2] + 0,
\ 'text': l:match[3] . ': ' . l:match[4], \ 'text': l:match[3] . ': ' . l:match[4],
\ 'type': l:match[3] is# 'error' ? 'E' : 'W', \ 'type': l:match[3] is# 'error' ? 'E' : 'W',
\}) \}))
continue continue
endif endif
endfor endfor

View file

@ -22,6 +22,26 @@ if !hlexists('ALEInfo')
highlight link ALEInfo ALEWarning highlight link ALEInfo ALEWarning
endif endif
if !hlexists('ALEVirtualTextError')
highlight link ALEVirtualTextError ALEError
endif
if !hlexists('ALEVirtualTextStyleError')
highlight link ALEVirtualTextStyleError ALEVirtualTextError
endif
if !hlexists('ALEVirtualTextWarning')
highlight link ALEVirtualTextWarning ALEWarning
endif
if !hlexists('ALEVirtualTextStyleWarning')
highlight link ALEVirtualTextStyleWarning ALEVirtualTextWarning
endif
if !hlexists('ALEVirtualTextInfo')
highlight link ALEVirtualTextInfo ALEVirtualTextWarning
endif
" The maximum number of items for the second argument of matchaddpos() " The maximum number of items for the second argument of matchaddpos()
let s:MAX_POS_VALUES = 8 let s:MAX_POS_VALUES = 8
let s:MAX_COL_SIZE = 1073741824 " pow(2, 30) let s:MAX_COL_SIZE = 1073741824 " pow(2, 30)

View file

@ -46,7 +46,7 @@ function! ale#hover#HandleTSServerResponse(conn_id, response) abort
call balloon_show(a:response.body.displayString) call balloon_show(a:response.body.displayString)
elseif get(l:options, 'truncated_echo', 0) elseif get(l:options, 'truncated_echo', 0)
if !empty(a:response.body.displayString) if !empty(a:response.body.displayString)
call ale#cursor#TruncatedEcho(split(a:response.body.displayString, "\n")[0]) call ale#cursor#TruncatedEcho(a:response.body.displayString)
endif endif
elseif g:ale_hover_to_floating_preview || g:ale_floating_preview elseif g:ale_hover_to_floating_preview || g:ale_floating_preview
call ale#floating_preview#Show(split(a:response.body.displayString, "\n"), { call ale#floating_preview#Show(split(a:response.body.displayString, "\n"), {
@ -231,7 +231,11 @@ function! ale#hover#HandleLSPResponse(conn_id, response) abort
\&& (l:set_balloons is 1 || l:set_balloons is# 'hover') \&& (l:set_balloons is 1 || l:set_balloons is# 'hover')
call balloon_show(join(l:lines, "\n")) call balloon_show(join(l:lines, "\n"))
elseif get(l:options, 'truncated_echo', 0) elseif get(l:options, 'truncated_echo', 0)
if type(l:lines[0]) is# v:t_list
call ale#cursor#TruncatedEcho(join(l:lines[0], '\n'))
else
call ale#cursor#TruncatedEcho(l:lines[0]) call ale#cursor#TruncatedEcho(l:lines[0])
endif
elseif g:ale_hover_to_floating_preview || g:ale_floating_preview elseif g:ale_hover_to_floating_preview || g:ale_floating_preview
call ale#floating_preview#Show(l:lines, { call ale#floating_preview#Show(l:lines, {
\ 'filetype': 'ale-preview.message', \ 'filetype': 'ale-preview.message',

View file

@ -187,10 +187,16 @@ function! ale#job#PrepareCommand(buffer, command) abort
\ : a:command \ : a:command
" If a custom shell is specified, use that. " If a custom shell is specified, use that.
if exists('g:ale_shell') if exists('b:ale_shell')
let l:shell_arguments = get(g:, 'ale_shell_arguments', &shellcmdflag) let l:ale_shell = b:ale_shell
elseif exists('g:ale_shell')
let l:ale_shell = g:ale_shell
endif
return split(g:ale_shell) + split(l:shell_arguments) + [l:command] if exists('l:ale_shell')
let l:shell_arguments = get(b:, 'ale_shell_arguments', get(g:, 'ale_shell_arguments', &shellcmdflag))
return split(l:ale_shell) + split(l:shell_arguments) + [l:command]
endif endif
if has('win32') if has('win32')
@ -244,10 +250,16 @@ function! ale#job#Start(command, options) abort
if has_key(a:options, 'out_cb') if has_key(a:options, 'out_cb')
let l:job_options.out_cb = function('s:VimOutputCallback') let l:job_options.out_cb = function('s:VimOutputCallback')
else
" prevent buffering of output and excessive polling in case close_cb is set
let l:job_options.out_cb = {->0}
endif endif
if has_key(a:options, 'err_cb') if has_key(a:options, 'err_cb')
let l:job_options.err_cb = function('s:VimErrorCallback') let l:job_options.err_cb = function('s:VimErrorCallback')
else
" prevent buffering of output and excessive polling in case close_cb is set
let l:job_options.err_cb = {->0}
endif endif
if has_key(a:options, 'exit_cb') if has_key(a:options, 'exit_cb')

View file

@ -19,6 +19,7 @@ let s:default_ale_linter_aliases = {
\ 'rmd': 'r', \ 'rmd': 'r',
\ 'systemverilog': 'verilog', \ 'systemverilog': 'verilog',
\ 'typescriptreact': ['typescript', 'tsx'], \ 'typescriptreact': ['typescript', 'tsx'],
\ 'vader': ['vim', 'vader'],
\ 'verilog_systemverilog': ['verilog_systemverilog', 'verilog'], \ 'verilog_systemverilog': ['verilog_systemverilog', 'verilog'],
\ 'vimwiki': 'markdown', \ 'vimwiki': 'markdown',
\ 'vue': ['vue', 'javascript'], \ 'vue': ['vue', 'javascript'],
@ -45,15 +46,20 @@ let s:default_ale_linters = {
\ 'hack': ['hack'], \ 'hack': ['hack'],
\ 'help': [], \ 'help': [],
\ 'inko': ['inko'], \ 'inko': ['inko'],
\ 'json': ['jsonlint', 'spectral', 'vscodejson'],
\ 'json5': [],
\ 'jsonc': [],
\ 'perl': ['perlcritic'], \ 'perl': ['perlcritic'],
\ 'perl6': [], \ 'perl6': [],
\ 'python': ['flake8', 'mypy', 'pylint', 'pyright'], \ 'python': ['flake8', 'mypy', 'pylint', 'pyright'],
\ 'rust': ['cargo', 'rls'], \ 'rust': ['cargo', 'rls'],
\ 'spec': [], \ 'spec': [],
\ 'text': [], \ 'text': [],
\ 'vader': ['vimls'],
\ 'vue': ['eslint', 'vls'], \ 'vue': ['eslint', 'vls'],
\ 'zsh': ['shell'], \ 'zsh': ['shell'],
\ 'v': ['v'], \ 'v': ['v'],
\ 'yaml': ['spectral', 'yaml-language-server', 'yamllint'],
\} \}
" Testing/debugging helper to unload all linters. " Testing/debugging helper to unload all linters.

View file

@ -36,12 +36,22 @@ function! ale#list#IsQuickfixOpen() abort
endfunction endfunction
" Check if we should open the list, based on the save event being fired, and " Check if we should open the list, based on the save event being fired, and
" that setting being on, or the setting just being set to `1`. " that setting being on, or that the error count is at least as high as the
function! s:ShouldOpen(buffer) abort " setting when set to an integer value.
function! s:ShouldOpen(buffer, loclist_len) abort
let l:val = ale#Var(a:buffer, 'open_list') let l:val = ale#Var(a:buffer, 'open_list')
let l:saved = getbufvar(a:buffer, 'ale_save_event_fired', 0) let l:saved = getbufvar(a:buffer, 'ale_save_event_fired', 0)
return l:val is 1 || (l:val is# 'on_save' && l:saved) return l:val > 0 ? a:loclist_len >= l:val : l:val is# 'on_save' && l:saved
endfunction
" Check if we should close the list, based on the save event being fired, and
" that setting being on, or the setting just being set to an integer value.
function! s:ShouldClose(buffer) abort
let l:val = ale#Var(a:buffer, 'open_list')
let l:saved = getbufvar(a:buffer, 'ale_save_event_fired', 0)
return !((l:val >= 1) || (l:val is# 'on_save' && l:saved))
endfunction endfunction
function! s:Deduplicate(list) abort function! s:Deduplicate(list) abort
@ -122,9 +132,9 @@ function! s:SetListsImpl(timer_id, buffer, loclist) abort
" Open a window to show the problems if we need to. " Open a window to show the problems if we need to.
" "
" We'll check if the current buffer's List is not empty here, so the " ShouldOpen() checks if the current buffer has enough problems to be
" window will only be opened if the current buffer has problems. " opened.
if s:ShouldOpen(a:buffer) && !empty(a:loclist) if s:ShouldOpen(a:buffer, len(a:loclist))
let l:winnr = winnr() let l:winnr = winnr()
let l:mode = mode() let l:mode = mode()
@ -212,8 +222,25 @@ function! ale#list#SetLists(buffer, loclist) abort
endif endif
endfunction endfunction
function! ale#list#ForcePopulateErrorList(populate_quickfix) abort
let l:quickfix_bak = g:ale_set_quickfix
let g:ale_set_quickfix = a:populate_quickfix
let l:loclist_bak = g:ale_set_loclist
let g:ale_set_loclist = !a:populate_quickfix
let l:open_list_bak = g:ale_open_list
let g:ale_open_list = 1
let l:buffer = bufnr('')
let l:loclist = get(g:ale_buffer_info, l:buffer, {'loclist': []}).loclist
call s:SetListsImpl(-1, l:buffer, l:loclist)
let g:ale_open_list = l:open_list_bak
let g:ale_set_loclist = l:loclist_bak
let g:ale_set_quickfix = l:quickfix_bak
endfunction
function! s:CloseWindowIfNeeded(buffer) abort function! s:CloseWindowIfNeeded(buffer) abort
if ale#Var(a:buffer, 'keep_list_window_open') || !s:ShouldOpen(a:buffer) if ale#Var(a:buffer, 'keep_list_window_open') || s:ShouldClose(a:buffer)
return return
endif endif

View file

@ -38,11 +38,13 @@ function! ale#lsp#Register(executable_or_address, project, init_options) abort
\ 'capabilities': { \ 'capabilities': {
\ 'hover': 0, \ 'hover': 0,
\ 'rename': 0, \ 'rename': 0,
\ 'filerename': 0,
\ 'references': 0, \ 'references': 0,
\ 'completion': 0, \ 'completion': 0,
\ 'completion_trigger_characters': [], \ 'completion_trigger_characters': [],
\ 'definition': 0, \ 'definition': 0,
\ 'typeDefinition': 0, \ 'typeDefinition': 0,
\ 'implementation': 0,
\ 'symbol_search': 0, \ 'symbol_search': 0,
\ 'code_actions': 0, \ 'code_actions': 0,
\ 'did_save': 0, \ 'did_save': 0,
@ -258,6 +260,14 @@ function! s:UpdateCapabilities(conn, capabilities) abort
let a:conn.capabilities.typeDefinition = 1 let a:conn.capabilities.typeDefinition = 1
endif endif
if get(a:capabilities, 'implementationProvider') is v:true
let a:conn.capabilities.implementation = 1
endif
if type(get(a:capabilities, 'implementationProvider')) is v:t_dict
let a:conn.capabilities.implementation = 1
endif
if get(a:capabilities, 'workspaceSymbolProvider') is v:true if get(a:capabilities, 'workspaceSymbolProvider') is v:true
let a:conn.capabilities.symbol_search = 1 let a:conn.capabilities.symbol_search = 1
endif endif
@ -378,8 +388,10 @@ function! ale#lsp#MarkConnectionAsTsserver(conn_id) abort
let l:conn.capabilities.completion_trigger_characters = ['.'] let l:conn.capabilities.completion_trigger_characters = ['.']
let l:conn.capabilities.definition = 1 let l:conn.capabilities.definition = 1
let l:conn.capabilities.typeDefinition = 1 let l:conn.capabilities.typeDefinition = 1
let l:conn.capabilities.implementation = 1
let l:conn.capabilities.symbol_search = 1 let l:conn.capabilities.symbol_search = 1
let l:conn.capabilities.rename = 1 let l:conn.capabilities.rename = 1
let l:conn.capabilities.filerename = 1
let l:conn.capabilities.code_actions = 1 let l:conn.capabilities.code_actions = 1
endfunction endfunction
@ -436,11 +448,20 @@ function! s:SendInitMessage(conn) abort
\ 'typeDefinition': { \ 'typeDefinition': {
\ 'dynamicRegistration': v:false, \ 'dynamicRegistration': v:false,
\ }, \ },
\ 'implementation': {
\ 'dynamicRegistration': v:false,
\ 'linkSupport': v:false,
\ },
\ 'publishDiagnostics': { \ 'publishDiagnostics': {
\ 'relatedInformation': v:true, \ 'relatedInformation': v:true,
\ }, \ },
\ 'codeAction': { \ 'codeAction': {
\ 'dynamicRegistration': v:false, \ 'dynamicRegistration': v:false,
\ 'codeActionLiteralSupport': {
\ 'codeActionKind': {
\ 'valueSet': []
\ }
\ }
\ }, \ },
\ 'rename': { \ 'rename': {
\ 'dynamicRegistration': v:false, \ 'dynamicRegistration': v:false,
@ -465,6 +486,7 @@ function! ale#lsp#StartProgram(conn_id, executable, command) abort
let l:options = { let l:options = {
\ 'mode': 'raw', \ 'mode': 'raw',
\ 'out_cb': {_, message -> ale#lsp#HandleMessage(a:conn_id, message)}, \ 'out_cb': {_, message -> ale#lsp#HandleMessage(a:conn_id, message)},
\ 'exit_cb': { -> ale#lsp#Stop(a:conn_id) },
\} \}
if has('win32') if has('win32')

View file

@ -35,7 +35,7 @@ function! ale#lsp#message#Initialize(root_path, options, capabilities) abort
\ 'rootPath': a:root_path, \ 'rootPath': a:root_path,
\ 'capabilities': a:capabilities, \ 'capabilities': a:capabilities,
\ 'initializationOptions': a:options, \ 'initializationOptions': a:options,
\ 'rootUri': ale#path#ToURI(a:root_path), \ 'rootUri': ale#util#ToURI(a:root_path),
\}] \}]
endfunction endfunction
@ -56,7 +56,7 @@ function! ale#lsp#message#DidOpen(buffer, language_id) abort
return [1, 'textDocument/didOpen', { return [1, 'textDocument/didOpen', {
\ 'textDocument': { \ 'textDocument': {
\ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')), \ 'uri': ale#util#ToURI(expand('#' . a:buffer . ':p')),
\ 'languageId': a:language_id, \ 'languageId': a:language_id,
\ 'version': ale#lsp#message#GetNextVersionID(), \ 'version': ale#lsp#message#GetNextVersionID(),
\ 'text': join(l:lines, "\n") . "\n", \ 'text': join(l:lines, "\n") . "\n",
@ -70,21 +70,21 @@ function! ale#lsp#message#DidChange(buffer) abort
" For changes, we simply send the full text of the document to the server. " For changes, we simply send the full text of the document to the server.
return [1, 'textDocument/didChange', { return [1, 'textDocument/didChange', {
\ 'textDocument': { \ 'textDocument': {
\ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')), \ 'uri': ale#util#ToURI(expand('#' . a:buffer . ':p')),
\ 'version': ale#lsp#message#GetNextVersionID(), \ 'version': ale#lsp#message#GetNextVersionID(),
\ }, \ },
\ 'contentChanges': [{'text': join(l:lines, "\n") . "\n"}] \ 'contentChanges': [{'text': join(l:lines, "\n") . "\n"}]
\}] \}]
endfunction endfunction
function! ale#lsp#message#DidSave(buffer, includeText) abort function! ale#lsp#message#DidSave(buffer, include_text) abort
let l:response = [1, 'textDocument/didSave', { let l:response = [1, 'textDocument/didSave', {
\ 'textDocument': { \ 'textDocument': {
\ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')), \ 'uri': ale#util#ToURI(expand('#' . a:buffer . ':p')),
\ }, \ },
\}] \}]
if a:includeText if a:include_text
let l:response[2].textDocument.version = ale#lsp#message#GetNextVersionID() let l:response[2].textDocument.version = ale#lsp#message#GetNextVersionID()
let l:response[2].text = ale#util#GetBufferContents(a:buffer) let l:response[2].text = ale#util#GetBufferContents(a:buffer)
endif endif
@ -95,7 +95,7 @@ endfunction
function! ale#lsp#message#DidClose(buffer) abort function! ale#lsp#message#DidClose(buffer) abort
return [1, 'textDocument/didClose', { return [1, 'textDocument/didClose', {
\ 'textDocument': { \ 'textDocument': {
\ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')), \ 'uri': ale#util#ToURI(expand('#' . a:buffer . ':p')),
\ }, \ },
\}] \}]
endfunction endfunction
@ -106,7 +106,7 @@ let s:COMPLETION_TRIGGER_CHARACTER = 2
function! ale#lsp#message#Completion(buffer, line, column, trigger_character) abort function! ale#lsp#message#Completion(buffer, line, column, trigger_character) abort
let l:message = [0, 'textDocument/completion', { let l:message = [0, 'textDocument/completion', {
\ 'textDocument': { \ 'textDocument': {
\ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')), \ 'uri': ale#util#ToURI(expand('#' . a:buffer . ':p')),
\ }, \ },
\ 'position': {'line': a:line - 1, 'character': a:column - 1}, \ 'position': {'line': a:line - 1, 'character': a:column - 1},
\}] \}]
@ -124,7 +124,7 @@ endfunction
function! ale#lsp#message#Definition(buffer, line, column) abort function! ale#lsp#message#Definition(buffer, line, column) abort
return [0, 'textDocument/definition', { return [0, 'textDocument/definition', {
\ 'textDocument': { \ 'textDocument': {
\ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')), \ 'uri': ale#util#ToURI(expand('#' . a:buffer . ':p')),
\ }, \ },
\ 'position': {'line': a:line - 1, 'character': a:column - 1}, \ 'position': {'line': a:line - 1, 'character': a:column - 1},
\}] \}]
@ -133,7 +133,16 @@ endfunction
function! ale#lsp#message#TypeDefinition(buffer, line, column) abort function! ale#lsp#message#TypeDefinition(buffer, line, column) abort
return [0, 'textDocument/typeDefinition', { return [0, 'textDocument/typeDefinition', {
\ 'textDocument': { \ 'textDocument': {
\ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')), \ 'uri': ale#util#ToURI(expand('#' . a:buffer . ':p')),
\ },
\ 'position': {'line': a:line - 1, 'character': a:column - 1},
\}]
endfunction
function! ale#lsp#message#Implementation(buffer, line, column) abort
return [0, 'textDocument/implementation', {
\ 'textDocument': {
\ 'uri': ale#util#ToURI(expand('#' . a:buffer . ':p')),
\ }, \ },
\ 'position': {'line': a:line - 1, 'character': a:column - 1}, \ 'position': {'line': a:line - 1, 'character': a:column - 1},
\}] \}]
@ -142,7 +151,7 @@ endfunction
function! ale#lsp#message#References(buffer, line, column) abort function! ale#lsp#message#References(buffer, line, column) abort
return [0, 'textDocument/references', { return [0, 'textDocument/references', {
\ 'textDocument': { \ 'textDocument': {
\ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')), \ 'uri': ale#util#ToURI(expand('#' . a:buffer . ':p')),
\ }, \ },
\ 'position': {'line': a:line - 1, 'character': a:column - 1}, \ 'position': {'line': a:line - 1, 'character': a:column - 1},
\ 'context': {'includeDeclaration': v:false}, \ 'context': {'includeDeclaration': v:false},
@ -158,7 +167,7 @@ endfunction
function! ale#lsp#message#Hover(buffer, line, column) abort function! ale#lsp#message#Hover(buffer, line, column) abort
return [0, 'textDocument/hover', { return [0, 'textDocument/hover', {
\ 'textDocument': { \ 'textDocument': {
\ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')), \ 'uri': ale#util#ToURI(expand('#' . a:buffer . ':p')),
\ }, \ },
\ 'position': {'line': a:line - 1, 'character': a:column - 1}, \ 'position': {'line': a:line - 1, 'character': a:column - 1},
\}] \}]
@ -173,7 +182,7 @@ endfunction
function! ale#lsp#message#Rename(buffer, line, column, new_name) abort function! ale#lsp#message#Rename(buffer, line, column, new_name) abort
return [0, 'textDocument/rename', { return [0, 'textDocument/rename', {
\ 'textDocument': { \ 'textDocument': {
\ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')), \ 'uri': ale#util#ToURI(expand('#' . a:buffer . ':p')),
\ }, \ },
\ 'position': {'line': a:line - 1, 'character': a:column - 1}, \ 'position': {'line': a:line - 1, 'character': a:column - 1},
\ 'newName': a:new_name, \ 'newName': a:new_name,
@ -183,7 +192,7 @@ endfunction
function! ale#lsp#message#CodeAction(buffer, line, column, end_line, end_column, diagnostics) abort function! ale#lsp#message#CodeAction(buffer, line, column, end_line, end_column, diagnostics) abort
return [0, 'textDocument/codeAction', { return [0, 'textDocument/codeAction', {
\ 'textDocument': { \ 'textDocument': {
\ 'uri': ale#path#ToURI(expand('#' . a:buffer . ':p')), \ 'uri': ale#util#ToURI(expand('#' . a:buffer . ':p')),
\ }, \ },
\ 'range': { \ 'range': {
\ 'start': {'line': a:line - 1, 'character': a:column - 1}, \ 'start': {'line': a:line - 1, 'character': a:column - 1},

View file

@ -59,7 +59,7 @@ function! ale#lsp#response#ReadDiagnostics(response) abort
\ && l:diagnostic.relatedInformation isnot v:null \ && l:diagnostic.relatedInformation isnot v:null
let l:related = deepcopy(l:diagnostic.relatedInformation) let l:related = deepcopy(l:diagnostic.relatedInformation)
call map(l:related, {key, val -> call map(l:related, {key, val ->
\ ale#path#FromURI(val.location.uri) . \ ale#util#ToResource(val.location.uri) .
\ ':' . (val.location.range.start.line + 1) . \ ':' . (val.location.range.start.line + 1) .
\ ':' . (val.location.range.start.character + 1) . \ ':' . (val.location.range.start.character + 1) .
\ ":\n\t" . val.message \ ":\n\t" . val.message

View file

@ -72,6 +72,14 @@ function! ale#lsp#tsserver_message#TypeDefinition(buffer, line, column) abort
\}] \}]
endfunction endfunction
function! ale#lsp#tsserver_message#Implementation(buffer, line, column) abort
return [0, 'ts@implementation', {
\ 'line': a:line,
\ 'offset': a:column,
\ 'file': expand('#' . a:buffer . ':p'),
\}]
endfunction
function! ale#lsp#tsserver_message#References(buffer, line, column) abort function! ale#lsp#tsserver_message#References(buffer, line, column) abort
return [0, 'ts@references', { return [0, 'ts@references', {
\ 'line': a:line, \ 'line': a:line,
@ -101,6 +109,14 @@ function! ale#lsp#tsserver_message#Rename(
\}] \}]
endfunction endfunction
function! ale#lsp#tsserver_message#GetEditsForFileRename(
\ oldFilePath, newFilePath) abort
return [0, 'ts@getEditsForFileRename', {
\ 'oldFilePath': a:oldFilePath,
\ 'newFilePath': a:newFilePath,
\}]
endfunction
function! ale#lsp#tsserver_message#OrganizeImports(buffer) abort function! ale#lsp#tsserver_message#OrganizeImports(buffer) abort
return [0, 'ts@organizeImports', { return [0, 'ts@organizeImports', {
\ 'scope': { \ 'scope': {

View file

@ -11,6 +11,22 @@ endif
" A Dictionary to track one-shot handlers for custom LSP requests " A Dictionary to track one-shot handlers for custom LSP requests
let s:custom_handlers_map = get(s:, 'custom_handlers_map', {}) let s:custom_handlers_map = get(s:, 'custom_handlers_map', {})
" Clear LSP linter data for the linting engine.
function! ale#lsp_linter#ClearLSPData() abort
let s:lsp_linter_map = {}
let s:custom_handlers_map = {}
endfunction
" Only for internal use.
function! ale#lsp_linter#GetLSPLinterMap() abort
return s:lsp_linter_map
endfunction
" Just for tests.
function! ale#lsp_linter#SetLSPLinterMap(replacement_map) abort
let s:lsp_linter_map = a:replacement_map
endfunction
" Check if diagnostics for a particular linter should be ignored. " Check if diagnostics for a particular linter should be ignored.
function! s:ShouldIgnore(buffer, linter_name) abort function! s:ShouldIgnore(buffer, linter_name) abort
" Ignore all diagnostics if LSP integration is disabled. " Ignore all diagnostics if LSP integration is disabled.
@ -33,7 +49,7 @@ endfunction
function! s:HandleLSPDiagnostics(conn_id, response) abort function! s:HandleLSPDiagnostics(conn_id, response) abort
let l:linter_name = s:lsp_linter_map[a:conn_id] let l:linter_name = s:lsp_linter_map[a:conn_id]
let l:filename = ale#path#FromURI(a:response.params.uri) let l:filename = ale#util#ToResource(a:response.params.uri)
let l:escaped_name = escape( let l:escaped_name = escape(
\ fnameescape(l:filename), \ fnameescape(l:filename),
\ has('win32') ? '^' : '^,}]' \ has('win32') ? '^' : '^,}]'
@ -466,8 +482,8 @@ function! s:CheckWithLSP(linter, details) abort
" If this was a file save event, also notify the server of that. " If this was a file save event, also notify the server of that.
if a:linter.lsp isnot# 'tsserver' if a:linter.lsp isnot# 'tsserver'
\&& getbufvar(l:buffer, 'ale_save_event_fired', 0) \&& getbufvar(l:buffer, 'ale_save_event_fired', 0)
\&& ale#lsp#HasCapability(l:buffer, 'did_save') \&& ale#lsp#HasCapability(l:id, 'did_save')
let l:include_text = ale#lsp#HasCapability(l:buffer, 'includeText') let l:include_text = ale#lsp#HasCapability(l:id, 'includeText')
let l:save_message = ale#lsp#message#DidSave(l:buffer, l:include_text) let l:save_message = ale#lsp#message#DidSave(l:buffer, l:include_text)
let l:notified = ale#lsp#Send(l:id, l:save_message) != 0 let l:notified = ale#lsp#Send(l:id, l:save_message) != 0
endif endif
@ -477,17 +493,6 @@ function! ale#lsp_linter#CheckWithLSP(buffer, linter) abort
return ale#lsp_linter#StartLSP(a:buffer, a:linter, function('s:CheckWithLSP')) return ale#lsp_linter#StartLSP(a:buffer, a:linter, function('s:CheckWithLSP'))
endfunction endfunction
" Clear LSP linter data for the linting engine.
function! ale#lsp_linter#ClearLSPData() abort
let s:lsp_linter_map = {}
let s:custom_handlers_map = {}
endfunction
" Just for tests.
function! ale#lsp_linter#SetLSPLinterMap(replacement_map) abort
let s:lsp_linter_map = a:replacement_map
endfunction
function! s:HandleLSPResponseToCustomRequests(conn_id, response) abort function! s:HandleLSPResponseToCustomRequests(conn_id, response) abort
if has_key(a:response, 'id') if has_key(a:response, 'id')
\&& has_key(s:custom_handlers_map, a:response.id) \&& has_key(s:custom_handlers_map, a:response.id)

View file

@ -1,6 +1,6 @@
" Author: Jerko Steiner <jerko.steiner@gmail.com> " Author: Jerko Steiner <jerko.steiner@gmail.com>
" Description: Organize imports support for tsserver " Description: Organize imports support for tsserver
"
function! ale#organize_imports#HandleTSServerResponse(conn_id, response) abort function! ale#organize_imports#HandleTSServerResponse(conn_id, response) abort
if get(a:response, 'command', '') isnot# 'organizeImports' if get(a:response, 'command', '') isnot# 'organizeImports'
return return
@ -17,7 +17,10 @@ function! ale#organize_imports#HandleTSServerResponse(conn_id, response) abort
\ 'description': 'Organize Imports', \ 'description': 'Organize Imports',
\ 'changes': l:file_code_edits, \ 'changes': l:file_code_edits,
\ }, \ },
\ {} \ {
\ 'conn_id': a:conn_id,
\ 'should_save': !&hidden,
\ },
\) \)
endfunction endfunction

View file

@ -218,7 +218,7 @@ endfunction
" Convert a filesystem path to a file:// URI " Convert a filesystem path to a file:// URI
" relatives paths will not be prefixed with the protocol. " relatives paths will not be prefixed with the protocol.
" For Windows paths, the `:` in C:\ etc. will not be percent-encoded. " For Windows paths, the `:` in C:\ etc. will not be percent-encoded.
function! ale#path#ToURI(path) abort function! ale#path#ToFileURI(path) abort
let l:has_drive_letter = a:path[1:2] is# ':\' let l:has_drive_letter = a:path[1:2] is# ':\'
return substitute( return substitute(
@ -231,7 +231,7 @@ function! ale#path#ToURI(path) abort
\) \)
endfunction endfunction
function! ale#path#FromURI(uri) abort function! ale#path#FromFileURI(uri) abort
if a:uri[:6] is? 'file://' if a:uri[:6] is? 'file://'
let l:encoded_path = a:uri[7:] let l:encoded_path = a:uri[7:]
elseif a:uri[:4] is? 'file:' elseif a:uri[:4] is? 'file:'

View file

@ -26,6 +26,7 @@ function! ale#python#FindProjectRootIni(buffer) abort
\|| filereadable(l:path . '/tox.ini') \|| filereadable(l:path . '/tox.ini')
\|| filereadable(l:path . '/.pyre_configuration.local') \|| filereadable(l:path . '/.pyre_configuration.local')
\|| filereadable(l:path . '/mypy.ini') \|| filereadable(l:path . '/mypy.ini')
\|| filereadable(l:path . '/.mypy.ini')
\|| filereadable(l:path . '/pycodestyle.cfg') \|| filereadable(l:path . '/pycodestyle.cfg')
\|| filereadable(l:path . '/.flake8') \|| filereadable(l:path . '/.flake8')
\|| filereadable(l:path . '/.flake8rc') \|| filereadable(l:path . '/.flake8rc')

View file

@ -16,6 +16,23 @@ function! ale#references#ClearLSPData() abort
let s:references_map = {} let s:references_map = {}
endfunction endfunction
function! ale#references#FormatTSResponseItem(response_item, options) abort
if get(a:options, 'open_in') is# 'quickfix'
return {
\ 'filename': a:response_item.file,
\ 'lnum': a:response_item.start.line,
\ 'col': a:response_item.start.offset,
\}
else
return {
\ 'filename': a:response_item.file,
\ 'line': a:response_item.start.line,
\ 'column': a:response_item.start.offset,
\ 'match': substitute(a:response_item.lineText, '^\s*\(.\{-}\)\s*$', '\1', ''),
\}
endif
endfunction
function! ale#references#HandleTSServerResponse(conn_id, response) abort function! ale#references#HandleTSServerResponse(conn_id, response) abort
if get(a:response, 'command', '') is# 'references' if get(a:response, 'command', '') is# 'references'
\&& has_key(s:references_map, a:response.request_seq) \&& has_key(s:references_map, a:response.request_seq)
@ -25,21 +42,41 @@ function! ale#references#HandleTSServerResponse(conn_id, response) abort
let l:item_list = [] let l:item_list = []
for l:response_item in a:response.body.refs for l:response_item in a:response.body.refs
call add(l:item_list, { call add(
\ 'filename': l:response_item.file, \ l:item_list,
\ 'line': l:response_item.start.line, \ ale#references#FormatTSResponseItem(l:response_item, l:options)
\ 'column': l:response_item.start.offset, \)
\ 'match': substitute(l:response_item.lineText, '^\s*\(.\{-}\)\s*$', '\1', ''),
\})
endfor endfor
if empty(l:item_list) if empty(l:item_list)
call ale#util#Execute('echom ''No references found.''') call ale#util#Execute('echom ''No references found.''')
else
if get(l:options, 'open_in') is# 'quickfix'
call setqflist([], 'r')
call setqflist(l:item_list, 'a')
call ale#util#Execute('cc 1')
else else
call ale#preview#ShowSelection(l:item_list, l:options) call ale#preview#ShowSelection(l:item_list, l:options)
endif endif
endif endif
endif endif
endif
endfunction
function! ale#references#FormatLSPResponseItem(response_item, options) abort
if get(a:options, 'open_in') is# 'quickfix'
return {
\ 'filename': ale#util#ToResource(a:response_item.uri),
\ 'lnum': a:response_item.range.start.line + 1,
\ 'col': a:response_item.range.start.character + 1,
\}
else
return {
\ 'filename': ale#util#ToResource(a:response_item.uri),
\ 'line': a:response_item.range.start.line + 1,
\ 'column': a:response_item.range.start.character + 1,
\}
endif
endfunction endfunction
function! ale#references#HandleLSPResponse(conn_id, response) abort function! ale#references#HandleLSPResponse(conn_id, response) abort
@ -53,20 +90,24 @@ function! ale#references#HandleLSPResponse(conn_id, response) abort
if type(l:result) is v:t_list if type(l:result) is v:t_list
for l:response_item in l:result for l:response_item in l:result
call add(l:item_list, { call add(l:item_list,
\ 'filename': ale#path#FromURI(l:response_item.uri), \ ale#references#FormatLSPResponseItem(l:response_item, l:options)
\ 'line': l:response_item.range.start.line + 1, \)
\ 'column': l:response_item.range.start.character + 1,
\})
endfor endfor
endif endif
if empty(l:item_list) if empty(l:item_list)
call ale#util#Execute('echom ''No references found.''') call ale#util#Execute('echom ''No references found.''')
else
if get(l:options, 'open_in') is# 'quickfix'
call setqflist([], 'r')
call setqflist(l:item_list, 'a')
call ale#util#Execute('cc 1')
else else
call ale#preview#ShowSelection(l:item_list, l:options) call ale#preview#ShowSelection(l:item_list, l:options)
endif endif
endif endif
endif
endfunction endfunction
function! s:OnReady(line, column, options, linter, lsp_details) abort function! s:OnReady(line, column, options, linter, lsp_details) abort
@ -119,6 +160,8 @@ function! ale#references#Find(...) abort
let l:options.open_in = 'split' let l:options.open_in = 'split'
elseif l:option is? '-vsplit' elseif l:option is? '-vsplit'
let l:options.open_in = 'vsplit' let l:options.open_in = 'vsplit'
elseif l:option is? '-quickfix'
let l:options.open_in = 'quickfix'
endif endif
endfor endfor
endif endif

View file

@ -84,7 +84,8 @@ function! ale#rename#HandleTSServerResponse(conn_id, response) abort
\ 'changes': l:changes, \ 'changes': l:changes,
\ }, \ },
\ { \ {
\ 'should_save': 1, \ 'conn_id': a:conn_id,
\ 'should_save': !&hidden,
\ }, \ },
\) \)
endfunction endfunction
@ -116,7 +117,8 @@ function! ale#rename#HandleLSPResponse(conn_id, response) abort
\ 'changes': l:changes, \ 'changes': l:changes,
\ }, \ },
\ { \ {
\ 'should_save': 1, \ 'conn_id': a:conn_id,
\ 'should_save': !&hidden,
\ }, \ },
\) \)
endif endif

View file

@ -41,7 +41,7 @@ function! ale#symbol#HandleLSPResponse(conn_id, response) abort
let l:location = l:response_item.location let l:location = l:response_item.location
call add(l:item_list, { call add(l:item_list, {
\ 'filename': ale#path#FromURI(l:location.uri), \ 'filename': ale#util#ToResource(l:location.uri),
\ 'line': l:location.range.start.line + 1, \ 'line': l:location.range.start.line + 1,
\ 'column': l:location.range.start.character + 1, \ 'column': l:location.range.start.character + 1,
\ 'match': l:response_item.name, \ 'match': l:response_item.name,

View file

@ -62,25 +62,34 @@ function! ale#test#SetFilename(path) abort
silent! noautocmd execute 'file ' . fnameescape(l:full_path) silent! noautocmd execute 'file ' . fnameescape(l:full_path)
endfunction endfunction
function! s:RemoveModule(results) abort function! RemoveNewerKeys(results) abort
for l:item in a:results for l:item in a:results
if has_key(l:item, 'module') if has_key(l:item, 'module')
call remove(l:item, 'module') call remove(l:item, 'module')
endif endif
if has_key(l:item, 'end_col')
call remove(l:item, 'end_col')
endif
if has_key(l:item, 'end_lnum')
call remove(l:item, 'end_lnum')
endif
endfor endfor
endfunction endfunction
" Return loclist data without the module string, only in newer Vim versions. " Return loclist data with only the keys supported by the lowest Vim versions.
function! ale#test#GetLoclistWithoutModule() abort function! ale#test#GetLoclistWithoutNewerKeys() abort
let l:results = getloclist(0) let l:results = getloclist(0)
call s:RemoveModule(l:results) call RemoveNewerKeys(l:results)
return l:results return l:results
endfunction endfunction
function! ale#test#GetQflistWithoutModule() abort " Return quickfix data with only the keys supported by the lowest Vim versions.
function! ale#test#GetQflistWithoutNewerKeys() abort
let l:results = getqflist() let l:results = getqflist()
call s:RemoveModule(l:results) call RemoveNewerKeys(l:results)
return l:results return l:results
endfunction endfunction

View file

@ -64,7 +64,8 @@ function! ale#toggle#ToggleBuffer(buffer) abort
" Disabling ALE globally removes autocmd events, so we cannot enable " Disabling ALE globally removes autocmd events, so we cannot enable
" linting locally when linting is disabled globally " linting locally when linting is disabled globally
if l:enabled && !g:ale_enabled if l:enabled && !g:ale_enabled
execute 'echom ''ALE cannot be enabled locally when disabled globally''' " no-custom-checks
echom 'ALE cannot be enabled locally when disabled globally'
return return
endif endif

View file

@ -25,3 +25,19 @@ function! ale#uri#Decode(value) abort
\ 'g' \ 'g'
\) \)
endfunction endfunction
let s:uri_handlers = {
\ 'jdt': {
\ 'OpenURILink': function('ale#uri#jdt#OpenJDTLink'),
\ }
\}
function! ale#uri#GetURIHandler(uri) abort
for l:scheme in keys(s:uri_handlers)
if a:uri =~# '^'.l:scheme.'://'
return s:uri_handlers[scheme]
endif
endfor
return v:null
endfunction

View file

@ -25,7 +25,8 @@ function! ale#util#ShowMessage(string, ...) abort
" We have to assume the user is using a monospace font. " We have to assume the user is using a monospace font.
if has('nvim') || (a:string !~? "\n" && len(a:string) < &columns) if has('nvim') || (a:string !~? "\n" && len(a:string) < &columns)
execute 'echo a:string' " no-custom-checks
echo a:string
else else
call ale#preview#Show(split(a:string, "\n"), extend( call ale#preview#Show(split(a:string, "\n"), extend(
\ { \ {
@ -491,8 +492,12 @@ function! ale#util#FindItemAtCursor(buffer) abort
return [l:info, l:loc] return [l:info, l:loc]
endfunction endfunction
function! ale#util#Input(message, value) abort function! ale#util#Input(message, value, ...) abort
if a:0 > 0
return input(a:message, a:value, a:1)
else
return input(a:message, a:value) return input(a:message, a:value)
endif
endfunction endfunction
function! ale#util#HasBuflineApi() abort function! ale#util#HasBuflineApi() abort
@ -539,3 +544,31 @@ endfunction
function! ale#util#GetBufferContents(buffer) abort function! ale#util#GetBufferContents(buffer) abort
return join(getbufline(a:buffer, 1, '$'), '\n') . '\n' return join(getbufline(a:buffer, 1, '$'), '\n') . '\n'
endfunction endfunction
function! ale#util#ToURI(resource) abort
let l:uri_handler = ale#uri#GetURIHandler(a:resource)
if l:uri_handler is# v:null
" resource is a filesystem path
let l:uri = ale#path#ToFileURI(a:resource)
else
" resource is a URI
let l:uri = a:resource
endif
return l:uri
endfunction
function! ale#util#ToResource(uri) abort
let l:uri_handler = ale#uri#GetURIHandler(a:uri)
if l:uri_handler is# v:null
" resource is a filesystem path
let l:resource = ale#path#FromFileURI(a:uri)
else
" resource is a URI
let l:resource = a:uri
endif
return l:resource
endfunction

View file

@ -18,26 +18,6 @@ elseif has('textprop') && has('popupwin')
let s:has_virt_text = 1 let s:has_virt_text = 1
endif endif
if !hlexists('ALEVirtualTextError')
highlight link ALEVirtualTextError ALEError
endif
if !hlexists('ALEVirtualTextStyleError')
highlight link ALEVirtualTextStyleError ALEVirtualTextError
endif
if !hlexists('ALEVirtualTextWarning')
highlight link ALEVirtualTextWarning ALEWarning
endif
if !hlexists('ALEVirtualTextStyleWarning')
highlight link ALEVirtualTextStyleWarning ALEVirtualTextWarning
endif
if !hlexists('ALEVirtualTextInfo')
highlight link ALEVirtualTextInfo ALEVirtualTextWarning
endif
function! ale#virtualtext#Clear() abort function! ale#virtualtext#Clear() abort
if !s:has_virt_text if !s:has_virt_text
return return

View file

@ -2,6 +2,11 @@
ALE Ada Integration *ale-ada-options* ALE Ada Integration *ale-ada-options*
===============================================================================
cspell *ale-ada-cspell*
See |ale-cspell-options|
=============================================================================== ===============================================================================
gcc *ale-ada-gcc* gcc *ale-ada-gcc*

View file

@ -2,6 +2,12 @@
ALE AsciiDoc Integration *ale-asciidoc-options* ALE AsciiDoc Integration *ale-asciidoc-options*
===============================================================================
cspell *ale-asciidoc-cspell*
See |ale-cspell-options|
=============================================================================== ===============================================================================
write-good *ale-asciidoc-write-good* write-good *ale-asciidoc-write-good*

View file

@ -352,6 +352,12 @@ g:ale_cpp_cquery_cache_directory *g:ale_c_cquery_cache_directory*
cache. cache.
===============================================================================
cspell *ale-c-cspell*
See |ale-cspell-options|
=============================================================================== ===============================================================================
flawfinder *ale-c-flawfinder* flawfinder *ale-c-flawfinder*

View file

@ -21,6 +21,25 @@ g:ale_cmake_cmakelint_options *g:ale_cmake_cmakelint_options*
This variable can be set to pass additional options to cmakelint. This variable can be set to pass additional options to cmakelint.
===============================================================================
cmake-lint *ale-cmake-cmake-lint*
g:ale_cmake_cmake_lint_executable *g:ale_cmake_cmake_lint_executable*
*b:ale_cmake_cmake_lint_executable*
Type: |String|
Default: `'cmake-lint'`
This variable can be set to change the path the cmake-lint.
g:ale_cmake_cmake_lint_options *g:ale_cmake_cmake_lint_options*
*b:ale_cmake_cmake_lint_options*
Type: |String|
Default: `''`
This variable can be set to pass additional options to cmake-lint.
=============================================================================== ===============================================================================
cmake-format *ale-cmake-cmakeformat* cmake-format *ale-cmake-cmakeformat*

View file

@ -287,6 +287,21 @@ g:ale_cpp_cpplint_options *g:ale_cpp_cpplint_options*
This variable can be changed to modify flags given to cpplint. This variable can be changed to modify flags given to cpplint.
g:ale_c_cpplint_executable *g:ale_c_cpplint_executable*
*b:ale_c_cpplint_executable*
Type: |String|
Default: `'cpplint'`
This variable can be changed to use a different executable for cpplint.
g:ale_c_cpplint_options *g:ale_c_cpplint_options*
*b:ale_c_cpplint_options*
Type: |String|
Default: `''`
This variable can be changed to modify flags given to cpplint.
=============================================================================== ===============================================================================
cquery *ale-cpp-cquery* cquery *ale-cpp-cquery*
@ -308,6 +323,12 @@ g:ale_cpp_cquery_cache_directory *g:ale_cpp_cquery_cache_directory*
cache. cache.
===============================================================================
cspell *ale-cpp-cspell*
See |ale-cspell-options|
=============================================================================== ===============================================================================
flawfinder *ale-cpp-flawfinder* flawfinder *ale-cpp-flawfinder*

View file

@ -90,6 +90,12 @@ g:ale_cs_csc_assemblies *g:ale_cs_csc_assemblies*
\] \]
< <
===============================================================================
cspell *ale-cs-cspell*
See |ale-cspell-options|
=============================================================================== ===============================================================================
dotnet-format *ale-cs-dotnet-format* dotnet-format *ale-cs-dotnet-format*

View file

@ -2,6 +2,12 @@
ALE CSS Integration *ale-css-options* ALE CSS Integration *ale-css-options*
===============================================================================
cspell *ale-css-cspell*
See |ale-cspell-options|
=============================================================================== ===============================================================================
fecs *ale-css-fecs* fecs *ale-css-fecs*
@ -43,5 +49,18 @@ g:ale_css_stylelint_use_global *g:ale_css_stylelint_use_global*
See |ale-integrations-local-executables| See |ale-integrations-local-executables|
===============================================================================
vscodecss *ale-css-vscode*
Website: https://github.com/hrsh7th/vscode-langservers-extracted
Installation
-------------------------------------------------------------------------------
Install VSCode css language server either globally or locally: >
npm install -g vscode-langservers-extracted
<
=============================================================================== ===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View file

@ -87,39 +87,6 @@ g:ale_dart_format_options *g:ale_dart_format_options*
This variable can be set to pass additional options to the dart format fixer. This variable can be set to pass additional options to the dart format fixer.
===============================================================================
dartanalyzer *ale-dart-dartanalyzer*
Installation
-------------------------------------------------------------------------------
Install Dart via whatever means. `dartanalyzer` will be included in the SDK.
You can add the SDK to `$PATH`, as described here:
https://www.dartlang.org/tools/sdk
If you have installed Dart on Linux, you can also try the following: >
" Set the executable path for dartanalyzer to the absolute path to it.
let g:ale_dart_dartanalyzer_executable = '/usr/lib/dart/bin/dartanalyzer'
<
... or similarly for wherever your Dart SDK lives. This should work without
having to modify `$PATH`.
ALE can only check for problems with `dartanalyzer` with the file on disk.
See |ale-lint-file-linters|
Options
-------------------------------------------------------------------------------
g:ale_dart_dartanalyzer_executable *g:ale_dart_dartanalyzer_executable*
*b:ale_dart_dartanalyzer_executable*
Type: |String|
Default: `'dartanalyzer'`
This variable can be set to change the path to dartanalyzer.
=============================================================================== ===============================================================================
dartfmt *ale-dart-dartfmt* dartfmt *ale-dart-dartfmt*

View file

@ -14,6 +14,7 @@ CONTENTS *ale-development-contents*
4.1. Writing Linter Tests.............|ale-development-linter-tests| 4.1. Writing Linter Tests.............|ale-development-linter-tests|
4.2. Writing Fixer Tests..............|ale-development-fixer-tests| 4.2. Writing Fixer Tests..............|ale-development-fixer-tests|
4.3. Running Tests in a Windows VM....|ale-development-windows-tests| 4.3. Running Tests in a Windows VM....|ale-development-windows-tests|
5. Contributing.........................|ale-development-contributing|
=============================================================================== ===============================================================================
1. Introduction *ale-development-introduction* 1. Introduction *ale-development-introduction*
@ -97,8 +98,8 @@ should also follow some additional rules designed to prevent mistakes. Some of
these are reported with ALE's `custom-linting-rules` script. See these are reported with ALE's `custom-linting-rules` script. See
|ale-development-tests|. |ale-development-tests|.
* Don't leave stray `:echo` lines in code. Use `execute 'echo' ...` if you must * Don't leave stray `:echo` lines in code. Write `" no-custom-checks` above
echo something. the line if you must echo something.
* For strings use |is#| instead of |==#|, `is?` instead of `==?`, `isnot#` * For strings use |is#| instead of |==#|, `is?` instead of `==?`, `isnot#`
instead of `!=#`, and `isnot?` instead of `!=?`. This is because `'x' ==# 0` instead of `!=#`, and `isnot?` instead of `!=?`. This is because `'x' ==# 0`
returns 1, while `'x' is# 0` returns 0, so you will experience fewer issues returns 1, while `'x' is# 0` returns 0, so you will experience fewer issues
@ -153,10 +154,9 @@ ALE runs tests with the following versions of Vim in the following
environments. environments.
1. Vim 8.0.0027 on Linux via GitHub Actions. 1. Vim 8.0.0027 on Linux via GitHub Actions.
2. Vim 8.2.2401 on Linux via GitHub Actions. 2. Vim 8.2.4693 on Linux via GitHub Actions.
3. NeoVim 0.2.0 on Linux via GitHub Actions. 3. NeoVim 0.2.0 on Linux via GitHub Actions.
4. NeoVim 0.4.4 on Linux via GitHub Actions. 4. NeoVim 0.7.0 on Linux via GitHub Actions.
5. NeoVim 0.5.0 on Linux via GitHub Actions.
6. Vim 8 (stable builds) on Windows via AppVeyor. 6. Vim 8 (stable builds) on Windows via AppVeyor.
If you are developing ALE code on Linux, Mac OSX, or BSD, you can run ALEs If you are developing ALE code on Linux, Mac OSX, or BSD, you can run ALEs
@ -444,5 +444,23 @@ You can run a specific test by passing the filename as an argument to the
batch file, for example: `run-tests test/test_c_flag_parsing.vader` . This will batch file, for example: `run-tests test/test_c_flag_parsing.vader` . This will
give you results much more quickly. give you results much more quickly.
===============================================================================
5. Contributing *ale-development-contributing*
All integration of new code into ALE is done through GitHub pull requests.
Using that tool streamlines the process and minimizes the time and effort
required to e.g. ensure test suites are run for every change.
As for any project hosted by GitHub, the choice of platform demands every
contributor to take care to setup an account and configure it accordingly.
Due to details of our process, a difference to many other GitHub hosted
projects is that contributors who wish to keep the author fields for their
commits unaltered need to configure a public email address in their account
and profile settings. See: https://docs.github.com/en/account-and-profile/
Unless configuring GitHub to expose contact details, commits will be rewritten
to appear by `USERNAME <RANDOM_NUMBER+USERNAME@users.noreply.github.com>` .
=============================================================================== ===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View file

@ -25,6 +25,12 @@ g:ale_dockerfile_dockerfile_lint_options
the dockerfile lint invocation - like custom rule file definitions. the dockerfile lint invocation - like custom rule file definitions.
===============================================================================
dprint *ale-dockerfile-dprint*
See |ale-dprint-options| and https://dprint.dev/plugins/dockerfile
=============================================================================== ===============================================================================
hadolint *ale-dockerfile-hadolint* hadolint *ale-dockerfile-hadolint*

View file

@ -5,7 +5,6 @@ ALE Elixir Integration *ale-elixir-options*
=============================================================================== ===============================================================================
mix *ale-elixir-mix* mix *ale-elixir-mix*
The `mix` linter is disabled by default, as it can be too expensive to run. The `mix` linter is disabled by default, as it can be too expensive to run.
See `:help g:ale_linters` See `:help g:ale_linters`
@ -18,6 +17,7 @@ g:ale_elixir_mix_options *g:ale_elixir_mix_options*
This variable can be changed to specify the mix executable. This variable can be changed to specify the mix executable.
=============================================================================== ===============================================================================
mix_format *ale-elixir-mix-format* mix_format *ale-elixir-mix-format*
@ -30,6 +30,7 @@ g:ale_elixir_mix_format_options *g:ale_elixir_mix_format_options*
This variable can be changed to specify the mix options passed to the This variable can be changed to specify the mix options passed to the
mix_format fixer mix_format fixer
=============================================================================== ===============================================================================
dialyxir *ale-elixir-dialyxir* dialyxir *ale-elixir-dialyxir*
@ -45,6 +46,7 @@ configured on your project's `mix.exs`.
See https://github.com/jeremyjh/dialyxir#with-explaining-stuff for more See https://github.com/jeremyjh/dialyxir#with-explaining-stuff for more
information. information.
=============================================================================== ===============================================================================
elixir-ls *ale-elixir-elixir-ls* elixir-ls *ale-elixir-elixir-ls*
@ -72,6 +74,8 @@ g:ale_elixir_elixir_ls_config *g:ale_elixir_elixir_ls_config*
\ } \ }
< <
Consult the ElixirLS documentation for more information about settings. Consult the ElixirLS documentation for more information about settings.
=============================================================================== ===============================================================================
credo *ale-elixir-credo* credo *ale-elixir-credo*
@ -79,18 +83,26 @@ Credo (https://github.com/rrrene/credo)
g:ale_elixir_credo_strict *g:ale_elixir_credo_strict* g:ale_elixir_credo_strict *g:ale_elixir_credo_strict*
Type: Integer Type: |Integer|
Default: 0 Default: `0`
Tells credo to run in strict mode or suggest mode. Set variable to 1 to Tells credo to run in strict mode or suggest mode. Set variable to 1 to
enable --strict mode. enable --strict mode.
g:ale_elixir_credo_config_file g:ale_elixir_credo_config_file
Type: String g:ale_elixir_credo_config_file *g:ale_elixir_credo_config_file*
Default: ''
Type: |String|
Default: `''`
Tells credo to use a custom configuration file. Tells credo to use a custom configuration file.
===============================================================================
cspell *ale-elixir-cspell*
See |ale-cspell-options|
=============================================================================== ===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View file

@ -39,7 +39,6 @@ g:ale_go_go111module *g:ale_go_go111module*
golang tools. golang tools.
=============================================================================== ===============================================================================
bingo *ale-go-bingo* bingo *ale-go-bingo*
@ -57,6 +56,11 @@ g:ale_go_bingo_options *g:ale_go_bingo_options*
Default: `''` Default: `''`
===============================================================================
cspell *ale-go-cspell*
See |ale-cspell-options|
=============================================================================== ===============================================================================
gobuild *ale-go-gobuild* gobuild *ale-go-gobuild*
@ -80,6 +84,24 @@ g:ale_go_gofmt_options *g:ale_go_gofmt_options*
This variable can be set to pass additional options to the gofmt fixer. This variable can be set to pass additional options to the gofmt fixer.
===============================================================================
gofumpt *ale-go-gofumpt*
g:ale_go_gofumpt_executable *g:ale_go_gofumpt_executable*
*b:ale_go_gofumpt_executable*
Type: |String|
Default: `'gofumpt'`
Executable to run to use as the gofumpt fixer.
g:ale_go_gofumpt_options *g:ale_go_gofumpt_options*
*b:ale_go_gofumpt_options*
Type: |String|
Default: `''`
Options to pass to the gofumpt fixer.
=============================================================================== ===============================================================================
golangci-lint *ale-go-golangci-lint* golangci-lint *ale-go-golangci-lint*
@ -133,6 +155,7 @@ g:ale_go_langserver_options *g:ale_go_langserver_options*
`-gocodecompletion` option is ignored because it is handled automatically `-gocodecompletion` option is ignored because it is handled automatically
by the |g:ale_completion_enabled| variable. by the |g:ale_completion_enabled| variable.
=============================================================================== ===============================================================================
golines *ale-go-golines* golines *ale-go-golines*
@ -151,6 +174,7 @@ g:ale_go_golines_options *g:ale_go_golines_options*
Additional options passed to the golines command. By default golines has Additional options passed to the golines command. By default golines has
--max-length=100 (lines above 100 characters will be wrapped) --max-length=100 (lines above 100 characters will be wrapped)
=============================================================================== ===============================================================================
golint *ale-go-golint* golint *ale-go-golint*
@ -330,7 +354,7 @@ g:ale_go_staticcheck_options *g:ale_go_staticcheck_options*
g:ale_go_staticcheck_lint_package *g:ale_go_staticcheck_lint_package* g:ale_go_staticcheck_lint_package *g:ale_go_staticcheck_lint_package*
*b:ale_go_staticcheck_lint_package* *b:ale_go_staticcheck_lint_package*
Type: |Number| Type: |Number|
Default: `0` Default: `1`
When set to `1`, the whole Go package will be checked instead of only the When set to `1`, the whole Go package will be checked instead of only the
current file. current file.

View file

@ -13,6 +13,12 @@ g:ale_haskell_brittany_executable *g:ale_haskell_brittany_executable*
This variable can be changed to use a different executable for brittany. This variable can be changed to use a different executable for brittany.
===============================================================================
cspell *ale-haskell-cspell*
See |ale-cspell-options|
=============================================================================== ===============================================================================
floskell *ale-haskell-floskell* floskell *ale-haskell-floskell*
@ -128,7 +134,7 @@ g:ale_haskell_hlint_options g:ale_haskell_hlint_options
hls *ale-haskell-hls* hls *ale-haskell-hls*
g:ale_haskell_hls_executable *g:ale_haskell_hls_executable* g:ale_haskell_hls_executable *g:ale_haskell_hls_executable*
*b:ale_haskell_his_executable* *b:ale_haskell_hls_executable*
Type: |String| Type: |String|
Default: `'haskell-language-server-wrapper'` Default: `'haskell-language-server-wrapper'`
@ -136,6 +142,20 @@ g:ale_haskell_hls_executable *g:ale_haskell_hls_executable*
language server. language server.
g:ale_haskell_hls_config *g:ale_haskell_hls_config*
*b:ale_haskell_hls_config*
Type: |Dictionary|
Default: `{}`
Dictionary with configuration settings for HLS. For example, to see more
completions:
>
let g:ale_haskell_hls_config = {'haskell': {'maxCompletions': 250}}
<
Refer to HLS documentation for possible settings:
https://haskell-language-server.readthedocs.io/en/latest/configuration.html#language-specific-server-options
=============================================================================== ===============================================================================
stack-build *ale-haskell-stack-build* stack-build *ale-haskell-stack-build*

View file

@ -2,6 +2,11 @@
ALE HCL Integration *ale-hcl-options* ALE HCL Integration *ale-hcl-options*
===============================================================================
packer-fmt *ale-hcl-packer-fmt*
See |ale-packer-fmt-fixer| for information about the available options.
=============================================================================== ===============================================================================
terraform-fmt *ale-hcl-terraform-fmt* terraform-fmt *ale-hcl-terraform-fmt*

View file

@ -28,6 +28,11 @@ g:ale_html_angular_use_global *g:ale_html_angular_use_global*
See |ale-integrations-local-executables| See |ale-integrations-local-executables|
===============================================================================
cspell *ale-html-cspell*
See |ale-cspell-options|
=============================================================================== ===============================================================================
fecs *ale-html-fecs* fecs *ale-html-fecs*
@ -159,6 +164,19 @@ g:ale_html_tidy_use_global *g:html_tidy_use_global*
See |ale-integrations-local-executables| See |ale-integrations-local-executables|
===============================================================================
vscodehtml *ale-html-vscode*
Website: https://github.com/hrsh7th/vscode-langservers-extracted
Installation
-------------------------------------------------------------------------------
Install VSCode html language server either globally or locally: >
npm install -g vscode-langservers-extracted
<
=============================================================================== ===============================================================================
write-good *ale-html-write-good* write-good *ale-html-write-good*

View file

@ -41,6 +41,12 @@ g:ale_java_checkstyle_options *g:ale_java_checkstyle_options*
configuration files set with |g:ale_java_checkstyle_config|. configuration files set with |g:ale_java_checkstyle_config|.
===============================================================================
cspell *ale-java-cspell*
See |ale-cspell-options|
=============================================================================== ===============================================================================
javac *ale-java-javac* javac *ale-java-javac*
@ -91,7 +97,6 @@ List type:
\ ] \ ]
< <
=============================================================================== ===============================================================================
google-java-format *ale-java-google-java-format* google-java-format *ale-java-google-java-format*
@ -190,6 +195,7 @@ The Java language server will look for the dependencies you specify in
`externalDependencies` array in your Maven and Gradle caches ~/.m2 and `externalDependencies` array in your Maven and Gradle caches ~/.m2 and
~/.gradle. ~/.gradle.
=============================================================================== ===============================================================================
eclipselsp *ale-java-eclipselsp* eclipselsp *ale-java-eclipselsp*
@ -218,8 +224,9 @@ g:ale_java_eclipselsp_path *g:ale_java_eclipselsp_path*
Default: `'$HOME/eclipse.jdt.ls'` Default: `'$HOME/eclipse.jdt.ls'`
Absolute path to the location of the eclipse.jdt.ls repository folder. Or if Absolute path to the location of the eclipse.jdt.ls repository folder. Or if
you have VSCode extension installed the absolute path to the VSCode extensions you have VSCode extension installed the absolute path to the VSCode
folder (e.g. $HOME/.vscode/extensions/redhat.java-0.4x.0 in Linux). extensions folder (e.g. $HOME/.vscode/extensions/redhat.java-0.4x.0 in
Linux).
g:ale_java_eclipselsp_executable *g:ale_java_eclipse_executable* g:ale_java_eclipselsp_executable *g:ale_java_eclipse_executable*
@ -261,7 +268,8 @@ g:ale_java_eclipselsp_javaagent *g:ale_java_eclipselsp_javaagent*
Default: `''` Default: `''`
A variable to add java agent for annotation processing such as Lombok. A variable to add java agent for annotation processing such as Lombok.
If you have multiple java agent files, use space to separate them. For example: If you have multiple java agent files, use space to separate them.
For example:
> >
let g:ale_java_eclipselsp_javaagent='/eclipse/lombok.jar /eclipse/jacoco.jar' let g:ale_java_eclipselsp_javaagent='/eclipse/lombok.jar /eclipse/jacoco.jar'
< <

View file

@ -23,11 +23,24 @@ To this: >
/path/foo/bar/.eslintrc.js # extends: ["/path/foo/.base-eslintrc.js"] /path/foo/bar/.eslintrc.js # extends: ["/path/foo/.base-eslintrc.js"]
< <
===============================================================================
cspell *ale-javascript-cspell*
See |ale-cspell-options|
=============================================================================== ===============================================================================
deno *ale-javascript-deno* deno *ale-javascript-deno*
Check the docs over at |ale-typescript-deno|. Check the docs over at |ale-typescript-deno|.
===============================================================================
dprint *ale-javascript-dprint*
See |ale-dprint-options| and https://dprint.dev/plugins/typescript
=============================================================================== ===============================================================================
eslint *ale-javascript-eslint* eslint *ale-javascript-eslint*

View file

@ -2,6 +2,18 @@
ALE JSON Integration *ale-json-options* ALE JSON Integration *ale-json-options*
===============================================================================
cspell *ale-json-cspell*
See |ale-cspell-options|
===============================================================================
dprint *ale-json-dprint*
See |ale-dprint-options| and https://dprint.dev/plugins/json
=============================================================================== ===============================================================================
eslint *ale-json-eslint* eslint *ale-json-eslint*
@ -141,6 +153,18 @@ g:ale_json_spectral_use_global *g:ale_json_spectral_use_global*
See |ale-integrations-local-executables| See |ale-integrations-local-executables|
===============================================================================
vscodejson *ale-json-vscode*
Website: https://github.com/hrsh7th/vscode-langservers-extracted
Installation
-------------------------------------------------------------------------------
Install VSCode json language server either globally or locally: >
npm install -g vscode-langservers-extracted
<
=============================================================================== ===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View file

@ -2,6 +2,9 @@
ALE LaTeX Integration *ale-latex-options* ALE LaTeX Integration *ale-latex-options*
===============================================================================
cspell *ale-latex-cspell*
=============================================================================== ===============================================================================
write-good *ale-latex-write-good* write-good *ale-latex-write-good*

View file

@ -1,6 +1,13 @@
=============================================================================== ===============================================================================
ALE Lua Integration *ale-lua-options* ALE Lua Integration *ale-lua-options*
===============================================================================
cspell *ale-lua-cspell*
See |ale-cspell-options|
=============================================================================== ===============================================================================
lua-format *ale-lua-lua-format* lua-format *ale-lua-lua-format*
@ -11,6 +18,7 @@ g:ale_lua_lua_format_executable *g:ale_lua_lua_format_executable*
This variable can be changed to change the path to lua-format. This variable can be changed to change the path to lua-format.
g:ale_lua_lua_format_options *g:ale_lua_lua_format_options* g:ale_lua_lua_format_options *g:ale_lua_lua_format_options*
*b:ale_lua_lua_format_options* *b:ale_lua_lua_format_options*
Type: |String| Type: |String|
@ -29,6 +37,7 @@ g:ale_lua_luac_executable *g:ale_lua_luac_executable*
This variable can be changed to change the path to luac. This variable can be changed to change the path to luac.
=============================================================================== ===============================================================================
luacheck *ale-lua-luacheck* luacheck *ale-lua-luacheck*
@ -58,6 +67,7 @@ g:ale_lua_luafmt_executable *g:ale_lua_luafmt_executable*
This variable can be set to use a different executable for luafmt. This variable can be set to use a different executable for luafmt.
g:ale_lua_luafmt_options *g:ale_lua_luafmt_options* g:ale_lua_luafmt_options *g:ale_lua_luafmt_options*
*b:ale_lua_luafmt_options* *b:ale_lua_luafmt_options*
Type: |String| Type: |String|
@ -66,6 +76,25 @@ g:ale_lua_luafmt_options *g:ale_lua_luafmt_options*
This variable can be set to pass additional options to the luafmt fixer. This variable can be set to pass additional options to the luafmt fixer.
===============================================================================
selene *ale-lua-selene*
g:ale_lua_selene_executable *g:ale_lua_selene_executable*
*b:ale_lua_selene_executable*
Type: |String|
Default: `'selene'`
This variable can be set to use a different executable for selene.
g:ale_lua_selene_options *g:ale_lua_selene_options*
*b:ale_lua_selene_options*
Type: |String|
Default: `''`
This variable can be set to pass additional options to selene.
=============================================================================== ===============================================================================
stylua *ale-lua-stylua* stylua *ale-lua-stylua*
@ -76,6 +105,7 @@ g:ale_lua_stylua_executable *g:ale_lua_stylua_executable*
This variable can be set to use a different executable for stylua. This variable can be set to use a different executable for stylua.
g:ale_lua_stylua_options *g:ale_lua_stylua_options* g:ale_lua_stylua_options *g:ale_lua_stylua_options*
*b:ale_lua_stylua_options* *b:ale_lua_stylua_options*
Type: |String| Type: |String|

View file

@ -2,6 +2,18 @@
ALE Markdown Integration *ale-markdown-options* ALE Markdown Integration *ale-markdown-options*
===============================================================================
cspell *ale-markdown-cspell*
See |ale-cspell-options|
===============================================================================
dprint *ale-markdown-dprint*
See |ale-dprint-options| and https://dprint.dev/plugins/markdown
=============================================================================== ===============================================================================
markdownlint *ale-markdown-markdownlint* markdownlint *ale-markdown-markdownlint*

View file

@ -7,15 +7,15 @@ nixfmt *ale-nix-nixfmt*
g:ale_nix_nixfmt_executable *g:ale_nix_nixfmt_executable* g:ale_nix_nixfmt_executable *g:ale_nix_nixfmt_executable*
*b:ale_nix_nixfmt_executable* *b:ale_nix_nixfmt_executable*
Type: String Type: |String|
Default: 'nixfmt' Default: `'nixfmt'`
This variable sets the executable used for nixfmt. This variable sets the executable used for nixfmt.
g:ale_nix_nixfmt_options *g:ale_nix_nixfmt_options* g:ale_nix_nixfmt_options *g:ale_nix_nixfmt_options*
*b:ale_nix_nixfmt_options* *b:ale_nix_nixfmt_options*
Type: String Type: |String|
Default: '' Default: `''`
This variable can be set to pass additional options to the nixfmt fixer. This variable can be set to pass additional options to the nixfmt fixer.
@ -35,7 +35,44 @@ g:ale_nix_nixpkgsfmt_options *g:ale_nix_nixpkgsfmt_options*
Type: |String| Type: |String|
Default: `''` Default: `''`
This variable can be set to pass additional options to the nixpkgs-fmt fixer. This variable can be set to pass additional options to the nixpkgs-fmt
fixer.
===============================================================================
statix *ale-nix-statix*
g:ale_nix_statix_check_executable *g:ale_nix_statix_check_executable*
*b:ale_nix_statix_check_executable*
Type: |String|
Default: `'statix'`
This variable sets the executable used for statix when running it as a
linter.
g:ale_nix_statix_check_options *g:ale_nix_statix_check_options*
*b:ale_nix_statix_check_options*
Type: |String|
Default: `''`
This variable can be used to pass additional options to statix when running
it as a linter.
g:ale_nix_statix_fix_executable *g:ale_nix_fix_check_executable*
*b:ale_nix_fix_check_executable*
Type: |String|
Default: `'statix'`
This variable sets the executable used for statix when running it as a
fixer.
g:ale_nix_statix_fix_options *g:ale_nix_statix_fix_options*
*b:ale_nix_statix_fix_options*
Type: |String|
Default: `''`
This variable can be used to pass additional options to statix when running
it as a fixer.
=============================================================================== ===============================================================================

View file

@ -2,6 +2,26 @@
ALE OCaml Integration *ale-ocaml-options* ALE OCaml Integration *ale-ocaml-options*
===============================================================================
dune *ale-ocaml-dune*
Dune is a build system for OCaml projects. The `dune format` command is
supported for automatically formatting `dune` and `dune-project` files.
g:ale_ocaml_dune_executable *g:ale_ocaml_dune_executable*
*b:ale_ocaml_dune_executable*
Type: |String|
Default: `'dune'`
This variable can be set to pass the path to dune.
g:ale_ocaml_dune_options *g:ale_ocaml_dune_options*
*b:ale_ocaml_dune_options*
Type: |String|
Default: `''`
This variable can be set to pass additional options to the dune fixer.
=============================================================================== ===============================================================================
merlin *ale-ocaml-merlin* merlin *ale-ocaml-merlin*

View file

@ -1,6 +1,13 @@
=============================================================================== ===============================================================================
ALE PHP Integration *ale-php-options* ALE PHP Integration *ale-php-options*
===============================================================================
cspell *ale-php-cspell*
See |ale-cspell-options|
=============================================================================== ===============================================================================
langserver *ale-php-langserver* langserver *ale-php-langserver*
@ -41,6 +48,7 @@ g:ale_php_phan_minimum_severity *g:ale_php_phan_minimum_severity*
This variable defines the minimum severity level. This variable defines the minimum severity level.
g:ale_php_phan_executable *g:ale_php_phan_executable* g:ale_php_phan_executable *g:ale_php_phan_executable*
*b:ale_php_phan_executable* *b:ale_php_phan_executable*
Type: |String| Type: |String|
@ -48,6 +56,7 @@ g:ale_php_phan_executable *g:ale_php_phan_executable*
This variable sets executable used for phan or phan_client. This variable sets executable used for phan or phan_client.
g:ale_php_phan_use_client *g:ale_php_phan_use_client* g:ale_php_phan_use_client *g:ale_php_phan_use_client*
*b:ale_php_phan_use_client* *b:ale_php_phan_use_client*
Type: |Number| Type: |Number|
@ -56,6 +65,7 @@ g:ale_php_phan_use_client *g:ale_php_phan_use_client*
This variable can be set to 1 to use the phan_client with phan daemon mode This variable can be set to 1 to use the phan_client with phan daemon mode
instead of the phan standalone. instead of the phan standalone.
=============================================================================== ===============================================================================
phpcbf *ale-php-phpcbf* phpcbf *ale-php-phpcbf*
@ -129,6 +139,7 @@ g:ale_php_phpcs_options *g:ale_php_phpcs_options*
This variable can be set to pass additional options to php-cs This variable can be set to pass additional options to php-cs
=============================================================================== ===============================================================================
phpmd *ale-php-phpmd* phpmd *ale-php-phpmd*
@ -187,6 +198,15 @@ g:ale_php_phpstan_autoload *g:ale_php_phpstan_autoload*
This variable sets path to phpstan autoload file. This variable sets path to phpstan autoload file.
g:ale_php_phpstan_memory_limit *g:ale_php_phpstan_memory-limit*
*b:ale_php_phpstan_memory-limit*
Type: |String|
Default: `''`
This variable sets the memory limit for phpstan analysis. This is a string
in the same format as `php.ini` accepts, e.g. `128M`, `1G`.
=============================================================================== ===============================================================================
psalm *ale-php-psalm* psalm *ale-php-psalm*
@ -252,6 +272,33 @@ g:ale_php_php_executable *g:ale_php_php_executable*
This variable sets the executable used for php. This variable sets the executable used for php.
===============================================================================
pint *ale-php-pint*
g:ale_php_pint_executable *g:ale_php_pint_executable*
*b:ale_php_pint_executable*
Type: |String|
Default: `'pint'`
This variable sets the executable used for pint.
g:ale_php_pint_options *g:ale_php_pint_options*
*b:ale_php_pint_options*
Type: |String|
Default: `''`
This variable can be set to pass additional options to pint.
g:ale_php_pint_use_global *g:ale_php_pint_use_global*
*b:ale_php_pint_use_global*
Type: |Boolean|
Default: `get(g:, 'ale_use_global_executables', 0)`
See |ale-integrations-local-executables|
=============================================================================== ===============================================================================
tlint *ale-php-tlint* tlint *ale-php-tlint*

View file

@ -2,6 +2,12 @@
ALE PowerShell Integration *ale-powershell-options* ALE PowerShell Integration *ale-powershell-options*
===============================================================================
cspell *ale-powershell-cspell*
See |ale-cspell-options|
=============================================================================== ===============================================================================
powershell *ale-powershell-powershell* powershell *ale-powershell-powershell*
@ -65,6 +71,5 @@ g:ale_powershell_psscriptanalyzer_exclusions
\ 'PSAvoidUsingWriteHost,PSAvoidGlobalVars' \ 'PSAvoidUsingWriteHost,PSAvoidGlobalVars'
< <
=============================================================================== ===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View file

@ -8,13 +8,51 @@ Integration Information
To enable `.proto` file linting, update |g:ale_linters| as appropriate: To enable `.proto` file linting, update |g:ale_linters| as appropriate:
> >
" Enable linter for .proto files " Enable linter for .proto files
let g:ale_linters = {'proto': ['protoc-gen-lint', 'protolint']} let g:ale_linters = {'proto': ['buf-lint', 'protoc-gen-lint', 'protolint']}
To enable `.proto` file fixing, update |g:ale_fixers| as appropriate: To enable `.proto` file fixing, update |g:ale_fixers| as appropriate:
> >
" Enable linter for .proto files " Enable linter for .proto files
let b:ale_fixers = {'proto': ['protolint']} let b:ale_fixers = {'proto': ['buf-format', 'protolint']}
< <
===============================================================================
buf-format *ale-proto-buf-format*
The formatter uses `buf`, a fully-featured Protobuf compiler that doesn't depend
on `protoc`. Make sure the `buf` binary is available in the system path, or
set ale_proto_buf_format_executable.
g:ale_proto_buf_format_executable *g:ale_proto_buf_format_executable*
Type: |String|
Default: 'buf'
This variable can be changed to modify the executable used for buf.
===============================================================================
buf-lint *ale-proto-buf-lint*
The linter uses `buf`, a fully-featured Protobuf compiler that doesn't depend
on `protoc`. Make sure the `buf` binary is available in the system path, or
set ale_proto_buf_lint_executable.
g:ale_proto_buf_lint_executable *g:ale_proto_buf_lint_executable*
Type: |String|
Default: 'buf'
This variable can be changed to modify the executable used for buf.
g:ale_proto_buf_lint_config *g:ale_proto_buf_lint_config*
Type: |String|
Default: `''`
A path to a buf configuration file.
The path to the configuration file can be an absolute path or a relative
path. ALE will search for the relative path in parent directories.
=============================================================================== ===============================================================================
protoc-gen-lint *ale-proto-protoc-gen-lint* protoc-gen-lint *ale-proto-protoc-gen-lint*

View file

@ -10,6 +10,7 @@ g:ale_python_auto_pipenv *g:ale_python_auto_pipenv*
Detect whether the file is inside a pipenv, and set the executable to `pipenv` Detect whether the file is inside a pipenv, and set the executable to `pipenv`
if true. This is overridden by a manually-set executable. if true. This is overridden by a manually-set executable.
g:ale_python_auto_poetry *g:ale_python_auto_poetry* g:ale_python_auto_poetry *g:ale_python_auto_poetry*
*b:ale_python_auto_poetry* *b:ale_python_auto_poetry*
Type: |Number| Type: |Number|
@ -18,6 +19,7 @@ g:ale_python_auto_poetry *g:ale_python_auto_poetry*
Detect whether the file is inside a poetry, and set the executable to `poetry` Detect whether the file is inside a poetry, and set the executable to `poetry`
if true. This is overridden by a manually-set executable. if true. This is overridden by a manually-set executable.
=============================================================================== ===============================================================================
ALE Python Project Root Behavior *ale-python-root* ALE Python Project Root Behavior *ale-python-root*
@ -37,6 +39,7 @@ ALE will look for configuration files with the following filenames. >
tox.ini tox.ini
.pyre_configuration.local .pyre_configuration.local
mypy.ini mypy.ini
.mypy.ini
pycodestyle.cfg pycodestyle.cfg
.flake8 .flake8
.flake8rc .flake8rc
@ -229,6 +232,7 @@ g:ale_python_black_auto_pipenv *g:ale_python_black_auto_pipenv*
Detect whether the file is inside a pipenv, and set the executable to `pipenv` Detect whether the file is inside a pipenv, and set the executable to `pipenv`
if true. This is overridden by a manually-set executable. if true. This is overridden by a manually-set executable.
g:ale_python_black_auto_poetry *g:ale_python_black_auto_poetry* g:ale_python_black_auto_poetry *g:ale_python_black_auto_poetry*
*b:ale_python_black_auto_poetry* *b:ale_python_black_auto_poetry*
Type: |Number| Type: |Number|
@ -237,6 +241,7 @@ g:ale_python_black_auto_poetry *g:ale_python_black_auto_poetry*
Detect whether the file is inside a poetry, and set the executable to `poetry` Detect whether the file is inside a poetry, and set the executable to `poetry`
if true. This is overridden by a manually-set executable. if true. This is overridden by a manually-set executable.
g:ale_python_black_change_directory *g:ale_python_black_change_directory* g:ale_python_black_change_directory *g:ale_python_black_change_directory*
*b:ale_python_black_change_directory* *b:ale_python_black_change_directory*
Type: |Number| Type: |Number|
@ -248,17 +253,23 @@ g:ale_python_black_change_directory *g:ale_python_black_change_directory*
to control the directory Python is executed from yourself. to control the directory Python is executed from yourself.
===============================================================================
cspell *ale-python-cspell*
See |ale-cspell-options|
=============================================================================== ===============================================================================
flake8 *ale-python-flake8* flake8 *ale-python-flake8*
g:ale_python_flake8_change_directory *g:ale_python_flake8_change_directory* g:ale_python_flake8_change_directory *g:ale_python_flake8_change_directory*
*b:ale_python_flake8_change_directory* *b:ale_python_flake8_change_directory*
Type: |String| Type: |String|
Default: `project` Default: `'project'`
If set to `project`, ALE will switch to the project root before checking file. If set to `project`, ALE will switch to the project root before checking file.
If set to `file`, ALE will switch to directory the Python file being If set to `file`, ALE will first switch to the directory containing the
checked with `flake8` is in before checking it. Python file being checked with `flake8` before checking it.
You can turn it off with `off` option if you want to control the directory You can turn it off with `off` option if you want to control the directory
Python is executed from yourself. Python is executed from yourself.
@ -320,6 +331,7 @@ g:ale_python_flake8_auto_poetry *g:ale_python_flake8_auto_poetry*
Detect whether the file is inside a poetry, and set the executable to `poetry` Detect whether the file is inside a poetry, and set the executable to `poetry`
if true. This is overridden by a manually-set executable. if true. This is overridden by a manually-set executable.
=============================================================================== ===============================================================================
flakehell *ale-python-flakehell* flakehell *ale-python-flakehell*
@ -384,6 +396,7 @@ g:ale_python_flakehell_auto_poetry *g:ale_python_flakehell_auto_poetry*
Detect whether the file is inside a poetry, and set the executable to `poetry` Detect whether the file is inside a poetry, and set the executable to `poetry`
if true. This is overridden by a manually-set executable. if true. This is overridden by a manually-set executable.
=============================================================================== ===============================================================================
isort *ale-python-isort* isort *ale-python-isort*
@ -504,7 +517,6 @@ g:ale_python_mypy_use_global *g:ale_python_mypy_use_global*
See |ale-integrations-local-executables| See |ale-integrations-local-executables|
=============================================================================== ===============================================================================
prospector *ale-python-prospector* prospector *ale-python-prospector*
@ -569,7 +581,6 @@ g:ale_python_prospector_auto_poetry *g:ale_python_prospector_auto_poetry*
=============================================================================== ===============================================================================
pycodestyle *ale-python-pycodestyle* pycodestyle *ale-python-pycodestyle*
g:ale_python_pycodestyle_executable *g:ale_python_pycodestyle_executable* g:ale_python_pycodestyle_executable *g:ale_python_pycodestyle_executable*
*b:ale_python_pycodestyle_executable* *b:ale_python_pycodestyle_executable*
Type: |String| Type: |String|
@ -619,7 +630,6 @@ g:ale_python_pycodestyle_auto_poetry *g:ale_python_pycodestyle_auto_poetry*
=============================================================================== ===============================================================================
pydocstyle *ale-python-pydocstyle* pydocstyle *ale-python-pydocstyle*
g:ale_python_pydocstyle_executable *g:ale_python_pydocstyle_executable* g:ale_python_pydocstyle_executable *g:ale_python_pydocstyle_executable*
*b:ale_python_pydocstyle_executable* *b:ale_python_pydocstyle_executable*
Type: |String| Type: |String|
@ -669,7 +679,6 @@ g:ale_python_pydocstyle_auto_poetry *g:ale_python_pydocstyle_auto_poetry*
=============================================================================== ===============================================================================
pyflakes *ale-python-pyflakes* pyflakes *ale-python-pyflakes*
g:ale_python_pyflakes_executable *g:ale_python_pyflakes_executable* g:ale_python_pyflakes_executable *g:ale_python_pyflakes_executable*
*b:ale_python_pyflakes_executable* *b:ale_python_pyflakes_executable*
Type: |String| Type: |String|
@ -699,6 +708,52 @@ g:ale_python_pyflakes_auto_poetry *g:ale_python_pyflakes_auto_poetry*
if true. This is overridden by a manually-set executable. if true. This is overridden by a manually-set executable.
===============================================================================
pyflyby *ale-python-pyflyby*
g:ale_python_pyflyby_executable *g:ale_python_pyflyby_executable*
*b:ale_python_pyflyby_executable*
Type: |String|
Default: `'tidy-imports'`
See |ale-integrations-local-executables|
g:ale_python_pyflyby_options *g:ale_python_pyflyby_options*
*b:ale_python_pyflyby_options*
Type: |String|
Default: `''`
This variable can be changed to add command-line arguments to the pyflyby
tidy-imports invocation.
g:ale_python_pyflyby_use_global *g:ale_python_pyflyby_use_global*
*b:ale_python_pyflyby_use_global*
Type: |Number|
Default: `get(g:, 'ale_use_global_executables', 0)`
See |ale-integrations-local-executables|
g:ale_python_pyflyby_auto_pipenv *g:ale_python_pyflyby_auto_pipenv*
*b:ale_python_pyflyby_auto_pipenv*
Type: |Number|
Default: `0`
Detect whether the file is inside a pipenv, and set the executable to `pipenv`
if true. This is overridden by a manually-set executable.
g:ale_python_pyflyby_auto_poetry *g:ale_python_pyflyby_auto_poetry*
*b:ale_python_pyflyby_auto_poetry*
Type: |Number|
Default: `0`
Detect whether the file is inside a poetry, and set the executable to `poetry`
if true. This is overridden by a manually-set executable.
=============================================================================== ===============================================================================
pylama *ale-python-pylama* pylama *ale-python-pylama*
@ -925,6 +980,7 @@ g:ale_python_pylsp_options *g:ale_python_pylsp_options
An example stragety for installing `pylsp`: An example stragety for installing `pylsp`:
`python3 -m pip install --user pylsp` `python3 -m pip install --user pylsp`
=============================================================================== ===============================================================================
pyre *ale-python-pyre* pyre *ale-python-pyre*
@ -1057,6 +1113,58 @@ g:ale_python_reorder_python_imports_use_global
See |ale-integrations-local-executables| See |ale-integrations-local-executables|
===============================================================================
unimport *ale-python-unimport*
`unimport` will be run from a detected project root, per |ale-python-root|.
g:ale_python_unimport_auto_pipenv *g:ale_python_unimport_auto_pipenv*
*b:ale_python_unimport_auto_pipenv*
Type: |Number|
Default: `0`
Detect whether the file is inside a pipenv, and set the executable to `pipenv`
if true. This is overridden by a manually-set executable.
g:ale_python_unimport_auto_poetry *g:ale_python_unimport_auto_poetry*
*b:ale_python_unimport_auto_poetry*
Type: |Number|
Default: `0`
Detect whether the file is inside a poetry, and set the executable to `poetry`
if true. This is overridden by a manually-set executable.
g:ale_python_unimport_executable *g:ale_python_unimport_executable*
*b:ale_python_unimport_executable*
Type: |String|
Default: `'unimport'`
See |ale-integrations-local-executables|
Set this to `'pipenv'` to invoke `'pipenv` `run` `unimport'`.
Set this to `'poetry'` to invoke `'poetry` `run` `unimport'`.
g:ale_python_unimport_options *g:ale_python_unimport_options*
*b:ale_python_unimport_options*
Type: |String|
Default: `''`
This variable can be changed to add command-line arguments to the unimport
invocation.
g:ale_python_unimport_use_global *g:ale_python_unimport_use_global*
*b:ale_python_unimport_use_global*
Type: |Number|
Default: `get(g:, 'ale_use_global_executables', 0)`
See |ale-integrations-local-executables|
=============================================================================== ===============================================================================
vulture *ale-python-vulture* vulture *ale-python-vulture*

View file

@ -2,6 +2,12 @@
ALE reStructuredText Integration *ale-restructuredtext-options* ALE reStructuredText Integration *ale-restructuredtext-options*
===============================================================================
cspell *ale-restructuredtext-cspell*
See |ale-cspell-options|
=============================================================================== ===============================================================================
textlint *ale-restructuredtext-textlint* textlint *ale-restructuredtext-textlint*
@ -16,6 +22,7 @@ See: https://github.com/jimo1001/docutils-ast-writer
See |ale-text-textlint| See |ale-text-textlint|
=============================================================================== ===============================================================================
write-good *ale-restructuredtext-write-good* write-good *ale-restructuredtext-write-good*

View file

@ -21,6 +21,13 @@ g:ale_ruby_brakeman_options *g:ale_ruby_brakeman_options*
The contents of this variable will be passed through to brakeman. The contents of this variable will be passed through to brakeman.
===============================================================================
cspell *ale-ruby-cspell*
See |ale-cspell-options|
=============================================================================== ===============================================================================
debride *ale-ruby-debride* debride *ale-ruby-debride*
@ -212,7 +219,5 @@ g:ale_ruby_standardrb_options *g:ale_ruby_standardrb_options*
This variable can be changed to modify flags given to standardrb. This variable can be changed to modify flags given to standardrb.
===============================================================================
=============================================================================== ===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View file

@ -26,8 +26,10 @@ Integration Information
4. analyzer -- If you have rust-analyzer installed, you might prefer using 4. analyzer -- If you have rust-analyzer installed, you might prefer using
this linter over cargo and rls. rust-analyzer also implements the this linter over cargo and rls. rust-analyzer also implements the
Language Server Protocol for incremental compilation of Rust code, and is Language Server Protocol for incremental compilation of Rust code, and is
the next iteration of rls. rust-analyzer, like rls, requires Rust files the next iteration of rls. rust-analyzer either requires Rust files to be
to be contained in Cargo projects. contained in Cargo projects or requires the project to be described in
the rust-project.json format:
https://rust-analyzer.github.io/manual.html#non-cargo-based-projects
5. rustfmt -- If you have `rustfmt` installed, you can use it as a fixer to 5. rustfmt -- If you have `rustfmt` installed, you can use it as a fixer to
consistently reformat your Rust code. consistently reformat your Rust code.
@ -38,7 +40,7 @@ Integration Information
let g:ale_linters = {'rust': ['rustc', 'rls']} let g:ale_linters = {'rust': ['rustc', 'rls']}
< <
Also note that rustc 1.12. or later is needed. Also note that rustc 1.18. or later is needed.
=============================================================================== ===============================================================================
@ -145,8 +147,7 @@ g:ale_rust_cargo_avoid_whole_workspace *g:ale_rust_cargo_avoid_whole_workspace*
in the crate's directory. Otherwise, behave as usual. in the crate's directory. Otherwise, behave as usual.
g:ale_rust_cargo_use_clippy g:ale_rust_cargo_use_clippy *g:ale_rust_cargo_use_clippy*
*g:ale_rust_cargo_use_clippy*
*b:ale_rust_cargo_use_clippy* *b:ale_rust_cargo_use_clippy*
Type: |Number| Type: |Number|
Default: `0` Default: `0`
@ -163,8 +164,7 @@ g:ale_rust_cargo_use_clippy
let g:ale_rust_cargo_use_clippy = executable('cargo-clippy') let g:ale_rust_cargo_use_clippy = executable('cargo-clippy')
< <
g:ale_rust_cargo_clippy_options g:ale_rust_cargo_clippy_options *g:ale_rust_cargo_clippy_options*
*g:ale_rust_cargo_clippy_options*
*b:ale_rust_cargo_clippy_options* *b:ale_rust_cargo_clippy_options*
Type: |String| Type: |String|
@ -175,8 +175,7 @@ g:ale_rust_cargo_clippy_options
only `cargo clippy` supports (e.g. `--deny`). only `cargo clippy` supports (e.g. `--deny`).
g:ale_rust_cargo_target_dir g:ale_rust_cargo_target_dir *g:ale_rust_cargo_target_dir*
*g:ale_rust_cargo_target_dir*
*b:ale_rust_cargo_target_dir* *b:ale_rust_cargo_target_dir*
Type: |String| Type: |String|
@ -187,6 +186,12 @@ g:ale_rust_cargo_target_dir
running `cargo` commands manually while ALE is performing its checks. running `cargo` commands manually while ALE is performing its checks.
===============================================================================
cspell *ale-rust-cspell*
See |ale-cspell-options|
=============================================================================== ===============================================================================
rls *ale-rust-rls* rls *ale-rust-rls*
@ -234,13 +239,13 @@ rustc *ale-rust-rustc*
g:ale_rust_rustc_options *g:ale_rust_rustc_options* g:ale_rust_rustc_options *g:ale_rust_rustc_options*
*b:ale_rust_rustc_options* *b:ale_rust_rustc_options*
Type: |String| Type: |String|
Default: `'-Z no-codegen'` Default: `'--emit=mir -o /dev/null'`
The variable can be used to change the options passed to `rustc`. The variable can be used to change the options passed to `rustc`.
`-Z no-codegen` should only work with nightly builds of Rust. Be careful when Users of nightly builds of Rust might want to use `-Z no-codegen` instead.
setting the options, as running `rustc` could execute code or generate Be careful when setting the options, as running `rustc` could execute code
binary files. or generate binary files.
g:ale_rust_ignore_error_codes *g:ale_rust_ignore_error_codes* g:ale_rust_ignore_error_codes *g:ale_rust_ignore_error_codes*

View file

@ -2,6 +2,12 @@
ALE Scala Integration *ale-scala-options* ALE Scala Integration *ale-scala-options*
===============================================================================
cspell *ale-scala-cspell*
See |ale-cspell-options|
=============================================================================== ===============================================================================
metals *ale-scala-metals* metals *ale-scala-metals*

View file

@ -25,6 +25,12 @@ g:ale_sh_bashate_options *g:ale_sh_bashate_options*
let g:ale_sh_bashate_options = '-i E003' let g:ale_sh_bashate_options = '-i E003'
< <
===============================================================================
cspell *ale-sh-cspell*
See |ale-cspell-options|
=============================================================================== ===============================================================================
sh-language-server *ale-sh-language-server* sh-language-server *ale-sh-language-server*

View file

@ -2,6 +2,13 @@
ALE SQL Integration *ale-sql-options* ALE SQL Integration *ale-sql-options*
===============================================================================
dprint *ale-sql-dprint*
See |ale-dprint-options|
and https://github.com/dprint/dprint-plugin-sql/releases
=============================================================================== ===============================================================================
pgformatter *ale-sql-pgformatter* pgformatter *ale-sql-pgformatter*

View file

@ -14,6 +14,7 @@ Notes:
* Ada * Ada
* `ada_language_server` * `ada_language_server`
* `cspell`
* `gcc` * `gcc`
* `gnatpp` * `gnatpp`
* Ansible * Ansible
@ -24,7 +25,8 @@ Notes:
* `apkbuild-lint` * `apkbuild-lint`
* `secfixes-check` * `secfixes-check`
* AsciiDoc * AsciiDoc
* `alex`!! * `alex`
* `cspell`
* `languagetool`!! * `languagetool`!!
* `proselint` * `proselint`
* `redpen` * `redpen`
@ -33,10 +35,13 @@ Notes:
* `write-good` * `write-good`
* ASM * ASM
* `gcc` * `gcc`
* AVRA
* `avra`
* Awk * Awk
* `gawk` * `gawk`
* Bash * Bash
* `bashate` * `bashate`
* `cspell`
* `language-server` * `language-server`
* `shell` (-n flag) * `shell` (-n flag)
* `shellcheck` * `shellcheck`
@ -47,6 +52,8 @@ Notes:
* `buildifier` * `buildifier`
* BibTeX * BibTeX
* `bibclean` * `bibclean`
* BitBake
* `oelint-adv`
* Bourne Shell * Bourne Shell
* `shell` (-n flag) * `shell` (-n flag)
* `shellcheck` * `shellcheck`
@ -61,11 +68,13 @@ Notes:
* `cppcheck` * `cppcheck`
* `cpplint`!! * `cpplint`!!
* `cquery` * `cquery`
* `cspell`
* `flawfinder` * `flawfinder`
* `gcc` (`cc`) * `gcc` (`cc`)
* `uncrustify` * `uncrustify`
* C# * C#
* `csc`!! * `csc`!!
* `cspell`
* `dotnet-format` * `dotnet-format`
* `mcs` * `mcs`
* `mcsc`!! * `mcsc`!!
@ -82,9 +91,12 @@ Notes:
* `cppcheck` * `cppcheck`
* `cpplint`!! * `cpplint`!!
* `cquery` * `cquery`
* `cspell`
* `flawfinder` * `flawfinder`
* `gcc` (`cc`) * `gcc` (`cc`)
* `uncrustify` * `uncrustify`
* Cairo
* `starknet`
* Chef * Chef
* `cookstyle` * `cookstyle`
* `foodcritic`!! * `foodcritic`!!
@ -95,6 +107,7 @@ Notes:
* `cfn-python-lint` * `cfn-python-lint`
* CMake * CMake
* `cmake-format` * `cmake-format`
* `cmake-lint`
* `cmakelint` * `cmakelint`
* CoffeeScript * CoffeeScript
* `coffee` * `coffee`
@ -103,6 +116,8 @@ Notes:
* `ameba`!! * `ameba`!!
* `crystal`!! * `crystal`!!
* CSS * CSS
* `VSCode CSS language server`
* `cspell`
* `csslint` * `csslint`
* `fecs` * `fecs`
* `prettier` * `prettier`
@ -127,7 +142,6 @@ Notes:
* `analysis_server` * `analysis_server`
* `dart-analyze`!! * `dart-analyze`!!
* `dart-format`!! * `dart-format`!!
* `dartanalyzer`!!
* `dartfmt`!! * `dartfmt`!!
* `language_server` * `language_server`
* desktop * desktop
@ -138,9 +152,11 @@ Notes:
* `dhall-lint` * `dhall-lint`
* Dockerfile * Dockerfile
* `dockerfile_lint` * `dockerfile_lint`
* `dprint`
* `hadolint` * `hadolint`
* Elixir * Elixir
* `credo` * `credo`
* `cspell`
* `dialyxir` * `dialyxir`
* `dogma`!! * `dogma`!!
* `elixir-ls` * `elixir-ls`
@ -178,10 +194,12 @@ Notes:
* `glslls` * `glslls`
* Go * Go
* `bingo` * `bingo`
* `cspell`
* `go build`!! * `go build`!!
* `go mod`!! * `go mod`!!
* `go vet`!! * `go vet`!!
* `gofmt` * `gofmt`
* `gofumpt`
* `goimports` * `goimports`
* `golangci-lint`!! * `golangci-lint`!!
* `golangserver` * `golangserver`
@ -208,6 +226,7 @@ Notes:
* Haskell * Haskell
* `brittany` * `brittany`
* `cabal-ghc` * `cabal-ghc`
* `cspell`
* `floskell` * `floskell`
* `ghc` * `ghc`
* `ghc-mod` * `ghc-mod`
@ -222,10 +241,13 @@ Notes:
* `stack-ghc` * `stack-ghc`
* `stylish-haskell` * `stylish-haskell`
* HCL * HCL
* `packer-fmt`
* `terraform-fmt` * `terraform-fmt`
* HTML * HTML
* `alex`!! * `VSCode HTML language server`
* `alex`
* `angular` * `angular`
* `cspell`
* `fecs` * `fecs`
* `html-beautify` * `html-beautify`
* `htmlhint` * `htmlhint`
@ -244,13 +266,16 @@ Notes:
* Java * Java
* `PMD` * `PMD`
* `checkstyle`!! * `checkstyle`!!
* `cspell`
* `eclipselsp` * `eclipselsp`
* `google-java-format` * `google-java-format`
* `javac` * `javac`
* `javalsp` * `javalsp`
* `uncrustify` * `uncrustify`
* JavaScript * JavaScript
* `cspell`
* `deno` * `deno`
* `dprint`
* `eslint` * `eslint`
* `fecs` * `fecs`
* `flow` * `flow`
@ -263,6 +288,9 @@ Notes:
* `tsserver` * `tsserver`
* `xo` * `xo`
* JSON * JSON
* `VSCode JSON language server`
* `cspell`
* `dprint`
* `eslint` * `eslint`
* `fixjson` * `fixjson`
* `jq` * `jq`
@ -283,8 +311,9 @@ Notes:
* `ktlint` * `ktlint`
* `languageserver` * `languageserver`
* LaTeX (tex) * LaTeX (tex)
* `alex`!! * `alex`
* `chktex` * `chktex`
* `cspell`
* `lacheck` * `lacheck`
* `proselint` * `proselint`
* `redpen` * `redpen`
@ -299,20 +328,23 @@ Notes:
* LLVM * LLVM
* `llc` * `llc`
* Lua * Lua
* `cspell`
* `lua-format` * `lua-format`
* `luac` * `luac`
* `luacheck` * `luacheck`
* `luafmt` * `luafmt`
* `selene`
* `stylua` * `stylua`
* Mail * Mail
* `alex`!! * `alex`
* `languagetool`!! * `languagetool`!!
* `proselint` * `proselint`
* `vale` * `vale`
* Make * Make
* `checkmake` * `checkmake`
* Markdown * Markdown
* `alex`!! * `alex`
* `cspell`
* `languagetool`!! * `languagetool`!!
* `markdownlint`!! * `markdownlint`!!
* `mdl` * `mdl`
@ -339,8 +371,9 @@ Notes:
* `nixfmt` * `nixfmt`
* `nixpkgs-fmt` * `nixpkgs-fmt`
* `rnix-lsp` * `rnix-lsp`
* `statix`
* nroff * nroff
* `alex`!! * `alex`
* `proselint` * `proselint`
* `write-good` * `write-good`
* Objective-C * Objective-C
@ -353,6 +386,7 @@ Notes:
* `clangd` * `clangd`
* `uncrustify` * `uncrustify`
* OCaml * OCaml
* `dune`
* `merlin` (see |ale-ocaml-merlin|) * `merlin` (see |ale-ocaml-merlin|)
* `ocamlformat` * `ocamlformat`
* `ocamllsp` * `ocamllsp`
@ -362,6 +396,10 @@ Notes:
* `ibm_validator` * `ibm_validator`
* `prettier` * `prettier`
* `yamllint` * `yamllint`
* OpenSCAD
* `SCA2D`
* Packer
* `packer-fmt-fixer`
* Pascal * Pascal
* `ptop` * `ptop`
* Pawn * Pawn
@ -373,34 +411,40 @@ Notes:
* Perl6 * Perl6
* `perl6 -c` * `perl6 -c`
* PHP * PHP
* `cspell`
* `intelephense` * `intelephense`
* `langserver` * `langserver`
* `phan` * `phan`
* `php -l` * `php -l`
* `php-cs-fixer` * `php-cs-fixer`
* `phpactor`
* `phpcbf` * `phpcbf`
* `phpcs` * `phpcs`
* `phpmd` * `phpmd`
* `phpstan` * `phpstan`
* `pint`
* `psalm`!! * `psalm`!!
* `tlint` * `tlint`
* PO * PO
* `alex`!! * `alex`
* `msgfmt` * `msgfmt`
* `proselint` * `proselint`
* `write-good` * `write-good`
* Pod * Pod
* `alex`!! * `alex`
* `proselint` * `proselint`
* `write-good` * `write-good`
* Pony * Pony
* `ponyc` * `ponyc`
* PowerShell * PowerShell
* `cspell`
* `powershell` * `powershell`
* `psscriptanalyzer` * `psscriptanalyzer`
* Prolog * Prolog
* `swipl` * `swipl`
* proto * proto
* `buf-format`!!
* `buf-lint`!!
* `protoc-gen-lint`!! * `protoc-gen-lint`!!
* `protolint`!! * `protolint`!!
* Pug * Pug
@ -419,6 +463,7 @@ Notes:
* `autopep8` * `autopep8`
* `bandit` * `bandit`
* `black` * `black`
* `cspell`
* `flake8` * `flake8`
* `flakehell` * `flakehell`
* `isort` * `isort`
@ -427,12 +472,14 @@ Notes:
* `pycodestyle` * `pycodestyle`
* `pydocstyle` * `pydocstyle`
* `pyflakes` * `pyflakes`
* `pyflyby`
* `pylama`!! * `pylama`!!
* `pylint`!! * `pylint`!!
* `pylsp` * `pylsp`
* `pyre` * `pyre`
* `pyright` * `pyright`
* `reorder-python-imports` * `reorder-python-imports`
* `unimport`
* `vulture`!! * `vulture`!!
* `yapf` * `yapf`
* QML * QML
@ -452,8 +499,13 @@ Notes:
* `ols` * `ols`
* `reason-language-server` * `reason-language-server`
* `refmt` * `refmt`
* Rego
* `cspell`
* `opacheck`
* `opafmt`
* reStructuredText * reStructuredText
* `alex`!! * `alex`
* `cspell`
* `proselint` * `proselint`
* `redpen` * `redpen`
* `rstcheck` * `rstcheck`
@ -466,6 +518,7 @@ Notes:
* `rpmlint` * `rpmlint`
* Ruby * Ruby
* `brakeman`!! * `brakeman`!!
* `cspell`
* `debride` * `debride`
* `prettier` * `prettier`
* `rails_best_practices`!! * `rails_best_practices`!!
@ -478,6 +531,7 @@ Notes:
* `standardrb` * `standardrb`
* Rust * Rust
* `cargo`!! * `cargo`!!
* `cspell`
* `rls` * `rls`
* `rust-analyzer` * `rust-analyzer`
* `rustc` (see |ale-integration-rust|) * `rustc` (see |ale-integration-rust|)
@ -488,6 +542,7 @@ Notes:
* `sass-lint` * `sass-lint`
* `stylelint` * `stylelint`
* Scala * Scala
* `cspell`
* `fsc` * `fsc`
* `metals` * `metals`
* `sbtserver` * `sbtserver`
@ -508,6 +563,7 @@ Notes:
* `solhint` * `solhint`
* `solium` * `solium`
* SQL * SQL
* `dprint`
* `pgformatter` * `pgformatter`
* `sql-lint` * `sql-lint`
* `sqlfmt` * `sqlfmt`
@ -522,6 +578,7 @@ Notes:
* `svelteserver` * `svelteserver`
* Swift * Swift
* Apple `swift-format` * Apple `swift-format`
* `cspell`
* `sourcekit-lsp` * `sourcekit-lsp`
* `swiftformat` * `swiftformat`
* `swiftlint` * `swiftlint`
@ -530,17 +587,20 @@ Notes:
* Tcl * Tcl
* `nagelfar`!! * `nagelfar`!!
* Terraform * Terraform
* `checkov`
* `terraform` * `terraform`
* `terraform-fmt-fixer` * `terraform-fmt-fixer`
* `terraform-ls` * `terraform-ls`
* `terraform-lsp` * `terraform-lsp`
* `tflint` * `tflint`
* Texinfo * Texinfo
* `alex`!! * `alex`
* `cspell`
* `proselint` * `proselint`
* `write-good` * `write-good`
* Text^ * Text^
* `alex`!! * `alex`
* `cspell`
* `languagetool`!! * `languagetool`!!
* `proselint` * `proselint`
* `redpen` * `redpen`
@ -550,8 +610,12 @@ Notes:
* Thrift * Thrift
* `thrift` * `thrift`
* `thriftcheck` * `thriftcheck`
* TOML
* `dprint`
* TypeScript * TypeScript
* `cspell`
* `deno` * `deno`
* `dprint`
* `eslint` * `eslint`
* `fecs` * `fecs`
* `prettier` * `prettier`
@ -580,23 +644,30 @@ Notes:
* `vimls` * `vimls`
* `vint` * `vint`
* Vim help^ * Vim help^
* `alex`!! * `alex`
* `proselint` * `proselint`
* `write-good` * `write-good`
* Vue * Vue
* `cspell`
* `prettier` * `prettier`
* `vls` * `vls`
* `volar`
* WGSL
* `naga`
* XHTML * XHTML
* `alex`!! * `alex`
* `cspell`
* `proselint` * `proselint`
* `write-good` * `write-good`
* XML * XML
* `xmllint` * `xmllint`
* YAML * YAML
* `actionlint`
* `circleci`!! * `circleci`!!
* `prettier` * `prettier`
* `spectral` * `spectral`
* `swaglint` * `swaglint`
* `yaml-language-server`
* `yamlfix` * `yamlfix`
* `yamllint` * `yamllint`
* YANG * YANG
@ -604,6 +675,7 @@ Notes:
* Zeek * Zeek
* `zeek`!! * `zeek`!!
* Zig * Zig
* `zigfmt`
* `zls` * `zls`
=============================================================================== ===============================================================================

View file

@ -19,7 +19,8 @@ Additionally, ALE tries to locate and use the nearest existing `.swift-format`
configuration file. configuration file.
g:ale_swift_appleswiftformat_executable *g:ale_swift_appleswiftformat_executable* g:ale_swift_appleswiftformat_executable
*g:ale_swift_appleswiftformat_executable*
*b:ale_swift_appleswiftformat_executable* *b:ale_swift_appleswiftformat_executable*
Type: |String| Type: |String|
Default: `'swift-format'` Default: `'swift-format'`
@ -28,7 +29,8 @@ g:ale_swift_appleswiftformat_executable *g:ale_swift_appleswiftformat_executable
`swift-format`. `swift-format`.
g:ale_swift_appleswiftformat_use_swiftpm *g:ale_swift_appleswiftformat_use_swiftpm* g:ale_swift_appleswiftformat_use_swiftpm
*g:ale_swift_appleswiftformat_use_swiftpm*
*b:ale_swift_appleswiftformat_use_swiftpm* *b:ale_swift_appleswiftformat_use_swiftpm*
Type: |Number| Type: |Number|
Default: `0` Default: `0`
@ -40,6 +42,12 @@ g:ale_swift_appleswiftformat_use_swiftpm *g:ale_swift_appleswiftformat_use_swift
See |ale-integrations-local-executables| See |ale-integrations-local-executables|
===============================================================================
cspell *ale-swift-cspell*
See |ale-cspell-options|
=============================================================================== ===============================================================================
sourcekitlsp *ale-swift-sourcekitlsp* sourcekitlsp *ale-swift-sourcekitlsp*
@ -57,4 +65,3 @@ g:ale_sourcekit_lsp_executable *g:ale_sourcekit_lsp_executable*
=============================================================================== ===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View file

@ -2,6 +2,25 @@
ALE Terraform Integration *ale-terraform-options* ALE Terraform Integration *ale-terraform-options*
===============================================================================
checkov *ale-terraform-checkov*
g:ale_terraform_checkov_executable *g:ale_terraform_checkov_executable*
*b:ale_terraform_checkov_executable*
Type: |String|
Default: `'checkov'`
This variable can be changed to use a different executable for checkov.
g:ale_terraform_checkov_options *g:ale_terraform_checkov_options*
*b:ale_terraform_checkov_options*
Type: |String|
Default: `''`
This variable can be changed to set additional options for checkov.
=============================================================================== ===============================================================================
terraform-fmt-fixer *ale-terraform-fmt-fixer* terraform-fmt-fixer *ale-terraform-fmt-fixer*

View file

@ -21,7 +21,13 @@ g:ale_tex_chktex_options *g:ale_tex_chktex_options*
This variable can be changed to modify flags given to chktex. This variable can be changed to modify flags given to chktex.
------------------------------------------------------------------------------ ===============================================================================
cspell *ale-tex-cspell*
See |ale-cspell-options|
===============================================================================
lacheck *ale-tex-lacheck* lacheck *ale-tex-lacheck*
g:ale_lacheck_executable *g:ale_lacheck_executable* g:ale_lacheck_executable *g:ale_lacheck_executable*
@ -32,7 +38,6 @@ g:ale_lacheck_executable *g:ale_lacheck_executable*
This variable can be changed to change the path to lacheck. This variable can be changed to change the path to lacheck.
=============================================================================== ===============================================================================
latexindent *ale-tex-latexindent* latexindent *ale-tex-latexindent*
@ -52,7 +57,6 @@ g:ale_tex_latexindent_options *g:ale_tex_latexindent_options*
This variable can be changed to modify flags given to latexindent. This variable can be changed to modify flags given to latexindent.
=============================================================================== ===============================================================================
texlab *ale-tex-texlab* texlab *ale-tex-texlab*
@ -69,9 +73,23 @@ g:ale_tex_texlab_options *g:ale_tex_texlab_options*
Type: |String| Type: |String|
Default: `''` Default: `''`
This variable can be changed to modify flags given to texlab. This variable can be changed to modify flags given to texlab command.
g:ale_tex_texlab_config *g:ale_tex_texlab_config*
*b:ale_tex_texlab_config*
Type: |Dictionary|
Default: `{}`
Dictionary containing LSP configuration settings used to initialize texlab
language server. Refer to texlab documentation for possible settings:
https://github.com/latex-lsp/texlab/blob/master/docs/options.md
For example to set build onSave initialization setting:
>
let g:ale_tex_texlab_config = {"build":{"onSave":v:true}}
<
=============================================================================== ===============================================================================
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:

View file

@ -2,6 +2,12 @@
ALE Texinfo Integration *ale-texinfo-options* ALE Texinfo Integration *ale-texinfo-options*
===============================================================================
cspell *ale-texinfo-cspell*
See |ale-cspell-options|
=============================================================================== ===============================================================================
write-good *ale-texinfo-write-good* write-good *ale-texinfo-write-good*

View file

@ -2,6 +2,12 @@
ALE Text Integration *ale-text-options* ALE Text Integration *ale-text-options*
==============================================================================
cspell *ale-text-cspell*
See |ale-cspell-options|
=============================================================================== ===============================================================================
textlint *ale-text-textlint* textlint *ale-text-textlint*

View file

@ -2,6 +2,12 @@
ALE TypeScript Integration *ale-typescript-options* ALE TypeScript Integration *ale-typescript-options*
===============================================================================
cspell *ale-typescript-cspell*
See |ale-cspell-options|
=============================================================================== ===============================================================================
deno *ale-typescript-deno* deno *ale-typescript-deno*
@ -27,6 +33,7 @@ g:ale_deno_lsp_project_root *g:ale_deno_lsp_project_root*
3. Use the directory of the current buffer (if the buffer was opened from 3. Use the directory of the current buffer (if the buffer was opened from
a file). a file).
g:ale_deno_unstable *g:ale_deno_unstable* g:ale_deno_unstable *g:ale_deno_unstable*
*b:ale_deno_unstable* *b:ale_deno_unstable*
Type: |Number| Type: |Number|
@ -34,6 +41,7 @@ g:ale_deno_unstable *g:ale_deno_unstable*
Enable or disable unstable Deno features and APIs. Enable or disable unstable Deno features and APIs.
g:ale_deno_importMap *g:ale_deno_importMap* g:ale_deno_importMap *g:ale_deno_importMap*
*b:ale_deno_importMap* *b:ale_deno_importMap*
Type: |String| Type: |String|
@ -41,6 +49,13 @@ g:ale_deno_importMap *g:ale_deno_importMap
Specify the import map filename to load url maps in a deno project. Specify the import map filename to load url maps in a deno project.
===============================================================================
dprint *ale-typescript-dprint*
See |ale-dprint-options| and https://dprint.dev/plugins/typescript
=============================================================================== ===============================================================================
eslint *ale-typescript-eslint* eslint *ale-typescript-eslint*

Some files were not shown because too many files have changed in this diff Show more