forked from google/vim-codefmt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathluaformatterfiveone.vroom
53 lines (41 loc) · 1.49 KB
/
luaformatterfiveone.vroom
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
luaformatterfiveone" formatter only knows how to format lua 5.1 code.
If you aren't familiar with basic codefmt usage yet, see main.vroom
We'll set up codefmt and configure the vroom environment, then jump into some
examples.
:source $VROOMDIR/setupvroom.vim
:let g:repeat_calls = []
:function FakeRepeat(...)<CR>
| call add(g:repeat_calls, a:000)<CR>
:endfunction
:call maktaba#test#Override('repeat#set', 'FakeRepeat')
:call codefmt#SetWhetherToPerformIsAvailableChecksForTesting(0)
luaformatterfiveone expects the lua formatterfiveone executable to be installed
on your system.
% function hello()
% print("world")
% end
:FormatCode luaformatterfiveone
! luaformatterfiveone -i 2> .*
$ function hello()
$ print("world")
$ end
The name or path of the luaformatterfiveone executable can be configured via the
luaformatterfiveone_executable flag if the default of "buildifier" doesn't work.
:Glaive codefmt luaformatterfiveone_executable='myluaformatterfiveone'
:FormatCode luaformatterfiveone
! myluaformatterfiveone -i 2> .*
$ function hello()
$ print("world")
$ end
:Glaive codefmt luaformatterfiveone_executable='luaformatterfiveone'
Errors are reported using the quickfix list.
@clear
% 13()
:FormatCode luaformatterfiveone
! luaformatterfiveone -i 2> .*
~ (1 of 1): unexpected symbol near '13'
:echomsg line('.') . ',' . col('.')
~ 1,1
:echomsg string(map(getqflist(),
|'v:val.lnum . "," . v:val.text'))
~ ['1,unexpected symbol near ''13''']