coc-extensions / coc-svelte

svelte support for (Neo)Vim
MIT License
178 stars 24 forks source link

Error when triggering completion #61

Open marekdedic opened 1 year ago

marekdedic commented 1 year ago

Result from CocInfo

## versions

vim version: NVIM v0.7.2
node version: v18.12.1
coc.nvim version: 0.0.82-75f2b7eb 2022-12-06 00:50:36 +0800
coc.nvim directory: /home/marekdedic/.local/share/nvim/plugged/coc.nvim
term: tmux
platform: linux

## Log of coc.nvim

2022-12-09T23:50:39.090 INFO (pid:230614) [plugin] - coc.nvim initialized with node: v18.12.1 after 216
2022-12-09T23:50:39.103 INFO (pid:230614) [language-client-index] - Language server "svelte" started with 230629
2022-12-09T23:50:39.343 INFO (pid:230614) [attach] - receive notification: highlight []
2022-12-09T23:50:40.405 INFO (pid:230614) [attach] - receive notification: highlight []
2022-12-09T23:50:44.019 INFO (pid:230614) [attach] - receive notification: showInfo []

Describe the bug

I get an error when CoC completion is triggered

[coc.nvim]: UnhandledRejection: Cannot read properties of null (reading 'word')
TypeError: Cannot read properties of null (reading 'word')
    at Ov.convertVimCompleteItem (/home/marekdedic/.local/share/nvim/plugged/coc.nvim/build/index.js:214:9521)
    at Ov.convertToDurationItem (/home/marekdedic/.local/share/nvim/plugged/coc.nvim/build/index.js:214:9418)
    at /home/marekdedic/.local/share/nvim/plugged/coc.nvim/build/index.js:257:38120
    at Array.map (<anonymous>)
    at /home/marekdedic/.local/share/nvim/plugged/coc.nvim/build/index.js:257:38104

(Happens with coc-svelte, but the backtrace points tot coc itself...)

Reproduce the bug

We will close your issue when you don't provide minimal vimrc and we can't reproduce it

local Plug = vim.fn['plug#']

vim.call('plug#begin', vim.fn.stdpath('data') .. '/plugged')

Plug('neoclide/coc.nvim', {branch = 'release'})
Plug('coc-extensions/coc-svelte', {['do'] = 'yarn install --frozen-lockfile'})

vim.call('plug#end')

Previously reported to CoC as neoclide/coc.nvim#4426