Giter Site home page Giter Site logo

Comments (8)

sam-mccall avatar sam-mccall commented on June 12, 2024 1

You've put "~/.local/bin" on your path instead of "/Users/<MY_USERNAME>/.local/bin".
This is nonstandard - PATH should contain real paths. Bash supports it as an extension (on my system, when invoked as bash but not when invoked as sh) but not all tools do. In particular the npm-which library used by coc to find the binary doesn't support this.

You can fix this by unquoting the ~ so the shell will expand it:

 [[ ":$PATH:" != *:~/.local/bin/:* ]] && PATH=~/.local/bin/:"${PATH}"

from coc-clangd.

fannheyward avatar fannheyward commented on June 12, 2024

What's the output which clangd?

from coc-clangd.

karb94 avatar karb94 commented on June 12, 2024

So which clangd doesn't output anything which I find strange. Could this be related? I am definitely accessing clangd through the symlink at ~/.local/bin/clangd because when I change its name I get a No such file or directory.

from coc-clangd.

fannheyward avatar fannheyward commented on June 12, 2024

which clangd will find clangd from your $PATH, no output means we can't find it from $PATH. How do you add ~/.local/bin/ to your $PATH?

from coc-clangd.

karb94 avatar karb94 commented on June 12, 2024

echo $PATH contains ~/.local/bin/. I added it with [[ ":$PATH:" != *":~/.local/bin/:"* ]] && PATH="~/.local/bin/:${PATH}" in my .bashrc.

When I run ~/.local/bin/clangd it works as normal. Does which work with symlinks? I am very confused... Thank you for your help

from coc-clangd.

fannheyward avatar fannheyward commented on June 12, 2024

What's the output do you run clangd directly? Without ~/.local/bin/.

from coc-clangd.

karb94 avatar karb94 commented on June 12, 2024

Maybe this series of commands will be of help. This was done in a fresh new terminal.

$ hash
hash: hash table empty
$ type clangd
clangd is /Users/<MY_USERNAME>/.local/bin/clangd
$ which clangd
$ clangd
clangd is a language server that provides IDE-like features to editors.

It should be used via an editor plugin rather than invoked directly. For more information, see:
	https://clang.llvm.org/extra/clangd/
	https://microsoft.github.io/language-server-protocol/

clangd accepts flags on the commandline, and in the CLANGD_FLAGS environment variable.

I[12:13:51.794] clangd version 10.0.0 
I[12:13:51.794] PID: 37985
I[12:13:51.795] Working directory: /Users/<MY_USERNAME>
I[12:13:51.795] argv[0]: clangd
I[12:13:51.795] Starting LSP over stdin/stdout
**I pressed Ctrl-C to kill it**
^CE[12:13:54.356] Transport error: Got signal, shutting down
I[12:13:54.356] LSP finished, exiting with status 1
$ type clangd
clangd is hashed (/Users/<MY_USERNAME>/.local/bin/clangd)
$ hash
hits	command
   1	/usr/bin/which
   1	/Users/<MY_USERNAME>/.local/bin/clangd
$ readlink -f /Users/<MY_USERNAME>/.local/bin/clangd
/usr/local/Cellar/llvm/10.0.0_3/bin/clangd

I understand this may not be coc-clangd's problem and I appreciate the help.

from coc-clangd.

renyddd avatar renyddd commented on June 12, 2024

ln -s /usr/local/bin/clangd /$HOME/.config/coc/extensions/coc-clangd-data/install/10.0.0/clangd_10.0.0/bin/clangd

from coc-clangd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.