Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Language Server in docker container

Tags:

docker

neovim

I'm not sure if the title suites my question that well but I couldn't come up with a better one.

As I'm running Arch Linux but develop software (in C++) which has to run on Debian and Ubuntu I'm currently on the following setup. I have neovim (because I really like it) with YouCompleteMe and this setup to run the ycm-server within the Docker (which runs Debian).

Now I would like to give coc.nvmim together with clangd or ccls a try as it seems to give a better user experience than YouCompleteMe. I'm now wondering if it is possible to run clangd or ccls on the server and let coc.nvmim connect to it without problems. Unfortunately I couldn't find anything with Google and therefore I'm asking the StackOverflow community.

like image 479
Andreas Ziegler Avatar asked Dec 09 '25 02:12

Andreas Ziegler


1 Answers

I would recommend looking into nvim-lspconfig for language servers mason for installing language servers and blink for autocompletion.

If you really want to use language servers via the running container, you probably install them in the image? You could then use a bind mount for the container to make them accessible locally and then prepend the location of the mount to the run time path like:

vim.opt.rtp:prepend(string.format("%s/lspconfig.lua", vim.fn.stdpath("data") .. "/lua"))

The later should work, but I have not tested that in any capacity.

Recommendation

Create a development container, bind mount the project into the container. Have your neovim config, and servers on the host.

Execute the code in the container.

like image 149
zettlrobert Avatar answered Dec 15 '25 22:12

zettlrobert