diff options
Diffstat (limited to 'autoload/ale/fixers/dotnet_format.vim')
-rw-r--r-- | autoload/ale/fixers/dotnet_format.vim | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/autoload/ale/fixers/dotnet_format.vim b/autoload/ale/fixers/dotnet_format.vim new file mode 100644 index 00000000..b44a28bd --- /dev/null +++ b/autoload/ale/fixers/dotnet_format.vim @@ -0,0 +1,18 @@ +" Author: ghsang <gwonhyuksang@gmail.com> +" Description: Integration of dotnet format with ALE. + +call ale#Set('cs_dotnet_format_executable', 'dotnet') +call ale#Set('cs_dotnet_format_options', '') + +function! ale#fixers#dotnet_format#Fix(buffer) abort + let l:executable = ale#Var(a:buffer, 'cs_dotnet_format_executable') + let l:options = ale#Var(a:buffer, 'cs_dotnet_format_options') + + return { + \ 'command': ale#Escape(l:executable) + \ . ' format' + \ . (empty(l:options) ? '' : ' ' . l:options) + \ . ' --folder --include %t "$(dirname %t)"', + \ 'read_temporary_file': 1, + \} +endfunction |