File tree 3 files changed +9
-5
lines changed
3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -8,14 +8,13 @@ let s:plugin = maktaba#plugin#Get('codefmt')
8
8
function ! codefmt#jsonnetfmt#GetFormatter () abort
9
9
let l: formatter = {
10
10
\ ' name' : ' jsonnetfmt' ,
11
- \ ' setup_instructions' : ' Install jsonnet. ' .
12
- \ ' (https://jsonnet.org/).' }
11
+ \ ' setup_instructions' : ' Install jsonnet. (https://jsonnet.org/).' }
13
12
14
13
function l: formatter .IsAvailable () abort
15
14
return executable (s: plugin .Flag (' jsonnetfmt_executable' ))
16
15
endfunction
17
16
18
- let l: supported_filetypes = [' json' ,' jsonnet' ]
17
+ let l: supported_filetypes = [' json' , ' jsonnet' ]
19
18
20
19
function l: formatter .AppliesToBuffer () abort
21
20
return index (l: supported_filetypes , &filetype ) >= 0
@@ -24,7 +23,6 @@ function! codefmt#jsonnetfmt#GetFormatter() abort
24
23
" "
25
24
" Reformat the current buffer with jsonnetfmt or the binary named in
26
25
" @flag(jsonnetfmt_executable)
27
- " @throws ShellError
28
26
function l: formatter .Format () abort
29
27
let l: cmd = [ s: plugin .Flag (' jsonnetfmt_executable' ) ]
30
28
let l: fname = expand (' %:p' )
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ The current list of defaults by filetype is:
44
44
* java: google-java-format
45
45
* javascript, json, html, css: js-beautify
46
46
* javascript, html, css, markdown: prettier
47
+ * json, jsonnet: jsonnetfmt
47
48
* kotlin: ktfmt
48
49
* lua: luaformatterfiveone
49
50
* nix: nixpkgs-fmt
@@ -141,6 +142,10 @@ Options:
141
142
"+some-warning": Add 'some-warning' to the warning set.
142
143
Default: '' `
143
144
145
+ *codefmt:jsonnetfmt_executable*
146
+ The path to the jsonnetfmt executable.
147
+ Default: 'jsonnetfmt' `
148
+
144
149
*codefmt:google_java_executable*
145
150
The path to the google-java executable. Generally, this should have the form:
146
151
`java -jar /path/to/google-java`
Original file line number Diff line number Diff line change 38
38
" * java: google-java-format
39
39
" * javascript, json, html, css: js-beautify
40
40
" * javascript, html, css, markdown: prettier
41
+ " * json, jsonnet: jsonnetfmt
41
42
" * kotlin: ktfmt
42
43
" * lua: luaformatterfiveone
43
44
" * nix: nixpkgs-fmt
@@ -69,7 +70,7 @@ call s:registry.AddExtension(codefmt#fish_indent#GetFormatter())
69
70
call s: registry .AddExtension (codefmt#gn#GetFormatter ())
70
71
call s: registry .AddExtension (codefmt#gofmt#GetFormatter ())
71
72
call s: registry .AddExtension (codefmt#googlejava#GetFormatter ())
72
- call s . registry.AddExtension (codefmt#jsonnetfmt#GetFormatter ())
73
+ call s: registry .AddExtension (codefmt#jsonnetfmt#GetFormatter ())
73
74
call s: registry .AddExtension (codefmt#jsbeautify#GetFormatter ())
74
75
call s: registry .AddExtension (codefmt#prettier#GetFormatter ())
75
76
call s: registry .AddExtension (codefmt#ktfmt#GetFormatter ())
You can’t perform that action at this time.
0 commit comments