Skip to content

Commit c2c5f00

Browse files
committed
change stylua
1 parent 554e0f5 commit c2c5f00

File tree

8 files changed

+34
-16
lines changed

8 files changed

+34
-16
lines changed

crates/vim9-gen/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1716,9 +1716,12 @@ pub fn eval(program: parser::Program, opts: ParserOpts) -> anyhow::Result<Output
17161716

17171717
fn get_stylua_config() -> stylua_lib::Config {
17181718
stylua_lib::Config::new()
1719+
.with_column_width(100)
1720+
.with_line_endings(stylua_lib::LineEndings::Unix)
17191721
.with_indent_type(stylua_lib::IndentType::Spaces)
17201722
.with_indent_width(2)
1721-
.with_column_width(120)
1723+
.with_quote_style(stylua_lib::QuoteStyle::AutoPreferDouble)
1724+
.with_call_parentheses(stylua_lib::CallParenType::Always)
17221725
}
17231726

17241727
pub fn generate(contents: &str, opts: ParserOpts) -> Result<Output, (Output, String)> {

crates/vim9-gen/testdata/output/busted_methods.lua

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,13 @@ describe("filename", function()
5959
-- Actual test
6060
local x = { 1, 4, 2, 5 }
6161
NVIM9.fn_mut("sort", { x }, { replace = 0 })
62-
NVIM9.fn_mut("filter", {
63-
x,
64-
function(_, y)
62+
NVIM9.fn_mut(
63+
"filter",
64+
{ x, function(_, y)
6565
return NVIM9.ops["Modulo"](y, 2) == 0
66-
end,
67-
}, { replace = 0 })
66+
end },
67+
{ replace = 0 }
68+
)
6869
NVIM9.fn["assert_equal"]({ 2, 4 }, x)
6970

7071
-- Assert that errors is still empty

crates/vim9-gen/testdata/output/busted_methods_1.lua

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@ describe("filename", function()
1111

1212
-- Actual test
1313
local x = { 1, 2, 3 }
14-
NVIM9.fn_mut("filter", { x, function(_, y)
15-
return y == 2
16-
end }, { replace = 0 })
14+
NVIM9.fn_mut("filter", {
15+
x,
16+
function(_, y)
17+
return y == 2
18+
end,
19+
}, { replace = 0 })
1720

1821
NVIM9.fn["assert_equal"]({ 2 }, x)
1922

crates/vim9-gen/testdata/output/busted_methods_2.lua

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@ describe("filename", function()
1111

1212
-- Actual test
1313
local x = { 1, 2, 3 }
14-
NVIM9.fn_mut("filter", { x, function(_, y)
15-
return y == 2
16-
end }, { replace = 0 })
14+
NVIM9.fn_mut("filter", {
15+
x,
16+
function(_, y)
17+
return y == 2
18+
end,
19+
}, { replace = 0 })
1720

1821
NVIM9.fn["assert_equal"](x, { 2 })
1922

crates/vim9-gen/testdata/output/busted_operations.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ describe("filename", function()
2929

3030
-- Actual test
3131
local x = true
32-
if NVIM9.bool(NVIM9.ops["Or"](NVIM9.prefix["Bang"](NVIM9.fn["has"]("vim9script")), 900 < 900)) then
32+
if
33+
NVIM9.bool(NVIM9.ops["Or"](NVIM9.prefix["Bang"](NVIM9.fn["has"]("vim9script")), 900 < 900))
34+
then
3335
x = false
3436
end
3537

crates/vim9-gen/testdata/output/busted_shared.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ describe("filename", function()
1313

1414
-- Actual test
1515
pcall(vim.cmd, [[ syn keyword Test testkeyword contained ]])
16-
NVIM9.fn["assert_equal"](2, NVIM9.fn["len"](NVIM9.fn["split"](NVIM9.fn["execute"]("syntax list Test"), "\n")))
16+
NVIM9.fn["assert_equal"](
17+
2,
18+
NVIM9.fn["len"](NVIM9.fn["split"](NVIM9.fn["execute"]("syntax list Test"), "\n"))
19+
)
1720

1821
-- Assert that errors is still empty
1922
assert.are.same({}, vim.v.errors)

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ fn main() -> Result<()> {
109109
gen::ParserOpts {
110110
mode: gen::ParserMode::Autoload {
111111
// TODO: Calculate this correctly...
112-
prefix: "something".to_string(),
112+
prefix: "ccomplete".to_string(),
113113
},
114114
},
115115
) {

stylua.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
column_width = 100
2+
line_endings = "Unix"
13
indent_type = "Spaces"
24
indent_width = 2
3-
no_call_parentheses = true
5+
quote_style = "AutoPreferSingle"
6+
call_parentheses = "Always"

0 commit comments

Comments
 (0)