Skip to content

Commit 4eead79

Browse files
committed
Format with stylua
1 parent 5d87d9e commit 4eead79

5 files changed

Lines changed: 18 additions & 6 deletions

File tree

lua/luasnip/extras/filetype_functions.lua

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,16 @@ local function from_cursor_pos()
77
if has_parser then
88
local cursor = util.get_cursor_0ind()
99
-- assumption: languagetree uses 0-indexed byte-ranges.
10-
return { parser:language_for_range({ cursor[1], cursor[2], cursor[1], cursor[2] }):lang() }
10+
return {
11+
parser
12+
:language_for_range({
13+
cursor[1],
14+
cursor[2],
15+
cursor[1],
16+
cursor[2],
17+
})
18+
:lang(),
19+
}
1120
else
1221
return {}
1322
end

lua/luasnip/loaders/from_lua.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,16 @@ local function load_files(ft, files, add_opts)
4545
local file_added_autosnippets = {}
4646

4747
-- setup snip_env in func
48-
local func_env = vim.tbl_extend("force",
48+
local func_env = vim.tbl_extend(
49+
"force",
4950
-- extend the current(expected!) globals with the snip_env, and the two tables.
5051
_G,
5152
ls.get_snip_env(),
5253
{
5354
ls_file_snippets = file_added_snippets,
5455
ls_file_autosnippets = file_added_autosnippets,
55-
})
56+
}
57+
)
5658
-- defaults snip-env requires metatable for resolving
5759
-- lazily-initialized keys. If we have to combine this with an eventual
5860
-- metatable of _G, look into unifying ls.setup_snip_env and this.

lua/luasnip/util/util.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ local function lazy_table(lazy_t, lazy_defs)
589589
return v_resolved
590590
end
591591
return nil
592-
end
592+
end,
593593
})
594594
end
595595

tests/helpers.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ end
2626

2727
function M.session_setup_luasnip(opts)
2828
opts = opts or {}
29-
local no_snip_globals = opts.no_snip_globals ~= nil and opts.no_snip_globals or false
29+
local no_snip_globals = opts.no_snip_globals ~= nil and opts.no_snip_globals
30+
or false
3031

3132
helpers.exec("set rtp+=" .. os.getenv("LUASNIP_SOURCE"))
3233
helpers.exec(

tests/integration/loaders_spec.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ describe("loaders:", function()
104104

105105
before_each(function()
106106
helpers.clear()
107-
ls_helpers.session_setup_luasnip({no_snip_globals = true})
107+
ls_helpers.session_setup_luasnip({ no_snip_globals = true })
108108

109109
screen = Screen.new(50, 5)
110110
screen:attach()

0 commit comments

Comments
 (0)