mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
Compare commits
88 Commits
v4.0.x
...
d2f4090c33
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2f4090c33 | ||
|
|
59c6b4f7b0 | ||
|
|
21d5de18b2 | ||
|
|
ed26d1f1d9 | ||
|
|
9811114948 | ||
|
|
4217461c48 | ||
|
|
528e25954b | ||
|
|
b415dddf9f | ||
|
|
55acb6536e | ||
|
|
34d1fd266b | ||
|
|
84eae97bf2 | ||
|
|
9acafa8018 | ||
|
|
11cbd96667 | ||
|
|
ce1ee7c598 | ||
|
|
a083d58c7f | ||
|
|
3539f39d4d | ||
|
|
37e64b5caf | ||
|
|
822d9a1bf3 | ||
|
|
92dd497e6c | ||
|
|
6d7bc15d9a | ||
|
|
29f1ff2579 | ||
|
|
7df94447c1 | ||
|
|
c74b917648 | ||
|
|
206b414120 | ||
|
|
5dfd1fdb9a | ||
|
|
ac691b0b89 | ||
|
|
28573c8ada | ||
|
|
d6f1a47647 | ||
|
|
487d915984 | ||
|
|
c7f3ba9d41 | ||
|
|
295752ff3e | ||
|
|
3d68ec7857 | ||
|
|
e670c9781c | ||
|
|
0d1d0a9f81 | ||
|
|
c8890af8d4 | ||
|
|
9abe393961 | ||
|
|
4b1bf3ee8f | ||
|
|
edccdfa9ef | ||
|
|
9e49019a26 | ||
|
|
a0572359ae | ||
|
|
80ff84db84 | ||
|
|
c8c33e7217 | ||
|
|
5098dfd27e | ||
|
|
7cdaaa645d | ||
|
|
2f4a866591 | ||
|
|
f9de268816 | ||
|
|
1aaeb2cdae | ||
|
|
05e22db9a2 | ||
|
|
d0cdde7516 | ||
|
|
baaca9a5d7 | ||
|
|
aac34cd45a | ||
|
|
366de225fd | ||
|
|
22185c4c5c | ||
|
|
2883260ade | ||
|
|
090d31b79a | ||
|
|
067e74fee8 | ||
|
|
ff8fe94494 | ||
|
|
6433d31f47 | ||
|
|
f3f0b05240 | ||
|
|
add538213f | ||
|
|
dd23b92ee9 | ||
|
|
f90e72ae1f | ||
|
|
26ffb9dfa3 | ||
|
|
db43854ca3 | ||
|
|
b85e5191a3 | ||
|
|
ecf815891d | ||
|
|
bd591d47f2 | ||
|
|
06f4b6fe25 | ||
|
|
400857d758 | ||
|
|
2280d41b30 | ||
|
|
cdbd218a82 | ||
|
|
73b568b071 | ||
|
|
4f4d68f153 | ||
|
|
25547c856e | ||
|
|
cec1b26d82 | ||
|
|
33377583fd | ||
|
|
22c741648f | ||
|
|
338f3eeb73 | ||
|
|
8ee20eca4b | ||
|
|
f3512cd778 | ||
|
|
7fcc0548b0 | ||
|
|
9ce2c29df1 | ||
|
|
59c996c5b8 | ||
|
|
c4cedeea3f | ||
|
|
f3b6269388 | ||
|
|
47f1f49655 | ||
|
|
fe6a91fb92 | ||
|
|
995d78435a |
@@ -41,10 +41,10 @@ install:
|
||||
- ps: >-
|
||||
if (!(Test-Path -Path C:\vim)){
|
||||
Add-Type -A System.IO.Compression.FileSystem
|
||||
Invoke-WebRequest ftp://ftp.vim.org/pub/vim/pc/vim80-586w32.zip `
|
||||
Invoke-WebRequest https://github.com/dense-analysis/ale/releases/download/v4.0.0/vim80-586w32.zip `
|
||||
-OutFile C:\vim.zip
|
||||
[IO.Compression.ZipFile]::ExtractToDirectory('C:\vim.zip', 'C:\vim')
|
||||
Invoke-WebRequest ftp://ftp.vim.org/pub/vim/pc/vim80-586rt.zip `
|
||||
Invoke-WebRequest https://github.com/dense-analysis/ale/releases/download/v4.0.0/vim80-586rt.zip `
|
||||
-OutFile C:\rt.zip
|
||||
[IO.Compression.ZipFile]::ExtractToDirectory('C:\rt.zip', 'C:\vim')
|
||||
}
|
||||
|
||||
1
.github/ISSUE_TEMPLATE/report-a-bug.md
vendored
1
.github/ISSUE_TEMPLATE/report-a-bug.md
vendored
@@ -1,6 +1,7 @@
|
||||
---
|
||||
name: Report a bug
|
||||
labels: bug
|
||||
type: Bug
|
||||
about: Report a bug with ALE.
|
||||
|
||||
---
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
name: Suggest a new linter or fixer
|
||||
labels: new tool
|
||||
type: Task
|
||||
about: Suggest a new tool ALE can officially integrate with.
|
||||
|
||||
---
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
---
|
||||
name: Suggest an improvement
|
||||
labels: enhancement
|
||||
type: Feature
|
||||
about: Suggest some way to improve ALE, or add a new feature.
|
||||
|
||||
---
|
||||
|
||||
1
.github/workflows/main.yml
vendored
1
.github/workflows/main.yml
vendored
@@ -30,6 +30,7 @@ jobs:
|
||||
- '--vim-90-only'
|
||||
- '--neovim-07-only'
|
||||
- '--neovim-08-only'
|
||||
- '--lua-only'
|
||||
- '--linters-only'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
20
.luarc.json
Normal file
20
.luarc.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json",
|
||||
"diagnostics.globals": [
|
||||
"vim"
|
||||
],
|
||||
"workspace.ignoreDir": [
|
||||
"test"
|
||||
],
|
||||
"workspace.library": [
|
||||
"/usr/share/nvim/runtime/lua",
|
||||
"/opt/homebrew/share/nvim/runtime/lua"
|
||||
],
|
||||
"runtime.pathStrict": true,
|
||||
"runtime.path": [
|
||||
"lua/?.lua",
|
||||
"lua/?/init.lua"
|
||||
],
|
||||
"runtime.version": "LuaJIT",
|
||||
"hint.enable": false
|
||||
}
|
||||
13
Dockerfile
13
Dockerfile
@@ -2,12 +2,10 @@ ARG TESTBED_VIM_VERSION=24
|
||||
|
||||
FROM testbed/vim:${TESTBED_VIM_VERSION}
|
||||
|
||||
RUN install_vim -tag v8.0.0027 -build \
|
||||
-tag v9.0.0297 -build \
|
||||
-tag neovim:v0.7.0 -build \
|
||||
-tag neovim:v0.8.0 -build
|
||||
|
||||
ENV PACKAGES="\
|
||||
lua5.1 \
|
||||
lua5.1-dev \
|
||||
lua5.1-busted \
|
||||
bash \
|
||||
git \
|
||||
python2 \
|
||||
@@ -19,6 +17,11 @@ ENV PACKAGES="\
|
||||
RUN apk --update add $PACKAGES && \
|
||||
rm -rf /var/cache/apk/* /tmp/* /var/tmp/*
|
||||
|
||||
RUN install_vim -tag v8.0.0027 -build \
|
||||
-tag v9.0.0297 -build \
|
||||
-tag neovim:v0.7.0 -build \
|
||||
-tag neovim:v0.8.0 -build
|
||||
|
||||
RUN pip install vim-vint==0.3.21
|
||||
|
||||
RUN git clone https://github.com/junegunn/vader.vim vader && \
|
||||
|
||||
18
README.md
18
README.md
@@ -56,10 +56,19 @@ linting and fixing of code in Vim. ALE offers the following.
|
||||
* Near-zero configuration with custom code for better defaults
|
||||
* Highly customizable and well-documented (`:help ale-options`)
|
||||
* Breaking changes for the plugin are extremely rare
|
||||
* Integrates with Neovim's LSP client (0.8+) and diagnostics (0.7+)
|
||||
* Support for older Vim and Neovim versions
|
||||
* Windows support
|
||||
* Well-integrated with other plugins
|
||||
|
||||
## Sponsorship
|
||||
|
||||
If you would like to donate to Dense Analysis to say thank you for ALE, please
|
||||
consider visiting our [Sponsorship page](https://denseanalysis.org/sponsors/).
|
||||
Funds will be used to pay for our hosting fees and research. Whilst visiting our
|
||||
site, please feel free to make use of our educational resources and other
|
||||
recommended tools.
|
||||
|
||||
## Supported Languages and Tools
|
||||
|
||||
ALE supports a wide variety of languages and tools. See the
|
||||
@@ -140,6 +149,12 @@ ALE offers some support for completion via hijacking of omnicompletion while you
|
||||
type. All of ALE's completion information must come from Language Server
|
||||
Protocol linters, or from `tsserver` for TypeScript.
|
||||
|
||||
When running ALE in Neovim 0.8+, ALE will integrate with Neovim's LSP client by
|
||||
default, and any auto-completion plugin that uses the native LSP client will
|
||||
work when ALE runs language servers.
|
||||
[nvim-cmp](https://github.com/hrsh7th/nvim-cmp) is recommended as a
|
||||
completion plugin worth trying in Neovim.
|
||||
|
||||
ALE integrates with [Deoplete](https://github.com/Shougo/deoplete.nvim) as a
|
||||
completion source, named `'ale'`. You can configure Deoplete to only use ALE as
|
||||
the source of completion information, or mix it with other sources.
|
||||
@@ -186,7 +201,8 @@ LSP servers (e.g. eclipselsp). See `:help ale-completion` for more information.
|
||||
|
||||
ALE supports jumping to the definition of words under your cursor with the
|
||||
`:ALEGoToDefinition` command using any enabled Language Server Protocol linters
|
||||
and `tsserver`.
|
||||
and `tsserver`. In Neovim 0.8+, you can also use Neovim's built in `gd` keybind
|
||||
and more.
|
||||
|
||||
See `:help ale-go-to-definition` for more information.
|
||||
|
||||
|
||||
@@ -2,11 +2,44 @@
|
||||
" Description: ansible-lint for ansible-yaml files
|
||||
|
||||
call ale#Set('ansible_ansible_lint_executable', 'ansible-lint')
|
||||
call ale#Set('ansible_ansible_lint_auto_pipenv', 0)
|
||||
call ale#Set('ansible_ansible_lint_auto_poetry', 0)
|
||||
call ale#Set('ansible_ansible_lint_auto_uv', 0)
|
||||
call ale#Set('ansible_ansible_lint_change_directory', 1)
|
||||
|
||||
function! ale_linters#ansible#ansible_lint#GetExecutable(buffer) abort
|
||||
if (ale#Var(a:buffer, 'python_auto_pipenv')
|
||||
\ || ale#Var(a:buffer, 'ansible_ansible_lint_auto_pipenv'))
|
||||
\ && ale#python#PipenvPresent(a:buffer)
|
||||
return 'pipenv'
|
||||
endif
|
||||
|
||||
if (ale#Var(a:buffer, 'python_auto_poetry')
|
||||
\ || ale#Var(a:buffer, 'ansible_ansible_lint_auto_poetry'))
|
||||
\ && ale#python#PoetryPresent(a:buffer)
|
||||
return 'poetry'
|
||||
endif
|
||||
|
||||
if (ale#Var(a:buffer, 'python_auto_uv')
|
||||
\ || ale#Var(a:buffer, 'ansible_ansible_lint_auto_uv'))
|
||||
\ && ale#python#UvPresent(a:buffer)
|
||||
return 'uv'
|
||||
endif
|
||||
|
||||
return ale#Var(a:buffer, 'ansible_ansible_lint_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#ansible#ansible_lint#GetCwd(buffer) abort
|
||||
if ale#Var(a:buffer, 'ansible_ansible_lint_change_directory')
|
||||
" Run from project root if found, else from buffer dir.
|
||||
let l:project_root = ale#python#FindProjectRoot(a:buffer)
|
||||
|
||||
return !empty(l:project_root) ? l:project_root : '%s:h'
|
||||
endif
|
||||
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! ale_linters#ansible#ansible_lint#Handle(buffer, version, lines) abort
|
||||
for l:line in a:lines[:10]
|
||||
if match(l:line, '^Traceback') >= 0
|
||||
@@ -103,28 +136,50 @@ function! ale_linters#ansible#ansible_lint#Handle(buffer, version, lines) abort
|
||||
endfunction
|
||||
|
||||
function! ale_linters#ansible#ansible_lint#GetCommand(buffer, version) abort
|
||||
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 -p %t'
|
||||
let l:executable = ale_linters#ansible#ansible_lint#GetExecutable(a:buffer)
|
||||
|
||||
let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
|
||||
\ ? ' run ansible-lint'
|
||||
\ : ''
|
||||
|
||||
let l:opts_map = {
|
||||
\ '>=6.0.0': ' --nocolor -f json -x yaml %s',
|
||||
\ '>=5.0.0': ' --nocolor --parseable-severity -x yaml %s',
|
||||
\ '<5.0.0': ' --nocolor -p %t'
|
||||
\}
|
||||
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']
|
||||
|
||||
let l:cmd_opts = ale#semver#GTE(a:version, [6, 0]) ? l:opts_map['>=6.0.0'] :
|
||||
\ ale#semver#GTE(a:version, [5, 0]) ? l:opts_map['>=5.0.0'] :
|
||||
\ l:opts_map['<5.0.0']
|
||||
|
||||
let l:command = ale#Escape(l:executable) . l:exec_args . l:cmd_opts
|
||||
|
||||
return l:command
|
||||
endfunction
|
||||
|
||||
function! ale_linters#ansible#ansible_lint#RunWithVersionCheck(buffer) abort
|
||||
let l:executable = ale_linters#ansible#ansible_lint#GetExecutable(a:buffer)
|
||||
|
||||
let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
|
||||
\ ? ' run ansible-lint'
|
||||
\ : ''
|
||||
|
||||
let l:command = ale#Escape(l:executable) . l:exec_args . ' --version'
|
||||
|
||||
return ale#semver#RunWithVersionCheck(
|
||||
\ a:buffer,
|
||||
\ l:executable,
|
||||
\ l:command,
|
||||
\ function('ale_linters#ansible#ansible_lint#GetCommand'),
|
||||
\)
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('ansible', {
|
||||
\ 'name': 'ansible_lint',
|
||||
\ 'aliases': ['ansible', 'ansible-lint'],
|
||||
\ 'executable': function('ale_linters#ansible#ansible_lint#GetExecutable'),
|
||||
\ 'command': {buffer -> ale#semver#RunWithVersionCheck(
|
||||
\ buffer,
|
||||
\ ale_linters#ansible#ansible_lint#GetExecutable(buffer),
|
||||
\ '%e --version',
|
||||
\ function('ale_linters#ansible#ansible_lint#GetCommand'),
|
||||
\ )},
|
||||
\ 'cwd': function('ale_linters#ansible#ansible_lint#GetCwd'),
|
||||
\ 'command': function('ale_linters#ansible#ansible_lint#RunWithVersionCheck'),
|
||||
\ 'lint_file': 1,
|
||||
\ 'callback': {buffer, lines -> ale#semver#RunWithVersionCheck(
|
||||
\ buffer,
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
" Author: rhysd https://rhysd.github.io
|
||||
" Description: Redpen, a proofreading tool (http://redpen.cc)
|
||||
|
||||
call ale#linter#Define('asciidoc', {
|
||||
\ 'name': 'redpen',
|
||||
\ 'executable': 'redpen',
|
||||
\ 'command': 'redpen -f asciidoc -r json %t',
|
||||
\ 'callback': 'ale#handlers#redpen#HandleRedpenOutput',
|
||||
\})
|
||||
call ale#handlers#redpen#DefineLinter('asciidoc')
|
||||
|
||||
43
ale_linters/bindzone/checkzone.vim
Normal file
43
ale_linters/bindzone/checkzone.vim
Normal file
@@ -0,0 +1,43 @@
|
||||
" Description: named-checkzone for bindzone
|
||||
|
||||
call ale#Set('bindzone_checkzone_executable', 'named-checkzone')
|
||||
call ale#Set('bindzone_checkzone_options', '-c IN')
|
||||
|
||||
function! ale_linters#bindzone#checkzone#GetCommand(buffer) abort
|
||||
return '%e' . ale#Pad(ale#Var(a:buffer, 'bindzone_checkzone_options'))
|
||||
\ . ' example.com %t'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#bindzone#checkzone#Handle(buffer, lines) abort
|
||||
let l:warning_pattern = '\vzone example.com/IN: (.+)$'
|
||||
let l:error_pattern = '\v:(\d+): (.+)$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:error_pattern)
|
||||
let l:lnum = l:match[1]
|
||||
let l:text = l:match[2]
|
||||
|
||||
call add(l:output, {'text': l:text, 'lnum': l:lnum + 0, 'type': 'E'})
|
||||
endfor
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:warning_pattern)
|
||||
let l:text = l:match[1]
|
||||
|
||||
" Ignore information messages
|
||||
let l:scrub_match = matchlist(l:text, '\v(loaded serial|not loaded due to) ')
|
||||
|
||||
if empty(l:scrub_match)
|
||||
call add(l:output, {'text': l:text, 'lnum': 0, 'type': 'W'})
|
||||
endif
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('bindzone', {
|
||||
\ 'name': 'checkzone',
|
||||
\ 'executable': {b -> ale#Var(b, 'bindzone_checkzone_executable')},
|
||||
\ 'command': function('ale_linters#bindzone#checkzone#GetCommand'),
|
||||
\ 'callback': 'ale_linters#bindzone#checkzone#Handle',
|
||||
\ 'read_buffer': 0,
|
||||
\})
|
||||
@@ -5,6 +5,14 @@ call ale#Set('bitbake_oelint_adv_executable', 'oelint-adv')
|
||||
call ale#Set('bitbake_oelint_adv_options', '')
|
||||
call ale#Set('bitbake_oelint_adv_config', '.oelint.cfg')
|
||||
|
||||
function! ale_linters#bitbake#oelint_adv#StripAnsiCodes(line) abort
|
||||
return substitute(a:line, '\e\[[0-9;]\+[mK]', '', 'g')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#bitbake#oelint_adv#RemoveBranch(line) abort
|
||||
return substitute(a:line, ' \[branch:.*', '', 'g')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#bitbake#oelint_adv#Command(buffer) abort
|
||||
let l:config_file = ale#path#FindNearestFile(a:buffer,
|
||||
\ ale#Var(a:buffer, 'bitbake_oelint_adv_config'))
|
||||
@@ -17,26 +25,25 @@ function! ale_linters#bitbake#oelint_adv#Command(buffer) abort
|
||||
endfunction
|
||||
|
||||
function! ale_linters#bitbake#oelint_adv#Handle(buffer, lines) abort
|
||||
let l:pattern = '\v^(.+):(.+):(.+):(.+):(.+)$'
|
||||
let l:pattern = '\v^(.{-}):(.{-}):(.{-}):(.{-}):(.{-})$'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
call add(l:output, {
|
||||
\ 'lnum': str2nr(l:match[2]),
|
||||
\ 'type': l:match[3] is# 'error'
|
||||
\ ? 'E' : (l:match[3] is# 'warning' ? 'W' : 'I'),
|
||||
\ 'text': StripAnsiCodes(l:match[5]),
|
||||
\ 'code': l:match[4]
|
||||
\ })
|
||||
\ 'lnum': str2nr(l:match[2]),
|
||||
\ 'type': l:match[3] is# 'error'
|
||||
\ ? 'E'
|
||||
\ : (l:match[3] is# 'warning' ? 'W' : 'I'),
|
||||
\ 'text': ale_linters#bitbake#oelint_adv#RemoveBranch(
|
||||
\ ale_linters#bitbake#oelint_adv#StripAnsiCodes(l:match[5])
|
||||
\ ),
|
||||
\ 'code': l:match[4],
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
function! StripAnsiCodes(line) abort
|
||||
return substitute(a:line, '\e\[[0-9;]\+[mK]', '', 'g')
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('bitbake', {
|
||||
\ 'name': 'oelint_adv',
|
||||
\ 'output_stream': 'both',
|
||||
|
||||
41
ale_linters/cloudformation/checkov.vim
Normal file
41
ale_linters/cloudformation/checkov.vim
Normal file
@@ -0,0 +1,41 @@
|
||||
" Author: J. Handsel <jennpbc@posteo.net>, Thyme-87 <thyme-87@posteo.me>
|
||||
" Description: use checkov for providing warnings for cloudformation via ale
|
||||
|
||||
call ale#Set('cloudformation_checkov_executable', 'checkov')
|
||||
call ale#Set('cloudformation_checkov_options', '')
|
||||
|
||||
function! ale_linters#cloudformation#checkov#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'cloudformation_checkov_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#cloudformation#checkov#GetCommand(buffer) abort
|
||||
return '%e ' . '-f %t -o json --quiet --framework cloudformation ' . ale#Var(a:buffer, 'cloudformation_checkov_options')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#cloudformation#checkov#Handle(buffer, lines) abort
|
||||
let l:output = []
|
||||
|
||||
let l:results = get(get(ale#util#FuzzyJSONDecode(a:lines, {}), 'results', []), 'failed_checks', [])
|
||||
|
||||
for l:violation in l:results
|
||||
call add(l:output, {
|
||||
\ 'filename': l:violation['file_path'],
|
||||
\ 'lnum': l:violation['file_line_range'][0],
|
||||
\ 'end_lnum': l:violation['file_line_range'][1],
|
||||
\ 'text': l:violation['check_name'] . ' [' . l:violation['check_id'] . ']',
|
||||
\ 'detail': l:violation['check_id'] . ': ' . l:violation['check_name'] . "\n" .
|
||||
\ 'For more information, see: '. l:violation['guideline'],
|
||||
\ 'type': 'W',
|
||||
\ })
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('cloudformation', {
|
||||
\ 'name': 'checkov',
|
||||
\ 'output_stream': 'stdout',
|
||||
\ 'executable': function('ale_linters#cloudformation#checkov#GetExecutable'),
|
||||
\ 'command': function('ale_linters#cloudformation#checkov#GetCommand'),
|
||||
\ 'callback': 'ale_linters#cloudformation#checkov#Handle',
|
||||
\})
|
||||
@@ -49,7 +49,6 @@ function! ale_linters#dockerfile#hadolint#Handle(buffer, lines) abort
|
||||
if l:match[5] isnot# ''
|
||||
let l:code = l:match[4] . l:match[5]
|
||||
let l:link = ' ( ' . l:domain . l:code . ' )'
|
||||
let l:text = l:code . ': ' . l:detail
|
||||
let l:detail = l:code . l:link . "\n\n" . l:detail
|
||||
else
|
||||
let l:type = 'E'
|
||||
|
||||
47
ale_linters/fortran/fortitude.vim
Normal file
47
ale_linters/fortran/fortitude.vim
Normal file
@@ -0,0 +1,47 @@
|
||||
" Author: gomfol12
|
||||
" Desciption: A linter for fortran using fortitude.
|
||||
|
||||
call ale#Set('fortran_fortitude_executable', 'fortitude')
|
||||
call ale#Set('fortran_fortitude_options', '')
|
||||
|
||||
let s:severity_map = {
|
||||
\ 'E': 'E',
|
||||
\ 'C': 'W',
|
||||
\ 'OB': 'I',
|
||||
\ 'MOD': 'I',
|
||||
\ 'S': 'I',
|
||||
\ 'PORT': 'I',
|
||||
\ 'FORT': 'I',
|
||||
\}
|
||||
|
||||
function! ale_linters#fortran#fortitude#Handle(buffer, lines) abort
|
||||
let l:output = []
|
||||
|
||||
for l:error in ale#util#FuzzyJSONDecode(a:lines, [])
|
||||
let l:prefix = matchstr(l:error['code'], '^\a\+')
|
||||
let l:type = get(s:severity_map, l:prefix, 'I')
|
||||
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:error['location']['row'],
|
||||
\ 'end_lnum': l:error['end_location']['row'],
|
||||
\ 'col': l:error['location']['column'],
|
||||
\ 'end_col': l:error['end_location']['column'],
|
||||
\ 'text': l:error['message'],
|
||||
\ 'type': l:type,
|
||||
\ 'code': l:error['code'],
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('fortran', {
|
||||
\ 'name': 'fortitude',
|
||||
\ 'output_stream': 'stdout',
|
||||
\ 'executable': {b -> ale#Var(b, 'fortran_fortitude_executable')},
|
||||
\ 'command': {b ->
|
||||
\ '%e' . ' check --output-format json' . ale#Pad(ale#Var(b, 'fortran_fortitude_options')) . ' %s'
|
||||
\ },
|
||||
\ 'callback': 'ale_linters#fortran#fortitude#Handle',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
@@ -5,26 +5,38 @@ call ale#Set('go_golangci_lint_options', '')
|
||||
call ale#Set('go_golangci_lint_executable', 'golangci-lint')
|
||||
call ale#Set('go_golangci_lint_package', 1)
|
||||
|
||||
function! ale_linters#go#golangci_lint#GetCommand(buffer) abort
|
||||
function! ale_linters#go#golangci_lint#GetExecutable(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'go_golangci_lint_executable')
|
||||
|
||||
return l:executable
|
||||
endfunction
|
||||
|
||||
function! ale_linters#go#golangci_lint#GetCommand(buffer, version) abort
|
||||
let l:filename = expand('#' . a:buffer . ':t')
|
||||
let l:options = ale#Var(a:buffer, 'go_golangci_lint_options')
|
||||
let l:lint_package = ale#Var(a:buffer, 'go_golangci_lint_package')
|
||||
|
||||
if ale#semver#GTE(a:version, [2, 0, 0])
|
||||
let l:options = l:options
|
||||
\ . ' --output.json.path stdout'
|
||||
\ . ' --output.text.path stderr'
|
||||
\ . ' --show-stats=0'
|
||||
else
|
||||
let l:options = l:options
|
||||
\ . ' --out-format=json'
|
||||
\ . ' --show-stats=0'
|
||||
endif
|
||||
|
||||
if l:lint_package
|
||||
return ale#go#EnvString(a:buffer)
|
||||
\ . '%e run '
|
||||
\ . l:options
|
||||
\ . ' --out-format=json'
|
||||
\ . ' --show-stats=0'
|
||||
endif
|
||||
|
||||
return ale#go#EnvString(a:buffer)
|
||||
\ . '%e run '
|
||||
\ . ale#Escape(l:filename)
|
||||
\ . ' ' . l:options
|
||||
\ . ' --out-format=json'
|
||||
\ . ' --show-stats=0'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#go#golangci_lint#Handler(buffer, lines) abort
|
||||
@@ -45,7 +57,7 @@ function! ale_linters#go#golangci_lint#Handler(buffer, lines) abort
|
||||
endif
|
||||
|
||||
call add(l:output, {
|
||||
\ 'filename': ale#path#GetAbsPath(l:dir, l:match['Pos']['Filename']),
|
||||
\ 'filename': ale#path#GetAbsPath(l:dir, fnamemodify(l:match['Pos']['Filename'], ':t')),
|
||||
\ 'lnum': l:match['Pos']['Line'] + 0,
|
||||
\ 'col': l:match['Pos']['Column'] + 0,
|
||||
\ 'type': l:msg_type,
|
||||
@@ -58,9 +70,14 @@ endfunction
|
||||
|
||||
call ale#linter#Define('go', {
|
||||
\ 'name': 'golangci-lint',
|
||||
\ 'executable': {b -> ale#Var(b, 'go_golangci_lint_executable')},
|
||||
\ 'executable': function('ale_linters#go#golangci_lint#GetExecutable'),
|
||||
\ 'cwd': '%s:h',
|
||||
\ 'command': function('ale_linters#go#golangci_lint#GetCommand'),
|
||||
\ 'command': {buffer -> ale#semver#RunWithVersionCheck(
|
||||
\ buffer,
|
||||
\ ale_linters#go#golangci_lint#GetExecutable(buffer),
|
||||
\ '%e --version',
|
||||
\ function('ale_linters#go#golangci_lint#GetCommand'),
|
||||
\ )},
|
||||
\ 'callback': 'ale_linters#go#golangci_lint#Handler',
|
||||
\ 'lint_file': 1,
|
||||
\})
|
||||
|
||||
12
ale_linters/gohtmltmpl/djlint.vim
Normal file
12
ale_linters/gohtmltmpl/djlint.vim
Normal file
@@ -0,0 +1,12 @@
|
||||
" Author: Adrian Vollmer <computerfluesterer@protonmail.com>
|
||||
" Description: djlint for Django HTML template files
|
||||
|
||||
call ale#Set('html_djlint_executable', 'djlint')
|
||||
call ale#Set('html_djlint_options', '')
|
||||
|
||||
call ale#linter#Define('gohtmltmpl', {
|
||||
\ 'name': 'djlint',
|
||||
\ 'executable': function('ale#handlers#djlint#GetExecutable'),
|
||||
\ 'command': function('ale#handlers#djlint#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#djlint#Handle',
|
||||
\})
|
||||
12
ale_linters/handlebars/djlint.vim
Normal file
12
ale_linters/handlebars/djlint.vim
Normal file
@@ -0,0 +1,12 @@
|
||||
" Author: Adrian Vollmer <computerfluesterer@protonmail.com>
|
||||
" Description: djlint for Django HTML template files
|
||||
|
||||
call ale#Set('html_djlint_executable', 'djlint')
|
||||
call ale#Set('html_djlint_options', '')
|
||||
|
||||
call ale#linter#Define('handlebars', {
|
||||
\ 'name': 'djlint',
|
||||
\ 'executable': function('ale#handlers#djlint#GetExecutable'),
|
||||
\ 'command': function('ale#handlers#djlint#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#djlint#Handle',
|
||||
\})
|
||||
@@ -4,45 +4,11 @@
|
||||
call ale#Set('html_djlint_executable', 'djlint')
|
||||
call ale#Set('html_djlint_options', '')
|
||||
|
||||
function! ale_linters#html#djlint#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'html_djlint_executable')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#html#djlint#GetCommand(buffer) abort
|
||||
let l:executable = ale_linters#html#djlint#GetExecutable(a:buffer)
|
||||
|
||||
let l:options = ale#Var(a:buffer, 'html_djlint_options')
|
||||
|
||||
return ale#Escape(l:executable)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '') . ' %s'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#html#djlint#Handle(buffer, lines) abort
|
||||
let l:output = []
|
||||
let l:pattern = '\v^([A-Z]\d+) (\d+):(\d+) (.*)$'
|
||||
let l:i = 0
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
let l:i += 1
|
||||
let l:item = {
|
||||
\ 'lnum': l:match[2] + 0,
|
||||
\ 'col': l:match[3] + 0,
|
||||
\ 'vcol': 1,
|
||||
\ 'text': l:match[4],
|
||||
\ 'code': l:match[1],
|
||||
\ 'type': 'W',
|
||||
\}
|
||||
call add(l:output, l:item)
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('html', {
|
||||
\ 'name': 'djlint',
|
||||
\ 'executable': function('ale_linters#html#djlint#GetExecutable'),
|
||||
\ 'command': function('ale_linters#html#djlint#GetCommand'),
|
||||
\ 'callback': 'ale_linters#html#djlint#Handle',
|
||||
\ 'executable': function('ale#handlers#djlint#GetExecutable'),
|
||||
\ 'command': function('ale#handlers#djlint#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#djlint#Handle',
|
||||
\})
|
||||
|
||||
" vim:ts=4:sw=4:et:
|
||||
|
||||
12
ale_linters/htmlangular/djlint.vim
Normal file
12
ale_linters/htmlangular/djlint.vim
Normal file
@@ -0,0 +1,12 @@
|
||||
" Author: Adrian Vollmer <computerfluesterer@protonmail.com>
|
||||
" Description: djlint for Django HTML template files
|
||||
|
||||
call ale#Set('html_djlint_executable', 'djlint')
|
||||
call ale#Set('html_djlint_options', '')
|
||||
|
||||
call ale#linter#Define('htmlangular', {
|
||||
\ 'name': 'djlint',
|
||||
\ 'executable': function('ale#handlers#djlint#GetExecutable'),
|
||||
\ 'command': function('ale#handlers#djlint#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#djlint#Handle',
|
||||
\})
|
||||
12
ale_linters/htmldjango/djlint.vim
Normal file
12
ale_linters/htmldjango/djlint.vim
Normal file
@@ -0,0 +1,12 @@
|
||||
" Author: Adrian Vollmer <computerfluesterer@protonmail.com>
|
||||
" Description: djlint for Django HTML template files
|
||||
|
||||
call ale#Set('html_djlint_executable', 'djlint')
|
||||
call ale#Set('html_djlint_options', '')
|
||||
|
||||
call ale#linter#Define('htmldjango', {
|
||||
\ 'name': 'djlint',
|
||||
\ 'executable': function('ale#handlers#djlint#GetExecutable'),
|
||||
\ 'command': function('ale#handlers#djlint#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#djlint#Handle',
|
||||
\})
|
||||
12
ale_linters/jinja/djlint.vim
Normal file
12
ale_linters/jinja/djlint.vim
Normal file
@@ -0,0 +1,12 @@
|
||||
" Author: Adrian Vollmer <computerfluesterer@protonmail.com>
|
||||
" Description: djlint for Django HTML template files
|
||||
|
||||
call ale#Set('html_djlint_executable', 'djlint')
|
||||
call ale#Set('html_djlint_options', '')
|
||||
|
||||
call ale#linter#Define('jinja', {
|
||||
\ 'name': 'djlint',
|
||||
\ 'executable': function('ale#handlers#djlint#GetExecutable'),
|
||||
\ 'command': function('ale#handlers#djlint#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#djlint#Handle',
|
||||
\})
|
||||
46
ale_linters/jinja/j2lint.vim
Normal file
46
ale_linters/jinja/j2lint.vim
Normal file
@@ -0,0 +1,46 @@
|
||||
" Description: linter for jinja using j2lint
|
||||
|
||||
call ale#Set('jinja_j2lint_executable', 'j2lint')
|
||||
call ale#Set('jinja_j2lint_options', '')
|
||||
call ale#Set('jinja_j2lint_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
call ale#Set('jinja_j2lint_auto_pipenv', 0)
|
||||
call ale#Set('jinja_j2lint_auto_poetry', 0)
|
||||
call ale#Set('jinja_j2lint_auto_uv', 0)
|
||||
|
||||
function! ale_linters#jinja#j2lint#GetExecutable(buffer) abort
|
||||
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'jinja_j2lint_auto_pipenv'))
|
||||
\ && ale#python#PipenvPresent(a:buffer)
|
||||
return 'pipenv'
|
||||
endif
|
||||
|
||||
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'jinja_j2lint_auto_poetry'))
|
||||
\ && ale#python#PoetryPresent(a:buffer)
|
||||
return 'poetry'
|
||||
endif
|
||||
|
||||
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'jinja_j2lint_auto_uv'))
|
||||
\ && ale#python#UvPresent(a:buffer)
|
||||
return 'uv'
|
||||
endif
|
||||
|
||||
return ale#python#FindExecutable(a:buffer, 'jinja_j2lint', ['j2lint'])
|
||||
endfunction
|
||||
|
||||
function! ale_linters#jinja#j2lint#GetCommand(buffer) abort
|
||||
let l:executable = ale_linters#jinja#j2lint#GetExecutable(a:buffer)
|
||||
|
||||
let l:exec_args = l:executable =~? 'pipenv\|poetry\|uv$'
|
||||
\ ? ' run j2lint'
|
||||
\ : ''
|
||||
|
||||
return ale#Escape(l:executable) . l:exec_args
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'jinja_j2lint_options'))
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('jinja', {
|
||||
\ 'name': 'j2lint',
|
||||
\ 'executable': function('ale_linters#jinja#j2lint#GetExecutable'),
|
||||
\ 'command': function('ale_linters#jinja#j2lint#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#unix#HandleAsError',
|
||||
\})
|
||||
28
ale_linters/lean/lake.vim
Normal file
28
ale_linters/lean/lake.vim
Normal file
@@ -0,0 +1,28 @@
|
||||
" Author: Benjamin Block <https://github.com/benjamindblock>
|
||||
" Description: A language server for Lean 4.
|
||||
|
||||
function! ale_linters#lean#lake#GetProjectRoot(buffer) abort
|
||||
let l:lakefile_toml = ale#path#FindNearestFile(a:buffer, 'lakefile.toml')
|
||||
let l:lakefile_lean = ale#path#FindNearestFile(a:buffer, 'lakefile.lean')
|
||||
|
||||
if !empty(l:lakefile_toml)
|
||||
return fnamemodify(l:lakefile_toml, ':p:h')
|
||||
elseif !empty(l:lakefile_lean)
|
||||
return fnamemodify(l:lakefile_lean, ':p:h')
|
||||
else
|
||||
return fnamemodify('', ':h')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
call ale#Set('lean_lake_executable', 'lake')
|
||||
call ale#Set('lean_lake_config', {})
|
||||
|
||||
call ale#linter#Define('lean', {
|
||||
\ 'name': 'lake',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'language': 'lean',
|
||||
\ 'lsp_config': {b -> ale#Var(b, 'lean_lake_config')},
|
||||
\ 'executable': {b -> ale#Var(b, 'lean_lake_executable')},
|
||||
\ 'command': '%e serve',
|
||||
\ 'project_root': function('ale_linters#lean#lake#GetProjectRoot'),
|
||||
\})
|
||||
@@ -1,9 +1,4 @@
|
||||
" Author: rhysd https://rhysd.github.io
|
||||
" Description: Redpen, a proofreading tool (http://redpen.cc)
|
||||
|
||||
call ale#linter#Define('markdown', {
|
||||
\ 'name': 'redpen',
|
||||
\ 'executable': 'redpen',
|
||||
\ 'command': 'redpen -f markdown -r json %t',
|
||||
\ 'callback': 'ale#handlers#redpen#HandleRedpenOutput',
|
||||
\})
|
||||
call ale#handlers#redpen#DefineLinter('markdown')
|
||||
|
||||
@@ -29,7 +29,7 @@ function! ale_linters#nix#nix#Handle(buffer, lines) abort
|
||||
\ 'type': 'E',
|
||||
\ 'lnum': l:result.line,
|
||||
\ 'col': l:result.column,
|
||||
\ 'text': l:result.raw_msg
|
||||
\ 'text': substitute(l:result.raw_msg, '\e\[[0-9;]*m', '', 'g'),
|
||||
\})
|
||||
endif
|
||||
endif
|
||||
|
||||
12
ale_linters/nunjucks/djlint.vim
Normal file
12
ale_linters/nunjucks/djlint.vim
Normal file
@@ -0,0 +1,12 @@
|
||||
" Author: Adrian Vollmer <computerfluesterer@protonmail.com>
|
||||
" Description: djlint for Django HTML template files
|
||||
|
||||
call ale#Set('html_djlint_executable', 'djlint')
|
||||
call ale#Set('html_djlint_options', '')
|
||||
|
||||
call ale#linter#Define('nunjucks', {
|
||||
\ 'name': 'djlint',
|
||||
\ 'executable': function('ale#handlers#djlint#GetExecutable'),
|
||||
\ 'command': function('ale#handlers#djlint#GetCommand'),
|
||||
\ 'callback': 'ale#handlers#djlint#Handle',
|
||||
\})
|
||||
43
ale_linters/perl/languageserver.vim
Normal file
43
ale_linters/perl/languageserver.vim
Normal file
@@ -0,0 +1,43 @@
|
||||
" Authors: ophirr33 <coghlan.ty@gmail.com>, rymdbar <https://rymdbar.x20.se/>
|
||||
" Description: Perl::LanguageServer for perl, from cpan.org
|
||||
|
||||
" This should have the same value as in perl.vim
|
||||
call ale#Set('perl_perl_executable', 'perl')
|
||||
" Please note that perl_perl_options does not exist here.
|
||||
|
||||
function! ale_linters#perl#languageserver#GetProjectRoot(buffer) abort
|
||||
" Makefile.PL, https://perldoc.perl.org/ExtUtils::MakeMaker
|
||||
" Build.PL, https://metacpan.org/pod/Module::Build
|
||||
" dist.ini, https://metacpan.org/pod/Dist::Zilla
|
||||
let l:potential_roots = [ 'Makefile.PL', 'Build.PL', 'dist.ini', '.git' ]
|
||||
|
||||
for l:root in l:potential_roots
|
||||
let l:project_root = ale#path#FindNearestFile(a:buffer, l:root)
|
||||
|
||||
if !empty(l:project_root)
|
||||
return fnamemodify(l:project_root . '/', ':p:h:h')
|
||||
endif
|
||||
endfor
|
||||
|
||||
return fnamemodify(expand('#' . a:buffer . ':p:h'), ':p:h')
|
||||
endfunction
|
||||
|
||||
call ale#Set('perl_languageserver_config', {})
|
||||
|
||||
function! s:get_lsp_config(buffer) abort
|
||||
" This tool doesn't kick in unless workspace/didChangeConfiguration is
|
||||
" called, thus this function returning a fallback dict when there is no
|
||||
" config.
|
||||
let l:lsp_config = ale#Var(a:buffer, 'perl_languageserver_config')
|
||||
|
||||
return empty(l:lsp_config) ? { 'perl': { 'enable': 1 } } : l:lsp_config
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('perl', {
|
||||
\ 'name': 'languageserver',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': {b -> ale#Var(b, 'perl_perl_executable')},
|
||||
\ 'command': '%e -MPerl::LanguageServer -ePerl::LanguageServer::run',
|
||||
\ 'lsp_config': {b -> s:get_lsp_config(b)},
|
||||
\ 'project_root': function('ale_linters#perl#languageserver#GetProjectRoot'),
|
||||
\ })
|
||||
@@ -1,6 +1,9 @@
|
||||
" Author: Arizard <https://github.com/Arizard>
|
||||
" Description: PHPactor integration for ALE
|
||||
|
||||
call ale#Set('php_phpactor_executable', 'phpactor')
|
||||
call ale#Set('php_phpactor_init_options', {})
|
||||
|
||||
" Copied from langserver.vim
|
||||
function! ale_linters#php#phpactor#GetProjectRoot(buffer) abort
|
||||
let l:composer_path = ale#path#FindNearestFile(a:buffer, 'composer.json')
|
||||
@@ -17,7 +20,8 @@ endfunction
|
||||
call ale#linter#Define('php', {
|
||||
\ 'name': 'phpactor',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': 'phpactor',
|
||||
\ 'executable': {b -> ale#Var(b, 'php_phpactor_executable')},
|
||||
\ 'command': '%e language-server',
|
||||
\ 'initialization_options': {b -> ale#Var(b, 'php_phpactor_init_options')},
|
||||
\ 'project_root': function('ale_linters#php#phpactor#GetProjectRoot'),
|
||||
\})
|
||||
|
||||
@@ -27,6 +27,10 @@ function! ale_linters#php#phpstan#GetCommand(buffer, version) abort
|
||||
|
||||
let l:level = ale#Var(a:buffer, 'php_phpstan_level')
|
||||
|
||||
if type(l:level) is v:t_number
|
||||
let l:level = string(l:level)
|
||||
endif
|
||||
|
||||
if empty(l:level) && empty(ale_linters#php#phpstan#FindConfigFile(a:buffer))
|
||||
" if no configuration file is found, then use 4 as a default level
|
||||
let l:level = '4'
|
||||
@@ -83,6 +87,10 @@ function! ale_linters#php#phpstan#FindConfigFile(buffer) abort
|
||||
let l:result = ale#path#FindNearestFile(a:buffer, 'phpstan.neon.dist')
|
||||
endif
|
||||
|
||||
if empty(l:result)
|
||||
let l:result = ale#path#FindNearestFile(a:buffer, 'phpstan.dist.neon')
|
||||
endif
|
||||
|
||||
return l:result
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ function! ale_linters#python#flake8#GetCwd(buffer) abort
|
||||
endif
|
||||
|
||||
if (l:change_directory is# 'project' && empty(l:cwd))
|
||||
\|| l:change_directory is# 1
|
||||
\|| l:change_directory
|
||||
\|| l:change_directory is# 'file'
|
||||
let l:cwd = '%s:h'
|
||||
endif
|
||||
|
||||
@@ -63,7 +63,7 @@ function! ale_linters#python#flakehell#GetCwd(buffer) abort
|
||||
endif
|
||||
|
||||
if (l:change_directory is# 'project' && empty(l:cwd))
|
||||
\|| l:change_directory is# 1
|
||||
\|| l:change_directory
|
||||
\|| l:change_directory is# 'file'
|
||||
let l:cwd = '%s:h'
|
||||
endif
|
||||
|
||||
@@ -82,7 +82,7 @@ function! ale_linters#python#pylint#Handle(buffer, lines) abort
|
||||
continue
|
||||
endif
|
||||
|
||||
if ale#Var(a:buffer, 'python_pylint_use_msg_id') is# 1
|
||||
if ale#Var(a:buffer, 'python_pylint_use_msg_id')
|
||||
let l:code_out = l:code
|
||||
else
|
||||
let l:code_out = l:match[4]
|
||||
|
||||
57
ale_linters/python/pyrefly.vim
Normal file
57
ale_linters/python/pyrefly.vim
Normal file
@@ -0,0 +1,57 @@
|
||||
" Author: oliverralbertini <oliver.albertini@gmail.com>
|
||||
" Description: A performant type-checker supporting LSP for Python 3 created by Facebook
|
||||
|
||||
call ale#Set('python_pyrefly_executable', 'pyrefly')
|
||||
call ale#Set('python_pyrefly_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
call ale#Set('python_pyrefly_auto_pipenv', 0)
|
||||
call ale#Set('python_pyrefly_auto_poetry', 0)
|
||||
call ale#Set('python_pyrefly_auto_uv', 0)
|
||||
|
||||
function! ale_linters#python#pyrefly#GetExecutable(buffer) abort
|
||||
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_pyrefly_auto_pipenv'))
|
||||
\ && ale#python#PipenvPresent(a:buffer)
|
||||
return 'pipenv'
|
||||
endif
|
||||
|
||||
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_pyrefly_auto_poetry'))
|
||||
\ && ale#python#PoetryPresent(a:buffer)
|
||||
return 'poetry'
|
||||
endif
|
||||
|
||||
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_pyrefly_auto_uv'))
|
||||
\ && ale#python#UvPresent(a:buffer)
|
||||
return 'uv'
|
||||
endif
|
||||
|
||||
return ale#python#FindExecutable(a:buffer, 'python_pyrefly', ['pyrefly'])
|
||||
endfunction
|
||||
|
||||
function! ale_linters#python#pyrefly#GetCommand(buffer) abort
|
||||
let l:executable = ale_linters#python#pyrefly#GetExecutable(a:buffer)
|
||||
let l:exec_args = [
|
||||
\ ale#Escape(l:executable)
|
||||
\ ]
|
||||
\ + (l:executable =~? '\(pipenv\|poetry\|uv\)$' ? ['run', 'pyrefly'] : [])
|
||||
\ + [
|
||||
\ 'lsp',
|
||||
\ ]
|
||||
|
||||
return join(l:exec_args, ' ')
|
||||
endfunction
|
||||
|
||||
function! ale_linters#python#pyrefly#GetCwd(buffer) abort
|
||||
" Run from project root if found, else from buffer dir.
|
||||
let l:project_root = ale#python#FindProjectRoot(a:buffer)
|
||||
|
||||
return !empty(l:project_root) ? l:project_root : '%s:h'
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('python', {
|
||||
\ 'name': 'pyrefly',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': function('ale_linters#python#pyrefly#GetExecutable'),
|
||||
\ 'command': function('ale_linters#python#pyrefly#GetCommand'),
|
||||
\ 'project_root': function('ale#python#FindProjectRoot'),
|
||||
\ 'completion_filter': 'ale#completion#python#CompletionItemFilter',
|
||||
\ 'cwd': function('ale_linters#python#pyrefly#GetCwd'),
|
||||
\})
|
||||
@@ -34,6 +34,22 @@ function! ale_linters#python#ruff#GetExecutable(buffer) abort
|
||||
return ale#python#FindExecutable(a:buffer, 'python_ruff', ['ruff'])
|
||||
endfunction
|
||||
|
||||
function! ale_linters#python#ruff#RunWithVersionCheck(buffer) abort
|
||||
let l:executable = ale_linters#python#ruff#GetExecutable(a:buffer)
|
||||
let l:exec_args = l:executable =~? '\(pipenv\|poetry\|uv\)$'
|
||||
\ ? ' run ruff'
|
||||
\ : ''
|
||||
|
||||
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#ruff#GetCommand'),
|
||||
\)
|
||||
endfunction
|
||||
|
||||
function! ale_linters#python#ruff#GetCwd(buffer) abort
|
||||
if ale#Var(a:buffer, 'python_ruff_change_directory')
|
||||
" Run from project root if found, else from buffer dir.
|
||||
@@ -72,20 +88,35 @@ function! ale_linters#python#ruff#Handle(buffer, lines) abort
|
||||
try
|
||||
let l:item = json_decode(l:line)
|
||||
catch
|
||||
let l:item = v:null
|
||||
" If we can't decode a line, skip it.
|
||||
continue
|
||||
endtry
|
||||
|
||||
if !empty(l:item)
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:item.location.row,
|
||||
\ 'col': l:item.location.column,
|
||||
\ 'end_lnum': l:item.end_location.row,
|
||||
\ 'end_col': l:item.end_location.column - 1,
|
||||
\ 'code': l:item.code,
|
||||
\ 'text': l:item.message,
|
||||
\ 'type': l:item.code =~? '\vE\d+' ? 'E' : 'W',
|
||||
\})
|
||||
if empty(l:item)
|
||||
continue
|
||||
endif
|
||||
|
||||
if (l:item.code is# 'W291' || l:item.code is# 'W293')
|
||||
\&& !ale#Var(a:buffer, 'warn_about_trailing_whitespace')
|
||||
" Skip warnings for trailing whitespace if the option is off.
|
||||
continue
|
||||
endif
|
||||
|
||||
if l:item.code is# 'W391'
|
||||
\&& !ale#Var(a:buffer, 'warn_about_trailing_blank_lines')
|
||||
" Skip warnings for trailing blank lines if the option is off
|
||||
continue
|
||||
endif
|
||||
|
||||
call add(l:output, {
|
||||
\ 'lnum': l:item.location.row,
|
||||
\ 'col': l:item.location.column,
|
||||
\ 'end_lnum': l:item.end_location.row,
|
||||
\ 'end_col': l:item.end_location.column - 1,
|
||||
\ 'code': l:item.code,
|
||||
\ 'text': l:item.message,
|
||||
\ 'type': l:item.code =~? '\vE\d+' ? 'E' : 'W',
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
@@ -95,12 +126,7 @@ call ale#linter#Define('python', {
|
||||
\ 'name': 'ruff',
|
||||
\ 'executable': function('ale_linters#python#ruff#GetExecutable'),
|
||||
\ 'cwd': function('ale_linters#python#ruff#GetCwd'),
|
||||
\ 'command': {buffer -> ale#semver#RunWithVersionCheck(
|
||||
\ buffer,
|
||||
\ ale_linters#python#ruff#GetExecutable(buffer),
|
||||
\ '%e --version',
|
||||
\ function('ale_linters#python#ruff#GetCommand'),
|
||||
\ )},
|
||||
\ 'command': function('ale_linters#python#ruff#RunWithVersionCheck'),
|
||||
\ 'callback': 'ale_linters#python#ruff#Handle',
|
||||
\ 'output_stream': 'both',
|
||||
\ 'read_buffer': 1,
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
" Author: rhysd https://rhysd.github.io
|
||||
" Description: Redpen, a proofreading tool (http://redpen.cc)
|
||||
|
||||
call ale#linter#Define('review', {
|
||||
\ 'name': 'redpen',
|
||||
\ 'executable': 'redpen',
|
||||
\ 'command': 'redpen -f review -r json %t',
|
||||
\ 'callback': 'ale#handlers#redpen#HandleRedpenOutput',
|
||||
\})
|
||||
call ale#handlers#redpen#DefineLinter('review')
|
||||
|
||||
25
ale_linters/roc/roc_language_server.vim
Normal file
25
ale_linters/roc/roc_language_server.vim
Normal file
@@ -0,0 +1,25 @@
|
||||
" Author: Benjamin Block <https://github.com/benjamindblock>
|
||||
" Description: A language server for Roc.
|
||||
|
||||
function! ale_linters#roc#roc_language_server#GetProjectRoot(buffer) abort
|
||||
let l:roc_main_file = ale#path#FindNearestFile(a:buffer, 'main.roc')
|
||||
|
||||
if !empty(l:roc_main_file)
|
||||
return fnamemodify(l:roc_main_file, ':p:h')
|
||||
else
|
||||
return fnamemodify('', ':h')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
call ale#Set('roc_roc_language_server_executable', 'roc_language_server')
|
||||
call ale#Set('roc_roc_language_server_config', {})
|
||||
|
||||
call ale#linter#Define('roc', {
|
||||
\ 'name': 'roc_language_server',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'language': 'roc',
|
||||
\ 'lsp_config': {b -> ale#Var(b, 'roc_roc_language_server_config')},
|
||||
\ 'executable': {b -> ale#Var(b, 'roc_roc_language_server_executable')},
|
||||
\ 'command': '%e',
|
||||
\ 'project_root': function('ale_linters#roc#roc_language_server#GetProjectRoot'),
|
||||
\})
|
||||
@@ -1,9 +1,4 @@
|
||||
" Author: rhysd https://rhysd.github.io
|
||||
" Description: Redpen, a proofreading tool (http://redpen.cc)
|
||||
|
||||
call ale#linter#Define('rst', {
|
||||
\ 'name': 'redpen',
|
||||
\ 'executable': 'redpen',
|
||||
\ 'command': 'redpen -f rest -r json %t',
|
||||
\ 'callback': 'ale#handlers#redpen#HandleRedpenOutput',
|
||||
\})
|
||||
call ale#handlers#redpen#DefineLinter('rst')
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
call ale#Set('ruby_sorbet_executable', 'srb')
|
||||
call ale#Set('ruby_sorbet_options', '')
|
||||
call ale#Set('ruby_sorbet_enable_watchman', 0)
|
||||
call ale#Set('ruby_sorbet_initialization_options', { 'highlightUntyped': v:false })
|
||||
|
||||
function! ale_linters#ruby#sorbet#GetCommand(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'ruby_sorbet_executable')
|
||||
@@ -21,6 +22,6 @@ call ale#linter#Define('ruby', {
|
||||
\ 'language': 'ruby',
|
||||
\ 'executable': {b -> ale#Var(b, 'ruby_sorbet_executable')},
|
||||
\ 'command': function('ale_linters#ruby#sorbet#GetCommand'),
|
||||
\ 'project_root': function('ale#ruby#FindProjectRoot')
|
||||
\ 'project_root': function('ale#ruby#FindProjectRoot'),
|
||||
\ 'initialization_options': {b -> ale#Var(b, 'ruby_sorbet_initialization_options')}
|
||||
\})
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ function! ale_linters#scala#metals#GetProjectRoot(buffer) abort
|
||||
|
||||
let l:potential_roots = [
|
||||
\ 'build.sc',
|
||||
\ 'build.mill',
|
||||
\ 'build.sbt',
|
||||
\ '.bloop',
|
||||
\ '.metals',
|
||||
|
||||
@@ -25,6 +25,7 @@ endfunction
|
||||
|
||||
call ale#linter#Define('sh', {
|
||||
\ 'name': 'language_server',
|
||||
\ 'aliases': ['bash-language-server'],
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': function('ale_linters#sh#language_server#GetExecutable'),
|
||||
\ 'command': function('ale_linters#sh#language_server#GetCommand'),
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
" Author: rhysd https://rhysd.github.io
|
||||
" Description: Redpen, a proofreading tool (http://redpen.cc)
|
||||
|
||||
call ale#linter#Define('tex', {
|
||||
\ 'name': 'redpen',
|
||||
\ 'executable': 'redpen',
|
||||
\ 'command': 'redpen -f latex -r json %t',
|
||||
\ 'callback': 'ale#handlers#redpen#HandleRedpenOutput',
|
||||
\})
|
||||
call ale#handlers#redpen#DefineLinter('tex')
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
" Author: rhysd https://rhysd.github.io
|
||||
" Description: Redpen, a proofreading tool (http://redpen.cc)
|
||||
|
||||
call ale#linter#Define('text', {
|
||||
\ 'name': 'redpen',
|
||||
\ 'executable': 'redpen',
|
||||
\ 'command': 'redpen -f plain -r json %t',
|
||||
\ 'callback': 'ale#handlers#redpen#HandleRedpenOutput',
|
||||
\})
|
||||
call ale#handlers#redpen#DefineLinter('text')
|
||||
|
||||
38
ale_linters/toml/tombi.vim
Normal file
38
ale_linters/toml/tombi.vim
Normal file
@@ -0,0 +1,38 @@
|
||||
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||
" Description: TOML Formatter / Linter / Language Server
|
||||
|
||||
call ale#Set('toml_tombi_executable', 'tombi')
|
||||
call ale#Set('toml_tombi_lsp_options', '')
|
||||
|
||||
function! ale_linters#toml#tombi#GetProjectRoot(buffer) abort
|
||||
" Try to find nearest tombi.toml
|
||||
let l:tombiconfig_file = ale#path#FindNearestFile(a:buffer, 'tombi.toml')
|
||||
|
||||
if !empty(l:tombiconfig_file)
|
||||
return fnamemodify(l:tombiconfig_file . '/', ':p:h:h')
|
||||
endif
|
||||
|
||||
" Try to find nearest pyproject.toml
|
||||
let l:pyproject_file = ale#path#FindNearestFile(a:buffer, 'pyproject.toml')
|
||||
|
||||
if !empty(l:pyproject_file)
|
||||
return fnamemodify(l:pyproject_file . '/', ':p:h:h')
|
||||
endif
|
||||
|
||||
" Try to find nearest `git` directory
|
||||
let l:gitdir = ale#path#FindNearestFile(a:buffer, '.git')
|
||||
|
||||
if !empty(l:gitdir)
|
||||
return fnamemodify(l:gitdir . '/', ':p:h:h')
|
||||
endif
|
||||
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('toml', {
|
||||
\ 'name': 'tombi',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': {b -> ale#Var(b, 'toml_tombi_executable')},
|
||||
\ 'command': {b -> '%e lsp' . ale#Pad(ale#Var(b, 'toml_tombi_lsp_options'))},
|
||||
\ 'project_root': function('ale_linters#toml#tombi#GetProjectRoot'),
|
||||
\})
|
||||
@@ -9,7 +9,9 @@ endif
|
||||
" --lint-only
|
||||
function! ale_linters#verilog#slang#GetCommand(buffer) abort
|
||||
return 'slang -Weverything '
|
||||
\ . '--diag-abs-paths '
|
||||
\ . '-I%s:h '
|
||||
\ . '-y%s:h '
|
||||
\ . ale#Var(a:buffer, 'verilog_slang_options') .' '
|
||||
\ . '%t'
|
||||
endfunction
|
||||
@@ -28,6 +30,7 @@ function! ale_linters#verilog#slang#Handle(buffer, lines) abort
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
let l:item = {
|
||||
\ 'filename': l:match[1],
|
||||
\ 'lnum': str2nr(l:match[2]),
|
||||
\ 'type': (l:match[4] is# 'error') ? 'E' : 'W',
|
||||
\ 'text': s:RemoveUnicodeQuotes(l:match[5]),
|
||||
|
||||
43
ale_linters/verilog/verible_ls.vim
Normal file
43
ale_linters/verilog/verible_ls.vim
Normal file
@@ -0,0 +1,43 @@
|
||||
" Author: Nicolas Derumigny <https://github.com/nicolasderumigny>
|
||||
" Description: Verible LSP for verilog
|
||||
|
||||
call ale#Set('verilog_verible_ls_options', '--rules_config_search')
|
||||
call ale#Set('verilog_verible_ls_rules', '')
|
||||
call ale#Set('verilog_verible_ls_executable', 'verible-verilog-ls')
|
||||
call ale#Set('verilog_verible_ls_config', {})
|
||||
|
||||
function! ale_linters#verilog#verible_ls#GetProjectRoot(buffer) abort
|
||||
let l:git_dir = ale#path#FindNearestFile(a:buffer, 'verible.filelist')
|
||||
|
||||
if !empty(l:git_dir)
|
||||
return fnamemodify(l:git_dir, ':p:h')
|
||||
else
|
||||
return fnamemodify('', ':h')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! ale_linters#verilog#verible_ls#GetCommand(buffer) abort
|
||||
let l:command = ale#Escape(ale#Var(a:buffer, 'verilog_verible_ls_executable'))
|
||||
let l:options = ale#Var(a:buffer, 'verilog_verible_ls_options')
|
||||
let l:rules = ale#Var(a:buffer, 'verilog_verible_ls_rules')
|
||||
|
||||
if l:options isnot# ''
|
||||
let l:command .= ' ' . l:options
|
||||
endif
|
||||
|
||||
if l:rules isnot# ''
|
||||
let l:command .= ' --rules=' . l:rules
|
||||
endif
|
||||
|
||||
return l:command
|
||||
endfunction
|
||||
|
||||
|
||||
call ale#linter#Define('verilog', {
|
||||
\ 'name': 'verible_ls',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'lsp_config': {b -> ale#Var(b, 'verilog_verible_ls_config')},
|
||||
\ 'executable': {b -> ale#Var(b, 'verilog_verible_ls_executable')},
|
||||
\ 'command': function('ale_linters#verilog#verible_ls#GetCommand') ,
|
||||
\ 'project_root': function('ale_linters#verilog#verible_ls#GetProjectRoot'),
|
||||
\})
|
||||
@@ -10,6 +10,7 @@ function! ale_linters#verilog#verilator#GetCommand(buffer) abort
|
||||
" the path to the current file is systematically added to the search path
|
||||
return 'verilator --lint-only -Wall -Wno-DECLFILENAME '
|
||||
\ . '-I%s:h '
|
||||
\ . '-y %s:h '
|
||||
\ . ale#Var(a:buffer, 'verilog_verilator_options') .' '
|
||||
\ . '%t'
|
||||
endfunction
|
||||
|
||||
30
ale_linters/zig/zlint.vim
Normal file
30
ale_linters/zig/zlint.vim
Normal file
@@ -0,0 +1,30 @@
|
||||
" Author: Don Isaac
|
||||
" Description: A linter for the Zig programming language
|
||||
|
||||
call ale#Set('zig_zlint_executable', 'zlint')
|
||||
|
||||
function! ale_linters#zig#zlint#Handle(buffer, lines) abort
|
||||
" GitHub Actions format: ::severity file=file,line=line,col=col,title=code::message
|
||||
let l:pattern = '::\([a-z]\+\) file=\([^,]\+\),line=\(\d\+\),col=\(\d\+\),title=\([^:]\+\)::\(.*\)'
|
||||
let l:output = []
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
call add(l:output, {
|
||||
\ 'filename': l:match[2],
|
||||
\ 'lnum': str2nr(l:match[3]),
|
||||
\ 'col': str2nr(l:match[4]),
|
||||
\ 'text': l:match[6],
|
||||
\ 'type': l:match[1] =~? 'error\|fail' ? 'E' : 'W',
|
||||
\ 'code': l:match[5],
|
||||
\})
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('zig', {
|
||||
\ 'name': 'zlint',
|
||||
\ 'executable': {b -> ale#Var(b, "zig_zlint_executable")},
|
||||
\ 'command': '%e %s -f gh',
|
||||
\ 'callback': 'ale_linters#zig#zlint#Handle',
|
||||
\})
|
||||
@@ -205,7 +205,10 @@ endfunction
|
||||
function! ale#assert#LSPLanguage(expected_language) abort
|
||||
let l:buffer = bufnr('')
|
||||
let l:linter = s:GetLinter()
|
||||
let l:language = ale#linter#GetLanguage(l:buffer, l:linter)
|
||||
let l:Language = l:linter.language
|
||||
let l:language = type(l:Language) is v:t_func
|
||||
\ ? l:Language(l:buffer)
|
||||
\ : l:Language
|
||||
|
||||
AssertEqual a:expected_language, l:language
|
||||
endfunction
|
||||
|
||||
@@ -12,6 +12,8 @@ let g:__ale_c_project_filenames = ['.git/HEAD', 'configure', 'Makefile', 'CMakeL
|
||||
|
||||
let g:ale_c_build_dir_names = get(g:, 'ale_c_build_dir_names', [
|
||||
\ 'build',
|
||||
\ 'build/Debug',
|
||||
\ 'build/Release',
|
||||
\ 'bin',
|
||||
\])
|
||||
|
||||
|
||||
@@ -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_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_autoimport = get(g:, 'ale_completion_autoimport', 1)
|
||||
let g:ale_completion_autoimport = get(g:, 'ale_completion_autoimport', v:true)
|
||||
let g:ale_completion_tsserver_remove_warnings = get(g:, 'ale_completion_tsserver_remove_warnings', 0)
|
||||
|
||||
let s:timer_id = -1
|
||||
@@ -394,6 +394,7 @@ function! ale#completion#Show(result) abort
|
||||
if g:ale_enabled
|
||||
\&& (
|
||||
\ l:text_changed is# '1'
|
||||
\ || g:ale_lint_on_text_changed is v:true
|
||||
\ || l:text_changed is# 'always'
|
||||
\ || l:text_changed is# 'normal'
|
||||
\ || l:text_changed is# 'insert'
|
||||
@@ -510,7 +511,7 @@ function! ale#completion#ParseTSServerCompletionEntryDetails(response) abort
|
||||
\ 'icase': 1,
|
||||
\ 'menu': join(l:displayParts, ''),
|
||||
\ 'dup': get(l:info, 'additional_edits_only', 0)
|
||||
\ || g:ale_completion_autoimport,
|
||||
\ || (g:ale_completion_autoimport + 0),
|
||||
\ 'info': join(l:documentationParts, ''),
|
||||
\}
|
||||
" This flag is used to tell if this completion came from ALE or not.
|
||||
@@ -625,7 +626,7 @@ function! ale#completion#ParseLSPCompletions(response) abort
|
||||
\ 'icase': 1,
|
||||
\ 'menu': l:detail,
|
||||
\ 'dup': get(l:info, 'additional_edits_only', 0)
|
||||
\ || g:ale_completion_autoimport,
|
||||
\ || (g:ale_completion_autoimport + 0),
|
||||
\ 'info': (type(l:doc) is v:t_string ? l:doc : ''),
|
||||
\}
|
||||
" This flag is used to tell if this completion came from ALE or not.
|
||||
@@ -779,18 +780,15 @@ function! s:OnReady(linter, lsp_details) abort
|
||||
call ale#lsp#RegisterCallback(l:id, l:Callback)
|
||||
|
||||
if a:linter.lsp is# 'tsserver'
|
||||
if get(g:, 'ale_completion_tsserver_autoimport') is 1
|
||||
" no-custom-checks
|
||||
echom '`g:ale_completion_tsserver_autoimport` is deprecated. Use `g:ale_completion_autoimport` instead.'
|
||||
endif
|
||||
|
||||
let l:message = ale#lsp#tsserver_message#Completions(
|
||||
\ l:buffer,
|
||||
\ b:ale_completion_info.line,
|
||||
\ b:ale_completion_info.column,
|
||||
\ b:ale_completion_info.prefix,
|
||||
\ get(b:ale_completion_info, 'additional_edits_only', 0)
|
||||
\ || g:ale_completion_autoimport,
|
||||
\ (
|
||||
\ get(b:ale_completion_info, 'additional_edits_only', 0)
|
||||
\ || g:ale_completion_autoimport
|
||||
\ ) ? v:true : v:false,
|
||||
\)
|
||||
else
|
||||
" Send a message saying the buffer has changed first, otherwise
|
||||
|
||||
@@ -23,7 +23,7 @@ function! ale#cursor#TruncatedEcho(original_message) abort
|
||||
" Change tabs to spaces.
|
||||
let l:message = substitute(l:message, "\t", ' ', 'g')
|
||||
" 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')
|
||||
@@ -93,6 +93,7 @@ function! ale#cursor#EchoCursorWarning(...) abort
|
||||
if !empty(l:loc)
|
||||
let l:format = ale#Var(l:buffer, 'echo_msg_format')
|
||||
let l:msg = ale#GetLocItemMessage(l:loc, l:format)
|
||||
|
||||
call ale#cursor#TruncatedEcho(l:msg)
|
||||
let l:info.echoed = 1
|
||||
elseif get(l:info, 'echoed')
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
let s:go_to_definition_map = {}
|
||||
|
||||
" Enable automatic updates of the tagstack
|
||||
let g:ale_update_tagstack = get(g:, 'ale_update_tagstack', 1)
|
||||
let g:ale_update_tagstack = get(g:, 'ale_update_tagstack', v:true)
|
||||
let g:ale_default_navigation = get(g:, 'ale_default_navigation', 'buffer')
|
||||
|
||||
" Used to get the definition map in tests.
|
||||
|
||||
@@ -68,7 +68,7 @@ function! ale#engine#IsExecutable(buffer, executable) abort
|
||||
|
||||
" Cache the executable check if we found it, or if the option to cache
|
||||
" failing checks is on.
|
||||
if l:result || get(g:, 'ale_cache_executable_check_failures', 0)
|
||||
if l:result || get(g:, 'ale_cache_executable_check_failures')
|
||||
let s:executable_cache_map[a:executable] = l:result
|
||||
endif
|
||||
|
||||
@@ -259,7 +259,7 @@ function! ale#engine#SendResultsToNeovimDiagnostics(buffer, loclist) abort
|
||||
|
||||
" Keep the Lua surface area really small in the VimL part of ALE,
|
||||
" and just require the diagnostics.lua module on demand.
|
||||
let l:SendDiagnostics = luaeval('require("ale.diagnostics").sendAleResultsToDiagnostics')
|
||||
let l:SendDiagnostics = luaeval('require("ale.diagnostics").send')
|
||||
call l:SendDiagnostics(a:buffer, a:loclist)
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -173,7 +173,9 @@ function! ale#events#Init() abort
|
||||
autocmd BufWritePost * call ale#events#SaveEvent(str2nr(expand('<abuf>')))
|
||||
|
||||
if g:ale_enabled
|
||||
if l:text_changed is? 'always' || l:text_changed is# '1'
|
||||
if l:text_changed is? 'always'
|
||||
\|| l:text_changed is# '1'
|
||||
\|| g:ale_lint_on_text_changed is v:true
|
||||
autocmd TextChanged,TextChangedI * call ale#Queue(ale#Var(str2nr(expand('<abuf>')), 'lint_delay'))
|
||||
elseif l:text_changed is? 'normal'
|
||||
autocmd TextChanged * call ale#Queue(ale#Var(str2nr(expand('<abuf>')), 'lint_delay'))
|
||||
|
||||
@@ -78,7 +78,7 @@ function! ale#fix#ApplyFixes(buffer, output) abort
|
||||
|
||||
if !l:data.ignore_file_changed_errors
|
||||
" no-custom-checks
|
||||
echoerr 'The file was changed before fixing finished'
|
||||
echom 'The file was changed before fixing finished'
|
||||
endif
|
||||
|
||||
return
|
||||
|
||||
@@ -98,6 +98,11 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['dhall'],
|
||||
\ 'description': 'Standard code formatter for the Dhall language and removing dead code',
|
||||
\ },
|
||||
\ 'djlint': {
|
||||
\ 'function': 'ale#fixers#djlint#Fix',
|
||||
\ 'suggested_filetypes': ['html', 'htmldjango', 'htmlangular', 'jinja', 'handlebars', 'nunjucks', 'gohtmltmpl'],
|
||||
\ 'description': 'Fix HTML templates with `djlint --reformat`.',
|
||||
\ },
|
||||
\ 'dune': {
|
||||
\ 'function': 'ale#fixers#dune#Fix',
|
||||
\ 'suggested_filetypes': ['dune'],
|
||||
@@ -124,6 +129,11 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['hurl'],
|
||||
\ 'description': 'Fix hurl files with hurlfmt.',
|
||||
\ },
|
||||
\ 'kulala_fmt': {
|
||||
\ 'function': 'ale#fixers#kulala_fmt#Fix',
|
||||
\ 'suggested_filetypes': ['http', 'rest'],
|
||||
\ 'description': 'Fix http and rest files with kulala_fmt.',
|
||||
\ },
|
||||
\ 'tidy': {
|
||||
\ 'function': 'ale#fixers#tidy#Fix',
|
||||
\ 'suggested_filetypes': ['html'],
|
||||
@@ -707,6 +717,36 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['clojure'],
|
||||
\ 'description': 'formatter and linter for clojure files',
|
||||
\ },
|
||||
\ 'typstyle': {
|
||||
\ 'function': 'ale#fixers#typstyle#Fix',
|
||||
\ 'suggested_filetypes': ['typst'],
|
||||
\ 'description': 'A formatter for Typst files',
|
||||
\ },
|
||||
\ 'roc_format': {
|
||||
\ 'function': 'ale#fixers#roc_format#Fix',
|
||||
\ 'suggested_filetypes': ['roc'],
|
||||
\ 'description': 'Formats Roc files.',
|
||||
\ },
|
||||
\ 'roc_annotate': {
|
||||
\ 'function': 'ale#fixers#roc_annotate#Fix',
|
||||
\ 'suggested_filetypes': ['roc'],
|
||||
\ 'description': 'Annotates all top-level definitions in Roc files.',
|
||||
\ },
|
||||
\ 'tombi_format': {
|
||||
\ 'function': 'ale#fixers#tombi_format#Fix',
|
||||
\ 'suggested_filetypes': ['toml'],
|
||||
\ 'description': 'Formats TOML files',
|
||||
\ },
|
||||
\ 'tombi_lint': {
|
||||
\ 'function': 'ale#fixers#tombi_lint#Fix',
|
||||
\ 'suggested_filetypes': ['toml'],
|
||||
\ 'description': 'Lints TOML files',
|
||||
\ },
|
||||
\ 'verible_format': {
|
||||
\ 'function': 'ale#fixers#verible_format#Fix',
|
||||
\ 'suggested_filetypes': ['verilog'],
|
||||
\ 'description': 'Formats verilog files using verible.',
|
||||
\ },
|
||||
\}
|
||||
|
||||
" Reset the function registry to the default entries.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
function! ale#fixers#biome#Fix(buffer) abort
|
||||
let l:executable = ale#handlers#biome#GetExecutable(a:buffer)
|
||||
let l:options = ale#Var(a:buffer, 'biome_options')
|
||||
let l:apply = ale#Var(a:buffer, 'biome_fixer_apply_unsafe') ? '--apply-unsafe' : '--apply'
|
||||
let l:apply = ale#Var(a:buffer, 'biome_fixer_apply_unsafe') ? '--write --unsafe' : '--write'
|
||||
|
||||
return {
|
||||
\ 'read_temporary_file': 1,
|
||||
|
||||
@@ -22,7 +22,7 @@ function! ale#fixers#clangformat#Fix(buffer) abort
|
||||
let l:use_local_file = ale#Var(a:buffer, 'c_clangformat_use_local_file')
|
||||
|
||||
if l:style_option isnot# ''
|
||||
let l:style_option = '-style=' . "'" . l:style_option . "'"
|
||||
let l:style_option = '-style=' . ale#Escape(l:style_option)
|
||||
endif
|
||||
|
||||
if l:use_local_file
|
||||
|
||||
48
autoload/ale/fixers/djlint.vim
Normal file
48
autoload/ale/fixers/djlint.vim
Normal file
@@ -0,0 +1,48 @@
|
||||
" Author: Adrian Vollmer (computerfluesterer@protonmail.com)
|
||||
" Description: HTML template formatter using `djlint --reformat`
|
||||
|
||||
call ale#Set('html_djlint_executable', 'djlint')
|
||||
call ale#Set('html_djlint_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
call ale#Set('html_djlint_options', '')
|
||||
|
||||
function! ale#fixers#djlint#Fix(buffer) abort
|
||||
let l:executable = ale#python#FindExecutable(
|
||||
\ a:buffer,
|
||||
\ 'html_djlint',
|
||||
\ ['djlint']
|
||||
\)
|
||||
|
||||
let l:options = ale#Var(a:buffer, 'html_djlint_options')
|
||||
|
||||
let l:profile = ''
|
||||
let l:filetypes = split(getbufvar(a:buffer, '&filetype'), '\.')
|
||||
|
||||
" Append the --profile flag depending on the current filetype (unless it's
|
||||
" already set in g:html_djlint_options).
|
||||
if match(l:options, '--profile') == -1
|
||||
let l:djlint_profiles = {
|
||||
\ 'html': 'html',
|
||||
\ 'htmldjango': 'django',
|
||||
\ 'jinja': 'jinja',
|
||||
\ 'nunjucks': 'nunjucks',
|
||||
\ 'handlebars': 'handlebars',
|
||||
\ 'gohtmltmpl': 'golang',
|
||||
\ 'htmlangular': 'angular',
|
||||
\}
|
||||
|
||||
for l:filetype in l:filetypes
|
||||
if has_key(l:djlint_profiles, l:filetype)
|
||||
let l:profile = l:djlint_profiles[l:filetype]
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
|
||||
if !empty(l:profile)
|
||||
let l:options = (!empty(l:options) ? l:options . ' ' : '') . '--profile ' . l:profile
|
||||
endif
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable) . ' --reformat ' . l:options . ' -',
|
||||
\}
|
||||
endfunction
|
||||
@@ -17,10 +17,11 @@ let s:variables = {
|
||||
\}
|
||||
|
||||
function! ale#fixers#erlang_mode#Fix(buffer) abort
|
||||
let emacs_executable =
|
||||
let l:emacs_executable =
|
||||
\ ale#Var(a:buffer, 'erlang_erlang_mode_emacs_executable')
|
||||
|
||||
let l:exprs = [
|
||||
\ '(setq enable-local-variables :safe)',
|
||||
\ s:SetqDefault(a:buffer, s:variables),
|
||||
\ '(erlang-mode)',
|
||||
\ '(font-lock-fontify-region (point-min) (point-max))',
|
||||
|
||||
@@ -1,32 +1,48 @@
|
||||
" Author: Ian Stapleton Cordasco <graffatcolmingov@gmail.com>
|
||||
" Description: Run golangci-lint with the --fix flag to autofix some issues
|
||||
|
||||
call ale#Set('go_golangci_lint_options', '')
|
||||
call ale#Set('go_golangci_lint_executable', 'golangci-lint')
|
||||
call ale#Set('go_golangci_lint_package', 1)
|
||||
call ale#Set('go_golangci_formatter_options', '')
|
||||
call ale#Set('go_golangci_formatter_executable', 'golangci-lint')
|
||||
|
||||
function! ale#fixers#golangci_lint#GetCommand(buffer) abort
|
||||
function! ale#fixers#golangci_lint#GetExecutable(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'go_golangci_formatter_executable')
|
||||
|
||||
return l:executable
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#golangci_lint#GetCommand(buffer, version) abort
|
||||
let l:filename = expand('#' . a:buffer . ':t')
|
||||
let l:executable = ale#Var(a:buffer, 'go_golangci_lint_executable')
|
||||
let l:options = ale#Var(a:buffer, 'go_golangci_lint_options') . ' --fix'
|
||||
let l:package_mode = ale#Var(a:buffer, 'go_golangci_lint_package')
|
||||
let l:executable = ale#fixers#golangci_lint#GetExecutable(a:buffer)
|
||||
let l:options = ale#Var(a:buffer, 'go_golangci_formatter_options')
|
||||
let l:env = ale#go#EnvString(a:buffer)
|
||||
|
||||
|
||||
if l:package_mode
|
||||
if ale#semver#GTE(a:version, [2, 0, 0])
|
||||
return l:env . ale#Escape(l:executable)
|
||||
\ . ' run '
|
||||
\ . l:options
|
||||
\ . ' fmt --stdin '
|
||||
\ . l:options
|
||||
else
|
||||
return l:env . ale#Escape(l:executable)
|
||||
\ . ' run --fix '
|
||||
\ . l:options
|
||||
\ . ' '
|
||||
\ . ale#Escape(l:filename)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
return l:env . ale#Escape(l:executable)
|
||||
\ . ' run '
|
||||
\ . l:options
|
||||
\ . ' ' . ale#Escape(l:filename)
|
||||
function! ale#fixers#golangci_lint#GetCommandForVersion(buffer, version) abort
|
||||
return {
|
||||
\ 'command': ale#fixers#golangci_lint#GetCommand(a:buffer, a:version)
|
||||
\}
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#golangci_lint#Fix(buffer) abort
|
||||
return {
|
||||
\ 'command': ale#fixers#golangci_lint#GetCommand(a:buffer),
|
||||
\}
|
||||
let l:executable = ale#fixers#golangci_lint#GetExecutable(a:buffer)
|
||||
let l:command = ale#fixers#golangci_lint#GetExecutable(a:buffer) . ale#Pad('--version')
|
||||
|
||||
return ale#semver#RunWithVersionCheck(
|
||||
\ a:buffer,
|
||||
\ l:executable,
|
||||
\ l:command,
|
||||
\ function('ale#fixers#golangci_lint#GetCommandForVersion'),
|
||||
\)
|
||||
endfunction
|
||||
|
||||
11
autoload/ale/fixers/kulala_fmt.vim
Normal file
11
autoload/ale/fixers/kulala_fmt.vim
Normal file
@@ -0,0 +1,11 @@
|
||||
" Author: hsanson <hsanson@gmail.com>
|
||||
" Description: kulala_fmt fixer for http and rest files.
|
||||
|
||||
call ale#Set('http_kulala_fmt_executable', 'kulala-fmt')
|
||||
|
||||
function! ale#fixers#kulala_fmt#Fix(buffer) abort
|
||||
return {
|
||||
\ 'command': ale#Escape(ale#Var(a:buffer, 'http_kulala_fmt_executable')) . ' format %t > /dev/null',
|
||||
\ 'read_temporary_file': 1
|
||||
\ }
|
||||
endfunction
|
||||
21
autoload/ale/fixers/roc_annotate.vim
Normal file
21
autoload/ale/fixers/roc_annotate.vim
Normal file
@@ -0,0 +1,21 @@
|
||||
" Author: Benjamin Block <https://github.com/benjamindblock>
|
||||
" Description: Official type annotation tool for Roc.
|
||||
|
||||
call ale#Set('roc_roc_annotate_executable', 'roc')
|
||||
call ale#Set('roc_roc_annotate_options', '')
|
||||
|
||||
function! ale#fixers#roc_annotate#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'roc_roc_annotate_executable')
|
||||
let l:command = l:executable . ' format annotate'
|
||||
let l:options = ale#Var(a:buffer, 'roc_roc_annotate_options')
|
||||
|
||||
if l:options isnot# ''
|
||||
let l:command .= ' ' . l:options
|
||||
endif
|
||||
|
||||
return {
|
||||
\ 'command': l:command . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
||||
|
||||
20
autoload/ale/fixers/roc_format.vim
Normal file
20
autoload/ale/fixers/roc_format.vim
Normal file
@@ -0,0 +1,20 @@
|
||||
" Author: Benjamin Block <https://github.com/benjamindblock>
|
||||
" Description: Official formatter for Roc.
|
||||
|
||||
call ale#Set('roc_roc_format_executable', 'roc')
|
||||
call ale#Set('roc_roc_format_options', '')
|
||||
|
||||
function! ale#fixers#roc_format#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'roc_roc_format_executable')
|
||||
let l:command = l:executable . ' format'
|
||||
let l:options = ale#Var(a:buffer, 'roc_roc_format_options')
|
||||
|
||||
if l:options isnot# ''
|
||||
let l:command .= ' ' . l:options
|
||||
endif
|
||||
|
||||
return {
|
||||
\ 'command': l:command . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
||||
@@ -19,20 +19,34 @@ function! ale#fixers#rubocop#PostProcess(buffer, output) abort
|
||||
return a:output[l:line :]
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#rubocop#GetCommand(buffer) abort
|
||||
function! ale#fixers#rubocop#GetCommand(buffer, version) abort
|
||||
let l:executable = ale#Var(a:buffer, 'ruby_rubocop_executable')
|
||||
let l:options = ale#Var(a:buffer, 'ruby_rubocop_options')
|
||||
let l:auto_correct_all = ale#Var(a:buffer, 'ruby_rubocop_auto_correct_all')
|
||||
let l:editor_mode = ale#semver#GTE(a:version, [1, 61, 0])
|
||||
|
||||
return ale#ruby#EscapeExecutable(l:executable, 'rubocop')
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '')
|
||||
\ . (l:auto_correct_all ? ' --auto-correct-all' : ' --auto-correct')
|
||||
\ . (l:editor_mode ? ' --editor-mode' : '')
|
||||
\ . ' --force-exclusion --stdin %s'
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#rubocop#Fix(buffer) abort
|
||||
function! ale#fixers#rubocop#GetCommandForVersion(buffer, version) abort
|
||||
return {
|
||||
\ 'command': ale#fixers#rubocop#GetCommand(a:buffer),
|
||||
\ 'process_with': 'ale#fixers#rubocop#PostProcess'
|
||||
\ 'command': ale#fixers#rubocop#GetCommand(a:buffer, a:version),
|
||||
\ 'process_with': 'ale#fixers#rubocop#PostProcess'
|
||||
\}
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#rubocop#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'ruby_rubocop_executable')
|
||||
let l:command = l:executable . ale#Pad('--version')
|
||||
|
||||
return ale#semver#RunWithVersionCheck(
|
||||
\ a:buffer,
|
||||
\ l:executable,
|
||||
\ l:command,
|
||||
\ function('ale#fixers#rubocop#GetCommandForVersion'),
|
||||
\)
|
||||
endfunction
|
||||
|
||||
15
autoload/ale/fixers/tombi_format.vim
Normal file
15
autoload/ale/fixers/tombi_format.vim
Normal file
@@ -0,0 +1,15 @@
|
||||
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||
" Description: Integration of tombi formatting with ALE.
|
||||
|
||||
call ale#Set('toml_tombi_executable', 'tombi')
|
||||
call ale#Set('toml_tombi_format_options', '')
|
||||
|
||||
function! ale#fixers#tombi_format#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'toml_tombi_executable')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' format'
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'toml_tombi_format_options')),
|
||||
\}
|
||||
endfunction
|
||||
15
autoload/ale/fixers/tombi_lint.vim
Normal file
15
autoload/ale/fixers/tombi_lint.vim
Normal file
@@ -0,0 +1,15 @@
|
||||
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||
" Description: Integration of tombi linting with ALE.
|
||||
|
||||
call ale#Set('toml_tombi_executable', 'tombi')
|
||||
call ale#Set('toml_tombi_lint_options', '')
|
||||
|
||||
function! ale#fixers#tombi_lint#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'toml_tombi_executable')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' lint'
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'toml_tombi_lint_options')),
|
||||
\}
|
||||
endfunction
|
||||
20
autoload/ale/fixers/typstyle.vim
Normal file
20
autoload/ale/fixers/typstyle.vim
Normal file
@@ -0,0 +1,20 @@
|
||||
" Author: Adrian Vollmer (computerfluesterer@protonmail.com)
|
||||
" Description: Typst formatter using typstyle
|
||||
|
||||
call ale#Set('typst_typstyle_executable', 'typstyle')
|
||||
call ale#Set('typst_typstyle_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
call ale#Set('typst_typstyle_options', '')
|
||||
|
||||
function! ale#fixers#typstyle#Fix(buffer) abort
|
||||
let l:executable = ale#path#FindExecutable(
|
||||
\ a:buffer,
|
||||
\ 'typst_typstyle',
|
||||
\ ['typstyle']
|
||||
\)
|
||||
|
||||
let l:options = ale#Var(a:buffer, 'typst_typstyle_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable) . ' ' . l:options,
|
||||
\}
|
||||
endfunction
|
||||
17
autoload/ale/fixers/verible_format.vim
Normal file
17
autoload/ale/fixers/verible_format.vim
Normal file
@@ -0,0 +1,17 @@
|
||||
" Author: Nicolas Derumigny <https://github.com/nicolasderumigny>
|
||||
" Description: verible formatter for verilog.
|
||||
|
||||
call ale#Set('verilog_verible_format_executable', 'verible-verilog-format')
|
||||
call ale#Set('verilog_verible_format_options', '')
|
||||
|
||||
function! ale#fixers#verible_format#Fix(buffer) abort
|
||||
let l:executable = ale#Escape(ale#Var(a:buffer, 'verilog_verible_format_executable'))
|
||||
let l:command = l:executable
|
||||
let l:options = ale#Var(a:buffer, 'verilog_verible_format_options')
|
||||
|
||||
if l:options isnot# ''
|
||||
let l:command .= ' ' . l:options
|
||||
endif
|
||||
|
||||
return {'command': l:command . ' -'}
|
||||
endfunction
|
||||
64
autoload/ale/handlers/djlint.vim
Normal file
64
autoload/ale/handlers/djlint.vim
Normal file
@@ -0,0 +1,64 @@
|
||||
" Author: Vivian De Smedt <vds2212@gmail.com>, Adrian Vollmer <computerfluesterer@protonmail.com>
|
||||
" Description: Adds support for djlint
|
||||
"
|
||||
function! ale#handlers#djlint#GetExecutable(buffer) abort
|
||||
return ale#Var(a:buffer, 'html_djlint_executable')
|
||||
endfunction
|
||||
|
||||
function! ale#handlers#djlint#GetCommand(buffer) abort
|
||||
let l:executable = ale#handlers#djlint#GetExecutable(a:buffer)
|
||||
|
||||
let l:options = ale#Var(a:buffer, 'html_djlint_options')
|
||||
|
||||
let l:profile = ''
|
||||
let l:filetypes = split(getbufvar(a:buffer, '&filetype'), '\.')
|
||||
|
||||
" Append the --profile flag depending on the current filetype (unless it's
|
||||
" already set in g:html_djlint_options).
|
||||
if match(l:options, '--profile') == -1
|
||||
let l:djlint_profiles = {
|
||||
\ 'html': 'html',
|
||||
\ 'htmldjango': 'django',
|
||||
\ 'jinja': 'jinja',
|
||||
\ 'nunjucks': 'nunjucks',
|
||||
\ 'handlebars': 'handlebars',
|
||||
\ 'gohtmltmpl': 'golang',
|
||||
\ 'htmlangular': 'angular',
|
||||
\}
|
||||
|
||||
for l:filetype in l:filetypes
|
||||
if has_key(l:djlint_profiles, l:filetype)
|
||||
let l:profile = l:djlint_profiles[l:filetype]
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
|
||||
if !empty(l:profile)
|
||||
let l:options = (!empty(l:options) ? l:options . ' ' : '') . '--profile ' . l:profile
|
||||
endif
|
||||
|
||||
return ale#Escape(l:executable)
|
||||
\ . (!empty(l:options) ? ' ' . l:options : '') . ' %s'
|
||||
endfunction
|
||||
|
||||
function! ale#handlers#djlint#Handle(buffer, lines) abort
|
||||
let l:output = []
|
||||
let l:pattern = '\v^([A-Z]\d+) (\d+):(\d+) (.*)$'
|
||||
let l:i = 0
|
||||
|
||||
for l:match in ale#util#GetMatches(a:lines, l:pattern)
|
||||
let l:i += 1
|
||||
let l:item = {
|
||||
\ 'lnum': l:match[2] + 0,
|
||||
\ 'col': l:match[3] + 0,
|
||||
\ 'vcol': 1,
|
||||
\ 'text': l:match[4],
|
||||
\ 'code': l:match[1],
|
||||
\ 'type': 'W',
|
||||
\}
|
||||
call add(l:output, l:item)
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
@@ -1,6 +1,8 @@
|
||||
" Author: rhysd https://rhysd.github.io
|
||||
" Description: Redpen, a proofreading tool (http://redpen.cc)
|
||||
|
||||
call ale#Set('redpen_options', '')
|
||||
|
||||
function! ale#handlers#redpen#HandleRedpenOutput(buffer, lines) abort
|
||||
" Only one file was passed to redpen. So response array has only one
|
||||
" element.
|
||||
@@ -63,3 +65,14 @@ function! ale#handlers#redpen#HandleRedpenOutput(buffer, lines) abort
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
|
||||
" Define the redpen linter for a given filetype.
|
||||
function! ale#handlers#redpen#DefineLinter(filetype) abort
|
||||
call ale#linter#Define(a:filetype, {
|
||||
\ 'name': 'redpen',
|
||||
\ 'executable': 'redpen',
|
||||
\ 'command': {b -> 'redpen -f ' . a:filetype . ' -r json' . ale#Pad(ale#Var(b, 'redpen_options')) . ' %t'},
|
||||
\ 'callback': 'ale#handlers#redpen#HandleRedpenOutput',
|
||||
\})
|
||||
endfunction
|
||||
|
||||
@@ -63,6 +63,12 @@ function! ale#handlers#shellcheck#GetCommand(buffer, version) abort
|
||||
\ . ' -f ' . l:format . ' -'
|
||||
endfunction
|
||||
|
||||
function! s:ShouldIgnoreErrorCode(buffer, code) abort
|
||||
" Skip warnings for trailing whitespace if the option is off.
|
||||
return a:code is# 'SC1101'
|
||||
\ && !ale#Var(a:buffer, 'warn_about_trailing_whitespace')
|
||||
endfunction
|
||||
|
||||
function! s:HandleShellcheckJSON(buffer, lines) abort
|
||||
try
|
||||
let l:errors = json_decode(a:lines[0])
|
||||
@@ -87,11 +93,17 @@ function! s:HandleShellcheckJSON(buffer, lines) abort
|
||||
let l:type = 'W'
|
||||
endif
|
||||
|
||||
let l:code = 'SC' . l:error['code']
|
||||
|
||||
if s:ShouldIgnoreErrorCode(a:buffer, l:code)
|
||||
continue
|
||||
endif
|
||||
|
||||
let l:item = {
|
||||
\ 'lnum': l:error['line'],
|
||||
\ 'type': l:type,
|
||||
\ 'text': l:error['message'],
|
||||
\ 'code': 'SC' . l:error['code'],
|
||||
\ 'code': l:code,
|
||||
\ 'detail': l:error['message'] . "\n\nFor more information:\n https://www.shellcheck.net/wiki/SC" . l:error['code'],
|
||||
\}
|
||||
|
||||
@@ -107,7 +119,6 @@ function! s:HandleShellcheckJSON(buffer, lines) abort
|
||||
let l:item.end_lnum = l:error['endLine']
|
||||
endif
|
||||
|
||||
|
||||
" If the filename is something like <stdin>, <nofile> or -, then
|
||||
" this is an error for the file we checked.
|
||||
if has_key(l:error, 'file')
|
||||
@@ -135,11 +146,17 @@ function! s:HandleShellcheckGCC(buffer, lines) abort
|
||||
let l:type = 'W'
|
||||
endif
|
||||
|
||||
let l:code = l:match[6]
|
||||
|
||||
if s:ShouldIgnoreErrorCode(a:buffer, l:code)
|
||||
continue
|
||||
endif
|
||||
|
||||
let l:item = {
|
||||
\ 'lnum': str2nr(l:match[2]),
|
||||
\ 'type': l:type,
|
||||
\ 'text': l:match[5],
|
||||
\ 'code': l:match[6],
|
||||
\ 'code': l:code,
|
||||
\ 'detail': l:match[5] . "\n\nFor more information:\n https://www.shellcheck.net/wiki/" . l:match[6],
|
||||
\}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ let s:linters = {}
|
||||
" NOTE: Update the g:ale_linter_aliases documentation when modifying this.
|
||||
let s:default_ale_linter_aliases = {
|
||||
\ 'Dockerfile': 'dockerfile',
|
||||
\ 'bash': 'sh',
|
||||
\ 'csh': 'sh',
|
||||
\ 'javascriptreact': ['javascript', 'jsx'],
|
||||
\ 'plaintex': 'tex',
|
||||
@@ -446,9 +447,3 @@ function! ale#linter#GetAddress(buffer, linter) abort
|
||||
|
||||
return type(l:Address) is v:t_func ? l:Address(a:buffer) : l:Address
|
||||
endfunction
|
||||
|
||||
function! ale#linter#GetLanguage(buffer, linter) abort
|
||||
let l:Language = a:linter.language
|
||||
|
||||
return type(l:Language) is v:t_func ? l:Language(a:buffer) : l:Language
|
||||
endfunction
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
" Description: Manages the loclist and quickfix lists
|
||||
|
||||
" This flag dictates if ale open the configured loclist
|
||||
let g:ale_open_list = get(g:, 'ale_open_list', 0)
|
||||
let g:ale_open_list = get(g:, 'ale_open_list', v:false)
|
||||
" This flag dictates if ale keeps open loclist even if there is no error in loclist
|
||||
let g:ale_keep_list_window_open = get(g:, 'ale_keep_list_window_open', 0)
|
||||
" This flag dictates that quickfix windows should be opened vertically
|
||||
let g:ale_list_vertical = get(g:, 'ale_list_vertical', 0)
|
||||
let g:ale_list_vertical = get(g:, 'ale_list_vertical', v:false)
|
||||
" The window size to set for the quickfix and loclist windows
|
||||
let g:ale_list_window_size = get(g:, 'ale_list_window_size', 10)
|
||||
" A string format for the loclist messages.
|
||||
|
||||
@@ -5,9 +5,10 @@
|
||||
let s:connections = get(s:, 'connections', {})
|
||||
let g:ale_lsp_next_message_id = 1
|
||||
|
||||
" Given an id, which can be an executable or address, and a project path,
|
||||
" Given an id, which can be an executable or address, a project path,
|
||||
" and a language string or (bufnr) -> string function
|
||||
" create a new connection if needed. Return a unique ID for the connection.
|
||||
function! ale#lsp#Register(executable_or_address, project, init_options) abort
|
||||
function! ale#lsp#Register(executable_or_address, project, language, init_options) abort
|
||||
let l:conn_id = a:executable_or_address . ':' . a:project
|
||||
|
||||
if !has_key(s:connections, l:conn_id)
|
||||
@@ -28,6 +29,7 @@ function! ale#lsp#Register(executable_or_address, project, init_options) abort
|
||||
\ 'is_tsserver': 0,
|
||||
\ 'data': '',
|
||||
\ 'root': a:project,
|
||||
\ 'language': a:language,
|
||||
\ 'open_documents': {},
|
||||
\ 'initialized': 0,
|
||||
\ 'init_request_id': 0,
|
||||
@@ -45,6 +47,7 @@ function! ale#lsp#Register(executable_or_address, project, init_options) abort
|
||||
\ 'definition': 0,
|
||||
\ 'typeDefinition': 0,
|
||||
\ 'implementation': 0,
|
||||
\ 'pull_model': 0,
|
||||
\ 'symbol_search': 0,
|
||||
\ 'code_actions': 0,
|
||||
\ 'did_save': 0,
|
||||
@@ -195,101 +198,114 @@ endfunction
|
||||
|
||||
" Update capabilities from the server, so we know which features the server
|
||||
" supports.
|
||||
function! s:UpdateCapabilities(conn, capabilities) abort
|
||||
function! ale#lsp#UpdateCapabilities(conn_id, capabilities) abort
|
||||
let l:conn = get(s:connections, a:conn_id, {})
|
||||
|
||||
if empty(l:conn)
|
||||
return
|
||||
endif
|
||||
|
||||
if type(a:capabilities) isnot v:t_dict
|
||||
return
|
||||
endif
|
||||
|
||||
if get(a:capabilities, 'hoverProvider') is v:true
|
||||
let a:conn.capabilities.hover = 1
|
||||
let l:conn.capabilities.hover = 1
|
||||
endif
|
||||
|
||||
if type(get(a:capabilities, 'hoverProvider')) is v:t_dict
|
||||
let a:conn.capabilities.hover = 1
|
||||
let l:conn.capabilities.hover = 1
|
||||
endif
|
||||
|
||||
if get(a:capabilities, 'referencesProvider') is v:true
|
||||
let a:conn.capabilities.references = 1
|
||||
let l:conn.capabilities.references = 1
|
||||
endif
|
||||
|
||||
if type(get(a:capabilities, 'referencesProvider')) is v:t_dict
|
||||
let a:conn.capabilities.references = 1
|
||||
let l:conn.capabilities.references = 1
|
||||
endif
|
||||
|
||||
if get(a:capabilities, 'renameProvider') is v:true
|
||||
let a:conn.capabilities.rename = 1
|
||||
let l:conn.capabilities.rename = 1
|
||||
endif
|
||||
|
||||
if type(get(a:capabilities, 'renameProvider')) is v:t_dict
|
||||
let a:conn.capabilities.rename = 1
|
||||
let l:conn.capabilities.rename = 1
|
||||
endif
|
||||
|
||||
if get(a:capabilities, 'codeActionProvider') is v:true
|
||||
let a:conn.capabilities.code_actions = 1
|
||||
let l:conn.capabilities.code_actions = 1
|
||||
endif
|
||||
|
||||
if type(get(a:capabilities, 'codeActionProvider')) is v:t_dict
|
||||
let a:conn.capabilities.code_actions = 1
|
||||
let l:conn.capabilities.code_actions = 1
|
||||
endif
|
||||
|
||||
if !empty(get(a:capabilities, 'completionProvider'))
|
||||
let a:conn.capabilities.completion = 1
|
||||
let l:conn.capabilities.completion = 1
|
||||
endif
|
||||
|
||||
if type(get(a:capabilities, 'completionProvider')) is v:t_dict
|
||||
let l:chars = get(a:capabilities.completionProvider, 'triggerCharacters')
|
||||
|
||||
if type(l:chars) is v:t_list
|
||||
let a:conn.capabilities.completion_trigger_characters = l:chars
|
||||
let l:conn.capabilities.completion_trigger_characters = l:chars
|
||||
endif
|
||||
endif
|
||||
|
||||
if get(a:capabilities, 'definitionProvider') is v:true
|
||||
let a:conn.capabilities.definition = 1
|
||||
let l:conn.capabilities.definition = 1
|
||||
endif
|
||||
|
||||
if type(get(a:capabilities, 'definitionProvider')) is v:t_dict
|
||||
let a:conn.capabilities.definition = 1
|
||||
let l:conn.capabilities.definition = 1
|
||||
endif
|
||||
|
||||
if get(a:capabilities, 'typeDefinitionProvider') is v:true
|
||||
let a:conn.capabilities.typeDefinition = 1
|
||||
let l:conn.capabilities.typeDefinition = 1
|
||||
endif
|
||||
|
||||
if type(get(a:capabilities, 'typeDefinitionProvider')) is v:t_dict
|
||||
let a:conn.capabilities.typeDefinition = 1
|
||||
let l:conn.capabilities.typeDefinition = 1
|
||||
endif
|
||||
|
||||
if get(a:capabilities, 'implementationProvider') is v:true
|
||||
let a:conn.capabilities.implementation = 1
|
||||
let l:conn.capabilities.implementation = 1
|
||||
endif
|
||||
|
||||
if type(get(a:capabilities, 'implementationProvider')) is v:t_dict
|
||||
let a:conn.capabilities.implementation = 1
|
||||
let l:conn.capabilities.implementation = 1
|
||||
endif
|
||||
|
||||
" Check if the language server supports pull model diagnostics.
|
||||
if type(get(a:capabilities, 'diagnosticProvider')) is v:t_dict
|
||||
if type(get(a:capabilities.diagnosticProvider, 'interFileDependencies')) is v:t_bool
|
||||
let l:conn.capabilities.pull_model = 1
|
||||
endif
|
||||
endif
|
||||
|
||||
if get(a:capabilities, 'workspaceSymbolProvider') is v:true
|
||||
let a:conn.capabilities.symbol_search = 1
|
||||
let l:conn.capabilities.symbol_search = 1
|
||||
endif
|
||||
|
||||
if type(get(a:capabilities, 'workspaceSymbolProvider')) is v:t_dict
|
||||
let a:conn.capabilities.symbol_search = 1
|
||||
let l:conn.capabilities.symbol_search = 1
|
||||
endif
|
||||
|
||||
if type(get(a:capabilities, 'textDocumentSync')) is v:t_dict
|
||||
let l:syncOptions = get(a:capabilities, 'textDocumentSync')
|
||||
|
||||
if get(l:syncOptions, 'save') is v:true
|
||||
let a:conn.capabilities.did_save = 1
|
||||
let l:conn.capabilities.did_save = 1
|
||||
endif
|
||||
|
||||
if type(get(l:syncOptions, 'save')) is v:t_dict
|
||||
let a:conn.capabilities.did_save = 1
|
||||
let l:conn.capabilities.did_save = 1
|
||||
|
||||
let l:saveOptions = get(l:syncOptions, 'save')
|
||||
|
||||
if get(l:saveOptions, 'includeText') is v:true
|
||||
let a:conn.capabilities.includeText = 1
|
||||
let l:conn.capabilities.includeText = 1
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
@@ -313,13 +329,30 @@ function! ale#lsp#UpdateConfig(conn_id, buffer, config) abort
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
function! ale#lsp#CallInitCallbacks(conn_id) abort
|
||||
let l:conn = get(s:connections, a:conn_id, {})
|
||||
|
||||
if !empty(l:conn)
|
||||
" Ensure the connection is marked as initialized.
|
||||
" For integration with Neovim's LSP tooling this ensures immediately
|
||||
" call OnInit functions in Vim after the `on_init` callback is called.
|
||||
let l:conn.initialized = 1
|
||||
|
||||
" Call capabilities callbacks queued for the project.
|
||||
for l:Callback in l:conn.init_queue
|
||||
call l:Callback()
|
||||
endfor
|
||||
|
||||
let l:conn.init_queue = []
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! ale#lsp#HandleInitResponse(conn, response) abort
|
||||
if get(a:response, 'method', '') is# 'initialize'
|
||||
let a:conn.initialized = 1
|
||||
elseif type(get(a:response, 'result')) is v:t_dict
|
||||
\&& has_key(a:response.result, 'capabilities')
|
||||
call s:UpdateCapabilities(a:conn, a:response.result.capabilities)
|
||||
call ale#lsp#UpdateCapabilities(a:conn.id, a:response.result.capabilities)
|
||||
|
||||
let a:conn.initialized = 1
|
||||
endif
|
||||
@@ -331,12 +364,7 @@ function! ale#lsp#HandleInitResponse(conn, response) abort
|
||||
" The initialized message must be sent before everything else.
|
||||
call ale#lsp#Send(a:conn.id, ale#lsp#message#Initialized())
|
||||
|
||||
" Call capabilities callbacks queued for the project.
|
||||
for l:Callback in a:conn.init_queue
|
||||
call l:Callback()
|
||||
endfor
|
||||
|
||||
let a:conn.init_queue = []
|
||||
call ale#lsp#CallInitCallbacks(a:conn.id)
|
||||
endfunction
|
||||
|
||||
function! ale#lsp#HandleMessage(conn_id, message) abort
|
||||
@@ -375,6 +403,20 @@ function! ale#lsp#HandleMessage(conn_id, message) abort
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Handle a JSON response from a language server.
|
||||
" This is called from Lua for integration with Neovim's LSP API.
|
||||
function! ale#lsp#HandleResponse(conn_id, response) abort
|
||||
let l:conn = get(s:connections, a:conn_id, {})
|
||||
|
||||
if empty(l:conn)
|
||||
return
|
||||
endif
|
||||
|
||||
for l:Callback in l:conn.callback_list
|
||||
call ale#util#GetFunction(l:Callback)(a:conn_id, a:response)
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
" Given a connection ID, mark it as a tsserver connection, so it will be
|
||||
" handled that way.
|
||||
function! ale#lsp#MarkConnectionAsTsserver(conn_id) abort
|
||||
@@ -452,6 +494,10 @@ function! s:SendInitMessage(conn) abort
|
||||
\ 'dynamicRegistration': v:false,
|
||||
\ 'linkSupport': v:false,
|
||||
\ },
|
||||
\ 'diagnostic': {
|
||||
\ 'dynamicRegistration': v:true,
|
||||
\ 'relatedDocumentSupport': v:true,
|
||||
\ },
|
||||
\ 'publishDiagnostics': {
|
||||
\ 'relatedInformation': v:true,
|
||||
\ },
|
||||
@@ -482,6 +528,29 @@ function! ale#lsp#StartProgram(conn_id, executable, command) abort
|
||||
let l:conn = s:connections[a:conn_id]
|
||||
let l:started = 0
|
||||
|
||||
if g:ale_use_neovim_lsp_api && !l:conn.is_tsserver
|
||||
" For Windows from 'cmd /s/c "foo bar"' we need 'foo bar'
|
||||
let l:lsp_cmd = has('win32') && type(a:command) is v:t_string
|
||||
\ ? ['cmd', '/s/c', a:command[10:-2]]
|
||||
\ : a:command
|
||||
|
||||
" Always call lsp.start, which will either create or re-use a
|
||||
" connection. We'll set `attach` to `false` so we can later use
|
||||
" our OpenDocument function to attach the buffer separately.
|
||||
let l:client_id = luaeval('require("ale.lsp").start(_A)', {
|
||||
\ 'name': a:conn_id,
|
||||
\ 'cmd': l:lsp_cmd,
|
||||
\ 'root_dir': l:conn.root,
|
||||
\ 'init_options': l:conn.init_options,
|
||||
\})
|
||||
|
||||
if l:client_id > 0
|
||||
let l:conn.client_id = l:client_id
|
||||
endif
|
||||
|
||||
return l:client_id > 0
|
||||
endif
|
||||
|
||||
if !has_key(l:conn, 'job_id') || !ale#job#HasOpenChannel(l:conn.job_id)
|
||||
let l:options = {
|
||||
\ 'mode': 'raw',
|
||||
@@ -512,6 +581,21 @@ function! ale#lsp#StartProgram(conn_id, executable, command) abort
|
||||
return l:job_id > 0
|
||||
endfunction
|
||||
|
||||
" Split an address into [host, port].
|
||||
" The port will either be a number or v:null.
|
||||
function! ale#lsp#SplitAddress(address) abort
|
||||
let l:port_match = matchlist(a:address, '\v:(\d+)$')
|
||||
|
||||
if !empty(l:port_match)
|
||||
let l:host = a:address[:-len(l:port_match[1]) - 2]
|
||||
let l:port = l:port_match[1] + 0
|
||||
|
||||
return [l:host, l:port ? l:port : v:null]
|
||||
endif
|
||||
|
||||
return [a:address, v:null]
|
||||
endfunction
|
||||
|
||||
" Connect to an LSP server via TCP.
|
||||
"
|
||||
" 1 will be returned if the connection is running, or 0 if the connection could
|
||||
@@ -520,7 +604,23 @@ function! ale#lsp#ConnectToAddress(conn_id, address) abort
|
||||
let l:conn = s:connections[a:conn_id]
|
||||
let l:started = 0
|
||||
|
||||
if !has_key(l:conn, 'channel_id') || !ale#socket#IsOpen(l:conn.channel_id)
|
||||
if g:ale_use_neovim_lsp_api && !l:conn.is_tsserver
|
||||
let [l:host, l:port] = ale#lsp#SplitAddress(a:address)
|
||||
|
||||
let l:client_id = luaeval('require("ale.lsp").start(_A)', {
|
||||
\ 'name': a:conn_id,
|
||||
\ 'host': l:host,
|
||||
\ 'port': l:port,
|
||||
\ 'root_dir': l:conn.root,
|
||||
\ 'init_options': l:conn.init_options,
|
||||
\})
|
||||
|
||||
if l:client_id > 0
|
||||
let l:conn.client_id = l:client_id
|
||||
endif
|
||||
|
||||
return l:client_id > 0
|
||||
elseif !has_key(l:conn, 'channel_id') || !ale#socket#IsOpen(l:conn.channel_id)
|
||||
let l:channel_id = ale#socket#Open(a:address, {
|
||||
\ 'callback': {_, mess -> ale#lsp#HandleMessage(a:conn_id, mess)},
|
||||
\})
|
||||
@@ -606,26 +706,53 @@ function! ale#lsp#Send(conn_id, message) abort
|
||||
throw 'LSP server not initialized yet!'
|
||||
endif
|
||||
|
||||
if g:ale_use_neovim_lsp_api && !l:conn.is_tsserver
|
||||
return luaeval('require("ale.lsp").send_message(_A)', {
|
||||
\ 'client_id': l:conn.client_id,
|
||||
\ 'is_notification': a:message[0] == 1 ? v:true : v:false,
|
||||
\ 'method': a:message[1],
|
||||
\ 'params': get(a:message, 2, v:null)
|
||||
\})
|
||||
endif
|
||||
|
||||
let [l:id, l:data] = ale#lsp#CreateMessageData(a:message)
|
||||
call s:SendMessageData(l:conn, l:data)
|
||||
|
||||
return l:id == 0 ? -1 : l:id
|
||||
endfunction
|
||||
|
||||
function! ale#lsp#GetLanguage(conn_id, buffer) abort
|
||||
let l:conn = get(s:connections, a:conn_id, {})
|
||||
let l:Language = get(l:conn, 'language')
|
||||
|
||||
if empty(l:Language)
|
||||
return getbufvar(a:buffer, '&filetype')
|
||||
endif
|
||||
|
||||
return type(l:Language) is v:t_func ? l:Language(a:buffer) : l:Language
|
||||
endfunction
|
||||
|
||||
" Notify LSP servers or tsserver if a document is opened, if needed.
|
||||
" If a document is opened, 1 will be returned, otherwise 0 will be returned.
|
||||
function! ale#lsp#OpenDocument(conn_id, buffer, language_id) abort
|
||||
function! ale#lsp#OpenDocument(conn_id, buffer) abort
|
||||
let l:conn = get(s:connections, a:conn_id, {})
|
||||
let l:opened = 0
|
||||
|
||||
if !empty(l:conn) && !has_key(l:conn.open_documents, a:buffer)
|
||||
if l:conn.is_tsserver
|
||||
let l:message = ale#lsp#tsserver_message#Open(a:buffer)
|
||||
call ale#lsp#Send(a:conn_id, l:message)
|
||||
elseif g:ale_use_neovim_lsp_api
|
||||
call luaeval('require("ale.lsp").buf_attach(_A)', {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'client_id': l:conn.client_id,
|
||||
\})
|
||||
else
|
||||
let l:message = ale#lsp#message#DidOpen(a:buffer, a:language_id)
|
||||
let l:language_id = ale#lsp#GetLanguage(a:conn_id, a:buffer)
|
||||
let l:message = ale#lsp#message#DidOpen(a:buffer, l:language_id)
|
||||
call ale#lsp#Send(a:conn_id, l:message)
|
||||
endif
|
||||
|
||||
call ale#lsp#Send(a:conn_id, l:message)
|
||||
let l:conn.open_documents[a:buffer] = getbufvar(a:buffer, 'changedtick')
|
||||
let l:opened = 1
|
||||
endif
|
||||
@@ -649,11 +776,17 @@ function! ale#lsp#CloseDocument(buffer) abort
|
||||
if l:conn.initialized && has_key(l:conn.open_documents, a:buffer)
|
||||
if l:conn.is_tsserver
|
||||
let l:message = ale#lsp#tsserver_message#Close(a:buffer)
|
||||
call ale#lsp#Send(l:conn_id, l:message)
|
||||
elseif g:ale_use_neovim_lsp_api
|
||||
call luaeval('require("ale.lsp").buf_detach(_A)', {
|
||||
\ 'bufnr': a:buffer,
|
||||
\ 'client_id': l:conn.client_id,
|
||||
\})
|
||||
else
|
||||
let l:message = ale#lsp#message#DidClose(a:buffer)
|
||||
call ale#lsp#Send(l:conn_id, l:message)
|
||||
endif
|
||||
|
||||
call ale#lsp#Send(l:conn_id, l:message)
|
||||
call remove(l:conn.open_documents, a:buffer)
|
||||
let l:closed = 1
|
||||
endif
|
||||
|
||||
@@ -200,6 +200,14 @@ function! ale#lsp#message#CodeAction(buffer, line, column, end_line, end_column,
|
||||
\}]
|
||||
endfunction
|
||||
|
||||
function! ale#lsp#message#Diagnostic(buffer) abort
|
||||
return [0, 'textDocument/diagnostic', {
|
||||
\ 'textDocument': {
|
||||
\ 'uri': ale#util#ToURI(expand('#' . a:buffer . ':p')),
|
||||
\ },
|
||||
\}]
|
||||
endfunction
|
||||
|
||||
function! ale#lsp#message#ExecuteCommand(command, arguments) abort
|
||||
return [0, 'workspace/executeCommand', {
|
||||
\ 'command': a:command,
|
||||
|
||||
@@ -21,14 +21,14 @@ let s:SEVERITY_WARNING = 2
|
||||
let s:SEVERITY_INFORMATION = 3
|
||||
let s:SEVERITY_HINT = 4
|
||||
|
||||
" Parse the message for textDocument/publishDiagnostics
|
||||
function! ale#lsp#response#ReadDiagnostics(response) abort
|
||||
" Convert Diagnostic[] data from a language server to an ALE loclist.
|
||||
function! ale#lsp#response#ReadDiagnostics(diagnostics) abort
|
||||
let l:loclist = []
|
||||
|
||||
for l:diagnostic in a:response.params.diagnostics
|
||||
for l:diagnostic in a:diagnostics
|
||||
let l:severity = get(l:diagnostic, 'severity', 0)
|
||||
let l:loclist_item = {
|
||||
\ 'text': substitute(l:diagnostic.message, '\(\r\n\|\n\|\r\)', ' ', 'g'),
|
||||
\ 'text': l:diagnostic.message,
|
||||
\ 'type': 'E',
|
||||
\ 'lnum': l:diagnostic.range.start.line + 1,
|
||||
\ 'col': l:diagnostic.range.start.character + 1,
|
||||
|
||||
@@ -23,6 +23,26 @@ function! ale#lsp_linter#SetLSPLinterMap(replacement_map) abort
|
||||
let s:lsp_linter_map = a:replacement_map
|
||||
endfunction
|
||||
|
||||
" A map for tracking URIs for diagnostic request IDs
|
||||
if !has_key(s:, 'diagnostic_uri_map')
|
||||
let s:diagnostic_uri_map = {}
|
||||
endif
|
||||
|
||||
" For internal use only.
|
||||
function! ale#lsp_linter#ClearDiagnosticURIMap() abort
|
||||
let s:diagnostic_uri_map = {}
|
||||
endfunction
|
||||
|
||||
" For internal use only.
|
||||
function! ale#lsp_linter#GetDiagnosticURIMap() abort
|
||||
return s:diagnostic_uri_map
|
||||
endfunction
|
||||
|
||||
" Just for tests.
|
||||
function! ale#lsp_linter#SetDiagnosticURIMap(replacement_map) abort
|
||||
let s:diagnostic_uri_map = a:replacement_map
|
||||
endfunction
|
||||
|
||||
" Get all enabled LSP linters.
|
||||
" This list still includes linters ignored with `ale_linters_ignore`.
|
||||
"
|
||||
@@ -77,14 +97,17 @@ function! s:ShouldIgnoreDiagnostics(buffer, linter) abort
|
||||
return 0
|
||||
endfunction
|
||||
|
||||
function! s:HandleLSPDiagnostics(conn_id, response) abort
|
||||
" Handle LSP diagnostics for a given URI.
|
||||
" The special value 'unchanged' can be used for diagnostics to indicate
|
||||
" that diagnostics haven't changed since we last checked.
|
||||
function! ale#lsp_linter#HandleLSPDiagnostics(conn_id, uri, diagnostics) abort
|
||||
let l:linter = get(s:lsp_linter_map, a:conn_id)
|
||||
|
||||
if empty(l:linter)
|
||||
return
|
||||
endif
|
||||
|
||||
let l:filename = ale#util#ToResource(a:response.params.uri)
|
||||
let l:filename = ale#util#ToResource(a:uri)
|
||||
let l:escaped_name = escape(
|
||||
\ fnameescape(l:filename),
|
||||
\ has('win32') ? '^' : '^,}]'
|
||||
@@ -100,9 +123,12 @@ function! s:HandleLSPDiagnostics(conn_id, response) abort
|
||||
return
|
||||
endif
|
||||
|
||||
let l:loclist = ale#lsp#response#ReadDiagnostics(a:response)
|
||||
|
||||
call ale#engine#HandleLoclist(l:linter.name, l:buffer, l:loclist, 0)
|
||||
if a:diagnostics is# 'unchanged'
|
||||
call ale#engine#MarkLinterInactive(l:info, l:linter)
|
||||
else
|
||||
let l:loclist = ale#lsp#response#ReadDiagnostics(a:diagnostics)
|
||||
call ale#engine#HandleLoclist(l:linter.name, l:buffer, l:loclist, 0)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:HandleTSServerDiagnostics(response, error_type) abort
|
||||
@@ -204,7 +230,17 @@ function! ale#lsp_linter#HandleLSPResponse(conn_id, response) abort
|
||||
|
||||
call s:HandleLSPErrorMessage(l:linter, a:response)
|
||||
elseif l:method is# 'textDocument/publishDiagnostics'
|
||||
call s:HandleLSPDiagnostics(a:conn_id, a:response)
|
||||
let l:uri = a:response.params.uri
|
||||
let l:diagnostics = a:response.params.diagnostics
|
||||
|
||||
call ale#lsp_linter#HandleLSPDiagnostics(a:conn_id, l:uri, l:diagnostics)
|
||||
elseif has_key(s:diagnostic_uri_map, get(a:response, 'id'))
|
||||
let l:uri = remove(s:diagnostic_uri_map, a:response.id)
|
||||
let l:diagnostics = a:response.result.kind is# 'unchanged'
|
||||
\ ? 'unchanged'
|
||||
\ : a:response.result.items
|
||||
|
||||
call ale#lsp_linter#HandleLSPDiagnostics(a:conn_id, l:uri, l:diagnostics)
|
||||
elseif l:method is# 'window/showMessage'
|
||||
call ale#lsp_window#HandleShowMessage(
|
||||
\ s:lsp_linter_map[a:conn_id].name,
|
||||
@@ -219,7 +255,7 @@ function! ale#lsp_linter#HandleLSPResponse(conn_id, response) abort
|
||||
call s:HandleTSServerDiagnostics(a:response, 'syntax')
|
||||
elseif get(a:response, 'type', '') is# 'event'
|
||||
\&& get(a:response, 'event', '') is# 'suggestionDiag'
|
||||
\&& get(g:, 'ale_lsp_suggestions', '1') == 1
|
||||
\&& get(g:, 'ale_lsp_suggestions')
|
||||
call s:HandleTSServerDiagnostics(a:response, 'suggestion')
|
||||
endif
|
||||
endfunction
|
||||
@@ -306,11 +342,10 @@ function! ale#lsp_linter#OnInit(linter, details, Callback) abort
|
||||
let l:command = a:details.command
|
||||
|
||||
let l:config = ale#lsp_linter#GetConfig(l:buffer, a:linter)
|
||||
let l:language_id = ale#linter#GetLanguage(l:buffer, a:linter)
|
||||
|
||||
call ale#lsp#UpdateConfig(l:conn_id, l:buffer, l:config)
|
||||
|
||||
if ale#lsp#OpenDocument(l:conn_id, l:buffer, l:language_id)
|
||||
if ale#lsp#OpenDocument(l:conn_id, l:buffer)
|
||||
if g:ale_history_enabled && !empty(l:command)
|
||||
call ale#history#Add(l:buffer, 'started', l:conn_id, l:command)
|
||||
endif
|
||||
@@ -357,11 +392,21 @@ function! s:StartLSP(options, address, executable, command) abort
|
||||
let l:init_options = ale#lsp_linter#GetOptions(l:buffer, l:linter)
|
||||
|
||||
if l:linter.lsp is# 'socket'
|
||||
let l:conn_id = ale#lsp#Register(a:address, l:root, l:init_options)
|
||||
let l:conn_id = ale#lsp#Register(
|
||||
\ a:address,
|
||||
\ l:root,
|
||||
\ l:linter.language,
|
||||
\ l:init_options
|
||||
\)
|
||||
let l:ready = ale#lsp#ConnectToAddress(l:conn_id, a:address)
|
||||
let l:command = ''
|
||||
else
|
||||
let l:conn_id = ale#lsp#Register(a:executable, l:root, l:init_options)
|
||||
let l:conn_id = ale#lsp#Register(
|
||||
\ a:executable,
|
||||
\ l:root,
|
||||
\ l:linter.language,
|
||||
\ l:init_options
|
||||
\)
|
||||
|
||||
" tsserver behaves differently, so tell the LSP API that it is tsserver.
|
||||
if l:linter.lsp is# 'tsserver'
|
||||
@@ -511,17 +556,33 @@ function! s:CheckWithLSP(linter, details) abort
|
||||
if l:notified
|
||||
call ale#engine#MarkLinterActive(l:info, a:linter)
|
||||
endif
|
||||
else
|
||||
elseif !g:ale_use_neovim_lsp_api
|
||||
let l:notified = ale#lsp#NotifyForChanges(l:id, l:buffer)
|
||||
endif
|
||||
|
||||
" If this was a file save event, also notify the server of that.
|
||||
if a:linter.lsp isnot# 'tsserver'
|
||||
\&& getbufvar(l:buffer, 'ale_save_event_fired', 0)
|
||||
\&& ale#lsp#HasCapability(l:id, 'did_save')
|
||||
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:notified = ale#lsp#Send(l:id, l:save_message) != 0
|
||||
" If this was a file save event, also notify the server of that.
|
||||
if getbufvar(l:buffer, 'ale_save_event_fired', 0)
|
||||
\&& ale#lsp#HasCapability(l:id, 'did_save')
|
||||
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:notified = ale#lsp#Send(l:id, l:save_message) != 0
|
||||
endif
|
||||
|
||||
let l:diagnostic_request_id = 0
|
||||
|
||||
" If the document is updated and we can pull diagnostics, try to.
|
||||
if ale#lsp#HasCapability(l:id, 'pull_model')
|
||||
let l:diagnostic_message = ale#lsp#message#Diagnostic(l:buffer)
|
||||
|
||||
let l:diagnostic_request_id = ale#lsp#Send(l:id, l:diagnostic_message)
|
||||
endif
|
||||
|
||||
" If we are going to pull diagnostics, then mark the linter as active,
|
||||
" and remember the URI we sent the request for.
|
||||
if l:diagnostic_request_id
|
||||
call ale#engine#MarkLinterActive(l:info, a:linter)
|
||||
let s:diagnostic_uri_map[l:diagnostic_request_id] =
|
||||
\ l:diagnostic_message[2].textDocument.uri
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
" Find project root for a Lua language server.
|
||||
function! ale#lua#FindProjectRoot(buffer) abort
|
||||
let l:possible_project_roots = [
|
||||
\ '.luarc.json',
|
||||
\ '.git',
|
||||
\ bufname(a:buffer),
|
||||
\]
|
||||
|
||||
@@ -62,6 +62,36 @@ function! ale#path#FindNearestDirectory(buffer, directory_name) abort
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
" Given a buffer and a filename, find the nearest file or directory by
|
||||
" searching upwards through the paths relative to the given buffer.
|
||||
function! ale#path#FindNearestFileOrDirectory(buffer, filename) abort
|
||||
let l:buffer_filename = fnamemodify(bufname(a:buffer), ':p')
|
||||
let l:buffer_filename = fnameescape(l:buffer_filename)
|
||||
|
||||
let l:relative_path_file = findfile(a:filename, l:buffer_filename . ';')
|
||||
let l:relative_path_dir = finddir(a:filename, l:buffer_filename . ';')
|
||||
|
||||
" If we find both a file and directory, choose the shorter response by
|
||||
" making the longer one empty instead.
|
||||
if !empty(l:relative_path_file) && !empty(l:relative_path_dir)
|
||||
if strlen(l:relative_path_file) > strlen(l:relative_path_dir)
|
||||
let l:relative_path_dir = ''
|
||||
else
|
||||
let l:relative_path_file = ''
|
||||
endif
|
||||
endif
|
||||
|
||||
if !empty(l:relative_path_file)
|
||||
return fnamemodify(l:relative_path_file, ':p')
|
||||
endif
|
||||
|
||||
if !empty(l:relative_path_dir)
|
||||
return fnamemodify(l:relative_path_dir, ':p')
|
||||
endif
|
||||
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
" Given a buffer, a string to search for, and a global fallback for when
|
||||
" the search fails, look for a file in parent paths, and if that fails,
|
||||
" use the global fallback path instead.
|
||||
@@ -115,20 +145,24 @@ endfunction
|
||||
|
||||
" Return 1 if a path is an absolute path.
|
||||
function! ale#path#IsAbsolute(filename) abort
|
||||
if has('win32') && a:filename[:0] is# '\'
|
||||
return 1
|
||||
if has('win32')
|
||||
return a:filename[:0] =~# '[\\/]' || a:filename[0:2] =~? '[A-Z]:[/\\]'
|
||||
else
|
||||
return a:filename[:0] is# '/'
|
||||
endif
|
||||
|
||||
" Check for /foo and C:\foo, etc.
|
||||
return a:filename[:0] is# '/' || a:filename[1:2] is# ':\'
|
||||
endfunction
|
||||
|
||||
let s:temp_dir = ale#path#Simplify(fnamemodify(ale#util#Tempname(), ':h:h'))
|
||||
let s:resolved_temp_dir = resolve(s:temp_dir)
|
||||
|
||||
" Given a filename, return 1 if the file represents some temporary file
|
||||
" created by Vim.
|
||||
" created by Vim. If the temporary location is symlinked (e.g. macOS), some
|
||||
" linters may report the resolved version of the path, so both are checked.
|
||||
function! ale#path#IsTempName(filename) abort
|
||||
return ale#path#Simplify(a:filename)[:len(s:temp_dir) - 1] is# s:temp_dir
|
||||
let l:filename = ale#path#Simplify(a:filename)
|
||||
|
||||
return l:filename[:len(s:temp_dir) - 1] is# s:temp_dir
|
||||
\|| l:filename[:len(s:resolved_temp_dir) - 1] is# s:resolved_temp_dir
|
||||
endfunction
|
||||
|
||||
" Given a base directory, which must not have a trailing slash, and a
|
||||
|
||||
@@ -26,7 +26,6 @@ function! ale#python#FindProjectRootIni(buffer) abort
|
||||
" If you change this, update ale-python-root documentation.
|
||||
if filereadable(l:path . '/MANIFEST.in')
|
||||
\|| filereadable(l:path . '/setup.cfg')
|
||||
\|| filereadable(l:path . '/pytest.ini')
|
||||
\|| filereadable(l:path . '/tox.ini')
|
||||
\|| filereadable(l:path . '/.pyre_configuration.local')
|
||||
\|| filereadable(l:path . '/mypy.ini')
|
||||
@@ -55,11 +54,12 @@ endfunction
|
||||
" Given a buffer number, find the project root directory for Python.
|
||||
" The root directory is defined as the first directory found while searching
|
||||
" upwards through paths, including the current directory, until a path
|
||||
" containing an init file (one from MANIFEST.in, setup.cfg, pytest.ini,
|
||||
" tox.ini) is found. If it is not possible to find the project root directory
|
||||
" via init file, then it will be defined as the first directory found
|
||||
" searching upwards through paths, including the current directory, until no
|
||||
" __init__.py files is found.
|
||||
" containing an configuration file is found. (See list above)
|
||||
"
|
||||
" If it is not possible to find the project root directory via configuration
|
||||
" file, then it will be defined as the first directory found searching upwards
|
||||
" through paths, including the current directory, until no __init__.py files
|
||||
" is found.
|
||||
function! ale#python#FindProjectRoot(buffer) abort
|
||||
let l:ini_root = ale#python#FindProjectRootIni(a:buffer)
|
||||
|
||||
@@ -200,7 +200,7 @@ function! ale#python#PoetryPresent(buffer) abort
|
||||
return findfile('poetry.lock', expand('#' . a:buffer . ':p:h') . ';') isnot# ''
|
||||
endfunction
|
||||
|
||||
" Detects whether a poetry environment is present.
|
||||
" Detects whether a uv environment is present.
|
||||
function! ale#python#UvPresent(buffer) abort
|
||||
return findfile('uv.lock', expand('#' . a:buffer . ':p:h') . ';') isnot# ''
|
||||
endfunction
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
let g:ale_default_navigation = get(g:, 'ale_default_navigation', 'buffer')
|
||||
let g:ale_references_show_contents = get(g:, 'ale_references_show_contents', 1)
|
||||
|
||||
let s:references_map = {}
|
||||
|
||||
@@ -67,17 +68,33 @@ function! ale#references#HandleTSServerResponse(conn_id, response) abort
|
||||
endfunction
|
||||
|
||||
function! ale#references#FormatLSPResponseItem(response_item, options) abort
|
||||
let l:line_text = ''
|
||||
|
||||
let l:line= a:response_item.range.start.line
|
||||
let l:col = a:response_item.range.start.character
|
||||
let l:filename = ale#util#ToResource(a:response_item.uri)
|
||||
|
||||
if get(a:options, 'show_contents') == 1
|
||||
try
|
||||
let l:line_text = substitute(readfile(l:filename)[l:line], '^\s*\(.\{-}\)\s*$', '\1', '')
|
||||
catch
|
||||
" This happens in tests
|
||||
endtry
|
||||
endif
|
||||
|
||||
if get(a:options, 'open_in') is# 'quickfix'
|
||||
return {
|
||||
\ 'filename': ale#util#ToResource(a:response_item.uri),
|
||||
\ 'filename': l:filename,
|
||||
\ 'lnum': a:response_item.range.start.line + 1,
|
||||
\ 'col': a:response_item.range.start.character + 1,
|
||||
\ 'text': l:line_text,
|
||||
\}
|
||||
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,
|
||||
\ 'filename': l:filename,
|
||||
\ 'line': l:line + 1,
|
||||
\ 'column': l:col + 1,
|
||||
\ 'match': l:line_text,
|
||||
\}
|
||||
endif
|
||||
endfunction
|
||||
@@ -147,6 +164,7 @@ function! s:OnReady(line, column, options, linter, lsp_details) abort
|
||||
let s:references_map[l:request_id] = {
|
||||
\ 'use_relative_paths': has_key(a:options, 'use_relative_paths') ? a:options.use_relative_paths : 0,
|
||||
\ 'open_in': get(a:options, 'open_in', 'current-buffer'),
|
||||
\ 'show_contents': a:options.show_contents,
|
||||
\}
|
||||
endfunction
|
||||
|
||||
@@ -165,6 +183,8 @@ function! ale#references#Find(...) abort
|
||||
let l:options.open_in = 'vsplit'
|
||||
elseif l:option is? '-quickfix'
|
||||
let l:options.open_in = 'quickfix'
|
||||
elseif l:option is? '-contents'
|
||||
let l:options.show_contents = 1
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
@@ -177,6 +197,10 @@ function! ale#references#Find(...) abort
|
||||
endif
|
||||
endif
|
||||
|
||||
if !has_key(l:options, 'show_contents')
|
||||
let l:options.show_contents = ale#Var(bufnr(''), 'references_show_contents')
|
||||
endif
|
||||
|
||||
let l:buffer = bufnr('')
|
||||
let [l:line, l:column] = getpos('.')[1:2]
|
||||
let l:column = min([l:column, len(getline(l:line))])
|
||||
|
||||
@@ -17,8 +17,8 @@ function! ale#rename#ClearLSPData() abort
|
||||
let s:rename_map = {}
|
||||
endfunction
|
||||
|
||||
let g:ale_rename_tsserver_find_in_comments = get(g:, 'ale_rename_tsserver_find_in_comments')
|
||||
let g:ale_rename_tsserver_find_in_strings = get(g:, 'ale_rename_tsserver_find_in_strings')
|
||||
let g:ale_rename_tsserver_find_in_comments = get(g:, 'ale_rename_tsserver_find_in_comments', v:false)
|
||||
let g:ale_rename_tsserver_find_in_strings = get(g:, 'ale_rename_tsserver_find_in_strings', v:false)
|
||||
|
||||
function! s:message(message) abort
|
||||
call ale#util#Execute('echom ' . string(a:message))
|
||||
|
||||
@@ -7,7 +7,7 @@ scriptencoding utf8
|
||||
let g:ale_max_signs = get(g:, 'ale_max_signs', -1)
|
||||
" This flag can be set to 1 to enable changing the sign column colors when
|
||||
" there are errors.
|
||||
let g:ale_change_sign_column_color = get(g:, 'ale_change_sign_column_color', 0)
|
||||
let g:ale_change_sign_column_color = get(g:, 'ale_change_sign_column_color', v:false)
|
||||
" These variables dictate what signs are used to indicate errors and warnings.
|
||||
let g:ale_sign_error = get(g:, 'ale_sign_error', 'E')
|
||||
let g:ale_sign_style_error = get(g:, 'ale_sign_style_error', g:ale_sign_error)
|
||||
@@ -20,8 +20,8 @@ let g:ale_sign_priority = get(g:, 'ale_sign_priority', 30)
|
||||
" The dummy sign will use the ID exactly equal to the offset.
|
||||
let g:ale_sign_offset = get(g:, 'ale_sign_offset', 1000000)
|
||||
" This flag can be set to 1 to keep sign gutter always open
|
||||
let g:ale_sign_column_always = get(g:, 'ale_sign_column_always', 0)
|
||||
let g:ale_sign_highlight_linenrs = get(g:, 'ale_sign_highlight_linenrs', 0)
|
||||
let g:ale_sign_column_always = get(g:, 'ale_sign_column_always', v:false)
|
||||
let g:ale_sign_highlight_linenrs = get(g:, 'ale_sign_highlight_linenrs', v:false)
|
||||
|
||||
let s:supports_sign_groups = has('nvim-0.4.2') || has('patch-8.1.614')
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ let g:ale_virtualtext_delay = get(g:, 'ale_virtualtext_delay', 10)
|
||||
let g:ale_virtualtext_column = get(g:, 'ale_virtualtext_column', 0)
|
||||
let g:ale_virtualtext_maxcolumn = get(g:, 'ale_virtualtext_maxcolumn', 0)
|
||||
" If 1, only show the first problem with virtualtext.
|
||||
let g:ale_virtualtext_single = get(g:, 'ale_virtualtext_single', 1)
|
||||
let g:ale_virtualtext_single = get(g:, 'ale_virtualtext_single', v:true)
|
||||
|
||||
let s:cursor_timer = get(s:, 'cursor_timer', -1)
|
||||
let s:last_pos = get(s:, 'last_pos', [0, 0, 0])
|
||||
|
||||
@@ -7,19 +7,25 @@ cspell *ale-ada-cspell*
|
||||
|
||||
See |ale-cspell-options|
|
||||
|
||||
|
||||
===============================================================================
|
||||
gcc *ale-ada-gcc*
|
||||
|
||||
g:ale_ada_gcc_executable *g:ale_ada_gcc_executable*
|
||||
*ale-options.ada_gcc_executable*
|
||||
*g:ale_ada_gcc_executable*
|
||||
*b:ale_ada_gcc_executable*
|
||||
ada_gcc_executable
|
||||
g:ale_ada_gcc_executable
|
||||
Type: |String|
|
||||
Default: `'gcc'`
|
||||
|
||||
This variable can be changed to use a different executable for gcc.
|
||||
This variable can be changed to use a different executable for gcc.
|
||||
|
||||
|
||||
g:ale_ada_gcc_options *g:ale_ada_gcc_options*
|
||||
*ale-options.ada_gcc_options*
|
||||
*g:ale_ada_gcc_options*
|
||||
*b:ale_ada_gcc_options*
|
||||
ada_gcc_options
|
||||
g:ale_ada_gcc_options
|
||||
Type: |String|
|
||||
Default: `'-gnatwa -gnatq'`
|
||||
|
||||
@@ -29,8 +35,11 @@ g:ale_ada_gcc_options *g:ale_ada_gcc_options*
|
||||
===============================================================================
|
||||
gnatpp *ale-ada-gnatpp*
|
||||
|
||||
g:ale_ada_gnatpp_options *g:ale_ada_gnatpp_options*
|
||||
*ale-options.ada_gnatpp_options*
|
||||
*g:ale_ada_gnatpp_options*
|
||||
*b:ale_ada_gnatpp_options*
|
||||
ada_gnatpp_options
|
||||
g:ale_ada_gnatpp_options
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
@@ -40,31 +49,38 @@ g:ale_ada_gnatpp_options *g:ale_ada_gnatpp_options*
|
||||
===============================================================================
|
||||
ada-language-server *ale-ada-language-server*
|
||||
|
||||
g:ale_ada_adals_executable *g:ale_ada_adals_executable*
|
||||
*ale-options.ada_adals_executable*
|
||||
*g:ale_ada_adals_executable*
|
||||
*b:ale_ada_adals_executable*
|
||||
ada_adals_executable
|
||||
g:ale_ada_adals_executable
|
||||
Type: |String|
|
||||
Default: `'ada_language_server'`
|
||||
|
||||
This variable can be changed to use a different executable for Ada Language
|
||||
Server.
|
||||
|
||||
|
||||
g:ale_ada_adals_project *g:ale_ada_adals_project*
|
||||
*ale-options.ada_adals_project*
|
||||
*g:ale_ada_adals_project*
|
||||
*b:ale_ada_adals_project*
|
||||
ada_adals_project
|
||||
g:ale_ada_adals_project
|
||||
Type: |String|
|
||||
Default: `'default.gpr'`
|
||||
|
||||
This variable can be changed to use a different GPR file for
|
||||
Ada Language Server.
|
||||
This variable can be changed to use a different GPR file for Ada Language
|
||||
Server.
|
||||
|
||||
|
||||
g:ale_ada_adals_encoding *g:ale_ada_adals_encoding*
|
||||
*ale-options.ada_adals_encoding*
|
||||
*g:ale_ada_adals_encoding*
|
||||
*b:ale_ada_adals_encoding*
|
||||
ada_adals_encoding
|
||||
g:ale_ada_adals_encoding
|
||||
Type: |String|
|
||||
Default: `'utf-8'`
|
||||
|
||||
This variable can be changed to use a different file encoding for
|
||||
Ada Language Server.
|
||||
This variable can be changed to use a different file encoding for Ada
|
||||
Language Server.
|
||||
|
||||
|
||||
===============================================================================
|
||||
|
||||
@@ -1,39 +1,82 @@
|
||||
===============================================================================
|
||||
ALE Ansible Integration *ale-ansible-options*
|
||||
|
||||
|
||||
===============================================================================
|
||||
ansible-language-server *ale-ansible-language-server*
|
||||
ansible-language-server *ale-ansible-language-server*
|
||||
|
||||
|
||||
g:ale_ansible_language_server_executable *g:ale_ansible_language_server*
|
||||
*b:ale_ansible_language_server*
|
||||
|
||||
*ale-options.ansible_language_server_executable*
|
||||
*g:ale_ansible_language_server_executable*
|
||||
*b:ale_ansible_language_server_executable*
|
||||
ansible_language_server_executable
|
||||
g:ale_ansible_language_server_executable
|
||||
Type: |String|
|
||||
Default: 'ansible-language-server'
|
||||
Default: `'ansible-language-server'`
|
||||
|
||||
Variable can be used to modify the executable used for ansible language server.
|
||||
|
||||
|
||||
g:ale_ansible_language_server_config *g:ale_ansible_language_server_config*
|
||||
*b:ale_ansible_language_server_config*
|
||||
Variable can be used to modify the executable used for Ansible language
|
||||
server.
|
||||
|
||||
*ale-options.ansible_language_server_config*
|
||||
*g:ale_ansible_language_server_config*
|
||||
*b:ale_ansible_language_server_config*
|
||||
ansible_language_server_config
|
||||
g:ale_ansible_language_server_config
|
||||
Type: |Dictionary|
|
||||
Default: '{}'
|
||||
Default: `'{}'`
|
||||
|
||||
Configuration parameters sent to the language server on start. Refer to the
|
||||
ansible language server configuration documentation for list of available
|
||||
options: https://als.readthedocs.io/en/latest/settings/
|
||||
|
||||
|
||||
===============================================================================
|
||||
ansible-lint *ale-ansible-ansible-lint*
|
||||
|
||||
g:ale_ansible_ansible_lint_executable *g:ale_ansible_ansible_lint_executable*
|
||||
*ale-options.ansible_ansible_lint_executable*
|
||||
*g:ale_ansible_ansible_lint_executable*
|
||||
*b:ale_ansible_ansible_lint_executable*
|
||||
ansible_ansible_lint_executable
|
||||
g:ale_ansible_ansible_lint_executable
|
||||
Type: |String|
|
||||
Default: `'ansible-lint'`
|
||||
|
||||
This variable can be changed to modify the executable used for ansible-lint.
|
||||
|
||||
|
||||
*ale-options.ansible_ansible_lint_auto_pipenv*
|
||||
*g:ale_ansible_ansible_lint_auto_pipenv*
|
||||
*b:ale_ansible_ansible_lint_auto_pipenv*
|
||||
ansible_ansible_lint_auto_pipenv
|
||||
g:ale_ansible_ansible_lint_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.
|
||||
|
||||
*ale-options.ansible_ansible_lint_auto_poetry*
|
||||
*g:ale_ansible_ansible_lint_auto_poetry*
|
||||
*b:ale_ansible_ansible_lint_auto_poetry*
|
||||
ansible_ansible_lint_auto_poetry
|
||||
g:ale_ansible_ansible_lint_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.
|
||||
|
||||
*ale-options.ansible_ansible_lint_auto_uv*
|
||||
*g:ale_ansible_ansible_lint_auto_uv*
|
||||
*b:ale_ansible_ansible_lint_auto_uv*
|
||||
ansible_ansible_lint_auto_uv
|
||||
g:ale_ansible_ansible_lint_auto_uv
|
||||
Type: |Number|
|
||||
Default: `0`
|
||||
|
||||
Set the executable to `uv` if true. This is overridden by a manually-set
|
||||
executable.
|
||||
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
|
||||
@@ -5,27 +5,33 @@ ALE APKBUILD Integration *ale-apkbuild-options*
|
||||
===============================================================================
|
||||
apkbuild-fixer *ale-apkbuild-apkbuild-fixer*
|
||||
|
||||
g:apkbuild_apkbuild_fixer_options *g:apkbuild_apkbuild_fixer_options*
|
||||
*b:apkbuild_apkbuild_fixer_options*
|
||||
*ale-options.apkbuild_apkbuild_fixer_options*
|
||||
*g:ale_apkbuild_apkbuild_fixer_options*
|
||||
*b:ale_apkbuild_apkbuild_fixer_options*
|
||||
apkbuild_apkbuild_fixer_options
|
||||
g:ale_apkbuild_apkbuild_fixer_options
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
This variable can be set to pass additional options to the apkbuild_fixer
|
||||
fixer.
|
||||
|
||||
|
||||
g:apkbuild_apkbuild_fixer_executable *g:apkbuild_apkbuild_fixer_executable*
|
||||
*b:apkbuild_apkbuild_fixer_executable*
|
||||
*ale-options.apkbuild_apkbuild_fixer_executable*
|
||||
*g:ale_apkbuild_apkbuild_fixer_executable*
|
||||
*b:ale_apkbuild_apkbuild_fixer_executable*
|
||||
apkbuild_apkbuild_fixer_executable
|
||||
g:ale_apkbuild_apkbuild_fixer_executable
|
||||
Type: |String|
|
||||
Default: `'apkbuild-fixer'`
|
||||
|
||||
This variable can be modified to change the executable path for
|
||||
`apkbuild-fixer`.
|
||||
|
||||
|
||||
g:apkbuild_apkbuild_fixer_lint_executable
|
||||
*g:apkbuild_apkbuild_fixer_lint_executable*
|
||||
*b:apkbuild_apkbuild_fixer_lint_executable*
|
||||
*ale-options.apkbuild_apkbuild_fixer_lint_executable*
|
||||
*g:ale_apkbuild_apkbuild_fixer_lint_executable*
|
||||
*b:ale_apkbuild_apkbuild_fixer_lint_executable*
|
||||
apkbuild_apkbuild_fixer_lint_executable
|
||||
g:ale_apkbuild_apkbuild_fixer_lint_executable
|
||||
Type: |String|
|
||||
Default: `'apkbuild-fixer'`
|
||||
|
||||
@@ -36,26 +42,30 @@ g:apkbuild_apkbuild_fixer_lint_executable
|
||||
===============================================================================
|
||||
apkbuild-lint *ale-apkbuild-apkbuild-lint*
|
||||
|
||||
g:ale_apkbuild_apkbuild_lint_executable
|
||||
*ale-options.apkbuild_apkbuild_lint_executable*
|
||||
*g:ale_apkbuild_apkbuild_lint_executable*
|
||||
*b:ale_apkbuild_apkbuild_lint_executable*
|
||||
|
||||
apkbuild_apkbuild_lint_executable
|
||||
g:ale_apkbuild_apkbuild_lint_executable
|
||||
Type: |String|
|
||||
Default: `'apkbuild-lint'`
|
||||
|
||||
This variable can be set to change the path to apkbuild-lint
|
||||
|
||||
|
||||
===============================================================================
|
||||
secfixes-check *ale-apkbuild-secfixes-check*
|
||||
|
||||
g:ale_apkbuild_secfixes_check_executable
|
||||
*ale-options.apkbuild_secfixes_check_executable*
|
||||
*g:ale_apkbuild_secfixes_check_executable*
|
||||
*b:ale_apkbuild_secfixes_check_executable*
|
||||
|
||||
apkbuild_secfixes_check_executable
|
||||
g:ale_apkbuild_secfixes_check_executable
|
||||
Type: |String|
|
||||
Default: `'secfixes-check'`
|
||||
|
||||
This variable can be set to change the path to secfixes-check
|
||||
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
|
||||
@@ -20,5 +20,11 @@ textlint *ale-asciidoc-textlint*
|
||||
See |ale-text-textlint|
|
||||
|
||||
|
||||
===============================================================================
|
||||
redpen *ale-asciidoc-redpen*
|
||||
|
||||
See |ale-redpen-options|
|
||||
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
|
||||
@@ -5,16 +5,21 @@ ALE ASM Integration *ale-asm-options*
|
||||
===============================================================================
|
||||
gcc *ale-asm-gcc*
|
||||
|
||||
g:ale_asm_gcc_executable *g:ale_asm_gcc_executable*
|
||||
*ale-options.asm_gcc_executable*
|
||||
*g:ale_asm_gcc_executable*
|
||||
*b:ale_asm_gcc_executable*
|
||||
asm_gcc_executable
|
||||
g:ale_asm_gcc_executable
|
||||
Type: |String|
|
||||
Default: `'gcc'`
|
||||
|
||||
This variable can be changed to use a different executable for gcc.
|
||||
This variable can be changed to use a different executable for gcc.
|
||||
|
||||
|
||||
g:ale_asm_gcc_options *g:ale_asm_gcc_options*
|
||||
*ale-options.asm_gcc_options*
|
||||
*g:ale_asm_gcc_options*
|
||||
*b:ale_asm_gcc_options*
|
||||
asm_gcc_options
|
||||
g:ale_asm_gcc_options
|
||||
Type: |String|
|
||||
Default: `'-Wall'`
|
||||
|
||||
@@ -24,16 +29,21 @@ g:ale_asm_gcc_options *g:ale_asm_gcc_options*
|
||||
===============================================================================
|
||||
llvm_mc *ale-asm-llvm_mc*
|
||||
|
||||
g:ale_asm_clang_executable *g:ale_asm_llvm_mc_executable*
|
||||
*ale-options.asm_llvm_mc_executable*
|
||||
*g:ale_asm_llvm_mc_executable*
|
||||
*b:ale_asm_llvm_mc_executable*
|
||||
asm_llvm_mc_executable
|
||||
g:ale_asm_llvm_mc_executable
|
||||
Type: |String|
|
||||
Default: `'llvm-mc'`
|
||||
|
||||
This variable can be changed to use a different executable for llvm-mc.
|
||||
|
||||
|
||||
g:ale_asm_clang_options *g:ale_asm_llvm_mc_options*
|
||||
*ale-options.asm_llvm_mc_options*
|
||||
*g:ale_asm_llvm_mc_options*
|
||||
*b:ale_asm_llvm_mc_options*
|
||||
asm_llvm_mc_options
|
||||
g:ale_asm_llvm_mc_options
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
|
||||
@@ -5,17 +5,21 @@ ALE AVRA Integration *ale-avra-options*
|
||||
===============================================================================
|
||||
avra *ale-avra-avra*
|
||||
|
||||
g:ale_avra_avra_executable *g:ale_avra_avra_executable*
|
||||
*ale-options.avra_avra_executable*
|
||||
*g:ale_avra_avra_executable*
|
||||
*b:ale_avra_avra_executable*
|
||||
|
||||
avra_avra_executable
|
||||
g:ale_avra_avra_executable
|
||||
Type: |String|
|
||||
Default `'avra'`
|
||||
|
||||
This variable can be changed to use different executable for AVRA.
|
||||
|
||||
|
||||
g:ale_avra_avra_options *g:ale_avra_avra_options*
|
||||
*ale-options.avra_avra_options*
|
||||
*g:ale_avra_avra_options*
|
||||
*b:ale_avra_avra_options*
|
||||
avra_avra_options
|
||||
g:ale_avra_avra_options
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
|
||||
@@ -5,21 +5,27 @@ ALE Awk Integration *ale-awk-options*
|
||||
===============================================================================
|
||||
gawk *ale-awk-gawk*
|
||||
|
||||
g:ale_awk_gawk_executable *g:ale_awk_gawk_executable*
|
||||
*ale-options.awk_gawk_executable*
|
||||
*g:ale_awk_gawk_executable*
|
||||
*b:ale_awk_gawk_executable*
|
||||
awk_gawk_executable
|
||||
g:ale_awk_gawk_executable
|
||||
Type: |String|
|
||||
Default: `'gawk'`
|
||||
|
||||
This variable sets executable used for gawk.
|
||||
|
||||
|
||||
g:ale_awk_gawk_options *g:ale_awk_gawk_options*
|
||||
*ale-options.awk_gawk_options*
|
||||
*g:ale_awk_gawk_options*
|
||||
*b:ale_awk_gawk_options*
|
||||
awk_gawk_options
|
||||
g:ale_awk_gawk_options
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
With this variable we are able to pass extra arguments for gawk
|
||||
for invocation.
|
||||
With this variable we are able to pass extra arguments for gawk for
|
||||
invocation.
|
||||
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
|
||||
@@ -4,25 +4,36 @@ ALE Bazel Integration *ale-bazel-options*
|
||||
===============================================================================
|
||||
buildifier *ale-bazel-buildifier*
|
||||
|
||||
g:ale_bazel_buildifier_executable *g:ale_bazel_buildifier_executable*
|
||||
*ale-options.bazel_buildifier_executable*
|
||||
*g:ale_bazel_buildifier_executable*
|
||||
*b:ale_bazel_buildifier_executable*
|
||||
bazel_buildifier_executable
|
||||
g:ale_bazel_buildifier_executable
|
||||
Type: |String|
|
||||
Default: `'buildifier'`
|
||||
|
||||
See |ale-integrations-local-executables|
|
||||
|
||||
|
||||
g:ale_bazel_buildifier_options *g:ale_bazel_buildifier_options*
|
||||
*ale-options.bazel_buildifier_options*
|
||||
*g:ale_bazel_buildifier_options*
|
||||
*b:ale_bazel_buildifier_options*
|
||||
bazel_buildifier_options
|
||||
g:ale_bazel_buildifier_options
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
This variable can be set to pass extra options to buildifier.
|
||||
|
||||
|
||||
g:ale_bazel_buildifier_use_global *g:ale_bazel_buildifier_use_global*
|
||||
*ale-options.bazel_buildifier_use_global*
|
||||
*g:ale_bazel_buildifier_use_global*
|
||||
*b:ale_bazel_buildifier_use_global*
|
||||
bazel_buildifier_use_global
|
||||
g:ale_bazel_buildifier_use_global
|
||||
Type: |Number|
|
||||
Default: `get(g:, 'ale_use_global_executables', 0)`
|
||||
|
||||
See |ale-integrations-local-executables|
|
||||
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
|
||||
@@ -5,15 +5,22 @@ ALE BibTeX Integration *ale-bib-options*
|
||||
===============================================================================
|
||||
bibclean *ale-bib-bibclean*
|
||||
|
||||
g:ale_bib_bibclean_executable *g:ale_bib_bibclean_executable*
|
||||
|
||||
*ale-options.bib_bibclean_executable*
|
||||
*g:ale_bib_bibclean_executable*
|
||||
*b:ale_bib_bibclean_executable*
|
||||
bib_bibclean_executable
|
||||
g:ale_bib_bibclean_executable
|
||||
Type: |String|
|
||||
Default: `'bibclean'`
|
||||
|
||||
g:ale_bib_bibclean_options *g:ale_bib_bibclean_options*
|
||||
|
||||
*ale-options.bib_bibclean_options*
|
||||
*g:ale_bib_bibclean_options*
|
||||
*b:ale_bib_bibclean_options*
|
||||
bib_bibclean_options
|
||||
g:ale_bib_bibclean_options
|
||||
Type: |String|
|
||||
Default: `'-align-equals'`
|
||||
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
|
||||
@@ -1,20 +1,25 @@
|
||||
===============================================================================
|
||||
ALE Bicep Integration *ale-bicep-options*
|
||||
ALE Bicep Integration *ale-bicep-options*
|
||||
|
||||
|
||||
===============================================================================
|
||||
bicep *ale-bicep-bicep*
|
||||
bicep *ale-bicep-bicep*
|
||||
|
||||
g:ale_bicep_bicep_executable *g:ale_bicep_bicep_executable*
|
||||
*b:ale_bicep_bicep_executable*
|
||||
*ale-options.bicep_bicep_executable*
|
||||
*g:ale_bicep_bicep_executable*
|
||||
*b:ale_bicep_bicep_executable*
|
||||
bicep_bicep_executable
|
||||
g:ale_bicep_bicep_executable
|
||||
Type: |String|
|
||||
Default: `'bicep'`
|
||||
|
||||
This variable can be set to change the path to bicep.
|
||||
|
||||
|
||||
g:ale_bicep_bicep_options *g:ale_bicep_bicep_options*
|
||||
*b:ale_bicep_bicep_options*
|
||||
*ale-options.bicep_bicep_options*
|
||||
*g:ale_bicep_bicep_options*
|
||||
*b:ale_bicep_bicep_options*
|
||||
bicep_bicep_options
|
||||
g:ale_bicep_bicep_options
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
@@ -22,22 +27,28 @@ g:ale_bicep_bicep_options *g:ale_bicep_bicep_options*
|
||||
|
||||
|
||||
===============================================================================
|
||||
az_bicep *ale-bicep-az_bicep*
|
||||
az_bicep *ale-bicep-az_bicep*
|
||||
|
||||
g:ale_bicep_az_bicep_executable *g:ale_bicep_az_bicep_executable*
|
||||
*b:ale_bicep_az_bicep_executable*
|
||||
*ale-options.bicep_az_bicep_executable*
|
||||
*g:ale_bicep_az_bicep_executable*
|
||||
*b:ale_bicep_az_bicep_executable*
|
||||
bicep_az_bicep_executable
|
||||
g:ale_bicep_az_bicep_executable
|
||||
Type: |String|
|
||||
Default: `'az'`
|
||||
|
||||
This variable can be set to change the path to az_bicep.
|
||||
|
||||
|
||||
g:ale_bicep_az_bicep_options *g:ale_bicep_az_bicep_options*
|
||||
*b:ale_bicep_az_bicep_options*
|
||||
*ale-options.bicep_az_bicep_options*
|
||||
*g:ale_bicep_az_bicep_options*
|
||||
*b:ale_bicep_az_bicep_options*
|
||||
bicep_az_bicep_options
|
||||
g:ale_bicep_az_bicep_options
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
This variable can be set to pass additional options to az_bicep.
|
||||
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
|
||||
32
doc/ale-bindzone.txt
Normal file
32
doc/ale-bindzone.txt
Normal file
@@ -0,0 +1,32 @@
|
||||
===============================================================================
|
||||
ALE BINDZone Integration *ale-bindzone-options*
|
||||
|
||||
===============================================================================
|
||||
checkzone *ale-bindzone-checkzone*
|
||||
|
||||
*ale-options.bindzone_checkzone_executable*
|
||||
*g:ale_bindzone_checkzone_executable*
|
||||
*b:ale_bindzone_checkzone_executable*
|
||||
bindzone_checkzone_executable
|
||||
g:ale_bindzone_checkzone_executable
|
||||
Type: |String|
|
||||
Default: `named-checkzone`
|
||||
|
||||
This variable can be changed to set the path to named-checkzone executable.
|
||||
|
||||
*ale-options.bindzone_checkzone_options*
|
||||
*g:ale_bindzone_checkzone_options*
|
||||
*b:ale_bindzone_checkzone_options*
|
||||
bindzone_checkzone_options
|
||||
g:ale_bindzone_checkzone_options
|
||||
Type: |String|
|
||||
Default: `-c IN`
|
||||
|
||||
This variable can be changed to add additional command-line arguments.
|
||||
All available options can be found at:
|
||||
|
||||
https://bind9.readthedocs.io/en/stable/manpages.html#named-checkzone-zone-file-validation-tool
|
||||
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
@@ -5,22 +5,31 @@ ALE BitBake Integration *ale-bitbake-options*
|
||||
===============================================================================
|
||||
oelint-adv *ale-bitbake-oelint_adv*
|
||||
|
||||
g:ale_bitbake_oelint_adv_executable *g:ale_bitbake_oelint_adv_executable*
|
||||
*ale-options.bitbake_oelint_adv_executable*
|
||||
*g:ale_bitbake_oelint_adv_executable*
|
||||
*b:ale_bitbake_oelint_adv_executable*
|
||||
bitbake_oelint_adv_executable
|
||||
g:ale_bitbake_oelint_adv_executable
|
||||
|
||||
Type: |String|
|
||||
Default: `'oelint-adv'`
|
||||
|
||||
This variable can be changed to use a different executable for oelint-adv.
|
||||
|
||||
g:ale_bitbake_oelint_adv_options *g:ale_bitbake_oelint_adv_options*
|
||||
|
||||
*ale-options.bitbake_oelint_adv_options*
|
||||
*g:ale_bitbake_oelint_adv_options*
|
||||
*b:ale_bitbake_oelint_adv_options*
|
||||
bitbake_oelint_adv_options
|
||||
g:ale_bitbake_oelint_adv_options
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
This variable can be set to pass additional options to oelint-adv.
|
||||
|
||||
g:ale_bitbake_oelint_adv_config *g:ale_bitbake_oelint_adv_config*
|
||||
|
||||
*ale-options.bitbake_oelint_adv_config*
|
||||
*g:ale_bitbake_oelint_adv_config*
|
||||
*b:ale_bitbake_oelint_adv_config*
|
||||
g:ale_bitbake_oelint_adv_config
|
||||
Type: |String|
|
||||
Default: `'.oelint.cfg'`
|
||||
|
||||
|
||||
245
doc/ale-c.txt
245
doc/ale-c.txt
@@ -7,9 +7,11 @@ runs either `clang`, or `gcc`. See |ale-c-cc|.
|
||||
|
||||
===============================================================================
|
||||
Global Options
|
||||
|
||||
g:ale_c_always_make *g:ale_c_always_make*
|
||||
*ale-options.c_always_make*
|
||||
*g:ale_c_always_make*
|
||||
*b:ale_c_always_make*
|
||||
c_always_make
|
||||
g:ale_c_always_make
|
||||
Type: |Number|
|
||||
Default: `has('unix') && !has('macunix')`
|
||||
|
||||
@@ -18,12 +20,13 @@ g:ale_c_always_make *g:ale_c_always_make*
|
||||
support this option, so you probably want to turn this option off when using
|
||||
a BSD variant.
|
||||
|
||||
|
||||
g:ale_c_build_dir_names *g:ale_c_build_dir_names*
|
||||
*ale-options.c_build_dir_names*
|
||||
*g:ale_c_build_dir_names*
|
||||
*b:ale_c_build_dir_names*
|
||||
|
||||
c_build_dir_names
|
||||
g:ale_c_build_dir_names
|
||||
Type: |List|
|
||||
Default: `['build', 'bin']`
|
||||
Default: `['build', 'build/Debug', 'build/Release', 'bin']`
|
||||
|
||||
A list of directory names to be used when searching upwards from C files
|
||||
to discover compilation databases with. For directory named `'foo'`, ALE
|
||||
@@ -32,10 +35,11 @@ g:ale_c_build_dir_names *g:ale_c_build_dir_names*
|
||||
database. This feature is useful for the clang tools wrapped around
|
||||
LibTooling (namely here, clang-tidy)
|
||||
|
||||
|
||||
g:ale_c_build_dir *g:ale_c_build_dir*
|
||||
*ale-options.c_build_dir*
|
||||
*g:ale_c_build_dir*
|
||||
*b:ale_c_build_dir*
|
||||
|
||||
c_build_dir
|
||||
g:ale_c_build_dir
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
@@ -47,9 +51,11 @@ g:ale_c_build_dir *g:ale_c_build_dir*
|
||||
|
||||
This directory will be searched instead of |g:ale_c_build_dir_names|.
|
||||
|
||||
|
||||
g:ale_c_parse_compile_commands *g:ale_c_parse_compile_commands*
|
||||
*ale-options.c_parse_compile_commands*
|
||||
*g:ale_c_parse_compile_commands*
|
||||
*b:ale_c_parse_compile_commands*
|
||||
c_parse_compile_commands
|
||||
g:ale_c_parse_compile_commands
|
||||
Type: |Number|
|
||||
Default: `1`
|
||||
|
||||
@@ -59,9 +65,11 @@ g:ale_c_parse_compile_commands *g:ale_c_parse_compile_commands*
|
||||
`compile_commands.json` files in the directories for
|
||||
|g:ale_c_build_dir_names|.
|
||||
|
||||
|
||||
g:ale_c_parse_makefile *g:ale_c_parse_makefile*
|
||||
*ale-options.c_parse_makefile*
|
||||
*g:ale_c_parse_makefile*
|
||||
*b:ale_c_parse_makefile*
|
||||
c_parse_makefile
|
||||
g:ale_c_parse_makefile
|
||||
Type: |Number|
|
||||
Default: `0`
|
||||
|
||||
@@ -91,16 +99,21 @@ g:ale_c_parse_makefile *g:ale_c_parse_makefile*
|
||||
===============================================================================
|
||||
astyle *ale-c-astyle*
|
||||
|
||||
g:ale_c_astyle_executable *g:ale_c_astyle_executable*
|
||||
*ale-options.c_astyle_executable*
|
||||
*g:ale_c_astyle_executable*
|
||||
*b:ale_c_astyle_executable*
|
||||
c_astyle_executable
|
||||
g:ale_c_astyle_executable
|
||||
Type: |String|
|
||||
Default: `'astyle'`
|
||||
|
||||
This variable can be changed to use a different executable for astyle.
|
||||
|
||||
|
||||
g:ale_c_astyle_project_options *g:ale_c_astyle_project_options*
|
||||
*ale-options.c_astyle_project_options*
|
||||
*g:ale_c_astyle_project_options*
|
||||
*b:ale_c_astyle_project_options*
|
||||
c_astyle_project_options
|
||||
g:ale_c_astyle_project_options
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
@@ -117,8 +130,11 @@ cc *ale-c-cc*
|
||||
*ale-c-gcc*
|
||||
*ale-c-clang*
|
||||
|
||||
g:ale_c_cc_executable *g:ale_c_cc_executable*
|
||||
*ale-options.c_cc_executable*
|
||||
*g:ale_c_cc_executable*
|
||||
*b:ale_c_cc_executable*
|
||||
c_cc_executable
|
||||
g:ale_c_cc_executable
|
||||
Type: |String|
|
||||
Default: `'<auto>'`
|
||||
|
||||
@@ -127,17 +143,21 @@ g:ale_c_cc_executable *g:ale_c_cc_executable*
|
||||
ALE will try to use `clang` if Clang is available, otherwise ALE will
|
||||
default to checking C code with `gcc`.
|
||||
|
||||
|
||||
g:ale_c_cc_options *g:ale_c_cc_options*
|
||||
*ale-options.c_cc_options*
|
||||
*g:ale_c_cc_options*
|
||||
*b:ale_c_cc_options*
|
||||
c_cc_options
|
||||
g:ale_c_cc_options
|
||||
Type: |String|
|
||||
Default: `'-std=c11 -Wall'`
|
||||
|
||||
This variable can be changed to modify flags given to the C compiler.
|
||||
|
||||
|
||||
g:ale_c_cc_use_header_lang_flag *g:ale_c_cc_use_header_lang_flag*
|
||||
*ale-options.c_cc_use_header_lang_flag*
|
||||
*g:ale_c_cc_use_header_lang_flag*
|
||||
*b:ale_c_cc_use_header_lang_flag*
|
||||
c_cc_use_header_lang_flag
|
||||
g:ale_c_cc_use_header_lang_flag
|
||||
Type: |Number|
|
||||
Default: `-1`
|
||||
|
||||
@@ -158,9 +178,11 @@ g:ale_c_cc_use_header_lang_flag *g:ale_c_cc_use_header_lang_flag*
|
||||
which is what ALE does. This why, by default, ALE only uses `'-x c-header'`
|
||||
with Clang.
|
||||
|
||||
|
||||
g:ale_c_cc_header_exts *g:ale_c_cc_header_exts*
|
||||
*ale-options.c_cc_header_exts*
|
||||
*g:ale_c_cc_header_exts*
|
||||
*b:ale_c_cc_header_exts*
|
||||
c_cc_header_exts
|
||||
g:ale_c_cc_header_exts
|
||||
Type: |List|
|
||||
Default: `['h']`
|
||||
|
||||
@@ -174,29 +196,35 @@ g:ale_c_cc_header_exts *g:ale_c_cc_header_exts*
|
||||
===============================================================================
|
||||
ccls *ale-c-ccls*
|
||||
|
||||
g:ale_c_ccls_executable *g:ale_c_ccls_executable*
|
||||
*ale-options.c_ccls_executable*
|
||||
*g:ale_c_ccls_executable*
|
||||
*b:ale_c_ccls_executable*
|
||||
c_ccls_executable
|
||||
g:ale_c_ccls_executable
|
||||
Type: |String|
|
||||
Default: `'ccls'`
|
||||
|
||||
This variable can be changed to use a different executable for ccls.
|
||||
|
||||
|
||||
g:ale_c_ccls_init_options *g:ale_c_ccls_init_options*
|
||||
*ale-options.c_ccls_init_options*
|
||||
*g:ale_c_ccls_init_options*
|
||||
*b:ale_c_ccls_init_options*
|
||||
c_ccls_init_options
|
||||
g:ale_c_ccls_init_options
|
||||
Type: |Dictionary|
|
||||
Default: `{}`
|
||||
|
||||
This variable can be changed to customize ccls initialization options.
|
||||
Example: >
|
||||
{
|
||||
\ 'cacheDirectory': '/tmp/ccls',
|
||||
\ 'cacheFormat': 'binary',
|
||||
\ 'diagnostics': {
|
||||
\ 'onOpen': 0,
|
||||
\ 'opChange': 1000,
|
||||
\ },
|
||||
\ }
|
||||
For example: >
|
||||
|
||||
let g:ale_c_ccls_init_options = {
|
||||
\ 'cacheDirectory': '/tmp/ccls',
|
||||
\ 'cacheFormat': 'binary',
|
||||
\ 'diagnostics': {
|
||||
\ 'onOpen': 0,
|
||||
\ 'opChange': 1000,
|
||||
\ },
|
||||
\}
|
||||
<
|
||||
For all available options and explanations, visit
|
||||
https://github.com/MaskRay/ccls/wiki/Customization#initialization-options.
|
||||
@@ -213,16 +241,23 @@ Therefore, `clang-check` linter reads the options |g:ale_c_build_dir| and
|
||||
overrides |g:ale_c_build_dir_names|.
|
||||
|
||||
|
||||
g:ale_c_clangcheck_executable *g:ale_c_clangcheck_executable*
|
||||
-------------------------------------------------------------------------------
|
||||
Options
|
||||
*ale-options.c_clangcheck_executable*
|
||||
*g:ale_c_clangcheck_executable*
|
||||
*b:ale_c_clangcheck_executable*
|
||||
c_clangcheck_executable
|
||||
g:ale_c_clangcheck_executable
|
||||
Type: |String|
|
||||
Default: `'clang-check'`
|
||||
|
||||
This variable can be changed to use a different executable for clangcheck.
|
||||
|
||||
|
||||
g:ale_c_clangcheck_options *g:ale_c_clangcheck_options*
|
||||
*ale-options.c_clangcheck_options*
|
||||
*g:ale_c_clangcheck_options*
|
||||
*b:ale_c_clangcheck_options*
|
||||
c_clangcheck_options
|
||||
g:ale_c_clangcheck_options
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
@@ -236,16 +271,21 @@ g:ale_c_clangcheck_options *g:ale_c_clangcheck_options*
|
||||
===============================================================================
|
||||
clangd *ale-c-clangd*
|
||||
|
||||
g:ale_c_clangd_executable *g:ale_c_clangd_executable*
|
||||
*ale-options.c_clangd_executable*
|
||||
*g:ale_c_clangd_executable*
|
||||
*b:ale_c_clangd_executable*
|
||||
c_clangd_executable
|
||||
g:ale_c_clangd_executable
|
||||
Type: |String|
|
||||
Default: `'clangd'`
|
||||
|
||||
This variable can be changed to use a different executable for clangd.
|
||||
|
||||
|
||||
g:ale_c_clangd_options *g:ale_c_clangd_options*
|
||||
*ale-options.c_clangd_options*
|
||||
*g:ale_c_clangd_options*
|
||||
*b:ale_c_clangd_options*
|
||||
c_clangd_options
|
||||
g:ale_c_clangd_options
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
@@ -255,24 +295,31 @@ g:ale_c_clangd_options *g:ale_c_clangd_options*
|
||||
===============================================================================
|
||||
clang-format *ale-c-clangformat*
|
||||
|
||||
g:ale_c_clangformat_executable *g:ale_c_clangformat_executable*
|
||||
*ale-options.c_clangformat_executable*
|
||||
*g:ale_c_clangformat_executable*
|
||||
*b:ale_c_clangformat_executable*
|
||||
c_clangformat_executable
|
||||
g:ale_c_clangformat_executable
|
||||
Type: |String|
|
||||
Default: `'clang-format'`
|
||||
|
||||
This variable can be changed to use a different executable for clang-format.
|
||||
|
||||
|
||||
g:ale_c_clangformat_options *g:ale_c_clangformat_options*
|
||||
*ale-options.c_clangformat_options*
|
||||
*g:ale_c_clangformat_options*
|
||||
*b:ale_c_clangformat_options*
|
||||
c_clangformat_options
|
||||
g:ale_c_clangformat_options
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
This variable can be changed to modify flags given to clang-format.
|
||||
|
||||
|
||||
g:ale_c_clangformat_style_option *g:ale_c_clangformat_style_option*
|
||||
*ale-options.c_clangformat_style_option*
|
||||
*g:ale_c_clangformat_style_option*
|
||||
*b:ale_c_clangformat_style_option*
|
||||
c_clangformat_style_option
|
||||
g:ale_c_clangformat_style_option
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
@@ -281,19 +328,21 @@ g:ale_c_clangformat_style_option *g:ale_c_clangformat_style_option*
|
||||
flag of clang-format.
|
||||
|
||||
Example: >
|
||||
{
|
||||
\ BasedOnStyle: Microsoft,
|
||||
\ ColumnLimit: 80,
|
||||
\ AllowShortBlocksOnASingleLine: Always,
|
||||
\ AllowShortFunctionsOnASingleLine: Inline,
|
||||
\ }
|
||||
let g:ale_c_clangformat_style_option = {
|
||||
\ 'BasedOnStyle': 'Microsoft',
|
||||
\ 'ColumnLimit': 80,
|
||||
\ 'AllowShortBlocksOnASingleLine': 'Always',
|
||||
\ 'AllowShortFunctionsOnASingleLine': 'Inline',
|
||||
\}
|
||||
<
|
||||
If you set this variable, ensure you don't modify -style in
|
||||
|g:ale_c_clangformat_options|, as this will cause clang-format to error.
|
||||
|
||||
|
||||
g:ale_c_clangformat_use_local_file *g:ale_c_clangformat_use_local_file*
|
||||
*ale-options.c_clangformat_use_local_file*
|
||||
*g:ale_c_clangformat_use_local_file*
|
||||
*b:ale_c_clangformat_use_local_file*
|
||||
c_clangformat_use_local_file
|
||||
g:ale_c_clangformat_use_local_file
|
||||
Type: |Number|
|
||||
Default: `0`
|
||||
|
||||
@@ -320,8 +369,13 @@ Therefore, `clang-tidy` linter reads the options |g:ale_c_build_dir| and
|
||||
overrides |g:ale_c_build_dir_names|.
|
||||
|
||||
|
||||
g:ale_c_clangtidy_checks *g:ale_c_clangtidy_checks*
|
||||
-------------------------------------------------------------------------------
|
||||
Options
|
||||
*ale-options.c_clangtidy_checks*
|
||||
*g:ale_c_clangtidy_checks*
|
||||
*b:ale_c_clangtidy_checks*
|
||||
c_clangtidy_checks
|
||||
g:ale_c_clangtidy_checks
|
||||
Type: |List|
|
||||
Default: `[]`
|
||||
|
||||
@@ -335,17 +389,21 @@ g:ale_c_clangtidy_checks *g:ale_c_clangtidy_checks*
|
||||
clang documentation for an up-to-date list of compatible checks:
|
||||
http://clang.llvm.org/extra/clang-tidy/checks/list.html
|
||||
|
||||
|
||||
g:ale_c_clangtidy_executable *g:ale_c_clangtidy_executable*
|
||||
*ale-options.c_clangtidy_executable*
|
||||
*g:ale_c_clangtidy_executable*
|
||||
*b:ale_c_clangtidy_executable*
|
||||
c_clangtidy_executable
|
||||
g:ale_c_clangtidy_executable
|
||||
Type: |String|
|
||||
Default: `'clang-tidy'`
|
||||
|
||||
This variable can be changed to use a different executable for clangtidy.
|
||||
|
||||
|
||||
g:ale_c_clangtidy_options *g:ale_c_clangtidy_options*
|
||||
*ale-options.c_clangtidy_options*
|
||||
*g:ale_c_clangtidy_options*
|
||||
*b:ale_c_clangtidy_options*
|
||||
c_clangtidy_options
|
||||
g:ale_c_clangtidy_options
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
@@ -361,17 +419,21 @@ g:ale_c_clangtidy_options *g:ale_c_clangtidy_options*
|
||||
entirely manually, and no `compile_commands.json` file is in one
|
||||
of the |g:ale_c_build_dir_names| directories of the project tree.
|
||||
|
||||
|
||||
g:ale_c_clangtidy_extra_options *g:ale_c_clangtidy_extra_options*
|
||||
*ale-options.c_clangtidy_extra_options*
|
||||
*g:ale_c_clangtidy_extra_options*
|
||||
*b:ale_c_clangtidy_extra_options*
|
||||
c_clangtidy_extra_options
|
||||
g:ale_c_clangtidy_extra_options
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
This variable can be changed to modify flags given to clang-tidy.
|
||||
|
||||
|
||||
g:ale_c_clangtidy_fix_errors *g:ale_c_clangtidy_fix_errors*
|
||||
*ale-options.c_clangtidy_fix_errors*
|
||||
*g:ale_c_clangtidy_fix_errors*
|
||||
*b:ale_c_clangtidy_fix_errors*
|
||||
c_clangtidy_fix_errors
|
||||
g:ale_c_clangtidy_fix_errors
|
||||
Type: |Number|
|
||||
Default: `1`
|
||||
|
||||
@@ -382,16 +444,21 @@ g:ale_c_clangtidy_fix_errors *g:ale_c_clangtidy_fix_errors*
|
||||
===============================================================================
|
||||
cppcheck *ale-c-cppcheck*
|
||||
|
||||
g:ale_c_cppcheck_executable *g:ale_c_cppcheck_executable*
|
||||
*ale-options.c_cppcheck_executable*
|
||||
*g:ale_c_cppcheck_executable*
|
||||
*b:ale_c_cppcheck_executable*
|
||||
c_cppcheck_executable
|
||||
g:ale_c_cppcheck_executable
|
||||
Type: |String|
|
||||
Default: `'cppcheck'`
|
||||
|
||||
This variable can be changed to use a different executable for cppcheck.
|
||||
|
||||
|
||||
g:ale_c_cppcheck_options *g:ale_c_cppcheck_options*
|
||||
*ale-options.c_cppcheck_options*
|
||||
*g:ale_c_cppcheck_options*
|
||||
*b:ale_c_cppcheck_options*
|
||||
c_cppcheck_options
|
||||
g:ale_c_cppcheck_options
|
||||
Type: |String|
|
||||
Default: `'--enable=style'`
|
||||
|
||||
@@ -401,21 +468,26 @@ g:ale_c_cppcheck_options *g:ale_c_cppcheck_options*
|
||||
===============================================================================
|
||||
cquery *ale-c-cquery*
|
||||
|
||||
g:ale_c_cquery_executable *g:ale_c_cquery_executable*
|
||||
*ale-options.c_cquery_executable*
|
||||
*g:ale_c_cquery_executable*
|
||||
*b:ale_c_cquery_executable*
|
||||
c_cquery_executable
|
||||
g:ale_c_cquery_executable
|
||||
Type: |String|
|
||||
Default: `'cquery'`
|
||||
|
||||
This variable can be changed to use a different executable for cquery.
|
||||
|
||||
|
||||
g:ale_c_cquery_cache_directory *g:ale_c_cquery_cache_directory*
|
||||
*ale-options.c_cquery_cache_directory*
|
||||
*g:ale_c_cquery_cache_directory*
|
||||
*b:ale_c_cquery_cache_directory*
|
||||
c_cquery_cache_directory
|
||||
g:ale_c_cquery_cache_directory
|
||||
Type: |String|
|
||||
Default: `'~/.cache/cquery'`
|
||||
|
||||
This variable can be changed to decide which directory cquery uses for its
|
||||
cache.
|
||||
cache.
|
||||
|
||||
|
||||
===============================================================================
|
||||
@@ -427,31 +499,41 @@ See |ale-cspell-options|
|
||||
===============================================================================
|
||||
flawfinder *ale-c-flawfinder*
|
||||
|
||||
g:ale_c_flawfinder_executable *g:ale_c_flawfinder_executable*
|
||||
*ale-options.c_flawfinder_executable*
|
||||
*g:ale_c_flawfinder_executable*
|
||||
*b:ale_c_flawfinder_executable*
|
||||
c_flawfinder_executable
|
||||
g:ale_c_flawfinder_executable
|
||||
Type: |String|
|
||||
Default: `'flawfinder'`
|
||||
|
||||
This variable can be changed to use a different executable for flawfinder.
|
||||
|
||||
|
||||
g:ale_c_flawfinder_minlevel *g:ale_c_flawfinder_minlevel*
|
||||
*ale-options.c_flawfinder_minlevel*
|
||||
*g:ale_c_flawfinder_minlevel*
|
||||
*b:ale_c_flawfinder_minlevel*
|
||||
c_flawfinder_minlevel
|
||||
g:ale_c_flawfinder_minlevel
|
||||
Type: |Number|
|
||||
Default: `1`
|
||||
|
||||
This variable can be changed to ignore risks under the given risk threshold.
|
||||
|
||||
|
||||
g:ale_c_flawfinder_options *g:ale-c-flawfinder*
|
||||
*ale-options.c_flawfinder_options*
|
||||
*g:ale_c_flawfinder_options*
|
||||
*b:ale-c-flawfinder*
|
||||
c_flawfinder_options
|
||||
g:ale_c_flawfinder_options
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
This variable can be used to pass extra options into the flawfinder command.
|
||||
|
||||
g:ale_c_flawfinder_error_severity *g:ale_c_flawfinder_error_severity*
|
||||
*ale-options.c_flawfinder_error_severity*
|
||||
*g:ale_c_flawfinder_error_severity*
|
||||
*b:ale_c_flawfinder_error_severity*
|
||||
c_flawfinder_error_severity
|
||||
g:ale_c_flawfinder_error_severity
|
||||
Type: |Number|
|
||||
Default: `6`
|
||||
|
||||
@@ -462,16 +544,21 @@ g:ale_c_flawfinder_error_severity *g:ale_c_flawfinder_error_severity*
|
||||
===============================================================================
|
||||
uncrustify *ale-c-uncrustify*
|
||||
|
||||
g:ale_c_uncrustify_executable *g:ale_c_uncrustify_executable*
|
||||
*ale-options.c_uncrustify_executable*
|
||||
*g:ale_c_uncrustify_executable*
|
||||
*b:ale_c_uncrustify_executable*
|
||||
c_uncrustify_executable
|
||||
g:ale_c_uncrustify_executable
|
||||
Type: |String|
|
||||
Default: `'uncrustify'`
|
||||
|
||||
This variable can be changed to use a different executable for uncrustify.
|
||||
|
||||
|
||||
g:ale_c_uncrustify_options *g:ale_c_uncrustify_options*
|
||||
*ale-options.c_uncrustify_options*
|
||||
*g:ale_c_uncrustify_options*
|
||||
*b:ale_c_uncrustify_options*
|
||||
c_uncrustify_options
|
||||
g:ale_c_uncrustify_options
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
|
||||
@@ -4,26 +4,32 @@ ALE C3 Integration *ale-c3-options*
|
||||
===============================================================================
|
||||
c3lsp *ale-c3-c3lsp*
|
||||
|
||||
g:ale_c3_c3lsp_executable *g:ale_c3_c3lsp_executable*
|
||||
*ale-options.c3_c3lsp_executable*
|
||||
*g:ale_c3_c3lsp_executable*
|
||||
*b:ale_c3_c3lsp_executable*
|
||||
c3_c3lsp_executable
|
||||
g:ale_c3_c3lsp_executable
|
||||
Type: |String|
|
||||
Default: `c3lsp`
|
||||
|
||||
This variable can be changed to set the path to c3lsp executable.
|
||||
|
||||
|
||||
g:ale_c3_c3lsp_options *g:ale_c3_c3lsp_options*
|
||||
*ale-options.c3_c3lsp_options*
|
||||
*g:ale_c3_c3lsp_options*
|
||||
*b:ale_c3_c3lsp_options*
|
||||
|
||||
c3_c3lsp_options
|
||||
g:ale_c3_c3lsp_options
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
Add command line options to the c3lsp executable. This is useful to specify
|
||||
the path to the C3 standard library with '-stdlib-path=<path>'.
|
||||
|
||||
|
||||
g:ale_c3_c3lsp_init_options *g:ale_c3_c3lsp_init_options*
|
||||
*ale-options.c3_c3lsp_init_options*
|
||||
*g:ale_c3_c3lsp_init_options*
|
||||
*b:ale_c3_c3lsp_init_options*
|
||||
c3_c3lsp_init_options
|
||||
g:ale_c3_c3lsp_init_options
|
||||
Type: |Dictionary|
|
||||
Default: `{}`
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user