Closed blakedietz closed 1 year ago
Are you using adding build = "make install_jsregexp"
to your lazy config for LuaSnip?
Yes.
Here's what the config looks like: https://github.com/blakedietz/dotfiles-lazyvim-nvim/blob/e7f18f3fd10d699cd012d7becdaebc24c5238d86/lua/plugins/elixir.lua#L51.
After fighting with some issues I ended up getting it working! Thanks for the recommendations. A couple of questions and thoughts.
Is version supposed to literally be copied and pasted? If so, it doesn't seem to work. I was getting an error.
{
"L3MON4D3/LuaSnip",
-- follow latest release.
version = "<CurrentMajor>.*",
-- install jsregexp (optional!).
build = "make install_jsregexp"
}
I was having some issues after setting the value for version as above literally (without replacing). After running LazyVim install I had to go into my ~/.local/share/nvim/lazy directory and delete a handful of LuaSnip plugin and related plugin directories by hand in order to get everything to work again.
Thank you for the help. I've opened a pr against LazyVim to include this by default, as it feels like something that should be the default instead of the exception.
Closing as this fixed the issue.
I originally posted this question on the neovim subreddit. But after further sleuthing and some pointers from someone else, I ran into this section of the documentation.
I was wondering if you happen to have recommendations for installing jsregexp with LazyVim.
Problem
I'm using LuaSnip with some VSCode snippets I wrote. Expanding snippets works except for usages of VSCode variable transforms.
The snippets with pascal case transforms work fine in VSCode, but not in neovim, so I'm guessing there are three potential causes.
Potential root causes
It's always best to assume it's you before you assume it's something else.
Expected
When using one of my snippets with variable transforms for pascal case, the correct parts of the snippet are converted to pascal case.
Actual
When using one of my snippets with variable transforms for pascal case the snippet expands correctly, but does not convert variables to pascal case where specified.
Assumptions
Configuration
I use a custom flavor of lazy.nvim starter.
There are two areas that impact configurations that I'm aware of.
SuperTab
I'm using some SuperTab configurations that are ripped directly from
example.lua
here. This impacts both LuaSnip and SuperTab.LuaSnip
Then I configure LuaSnip to use the snippets I have on my local machine here.
As far as the actual file that's being used by LuaSnip, that's here.
I don't expect you to read the generated JSON as it is, so I wrote the smallest reproducible snippet below.
Example
Output for VSCode
Output for neovim