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

Pressing C-Y to accept completions cause luv thread to fail #725

Closed
2 tasks done
leath-dub opened this issue Dec 22, 2024 · 4 comments · Fixed by #726
Closed
2 tasks done

Pressing C-Y to accept completions cause luv thread to fail #725

leath-dub opened this issue Dec 22, 2024 · 4 comments · Fixed by #726
Labels
bug Something isn't working

Comments

@leath-dub
Copy link
Contributor

Make sure you have done the following

  • I have updated to the latest version of blink.cmp
  • I have read the README

Bug Description

This is a strange one, I have the default settings apart from these overrides:

  fuzzy = {
    prebuilt_binaries = {
      download = false,
    }
  },

I am using a nix derivation which compiles "libblink_cmp_fuzzy.so" into $HOME/.nix-profile/lib/libblink_cmp_fuzzy.so", I then add "$HOME/.nix-profile/lib/lib?.so" to my package.cpath`. This seems to work great and I get the completion pop ups on the latest version fine.

The only problem is when I hit <C-y> to accept a completion I get the following error without any trace:

Error in luv thread:                                                                                                                    
module 'blink_cmp_fuzzy' not found:                                                                                                     
        no field package.preload['blink_cmp_fuzzy']                                                                                     
        no file '/nix/store/lbhayvfs66lnrxkrfh2pv6nsqw9qy4vz-luajit-2.1.1713773202-env/share/lua/5.1/blink_cmp_fuzzy.lua'               
        no file '/nix/store/lbhayvfs66lnrxkrfh2pv6nsqw9qy4vz-luajit-2.1.1713773202-env/share/lua/5.1/blink_cmp_fuzzy/init.lua'          
        no file '/nix/store/lbhayvfs66lnrxkrfh2pv6nsqw9qy4vz-luajit-2.1.1713773202-env/lib/lua/5.1/blink_cmp_fuzzy.so'                  
        no file '/home/cathalo/.config/nvim/pack/add/opt/blink.cmp/lua/blink/cmp/fuzzy/../../../../target/release/libblink_cmp_fuzzy.so'
        no file '/home/cathalo/.config/nvim/pack/add/opt/blink.cmp/lua/blink/cmp/fuzzy/../../../../target/release/blink_cmp_fuzzy.so'

This behaviour I can observer on neovim 0.10.2 but also on nightly 0.11.0-dev (I switched to see if it is upstream issue that is already fixed).

Not sure why it errors on not finding package.preload field as that is the first step in a chain that lua require uses, it is not uncommon for package.preload to be nil, right...

Relevant configuration

fuzzy = {
    prebuilt_binaries = {
      download = false,
    }
  },

neovim version

v0.11.0-dev

blink.cmp version: branch, tag, or commit

v0.8.1

@leath-dub leath-dub added the bug Something isn't working label Dec 22, 2024
@leath-dub
Copy link
Contributor Author

Even when I do this:

package.preload["blink_cmp_fuzzy"] = require("blink_cmp_fuzzy")

It still gives same error?? this is very strange

@leath-dub
Copy link
Contributor Author

I think I narrowed the issue down to be here https://github.com/Saghen/blink.cmp/blob/main/lua/blink/cmp/fuzzy/init.lua#L27

@leath-dub
Copy link
Contributor Author

For now I'll just wrap it in a pcall

@leath-dub
Copy link
Contributor Author

Ok so I figured out the issue, ill make a pr that fixes this.

Basically the issue is that package.cpath is not inherited by the worker, this is fine for the standard paths as the rust.lua file will always add these paths whenever it is required. There needs to be a way for the user to be able to specify extra paths, or package.cpath needs to be properly inherited by the worker: which I am not sure why this doesn't happen by default ?

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.

1 participant