Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More info on install #31

Closed
olekspickle opened this issue Feb 25, 2024 · 17 comments · Fixed by #43
Closed

More info on install #31

olekspickle opened this issue Feb 25, 2024 · 17 comments · Fixed by #43
Labels
bug Something isn't working

Comments

@olekspickle
Copy link

olekspickle commented Feb 25, 2024

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:


Error detected while processing /home/pickle/.config/nvim/init.lua:
E5113: Error while calling lua chunk: Vim:E475: Invalid value for argument cmd: '/home/pickle/.config/nvim/site/pack/packer/start/codesna
p.nvim/snap-server/target/release/snap-server' is not executable
stack traceback:
        [C]: in function 'connect'
        .../pack/packer/start/codesnap.nvim/lua/codesnap/client.lua:29: in function 'init'
        .../pack/packer/start/codesnap.nvim/lua/codesnap/client.lua:33: in function 'start'
        ...te/pack/packer/start/codesnap.nvim/lua/codesnap/init.lua:15: in function 'setup'
        /home/pickle/.config/nvim/init.lua:39: in main chunk

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

@mistricky
Copy link
Owner

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:
image

Please notice there is an option build = 'make', before lazy installing the plugin, the build content will execute immediately. Can you provide your configuration?

@olekspickle
Copy link
Author

olekspickle commented Feb 26, 2024

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

@mistricky
Copy link
Owner

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' }

@olekspickle
Copy link
Author

olekspickle commented Mar 4, 2024

that's exactly how I added it, every time I try to reset it ends the same way

@mistricky mistricky added the bug Something isn't working label Mar 5, 2024
@mistricky
Copy link
Owner

After refactor, this issue may out of stale, can you try with latest version?

@olekspickle
Copy link
Author

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

@mistricky
Copy link
Owner

Can you provide your OS version and neovim version?

@olekspickle
Copy link
Author

Ubuntu 23.10
NVIM v0.9.1

@mistricky mistricky linked a pull request Mar 14, 2024 that will close this issue
4 tasks
@mistricky
Copy link
Owner

This issue may relate to which arch you use. What output of execute uname -a on your OS?

@olekspickle
Copy link
Author

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

@mistricky
Copy link
Owner

Hi! CodeSnap was refactored, you can reinstall follow the latest README, if have any problems just let me know

@mistricky mistricky reopened this Mar 16, 2024
@olekspickle
Copy link
Author

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

@Simon9991
Copy link

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,
},

@mistricky
Copy link
Owner

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.

@Simon9991
Copy link

Hi,
I just tried with the new version, and I have no issue anymore on my end!
Thanks for this plugin, I love it!

@olekspickle
Copy link
Author

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

@mistricky
Copy link
Owner

Hi @alekspickle sorry for replying late.

do you have the process of install described somewhere

Nope yet. CodeSnap.nvim is written by rust, and exposes FFI to communicate with Lua modules, if you are interested in this solution, you can check this repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants