Can't seem to make completion that involves comment prefixes to work #2338
-
|
Hello! I'm using this plugin in combination with luasnip and friendly-snippets to add snippets to my workflow. Friendly-snippets provides documentation snippets which must be enabled by the user to access in config, which I've done. I know they're enabled correctly because I can use the snippets from that file that begin with things like "@param" and "@return". However I can't seem to get snippets with the prefixes "/*" and "/**" to work right. Has anyone else had this problem? Here's my config: return {
"saghen/blink.cmp",
dependencies = {
{ "L3MON4D3/LuaSnip", version = "v2.*" },
},
opts = {
snippets = {
preset = "luasnip",
},
},
sources = {
default = { "snippets", "lsp", "path", "buffer" },
},
}return {
"L3MON4D3/LuaSnip",
dependencies = {
"rafamadriz/friendly-snippets",
},
config = function(_, opts)
if opts then
require("luasnip").config.setup(opts)
end
vim.tbl_map(function(type)
require("luasnip.loaders.from_" .. type).lazy_load()
end, { "vscode", "snipmate", "lua" })
-- friendly-snippets - enable standardized comments snippets
require("luasnip").filetype_extend("lua", { "luadoc" })
require("luasnip").filetype_extend("python", { "pydoc" })
require("luasnip").filetype_extend("rust", { "rustdoc" })
require("luasnip").filetype_extend("cs", { "csharpdoc" })
require("luasnip").filetype_extend("java", { "javadoc" })
require("luasnip").filetype_extend("c", { "cdoc" })
require("luasnip").filetype_extend("cpp", { "cppdoc" })
require("luasnip").filetype_extend("sh", { "shelldoc" })
end,
}
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
This is because your snippet have only special characters, namely In the meantime you could workaround this with the following config, this will trigger snippet source (so in your case luasnip) whenever your type sources = {
-- ...
providers = {
snippets = {
override = {
get_trigger_characters = function(_) return {'*'} end,
},
},
},
}, |
Beta Was this translation helpful? Give feedback.


This is because your snippet have only special characters, namely
/, and*. See this related issue: #1688In the meantime you could workaround this with the following config, this will trigger snippet source (so in your case luasnip) whenever your type
*: