Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coc-ccls not working #2088

Closed
ghost opened this issue Jun 19, 2020 · 17 comments
Closed

coc-ccls not working #2088

ghost opened this issue Jun 19, 2020 · 17 comments

Comments

@ghost
Copy link

ghost commented Jun 19, 2020

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 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
Copy link
Member

chemzqm commented Jun 19, 2020

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

@chemzqm chemzqm closed this as completed Jun 19, 2020
@lcksk
Copy link

lcksk commented Jun 24, 2020

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

Does this work for you ?

@ghost
Copy link
Author

ghost commented Jun 24, 2020

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
Copy link

elland commented Oct 6, 2020

@rolandjon thanks, that did it for me!

@linweilin
Copy link

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
Copy link

waych commented Dec 10, 2020

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
Copy link

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
Copy link

gerazov commented May 5, 2021

This should be in the README 🙂

@tony
Copy link
Contributor

tony commented Nov 20, 2021

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
Copy link
Member

oblitum commented Nov 20, 2021

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

Life is easier with coc-clangd.

@oblitum
Copy link
Member

oblitum commented Nov 20, 2021

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
Copy link
Contributor

tony commented Nov 20, 2021

How goes it @oblitum!

I will take a look at coc-clangd.

@oblitum
Copy link
Member

oblitum commented Nov 20, 2021

@tony hey 👍

@tony
Copy link
Contributor

tony commented Nov 21, 2021

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

@oblitum
Copy link
Member

oblitum commented Nov 21, 2021

@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
Copy link

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

@AlexvZyl
Copy link

Thanks for the clangd suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests