summaryrefslogtreecommitdiff
path: root/autoload/ale/fixers/dart_format.vim
blob: 4b8f730bfb9760dc1acd201f495b7c8007b68a21 (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 dart format with ALE.

call ale#Set('dart_format_executable', 'dart')
call ale#Set('dart_format_options', '')

function! ale#fixers#dart_format#Fix(buffer) abort
    let l:executable = ale#Var(a:buffer, 'dart_format_executable')
    let l:options = ale#Var(a:buffer, 'dart_format_options')

    return {
    \   'command': ale#Escape(l:executable)
    \       . ' format'
    \       . (empty(l:options) ? '' : ' ' . l:options)
    \       . ' %t',
    \   'read_temporary_file': 1,
    \}
endfunction