Closed richin13 closed 2 years ago
I can't get a nvim nightly release from https://github.com/neovim/neovim/releases, so I built from source https://github.com/neovim/neovim/commit/e8fb0728e220bb378a8689415c3915fe5912e987.
:version
NVIM v0.6.0-dev+e8fb0728e
Build type: Release
LuaJIT 2.1.0-beta3
Tested with the master and release branch, can't reproduce this, the rename/doHover
works as expected.
Tested with node 14 and 16, coc-tsserver for TypeScript, coc-pyright/coc-jedi for Python, coc-go for Go project, with coc.nvim release branch, still can't reproduce this.
@npearson72 @UltiRequiem @pappasam @andrevmatos sorry to boring you, but I saw you reacted on this issue, can you guys share something info/steps to reproduce this?
@fannheyward thanks for looking into it; one important thing to mention is that I don't use g:coc_global_extensions
nor CocInstall
and instead added the plugins directly with my package manager like this:
call packager#add('pappasam/coc-jedi', {'do': 'yarn install --frozen-lockfile'})
I can't get a nvim nightly release from https://github.com/neovim/neovim/releases, so I built from source neovim/neovim@e8fb072.
:version NVIM v0.6.0-dev+e8fb0728e Build type: Release LuaJIT 2.1.0-beta3
Tested with the master and release branch, can't reproduce this, the
rename/doHover
works as expected.
Yep, there's an issue in neovim (https://github.com/neovim/neovim/issues/15709) where sometimes the CI will fail to publish the latest nightly. I'll try again with master
@fannheyward confirming the issue is still there when building directly from master however, CocInstall
ed plugins are not affected. I've
coc-tsserver
located at $HOME/.config/nvim/pack/packager/start/coc-tsserver
:CocInstall
CocInfo
after this change:## versions
vim version: NVIM v0.6.0-dev
node version: v16.6.0
coc.nvim version: 0.0.80-03c9add7cd
coc.nvim directory: /home/rmadriz/.config/nvim/pack/packager/start/coc.nvim
term: alacritty
platform: linux
## Log of coc.nvim
2021-09-22T07:40:04.834 INFO (pid:1470243) [plugin] - coc.nvim 0.0.80-03c9add7cd initialized with node: v16.6.0 after 132ms
2021-09-22T07:40:04.872 INFO (pid:1470243) [services] - registered service "tsserver"
2021-09-22T07:40:06.375 INFO (pid:1470243) [attach] - receive notification: highlight []
2021-09-22T07:40:08.006 INFO (pid:1470243) [attach] - receive notification: showInfo []
Notice how this time the service was correctly discovered so this is definitely an issue with 'manually' installed plugins
added the plugins directly with my package manager like this:
call packager#add('pappasam/coc-jedi', {'do': 'yarn install --frozen-lockfile'})
@richin13 what's the package manager? https://github.com/therealblurch/vim-packager ?
Please make sure the yarn
build is successful, after the successful building, for example coc-tsserver, there will be lib/index.js
in the coc-tsserver root.
@fannheyward I can reproduce. When I change from 0.5.1
to nightly
, coc extensions managed as vim packages no longer work. The exact same installed packages work fine when the Vim version I use is 0.5.1
or 0.5.0
.
Note: we're using vim's native package tooling. Maybe you're reproducing with an old-style plugin manager like vim-plug?
@pappasam I'm using vim-plug, here's my tests:
Plug 'pappasam/coc-jedi', {'do': 'yarn install --frozen-lockfile'}
PlugInstall
, the yarn building is workingTested on nvim v0.6.0-dev+bec7f47ce
.
Related issues? https://github.com/neovim/neovim/issues/15837
@fannheyward, @pappasam meant that given you're using vim-plug
to try reproduce the issue, you won't be able to because they're using native package management (like packer.nvim does, but not vim-plug).
@oblitum thank you for your point, I misunderstood @pappasam 's comment. I'll test with packer.nvim today. (I'm not a packer.nvim user, any help for this will be great.
Maybe this related https://github.com/neovim/neovim/pull/15632
coc.nvim will load extensions from &runtimepath
.
init.vim:
if &compatible
set nocompatible
endif
function! s:packager_init(packager) abort
call a:packager.add('neoclide/coc.nvim', { 'branch': 'release' })
call a:packager.add('fannheyward/coc-pyright', { 'do': 'yarn install --frozen-lockfile' })
endfunction
packadd vim-packager
call packager#setup(function('s:packager_init'))
nvim 0.5.1 + https://github.com/therealblurch/vim-packager:
[
'/Users/fannheyward/.config/nvim',
'/Users/fannheyward/.config/nvim/pack/packager/start/coc.nvim',
'/Users/fannheyward/.config/nvim/pack/packager/start/coc-pyright',
'/Users/fannheyward/.config/nvim/pack/packager/opt/vim-packager',
...
]
nvim 0.6.0 + https://github.com/therealblurch/vim-packager:
[
'/Users/fannheyward/.config/nvim',
'/Users/fannheyward/.config/nvim/pack/packager/opt/vim-packager',
...
]
Tested with https://github.com/wbthomason/packer.nvim
-- This file can be loaded by calling `lua require('plugins')` from your init.vim
return require('packer').startup(function()
use {
'neoclide/coc.nvim', branch = 'release'
}
use {
'fannheyward/coc-pyright', run = 'yarn install --frozen-lockfile'
}
-- Packer can manage itself
use 'wbthomason/packer.nvim'
end)
nvim 0.5.1:
[
'/Users/fannheyward/.config/nvim',
'/etc/xdg/nvim',
'/Users/fannheyward/.local/share/nvim/site',
'/Users/fannheyward/.local/share/nvim/site/pack/packer/start/packer.nvim',
'/Users/fannheyward/.local/share/nvim/site/pack/packer/start/coc.nvim',
'/Users/fannheyward/.local/share/nvim/site/pack/packer/start/coc-pyright',
...
]
nvim 0.6.0:
[
'/Users/fannheyward/.config/nvim',
'/etc/xdg/nvim',
'/Users/fannheyward/.local/share/nvim/site',
'/Users/fannheyward/.local/share/nvim/site/pack/packer/start/packer.nvim',
]
Add vim.cmd [[packadd coc-pyright]]
in plugins.lua
fixed this, now nvim 0.6.0:
[
'/Users/fannheyward/.config/nvim',
'/etc/xdg/nvim',
'/Users/fannheyward/.local/share/nvim/site',
'/Users/fannheyward/.local/share/nvim/site/pack/packer/start/coc-pyright',
'/Users/fannheyward/.local/share/nvim/site/pack/packer/start/packer.nvim',
...
]
Thanks everyone for the help, explicitly packadd
ing the extensions solved it. I'm closing this since is not really related to CoC and more an issue with neovim itself.
@richin13 @fannheyward I'm not sure this should be closed. Although the packadd
hack does resolve the issue for users who think to use it, I think the way coc handles the runtime path should be fixed. See https://github.com/Shougo/defx.nvim/commit/701b2a9b04055d056cd2e3e1f6f6fa555b0c4cb6 for an example resolution of the underlying issue for defx.
I believe the relevant function that needs to be updated in coc.nvim
is here: https://github.com/neoclide/coc.nvim/blob/master/src/extensions.ts#L680
I agree, manually having to add packadd
isn't the usual workflow of packer.nvim managed plugins.
I can reproduce this issue on NixOS, with neovim-nightly-overlay
; having the coc extensions installed from nix (home-manager), on current neovim stable (neovim-unwrapped
package on nixos unstable/current), the extensions are loaded and listed, while just activating the overlay to use neovim-nightly
makes them not be loaded/seen by CoC, although CoC and the other nvim plugins do get properly loaded.
I have the same issue with nvim 0.6.0+dev+544+g7ae86c1d4-1 - after upgrading nvim and upgrading coc - there is no any extension loaded and coc is not working
Add
vim.cmd [[packadd coc-pyright]]
inplugins.lua
fixed this, now nvim 0.6.0:[ '/Users/fannheyward/.config/nvim', '/etc/xdg/nvim', '/Users/fannheyward/.local/share/nvim/site', '/Users/fannheyward/.local/share/nvim/site/pack/packer/start/coc-pyright', '/Users/fannheyward/.local/share/nvim/site/pack/packer/start/packer.nvim', ... ]
Could you provide what exactly should be placed in plugins.lua
file to get coc-plugins work
@savl-2021 add vim.cmd [[packadd coc-pyright]]
to your plug-in.lua.
There's a PR to fix this in a better way.
@fannheyward this is now a usability issue with neovim's latest stable release: https://github.com/neovim/neovim/releases/tag/v0.6.0
NixOS unstable just merged neovim's 0.6.0 release, effectively breaking coc plugins loading. Does anyone know a workaround? It seems vimPlugins.coc-nvim
is built from the release
branch, and therefore quite hard to overlay
with the patch from the linked PR.
@andrevmatos workaround is provided by @fannheyward in thread already. Either that or using coc's own dep system, which still works fine.
Should be fixed in https://github.com/neoclide/coc.nvim/pull/3511
Result from CocInfo
While on neovim version 0.5.0
Latest nightly build (NVIM v0.6.0-dev+304-g924e8e4f2)
Describe the bug
When using a nightly build of neovim CoC won't register any services at all and whenever you try to use your language server's feature it throws an error message:
I first noticed this issue Yesterday, Sunday 19th 2021. It works fine with the latest stable release (0.5.0)
Reproduce the bug
For this you will need to have a way to use two different versions of neovim so that you can compare the results. I'm using
asdf
version manager to switch between versions. The following config file reproduces the issue as long as you use the right version.Create file
mini.vim
with:First, start neovim v0.5.0 with command:
nvim -u mini.vim
, Coc works as expectedThen, switch to latest nightly build and run the same command, Coc stops working
Screenshots (optional)
The above logs it's all I got 😅