Maxattax97 / coc-ccls

CCLS (C/C++) extension for coc.nvim
https://github.com/neoclide/coc.nvim
25 stars 3 forks source link

Unable to load global extension #5

Open Notaduck opened 4 years ago

Notaduck commented 4 years ago

Observed behavio

Every time I open neovim do I get greeted by the following message:

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

Steps to reproduce

I installed coc-ccls with CocInstall <package name>, edited my config

{
    "coc.preferences.formatOnSaveFiletypes": ["js", "jsx"],
    "eslint.run": "onType",
    "eslint.autoFix": true,
    "languageserver": {
            "ccls": {
                "command": "ccls",
                "filetypes": ["c", "cpp", "objc", "objcpp"],
                "rootPatterns": [".ccls", "compile_commands.json", ".vim/", ".git/", ".hg/"],
                "initializationOptions": {
                     "cache": {
                         "directory": "/tmp/ccls"
                     }
                 }
            }
        },
    "java.home": "/usr/lib/jvm/java-11-openjdk/",
    "java.format.settings.url": "/home/daniel/.config/coc/extensions/node_modules/redhat.java/eclipse-formatter.xml"

}

I've tried to update, rebuild, reinstall the plugin without any luck.

ferran9908 commented 3 years ago

If you want to remove that warning altogether, you could delete the coc/ folder in ~/.config and you can reinstall the plugins.

You could actually go in and delete the specific files or text to make it go away but I have a script in place to download a set of default extensions from Coc on Startup.

CapSel commented 3 years ago

uninstalling coc-ccls and removing coc-ccls directory does not help

tarsiec commented 3 years ago

I am having the same issue, and reinstalling the extension does not seem to work for me either. I do not know what the file lib/extension.js could be, as it is not present in the extension.

Tkdefender88 commented 3 years ago

I'm also running into this problem.

DannMartinnez commented 3 years ago

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

Does this work for you ?

Notaduck commented 3 years ago

I am currently not with my Linux laptop so I am sorry that I can't test it now.

davepinto commented 3 years ago

It fixed the issue for me at least.

DarrienG commented 3 years ago

For me - the problem here was that the extensions.json file referenced extensions I had long uninstalled. Removing the references to the extensions I no longer had installed in extensions.json fixed it for me.

yegetables commented 3 years ago

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

Does this work for you ?

i think your way is the best way

zzLinus commented 3 years ago

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

Does this work for you ?

it does work for me with this issues

b3ll9trix commented 2 years ago

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

Does this work for you ?

This worked for me as well. Thanks!

shmup commented 2 years ago

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

Does this work for you ?

Yes, but can we talk about this? Can we not have to do this, yanno, new $machine and not remembering?

What's the actual reason for needing to do this?


Ah, from: https://github.com/neoclide/coc.nvim/issues/2088#issuecomment-974727778

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

After building you'll have this lib. Cool.

Though, would be rad if :CocInstall coc-ccls performed these same steps.