neoclide / coc.nvim

Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers.
Other
24.48k stars 958 forks source link

coc-ccls not working #2088

Closed ghost closed 4 years ago

ghost commented 4 years ago

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 /nodemodules/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/nodemodules/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 coc-ccls@0.0.5: The engine "coc" appears to be invalid.
> [2/5] Resolving packages...
> warning coc.nvim > log4js > circular-json@0.5.9: 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 coc-ccls@0.0.5: 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 coc-ccls@0.0.5: 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

chemzqm commented 4 years ago

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

lcksk commented 4 years ago

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

Does this work for you ?

ghost commented 4 years ago

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 ...

elland commented 4 years ago

@rolandjon thanks, that did it for me!

linweilin commented 4 years ago

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!

waych commented 3 years ago

I just hit this missing symlink on windows. Fixed locally much the same way. In powershell as admin:

cd .config\coc\extensions\node_modules\coc-ccls
New-Item lib -ItemType SymbolicLink -Value .\node_modules\ws\lib\
CalebDosSantos commented 3 years ago

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

Does this work for you ?

That worked for me! Thanks!

gerazov commented 3 years ago

This should be in the README :slightly_smiling_face:

tony commented 2 years ago

cd ~/.config/coc/extensions/node_modules/coc-ccls npm i npm run build

For some reason listing coc-ccls in my config by itself isn't enough to do the trick.

oblitum commented 2 years ago

@tony it's what the thread has been saying all along it seems (extension is broken).

Life is easier with coc-clangd.

oblitum commented 2 years ago

If extension is dead, and wish to keep with ccls, I just configure the server and not use the extension, unless there's a newer one.

tony commented 2 years ago

How goes it @oblitum!

I will take a look at coc-clangd.

oblitum commented 2 years ago

@tony hey 👍

tony commented 2 years ago

@oblitum Moved over, things are much faster now. Surprised by how good clangd is

oblitum commented 2 years ago

@tony yup, the main argument for ccls when it was out was due to clangd's lack of cache, it now has cache and all that.

Realtyxxx commented 2 years ago

hey! but how to configure with coc-clangd ,my clangd always gives me warning when it comes to c++11 standard

AlexvZyl commented 2 years ago

Thanks for the clangd suggestion.