From 2e5f135836a700dcc6b787f10097ebdeb8e22abb Mon Sep 17 00:00:00 2001 From: Markus Date: Mon, 14 Oct 2024 04:45:41 +0200 Subject: [PATCH] no need to write and read temporary file with syntax_tree (#4834) --- autoload/ale/fixers/syntax_tree.vim | 3 +-- test/fixers/test_syntax_tree_fixer_callback.vader | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/autoload/ale/fixers/syntax_tree.vim b/autoload/ale/fixers/syntax_tree.vim index 7ae03373..08823a88 100644 --- a/autoload/ale/fixers/syntax_tree.vim +++ b/autoload/ale/fixers/syntax_tree.vim @@ -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 diff --git a/test/fixers/test_syntax_tree_fixer_callback.vader b/test/fixers/test_syntax_tree_fixer_callback.vader index 46450985..de9e69f9 100644 --- a/test/fixers/test_syntax_tree_fixer_callback.vader +++ b/test/fixers/test_syntax_tree_fixer_callback.vader @@ -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(''))