Coc.nvim: coc-ccls not working

Created on 19 Jun 2020  路  5Comments  路  Source: neoclide/coc.nvim

Hi,

I installed coc.nvim using vim plug with the branch/master setting. It works well for lots of languages but when I installed coc-ccls it shows an error every time I start nvim:

_[coc.nvim] Unable to load global extension at /home/psd/.config/coc/extensions
/node_modules/coc-ccls: main file ./lib/extension.js not found, you may need t
o build the project._

I did what it told me to do and went into _~/.config/coc/extensions/node_modules/coc-ccls_ and deleted the package lock and all its node modules, and then ran:

yarn install --frozen-lockfile

And it generated lots of errors LoL:

> yarn install --frozen-lockfile
> yarn install v1.22.4
> warning ../../package.json: No license field
> info No lockfile found.
> [1/5] Validating package.json...
> warning [email protected]: The engine "coc" appears to be invalid.
> [2/5] Resolving packages...
> warning coc.nvim > log4js > [email protected]: CircularJSON is in maintenance only, flatted is its successor.
> [3/5] Fetching packages...
> [4/5] Linking dependencies...
> [5/5] Building fresh packages...
> $ yarn clean && yarn build
> yarn run v1.22.4
> warning ../../package.json: No license field
> warning [email protected]: The engine "coc" appears to be invalid.
> $ rimraf lib
> Done in 1.69s.
> yarn run v1.22.4
> warning ../../package.json: No license field
> warning [email protected]: The engine "coc" appears to be invalid.
> $ tsc -p tsconfig.json
> node_modules/vscode-jsonrpc/lib/cancellation.d.ts:24:9 - error TS1086: An accessor cannot be declared in an ambient context.
> 
> 24     get token(): CancellationToken;
>            ~~~~~
> 
> 
> node_modules/vscode-jsonrpc/lib/events.d.ts:40:9 - error TS1086: An accessor cannot be declared in an ambient context.
> 
> 40     get event(): Event<T>;
>            ~~~~~
> 
> 
> node_modules/vscode-jsonrpc/lib/linkedMap.d.ts:15:9 - error TS1086: An accessor cannot be declared in an ambient context.
> 
> 15     get size(): number;
>            ~~~~
> 
> 
> node_modules/vscode-jsonrpc/lib/messageReader.d.ts:29:9 - error TS1086: An accessor cannot be declared in an ambient context.
> 
> 29     get onError(): Event<Error>;
>            ~~~~~~~
> 
> 
> node_modules/vscode-jsonrpc/lib/messageReader.d.ts:31:9 - error TS1086: An accessor cannot be declared in an ambient context.
> 
> 31     get onClose(): Event<void>;
>            ~~~~~~~
> 
> 
> node_modules/vscode-jsonrpc/lib/messageReader.d.ts:33:9 - error TS1086: An accessor cannot be declared in an ambient context.
> 
> 33     get onPartialMessage(): Event<PartialMessageInfo>;
>            ~~~~~~~~~~~~~~~~
> 
> 
> node_modules/vscode-jsonrpc/lib/messageReader.d.ts:46:9 - error TS1086: An accessor cannot be declared in an ambient context.
> 
> 46     set partialMessageTimeout(timeout: number);
>            ~~~~~~~~~~~~~~~~~~~~~
> 
> 
> node_modules/vscode-jsonrpc/lib/messageReader.d.ts:47:9 - error TS1086: An accessor cannot be declared in an ambient context.
> 
> 47     get partialMessageTimeout(): number;
>            ~~~~~~~~~~~~~~~~~~~~~
> 
> 
> node_modules/vscode-jsonrpc/lib/messageWriter.d.ts:20:9 - error TS1086: An accessor cannot be declared in an ambient context.
> 
> 20     get onError(): Event<[Error, Message | undefined, number | undefined]>;
>            ~~~~~~~
> 
> 
> node_modules/vscode-jsonrpc/lib/messageWriter.d.ts:22:9 - error TS1086: An accessor cannot be declared in an ambient context.
> 
> 22     get onClose(): Event<void>;
>            ~~~~~~~
> 
> 
> node_modules/vscode-jsonrpc/lib/messages.d.ts:108:9 - error TS1086: An accessor cannot be declared in an ambient context.
> 
> 108     get method(): string;
>             ~~~~~~
> 
> 
> node_modules/vscode-jsonrpc/lib/messages.d.ts:109:9 - error TS1086: An accessor cannot be declared in an ambient context.
> 
> 109     get numberOfParams(): number;
>             ~~~~~~~~~~~~~~
> 
> 
> 
> node_modules/vscode-languageserver-types/lib/umd/main.d.ts:733:9 - error TS1086: An accessor cannot be declared in an ambient context.
> 
> 733     get edit(): WorkspaceEdit;
>             ~~~~
> 
> 
> error Command failed with exit code 2.
> info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
> error Command failed with exit code 2.
> info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
> 

Result from CocInfo

versions

vim version: NVIM v0.4.3
node version: v13.2.0
coc.nvim version: 0.0.78-475932ddf5
coc.nvim directory: /home/psd/.local/share/nvim/plugged/coc.nvim
term: xterm-256color
platform: linux

I am running Void Linux, but this problem also appears on my Linux Mint laptop too. I think the coc-ccls extension is out of date and no longer compatible with some of the newer node modules you started using. I would fix the extension source code myself, but I'm a C hacker and don't know anything about javascript or typescript LoL

Thanks,
Phil

Most helpful comment

cd ~/.config/coc/extensions/node_modules/coc-ccls
ln -s node_modules/ws/lib lib

Does this work for you ?

All 5 comments

That extension on npm is broken now, you can use vim-plug to install it from github.

cd ~/.config/coc/extensions/node_modules/coc-ccls
ln -s node_modules/ws/lib lib

Does this work for you ?

It appeared the author abandoned it, so I did too. I need to do some C development on a Raspberry PI, but neovim is laggy on that device, and when you add in code completion it is just too slow to be useful, so I decided to use CLion on my PC because it has excellent remote deployment capabilities ...

@rolandjon thanks, that did it for me!

cd ~/.config/coc/extensions/node_modules/coc-ccls
ln -s node_modules/ws/lib lib

Does this work for you ?

thanks, that did it for me!

Was this page helpful?
0 / 5 - 0 ratings