LLVM Discussion Forums

Clangd, Docker, and Emacs

I’m wondering if it’s possible to run Clangd in a Docker container, and have it communicate with Emacs running outside the container. It seems like this might be possible (because VS Code is capable of a similar feature), but I’ve not been able to find any information about it. I would greatly appreciate an official or unoffical guide to make this work.

Interestingly, the 10.0.0 release notes mention: “clangd can be more easily used remotely or in a docker container.” But I can’t find any additional info on it.

Why am I doing this? Good question. It’s for work, where our toolchain and dependencies are distributed as a Docker container. Compiling always happens in the container, but employees are expected to run their editor outside of the container. Most people use VS Code, which apparently has an excellent Docker plugin. I’m kind of an Emacs person myself, so I’m trying to do something similar with Tramp and/or Docker bind mounts.

you might find http://lists.llvm.org/pipermail/clangd-dev/2019-January/000231.html useful.

please ask any questions you still have after reading the thread. we should probably make a doc out of it representing the current state. it would be great if you decide to write such a doc/guide/walkthrough while experimenting :slight_smile: Then we can include it in clangd.llvm.org under some section.