How to use lsp-mode in existing docker container?

Say that I have a running docker, which has some cpp files in it. I can use docker.el to open files in docker. I hope to use ccls for those cpp files:

(after! lsp-mode
  (lsp-register-client
   (make-lsp-client :new-connection (lsp-tramp-connection "/projects/github/ccls/Release/ccls")
                    :major-modes '(c++-mode)
                    :remote? t
                    :server-id 'ccls-docker))
  (lsp-register-client
   (make-lsp-client :new-connection (lsp-tramp-connection "/projects/github/ccls/Release/ccls")
                    :major-modes '(c-mode)
                    :remote? t
                    :server-id 'ccls-docker))
  )

And I also have ccls built in docker's path:

root@7be0e470c9ea:/projects/github/ccls/Release# ls /projects/github/ccls/Release/ccls

But lsp-log tells me Command "/projects/github/ccls/Release/ccls" is not present on the path.. Where goes wrong?

Posted Mar 21, 2020, 5:26 AM UTC

20

No comments yet

Nobody commented on this post, or the comments weren't captured.