mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-31 16:44:31 +08:00
Support 'gleam format' as Gleam fixer (#4710)
This commit is contained in:
@@ -291,6 +291,11 @@ let s:default_registry = {
|
||||
\ 'suggested_filetypes': ['solidity'],
|
||||
\ 'description': 'Fix Solidity files with forge fmt.',
|
||||
\ },
|
||||
\ 'gleam_format': {
|
||||
\ 'function': 'ale#fixers#gleam_format#Fix',
|
||||
\ 'suggested_filetypes': ['gleam'],
|
||||
\ 'description': 'Fix Gleam files with gleam format.',
|
||||
\ },
|
||||
\ 'gofmt': {
|
||||
\ 'function': 'ale#fixers#gofmt#Fix',
|
||||
\ 'suggested_filetypes': ['go'],
|
||||
|
||||
19
autoload/ale/fixers/gleam_format.vim
Normal file
19
autoload/ale/fixers/gleam_format.vim
Normal file
@@ -0,0 +1,19 @@
|
||||
" Author: Jonathan Palardt https://github.com/jpalardy
|
||||
" Description: Integration of 'gleam format' with ALE.
|
||||
|
||||
call ale#Set('gleam_format_executable', 'gleam')
|
||||
|
||||
function! ale#fixers#gleam_format#GetExecutable(buffer) abort
|
||||
let l:executable = ale#Var(a:buffer, 'gleam_format_executable')
|
||||
|
||||
return ale#Escape(l:executable)
|
||||
endfunction
|
||||
|
||||
function! ale#fixers#gleam_format#Fix(buffer) abort
|
||||
let l:executable = ale#fixers#gleam_format#GetExecutable(a:buffer)
|
||||
|
||||
return {
|
||||
\ 'command': l:executable . ' format %t',
|
||||
\ 'read_temporary_file': 1,
|
||||
\}
|
||||
endfunction
|
||||
Reference in New Issue
Block a user