diff options
author | P M <10617122+pylipp@users.noreply.github.com> | 2018-06-12 20:38:16 +0200 |
---|---|---|
committer | w0rp <w0rp@users.noreply.github.com> | 2018-06-12 19:38:16 +0100 |
commit | f1b72218c36cadd544f4363d726e8ee131a593a5 (patch) | |
tree | 202b7a8650e0621ec4a718c8ef32c6faa32e1a65 /autoload | |
parent | 5283faa51152ef6510adeb022a8e7c5be4dc251d (diff) | |
download | ale-f1b72218c36cadd544f4363d726e8ee131a593a5.zip |
Add support for qmlfmt fixer (#1651)
* Add support for qmlfmt fixer
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/fix/registry.vim | 5 | ||||
-rw-r--r-- | autoload/ale/fixers/qmlfmt.vim | 11 |
2 files changed, 16 insertions, 0 deletions
diff --git a/autoload/ale/fix/registry.vim b/autoload/ale/fix/registry.vim index 72a9a5f8..7b55acfc 100644 --- a/autoload/ale/fix/registry.vim +++ b/autoload/ale/fix/registry.vim @@ -200,6 +200,11 @@ let s:default_registry = { \ 'suggested_filetypes': ['javascript'], \ 'description': 'Fix JavaScript files using xo --fix.', \ }, +\ 'qmlfmt': { +\ 'function': 'ale#fixers#qmlfmt#Fix', +\ 'suggested_filetypes': ['qml'], +\ 'description': 'Fix QML files with qmlfmt.', +\ }, \} " Reset the function registry to the default entries. diff --git a/autoload/ale/fixers/qmlfmt.vim b/autoload/ale/fixers/qmlfmt.vim new file mode 100644 index 00000000..d750d1c4 --- /dev/null +++ b/autoload/ale/fixers/qmlfmt.vim @@ -0,0 +1,11 @@ +call ale#Set('qml_qmlfmt_executable', 'qmlfmt') + +function! ale#fixers#qmlfmt#GetExecutable(buffer) abort + return ale#Var(a:buffer, 'qml_qmlfmt_executable') +endfunction + +function! ale#fixers#qmlfmt#Fix(buffer) abort + return { + \ 'command': ale#Escape(ale#fixers#qmlfmt#GetExecutable(a:buffer)), + \} +endfunction |