summaryrefslogtreecommitdiff
path: root/autoload/ale/fixers/dotnet_format.vim
blob: b44a28bd0f95176220afa50eafdb57bdfb4cff3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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