Struggling to load snippets for one filetype in another #968
Answered
by
L3MON4D3
westernwontons
asked this question in
Q&A
-
I'm trying to load my typescript snippets in svelte files using return {
"L3MON4D3/LuaSnip",
config = function()
require("luasnip").setup {
region_check_events = { "CursorHold", "InsertLeave", "CursorMoved" },
delete_check_events = { "TextChanged", "InsertEnter" },
store_selection_keys = "<C-x>",
enable_autosnippets = true,
load_ft_func = require("luasnip.extras.filetype_functions").extend_load_ft {
svelte = { "typescript" },
},
}
require("luasnip.loaders.from_lua").lazy_load {
paths = "./lua/user/luasnips",
}
end,
build = "make install_jsregexp",
} I tried multiple different filetypes, swapping them, rotating them, but the typescript snippets don't seem to get loaded when I'm in a svelte file. What am I missing? |
Beta Was this translation helpful? Give feedback.
Answered by
L3MON4D3
Jul 29, 2023
Replies: 1 comment 1 reply
-
Do you also have an |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
westernwontons
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do you also have an
ls.filetype_extend("svelte", {"typescript"})
somewhere?load_ft_func
only takes care of loading, which is (maybe a bit unexpectedly) unrelated to the actually active filetypes.