mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
tombi: support its LSP (#5022)
* tombi: support its LSP * tombi: support linting and formatting
This commit is contained in:
@@ -732,6 +732,16 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['roc'],
|
||||
\ 'description': 'Annotates all top-level definitions in Roc files.',
|
||||
\ },
|
||||
\ 'tombi_format': {
|
||||
\ 'function': 'ale#fixers#tombi_format#Fix',
|
||||
\ 'suggested_filetypes': ['toml'],
|
||||
\ 'description': 'Formats TOML files',
|
||||
\ },
|
||||
\ 'tombi_lint': {
|
||||
\ 'function': 'ale#fixers#tombi_lint#Fix',
|
||||
\ 'suggested_filetypes': ['toml'],
|
||||
\ 'description': 'Lints TOML files',
|
||||
\ },
|
||||
\}
|
||||
|
||||
" Reset the function registry to the default entries.
|
||||
|
||||
16
autoload/ale/fixers/tombi_format.vim
Normal file
16
autoload/ale/fixers/tombi_format.vim
Normal file
@@ -0,0 +1,16 @@
|
||||
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||
" Description: Integration of tombi formatting with ALE.
|
||||
|
||||
call ale#Set('toml_tombi_executable', 'tombi')
|
||||
call ale#Set('toml_tombi_format_options', '')
|
||||
|
||||
function! ale#fixers#tombi_format#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'toml_tombi_executable')
|
||||
let l:options = ale#Var(a:buffer, 'toml_tombi_format_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' format'
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options),
|
||||
\}
|
||||
endfunction
|
||||
16
autoload/ale/fixers/tombi_lint.vim
Normal file
16
autoload/ale/fixers/tombi_lint.vim
Normal file
@@ -0,0 +1,16 @@
|
||||
" Author: Ben Boeckel <github@me.benboeckel.net>
|
||||
" Description: Integration of tombi linting with ALE.
|
||||
|
||||
call ale#Set('toml_tombi_executable', 'tombi')
|
||||
call ale#Set('toml_tombi_lint_options', '')
|
||||
|
||||
function! ale#fixers#tombi_lint#Fix(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'toml_tombi_executable')
|
||||
let l:options = ale#Var(a:buffer, 'toml_tombi_lint_options')
|
||||
|
||||
return {
|
||||
\ 'command': ale#Escape(l:executable)
|
||||
\ . ' lint'
|
||||
\ . (empty(l:options) ? '' : ' ' . l:options),
|
||||
\}
|
||||
endfunction
|
||||
Reference in New Issue
Block a user