Closed alekspickle closed 2 months ago
Hey @alekspickle, thx for using codesnap.nvim, and reporting the issue, if you can't install it smoothly, there are only one reason, not because you're stupid, but because the documentation isn't detailed enough, sorry about that.
Do you install codesnap.nvim using Lazy.nvim? the config looks like:
Please notice there is an option build = 'make'
, before lazy installing the plugin, the build content will execute immediately. Can you provide your configuration?
nah, I wish i discovered lazy.nvim when i tried nvim the first time, at the moment I just use packer for all packages and simply adding this line as use statement installs codesnap nvim package, but apparently does not servers run the rust build/install command. If you can hint me where the entrypoint is, I can do a PR, running check that snap-server is available in path and running something like
[[ -x $(command -v snap-server) ]] && \
cd snap-server && \
cargo build --release && \
cp target/release/snap-server /usr/bin/
on init
The reason of this because the codesnap.nvim
needs build server code after installed, the document lacks this part how install this plugin with packer, I'll add it later.
Install this plugin use packer you configure like this:
use { 'mistricky/codesnap.nvim', run = 'make' }
that's exactly how I added it, every time I try to reset it ends the same way
After refactor, this issue may out of stale, can you try with latest version?
new error!
Error detected while processing /home/pickle/.config/nvim/site/pack/packer/start/codesnap.nvim/plugin/codesnap.lua:
E5113: Error while calling lua chunk: vim/_init_packages.lua:0: /home/pickle/.config/nvim/site/pack/packer/start/codesnap.nvim/lua/genera
tor.so: invalid ELF header
stack traceback:
[C]: in function 'error'
vim/_init_packages.lua: in function <vim/_init_packages.lua:0>
[C]: in function 'require'
...te/pack/packer/start/codesnap.nvim/lua/codesnap/init.lua:3: in main chunk
[C]: in function 'require'
...site/pack/packer/start/codesnap.nvim/plugin/codesnap.lua:1: in main chunk
Can you provide your OS version and neovim version?
Ubuntu 23.10 NVIM v0.9.1
This issue may relate to which arch you use. What output of execute uname -a
on your OS?
Linux picklelap 6.5.0-25-generic #25-Ubuntu SMP PREEMPT_DYNAMIC Wed Feb 7 14:58:39 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Hi! CodeSnap was refactored, you can reinstall follow the latest README, if have any problems just let me know
Did not work either
Error detected while processing /home/pickle/.config/nvim/site/pack/packer/start/codesnap.nvim/plugin/codesnap.lua:
E5113: Error while calling lua chunk: ...te/pack/packer/start/codesnap.nvim/lua/codesnap/init.lua:3: module 'generator' not found:
no field package.preload['generator']
no file './generator.lua'
no file '/__w/neovim/neovim/.deps/usr/share/luajit-2.1.0-beta3/generator.lua'
no file '/usr/local/share/lua/5.1/generator.lua'
no file '/usr/local/share/lua/5.1/generator/init.lua'
no file '/__w/neovim/neovim/.deps/usr/share/lua/5.1/generator.lua'
no file '/__w/neovim/neovim/.deps/usr/share/lua/5.1/generator/init.lua'
no file '/home/pickle/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/generator.lua'
no file '/home/pickle/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/generator/init.lua'
no file '/home/pickle/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/generator.lua'
no file '/home/pickle/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/generator/init.lua'
no file './generator.so'
no file '/usr/local/lib/lua/5.1/generator.so'
no file '/__w/neovim/neovim/.deps/usr/lib/lua/5.1/generator.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file '/home/pickle/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/generator.so'
stack traceback:
[C]: in function 'require'
...te/pack/packer/start/codesnap.nvim/lua/codesnap/init.lua:3: in main chunk
[C]: in function 'require'
...site/pack/packer/start/codesnap.nvim/plugin/codesnap.lua:1: in main chunk
Did not work either
Error detected while processing /home/pickle/.config/nvim/site/pack/packer/start/codesnap.nvim/plugin/codesnap.lua: E5113: Error while calling lua chunk: ...te/pack/packer/start/codesnap.nvim/lua/codesnap/init.lua:3: module 'generator' not found: no field package.preload['generator'] no file './generator.lua' no file '/__w/neovim/neovim/.deps/usr/share/luajit-2.1.0-beta3/generator.lua' no file '/usr/local/share/lua/5.1/generator.lua' no file '/usr/local/share/lua/5.1/generator/init.lua' no file '/__w/neovim/neovim/.deps/usr/share/lua/5.1/generator.lua' no file '/__w/neovim/neovim/.deps/usr/share/lua/5.1/generator/init.lua' no file '/home/pickle/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/generator.lua' no file '/home/pickle/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/generator/init.lua' no file '/home/pickle/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/generator.lua' no file '/home/pickle/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/generator/init.lua' no file './generator.so' no file '/usr/local/lib/lua/5.1/generator.so' no file '/__w/neovim/neovim/.deps/usr/lib/lua/5.1/generator.so' no file '/usr/local/lib/lua/5.1/loadall.so' no file '/home/pickle/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/generator.so' stack traceback: [C]: in function 'require' ...te/pack/packer/start/codesnap.nvim/lua/codesnap/init.lua:3: in main chunk [C]: in function 'require' ...site/pack/packer/start/codesnap.nvim/plugin/codesnap.lua:1: in main chunk
I had the same issue with the module generator
not being found.
In field package.preload['generator']
cache_loader: module generator not found
cache_loader_lib: module generator not found
In file './generator.lua'
I fixed the issue by using version 0.0.11
, instead of ^1
like written in the documentation.
Here is my codesnap.lua
if needed (I am using LazyVim though):
{
"mistricky/codesnap.nvim",
lazy = true,
version = "0.0.11",
build = "make",
cmd = "CodeSnapPreviewOn",
opts = {
mac_window_bar = false, -- (Optional) MacOS style title bar switch
},
config = function(_, opts)
require("codesnap").setup(opts)
end,
},
Hello guys @Simon9991 @alekspickle, this issue has been open for too long, something has changed since I released v1, can you guys test this bug in the latest version? if still not working properly, please let me know.
Hi, I just tried with the new version, and I have no issue anymore on my end! Thanks for this plugin, I love it!
Works like intended! Thank you but just out of curiosity, do you have the process of install described somewhere? I also want to write nvim plugin with rust backend
Maybe I'm stupid, but while trying to install, I just added specified line to packer plugin list, and I get this error on init:
I mean I get that server-snap is not installed, but at which point should it? and is there some command that copies rust binary to path or something? kinda confused it has not happened yet