garymjr / garymjr/nvim-snippets
friendly-snippets luarock doesn't work
- Dominant language
- Lua
- Stars
- 259
- Forks
- 20
- PR merge metrics
- No merged PRs in 30d
Description
Hello! I'm having some issues using friendly-snippets with this plugin.
I'm using rocks.nvim as my plugin manager, and the `friendly_snippets` config option doesn't seem to pick up the luarock installation automatically. No big deal, that's what `search_paths` is for, right? My current configuration looks something like this:
```
require("snippets").setup {
-- friendly_snippets = true, -- doesn't find the Rocks.nvim installation
create_cmp_source = true,
search_paths = {
vim.fn.stdpath('data') .. '/site/pack/luarocks/opt/friendly-snippets/snippets', -- this is where the snippets are located, but they don't seem to be picked up...
vim.fn.stdpath('config') .. '/snippets', -- if I symlink the directory above to this one it seems to work, but isn't the most portable
}
}
```
The above snippet... doesn't work either. As mentioned in my comments, if I symlink the friendly-snippets location (the same directory that the config evaluates to) to the .config/nvim/snippets directory, it's picked up and lua snippets show up in my completion. My immediate assumption was a permissions error but my user has full read/write on the snippets directory. Maybe the path is too long?
Using rocks-git.nvim to grab the source for friendly-snippets and adding that directory into the `search_path` didn't work, and pointing it to the directory above the snippets where the `package.json` was didn't work either.
I don't really know what else to try, some help would be appreciated!
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the setup shown in the issue with rocks.nvim, friendly-snippets, and both search_paths entries. Start at require("snippets").setup and trace how the friendly_snippets option and configured paths are resolved; compare the luarock path with the symlinked path. Done means snippets load from the luarock installation without a symlink and the behavior is covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100