mirror of
https://github.com/dense-analysis/ale.git
synced 2026-08-02 14:10:24 +08:00
Add support for various debian source files (debian/{tests/control,control,copyright,watch,upstream/metadata}) (#5107)
* Add debian-lsp support for autopkgtest files Add Language Server Protocol support for debian/tests/control files using debian-lsp (https://github.com/jelmer/debian-lsp). Vim detects these files as filetype 'autopkgtest' by default. * Add debian-lsp support for debcontrol files Add Language Server Protocol support for debian/control files using debian-lsp (https://github.com/jelmer/debian-lsp). debian-lsp provides diagnostics, completions, and code actions for Debian package control files. * Add debian-lsp support for debcopyright files Add Language Server Protocol support for debian/copyright files using debian-lsp (https://github.com/jelmer/debian-lsp). * Add debian-lsp support for debchangelog files Add Language Server Protocol support for debian/changelog files using debian-lsp (https://github.com/jelmer/debian-lsp). * Add debian-lsp support for debsources files Add Language Server Protocol support for debian/source/format files using debian-lsp (https://github.com/jelmer/debian-lsp). * Add debian-lsp support for debupstream files Add Language Server Protocol support for debian/upstream/metadata files using debian-lsp (https://github.com/jelmer/debian-lsp). Note: Vim does not detect debian/upstream/metadata files by default. Users need to add filetype detection to their vimrc: autocmd BufNewFile,BufRead */debian/upstream/metadata setfiletype debupstream * Add debian-lsp support for debwatch files Add Language Server Protocol support for debian/watch files using debian-lsp (https://github.com/jelmer/debian-lsp). Note: Vim does not detect debian/watch files by default. Users need to add filetype detection to their vimrc: autocmd BufNewFile,BufRead */debian/watch setfiletype debwatch * Add debian-lsp to supported tools documentation Update supported-tools.md, ale-supported-languages-and-tools.txt, and ale.txt table of contents to include the new Debian filetype linters (autopkgtest, debchangelog, debcontrol, debcopyright, debsources, debupstream, debwatch).
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
" Author: Jelmer Vernooij <jelmer@jelmer.uk>
|
||||
" Description: Language server for Debian package files
|
||||
|
||||
call ale#Set('debcontrol_debian_lsp_executable', 'debian-lsp')
|
||||
|
||||
function! ale_linters#debcontrol#debian_lsp#GetProjectRoot(buffer) abort
|
||||
" Find the debian directory
|
||||
let l:debian_dir = ale#path#FindNearestDirectory(a:buffer, 'debian')
|
||||
|
||||
if !empty(l:debian_dir)
|
||||
return fnamemodify(l:debian_dir, ':h:h')
|
||||
endif
|
||||
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
call ale#linter#Define('debcontrol', {
|
||||
\ 'name': 'debian_lsp',
|
||||
\ 'lsp': 'stdio',
|
||||
\ 'executable': {b -> ale#Var(b, 'debcontrol_debian_lsp_executable')},
|
||||
\ 'command': '%e',
|
||||
\ 'project_root': function('ale_linters#debcontrol#debian_lsp#GetProjectRoot'),
|
||||
\})
|
||||
Reference in New Issue
Block a user