-
-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Breaking Changes #81
Comments
23.07.2021Changed default for s({trig = "trigger anywhere"}, {...}) or s("trigger anywhere", {...}) to s({trig = "trigger anywhere", wordTrig=false}, {...}) |
24.07.2021Move pseudo-nodes ( These functions are probably imported once: local r = require("luasnip.util.functions").rep
local p = require("luasnip.util.functions").partial Those lines must be changed to local r = require("luasnip.extras").rep
local p = require("luasnip.extras").partial |
02.08.2021Pass function/dynamicNodes their arg-text without snippet-indent, prepend snippet-indent to returned text. Should affect very few setups, if a functionNode relies on the previous behaviour, they can now be simplified. |
26.08.2021This commit changes the third and subsequent arguments to -- Checks whether the same number of c1 and c2 occur on the current line.
-- The implementation is omitted as it is irrelevant in this context.
local function char_count_nequal(c1, c2) ... end
-- only expand if a closing ) is missing:
s("(", {t"(", i(1), t")"}, char_count_nequal, "(", ")") would now be -- Checks whether the same number of c1 and c2 occur on the current line.
-- The implementation is omitted as it is irrelevant in this context.
local function char_count_nequal(c1, c2) ... end
local function partial(func, ...)
local args = {...}
return function() return func(unpack(args))
end
-- only expand if a closing ) is missing:
s("(", {t"(", i(1), t")"}, { condition = partial(char_count_nequal, "(", ")") }) (The |
Doesn't apply anymore as of 31.08.2021, eg. |
05.09.2021The functions used in Changing function(text)
-- do something with text.
end to function(args)
local text = table.concat(args[1], "\n")
-- do the same thing with text.
end should do the trick. |
21.09.2021Changes the signature of the function passed to function/dynamicNodes from -- snippet inside the table of argnodes' text.
function({argnode_text, snip}, ...) end to function(argnode_text, snip, ...) end (eg. the snippet can no longer be accessed as This will likely break many configs, but adjusting the existing functions should be straightforward: -- also likely: args[#args]
f(function(args) return args[1].env.SELECT_DEDENT end, {}) to f(function(args, snip) return snip.env.SELECT_DEDENT end, {}) |
23.09.2021Changes the meaning of vim.api.nvim_command("hi LuasnipInsertNodePassive cterm=italic")
ls.config.setup({
ext_opts = {
[types.choiceNode] = {
passive = {
virt_text = {{"●", "GruvboxOrange"}},
}
},
},
}) to vim.api.nvim_command("hi LuasnipInsertNodeSnippetPassive cterm=italic")
ls.config.setup({
ext_opts = {
[types.choiceNode] = {
snippet_passive = {
virt_text = {{"●", "GruvboxOrange"}},
}
},
},
}) |
29.10.2021The module local conditions = require("luasnip.extras.conditions") to local conditions = require("luasnip.extras.expand_conditions") |
14.12.2021
Most dynamic/functionNode-functions should keep working, if not, replacing all occurences of second_arg.env.SOMETHING with second_arg.snippet.env.SOMETHING should do the trick. |
07.03.2022
There are two ways to mitigate the effect of this change on your precious startuptime:
|
11.03.2022The last argument of all nodes is now a table containing optional arguments, which clashes with the d(1, some_function, {argnode1, argnode2}, "user_arg1", "user_arg2") becomes d(1, some_function, {argnode1, argnode2}, { user_args = {"user_arg1", "user_arg2"}}) |
This is not a breaking change, but important nonetheless: |
20.03.2022Accessing If you cannot find the time to adapt your luasnip-config until then, follow the From now on, ls.snippets = {
all = {
...
},
lua = {
...
},
...
} becomes ls.add_snippets(nil, {
all = {
...
},
lua = {
...
},
}) ls.snippets.c = {
...
} becomes ls.add_snippets("c", {
...
}) If you want to be able to reload your snippets, you can provide an unique ls.add_snippets("lua", {
...
}, {
key = "my_lua_snippets"
}) If you're currently using -- load all snippets directly, on startup.
require("luasnip.loaders.from_lua").load({paths = "path/to/the/snippet/directory"})
-- emulate previous behaviour, eg. load snippets as late as possible.
require("luasnip.loaders.from_lua").lazy_load({paths = "path/to/the/snippet/directory"}) (you'll probably want the You can also move the snippet-files to a directory inside any in |
28.03.2022As announced in the previous comment, |
17.08.2022(This shouldn't affect any configs during "regular" usage) Luasnip, in some instances, replaces paths with the parent-directory of |
02.09.2022(shouldn't affect anyone tbh, but technically...) (Some older luasnip-specific variables, |
09.10.2022Deprecation |
04.10.2023Deprecation |
Watch this issue to be notified of any breaking changes.
thanks to @clason for recommending this
The text was updated successfully, but these errors were encountered: