no need to write and read temporary file with syntax_tree (#4834)

This commit is contained in:
Markus 2024-10-14 04:45:41 +02:00 committed by GitHub
parent a7ef1817b7
commit 2e5f135836
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 6 deletions

View File

@ -6,7 +6,7 @@ function! ale#fixers#syntax_tree#GetCommand(buffer) abort
let l:options = ale#Var(a:buffer, 'ruby_syntax_tree_options')
return ale#ruby#EscapeExecutable(l:executable, 'stree')
\ . ' write'
\ . ' format'
\ . (!empty(l:options) ? ' ' . l:options : '')
\ . ' %t'
endfunction
@ -14,6 +14,5 @@ endfunction
function! ale#fixers#syntax_tree#Fix(buffer) abort
return {
\ 'command': ale#fixers#syntax_tree#GetCommand(a:buffer),
\ 'read_temporary_file': 1,
\}
endfunction

View File

@ -18,9 +18,8 @@ Execute(The syntax_tree callback should return the correct default values):
AssertEqual
\ {
\ 'read_temporary_file': 1,
\ 'command': ale#Escape(g:ale_ruby_syntax_tree_executable)
\ . ' write %t',
\ . ' format %t',
\ },
\ ale#fixers#syntax_tree#Fix(bufnr(''))
@ -30,8 +29,7 @@ Execute(The syntax_tree callback should include custom options):
AssertEqual
\ {
\ 'read_temporary_file': 1,
\ 'command': ale#Escape(g:ale_ruby_syntax_tree_executable)
\ . ' write --print-width=100 --plugins=plugin/trailing_comma %t',
\ . ' format --print-width=100 --plugins=plugin/trailing_comma %t',
\ },
\ ale#fixers#syntax_tree#Fix(bufnr(''))