mirror of
https://github.com/dense-analysis/ale.git
synced 2026-06-15 04:00:45 +08:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c849345a8d | |||
| 014c959fee | |||
| 520c775c6a | |||
| 7f79d30fb9 |
@@ -0,0 +1,62 @@
|
||||
---
|
||||
# Disabling building for AppVeyor. We are just testing things.
|
||||
build: false
|
||||
clone_depth: 10
|
||||
# Use the directory C:\testplugin so test directories will mostly work.
|
||||
clone_folder: C:\testplugin
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- /v\d+\.\d+\.(x|\d+)/
|
||||
|
||||
# Skip running Windows tests if we only change files that can't impact
|
||||
# Windows tests.
|
||||
skip_commits:
|
||||
files:
|
||||
- '.github/**/*'
|
||||
- .gitattributes
|
||||
- Dockerfile
|
||||
- README.md
|
||||
- doc/*
|
||||
- lua/*
|
||||
- run-tests
|
||||
- supported-tools.md
|
||||
- syntax/*
|
||||
|
||||
# Cache the vim and vader directories between builds.
|
||||
cache:
|
||||
- C:\vim -> .appveyor.yml
|
||||
- C:\vader -> .appveyor.yml
|
||||
|
||||
init:
|
||||
# Stop git from changing newlines
|
||||
- git config --global core.autocrlf input
|
||||
|
||||
# NOTE: If you change the Vim or Vader versions here, please also update the
|
||||
# instructions for running tests on Windows in ale-development.txt
|
||||
|
||||
install:
|
||||
# Download and unpack Vim
|
||||
- ps: >-
|
||||
if (!(Test-Path -Path C:\vim)){
|
||||
Add-Type -A System.IO.Compression.FileSystem
|
||||
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 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')
|
||||
}
|
||||
# Clone Vader and check out the commit we want
|
||||
- ps: >-
|
||||
if (!(Test-Path -Path C:\vader)){
|
||||
git clone https://github.com/junegunn/vader.vim C:\vader 2> $null
|
||||
cd C:\vader
|
||||
git checkout -qf c6243dd81c98350df4dec608fa972df98fa2a3af 2> $null
|
||||
}
|
||||
|
||||
test_script:
|
||||
- cd C:\testplugin
|
||||
- 'C:\vim\vim\vim80\vim.exe -u test\vimrc "+Vader!
|
||||
test/*.vader test/*/*.vader test/*/*/*.vader test/*/*/*.vader"'
|
||||
@@ -1,9 +0,0 @@
|
||||
# Project-local Codex configuration.
|
||||
#
|
||||
# Command safety policy lives in .codex/rules/git-state.rules.
|
||||
|
||||
[[hooks.Stop]]
|
||||
[[hooks.Stop.hooks]]
|
||||
type = "command"
|
||||
command = "cat >> .codex/stop-trigger"
|
||||
timeout = 1
|
||||
@@ -1,90 +0,0 @@
|
||||
# Forbid Codex from changing Git repository state in this project.
|
||||
#
|
||||
# Read-only Git inspection, such as `git status`, `git diff`, `git log`, and
|
||||
# `git show`, is intentionally not matched by this policy.
|
||||
|
||||
prefix_rule(
|
||||
pattern = ["git", [
|
||||
"add",
|
||||
"am",
|
||||
"apply",
|
||||
"bisect",
|
||||
"branch",
|
||||
"checkout",
|
||||
"cherry-pick",
|
||||
"clean",
|
||||
"commit",
|
||||
"fetch",
|
||||
"merge",
|
||||
"mv",
|
||||
"notes",
|
||||
"pull",
|
||||
"push",
|
||||
"rebase",
|
||||
"reflog",
|
||||
"replace",
|
||||
"reset",
|
||||
"restore",
|
||||
"revert",
|
||||
"rm",
|
||||
"stash",
|
||||
"submodule",
|
||||
"switch",
|
||||
"tag",
|
||||
"update-index",
|
||||
"update-ref",
|
||||
"worktree",
|
||||
]],
|
||||
decision = "forbidden",
|
||||
justification = "Git commands that change the index, refs, branches, remotes, commits, or working tree are reserved for the user.",
|
||||
match = [
|
||||
"git add .",
|
||||
"git commit -m test",
|
||||
"git pull --rebase",
|
||||
"git reset --hard HEAD",
|
||||
"git restore --staged AGENTS.md",
|
||||
],
|
||||
not_match = [
|
||||
"git diff -- AGENTS.md",
|
||||
"git log --oneline -5",
|
||||
"git show HEAD",
|
||||
"git status --short",
|
||||
],
|
||||
)
|
||||
|
||||
prefix_rule(
|
||||
pattern = ["git", [
|
||||
"-C",
|
||||
"-c",
|
||||
"--bare",
|
||||
"--config-env",
|
||||
"--exec-path",
|
||||
"--git-dir",
|
||||
"--git-dir=.git",
|
||||
"--git-dir=/home/w0rp/ale/.git",
|
||||
"--namespace",
|
||||
"--no-optional-locks",
|
||||
"--no-pager",
|
||||
"--paginate",
|
||||
"-P",
|
||||
"--super-prefix",
|
||||
"--work-tree",
|
||||
"--work-tree=.",
|
||||
"--work-tree=/home/w0rp/ale",
|
||||
]],
|
||||
decision = "forbidden",
|
||||
justification = "Git global options can obscure or bypass repository state changes; run read-only Git commands from the repository root instead.",
|
||||
match = [
|
||||
"git -C /home/w0rp/ale status --short",
|
||||
"git --git-dir .git status",
|
||||
"git --git-dir=.git status",
|
||||
"git --no-pager add .",
|
||||
"git --work-tree . status",
|
||||
],
|
||||
not_match = [
|
||||
"git diff -- AGENTS.md",
|
||||
"git log --oneline -5",
|
||||
"git show HEAD",
|
||||
"git status --short",
|
||||
],
|
||||
)
|
||||
@@ -1 +0,0 @@
|
||||
* @w0rp
|
||||
+10
-60
@@ -11,10 +11,9 @@ on: # yamllint disable-line rule:truthy
|
||||
|
||||
jobs:
|
||||
build_image:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/checkout@v4
|
||||
- name: Build docker run image
|
||||
shell: bash
|
||||
env:
|
||||
@@ -22,67 +21,18 @@ jobs:
|
||||
DOCKER_HUB_PASS: ${{ secrets.DOCKER_HUB_PASS }}
|
||||
run: ./run-tests --build-image
|
||||
test_ale:
|
||||
name: ${{ matrix.name }}
|
||||
needs: build_image
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- name: Lint
|
||||
test-args: --linters-only
|
||||
- name: Lua
|
||||
test-args: --lua-only
|
||||
- name: Neovim 0.10 Linux
|
||||
test-args: --neovim-010-only
|
||||
- name: Neovim 0.12 Linux
|
||||
test-args: --neovim-012-only
|
||||
- name: Vim 8.2 Linux
|
||||
test-args: --vim-82-only
|
||||
- name: Vim 9.2 Linux
|
||||
test-args: --vim-92-only
|
||||
vim-version:
|
||||
- '--vim-80-only'
|
||||
- '--vim-90-only'
|
||||
- '--neovim-07-only'
|
||||
- '--neovim-08-only'
|
||||
- '--lua-only'
|
||||
- '--linters-only'
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions/checkout@v4
|
||||
- name: Run tests
|
||||
run: ./run-tests -v ${{ matrix.test-args }}
|
||||
test_ale_windows:
|
||||
name: ${{ matrix.name }}
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- name: Neovim 0.10 Windows
|
||||
editor: neovim
|
||||
version: v0.10.4
|
||||
- name: Neovim 0.12 Windows
|
||||
editor: neovim
|
||||
version: v0.12.1
|
||||
- name: Vim 8.2 Windows
|
||||
editor: vim
|
||||
version: v8.2.4843
|
||||
- name: Vim 9.2 Windows
|
||||
editor: vim
|
||||
version: v9.2.0329
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Setup ${{ matrix.editor }} ${{ matrix.version }}
|
||||
uses: rhysd/action-setup-vim@v1
|
||||
id: editor
|
||||
with:
|
||||
neovim: ${{ matrix.editor == 'neovim' }}
|
||||
version: ${{ matrix.version }}
|
||||
- name: Clone Vader
|
||||
shell: cmd
|
||||
run: |
|
||||
git clone https://github.com/junegunn/vader.vim C:\vader
|
||||
git -C C:\vader checkout -qf c6243dd81c98350df4dec608fa972df98fa2a3af
|
||||
- name: Run tests
|
||||
shell: cmd
|
||||
env:
|
||||
VIM_EXE: ${{ steps.editor.outputs.executable }}
|
||||
VIM_HEADLESS: ${{ matrix.editor == 'neovim' && '--headless' || '--not-a-term' }}
|
||||
run: |
|
||||
set TMP=%CD:~0,2%\tmp
|
||||
set TEMP=%CD:~0,2%\tmp
|
||||
if not exist "%CD:~0,2%\tmp" mkdir "%CD:~0,2%\tmp"
|
||||
run-tests.bat
|
||||
run: ./run-tests -v ${{ matrix.vim-version }}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
read_globals = {
|
||||
'vim',
|
||||
}
|
||||
@@ -1,23 +1,6 @@
|
||||
# ALE Instructions
|
||||
# ALE Agent instructions
|
||||
|
||||
## Basic Instructions
|
||||
|
||||
Read documentation from @doc/ale-development.txt to understand how to be an
|
||||
ALE developer and how to match our standards.
|
||||
|
||||
Run all tests quickly with `./run-tests -q --fast`, which picks the quickest
|
||||
version of Neovim we can run, and runs our linting checks.
|
||||
|
||||
You can quickly check an individual Vader test file by passing them as arguments
|
||||
such as `./run-tests -q --fast test/path/some_file.vader`.
|
||||
|
||||
You can quickly run all Lua tests with `./run-tests -q --lua-only`.
|
||||
|
||||
|
||||
For new Vim files, set `Author:` comments to the person doing the work.
|
||||
Do not use Codex, OpenAI, or other tool names as the author.
|
||||
|
||||
## Writing Tests
|
||||
|
||||
For `test/test-files` they should almost always be 0 bytes in size and files
|
||||
may be marked executable when testing searching for executables.
|
||||
1. Read documentation from `doc/ale-development.txt` to understand how to be an
|
||||
ALE developer.
|
||||
2. Run Vader/Vim tests with `./run-tests -q --fast test/path/some_file.vader`
|
||||
3. When editing Lua code run Lua tests with `./run-tests -q --lua-only`
|
||||
|
||||
+10
-60
@@ -1,78 +1,28 @@
|
||||
#############################################################################
|
||||
# Base testbed image copied from:
|
||||
# https://github.com/Vimjas/vim-testbed/blob/master/Dockerfile
|
||||
FROM alpine:3.23 as testbed
|
||||
ARG TESTBED_VIM_VERSION=24
|
||||
|
||||
RUN apk --no-cache upgrade
|
||||
FROM testbed/vim:${TESTBED_VIM_VERSION}
|
||||
|
||||
ENV PACKAGES="\
|
||||
build-base \
|
||||
linux-headers \
|
||||
cmake \
|
||||
coreutils \
|
||||
msgpack-c-dev \
|
||||
libtermkey-dev \
|
||||
libvterm-dev \
|
||||
unibilium-dev \
|
||||
ncurses-dev \
|
||||
lua5.1 \
|
||||
lua5.1-dev \
|
||||
lua5.1-lpeg \
|
||||
lua5.1-mpack \
|
||||
lua5.1-busted \
|
||||
bash \
|
||||
git \
|
||||
grep \
|
||||
sed \
|
||||
python2 \
|
||||
python3 \
|
||||
py3-pip \
|
||||
gettext-dev \
|
||||
libuv-dev \
|
||||
libluv \
|
||||
lua-luv-dev \
|
||||
utf8proc-dev \
|
||||
vint \
|
||||
curl \
|
||||
gettext-dev \
|
||||
libtool \
|
||||
ninja \
|
||||
tree-sitter-dev \
|
||||
grep \
|
||||
sed \
|
||||
"
|
||||
|
||||
RUN apk --update add $PACKAGES && \
|
||||
rm -rf /var/cache/apk/* /tmp/* /var/tmp/*
|
||||
|
||||
RUN adduser -h /home/vimtest -s /bin/sh -D -u 8465 vimtest
|
||||
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 mkdir -p /vim /vim-build/bin /plugins
|
||||
RUN chown vimtest:vimtest /home /plugins
|
||||
|
||||
# Useful during tests to have these packages in a deeper layer cached already.
|
||||
# RUN apk --no-cache add --virtual vim-build build-base
|
||||
|
||||
ADD docker/argecho.sh /vim-build/bin/argecho
|
||||
ADD docker/install_vim.sh /sbin/install_vim
|
||||
ADD docker/run_vim.sh /sbin/run_vim
|
||||
|
||||
RUN chmod +x /vim-build/bin/argecho /sbin/install_vim /sbin/run_vim
|
||||
|
||||
# The user directory for setup
|
||||
VOLUME /home/vimtest
|
||||
|
||||
# Your plugin
|
||||
VOLUME /testplugin
|
||||
|
||||
ENTRYPOINT ["/sbin/run_vim"]
|
||||
|
||||
#############################################################################
|
||||
# ALE Test image
|
||||
#
|
||||
FROM testbed
|
||||
|
||||
RUN install_vim -tag v8.2.5172 -build \
|
||||
-tag v9.2.0329 -build \
|
||||
-tag neovim:v0.10.4 -build \
|
||||
-tag neovim:v0.12.1 -build
|
||||
RUN pip install vim-vint==0.3.21
|
||||
|
||||
RUN git clone https://github.com/junegunn/vader.vim vader && \
|
||||
cd vader && git checkout c6243dd81c98350df4dec608fa972df98fa2a3af
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
# Asynchronous Lint Engine
|
||||
|
||||
[](https://www.vim.org/) [](https://neovim.io/) [](https://github.com/dense-analysis/ale/actions?query=event%3Apush+workflow%3ACI+branch%3Amaster++) [](https://discord.gg/5zFD6pQxDk)
|
||||
[](https://www.vim.org/) [](https://neovim.io/) [](https://github.com/dense-analysis/ale/actions?query=event%3Apush+workflow%3ACI+branch%3Amaster++) [](https://ci.appveyor.com/project/dense-analysis/ale) [](https://discord.gg/5zFD6pQxDk)
|
||||
|
||||

|
||||
|
||||
ALE (Asynchronous Lint Engine) is a plugin providing linting (syntax checking
|
||||
and semantic errors) in Neovim 0.7.0+ and Vim 8.2+ while you edit your text files,
|
||||
and semantic errors) in Neovim 0.7.0+ and Vim 8.0+ while you edit your text files,
|
||||
and acts as a Vim [Language Server Protocol](https://langserver.org/) client.
|
||||
|
||||
<video autoplay="true" muted="true" loop="true" controls="false" src="https://user-images.githubusercontent.com/3518142/210141215-8f2ff760-6a87-4704-a11e-c109b8e9ec41.mp4" title="An example showing what ALE can do."></video>
|
||||
|
||||
@@ -23,7 +23,7 @@ function! ale_linters#cuda#nvcc#HandleNVCCFormat(buffer, lines) abort
|
||||
\ 'lnum': str2nr(l:match[2]),
|
||||
\ 'type': l:match[4] =~# 'error' ? 'E' : 'W',
|
||||
\ 'text': l:match[5],
|
||||
\ 'filename': ale#path#Simplify(fnamemodify(l:match[1], ':p')),
|
||||
\ 'filename': fnamemodify(l:match[1], ':p'),
|
||||
\}
|
||||
|
||||
if !empty(l:match[3])
|
||||
|
||||
@@ -87,9 +87,7 @@ function! ale_linters#d#dmd#Handle(buffer, lines) abort
|
||||
" Matches patterns lines like the following:
|
||||
" /tmp/tmp.qclsa7qLP7/file.d(1): Error: function declaration without return type. (Note that constructors are always named 'this')
|
||||
" /tmp/tmp.G1L5xIizvB.d(8,8): Error: module weak_reference is in file 'dstruct/weak_reference.d' which cannot be read
|
||||
" Use [^(]+ instead of \f+ because NeoVim's 'isfname' on Windows does
|
||||
" not include \ or :, so \f+ cannot match Windows absolute paths.
|
||||
let l:pattern = '\v^([^(]+)\((\d+)(,(\d+))?\): (\w+): (.+)$'
|
||||
let l:pattern = '\v^(\f+)\((\d+)(,(\d+))?\): (\w+): (.+)$'
|
||||
let l:output = []
|
||||
let l:dir = expand('#' . a:buffer . ':p:h')
|
||||
|
||||
|
||||
@@ -7,6 +7,6 @@ call ale#linter#Define('elixir', {
|
||||
\ 'name': 'expert',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': {b -> ale#Var(b, 'elixir_expert_executable')},
|
||||
\ 'command': '%e --stdio',
|
||||
\ 'command': '%e',
|
||||
\ 'project_root': function('ale#handlers#elixir#FindMixUmbrellaRoot'),
|
||||
\})
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
" Author: Sam Bottoni
|
||||
" Description: lilypond linter for LilyPond files
|
||||
|
||||
call ale#Set('lilypond_lilypond_executable', 'lilypond')
|
||||
|
||||
let g:ale_lilypond_lilypond_options = get(g:, 'ale_lilypond_lilypond_options', '')
|
||||
|
||||
function! ale_linters#lilypond#lilypond#GetCommand(buffer) abort
|
||||
return '%e --loglevel=WARNING -dbackend=null -dno-print-pages -o /tmp'
|
||||
\ . ale#Pad(ale#Var(a:buffer, 'lilypond_lilypond_options'))
|
||||
\ . ' %t 2>&1'
|
||||
endfunction
|
||||
|
||||
function! ale_linters#lilypond#lilypond#Handle(buffer, lines) abort
|
||||
let l:output = []
|
||||
|
||||
for l:line in a:lines
|
||||
" Match: file:line:col: error|warning|programming error: message
|
||||
let l:match = matchlist(l:line,
|
||||
\ '\v^.*:(\d+):(\d+): (error|warning|programming error): (.*)$')
|
||||
|
||||
if !empty(l:match)
|
||||
call add(l:output, {
|
||||
\ 'lnum': str2nr(l:match[1]),
|
||||
\ 'col': str2nr(l:match[2]),
|
||||
\ 'type': l:match[3] =~? 'error' ? 'E' : 'W',
|
||||
\ 'text': l:match[4]
|
||||
\})
|
||||
endif
|
||||
endfor
|
||||
|
||||
return l:output
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('lilypond', {
|
||||
\ 'name': 'lilypond',
|
||||
\ 'executable': {b -> ale#Var(b, 'lilypond_lilypond_executable')},
|
||||
\ 'command': function('ale_linters#lilypond#lilypond#GetCommand'),
|
||||
\ 'callback': 'ale_linters#lilypond#lilypond#Handle',
|
||||
\})
|
||||
@@ -1,32 +0,0 @@
|
||||
" Author: Armand Halbert <armand.halbert@gmail.com>
|
||||
" Description: Harper for Markdown files
|
||||
|
||||
call ale#Set('markdown_harper_config', {
|
||||
\ 'harper-ls': {
|
||||
\ 'diagnosticSeverity': 'hint',
|
||||
\ 'dialect': 'American',
|
||||
\ 'linters': {
|
||||
\ 'SpellCheck': v:true,
|
||||
\ 'SentenceCapitalization': v:true,
|
||||
\ 'RepeatedWords': v:true,
|
||||
\ 'LongSentences': v:true,
|
||||
\ 'AnA': v:true,
|
||||
\ 'Spaces': v:true,
|
||||
\ 'SpelledNumbers': v:false,
|
||||
\ 'WrongQuotes': v:false,
|
||||
\ },
|
||||
\ },
|
||||
\})
|
||||
|
||||
call ale#linter#Define('markdown', {
|
||||
\ 'name': 'harper',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': 'harper-ls',
|
||||
\ 'command': '%e --stdio',
|
||||
\ 'project_root': function('ale_linters#markdown#harper#GetProjectRoot'),
|
||||
\ 'lsp_config': {b -> ale#Var(b, 'markdown_harper_config')},
|
||||
\})
|
||||
|
||||
function! ale_linters#markdown#harper#GetProjectRoot(buffer) abort
|
||||
return fnamemodify(bufname(a:buffer), ':p:h')
|
||||
endfunction
|
||||
@@ -1,48 +0,0 @@
|
||||
" Author: Evan Chen <evan@evanchen.cc>
|
||||
" Description: Fast Markdown linter and formatter written in Rust
|
||||
|
||||
|
||||
call ale#Set('markdown_rumdl_executable', 'rumdl')
|
||||
call ale#Set('markdown_rumdl_options', '')
|
||||
|
||||
function! ale_linters#markdown#rumdl#GetProjectRoot(buffer) abort
|
||||
let l:dotconfig = ale#path#FindNearestFile(a:buffer, '.rumdl.toml')
|
||||
let l:config = ale#path#FindNearestFile(a:buffer, 'rumdl.toml')
|
||||
|
||||
if !empty(l:dotconfig) && !empty(l:config)
|
||||
let l:nearest = len(l:dotconfig) >= len(l:config) ? l:dotconfig : l:config
|
||||
|
||||
return fnamemodify(l:nearest, ':h')
|
||||
elseif !empty(l:dotconfig)
|
||||
return fnamemodify(l:dotconfig, ':h')
|
||||
elseif !empty(l:config)
|
||||
return fnamemodify(l:config, ':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 fnamemodify(bufname(a:buffer), ':p:h')
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('markdown', {
|
||||
\ 'name': 'rumdl',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': {b -> ale#Var(b, 'markdown_rumdl_executable')},
|
||||
\ 'command': {b -> ale#Escape(ale#Var(b, 'markdown_rumdl_executable'))
|
||||
\ . ' server --stdio'
|
||||
\ . ale#Pad(ale#Var(b, 'markdown_rumdl_options'))},
|
||||
\ 'project_root': function('ale_linters#markdown#rumdl#GetProjectRoot'),
|
||||
\ 'language': 'markdown',
|
||||
\})
|
||||
@@ -5,6 +5,29 @@
|
||||
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' ]
|
||||
|
||||
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
|
||||
|
||||
let l:project_root = ale#path#FindNearestFileOrDirectory(a:buffer, '.git')
|
||||
|
||||
if !empty(l:project_root)
|
||||
return fnamemodify(l:project_root . '/', ':p:h:h')
|
||||
endif
|
||||
|
||||
return fnamemodify(expand('#' . a:buffer . ':p:h'), ':p:h')
|
||||
endfunction
|
||||
|
||||
call ale#Set('perl_languageserver_config', {})
|
||||
|
||||
function! s:get_lsp_config(buffer) abort
|
||||
@@ -22,5 +45,5 @@ call ale#linter#Define('perl', {
|
||||
\ '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#handlers#perl#GetProjectRoot'),
|
||||
\ 'project_root': function('ale_linters#perl#languageserver#GetProjectRoot'),
|
||||
\ })
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
" Author: rymdbar <https://rymdbar.x20.se/>
|
||||
" Description: Perl Navigator Language Server
|
||||
" See: https://github.com/bscan/PerlNavigator
|
||||
|
||||
call ale#Set('perl_perlnavigator_config', {})
|
||||
call ale#Set('perl_perlnavigator_executable', 'perlnavigator')
|
||||
|
||||
call ale#linter#Define('perl', {
|
||||
\ 'name': 'perlnavigator',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': {b -> ale#Var(b, 'perl_perlnavigator_executable')},
|
||||
\ 'command': '%e --stdio',
|
||||
\ 'lsp_config': {b -> ale#Var(b, 'perl_perlnavigator_config')},
|
||||
\ 'project_root': function('ale#handlers#perl#GetProjectRoot'),
|
||||
\ })
|
||||
@@ -7,34 +7,6 @@ call ale#Set('php_phpcs_options', '')
|
||||
call ale#Set('php_phpcs_executable', 'phpcs')
|
||||
call ale#Set('php_phpcs_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
|
||||
function! ale_linters#php#phpcs#GetCwd(buffer) abort
|
||||
let l:result = ale#path#Dirname(ale_linters#php#phpcs#FindProjectRoot(a:buffer))
|
||||
|
||||
return empty(l:result) ? v:null : l:result
|
||||
endfunction
|
||||
|
||||
function! ale_linters#php#phpcs#FindProjectRoot(buffer) abort
|
||||
let l:result = ale#path#FindNearestFile(a:buffer, 'phpcs.xml')
|
||||
|
||||
if empty(l:result)
|
||||
let l:result = ale#path#FindNearestFile(a:buffer, 'phpcs.xml.dist')
|
||||
endif
|
||||
|
||||
if empty(l:result)
|
||||
let l:result = ale#path#FindNearestFile(a:buffer, '.phpcs.xml')
|
||||
endif
|
||||
|
||||
if empty(l:result)
|
||||
let l:result = ale#path#FindNearestFile(a:buffer, '.phpcs.xml.dist')
|
||||
endif
|
||||
|
||||
if empty(l:result)
|
||||
let l:result = ale#path#FindNearestFile(a:buffer, 'composer.json')
|
||||
endif
|
||||
|
||||
return l:result
|
||||
endfunction
|
||||
|
||||
function! ale_linters#php#phpcs#GetCommand(buffer) abort
|
||||
let l:standard = ale#Var(a:buffer, 'php_phpcs_standard')
|
||||
let l:standard_option = !empty(l:standard)
|
||||
@@ -76,7 +48,7 @@ call ale#linter#Define('php', {
|
||||
\ 'vendor/bin/phpcs',
|
||||
\ 'phpcs'
|
||||
\ ])},
|
||||
\ 'cwd': function('ale_linters#php#phpcs#GetCwd'),
|
||||
\ 'cwd': '%s:h',
|
||||
\ 'command': function('ale_linters#php#phpcs#GetCommand'),
|
||||
\ 'callback': 'ale_linters#php#phpcs#Handle',
|
||||
\})
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
" Author: w0rp <dev@w0rp.com>
|
||||
" Description: Astral's Python type checker and language server
|
||||
|
||||
call ale#Set('python_ty_executable', 'ty')
|
||||
call ale#Set('python_ty_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
call ale#Set('python_ty_auto_pipenv', 0)
|
||||
call ale#Set('python_ty_auto_poetry', 0)
|
||||
call ale#Set('python_ty_auto_uv', 0)
|
||||
call ale#Set('python_ty_config', {})
|
||||
|
||||
function! ale_linters#python#ty#GetExecutable(buffer) abort
|
||||
if (ale#Var(a:buffer, 'python_auto_pipenv') || ale#Var(a:buffer, 'python_ty_auto_pipenv'))
|
||||
\ && ale#python#PipenvPresent(a:buffer)
|
||||
return 'pipenv'
|
||||
endif
|
||||
|
||||
if (ale#Var(a:buffer, 'python_auto_poetry') || ale#Var(a:buffer, 'python_ty_auto_poetry'))
|
||||
\ && ale#python#PoetryPresent(a:buffer)
|
||||
return 'poetry'
|
||||
endif
|
||||
|
||||
if (ale#Var(a:buffer, 'python_auto_uv') || ale#Var(a:buffer, 'python_ty_auto_uv'))
|
||||
\ && ale#python#UvPresent(a:buffer)
|
||||
return 'uv'
|
||||
endif
|
||||
|
||||
return ale#python#FindExecutable(a:buffer, 'python_ty', ['ty'])
|
||||
endfunction
|
||||
|
||||
" Force the cwd of the server to be the same as the project root.
|
||||
function! ale_linters#python#ty#GetCwd(buffer) abort
|
||||
let l:fake_linter = {
|
||||
\ 'name': 'ty',
|
||||
\ 'project_root': function('ale#python#FindProjectRoot'),
|
||||
\}
|
||||
let l:root = ale#lsp_linter#FindProjectRoot(a:buffer, l:fake_linter)
|
||||
|
||||
return !empty(l:root) ? l:root : v:null
|
||||
endfunction
|
||||
|
||||
function! ale_linters#python#ty#GetCommand(buffer) abort
|
||||
let l:executable = ale_linters#python#ty#GetExecutable(a:buffer)
|
||||
let l:exec_args = [
|
||||
\ ale#Escape(l:executable),
|
||||
\]
|
||||
\ + (l:executable =~? '\(pipenv\|poetry\|uv\)$' ? ['run', 'ty'] : [])
|
||||
\ + [
|
||||
\ 'server',
|
||||
\]
|
||||
|
||||
return join(l:exec_args, ' ')
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('python', {
|
||||
\ 'name': 'ty',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': function('ale_linters#python#ty#GetExecutable'),
|
||||
\ 'cwd': function('ale_linters#python#ty#GetCwd'),
|
||||
\ 'command': function('ale_linters#python#ty#GetCommand'),
|
||||
\ 'project_root': function('ale#python#FindProjectRoot'),
|
||||
\ 'completion_filter': 'ale#completion#python#CompletionItemFilter',
|
||||
\ 'lsp_config': {b -> ale#Var(b, 'python_ty_config')},
|
||||
\})
|
||||
@@ -8,10 +8,7 @@ call ale#Set('ruby_solargraph_executable', 'solargraph')
|
||||
call ale#Set('ruby_solargraph_options', {})
|
||||
|
||||
function! ale_linters#ruby#solargraph#GetCommand(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'ruby_solargraph_executable')
|
||||
|
||||
return ale#ruby#EscapeExecutable(l:executable, 'solargraph')
|
||||
\ . ale#Pad('stdio')
|
||||
return '%e' . ale#Pad('stdio')
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('ruby', {
|
||||
|
||||
@@ -25,10 +25,6 @@ endfunction
|
||||
function! ale_linters#terraform#terraform_ls#GetProjectRoot(buffer) abort
|
||||
let l:tf_dir = ale#path#FindNearestDirectory(a:buffer, '.terraform')
|
||||
|
||||
if empty(l:tf_dir)
|
||||
let l:tf_dir = ale#path#FindNearestDirectory(a:buffer, '.')
|
||||
endif
|
||||
|
||||
return !empty(l:tf_dir) ? fnamemodify(l:tf_dir, ':h:h') : ''
|
||||
endfunction
|
||||
|
||||
|
||||
+28
-37
@@ -5,13 +5,12 @@ call ale#Set('c_parse_makefile', 0)
|
||||
call ale#Set('c_always_make', has('unix') && !has('macunix'))
|
||||
call ale#Set('c_parse_compile_commands', 1)
|
||||
|
||||
let s:is_windows = has('win32') || has('win64') || has('win32unix')
|
||||
let s:sep = s:is_windows ? '\' : '/'
|
||||
let s:sep = has('win32') ? '\' : '/'
|
||||
|
||||
" Set just so tests can override it.
|
||||
let g:__ale_c_project_filenames = ['.git/HEAD', 'configure', 'Makefile', 'CMakeLists.txt']
|
||||
|
||||
call ale#Set('c_build_dir_names', [
|
||||
let g:ale_c_build_dir_names = get(g:, 'ale_c_build_dir_names', [
|
||||
\ 'build',
|
||||
\ 'build/Debug',
|
||||
\ 'build/Release',
|
||||
@@ -19,6 +18,10 @@ call ale#Set('c_build_dir_names', [
|
||||
\])
|
||||
|
||||
function! s:CanParseMakefile(buffer) abort
|
||||
" Something somewhere seems to delete this setting in tests, so ensure we
|
||||
" always have a default value.
|
||||
call ale#Set('c_parse_makefile', 0)
|
||||
|
||||
return ale#Var(a:buffer, 'c_parse_makefile')
|
||||
endfunction
|
||||
|
||||
@@ -243,6 +246,15 @@ function! ale#c#FindCompileCommands(buffer) abort
|
||||
return [fnamemodify(l:json_file, ':h'), l:json_file]
|
||||
endif
|
||||
|
||||
" Something somewhere seems to delete this setting in tests, so ensure
|
||||
" we always have a default value.
|
||||
call ale#Set('c_build_dir_names', [
|
||||
\ 'build',
|
||||
\ 'build/Debug',
|
||||
\ 'build/Release',
|
||||
\ 'bin',
|
||||
\])
|
||||
|
||||
" Search in build directories if we can't find it in the project.
|
||||
for l:path in ale#path#Upwards(expand('#' . a:buffer . ':p:h'))
|
||||
for l:dirname in ale#Var(a:buffer, 'c_build_dir_names')
|
||||
@@ -387,40 +399,23 @@ function! ale#c#ParseCompileCommandsFlags(buffer, file_lookup, dir_lookup) abort
|
||||
let l:file_list = get(a:file_lookup, l:buffer_filename, [])
|
||||
|
||||
" We may have to look for /foo/bar instead of C:\foo\bar
|
||||
if empty(l:file_list) && s:is_windows
|
||||
" Try without the drive letter.
|
||||
let l:no_drive = ale#path#RemoveDriveLetter(l:buffer_filename)
|
||||
|
||||
let l:file_list = get(a:file_lookup, l:no_drive, [])
|
||||
|
||||
" Also try by iterating keys in case Simplify produced different
|
||||
" results for the key and the lookup value.
|
||||
if empty(l:file_list)
|
||||
for [l:key, l:val] in items(a:file_lookup)
|
||||
if ale#path#RemoveDriveLetter(l:key) is? l:no_drive
|
||||
let l:file_list = l:val
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
if empty(l:file_list) && has('win32')
|
||||
let l:file_list = get(
|
||||
\ a:file_lookup,
|
||||
\ ale#path#RemoveDriveLetter(l:buffer_filename),
|
||||
\ []
|
||||
\)
|
||||
endif
|
||||
|
||||
" Try the absolute path to the directory second.
|
||||
let l:dir_list = get(a:dir_lookup, l:dir, [])
|
||||
|
||||
if empty(l:dir_list) && s:is_windows
|
||||
let l:no_drive_dir = ale#path#RemoveDriveLetter(l:dir)
|
||||
|
||||
let l:dir_list = get(a:dir_lookup, l:no_drive_dir, [])
|
||||
|
||||
if empty(l:dir_list)
|
||||
for [l:key, l:val] in items(a:dir_lookup)
|
||||
if ale#path#RemoveDriveLetter(l:key) is? l:no_drive_dir
|
||||
let l:dir_list = l:val
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
if empty(l:dir_list) && has('win32')
|
||||
let l:dir_list = get(
|
||||
\ a:dir_lookup,
|
||||
\ ale#path#RemoveDriveLetter(l:dir),
|
||||
\ []
|
||||
\)
|
||||
endif
|
||||
|
||||
if empty(l:file_list) && empty(l:dir_list)
|
||||
@@ -442,7 +437,7 @@ function! ale#c#ParseCompileCommandsFlags(buffer, file_lookup, dir_lookup) abort
|
||||
let l:key = fnamemodify(l:buffer_filename, ':r') . l:suffix
|
||||
let l:file_list = get(a:file_lookup, l:key, [])
|
||||
|
||||
if empty(l:file_list) && s:is_windows
|
||||
if empty(l:file_list) && has('win32')
|
||||
let l:file_list = get(
|
||||
\ a:file_lookup,
|
||||
\ ale#path#RemoveDriveLetter(l:key),
|
||||
@@ -468,12 +463,8 @@ function! ale#c#ParseCompileCommandsFlags(buffer, file_lookup, dir_lookup) abort
|
||||
|
||||
" Load the flags for this file, or for a source file matching the
|
||||
" header file.
|
||||
" On Windows, bufnr() may fail to match when one path has a drive
|
||||
" letter and the other doesn't, so fall back to path comparison.
|
||||
if (
|
||||
\ bufnr(l:filename) is a:buffer
|
||||
\ || ale#path#RemoveDriveLetter(l:filename)
|
||||
\ is? ale#path#RemoveDriveLetter(l:buffer_filename)
|
||||
\ || (
|
||||
\ !empty(l:source_file)
|
||||
\ && l:filename[-len(l:source_file):] is? l:source_file
|
||||
|
||||
@@ -7,8 +7,6 @@ if !exists('s:buffer_data')
|
||||
let s:buffer_data = {}
|
||||
endif
|
||||
|
||||
let s:is_windows = has('win32') || has('win64') || has('win32unix')
|
||||
|
||||
" The regular expression used for formatting filenames with modifiers.
|
||||
let s:path_format_regex = '\v\%s(%(:h|:t|:r|:e)*)'
|
||||
|
||||
@@ -142,7 +140,7 @@ function! s:TemporaryFilename(buffer) abort
|
||||
|
||||
" Create a temporary filename, <temp_dir>/<original_basename>
|
||||
" The file itself will not be created by this function.
|
||||
return ale#path#GetAbsPath(ale#util#Tempname(), l:filename)
|
||||
return ale#util#Tempname() . (has('win32') ? '\' : '/') . l:filename
|
||||
endfunction
|
||||
|
||||
" Given part of a command, replace any % with %%, so that no characters in
|
||||
@@ -180,7 +178,7 @@ function! ale#command#CdString(directory) abort
|
||||
\ ? a:directory
|
||||
\ : ale#Escape(a:directory)
|
||||
|
||||
if s:is_windows
|
||||
if has('win32')
|
||||
return 'cd /d ' . l:directory . ' && '
|
||||
endif
|
||||
|
||||
@@ -394,7 +392,7 @@ function! ale#command#Run(buffer, command, Callback, ...) abort
|
||||
let s:fake_job_id = get(s:, 'fake_job_id', 0) + 1
|
||||
let l:job_id = s:fake_job_id
|
||||
endif
|
||||
elseif s:is_windows
|
||||
elseif has('win32')
|
||||
let l:job_id = ale#job#StartWithCmd(l:command, l:job_options)
|
||||
else
|
||||
let l:job_id = ale#job#Start(l:command, l:job_options)
|
||||
|
||||
@@ -145,7 +145,6 @@ let s:omni_start_map = {
|
||||
|
||||
" A map of exact characters for triggering LSP completions. Do not forget to
|
||||
" update self.input_patterns in ale.py in updating entries in this map.
|
||||
" These are used as a fallback when LSP servers don't provide trigger chars.
|
||||
let s:trigger_character_map = {
|
||||
\ '<default>': ['.'],
|
||||
\ 'typescript': ['.', '''', '"'],
|
||||
@@ -154,19 +153,6 @@ let s:trigger_character_map = {
|
||||
\ 'c': ['.', '->'],
|
||||
\}
|
||||
|
||||
" Get trigger characters, preferring LSP-provided ones over hardcoded.
|
||||
function! s:GetTriggerCharacters(filetype, conn_id) abort
|
||||
if !empty(a:conn_id)
|
||||
let l:lsp_triggers = ale#lsp#GetCompletionTriggerCharacters(a:conn_id)
|
||||
|
||||
if !empty(l:lsp_triggers)
|
||||
return l:lsp_triggers
|
||||
endif
|
||||
endif
|
||||
|
||||
return s:GetFiletypeValue(s:trigger_character_map, a:filetype)
|
||||
endfunction
|
||||
|
||||
function! s:GetFiletypeValue(map, filetype) abort
|
||||
for l:part in reverse(split(a:filetype, '\.'))
|
||||
let l:regex = get(a:map, l:part, [])
|
||||
@@ -189,32 +175,15 @@ function! ale#completion#GetPrefix(filetype, line, column) abort
|
||||
" abc
|
||||
" ^
|
||||
" So we need check the text in the column before that position.
|
||||
let l:line_text = getline(a:line)[: a:column - 2]
|
||||
let l:prefix = matchstr(l:line_text, l:regex)
|
||||
|
||||
if !empty(l:prefix)
|
||||
return l:prefix
|
||||
endif
|
||||
|
||||
" Check LSP trigger characters for active connections on this buffer.
|
||||
let l:triggers = ale#lsp#GetAllCompletionTriggerCharactersForBuffer(bufnr(''))
|
||||
|
||||
for l:char in l:triggers
|
||||
if l:line_text[-len(l:char):] is# l:char
|
||||
return l:char
|
||||
endif
|
||||
endfor
|
||||
|
||||
return ''
|
||||
return matchstr(getline(a:line)[: a:column - 2], l:regex)
|
||||
endfunction
|
||||
|
||||
function! ale#completion#GetTriggerCharacter(filetype, prefix, ...) abort
|
||||
function! ale#completion#GetTriggerCharacter(filetype, prefix) abort
|
||||
if empty(a:prefix)
|
||||
return ''
|
||||
endif
|
||||
|
||||
let l:conn_id = get(a:, 1, '')
|
||||
let l:char_list = s:GetTriggerCharacters(a:filetype, l:conn_id)
|
||||
let l:char_list = s:GetFiletypeValue(s:trigger_character_map, a:filetype)
|
||||
|
||||
if index(l:char_list, a:prefix) >= 0
|
||||
return a:prefix
|
||||
@@ -235,8 +204,7 @@ function! ale#completion#Filter(
|
||||
if empty(a:prefix)
|
||||
let l:filtered_suggestions = a:suggestions
|
||||
else
|
||||
let l:conn_id = get(get(b:, 'ale_completion_info', {}), 'conn_id', '')
|
||||
let l:triggers = s:GetTriggerCharacters(a:filetype, l:conn_id)
|
||||
let l:triggers = s:GetFiletypeValue(s:trigger_character_map, a:filetype)
|
||||
|
||||
" For completing...
|
||||
" foo.
|
||||
@@ -796,9 +764,6 @@ function! s:OnReady(linter, lsp_details) abort
|
||||
let l:id = a:lsp_details.connection_id
|
||||
|
||||
if !ale#lsp#HasCapability(l:id, 'completion')
|
||||
" Return at least an empty result to avoid OmniFunc timeout
|
||||
call ale#completion#Show([])
|
||||
|
||||
return
|
||||
endif
|
||||
|
||||
@@ -837,7 +802,7 @@ function! s:OnReady(linter, lsp_details) abort
|
||||
\ l:buffer,
|
||||
\ b:ale_completion_info.line,
|
||||
\ b:ale_completion_info.column,
|
||||
\ ale#completion#GetTriggerCharacter(&filetype, b:ale_completion_info.prefix, l:id),
|
||||
\ ale#completion#GetTriggerCharacter(&filetype, b:ale_completion_info.prefix),
|
||||
\)
|
||||
endif
|
||||
|
||||
@@ -980,18 +945,9 @@ function! ale#completion#OmniFunc(findstart, base) abort
|
||||
else
|
||||
let l:result = ale#completion#GetCompletionResult()
|
||||
|
||||
let l:timeout = get(g:, 'ale_completion_timeout', 3)
|
||||
let l:timeout_start = reltime()
|
||||
|
||||
while l:result is v:null && !complete_check()
|
||||
sleep 2ms
|
||||
let l:result = ale#completion#GetCompletionResult()
|
||||
|
||||
if reltimefloat(reltime(l:timeout_start)) > l:timeout
|
||||
" no-custom-checks
|
||||
echoerr 'no result within timeout (' . l:timeout . 's)'
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
|
||||
return l:result isnot v:null ? l:result : []
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
" Author: w0rp <devw0rp@gmail.com>
|
||||
" Description: Logic for handling mappings between files
|
||||
|
||||
let s:is_windows = has('win32') || has('win64') || has('win32unix')
|
||||
|
||||
" Invert filesystem mappings so they can be mapped in reverse.
|
||||
function! ale#filename_mapping#Invert(filename_mappings) abort
|
||||
return map(copy(a:filename_mappings), '[v:val[1], v:val[0]]')
|
||||
@@ -16,16 +14,7 @@ function! ale#filename_mapping#Map(filename, filename_mappings) abort
|
||||
let l:mapping_from = ale#path#Simplify(l:mapping_from)
|
||||
|
||||
if l:simplified_filename[:len(l:mapping_from) - 1] is# l:mapping_from
|
||||
let l:suffix = l:simplified_filename[len(l:mapping_from):]
|
||||
|
||||
" On Windows, the simplified suffix uses backslashes, but the
|
||||
" mapping target may use forward slashes for a remote path.
|
||||
" Normalize the suffix separator to match the mapping target.
|
||||
if s:is_windows && l:mapping_to =~# '/'
|
||||
let l:suffix = substitute(l:suffix, '\\', '/', 'g')
|
||||
endif
|
||||
|
||||
return l:mapping_to . l:suffix
|
||||
return l:mapping_to . l:simplified_filename[len(l:mapping_from):]
|
||||
endif
|
||||
endfor
|
||||
|
||||
|
||||
@@ -207,11 +207,6 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['puppet'],
|
||||
\ 'description': 'Run puppet-lint -f on a file.',
|
||||
\ },
|
||||
\ 'replace_emdash': {
|
||||
\ 'function': 'ale#fixers#generic#ReplaceEmDash',
|
||||
\ 'suggested_filetypes': [],
|
||||
\ 'description': 'Replace em dash with -- ASCII characters.',
|
||||
\ },
|
||||
\ 'remove_trailing_lines': {
|
||||
\ 'function': 'ale#fixers#generic#RemoveTrailingBlankLines',
|
||||
\ 'suggested_filetypes': [],
|
||||
@@ -772,16 +767,6 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['markdown'],
|
||||
\ 'description': 'Fix markdown files with markdownlint.',
|
||||
\ },
|
||||
\ 'rumdl': {
|
||||
\ 'function': 'ale#fixers#rumdl#Fix',
|
||||
\ 'suggested_filetypes': ['markdown'],
|
||||
\ 'description': 'Fix markdown files with rumdl.',
|
||||
\ },
|
||||
\ 'tex-fmt': {
|
||||
\ 'function': 'ale#fixers#tex_fmt#Fix',
|
||||
\ 'suggested_filetypes': ['bib', 'tex'],
|
||||
\ 'description': 'Fix LaTeX and bibliography files with tex-fmt.',
|
||||
\ }
|
||||
\}
|
||||
|
||||
" Reset the function registry to the default entries.
|
||||
|
||||
@@ -7,7 +7,7 @@ function! ale#fixers#alejandra#Fix(buffer) abort
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' -- -'
|
||||
\}
|
||||
endfunction
|
||||
|
||||
@@ -12,7 +12,7 @@ function! ale#fixers#apkbuild_fixer#Fix(buffer) abort
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' -p ' . ale#Var(a:buffer, 'apkbuild_apkbuild_fixer_lint_executable')
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
|
||||
@@ -36,7 +36,7 @@ function! ale#fixers#clangtidy#GetCommand(buffer) abort
|
||||
|
||||
return ' -fix' . (l:fix_errors ? ' -fix-errors' : '')
|
||||
\ . (empty(l:checks) ? '' : ' -checks=' . ale#Escape(l:checks))
|
||||
\ . ale#Pad(l:extra_options)
|
||||
\ . (empty(l:extra_options) ? '' : ' ' . l:extra_options)
|
||||
\ . (empty(l:build_dir) ? '' : ' -p ' . ale#Escape(l:build_dir))
|
||||
\ . ' %t' . (empty(l:options) ? '' : ' -- ' . l:options)
|
||||
endfunction
|
||||
|
||||
@@ -10,7 +10,7 @@ function! ale#fixers#cmakeformat#Fix(buffer) abort
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' -'
|
||||
\}
|
||||
endfunction
|
||||
|
||||
@@ -11,7 +11,7 @@ function! ale#fixers#dart_format#Fix(buffer) abort
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' format'
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
|
||||
@@ -11,7 +11,7 @@ function! ale#fixers#dartfmt#Fix(buffer) abort
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' -w'
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
|
||||
@@ -11,7 +11,7 @@ function! ale#fixers#dfmt#Fix(buffer) abort
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' -i'
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
|
||||
@@ -11,7 +11,7 @@ function! ale#fixers#dotnet_format#Fix(buffer) abort
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' format'
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' --folder --include %t "$(dirname %t)"',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
|
||||
@@ -11,6 +11,6 @@ function! ale#fixers#dune#Fix(buffer) abort
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' format'
|
||||
\ . ale#Pad(l:options),
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options),
|
||||
\}
|
||||
endfunction
|
||||
|
||||
@@ -17,7 +17,7 @@ function! ale#fixers#elm_format#Fix(buffer) abort
|
||||
return {
|
||||
\ 'command': ale#Escape(ale#fixers#elm_format#GetExecutable(a:buffer))
|
||||
\ . ' %t'
|
||||
\ . ale#Pad(l:options),
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options),
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
||||
|
||||
@@ -12,7 +12,7 @@ function! ale#fixers#fish_indent#Fix(buffer) abort
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' -w '
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
|
||||
@@ -13,7 +13,7 @@ function! ale#fixers#fourmolu#Fix(buffer) abort
|
||||
|
||||
return {
|
||||
\ 'command': l:executable
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' --stdin-input-file '
|
||||
\ . ale#Escape(@%),
|
||||
\}
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
" Author: w0rp <devw0rp@gmail.com>
|
||||
" Description: Generic functions for fixing files with.
|
||||
|
||||
function! ale#fixers#generic#ReplaceEmDash(buffer, lines) abort
|
||||
return map(copy(a:lines), {_, line -> substitute(line, "\u2014", '--', 'g')})
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#generic#RemoveTrailingBlankLines(buffer, lines) abort
|
||||
let l:end_index = len(a:lines) - 1
|
||||
|
||||
|
||||
@@ -11,6 +11,6 @@ function! ale#fixers#gofmt#Fix(buffer) abort
|
||||
|
||||
return {
|
||||
\ 'command': l:env . ale#Escape(l:executable)
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\}
|
||||
endfunction
|
||||
|
||||
@@ -16,7 +16,7 @@ function! ale#fixers#goimports#Fix(buffer) abort
|
||||
return {
|
||||
\ 'command': l:env . ale#Escape(l:executable)
|
||||
\ . ' -l -w -srcdir %s'
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
|
||||
@@ -16,6 +16,6 @@ function! ale#fixers#golines#Fix(buffer) abort
|
||||
|
||||
return {
|
||||
\ 'command': l:env . ale#Escape(l:executable)
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\}
|
||||
endfunction
|
||||
|
||||
@@ -15,7 +15,7 @@ function! ale#fixers#google_java_format#Fix(buffer) abort
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' ' . ale#Pad(l:options)
|
||||
\ . ' ' . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' --replace'
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
|
||||
@@ -11,7 +11,7 @@ function! ale#fixers#hackfmt#Fix(buffer) abort
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' -i'
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
|
||||
@@ -11,6 +11,6 @@ function! ale#fixers#latexindent#Fix(buffer) abort
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' -l'
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\}
|
||||
endfunction
|
||||
|
||||
@@ -7,7 +7,7 @@ function! ale#fixers#luafmt#Fix(buffer) abort
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' --stdin',
|
||||
\}
|
||||
endfunction
|
||||
|
||||
@@ -10,7 +10,7 @@ function! ale#fixers#nickel_format#Fix(buffer) abort
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable) . ' format'
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\}
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -7,6 +7,6 @@ function! ale#fixers#nixpkgsfmt#Fix(buffer) abort
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ale#Pad(l:options),
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options),
|
||||
\}
|
||||
endfunction
|
||||
|
||||
@@ -10,7 +10,7 @@ function! ale#fixers#ocamlformat#Fix(buffer) abort
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' --name=%s'
|
||||
\ . ' -'
|
||||
\}
|
||||
|
||||
@@ -13,6 +13,6 @@ function! ale#fixers#ocp_indent#Fix(buffer) abort
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . (empty(l:config) ? '' : ' --config=' . ale#Escape(l:config))
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (empty(l:options) ? '': ' ' . l:options)
|
||||
\}
|
||||
endfunction
|
||||
|
||||
@@ -10,6 +10,6 @@ function! ale#fixers#opafmt#Fix(buffer) abort
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' fmt'
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\}
|
||||
endfunction
|
||||
|
||||
@@ -7,6 +7,6 @@ function! ale#fixers#ormolu#Fix(buffer) abort
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ale#Pad(l:options),
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options),
|
||||
\}
|
||||
endfunction
|
||||
|
||||
@@ -11,7 +11,7 @@ function! ale#fixers#packer#Fix(buffer) abort
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' fmt'
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' -'
|
||||
\}
|
||||
endfunction
|
||||
|
||||
@@ -11,7 +11,7 @@ function! ale#fixers#perltidy#Fix(buffer) abort
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' -b'
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
|
||||
@@ -7,6 +7,6 @@ function! ale#fixers#pgformatter#Fix(buffer) abort
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ale#Pad(l:options),
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options),
|
||||
\}
|
||||
endfunction
|
||||
|
||||
@@ -8,7 +8,6 @@ call ale#Set('javascript_prettier_options', '')
|
||||
|
||||
function! ale#fixers#prettier#GetExecutable(buffer) abort
|
||||
return ale#path#FindExecutable(a:buffer, 'javascript_prettier', [
|
||||
\ '.yarn/sdks/prettier/bin/prettier.cjs',
|
||||
\ 'node_modules/.bin/prettier_d',
|
||||
\ 'node_modules/prettier-cli/index.js',
|
||||
\ 'node_modules/.bin/prettier',
|
||||
|
||||
@@ -10,7 +10,7 @@ function! ale#fixers#ptop#Fix(buffer) abort
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' %s %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
|
||||
@@ -10,6 +10,6 @@ function! ale#fixers#raco_fmt#Fix(buffer) abort
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable) . ' fmt'
|
||||
\ . ale#Pad(l:options),
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options),
|
||||
\}
|
||||
endfunction
|
||||
|
||||
@@ -10,7 +10,7 @@ function! ale#fixers#refmt#Fix(buffer) abort
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' --in-place'
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
|
||||
@@ -10,7 +10,7 @@ function! ale#fixers#rubyfmt#Fix(buffer) abort
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\}
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
scriptencoding utf-8
|
||||
|
||||
" Author: Evan Chen <evan@evanchen.cc>
|
||||
" Description: Fast Markdown linter and formatter written in Rust
|
||||
|
||||
|
||||
call ale#Set('markdown_rumdl_executable', 'rumdl')
|
||||
call ale#Set('markdown_rumdl_fmt_options', '--silent')
|
||||
|
||||
function! ale#fixers#rumdl#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'markdown_rumdl_executable')
|
||||
let l:options = ale#Var(a:buffer, 'markdown_rumdl_fmt_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable) . ' fmt -'
|
||||
\ . ale#Pad(l:options),
|
||||
\}
|
||||
endfunction
|
||||
@@ -10,6 +10,6 @@ function! ale#fixers#rustfmt#Fix(buffer) abort
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ale#Pad(l:options),
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options),
|
||||
\}
|
||||
endfunction
|
||||
|
||||
@@ -11,7 +11,7 @@ function! ale#fixers#rustywind#Fix(buffer) abort
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' --stdin'
|
||||
\}
|
||||
endfunction
|
||||
|
||||
@@ -10,6 +10,6 @@ function! ale#fixers#scadformat#Fix(buffer) abort
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ale#Pad(l:options),
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options),
|
||||
\}
|
||||
endfunction
|
||||
|
||||
@@ -13,7 +13,7 @@ function! ale#fixers#scalafmt#GetCommand(buffer) abort
|
||||
\ : ''
|
||||
|
||||
return ale#Escape(l:executable) . l:exec_args
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' %t'
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -12,6 +12,6 @@ function! ale#fixers#shfmt#Fix(buffer) abort
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' -filename=%s'
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\}
|
||||
endfunction
|
||||
|
||||
@@ -8,6 +8,6 @@ function! ale#fixers#sqlfmt#Fix(buffer) abort
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' -w'
|
||||
\ . ale#Pad(l:options),
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options),
|
||||
\}
|
||||
endfunction
|
||||
|
||||
@@ -11,7 +11,7 @@ function! ale#fixers#terraform#Fix(buffer) abort
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' fmt'
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' -'
|
||||
\}
|
||||
endfunction
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
" Author: https://github.com/Spixmaster
|
||||
" Description: Fix LaTeX and bibliography files with tex-fmt.
|
||||
|
||||
call ale#Set('tex_tex_fmt_executable', 'tex-fmt')
|
||||
call ale#Set('tex_tex_fmt_use_global', get(g:, 'ale_use_global_executables', 0))
|
||||
call ale#Set('tex_tex_fmt_options', '')
|
||||
|
||||
function! ale#fixers#tex_fmt#Fix(buffer) abort
|
||||
let l:executable = ale#python#FindExecutable(
|
||||
\ a:buffer,
|
||||
\ 'tex_tex_fmt',
|
||||
\ ['tex-fmt']
|
||||
\)
|
||||
|
||||
let l:options = ale#Var(a:buffer, 'tex_tex_fmt_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable) . ' ' . l:options . ' -s',
|
||||
\}
|
||||
endfunction
|
||||
@@ -8,7 +8,7 @@ function! ale#fixers#textlint#Fix(buffer) abort
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' --fix'
|
||||
\ . ale#Pad(l:options)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . ' %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
|
||||
@@ -11,8 +11,8 @@ function! ale#handlers#ktlint#GetCommand(buffer) abort
|
||||
let l:rulesets = ale#handlers#ktlint#GetRulesets(a:buffer)
|
||||
|
||||
return ale#Escape(l:executable)
|
||||
\ . ale#Pad(l:options)
|
||||
\ . ale#Pad(l:rulesets)
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options)
|
||||
\ . (empty(l:rulesets) ? '' : ' ' . l:rulesets)
|
||||
\ . ' --stdin'
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ function! ale#handlers#languagetool#GetCommand(buffer) abort
|
||||
let l:options = ale#Var(a:buffer, 'languagetool_options')
|
||||
|
||||
return ale#Escape(l:executable)
|
||||
\ . ale#Pad(l:options) . ' %s'
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options) . ' %s'
|
||||
endfunction
|
||||
|
||||
function! ale#handlers#languagetool#HandleOutput(buffer, lines) abort
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
" Author: rymdbar <https://rymdbar.x20.se/>
|
||||
|
||||
function! ale#handlers#perl#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' ]
|
||||
|
||||
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
|
||||
|
||||
let l:project_root = ale#path#FindNearestFileOrDirectory(a:buffer, '.git')
|
||||
|
||||
if !empty(l:project_root)
|
||||
return fnamemodify(l:project_root . '/', ':p:h:h')
|
||||
endif
|
||||
|
||||
return fnamemodify(expand('#' . a:buffer . ':p:h'), ':p:h')
|
||||
endfunction
|
||||
@@ -10,7 +10,6 @@
|
||||
|
||||
" A setting for wrapping commands.
|
||||
let g:ale_command_wrapper = get(g:, 'ale_command_wrapper', '')
|
||||
let s:is_windows = has('win32') || has('win64') || has('win32unix')
|
||||
|
||||
if !has_key(s:, 'job_map')
|
||||
let s:job_map = {}
|
||||
@@ -200,7 +199,7 @@ function! ale#job#PrepareCommand(buffer, command) abort
|
||||
return split(l:ale_shell) + split(l:shell_arguments) + [l:command]
|
||||
endif
|
||||
|
||||
if s:is_windows
|
||||
if has('win32')
|
||||
return 'cmd /s/c "' . l:command . '"'
|
||||
endif
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ let s:default_ale_linters = {
|
||||
\ 'jsonc': ['biome'],
|
||||
\ 'perl': ['perlcritic'],
|
||||
\ 'perl6': [],
|
||||
\ 'python': ['flake8', 'mypy', 'pylint', 'pyright', 'ruff', 'ty'],
|
||||
\ 'python': ['flake8', 'mypy', 'pylint', 'pyright', 'ruff'],
|
||||
\ 'rust': ['analyzer', 'cargo'],
|
||||
\ 'spec': [],
|
||||
\ 'text': [],
|
||||
|
||||
+1
-192
@@ -23,7 +23,6 @@ function! ale#lsp#Register(executable_or_address, project, language, init_option
|
||||
" config: Configuration settings to send to the server.
|
||||
" callback_list: A list of callbacks for handling LSP responses.
|
||||
" capabilities_queue: The list of callbacks to call with capabilities.
|
||||
" dynamic_registrations: A map of dynamically registered capabilities.
|
||||
" capabilities: Features the server supports.
|
||||
let s:connections[l:conn_id] = {
|
||||
\ 'id': l:conn_id,
|
||||
@@ -38,8 +37,6 @@ function! ale#lsp#Register(executable_or_address, project, language, init_option
|
||||
\ 'config': {},
|
||||
\ 'callback_list': [],
|
||||
\ 'init_queue': [],
|
||||
\ 'dynamic_registrations': {},
|
||||
\ 'static_pull_model': 0,
|
||||
\ 'capabilities': {
|
||||
\ 'hover': 0,
|
||||
\ 'rename': 0,
|
||||
@@ -199,27 +196,6 @@ function! ale#lsp#ReadMessageData(data) abort
|
||||
return [l:remainder, l:response_list]
|
||||
endfunction
|
||||
|
||||
function! s:UpdatePullModelCapability(conn) abort
|
||||
let a:conn.capabilities.pull_model = get(a:conn, 'static_pull_model', 0)
|
||||
|
||||
if a:conn.capabilities.pull_model
|
||||
return
|
||||
endif
|
||||
|
||||
for l:registration in values(get(a:conn, 'dynamic_registrations', {}))
|
||||
if get(l:registration, 'method', '') is# 'textDocument/diagnostic'
|
||||
let l:options = get(l:registration, 'registerOptions', {})
|
||||
|
||||
if type(l:options) is v:t_dict
|
||||
\&& type(get(l:options, 'interFileDependencies')) is v:t_bool
|
||||
let a:conn.capabilities.pull_model = 1
|
||||
|
||||
return
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
" Update capabilities from the server, so we know which features the server
|
||||
" supports.
|
||||
function! ale#lsp#UpdateCapabilities(conn_id, capabilities) abort
|
||||
@@ -304,8 +280,7 @@ function! ale#lsp#UpdateCapabilities(conn_id, capabilities) abort
|
||||
" 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.static_pull_model = 1
|
||||
call s:UpdatePullModelCapability(l:conn)
|
||||
let l:conn.capabilities.pull_model = 1
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -336,121 +311,6 @@ function! ale#lsp#UpdateCapabilities(conn_id, capabilities) abort
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Update capabilities registered dynamically with client/registerCapability.
|
||||
" Returns 1 when pull diagnostics were registered.
|
||||
function! ale#lsp#RegisterCapabilities(conn_id, registrations) abort
|
||||
let l:conn = get(s:connections, a:conn_id, {})
|
||||
|
||||
if empty(l:conn) || type(a:registrations) isnot v:t_list
|
||||
return 0
|
||||
endif
|
||||
|
||||
if !has_key(l:conn, 'dynamic_registrations')
|
||||
let l:conn.dynamic_registrations = {}
|
||||
endif
|
||||
|
||||
let l:registered_pull_diagnostics = 0
|
||||
|
||||
for l:registration in a:registrations
|
||||
if type(l:registration) isnot v:t_dict
|
||||
continue
|
||||
endif
|
||||
|
||||
let l:id = get(l:registration, 'id', '')
|
||||
|
||||
if empty(l:id)
|
||||
continue
|
||||
endif
|
||||
|
||||
let l:conn.dynamic_registrations[l:id] = l:registration
|
||||
|
||||
if get(l:registration, 'method', '') is# 'textDocument/diagnostic'
|
||||
let l:options = get(l:registration, 'registerOptions', {})
|
||||
|
||||
if type(l:options) is v:t_dict
|
||||
\&& type(get(l:options, 'interFileDependencies')) is v:t_bool
|
||||
let l:registered_pull_diagnostics = 1
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
|
||||
call s:UpdatePullModelCapability(l:conn)
|
||||
|
||||
return l:registered_pull_diagnostics
|
||||
endfunction
|
||||
|
||||
" Update capabilities removed dynamically with client/unregisterCapability.
|
||||
" The LSP spec names the list "unregisterations".
|
||||
function! ale#lsp#UnregisterCapabilities(conn_id, unregisterations) abort
|
||||
let l:conn = get(s:connections, a:conn_id, {})
|
||||
|
||||
if empty(l:conn) || type(a:unregisterations) isnot v:t_list
|
||||
return 0
|
||||
endif
|
||||
|
||||
if !has_key(l:conn, 'dynamic_registrations')
|
||||
let l:conn.dynamic_registrations = {}
|
||||
endif
|
||||
|
||||
let l:unregistered_pull_diagnostics = 0
|
||||
|
||||
for l:unregistration in a:unregisterations
|
||||
if type(l:unregistration) isnot v:t_dict
|
||||
continue
|
||||
endif
|
||||
|
||||
let l:id = get(l:unregistration, 'id', '')
|
||||
let l:method = get(l:unregistration, 'method', '')
|
||||
|
||||
if empty(l:id) || !has_key(l:conn.dynamic_registrations, l:id)
|
||||
continue
|
||||
endif
|
||||
|
||||
let l:registration = l:conn.dynamic_registrations[l:id]
|
||||
|
||||
if get(l:registration, 'method', '') isnot# l:method
|
||||
continue
|
||||
endif
|
||||
|
||||
if l:method is# 'textDocument/diagnostic'
|
||||
let l:unregistered_pull_diagnostics = 1
|
||||
endif
|
||||
|
||||
call remove(l:conn.dynamic_registrations, l:id)
|
||||
endfor
|
||||
|
||||
call s:UpdatePullModelCapability(l:conn)
|
||||
|
||||
return l:unregistered_pull_diagnostics
|
||||
endfunction
|
||||
|
||||
" Send textDocument/diagnostic requests for all open documents on a connection.
|
||||
" Returns a list of request details so callers can map responses back to URIs.
|
||||
function! ale#lsp#SendDiagnosticsForOpenDocuments(conn_id) abort
|
||||
let l:conn = get(s:connections, a:conn_id, {})
|
||||
let l:request_list = []
|
||||
|
||||
if empty(l:conn) || !ale#lsp#HasCapability(a:conn_id, 'pull_model')
|
||||
return l:request_list
|
||||
endif
|
||||
|
||||
for l:buffer_string in sort(keys(l:conn.open_documents))
|
||||
let l:buffer = str2nr(l:buffer_string)
|
||||
let l:message = ale#lsp#message#Diagnostic(l:buffer)
|
||||
let l:request_id = ale#lsp#Send(a:conn_id, l:message)
|
||||
|
||||
if l:request_id > 0
|
||||
call add(l:request_list, {
|
||||
\ 'id': l:request_id,
|
||||
\ 'buffer': l:buffer,
|
||||
\ 'uri': l:message[2].textDocument.uri,
|
||||
\})
|
||||
endif
|
||||
endfor
|
||||
|
||||
return l:request_list
|
||||
endfunction
|
||||
|
||||
" Update a connection's configuration dictionary and notify LSP servers
|
||||
" of any changes since the last update. Returns 1 if a configuration
|
||||
" update was sent; otherwise 0 will be returned.
|
||||
@@ -469,27 +329,6 @@ function! ale#lsp#UpdateConfig(conn_id, buffer, config) abort
|
||||
return 1
|
||||
endfunction
|
||||
|
||||
function! ale#lsp#GetConnectionConfig(conn_id) abort
|
||||
let l:conn = get(s:connections, a:conn_id, {})
|
||||
|
||||
return get(l:conn, 'config', {})
|
||||
endfunction
|
||||
|
||||
" Send a JSON-RPC response to a server-initiated request (e.g. workspace/configuration).
|
||||
" Unlike ale#lsp#Send, which builds outgoing requests/notifications with a 'method' field,
|
||||
" this sends a response with 'id' + 'result' fields to reply to a request the server sent us.
|
||||
function! ale#lsp#SendResponse(conn_id, id, result) abort
|
||||
let l:conn = get(s:connections, a:conn_id, {})
|
||||
|
||||
if empty(l:conn)
|
||||
return
|
||||
endif
|
||||
|
||||
let l:body = json_encode({'jsonrpc': '2.0', 'id': a:id, 'result': a:result})
|
||||
let l:data = 'Content-Length: ' . strlen(l:body) . "\r\n\r\n" . l:body
|
||||
call s:SendMessageData(l:conn, l:data)
|
||||
endfunction
|
||||
|
||||
function! ale#lsp#CallInitCallbacks(conn_id) abort
|
||||
let l:conn = get(s:connections, a:conn_id, {})
|
||||
|
||||
@@ -1010,33 +849,3 @@ function! ale#lsp#HasCapability(conn_id, capability) abort
|
||||
|
||||
return l:conn.capabilities[a:capability]
|
||||
endfunction
|
||||
|
||||
" Get the completion trigger characters for a connection.
|
||||
function! ale#lsp#GetCompletionTriggerCharacters(conn_id) abort
|
||||
let l:conn = get(s:connections, a:conn_id, {})
|
||||
|
||||
if empty(l:conn)
|
||||
return []
|
||||
endif
|
||||
|
||||
return get(l:conn.capabilities, 'completion_trigger_characters', [])
|
||||
endfunction
|
||||
|
||||
" Get all completion trigger characters from LSPs active for a buffer.
|
||||
function! ale#lsp#GetAllCompletionTriggerCharactersForBuffer(buffer) abort
|
||||
let l:all_triggers = []
|
||||
|
||||
for l:conn in values(s:connections)
|
||||
if has_key(l:conn.open_documents, a:buffer)
|
||||
let l:triggers = get(l:conn.capabilities, 'completion_trigger_characters', [])
|
||||
|
||||
for l:char in l:triggers
|
||||
if index(l:all_triggers, l:char) < 0
|
||||
call add(l:all_triggers, l:char)
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
endfor
|
||||
|
||||
return l:all_triggers
|
||||
endfunction
|
||||
|
||||
@@ -210,24 +210,6 @@ function! s:HandleLSPErrorMessage(linter, response) abort
|
||||
call ale#lsp_linter#AddErrorMessage(a:linter.name, l:message)
|
||||
endfunction
|
||||
|
||||
function! s:SendPullDiagnosticsForOpenDocuments(conn_id) abort
|
||||
let l:linter = get(s:lsp_linter_map, a:conn_id)
|
||||
|
||||
if empty(l:linter)
|
||||
return
|
||||
endif
|
||||
|
||||
for l:request in ale#lsp#SendDiagnosticsForOpenDocuments(a:conn_id)
|
||||
let l:info = get(g:ale_buffer_info, l:request.buffer, {})
|
||||
|
||||
if !empty(l:info)
|
||||
call ale#engine#MarkLinterActive(l:info, l:linter)
|
||||
endif
|
||||
|
||||
let s:diagnostic_uri_map[l:request.id] = l:request.uri
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
function! ale#lsp_linter#AddErrorMessage(linter_name, message) abort
|
||||
" This global variable is set here so we don't load the debugging.vim file
|
||||
" until someone uses :ALEInfo.
|
||||
@@ -246,62 +228,25 @@ function! ale#lsp_linter#HandleLSPResponse(conn_id, response) abort
|
||||
if get(a:response, 'jsonrpc', '') is# '2.0' && has_key(a:response, 'error')
|
||||
let l:linter = get(s:lsp_linter_map, a:conn_id, {})
|
||||
|
||||
" Clean up values in the map on error.
|
||||
if empty(l:method) && has_key(s:diagnostic_uri_map, get(a:response, 'id'))
|
||||
call remove(s:diagnostic_uri_map, a:response.id)
|
||||
endif
|
||||
|
||||
call s:HandleLSPErrorMessage(l:linter, a:response)
|
||||
elseif l:method is# 'textDocument/publishDiagnostics'
|
||||
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 l:method is# 'workspace/diagnostic/refresh'
|
||||
call ale#lsp#SendResponse(a:conn_id, a:response.id, v:null)
|
||||
call s:SendPullDiagnosticsForOpenDocuments(a:conn_id)
|
||||
elseif l:method is# 'client/registerCapability'
|
||||
let l:registered_pull_diagnostics = ale#lsp#RegisterCapabilities(
|
||||
\ a:conn_id,
|
||||
\ get(get(a:response, 'params', {}), 'registrations', []),
|
||||
\)
|
||||
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#SendResponse(a:conn_id, a:response.id, v:null)
|
||||
|
||||
if l:registered_pull_diagnostics
|
||||
call s:SendPullDiagnosticsForOpenDocuments(a:conn_id)
|
||||
endif
|
||||
elseif l:method is# 'client/unregisterCapability'
|
||||
let l:unregisterations = get(
|
||||
\ get(a:response, 'params', {}),
|
||||
\ 'unregisterations',
|
||||
\ get(get(a:response, 'params', {}), 'unregistrations', []),
|
||||
\)
|
||||
|
||||
call ale#lsp#UnregisterCapabilities(a:conn_id, l:unregisterations)
|
||||
call ale#lsp#SendResponse(a:conn_id, a:response.id, v:null)
|
||||
elseif l:method is# 'workspace/configuration'
|
||||
let l:items = get(get(a:response, 'params', {}), 'items', [])
|
||||
let l:config = ale#lsp#GetConnectionConfig(a:conn_id)
|
||||
call ale#lsp#SendResponse(a:conn_id, a:response.id, map(copy(l:items), 'l:config'))
|
||||
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,
|
||||
\ g:ale_lsp_show_message_format,
|
||||
\ a:response.params
|
||||
\)
|
||||
elseif empty(l:method) && has_key(s:diagnostic_uri_map, get(a:response, 'id'))
|
||||
let l:uri = remove(s:diagnostic_uri_map, a:response.id)
|
||||
let l:diagnostics = 'unchanged'
|
||||
|
||||
if type(get(a:response, 'result')) is v:t_dict
|
||||
if get(a:response.result, 'kind', '') isnot# 'unchanged'
|
||||
\&& type(get(a:response.result, 'items')) is v:t_list
|
||||
let l:diagnostics = a:response.result.items
|
||||
endif
|
||||
endif
|
||||
|
||||
call ale#lsp_linter#HandleLSPDiagnostics(a:conn_id, l:uri, l:diagnostics)
|
||||
elseif get(a:response, 'type', '') is# 'event'
|
||||
\&& get(a:response, 'event', '') is# 'semanticDiag'
|
||||
call s:HandleTSServerDiagnostics(a:response, 'semantic')
|
||||
@@ -369,11 +314,6 @@ function! ale#lsp_linter#FindProjectRoot(buffer, linter) abort
|
||||
endif
|
||||
endif
|
||||
|
||||
" If the global setting is a string, return that right away.
|
||||
if type(g:ale_root) is v:t_string
|
||||
return g:ale_root
|
||||
endif
|
||||
|
||||
" Try to get a global setting for the root
|
||||
if has_key(g:ale_root, a:linter.name)
|
||||
let l:Root = g:ale_root[a:linter.name]
|
||||
|
||||
+14
-22
@@ -1,8 +1,6 @@
|
||||
" Author: w0rp <devw0rp@gmail.com>
|
||||
" Description: Functions for working with paths in the filesystem.
|
||||
|
||||
let s:is_windows = has('win32') || has('win64') || has('win32unix')
|
||||
|
||||
" simplify a path, and fix annoying issues with paths on Windows.
|
||||
"
|
||||
" Forward slashes are changed to back slashes so path equality works better
|
||||
@@ -29,7 +27,7 @@ endfunction
|
||||
" Simplify a path without a Windows drive letter.
|
||||
" This function can be used for checking if paths are equal.
|
||||
function! ale#path#RemoveDriveLetter(path) abort
|
||||
return s:is_windows && a:path[1:2] =~# '^:[/\\]$'
|
||||
return has('win32') && a:path[1:2] is# ':\'
|
||||
\ ? ale#path#Simplify(a:path[2:])
|
||||
\ : ale#path#Simplify(a:path)
|
||||
endfunction
|
||||
@@ -43,7 +41,7 @@ function! ale#path#FindNearestFile(buffer, filename) abort
|
||||
let l:relative_path = findfile(a:filename, l:buffer_filename . ';')
|
||||
|
||||
if !empty(l:relative_path)
|
||||
return ale#path#Simplify(resolve(fnamemodify(l:relative_path, ':p')))
|
||||
return fnamemodify(l:relative_path, ':p')
|
||||
endif
|
||||
|
||||
return ''
|
||||
@@ -58,7 +56,7 @@ function! ale#path#FindNearestDirectory(buffer, directory_name) abort
|
||||
let l:relative_path = finddir(a:directory_name, l:buffer_filename . ';')
|
||||
|
||||
if !empty(l:relative_path)
|
||||
return ale#path#Simplify(resolve(fnamemodify(l:relative_path, ':p')) . '/')
|
||||
return fnamemodify(l:relative_path, ':p')
|
||||
endif
|
||||
|
||||
return ''
|
||||
@@ -84,11 +82,11 @@ function! ale#path#FindNearestFileOrDirectory(buffer, filename) abort
|
||||
endif
|
||||
|
||||
if !empty(l:relative_path_file)
|
||||
return resolve(fnamemodify(l:relative_path_file, ':p'))
|
||||
return fnamemodify(l:relative_path_file, ':p')
|
||||
endif
|
||||
|
||||
if !empty(l:relative_path_dir)
|
||||
return ale#path#Simplify(resolve(fnamemodify(l:relative_path_dir, ':p')) . '/')
|
||||
return fnamemodify(l:relative_path_dir, ':p')
|
||||
endif
|
||||
|
||||
return ''
|
||||
@@ -147,7 +145,7 @@ endfunction
|
||||
|
||||
" Return 1 if a path is an absolute path.
|
||||
function! ale#path#IsAbsolute(filename) abort
|
||||
if s:is_windows
|
||||
if has('win32')
|
||||
return a:filename[:0] =~# '[\\/]' || a:filename[0:2] =~? '[A-Z]:[/\\]'
|
||||
else
|
||||
return a:filename[:0] is# '/'
|
||||
@@ -155,12 +153,6 @@ function! ale#path#IsAbsolute(filename) abort
|
||||
endfunction
|
||||
|
||||
let s:temp_dir = ale#path#Simplify(fnamemodify(ale#util#Tempname(), ':h:h'))
|
||||
|
||||
if s:temp_dir is# ale#path#Simplify(fnamemodify(s:temp_dir, ':h'))
|
||||
" :h:h resolved to a root path; use :h instead.
|
||||
let s:temp_dir = ale#path#Simplify(fnamemodify(ale#util#Tempname(), ':h'))
|
||||
endif
|
||||
|
||||
let s:resolved_temp_dir = resolve(s:temp_dir)
|
||||
|
||||
" Given a filename, return 1 if the file represents some temporary file
|
||||
@@ -181,7 +173,7 @@ function! ale#path#GetAbsPath(base_directory, filename) abort
|
||||
return ale#path#Simplify(a:filename)
|
||||
endif
|
||||
|
||||
let l:sep = s:is_windows ? '\' : '/'
|
||||
let l:sep = has('win32') ? '\' : '/'
|
||||
|
||||
return ale#path#Simplify(a:base_directory . l:sep . a:filename)
|
||||
endfunction
|
||||
@@ -194,7 +186,7 @@ function! ale#path#Dirname(path) abort
|
||||
endif
|
||||
|
||||
" For /foo/bar/ we need :h:h to get /foo
|
||||
if a:path[-1:] is# '/' || (s:is_windows && a:path[-1:] is# '\')
|
||||
if a:path[-1:] is# '/' || (has('win32') && a:path[-1:] is# '\')
|
||||
return fnamemodify(a:path, ':h:h')
|
||||
endif
|
||||
|
||||
@@ -213,7 +205,7 @@ function! ale#path#IsBufferPath(buffer, complex_filename) abort
|
||||
|
||||
let l:test_filename = ale#path#Simplify(a:complex_filename)
|
||||
|
||||
if l:test_filename[:1] is# './' || l:test_filename[:1] is# '.\'
|
||||
if l:test_filename[:1] is# './'
|
||||
let l:test_filename = l:test_filename[2:]
|
||||
endif
|
||||
|
||||
@@ -227,7 +219,7 @@ function! ale#path#IsBufferPath(buffer, complex_filename) abort
|
||||
let l:test_filename = fnamemodify(l:test_filename, ':t')
|
||||
endif
|
||||
|
||||
let l:buffer_filename = ale#path#Simplify(expand('#' . a:buffer . ':p'))
|
||||
let l:buffer_filename = expand('#' . a:buffer . ':p')
|
||||
|
||||
return l:buffer_filename is# l:test_filename
|
||||
\ || l:buffer_filename[-len(l:test_filename):] is# l:test_filename
|
||||
@@ -235,8 +227,8 @@ endfunction
|
||||
|
||||
" Given a path, return every component of the path, moving upwards.
|
||||
function! ale#path#Upwards(path) abort
|
||||
let l:pattern = s:is_windows ? '\v/+|\\+' : '\v/+'
|
||||
let l:sep = s:is_windows ? '\' : '/'
|
||||
let l:pattern = has('win32') ? '\v/+|\\+' : '\v/+'
|
||||
let l:sep = has('win32') ? '\' : '/'
|
||||
let l:parts = split(ale#path#Simplify(a:path), l:pattern)
|
||||
let l:path_list = []
|
||||
|
||||
@@ -245,7 +237,7 @@ function! ale#path#Upwards(path) abort
|
||||
let l:parts = l:parts[:-2]
|
||||
endwhile
|
||||
|
||||
if s:is_windows && a:path =~# '^[a-zA-z]:\'
|
||||
if has('win32') && a:path =~# '^[a-zA-z]:\'
|
||||
" Add \ to C: for C:\, etc.
|
||||
let l:path_list[-1] .= '\'
|
||||
elseif a:path[0] is# '/'
|
||||
@@ -285,7 +277,7 @@ function! ale#path#FromFileURI(uri) abort
|
||||
let l:path = ale#uri#Decode(l:encoded_path)
|
||||
|
||||
" If the path is like /C:/foo/bar, it should be C:\foo\bar instead.
|
||||
if s:is_windows && l:path =~# '^/[a-zA-Z][:|]'
|
||||
if has('win32') && l:path =~# '^/[a-zA-Z][:|]'
|
||||
let l:path = substitute(l:path[1:], '/', '\\', 'g')
|
||||
let l:path = l:path[0] . ':' . l:path[2:]
|
||||
endif
|
||||
|
||||
@@ -8,8 +8,8 @@ function! s:TemporaryPSScript(buffer, input) abort
|
||||
" Create a temp dir to house our temp .ps1 script
|
||||
" a temp dir is needed as powershell needs the .ps1
|
||||
" extension
|
||||
let l:tempscript = ale#path#GetAbsPath(ale#util#Tempname(), l:filename)
|
||||
let l:tempdir = fnamemodify(l:tempscript, ':h')
|
||||
let l:tempdir = ale#util#Tempname() . (has('win32') ? '\' : '/')
|
||||
let l:tempscript = l:tempdir . l:filename
|
||||
" Create the temporary directory for the file, unreadable by 'other'
|
||||
" users.
|
||||
call mkdir(l:tempdir, '', 0750)
|
||||
|
||||
@@ -42,10 +42,9 @@ function! ale#python#FindProjectRootIni(buffer) abort
|
||||
\|| filereadable(l:path . '/Pipfile.lock')
|
||||
\|| filereadable(l:path . '/poetry.lock')
|
||||
\|| filereadable(l:path . '/pyproject.toml')
|
||||
\|| filereadable(l:path . '/ty.toml')
|
||||
\|| filereadable(l:path . '/.tool-versions')
|
||||
\|| filereadable(l:path . '/uv.lock')
|
||||
return resolve(l:path)
|
||||
return l:path
|
||||
endif
|
||||
endfor
|
||||
|
||||
@@ -70,7 +69,7 @@ function! ale#python#FindProjectRoot(buffer) abort
|
||||
|
||||
for l:path in ale#path#Upwards(expand('#' . a:buffer . ':p:h'))
|
||||
if !filereadable(l:path . '/__init__.py')
|
||||
return resolve(l:path)
|
||||
return l:path
|
||||
endif
|
||||
endfor
|
||||
|
||||
@@ -94,7 +93,7 @@ function! ale#python#FindVirtualenv(buffer) abort
|
||||
\)
|
||||
|
||||
if filereadable(l:script_filename)
|
||||
return resolve(l:venv_dir)
|
||||
return l:venv_dir
|
||||
endif
|
||||
endfor
|
||||
endfor
|
||||
|
||||
+3
-14
@@ -3,10 +3,6 @@
|
||||
"
|
||||
" This file should not typically be loaded during the normal execution of ALE.
|
||||
|
||||
" Determine the repository root from this script's location.
|
||||
" autoload/ale/test.vim -> :h:h:h = repo root
|
||||
let s:repo_root = expand('<sfile>:p:h:h:h')
|
||||
|
||||
" Change the directory for checking things in particular test directories
|
||||
"
|
||||
" This function will set the g:dir variable, which represents the working
|
||||
@@ -20,16 +16,9 @@ function! ale#test#SetDirectory(docker_path) abort
|
||||
throw 'docker_path must start with /testplugin/!'
|
||||
endif
|
||||
|
||||
if has('win32')
|
||||
" On Windows (outside Docker), map /testplugin/ to the repo root.
|
||||
let l:win_path = s:repo_root . a:docker_path[len('/testplugin'):]
|
||||
silent! execute 'cd ' . fnameescape(l:win_path)
|
||||
else
|
||||
" Try to switch directory, which will fail when running tests directly,
|
||||
" and not through the Docker image.
|
||||
silent! execute 'cd ' . fnameescape(a:docker_path)
|
||||
endif
|
||||
|
||||
" Try to switch directory, which will fail when running tests directly,
|
||||
" and not through the Docker image.
|
||||
silent! execute 'cd ' . fnameescape(a:docker_path)
|
||||
let g:dir = getcwd() " no-custom-checks
|
||||
endfunction
|
||||
|
||||
|
||||
+58
-70
@@ -13,7 +13,7 @@ CONTENTS *ale-development-contents*
|
||||
4. Testing ALE..........................|ale-development-tests|
|
||||
4.1. Writing Linter Tests.............|ale-development-linter-tests|
|
||||
4.2. Writing Fixer Tests..............|ale-development-fixer-tests|
|
||||
4.3. Running Tests on Windows.........|ale-development-windows-tests|
|
||||
4.3. Running Tests in a Windows VM....|ale-development-windows-tests|
|
||||
5. Contributing.........................|ale-development-contributing|
|
||||
5.1. Preparing a Release..............|ale-development-release|
|
||||
|
||||
@@ -50,7 +50,7 @@ documented functions and options, until a major version is planned. Breaking
|
||||
changes should be preceded by a deprecation phase complete with warnings.
|
||||
Changes required for security may be an exception.
|
||||
|
||||
ALE supports Vim 8.2 and above, and Neovim 0.10.0 or newer. These are the
|
||||
ALE supports Vim 8 and above, and Neovim 0.7.0 or newer. These are the
|
||||
earliest versions of Vim and Neovim which support |+job|, |+timer|,
|
||||
|+closure|, and |+lambda| features. All ALE code should be written so it is
|
||||
compatible with these versions of Vim, or with version checks so particular
|
||||
@@ -156,13 +156,15 @@ Apply the following rules when writing Bash scripts.
|
||||
===============================================================================
|
||||
4. Testing ALE *ale-development-tests* *ale-dev-tests* *ale-tests*
|
||||
|
||||
ALE is tested with a suite of tests executed via GitHub Actions. ALE runs
|
||||
tests with the following versions of Vim in the following environments.
|
||||
ALE is tested with a suite of tests executed via GitHub Actions and AppVeyor.
|
||||
ALE runs tests with the following versions of Vim in the following
|
||||
environments.
|
||||
|
||||
1. Vim 8.2 on Linux and Windows via GitHub Actions.
|
||||
2. Vim 9.2 on Linux and Windows via GitHub Actions.
|
||||
3. Neovim 0.10 on Linux and Windows via GitHub Actions.
|
||||
4. Neovim 0.12 on Linux and Windows via GitHub Actions.
|
||||
1. Vim 8.0.0027 on Linux via GitHub Actions.
|
||||
2. Vim 9.0.0297 on Linux via GitHub Actions.
|
||||
3. Neovim 0.7.0 on Linux via GitHub Actions.
|
||||
4. Neovim 0.8.0 on Linux via GitHub Actions.
|
||||
6. Vim 8 (stable builds) on Windows via AppVeyor.
|
||||
|
||||
If you are developing ALE code on Linux, Mac OSX, or BSD, you can run ALEs
|
||||
tests by installing Docker and running the `run-tests` script. Follow the
|
||||
@@ -202,24 +204,9 @@ See |ale-development-linter-tests| for more information on how to write linter
|
||||
tests.
|
||||
|
||||
When you add new linters or fixers, make sure to add them into the tables in
|
||||
`../supported-tools.md` and |ale-supported-languages-and-tools.txt|.
|
||||
|
||||
The supported tools lists are very long, so please bear in mind the meanings
|
||||
of the emojis and special characters in the Vim help file.
|
||||
>
|
||||
| Key | Definition |
|
||||
| -------------- | ----------------------------------------------------- |
|
||||
|:speech_balloon:| Language Server Protocol (LSP) |
|
||||
| :floppy_disk: | Only runs on disk (see: `help ale-lint-file-linters`) |
|
||||
| :warning: | Disabled by default |
|
||||
<
|
||||
>
|
||||
`^` No linters for text or Vim help filetypes are enabled by default.
|
||||
`!!` These linters check only files on disk. See |ale-lint-file-linters|
|
||||
<
|
||||
|
||||
If you forget to keep them both in sync, you should see an error like the
|
||||
following in the builds run for GitHub Actions.
|
||||
supported-tools.md and |ale-supported-languages-and-tools.txt|. If you forget to
|
||||
keep them both in sync, you should see an error like the following in the
|
||||
builds run for GitHub Actions.
|
||||
>
|
||||
========================================
|
||||
diff supported-tools.md and doc/ale-supported-languages-and-tools.txt tables
|
||||
@@ -390,25 +377,15 @@ given the above setup are as follows.
|
||||
|
||||
|
||||
===============================================================================
|
||||
4.3 Running Tests on Windows *ale-development-windows-tests*
|
||||
4.3 Running Tests in a Windows VM *ale-development-windows-tests*
|
||||
|
||||
Tests are run for ALE on Windows via GitHub Actions using the
|
||||
`rhysd/action-setup-vim` action to install Vim and Neovim. These tests can
|
||||
frequently break due to minor differences in paths and how escaping is done
|
||||
for commands on Windows.
|
||||
Tests are run for ALE in a build of Vim 8 for Windows via AppVeyor. These
|
||||
tests can frequently break due to minor differences in paths and how escaping
|
||||
is done for commands on Windows. If you are a Linux or Mac user, running these
|
||||
tests locally can be difficult. Here is a process that will make that easier.
|
||||
|
||||
The GitHub Actions workflow automatically:
|
||||
1. Installs the specified Vim or Neovim version.
|
||||
2. Clones Vader to `C:\vader` at the pinned commit.
|
||||
3. Creates a directory junction from `C:\testplugin` to the repository
|
||||
checkout, so all test paths referencing `/testplugin/` resolve correctly.
|
||||
4. Runs `run-tests.bat` with the installed editor.
|
||||
|
||||
If you are a Linux or Mac user and need to run Windows tests locally, you
|
||||
can use a Windows virtual machine. Here is a process for that.
|
||||
|
||||
First, install a Windows image with VirtualBox. Install VirtualBox and grab
|
||||
a VirtualBox image for Windows such as from here:
|
||||
First, you want to install a Windows image with VirtualBox. Install VirtualBox
|
||||
and grab a VirtualBox image for Windows such as from here:
|
||||
https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/
|
||||
|
||||
NOTE: If you need to enter a password for the virtual machine at any point,
|
||||
@@ -417,6 +394,9 @@ the password is "Passw0rd!" without the double quotes.
|
||||
NOTE: If your trial period for Windows runs out, run the commands like the
|
||||
wallpaper tells you to.
|
||||
|
||||
Your virtual machine will need to have PowerShell installed. Before you go any
|
||||
further, confirm that PowerShell is installed in your Windows virtual machine.
|
||||
|
||||
Consult the VirtualBox documentation on how to install "Guest Additions."
|
||||
You probably want to install "Guest Additions" for most things to work
|
||||
properly.
|
||||
@@ -428,41 +408,49 @@ example: "/home/w0rp/ale"
|
||||
|
||||
Find out which drive letter "ale" has been mounted as in Windows. We'll use
|
||||
"E:" as the drive letter, for example. Open the command prompt as an
|
||||
administrator and type the following command to create a junction for the
|
||||
"ale" directory, where "E:" is replaced with your drive letter. >
|
||||
administrator by typing in `cmd` in the start menu, right clicking on the
|
||||
command prompt application, and clicking "Run as administrator." Click "Yes"
|
||||
when prompted to ask if you're sure you want to run the command prompt. You
|
||||
should type in the following command to mount the "ale" directory for testing,
|
||||
where "E:" is replaced with your drive letter. >
|
||||
|
||||
mklink /J C:\testplugin E:
|
||||
mklink /D C:\testplugin E:
|
||||
<
|
||||
Install Vader by opening PowerShell and running: >
|
||||
Close the administrator Command Prompt, and try running the command
|
||||
`type C:\testplugin\LICENSE` in a new Command Prompt which you are NOT running
|
||||
as administrator. You should see the license for ALE in your terminal. After
|
||||
you have confirmed that you have mounted ALE on your machine, search in the
|
||||
Start Menu for "power shell," run PowerShell as an administrator, and issue
|
||||
the following commands to install the correct Vim and Vader versions for
|
||||
running tests. >
|
||||
|
||||
git clone https://github.com/junegunn/vader.vim C:\vader
|
||||
cd C:\vader
|
||||
git checkout -qf c6243dd81c98350df4dec608fa972df98fa2a3af
|
||||
Add-Type -A System.IO.Compression.FileSystem
|
||||
|
||||
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')
|
||||
rm C:\vim.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')
|
||||
rm C:\rt.zip
|
||||
|
||||
Invoke-WebRequest https://github.com/junegunn/vader.vim/archive/c6243dd81c98350df4dec608fa972df98fa2a3af.zip -OutFile C:\vader.zip
|
||||
[IO.Compression.ZipFile]::ExtractToDirectory('C:\vader.zip', 'C:\')
|
||||
mv C:\vader.vim-c6243dd81c98350df4dec608fa972df98fa2a3af C:\vader
|
||||
rm C:\vader.zip
|
||||
<
|
||||
Install Vim or Neovim on your Windows machine. You can download Vim from
|
||||
https://github.com/vim/vim-win32-installer/releases or Neovim from
|
||||
https://github.com/neovim/neovim/releases .
|
||||
|
||||
After you have finished installing everything, you can run the tests by
|
||||
setting the `VIM_EXE` environment variable to the path of your Vim or
|
||||
Neovim executable and running `run-tests.bat`. For Neovim, also set
|
||||
`VIM_HEADLESS` to `--headless`. >
|
||||
After you have finished installing everything, you can run all of the tests
|
||||
in Windows by opening a Command Prompt NOT as an administrator by navigating
|
||||
to the directory where you've mounted the ALE code, which must be named
|
||||
`C:\testplugin`, and by running the `run-tests.bat` batch file. >
|
||||
|
||||
cd C:\testplugin
|
||||
set VIM_EXE=C:\path\to\vim.exe
|
||||
run-tests
|
||||
<
|
||||
For Neovim: >
|
||||
|
||||
cd C:\testplugin
|
||||
set VIM_EXE=C:\path\to\nvim.exe
|
||||
set VIM_HEADLESS=--headless
|
||||
run-tests
|
||||
<
|
||||
It will probably take several minutes for all of the tests to run. Be
|
||||
patient. You can run a specific test by passing the filename as an argument
|
||||
to the batch file, for example: `run-tests test/test_c_flag_parsing.vader`.
|
||||
This will give you results much more quickly.
|
||||
It will probably take several minutes for all of the tests to run. Be patient.
|
||||
You can run a specific test by passing the filename as an argument to the
|
||||
batch file, for example: `run-tests test/test_c_flag_parsing.vader` . This will
|
||||
give you results much more quickly.
|
||||
|
||||
|
||||
===============================================================================
|
||||
|
||||
@@ -11,78 +11,6 @@ See |ale-html-djlint|
|
||||
===============================================================================
|
||||
j2lint *ale-jinja-j2lint*
|
||||
|
||||
*ale-options.jinja_j2lint_executable*
|
||||
*g:ale_jinja_j2lint_executable*
|
||||
*b:ale_jinja_j2lint_executable*
|
||||
jinja_j2lint_executable
|
||||
g:ale_jinja_j2lint_executable
|
||||
Type: |String|
|
||||
Default: `'j2lint'`
|
||||
|
||||
See |ale-integrations-local-executables|
|
||||
|
||||
Set this to `'pipenv'` to invoke `'pipenv` `run` `j2lint'`.
|
||||
Set this to `'poetry'` to invoke `'poetry` `run` `j2lint'`.
|
||||
Set this to `'uv'` to invoke `'uv` `run` `j2lint'`.
|
||||
|
||||
*ale-options.jinja_j2lint_options*
|
||||
*g:ale_jinja_j2lint_options*
|
||||
*b:ale_jinja_j2lint_options*
|
||||
|
||||
jinja_j2lint_options
|
||||
g:ale_jinja_j2lint_options
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
This variable can be changed to add command-line arguments to the
|
||||
j2lint invocation.
|
||||
|
||||
*ale-options.jinja_j2lint_use_global*
|
||||
*g:ale_jinja_j2lint_use_global*
|
||||
*b:ale_jinja_j2lint_use_global*
|
||||
|
||||
jinja_j2lint_use_global
|
||||
g:ale_jinja_j2lint_use_global
|
||||
Type: |Number|
|
||||
Default: `get(g:, 'ale_use_global_executables', 0)`
|
||||
|
||||
See |ale-integrations-local-executables|
|
||||
|
||||
*ale-options.jinja_j2lint_auto_pipenv*
|
||||
*g:ale_jinja_j2lint_auto_pipenv*
|
||||
*b:ale_jinja_j2lint_auto_pipenv*
|
||||
|
||||
jinja_j2lint_auto_pipenv
|
||||
g:ale_jinja_j2lint_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.jinja_j2lint_auto_poetry*
|
||||
*g:ale_jinja_j2lint_auto_poetry*
|
||||
*b:ale_jinja_j2lint_auto_poetry*
|
||||
|
||||
jinja_j2lint_auto_poetry
|
||||
g:ale_jinja_j2lint_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.jinja_j2lint_auto_uv*
|
||||
*g:ale_jinja_j2lint_auto_uv*
|
||||
*b:ale_jinja_j2lint_auto_uv*
|
||||
|
||||
jinja_j2lint_auto_uv
|
||||
g:ale_jinja_j2lint_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:
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
===============================================================================
|
||||
ALE LilyPond Integration *ale-lilypond-options*
|
||||
|
||||
|
||||
===============================================================================
|
||||
lilypond *ale-lilypond*
|
||||
|
||||
g:ale_lilypond_lilypond_executable *g:ale_lilypond_lilypond_executable*
|
||||
*b:ale_lilypond_lilypond_executable*
|
||||
Type: |String|
|
||||
Default: `'lilypond'`
|
||||
|
||||
This variable can be changed to modify the executable used for lilypond.
|
||||
|
||||
|
||||
g:ale_lilypond_lilypond_options *g:ale_lilypond_lilypond_options*
|
||||
*b:ale_lilypond_lilypond_options*
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
This variable can be changed to modify flags given to lilypond.
|
||||
|
||||
For example, to add custom include paths: >
|
||||
|
||||
let g:ale_lilypond_lilypond_options = '--include=/path/to/includes'
|
||||
<
|
||||
|
||||
===============================================================================
|
||||
vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl:
|
||||
@@ -14,35 +14,6 @@ dprint *ale-markdown-dprint*
|
||||
See |ale-dprint-options| and https://dprint.dev/plugins/markdown
|
||||
|
||||
|
||||
===============================================================================
|
||||
harper *ale-markdown-harper*
|
||||
|
||||
*ale-options.markdown_harper_config*
|
||||
*g:ale_markdown_harper_config*
|
||||
*b:ale_markdown_harper_config*
|
||||
markdown_harper_config
|
||||
g:ale_markdown_harper_config
|
||||
Type: |Dictionary|
|
||||
Default: `{'harper-ls': {'diagnosticSeverity': 'hint', 'dialect': 'American', ...}}`
|
||||
|
||||
Dictionary passed to harper-ls as LSP workspace configuration. The default
|
||||
enables spell check, sentence capitalization, repeated words, long
|
||||
sentences, a/an errors, and spacing rules, and disables spelled-out numbers
|
||||
and wrong-quote checks.
|
||||
|
||||
Example: >
|
||||
let g:ale_markdown_harper_config = {
|
||||
\ 'harper-ls': {
|
||||
\ 'diagnosticSeverity': 'warning',
|
||||
\ 'linters': {
|
||||
\ 'SpellCheck': v:true,
|
||||
\ 'LongSentences': v:false,
|
||||
\ },
|
||||
\ },
|
||||
\}
|
||||
<
|
||||
|
||||
|
||||
===============================================================================
|
||||
markdownlint *ale-markdown-markdownlint*
|
||||
|
||||
@@ -244,40 +215,6 @@ g:ale_markdown_remark_lint_use_global
|
||||
See |ale-integrations-local-executables|
|
||||
|
||||
|
||||
===============================================================================
|
||||
rumdl *ale-markdown-rumdl*
|
||||
|
||||
*ale-options.markdown_rumdl_executable*
|
||||
*g:ale_markdown_rumdl_executable*
|
||||
*b:ale_markdown_rumdl_executable*
|
||||
markdown_rumdl_executable
|
||||
g:ale_markdown_rumdl_executable
|
||||
Type: |String|
|
||||
Default: `'rumdl'`
|
||||
|
||||
Override the invoked `rumdl` binary.
|
||||
|
||||
*ale-options.markdown_rumdl_options*
|
||||
*g:ale_markdown_rumdl_options*
|
||||
*b:ale_markdown_rumdl_options*
|
||||
markdown_rumdl_options
|
||||
g:ale_markdown_rumdl_options
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
This variable can be set to pass additional options to `rumdl server`.
|
||||
|
||||
*ale-options.markdown_rumdl_fmt_options*
|
||||
*g:ale_markdown_rumdl_fmt_options*
|
||||
*b:ale_markdown_rumdl_fmt_options*
|
||||
markdown_rumdl_fmt_options
|
||||
g:ale_markdown_rumdl_fmt_options
|
||||
Type: |String|
|
||||
Default: `'--silent'`
|
||||
|
||||
This variable can be set to pass additional options to `rumdl fmt`.
|
||||
|
||||
|
||||
===============================================================================
|
||||
textlint *ale-markdown-textlint*
|
||||
|
||||
|
||||
+1
-48
@@ -70,6 +70,7 @@ g:ale_perl_languageserver_config
|
||||
For all available options and explanations, visit
|
||||
https://metacpan.org/pod/Perl::LanguageServer#Extension-Settings
|
||||
|
||||
|
||||
===============================================================================
|
||||
perlcritic *ale-perl-perlcritic*
|
||||
|
||||
@@ -126,54 +127,6 @@ g:ale_perl_perlcritic_showrules
|
||||
Defaults to off to reduce length of message.
|
||||
|
||||
|
||||
|
||||
===============================================================================
|
||||
perlnavigator *ale-perl-perlnavigator*
|
||||
|
||||
*ale-options.perl_perlnavigator_executable*
|
||||
*g:ale_perl_perlnavigator_executable*
|
||||
*b:ale_perl_perlnavigator_executable*
|
||||
perl_perlnavigator_executable
|
||||
g:ale_perl_perlnavigator_executable
|
||||
Type: |String|
|
||||
Default: `'perlnavigator'`
|
||||
|
||||
This variable can be changed to modify the perlnavigator executable used for
|
||||
linting perl.
|
||||
|
||||
*ale-options.perl_perlnavigator_config*
|
||||
*g:ale_perl_perlnavigator_config*
|
||||
*b:ale_perl_perlnavigator_config*
|
||||
perl_perlnavigator_config
|
||||
g:ale_perl_perlnavigator_config
|
||||
Type: |Dictionary|
|
||||
Default: `'{}'`
|
||||
|
||||
This variable can be changed to customize the lsp_config (sent as a
|
||||
workspace/didChangeConfiguration command) for perlnavigator.
|
||||
For example: >
|
||||
|
||||
let g:ale_perl_perlnavigator_config = {
|
||||
\ 'perlnavigator': {
|
||||
\ 'enableWarnings': 1,
|
||||
\ 'includePaths': [ $HOME . '/MyPerlStuff/lib', '/tmp/tmp.7qSgUo34e' ],
|
||||
\ 'perlEnvAdd': 1,
|
||||
\ 'perlEnv': {
|
||||
\ 'PERL_DL_NONLAZY': 1,
|
||||
\ },
|
||||
\ 'perlPath': substitute(g:ale_perl_perl_executable, '/perl$', '', ''),
|
||||
\ 'perlcriticEnabled': 1,
|
||||
\ 'perlcriticProfile': '$workspaceFolder/.perlcriticrc',
|
||||
\ 'perltidyProfile': '$workspaceFolder/.perltidyrc',
|
||||
\ 'perlcriticSeverity': 2,
|
||||
\ },
|
||||
\ }
|
||||
\}
|
||||
|
||||
<
|
||||
For all available options and explanations, visit
|
||||
https://github.com/bscan/PerlNavigator?tab=readme-ov-file
|
||||
|
||||
===============================================================================
|
||||
perltidy *ale-perl-perltidy*
|
||||
|
||||
|
||||
@@ -79,7 +79,6 @@ ALE will look for configuration files with the following filenames. >
|
||||
Pipfile.lock
|
||||
poetry.lock
|
||||
pyproject.toml
|
||||
ty.toml
|
||||
.tool-versions
|
||||
uv.lock
|
||||
<
|
||||
@@ -2107,79 +2106,6 @@ g:ale_python_ruff_format_auto_uv
|
||||
executable.
|
||||
|
||||
|
||||
===============================================================================
|
||||
ty *ale-python-ty*
|
||||
|
||||
`ty` will be run from a detected project root, per |ale-python-root|.
|
||||
|
||||
*ale-options.python_ty_executable*
|
||||
*g:ale_python_ty_executable*
|
||||
*b:ale_python_ty_executable*
|
||||
python_ty_executable
|
||||
g:ale_python_ty_executable
|
||||
Type: |String|
|
||||
Default: `'ty'`
|
||||
|
||||
See |ale-integrations-local-executables|
|
||||
|
||||
Set this to `'pipenv'` to invoke `'pipenv` `run` `ty'`.
|
||||
Set this to `'poetry'` to invoke `'poetry` `run` `ty'`.
|
||||
Set this to `'uv'` to invoke `'uv` `run` `ty'`.
|
||||
|
||||
*ale-options.python_ty_use_global*
|
||||
*g:ale_python_ty_use_global*
|
||||
*b:ale_python_ty_use_global*
|
||||
python_ty_use_global
|
||||
g:ale_python_ty_use_global
|
||||
Type: |Number|
|
||||
Default: `get(g:, 'ale_use_global_executables', 0)`
|
||||
|
||||
See |ale-integrations-local-executables|
|
||||
|
||||
*ale-options.python_ty_auto_pipenv*
|
||||
*g:ale_python_ty_auto_pipenv*
|
||||
*b:ale_python_ty_auto_pipenv*
|
||||
python_ty_auto_pipenv
|
||||
g:ale_python_ty_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.python_ty_auto_poetry*
|
||||
*g:ale_python_ty_auto_poetry*
|
||||
*b:ale_python_ty_auto_poetry*
|
||||
python_ty_auto_poetry
|
||||
g:ale_python_ty_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.python_ty_auto_uv*
|
||||
*g:ale_python_ty_auto_uv*
|
||||
*b:ale_python_ty_auto_uv*
|
||||
python_ty_auto_uv
|
||||
g:ale_python_ty_auto_uv
|
||||
Type: |Number|
|
||||
Default: `0`
|
||||
|
||||
Set the executable to `uv` if true. This is overridden by a manually-set
|
||||
executable.
|
||||
|
||||
*ale-options.python_ty_config*
|
||||
*g:ale_python_ty_config*
|
||||
*b:ale_python_ty_config*
|
||||
python_ty_config
|
||||
g:ale_python_ty_config
|
||||
Type: |Dictionary|
|
||||
Default: `{}`
|
||||
|
||||
Dictionary with language server configuration settings for `ty`.
|
||||
|
||||
|
||||
===============================================================================
|
||||
unimport *ale-python-unimport*
|
||||
|
||||
|
||||
+2
-2
@@ -227,8 +227,8 @@ g:ale_ruby_solargraph_executable
|
||||
Type: |String|
|
||||
Default: `'solargraph'`
|
||||
|
||||
Override the invoked solargraph binary. Set this to `'bundle'` to invoke
|
||||
`'bundle` `exec` solargraph'.
|
||||
Override the invoked solargraph binary. This is useful for running solargraph
|
||||
from binstubs or a bundle.
|
||||
|
||||
|
||||
===============================================================================
|
||||
|
||||
@@ -373,7 +373,6 @@ Notes:
|
||||
* `lacheck`
|
||||
* `proselint`
|
||||
* `redpen`
|
||||
* `tex-fmt`
|
||||
* `texlab`
|
||||
* `textlint`
|
||||
* `vale`
|
||||
@@ -384,8 +383,6 @@ Notes:
|
||||
* `lessc`
|
||||
* `prettier`
|
||||
* `stylelint`
|
||||
* LilyPond
|
||||
* `lilypond`
|
||||
* LLVM
|
||||
* `llc`
|
||||
* Lua
|
||||
@@ -407,7 +404,6 @@ Notes:
|
||||
* Markdown
|
||||
* `alex`
|
||||
* `cspell`
|
||||
* `harper`
|
||||
* `languagetool`!!
|
||||
* `markdownlint`!!
|
||||
* `marksman`
|
||||
@@ -418,7 +414,6 @@ Notes:
|
||||
* `pymarkdown`
|
||||
* `redpen`
|
||||
* `remark-lint`
|
||||
* `rumdl`
|
||||
* `textlint`
|
||||
* `vale`
|
||||
* `write-good`
|
||||
@@ -484,7 +479,6 @@ Notes:
|
||||
* `languageserver`
|
||||
* `perl -c`
|
||||
* `perl-critic`
|
||||
* `perlnavigator`
|
||||
* `perltidy`
|
||||
* Perl6
|
||||
* `perl6 -c`
|
||||
@@ -563,7 +557,6 @@ Notes:
|
||||
* `reorder-python-imports`
|
||||
* ruff
|
||||
* ruff-format
|
||||
* `ty`
|
||||
* `unimport`
|
||||
* `vulture`!!
|
||||
* `yapf`
|
||||
|
||||
@@ -70,30 +70,6 @@ g:ale_tex_latexindent_options
|
||||
This variable can be changed to modify flags given to latexindent.
|
||||
|
||||
|
||||
===============================================================================
|
||||
tex-fmt *ale-tex-tex-fmt*
|
||||
|
||||
*ale-options.tex_tex_fmt_executable*
|
||||
*g:ale_tex_tex_fmt_executable*
|
||||
*b:ale_tex_tex_fmt_executable*
|
||||
tex_tex_fmt_executable
|
||||
g:ale_tex_tex_fmt_executable
|
||||
Type: |String|
|
||||
Default: `'tex-fmt'`
|
||||
|
||||
See |ale-integrations-local-executables|.
|
||||
|
||||
*ale-options.tex_tex_fmt_options*
|
||||
*g:ale_tex_tex_fmt_options*
|
||||
*b:ale_tex_tex_fmt_options*
|
||||
tex_tex_fmt_options
|
||||
g:ale_tex_tex_fmt_options
|
||||
Type: |String|
|
||||
Default: `''`
|
||||
|
||||
This variable can be changed to modify flags given to tex-fmt.
|
||||
|
||||
|
||||
===============================================================================
|
||||
texlab *ale-tex-texlab*
|
||||
|
||||
|
||||
+11
-30
@@ -1143,20 +1143,6 @@ g:ale_completion_max_suggestions
|
||||
Adjust this option as needed, depending on the complexity of your codebase
|
||||
and your available processing power.
|
||||
|
||||
*ale-options.completion_timeout*
|
||||
*g:ale_completion_timeout*
|
||||
completion_timeout
|
||||
g:ale_completion_timeout
|
||||
Type: |Number|
|
||||
Default: `3`
|
||||
|
||||
The maximum time in seconds ale#completion#OmniFunc() will wait for a
|
||||
completion result from the language server.
|
||||
|
||||
When the timeout is exceeded ale#completion#OmniFunc() will print an error
|
||||
message and return an empty result. Setting a higher value allows longer
|
||||
response times, but it may also keep Vim unresponsible for a longer time.
|
||||
|
||||
*ale-options.cursor_detail*
|
||||
*g:ale_cursor_detail*
|
||||
cursor_detail
|
||||
@@ -1958,7 +1944,7 @@ g:ale_linters
|
||||
\ 'jsonc': [],
|
||||
\ 'perl': ['perlcritic'],
|
||||
\ 'perl6': [],
|
||||
\ 'python': ['flake8', 'mypy', 'pylint', 'pyright', 'ruff', 'ty'],
|
||||
\ 'python': ['flake8', 'mypy', 'pylint', 'pyright', 'ruff'],
|
||||
\ 'rust': ['analyzer', 'cargo'],
|
||||
\ 'spec': [],
|
||||
\ 'text': [],
|
||||
@@ -2348,8 +2334,10 @@ g:ale_root
|
||||
This option is used to determine the project root for a linter. If the value
|
||||
is a |Dictionary|, it maps a linter to either a |String| containing the
|
||||
project root or a |Funcref| to call to look up the root. The |Funcref| is
|
||||
provided the buffer number as its argument. If the the value is a string, it
|
||||
will be interpreted as the project root itself.
|
||||
provided the buffer number as its argument.
|
||||
|
||||
The buffer-specific variable may additionally be a string containing the
|
||||
project root itself.
|
||||
|
||||
If neither variable yields a result, a linter-specific function is invoked to
|
||||
detect a project root. If this, too, yields no result, and the linter is an
|
||||
@@ -3466,8 +3454,6 @@ documented in additional help files.
|
||||
cspell................................|ale-c-cspell|
|
||||
flawfinder............................|ale-c-flawfinder|
|
||||
uncrustify............................|ale-c-uncrustify|
|
||||
c3......................................|ale-c3-options|
|
||||
c3lsp.................................|ale-c3-c3lsp|
|
||||
cairo...................................|ale-cairo-options|
|
||||
scarb.................................|ale-cairo-scarb|
|
||||
starknet..............................|ale-cairo-starknet|
|
||||
@@ -3519,6 +3505,8 @@ documented in additional help files.
|
||||
clang-format..........................|ale-cuda-clangformat|
|
||||
clangd................................|ale-cuda-clangd|
|
||||
nvcc..................................|ale-cuda-nvcc|
|
||||
c3......................................|ale-c3-options|
|
||||
c3lsp.................................|ale-c3-c3lsp|
|
||||
d.......................................|ale-d-options|
|
||||
dfmt..................................|ale-d-dfmt|
|
||||
dls...................................|ale-d-dls|
|
||||
@@ -3710,14 +3698,14 @@ documented in additional help files.
|
||||
prettier..............................|ale-json-prettier|
|
||||
spectral..............................|ale-json-spectral|
|
||||
vscodejson............................|ale-json-vscode|
|
||||
json5...................................|ale-json5-options|
|
||||
eslint................................|ale-json5-eslint|
|
||||
jsonc...................................|ale-jsonc-options|
|
||||
biome.................................|ale-jsonc-biome|
|
||||
eslint................................|ale-jsonc-eslint|
|
||||
jsonnet.................................|ale-jsonnet-options|
|
||||
jsonnetfmt............................|ale-jsonnet-jsonnetfmt|
|
||||
jsonnet-lint..........................|ale-jsonnet-jsonnet-lint|
|
||||
json5...................................|ale-json5-options|
|
||||
eslint................................|ale-json5-eslint|
|
||||
julia...................................|ale-julia-options|
|
||||
languageserver........................|ale-julia-languageserver|
|
||||
kotlin..................................|ale-kotlin-options|
|
||||
@@ -3734,8 +3722,6 @@ documented in additional help files.
|
||||
lessc.................................|ale-less-lessc|
|
||||
prettier..............................|ale-less-prettier|
|
||||
stylelint.............................|ale-less-stylelint|
|
||||
lilypond................................|ale-lilypond-options|
|
||||
lilypond..............................|ale-lilypond|
|
||||
llvm....................................|ale-llvm-options|
|
||||
llc...................................|ale-llvm-llc|
|
||||
lua.....................................|ale-lua-options|
|
||||
@@ -3752,7 +3738,6 @@ documented in additional help files.
|
||||
markdown................................|ale-markdown-options|
|
||||
cspell................................|ale-markdown-cspell|
|
||||
dprint................................|ale-markdown-dprint|
|
||||
harper................................|ale-markdown-harper|
|
||||
markdownlint..........................|ale-markdown-markdownlint|
|
||||
marksman..............................|ale-markdown-marksman|
|
||||
mdl...................................|ale-markdown-mdl|
|
||||
@@ -3760,7 +3745,6 @@ documented in additional help files.
|
||||
prettier..............................|ale-markdown-prettier|
|
||||
pymarkdown............................|ale-markdown-pymarkdown|
|
||||
remark-lint...........................|ale-markdown-remark-lint|
|
||||
rumdl.................................|ale-markdown-rumdl|
|
||||
textlint..............................|ale-markdown-textlint|
|
||||
write-good............................|ale-markdown-write-good|
|
||||
redpen................................|ale-markdown-redpen|
|
||||
@@ -3820,7 +3804,6 @@ documented in additional help files.
|
||||
perl..................................|ale-perl-perl|
|
||||
perl language server..................|ale-perl-languageserver|
|
||||
perlcritic............................|ale-perl-perlcritic|
|
||||
perlnavigator.........................|ale-perl-perlnavigator|
|
||||
perltidy..............................|ale-perl-perltidy|
|
||||
perl6...................................|ale-perl6-options|
|
||||
perl6.................................|ale-perl6-perl6|
|
||||
@@ -3896,7 +3879,6 @@ documented in additional help files.
|
||||
reorder-python-imports................|ale-python-reorder_python_imports|
|
||||
ruff..................................|ale-python-ruff|
|
||||
ruff-format...........................|ale-python-ruff-format|
|
||||
ty....................................|ale-python-ty|
|
||||
unimport..............................|ale-python-unimport|
|
||||
vulture...............................|ale-python-vulture|
|
||||
yapf..................................|ale-python-yapf|
|
||||
@@ -4021,7 +4003,6 @@ documented in additional help files.
|
||||
cspell................................|ale-tex-cspell|
|
||||
lacheck...............................|ale-tex-lacheck|
|
||||
latexindent...........................|ale-tex-latexindent|
|
||||
tex-fmt...............................|ale-tex-tex-fmt|
|
||||
texlab................................|ale-tex-texlab|
|
||||
redpen................................|ale-tex-redpen|
|
||||
texinfo.................................|ale-texinfo-options|
|
||||
@@ -4071,11 +4052,11 @@ documented in additional help files.
|
||||
hdl-checker...........................|ale-vhdl-hdl-checker|
|
||||
vcom..................................|ale-vhdl-vcom|
|
||||
xvhdl.................................|ale-vhdl-xvhdl|
|
||||
vim help................................|ale-vim-help-options|
|
||||
write-good............................|ale-vim-help-write-good|
|
||||
vim.....................................|ale-vim-options|
|
||||
vimls.................................|ale-vim-vimls|
|
||||
vint..................................|ale-vim-vint|
|
||||
vim help................................|ale-vim-help-options|
|
||||
write-good............................|ale-vim-help-write-good|
|
||||
vue.....................................|ale-vue-options|
|
||||
cspell................................|ale-vue-cspell|
|
||||
prettier..............................|ale-vue-prettier|
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Running as: $(whoami)"
|
||||
|
||||
echo
|
||||
echo "Environment:"
|
||||
env
|
||||
|
||||
echo
|
||||
echo "Arguments:"
|
||||
while [ $# -gt 0 ]; do
|
||||
echo "$1"
|
||||
shift
|
||||
done
|
||||
@@ -1,425 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
bail() {
|
||||
echo "$@" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
init_vars() {
|
||||
FLAVOR=
|
||||
TAG=
|
||||
NAME=
|
||||
PYTHON2=
|
||||
PYTHON3=
|
||||
RUBY=0
|
||||
LUA=0
|
||||
CONFIGURE_OPTIONS=
|
||||
PREBUILD_SCRIPT=
|
||||
}
|
||||
|
||||
# "apk add --virtual" does not add to existing virtual package anymore since
|
||||
# Alpine 3.9 (https://bugs.alpinelinux.org/issues/9651).
|
||||
APK_BUILD_DEPS=
|
||||
apk_add_build_dep() {
|
||||
for dep; do
|
||||
if ! apk info -e "$dep"; then
|
||||
apk add "$dep"
|
||||
APK_BUILD_DEPS="$APK_BUILD_DEPS $dep"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
prepare_build() {
|
||||
[ -z $TAG ] && bail "-tag is required"
|
||||
|
||||
# Parse TAG into repo and tag.
|
||||
IFS=: read -r -- repo tag <<EOF
|
||||
$TAG
|
||||
EOF
|
||||
if [ -z "$tag" ]; then
|
||||
tag="$repo"
|
||||
repo=
|
||||
elif [ "$repo" = vim ]; then
|
||||
repo="vim/vim"
|
||||
elif [ "$repo" = neovim ]; then
|
||||
repo="neovim/neovim"
|
||||
[ -z "$FLAVOR" ] && FLAVOR=neovim
|
||||
elif [ "${repo#*/}" = "$repo" ]; then
|
||||
bail "Unrecognized repo ($repo) from tag: $TAG"
|
||||
elif [ "${repo#*/neovim}" != "$repo" ]; then
|
||||
FLAVOR=neovim
|
||||
fi
|
||||
if [ -z "$FLAVOR" ]; then
|
||||
FLAVOR=vim
|
||||
fi
|
||||
if [ -z "$repo" ]; then
|
||||
if [ "$FLAVOR" = vim ]; then
|
||||
repo="vim/vim"
|
||||
else
|
||||
repo="neovim/neovim"
|
||||
fi
|
||||
fi
|
||||
[ -z $NAME ] && NAME="${FLAVOR}-${tag}"
|
||||
|
||||
if [ "$FLAVOR" = vim ]; then
|
||||
VIM_NAME="${repo}/${tag}_py${PYTHON2}${PYTHON3}_rb${RUBY}_lua${LUA}"
|
||||
else
|
||||
VIM_NAME="${repo}/${tag}"
|
||||
fi
|
||||
INSTALL_PREFIX="/vim-build/$VIM_NAME"
|
||||
|
||||
if [ "$FLAVOR" = vim ]; then
|
||||
VIM_CONFIG_ARGS="--prefix=$INSTALL_PREFIX --enable-multibyte --without-x --enable-gui=no --with-compiledby=vim-testbed --with-tlib=ncurses"
|
||||
fi
|
||||
set +x
|
||||
echo "TAG:$TAG"
|
||||
echo "repo:$repo"
|
||||
echo "tag:$tag"
|
||||
echo "FLAVOR:$FLAVOR"
|
||||
echo "NAME:$NAME"
|
||||
set -x
|
||||
|
||||
apk_add_build_dep gcc libc-dev make
|
||||
|
||||
if [ -n "$PYTHON2" ]; then
|
||||
apk_add_build_dep python2-dev
|
||||
if [ "$FLAVOR" = vim ]; then
|
||||
VIM_CONFIG_ARGS="$VIM_CONFIG_ARGS --enable-pythoninterp=dynamic"
|
||||
else
|
||||
apk add python2
|
||||
apk_add_build_dep g++ # for building greenlet
|
||||
python2 -m ensurepip
|
||||
pip2 install pynvim
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -n "$PYTHON3" ]; then
|
||||
apk_add_build_dep python3-dev
|
||||
if [ "$FLAVOR" = vim ]; then
|
||||
VIM_CONFIG_ARGS="$VIM_CONFIG_ARGS --enable-python3interp=dynamic"
|
||||
else
|
||||
apk add python3
|
||||
apk add py3-pynvim
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $RUBY -eq 1 ]; then
|
||||
apk_add_build_dep ruby-dev
|
||||
apk add ruby
|
||||
if [ "$FLAVOR" = vim ]; then
|
||||
VIM_CONFIG_ARGS="$VIM_CONFIG_ARGS --enable-rubyinterp"
|
||||
else
|
||||
apk_add_build_dep ruby-rdoc ruby-irb
|
||||
gem install neovim
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $LUA -eq 1 ]; then
|
||||
if [ "$FLAVOR" = vim ]; then
|
||||
VIM_CONFIG_ARGS="$VIM_CONFIG_ARGS --enable-luainterp"
|
||||
apk_add_build_dep lua5.3-dev
|
||||
apk add lua5.3-libs
|
||||
# Install symlinks to make Vim's configure pick it up.
|
||||
(cd /usr/bin && ln -s lua5.3 lua)
|
||||
(cd /usr/lib && ln -s lua5.3/liblua.so liblua5.3.so)
|
||||
else
|
||||
echo 'NOTE: -lua is automatically used with Neovim 0.2.1+, and not supported before.'
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$FLAVOR" = vim ] && [ -n "$CONFIGURE_OPTIONS" ]; then
|
||||
VIM_CONFIG_ARGS="$VIM_CONFIG_ARGS $CONFIGURE_OPTIONS"
|
||||
fi
|
||||
|
||||
cd /vim
|
||||
|
||||
if [ -d "$INSTALL_PREFIX" ]; then
|
||||
echo "WARNING: $INSTALL_PREFIX exists already. Overwriting."
|
||||
fi
|
||||
|
||||
BUILD_DIR="${FLAVOR}-${repo}-${tag}"
|
||||
if [ ! -d "$BUILD_DIR" ]; then
|
||||
apk_add_build_dep git
|
||||
git clone -b "$tag" "https://github.com/$repo" "$BUILD_DIR"
|
||||
cd "$BUILD_DIR"
|
||||
else
|
||||
cd "$BUILD_DIR"
|
||||
fi
|
||||
|
||||
if [ "$FLAVOR" = vim ]; then
|
||||
apk_add_build_dep ncurses-dev
|
||||
apk add ncurses
|
||||
elif [ "$FLAVOR" = neovim ]; then
|
||||
# Some of them will be installed already, but it is a good reference for
|
||||
# what is required.
|
||||
# luajit is required with Neomvim 0.2.1+ (previously only during build).
|
||||
apk add gettext \
|
||||
libuv \
|
||||
libtermkey \
|
||||
libvterm \
|
||||
luajit \
|
||||
msgpack-c \
|
||||
unibilium
|
||||
apk_add_build_dep \
|
||||
autoconf \
|
||||
automake \
|
||||
ca-certificates \
|
||||
cmake \
|
||||
g++ \
|
||||
gettext-dev \
|
||||
gperf \
|
||||
libtool \
|
||||
libuv-dev \
|
||||
libtermkey-dev \
|
||||
libvterm-dev \
|
||||
lua5.1-lpeg \
|
||||
lua5.1-mpack \
|
||||
luajit-dev \
|
||||
m4 \
|
||||
make \
|
||||
msgpack-c-dev \
|
||||
perl \
|
||||
unzip \
|
||||
unibilium-dev \
|
||||
xz
|
||||
else
|
||||
bail "Unexpected FLAVOR: $FLAVOR (use vim or neovim)."
|
||||
fi
|
||||
}
|
||||
|
||||
build() {
|
||||
if [ -n "$PREBUILD_SCRIPT" ]; then
|
||||
eval "$PREBUILD_SCRIPT"
|
||||
fi
|
||||
|
||||
if [ "$FLAVOR" = vim ]; then
|
||||
# Apply build fix from v7.1.148.
|
||||
# NOTE: this silently does nothing with 7.1.148+, but can be skipped with
|
||||
# Vim 8+ (and needs to be for 8.0.0082, where src/configure.in was renamed
|
||||
# to src/configure.ac).
|
||||
MAJOR="$(sed -n '/^MAJOR = / s~MAJOR = ~~p' Makefile)"
|
||||
if [ "$MAJOR" -lt 8 ]; then
|
||||
sed -i 's~sys/time.h termio.h~sys/time.h sys/types.h termio.h~' src/configure.in src/auto/configure
|
||||
fi
|
||||
|
||||
# Apply Vim patch v8.0.1635 to fix build with Python.
|
||||
if grep -q _POSIX_THREADS src/if_python3.c; then
|
||||
sed -i '/#ifdef _POSIX_THREADS/,+2 d' src/if_python3.c
|
||||
fi
|
||||
|
||||
if [ -n "$PYTHON3" ]; then
|
||||
# Vim patch 8.1.2201 (cannot build with dynamically linked Python 3.8).
|
||||
if ! grep -q "# if PY_VERSION_HEX >= 0x030800f0" src/if_python3.c; then
|
||||
apk_add_build_dep curl patch
|
||||
curl https://github.com/vim/vim/commit/13a1f3fb0.patch \
|
||||
| patch -p1
|
||||
fi
|
||||
# Vim patch 8.2.0354 (Python 3.9 does not define _Py_DEC_REFTOTAL).
|
||||
if grep -q "^ _Py_DEC_REFTOTAL;$" src/if_python3.c; then
|
||||
apk_add_build_dep curl patch
|
||||
curl https://github.com/vim/vim/commit/a65bb5351.patch \
|
||||
| patch -p1
|
||||
fi
|
||||
# Vim patch 8.2.1225: linker errors when building with dynamic Python 3.9.
|
||||
if ! grep -q "^# define PyType_GetFlags py3_PyType_GetFlags" src/if_python3.c; then
|
||||
# NOTE: --fuzz=3 needed with Vim v7.4.052 (likely due to e.g. missingv8.1.0735).
|
||||
apk_add_build_dep curl patch
|
||||
curl https://github.com/vim/vim/commit/ee1b93169.patch \
|
||||
| patch -p1 --fuzz=3
|
||||
fi
|
||||
fi
|
||||
|
||||
# Older xxd sources redeclare libc functions without arguments, which
|
||||
# newer system headers reject.
|
||||
if grep -q '^extern long int strtol();$' src/xxd/xxd.c; then
|
||||
sed -i '/^extern long int strtol();$/d' src/xxd/xxd.c
|
||||
fi
|
||||
if grep -q '^extern long int ftell();$' src/xxd/xxd.c; then
|
||||
sed -i '/^extern long int ftell();$/d' src/xxd/xxd.c
|
||||
fi
|
||||
|
||||
echo "Configuring with: $VIM_CONFIG_ARGS"
|
||||
# shellcheck disable=SC2086
|
||||
./configure $VIM_CONFIG_ARGS || bail "Could not configure"
|
||||
make CFLAGS="-Wno-error=incompatible-pointer-types -Wno-incompatible-pointer-types -Wno-error=int-conversion -Wno-int-conversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2" -j4 || bail "Make failed"
|
||||
make install || bail "Install failed"
|
||||
|
||||
elif [ "$FLAVOR" = neovim ]; then
|
||||
CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX"
|
||||
DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_TS_PARSERS=ON"
|
||||
DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_TS=ON"
|
||||
|
||||
# Use bundled libvterm. Neovim 0.4.x requires 0.1, which is not yet in
|
||||
# Alpine Linux. Using the bundled version also makes it easier for older
|
||||
# Neovim versions when Alpine updates it.
|
||||
DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LIBVTERM=ON"
|
||||
|
||||
# Install luv, for Neovim 0.4.0+, shipped with Alpine 3.10+.
|
||||
# Only add it when required, since it was broken with nvim-0.2.0
|
||||
# (at least, maybe only when using the bundled one), where it is optional
|
||||
# (only for tests).
|
||||
if grep -iq 'find.*libluv' CMakeLists.txt; then
|
||||
apk add libluv
|
||||
apk_add_build_dep libluv-dev
|
||||
fi
|
||||
|
||||
# NOTE: ENABLE_JEMALLOC has been removed in v0.3.4-168-gc2343180d
|
||||
# (https://github.com/neovim/neovim/commit/c2343180d).
|
||||
if grep -q 'ENABLE_JEMALLOC' CMakeLists.txt; then
|
||||
CMAKE_EXTRA_FLAGS="$CMAKE_EXTRA_FLAGS -DENABLE_JEMALLOC=OFF"
|
||||
fi
|
||||
|
||||
# Use bundled unibilium with older releases that use data directly, and not
|
||||
# through unibi_var_from_num like it is required now.
|
||||
if ! grep -qF 'unibi_var_from_num' src/nvim/tui/tui.c; then
|
||||
DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_UNIBILIUM=ON"
|
||||
fi
|
||||
|
||||
if grep -qF 'UTF8PROC' CMakeLists.txt; then
|
||||
apk add utf8proc
|
||||
apk_add_build_dep utf8proc-dev
|
||||
fi
|
||||
|
||||
# gcc10 fixes (due to -fno-common),
|
||||
# required to fix builds with v0.3.0+, until v0.4.4/v0.5.0.
|
||||
# Ref: https://github.com/neovim/neovim/commit/c036e24f3.patch
|
||||
if grep -q '\} ListLenSpecials;$' src/nvim/eval/typval.h; then
|
||||
apk_add_build_dep curl patch
|
||||
curl https://github.com/neovim/neovim/commit/ebcde1de4.patch | patch -p1
|
||||
fi
|
||||
if grep -q '\} ExprParserFlags;$' src/nvim/viml/parser/expressions.h; then
|
||||
apk_add_build_dep curl patch
|
||||
curl https://github.com/neovim/neovim/commit/b87b4a614.patch | patch -p1
|
||||
fi
|
||||
if grep -q '\} RemapValues;$' src/nvim/getchar.h; then
|
||||
apk_add_build_dep curl patch
|
||||
curl https://github.com/neovim/neovim/commit/986db1adb.patch | patch -p1
|
||||
fi
|
||||
if grep -q "^MultiQueue \*ch_before_blocking_events;" src/nvim/msgpack_rpc/channel.h; then
|
||||
apk_add_build_dep curl patch
|
||||
curl https://github.com/neovim/neovim/commit/517bf1560.patch | patch -p1
|
||||
fi
|
||||
if grep -q '^EXTERN PMap(uint64_t) \*channels;$' src/nvim/channel.h; then
|
||||
apk_add_build_dep curl patch
|
||||
curl https://github.com/neovim/neovim/commit/823b2104c.patch | patch -p1
|
||||
fi
|
||||
|
||||
# NOTE: uses "make cmake" to avoid linking twice when changing versiondef.h
|
||||
make cmake CMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
CMAKE_EXTRA_FLAGS="$CMAKE_EXTRA_FLAGS" \
|
||||
DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS" \
|
||||
|| bail "make cmake failed"
|
||||
|
||||
make install || bail "Install failed"
|
||||
fi
|
||||
|
||||
# Clean, but don't delete the source in case you want make a different build
|
||||
# with the same version.
|
||||
make distclean
|
||||
|
||||
if [ "$FLAVOR" = vim ]; then
|
||||
VIM_BIN="$INSTALL_PREFIX/bin/vim"
|
||||
else
|
||||
VIM_BIN="$INSTALL_PREFIX/bin/nvim"
|
||||
fi
|
||||
if ! [ -e "$VIM_BIN" ]; then
|
||||
bail "Binary $VIM_BIN was not created."
|
||||
fi
|
||||
link_target="/vim-build/bin/$NAME"
|
||||
if [ -e "$link_target" ]; then
|
||||
echo "WARNING: link target for $NAME exists already. Overwriting."
|
||||
fi
|
||||
ln -sfn "$VIM_BIN" "$link_target"
|
||||
"$link_target" --version
|
||||
}
|
||||
|
||||
apk update
|
||||
|
||||
init_vars
|
||||
clean=
|
||||
while [ $# -gt 0 ]; do
|
||||
case $1 in
|
||||
-flavor)
|
||||
if [ "$2" != vim ] && [ "$2" != neovim ]; then
|
||||
bail "Invalid value for -flavor: $2: only vim or neovim are recognized."
|
||||
fi
|
||||
FLAVOR="$2"
|
||||
shift
|
||||
;;
|
||||
-name)
|
||||
NAME="$2"
|
||||
shift
|
||||
;;
|
||||
-tag)
|
||||
TAG="$2"
|
||||
shift
|
||||
;;
|
||||
-py|-py2)
|
||||
PYTHON2=2
|
||||
;;
|
||||
-py3)
|
||||
PYTHON3=3
|
||||
;;
|
||||
-ruby)
|
||||
RUBY=1
|
||||
;;
|
||||
-lua)
|
||||
LUA=1
|
||||
;;
|
||||
-prepare_build)
|
||||
# Not documented, meant to ease hacking on this script, by avoiding
|
||||
# downloads over and over again.
|
||||
prepare_build
|
||||
[ -z "$clean" ] && clean=0
|
||||
;;
|
||||
-skip_clean)
|
||||
clean=0
|
||||
;;
|
||||
-prebuild_script)
|
||||
PREBUILD_SCRIPT="$2"
|
||||
shift
|
||||
;;
|
||||
-build)
|
||||
# So here I am thinking that using Alpine was going to give the biggest
|
||||
# savings in image size. Alpine starts at about 5MB. Built this image,
|
||||
# and it's about 8MB. Looking good. Install two versions of vanilla
|
||||
# vim, 300MB wtf!!! Each run of this script without cleaning up created
|
||||
# a layer with all of the build dependencies. So now, this script
|
||||
# expects a -build flag to signal the start of a build. This way,
|
||||
# installing all Vim versions becomes one layer.
|
||||
# Side note: tried docker-squash and it didn't seem to do anything.
|
||||
echo "=== building: NAME=$NAME, TAG=$TAG, PYTHON=${PYTHON2}${PYTHON3}, RUBY=$RUBY, LUA=$LUA, FLAVOR=$FLAVOR ==="
|
||||
prepare_build
|
||||
build
|
||||
init_vars
|
||||
[ -z "$clean" ] && clean=1
|
||||
;;
|
||||
*)
|
||||
CONFIGURE_OPTIONS="$CONFIGURE_OPTIONS $1"
|
||||
;;
|
||||
esac
|
||||
|
||||
shift
|
||||
done
|
||||
|
||||
if [ "$clean" = 0 ]; then
|
||||
echo "NOTE: skipping cleanup."
|
||||
else
|
||||
echo "Pruning packages and dirs.."
|
||||
if [ -n "$APK_BUILD_DEPS" ]; then
|
||||
# shellcheck disable=SC2086
|
||||
apk del $APK_BUILD_DEPS
|
||||
APK_BUILD_DEPS=
|
||||
fi
|
||||
rm -rf /vim/*
|
||||
rm -rf /var/cache/apk/* /tmp/* /var/tmp/* /root/.cache
|
||||
find / \( -name '*.pyc' -o -name '*.pyo' \) -delete
|
||||
|
||||
# Luarocks used for Neovim.
|
||||
rm -f /usr/local/bin/luarocks*
|
||||
rm -rf /usr/local/share/lua/5*/luarocks
|
||||
rm -rf /usr/local/etc/luarocks*
|
||||
fi
|
||||
@@ -1,36 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ "$VIM_TESTBED_DEBUG" = 1 ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
BIN=$1
|
||||
shift
|
||||
|
||||
if [ "$BIN" = "sh" ] || [ -z "$BIN" ]; then
|
||||
exec /bin/sh
|
||||
fi
|
||||
if ! [ -x "/vim-build/bin/$BIN" ]; then
|
||||
exec "$BIN" "$@"
|
||||
fi
|
||||
|
||||
# Set default vimrc to a visible file
|
||||
ARGS="-u /home/vimtest/vimrc -i NONE"
|
||||
|
||||
# Run as the vimtest user (when no USER is specified in the Dockerfile, i.e.
|
||||
# when running as root).
|
||||
# This is not really for security. It is for running Vim as a user that's
|
||||
# unable to write to your volume.
|
||||
if [ "$(id -u)" = 0 ]; then
|
||||
# So we can pass the arguments to Vim as it was passed to this script
|
||||
while [ $# -gt 0 ]; do
|
||||
ARGS="$ARGS \"$1\""
|
||||
shift
|
||||
done
|
||||
exec su -l vimtest -c "cd /testplugin && /vim-build/bin/$BIN $ARGS"
|
||||
fi
|
||||
|
||||
cd /testplugin || exit
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
exec "/vim-build/bin/$BIN" "$@"
|
||||
@@ -1,5 +0,0 @@
|
||||
*
|
||||
!scripts/argecho.sh
|
||||
!scripts/install_vim.sh
|
||||
!scripts/run_vim.sh
|
||||
!scripts/rtp.vim
|
||||
+9
-33
@@ -1,34 +1,12 @@
|
||||
local module = {}
|
||||
|
||||
local function remove_invalid_lsp_table_keys(value, seen)
|
||||
if type(value) ~= "table" then
|
||||
return value
|
||||
end
|
||||
|
||||
seen = seen or {}
|
||||
|
||||
if seen[value] then
|
||||
return value
|
||||
end
|
||||
|
||||
seen[value] = true
|
||||
|
||||
for key, child in pairs(value) do
|
||||
local key_type = type(key)
|
||||
|
||||
if key_type ~= "number" and key_type ~= "string" then
|
||||
value[key] = nil
|
||||
else
|
||||
remove_invalid_lsp_table_keys(child, seen)
|
||||
end
|
||||
end
|
||||
|
||||
return value
|
||||
end
|
||||
|
||||
module.start = function(config)
|
||||
-- Neovim's luaeval sometimes adds a Boolean key to table we need to remove.
|
||||
remove_invalid_lsp_table_keys(config.init_options)
|
||||
if type(config.init_options) == "table"
|
||||
and config.init_options[true] ~= nil
|
||||
then
|
||||
config.init_options[true] = nil
|
||||
end
|
||||
|
||||
-- ensure init_options uses empty_dict if empty
|
||||
if type(config.init_options) == "table"
|
||||
@@ -160,19 +138,17 @@ module.send_message = function(args)
|
||||
return 0
|
||||
end
|
||||
|
||||
local params = remove_invalid_lsp_table_keys(args.params)
|
||||
|
||||
if args.is_notification then
|
||||
local success
|
||||
|
||||
if vim.version().minor >= 11 then
|
||||
-- Supporting Neovim 0.11+
|
||||
---@diagnostic disable-next-line
|
||||
success = client.notify(client, args.method, params)
|
||||
success = client.notify(client, args.method, args.params)
|
||||
else
|
||||
-- Supporting Neovim 0.10 and below
|
||||
---@diagnostic disable-next-line
|
||||
success = client.notify(args.method, params)
|
||||
success = client.notify(args.method, args.params)
|
||||
end
|
||||
|
||||
-- For notifications we send a request and expect no direct response.
|
||||
@@ -199,11 +175,11 @@ module.send_message = function(args)
|
||||
-- We set the bufnr to -1 to prevent Neovim from flushing anything, as ALE
|
||||
-- already flushes changes to files before sending requests.
|
||||
---@diagnostic disable-next-line
|
||||
success, request_id = client.request(client, args.method, params, handle_func, -1)
|
||||
success, request_id = client.request(client, args.method, args.params, handle_func, -1)
|
||||
else
|
||||
-- Supporting Neovim 0.10 and below
|
||||
---@diagnostic disable-next-line
|
||||
success, request_id = client.request(args.method, params, handle_func, -1)
|
||||
success, request_id = client.request(args.method, args.params, handle_func, -1)
|
||||
end
|
||||
|
||||
if success then
|
||||
|
||||
@@ -26,10 +26,10 @@ tests='test/*.vader test/*/*.vader test/*/*/*.vader'
|
||||
# These flags are forwarded to the script for running Vader tests.
|
||||
verbose_flag=''
|
||||
quiet_flag=''
|
||||
run_neovim_010_tests=1
|
||||
run_neovim_012_tests=1
|
||||
run_vim_82_tests=1
|
||||
run_vim_92_tests=1
|
||||
run_neovim_07_tests=1
|
||||
run_neovim_08_tests=1
|
||||
run_vim_80_tests=1
|
||||
run_vim_90_tests=1
|
||||
run_lua_tests=1
|
||||
run_linters=1
|
||||
|
||||
@@ -44,81 +44,81 @@ while [ $# -ne 0 ]; do
|
||||
shift
|
||||
;;
|
||||
--build-image)
|
||||
run_vim_82_tests=0
|
||||
run_vim_92_tests=0
|
||||
run_neovim_010_tests=0
|
||||
run_neovim_012_tests=0
|
||||
run_vim_80_tests=0
|
||||
run_vim_90_tests=0
|
||||
run_neovim_07_tests=0
|
||||
run_neovim_08_tests=0
|
||||
run_lua_tests=0
|
||||
run_linters=0
|
||||
shift
|
||||
;;
|
||||
--neovim-only)
|
||||
run_vim_82_tests=0
|
||||
run_vim_92_tests=0
|
||||
run_vim_80_tests=0
|
||||
run_vim_90_tests=0
|
||||
run_lua_tests=0
|
||||
run_linters=0
|
||||
shift
|
||||
;;
|
||||
--neovim-010-only)
|
||||
run_neovim_012_tests=0
|
||||
run_vim_82_tests=0
|
||||
run_vim_92_tests=0
|
||||
--neovim-07-only)
|
||||
run_neovim_08_tests=0
|
||||
run_vim_80_tests=0
|
||||
run_vim_90_tests=0
|
||||
run_lua_tests=0
|
||||
run_linters=0
|
||||
shift
|
||||
;;
|
||||
--neovim-012-only)
|
||||
run_neovim_010_tests=0
|
||||
run_vim_82_tests=0
|
||||
run_vim_92_tests=0
|
||||
--neovim-08-only)
|
||||
run_neovim_07_tests=0
|
||||
run_vim_80_tests=0
|
||||
run_vim_90_tests=0
|
||||
run_lua_tests=0
|
||||
run_linters=0
|
||||
shift
|
||||
;;
|
||||
--vim-only)
|
||||
run_neovim_010_tests=0
|
||||
run_neovim_012_tests=0
|
||||
run_neovim_07_tests=0
|
||||
run_neovim_08_tests=0
|
||||
run_lua_tests=0
|
||||
run_linters=0
|
||||
shift
|
||||
;;
|
||||
--vim-82-only)
|
||||
run_neovim_010_tests=0
|
||||
run_neovim_012_tests=0
|
||||
run_vim_92_tests=0
|
||||
--vim-80-only)
|
||||
run_neovim_07_tests=0
|
||||
run_neovim_08_tests=0
|
||||
run_vim_90_tests=0
|
||||
run_lua_tests=0
|
||||
run_linters=0
|
||||
shift
|
||||
;;
|
||||
--vim-92-only)
|
||||
run_neovim_010_tests=0
|
||||
run_neovim_012_tests=0
|
||||
run_vim_82_tests=0
|
||||
--vim-90-only)
|
||||
run_neovim_07_tests=0
|
||||
run_neovim_08_tests=0
|
||||
run_vim_80_tests=0
|
||||
run_lua_tests=0
|
||||
run_linters=0
|
||||
shift
|
||||
;;
|
||||
--linters-only)
|
||||
run_vim_82_tests=0
|
||||
run_vim_92_tests=0
|
||||
run_neovim_010_tests=0
|
||||
run_neovim_012_tests=0
|
||||
run_vim_80_tests=0
|
||||
run_vim_90_tests=0
|
||||
run_neovim_07_tests=0
|
||||
run_neovim_08_tests=0
|
||||
run_lua_tests=0
|
||||
shift
|
||||
;;
|
||||
--lua-only)
|
||||
run_vim_82_tests=0
|
||||
run_vim_92_tests=0
|
||||
run_neovim_010_tests=0
|
||||
run_neovim_012_tests=0
|
||||
run_vim_80_tests=0
|
||||
run_vim_90_tests=0
|
||||
run_neovim_07_tests=0
|
||||
run_neovim_08_tests=0
|
||||
run_linters=0
|
||||
shift
|
||||
;;
|
||||
--fast)
|
||||
run_vim_82_tests=0
|
||||
run_vim_92_tests=0
|
||||
run_neovim_010_tests=0
|
||||
run_neovim_012_tests=1
|
||||
run_vim_80_tests=0
|
||||
run_vim_90_tests=0
|
||||
run_neovim_07_tests=0
|
||||
run_neovim_08_tests=1
|
||||
shift
|
||||
;;
|
||||
--help)
|
||||
@@ -132,11 +132,11 @@ while [ $# -ne 0 ]; do
|
||||
echo ' -q Hide output for successful tests'
|
||||
echo ' --build-image Run docker image build only.'
|
||||
echo ' --neovim-only Run tests only for Neovim'
|
||||
echo ' --neovim-010-only Run tests only for Neovim 0.10'
|
||||
echo ' --neovim-012-only Run tests only for Neovim 0.12'
|
||||
echo ' --neovim-07-only Run tests only for Neovim 0.7'
|
||||
echo ' --neovim-08-only Run tests only for Neovim 0.8'
|
||||
echo ' --vim-only Run tests only for Vim'
|
||||
echo ' --vim-82-only Run tests only for Vim 8.2'
|
||||
echo ' --vim-92-only Run tests only for Vim 9.2'
|
||||
echo ' --vim-80-only Run tests only for Vim 8.2'
|
||||
echo ' --vim-90-only Run tests only for Vim 9.0'
|
||||
echo ' --lua-only Run only Lua tests'
|
||||
echo ' --linters-only Run only Vint and custom checks'
|
||||
echo ' --fast Run only the fastest Vim and custom checks'
|
||||
@@ -203,6 +203,13 @@ if [ "$has_image" -eq 0 ] && ! download_image; then
|
||||
|
||||
build_args=( --build-arg GIT_VERSION="$git_version" )
|
||||
|
||||
if [[ $arch != x86_64 ]]; then
|
||||
echo "Building testbed/vim:24 for $arch"
|
||||
testbed_vim_ref=902917c4caa50db2f2e80009b839605602f9f014
|
||||
"$DOCKER" build -t "testbed/vim:$testbed_vim_ref" "https://github.com/Vimjas/vim-testbed.git#$testbed_vim_ref"
|
||||
build_args+=( --build-arg TESTBED_VIM_VERSION="$testbed_vim_ref" )
|
||||
fi
|
||||
|
||||
"$DOCKER" build "${build_args[@]}" -t "${image}:${image_tag}" .
|
||||
"$DOCKER" tag "${image}:${image_tag}" "${image}:latest"
|
||||
|
||||
@@ -253,10 +260,10 @@ cancel_tests() {
|
||||
trap cancel_tests INT TERM
|
||||
|
||||
for vim in $("$DOCKER" run --rm "$DOCKER_RUN_IMAGE" ls /vim-build/bin | grep '^neovim\|^vim' ); do
|
||||
if ( [[ $vim =~ ^vim-v8.2 ]] && ((run_vim_82_tests)) ) \
|
||||
|| ( [[ $vim =~ ^vim-v9.2 ]] && ((run_vim_92_tests)) ) \
|
||||
|| ( [[ $vim =~ ^neovim-v0.10 ]] && ((run_neovim_010_tests)) ) \
|
||||
|| ( [[ $vim =~ ^neovim-v0.12 ]] && ((run_neovim_012_tests)) ); then
|
||||
if ( [[ $vim =~ ^vim-v8.0 ]] && ((run_vim_80_tests)) ) \
|
||||
|| ( [[ $vim =~ ^vim-v9.0 ]] && ((run_vim_90_tests)) ) \
|
||||
|| ( [[ $vim =~ ^neovim-v0.7 ]] && ((run_neovim_07_tests)) ) \
|
||||
|| ( [[ $vim =~ ^neovim-v0.8 ]] && ((run_neovim_08_tests)) ); then
|
||||
echo "Starting Vim: $vim..."
|
||||
file_number=$((file_number+1))
|
||||
test/script/run-vader-tests $quiet_flag $verbose_flag "$vim" "$tests" \
|
||||
|
||||
+3
-13
@@ -1,24 +1,14 @@
|
||||
@echo off
|
||||
REM Run tests on Windows.
|
||||
REM
|
||||
REM Set the VIM_EXE environment variable to the path to the Vim or Neovim
|
||||
REM executable. If not set, the default path for the old AppVeyor setup will
|
||||
REM be used.
|
||||
REM
|
||||
REM Set VIM_HEADLESS to --headless for Neovim.
|
||||
REM To run these tests, you should set up your Windows machine with the same
|
||||
REM paths that are used in AppVeyor.
|
||||
|
||||
set tests=test/*.vader test/*/*.vader test/*/*/*.vader test/*/*/*/*.vader
|
||||
|
||||
REM Use the first argument for selecting tests to run.
|
||||
if not "%1"=="" set tests=%1
|
||||
|
||||
REM VIM_EXE can be set externally (e.g., by GitHub Actions).
|
||||
if "%VIM_EXE%"=="" set VIM_EXE=C:\vim\vim\vim80\vim.exe
|
||||
|
||||
REM VIM_HEADLESS can be set for Neovim (--headless).
|
||||
REM For Vim, --not-a-term prevents E211 and terminal warnings in CI.
|
||||
if "%VIM_HEADLESS%"=="" set VIM_HEADLESS=--not-a-term
|
||||
|
||||
set VADER_OUTPUT_FILE=%~dp0\vader_output
|
||||
REM Automatically re-run Windows tests, which can fail some times.
|
||||
set tries=0
|
||||
@@ -26,7 +16,7 @@ set tries=0
|
||||
:RUN_TESTS
|
||||
set /a tries=%tries%+1
|
||||
type nul > "%VADER_OUTPUT_FILE%"
|
||||
"%VIM_EXE%" -n -i NONE -u test/vimrc %VIM_HEADLESS% "+Vader! %tests%"
|
||||
C:\vim\vim\vim80\vim.exe -u test/vimrc "+Vader! %tests%"
|
||||
set code=%ERRORLEVEL%
|
||||
|
||||
IF %code% EQU 0 GOTO :SHOW_RESULTS
|
||||
|
||||
+6
-13
@@ -14,11 +14,11 @@ formatting.
|
||||
|
||||
**Legend**
|
||||
|
||||
| Key | Definition |
|
||||
| -------------- | ----------------------------------------------------- |
|
||||
|:speech_balloon:| Language Server Protocol (LSP) |
|
||||
| :floppy_disk: | Only runs on disk (see: `help ale-lint-file-linters`) |
|
||||
| :warning: | Disabled by default |
|
||||
| Key | Definition |
|
||||
| -------------- | ----------------------------------------------------------------- |
|
||||
|:speech_balloon:| Language Server Protocol (LSP) |
|
||||
| :floppy_disk: | May only run on files on disk (see: `help ale-lint-file-linters` |
|
||||
| :warning: | Disabled by default |
|
||||
|
||||
---
|
||||
|
||||
@@ -383,7 +383,6 @@ formatting.
|
||||
* [lacheck](https://www.ctan.org/pkg/lacheck)
|
||||
* [proselint](http://proselint.com/)
|
||||
* [redpen](http://redpen.cc/)
|
||||
* [tex-fmt](https://github.com/WGUNDERWOOD/tex-fmt)
|
||||
* [texlab](https://texlab.netlify.com) :speech_balloon:
|
||||
* [textlint](https://textlint.github.io/)
|
||||
* [vale](https://github.com/ValeLint/vale)
|
||||
@@ -394,8 +393,6 @@ formatting.
|
||||
* [lessc](https://www.npmjs.com/package/less)
|
||||
* [prettier](https://github.com/prettier/prettier)
|
||||
* [stylelint](https://github.com/stylelint/stylelint)
|
||||
* LilyPond
|
||||
* [lilypond](https://lilypond.org/)
|
||||
* LLVM
|
||||
* [llc](https://llvm.org/docs/CommandGuide/llc.html)
|
||||
* Lua
|
||||
@@ -417,7 +414,6 @@ formatting.
|
||||
* Markdown
|
||||
* [alex](https://github.com/get-alex/alex)
|
||||
* [cspell](https://github.com/streetsidesoftware/cspell/tree/main/packages/cspell)
|
||||
* [harper](https://github.com/elijah-potter/harper) :speech_balloon:
|
||||
* [languagetool](https://languagetool.org/) :floppy_disk: :speech_balloon:
|
||||
* [markdownlint](https://github.com/DavidAnson/markdownlint) :floppy_disk:
|
||||
* [marksman](https://github.com/artempyanykh/marksman) :speech_balloon:
|
||||
@@ -428,7 +424,6 @@ formatting.
|
||||
* [pymarkdown](https://github.com/jackdewinter/pymarkdown) :floppy_disk:
|
||||
* [redpen](http://redpen.cc/)
|
||||
* [remark-lint](https://github.com/wooorm/remark-lint)
|
||||
* [rumdl](https://github.com/rvben/rumdl/issues) :speech_balloon:
|
||||
* [textlint](https://textlint.github.io/)
|
||||
* [vale](https://github.com/ValeLint/vale)
|
||||
* [write-good](https://github.com/btford/write-good)
|
||||
@@ -491,10 +486,9 @@ formatting.
|
||||
* Pawn
|
||||
* [uncrustify](https://github.com/uncrustify/uncrustify)
|
||||
* Perl
|
||||
* [languageserver](https://metacpan.org/pod/Perl::LanguageServer) :speech_balloon:
|
||||
* [languageserver](https://metacpan.org/pod/Perl::LanguageServer)
|
||||
* [perl -c](https://perl.org/) :warning:
|
||||
* [perl-critic](https://metacpan.org/pod/Perl::Critic)
|
||||
* [perlnavigator](https://github.com/bscan/PerlNavigator) :speech_balloon:
|
||||
* [perltidy](https://metacpan.org/pod/distribution/Perl-Tidy/bin/perltidy)
|
||||
* Perl6
|
||||
* [perl6 -c](https://perl6.org) :warning:
|
||||
@@ -573,7 +567,6 @@ formatting.
|
||||
* [reorder-python-imports](https://github.com/asottile/reorder_python_imports)
|
||||
* [ruff](https://github.com/charliermarsh/ruff)
|
||||
* [ruff-format](https://docs.astral.sh/ruff/formatter/)
|
||||
* [ty](https://github.com/astral-sh/ty) :speech_balloon:
|
||||
* [unimport](https://github.com/hakancelik96/unimport)
|
||||
* [vulture](https://github.com/jendrikseipp/vulture) :warning: :floppy_disk:
|
||||
* [yapf](https://github.com/google/yapf)
|
||||
|
||||
@@ -140,61 +140,3 @@ Execute(Filtering should respect filetype triggers):
|
||||
AssertEqual b:suggestions, ale#completion#Filter(bufnr(''), '', b:suggestions, '.', 0)
|
||||
AssertEqual b:suggestions, ale#completion#Filter(bufnr(''), 'rust', b:suggestions, '.', 0)
|
||||
AssertEqual b:suggestions, ale#completion#Filter(bufnr(''), 'rust', b:suggestions, '::', 0)
|
||||
|
||||
Execute(GetTriggerCharacter should return trigger characters from hardcoded map):
|
||||
AssertEqual '.', ale#completion#GetTriggerCharacter('python', '.')
|
||||
AssertEqual '::', ale#completion#GetTriggerCharacter('rust', '::')
|
||||
AssertEqual '->', ale#completion#GetTriggerCharacter('c', '->')
|
||||
AssertEqual '', ale#completion#GetTriggerCharacter('python', '@')
|
||||
|
||||
Execute(GetTriggerCharacter should return empty for empty prefix):
|
||||
AssertEqual '', ale#completion#GetTriggerCharacter('python', '')
|
||||
|
||||
Execute(GetTriggerCharacter should use LSP triggers when conn_id provided):
|
||||
call ale#lsp#Register('test-lsp', '/project', '', {})
|
||||
let g:conn_id = 'test-lsp:/project'
|
||||
call ale#lsp#UpdateCapabilities(g:conn_id, {
|
||||
\ 'completionProvider': {'triggerCharacters': ['@', '#']},
|
||||
\})
|
||||
|
||||
" '@' is in LSP triggers
|
||||
AssertEqual '@', ale#completion#GetTriggerCharacter('python', '@', g:conn_id)
|
||||
" '.' is NOT in LSP triggers (should not match even though it's in hardcoded)
|
||||
AssertEqual '', ale#completion#GetTriggerCharacter('python', '.', g:conn_id)
|
||||
" '#' is in LSP triggers
|
||||
AssertEqual '#', ale#completion#GetTriggerCharacter('python', '#', g:conn_id)
|
||||
|
||||
call ale#lsp#RemoveConnectionWithID(g:conn_id)
|
||||
unlet g:conn_id
|
||||
|
||||
Execute(GetTriggerCharacter should fall back to hardcoded when no LSP triggers):
|
||||
call ale#lsp#Register('test-lsp-empty', '/project', '', {})
|
||||
let g:conn_id = 'test-lsp-empty:/project'
|
||||
call ale#lsp#UpdateCapabilities(g:conn_id, {})
|
||||
|
||||
" Falls back to hardcoded map
|
||||
AssertEqual '.', ale#completion#GetTriggerCharacter('python', '.', g:conn_id)
|
||||
AssertEqual '', ale#completion#GetTriggerCharacter('python', '@', g:conn_id)
|
||||
|
||||
call ale#lsp#RemoveConnectionWithID(g:conn_id)
|
||||
unlet g:conn_id
|
||||
|
||||
Execute(Filtering should use LSP trigger characters):
|
||||
call ale#lsp#Register('test-lsp-filter', '/project', '', {})
|
||||
let g:conn_id = 'test-lsp-filter:/project'
|
||||
call ale#lsp#UpdateCapabilities(g:conn_id, {
|
||||
\ 'completionProvider': {'triggerCharacters': ['@']},
|
||||
\})
|
||||
|
||||
" Set up completion info with conn_id
|
||||
let b:ale_completion_info = {'conn_id': g:conn_id}
|
||||
let b:suggestions = [{'word': 'foo'}, {'word': 'bar'}]
|
||||
|
||||
" '@' is LSP trigger - should return all suggestions
|
||||
AssertEqual b:suggestions, ale#completion#Filter(bufnr(''), 'python', b:suggestions, '@', 0)
|
||||
" '.' is NOT LSP trigger - should filter
|
||||
AssertEqual [], ale#completion#Filter(bufnr(''), 'python', b:suggestions, '.', 0)
|
||||
|
||||
unlet b:ale_completion_info
|
||||
call ale#lsp#RemoveConnectionWithID(g:conn_id)
|
||||
unlet g:conn_id
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user