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

No notification handler registered #107

Open
wizard-28 opened this issue Mar 7, 2022 · 7 comments
Open

No notification handler registered #107

wizard-28 opened this issue Mar 7, 2022 · 7 comments

Comments

@wizard-28
Copy link

wizard-28 commented Mar 7, 2022

Describe the bug
Here's my plugin config (using a Packer.nvim macro):

(use-package! :rcarriga/vim-ultest
              {:requires :vim-test/vim-test
               :run ":UpdateRemotePlugins"
               :setup (fn []
                        (let! test#python#pytest#options :--color=yes))})

Which compiles to:

  local function _7_()
    vim.g["test#python#pytest#options"] = "--color=yes"
    return nil
  end
  use({requires = "vim-test/vim-test", run = ":UpdateRemotePlugins", setup = _7_, "rcarriga/vim-ultest"})

Using this configuration generates this error every time I open a test file:

no notification handler registered for "/home/pop-os/.local/share/nvim/site/pack/packer/start/vim-ultest/rplugin/python3/ultest:function
:_ultest_update_positions"

and after which if I run Ultest command

Error: vim-ultest encountered an unknown error on startup Vim(let):Error invoking '/home/pop-os/.local/share/nvim/site/pack/packer/start
/vim-ultest/rplugin/python3/ultest:function:_ultest_run_nearest' on channel 3 (python3-rplugin-host):^@no request handler registered for
 "/home/pop-os/.local/share/nvim/site/pack/packer/start/vim-ultest/rplugin/python3/ultest:function:_ultest_run_nearest"

Logs should be created using ULTEST_LOG_LEVEL=DEBUG ULTEST_LOG_FILE=vim-ultest.log nvim <test-file> and added here as well

Doesn't generate any log file.

To Reproduce

  1. Use my plugin configuration.
  2. Open a test file (example a pytest file)
  3. See the error.

Expected behavior
No errors, and the setting works as expected.

@wizard-28
Copy link
Author

I just found out this happens when doing any vim-ultest configuration in the setup function.

@rcarriga
Copy link
Owner

rcarriga commented Mar 8, 2022

This is because when you use a setup function paq will load the plugin after startup which means that when you :UpdateRemotePlugins, the functions are not detected. There's not much I can do about this, it is a side effect of how remote plugins work in neovim. The best workaround is to move your setup to your init.vim or somewhere else and have vim-ultest load on startup

@wizard-28
Copy link
Author

Okay, I'll try it today.

@akinsho
Copy link

akinsho commented Apr 27, 2022

Hi,

So I'm encountering the same issue using packer.nvim but I don't use a setup option for ultest in this case.

    use {
      'rcarriga/vim-ultest',
      requires = { 'vim-test' },
      run = ':UpdateRemotePlugins',
      config = function()
        as.augroup('UltestTests', {
          {
            event = { 'BufWritePost' },
            pattern = { '*_test.*', '*_spec.*' },
            command = 'UltestNearest',
          },
        })
        as.nmap(']t', '<Plug>(ultest-next-fail)', {
          label = 'ultest: next failure',
          buffer = 0,
        })
        as.nmap('[t', '<Plug>(ultest-prev-fail)', {
          label = 'ultest: previous failure',
          buffer = 0,
        })
      end,
    }

@rcarriga
Copy link
Owner

Can you verify that vim-ultest is in the start directory and not the opt directory of packer's pack?

@akinsho
Copy link

akinsho commented Apr 28, 2022

@rcarriga so I thought it might be that, but it is definitely in the start directory and still giving this error.

Screen Shot 2022-04-28 at 13 08 09

I think I just managed to fix it by setting vim-test to not be conditionally loaded, I was previously loading it on demand, but seems that was what was causing this issue.

@rcarriga
Copy link
Owner

Ah yes that'd be it, vim-ultest assumes vim-test is available on load as it needs to call it on startup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants