tombi: support its LSP (#5022)

* tombi: support its LSP
* tombi: support linting and formatting
This commit is contained in:
Ben Boeckel
2025-08-13 07:30:46 -04:00
committed by GitHub
parent 487d915984
commit d6f1a47647
15 changed files with 232 additions and 0 deletions

View File

@@ -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.

View 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

View 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