Support astgrep (#4975)
CI / Build (push) Canceled after 0s
CI / Neovim 0.10 Windows (push) Canceled after 0s
CI / Neovim 0.12 Windows (push) Canceled after 0s
CI / Vim 8.2 Windows (push) Canceled after 0s
CI / Vim 9.2 Windows (push) Canceled after 0s
CI / Lint (push) Canceled after 0s
CI / Lua (push) Canceled after 0s
CI / Neovim 0.10 Linux (push) Canceled after 0s
CI / Neovim 0.12 Linux (push) Canceled after 0s
CI / Vim 8.2 Linux (push) Canceled after 0s
CI / Vim 9.2 Linux (push) Canceled after 0s

* astgrep: support its LSP

Fixes: #4974

* astgrep: add a fixer
This commit is contained in:
Ben Boeckel
2026-07-25 23:08:59 +09:00
committed by GitHub
parent 40cbe2121b
commit 9e2efaa4d3
83 changed files with 678 additions and 0 deletions
@@ -0,0 +1,27 @@
Before:
Save g:ale_astgrep_executable
Save g:ale_astgrep_scan_options
After:
Restore
Execute(The ast-grep callback should return the correct default values):
AssertEqual
\ {
\ 'command': ale#Escape('ast-grep') . ' scan --update-all %t',
\ 'read_temporary_file': 1,
\ },
\ ale#fixers#astgrep#Fix(bufnr(''))
Execute(The astgrep executable and options should be configurable):
let g:ale_astgrep_executable = '/path/to/ast-grep'
let g:ale_astgrep_scan_options = '--interactive'
AssertEqual
\ {
\ 'command': ale#Escape('/path/to/ast-grep')
\ . ' scan'
\ . ' --interactive %t',
\ 'read_temporary_file': 1,
\ },
\ ale#fixers#astgrep#Fix(bufnr(''))