File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Expand file tree Collapse file tree 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')
88function ! codefmt#jsonnetfmt#GetFormatter () abort
99 let l: formatter = {
1010 \ ' name' : ' jsonnetfmt' ,
11- \ ' setup_instructions' : ' Install jsonnet. ' .
12- \ ' (https://jsonnet.org/).' }
11+ \ ' setup_instructions' : ' Install jsonnet. (https://jsonnet.org/).' }
1312
1413 function l: formatter .IsAvailable () abort
1514 return executable (s: plugin .Flag (' jsonnetfmt_executable' ))
1615 endfunction
1716
18- let l: supported_filetypes = [' json' ,' jsonnet' ]
17+ let l: supported_filetypes = [' json' , ' jsonnet' ]
1918
2019 function l: formatter .AppliesToBuffer () abort
2120 return index (l: supported_filetypes , &filetype ) >= 0
@@ -24,7 +23,6 @@ function! codefmt#jsonnetfmt#GetFormatter() abort
2423 " "
2524 " Reformat the current buffer with jsonnetfmt or the binary named in
2625 " @flag(jsonnetfmt_executable)
27- " @throws ShellError
2826 function l: formatter .Format () abort
2927 let l: cmd = [ s: plugin .Flag (' jsonnetfmt_executable' ) ]
3028 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:
4444 * java: google-java-format
4545 * javascript, json, html, css: js-beautify
4646 * javascript, html, css, markdown: prettier
47+ * json, jsonnet: jsonnetfmt
4748 * kotlin: ktfmt
4849 * lua: luaformatterfiveone
4950 * nix: nixpkgs-fmt
@@ -141,6 +142,10 @@ Options:
141142"+some-warning": Add 'some-warning' to the warning set.
142143Default: '' `
143144
145+ *codefmt:jsonnetfmt_executable*
146+ The path to the jsonnetfmt executable.
147+ Default: 'jsonnetfmt' `
148+
144149 *codefmt:google_java_executable*
145150The path to the google-java executable. Generally, this should have the form:
146151`java -jar /path/to/google-java`
Original file line number Diff line number Diff line change 3838" * java: google-java-format
3939" * javascript, json, html, css: js-beautify
4040" * javascript, html, css, markdown: prettier
41+ " * json, jsonnet: jsonnetfmt
4142" * kotlin: ktfmt
4243" * lua: luaformatterfiveone
4344" * nix: nixpkgs-fmt
@@ -69,7 +70,7 @@ call s:registry.AddExtension(codefmt#fish_indent#GetFormatter())
6970call s: registry .AddExtension (codefmt#gn#GetFormatter ())
7071call s: registry .AddExtension (codefmt#gofmt#GetFormatter ())
7172call s: registry .AddExtension (codefmt#googlejava#GetFormatter ())
72- call s . registry.AddExtension (codefmt#jsonnetfmt#GetFormatter ())
73+ call s: registry .AddExtension (codefmt#jsonnetfmt#GetFormatter ())
7374call s: registry .AddExtension (codefmt#jsbeautify#GetFormatter ())
7475call s: registry .AddExtension (codefmt#prettier#GetFormatter ())
7576call s: registry .AddExtension (codefmt#ktfmt#GetFormatter ())
You can’t perform that action at this time.
0 commit comments