neoclide / coc-solargraph

Solargraph extension for coc.nvim
202 stars 10 forks source link

Complete "solargraph" error: TypeError: Cannot read property 'hasOwnProperty' of null #65

Closed Durev closed 2 years ago

Durev commented 3 years ago

Hello,

I just started to use coc-solargraph in order to have Completion with ruby in neovim. The installation seems to work fine (whether using CocInstall or through the g:coc_global_extensions variable in my .vimrc).

However, when opening a ruby file and typing characters to trigger the autocompletion, solargraph does not seem to run. The output of :CocInfo shows a JS error popping in the coc-solargraph code:

undefined## versions

vim version: NVIM v0.5.0
node version: v16.5.0
coc.nvim version: 0.0.80-03c9add7cd
coc.nvim directory: /Users/xxx/.vim/plugged/coc.nvim
term: iTerm.app
platform: darwin

## Log of coc.nvim

2021-10-08T19:34:27.953 INFO (pid:45188) [plugin] - coc.nvim 0.0.80-03c9add7cd initialized with node: v16.5.0 after 42ms
 2021-10-08T19:34:31.946 INFO (pid:45188) [services] - registered service "solargraph"
 2021-10-08T19:34:32.693 INFO (pid:45188) [extension:coc-solargraph] - Solargraph is listening PORT=61979 PID=45223

 2021-10-08T19:34:41.666 INFO (pid:45188) [completion-complete] - Results from: around
 2021-10-08T19:34:44.906 INFO (pid:45188) [completion-complete] - Results from: around
 2021-10-08T19:35:00.896 INFO (pid:45188) [attach] - receive notification: showInfo []
 2021-10-08T19:35:04.931 ERROR (pid:45188) [source-language] - Complete "solargraph" error: TypeError: Cannot read property 'hasOwnProperty' of null
     at /Users/xxx/.config/coc/extensions/node_modules/coc-solargraph/lib/index.js:65653:25
     at async Wy.doComplete (/Users/xxx/.vim/plugged/coc.nvim/build/index.js:237:8939)
 2021-10-08T19:35:04.942 ERROR (pid:45188) [source-language] - Complete "solargraph" error: TypeError: Cannot read property 'hasOwnProperty' of null
     at /Users/xxx/.config/coc/extensions/node_modules/coc-solargraph/lib/index.js:65653:25
     at async Wy.doComplete (/Users/xxx/.vim/plugged/coc.nvim/build/index.js:237:8939)
 2021-10-08T19:35:05.954 ERROR (pid:45188) [source-language] - Complete "solargraph" error: TypeError: Cannot read property 'hasOwnProperty' of null
     at /Users/xxx/.config/coc/extensions/node_modules/coc-solargraph/lib/index.js:65653:25
     at async Wy.doComplete (/Users/xxx/.vim/plugged/coc.nvim/build/index.js:237:8939)
 2021-10-08T19:36:23.532 INFO (pid:45188) [attach] - receive notification: showInfo []

I'm using ruby 2.6.7 with solargraph 0.44.0, and coc.nvim from the release branch.

I'm not familiar with the stack used by coc-solargraph; any idea where this might come from? Does this come from coc-solargraph or another dependency?

Any idea on how to fix this to get coc-solargraph running in the meantime?

Thanks!