emacs-ycmd
emacs-ycmd copied to clipboard
Feature: Automated installation
It would be really cool if emacs-ycmd had a command like ycmd-install-server, like anaconda-mode and some other completion libraries provide.
Then, instead of specifying ycmd-server-command to the location of ycmd, we could customize ycmd-server-dir and instead specify where ycmd should be.
We looked at this briefly in #27, and the conclusion then (based to a degree on this question) was that it was more complicated than it was worth. Maybe the situation has changed now.
Building ycmd is non-trivial, or at least involves tools (e.g. cmake) that not everyone has. So while we could make an attempt at building ycmd by assuming that they've got git, cmake, python headers, and so forth, anything beyond that gets pretty hairy.
Maybe I'm just being lazy, though! If you see a robust and simple way to make this work for most users across platforms, I'm more than happy to hear you out. Ultimately I think it's conceptually ideal, but I'm just worried about the details of getting it right.
@abingham so once I actually tried installing ycmd, I realized why this is much more nuanced than, say, jedi.
I'm reading from this that there are two important problems:
- Determining how to install
ycmdsuch that the installation won't fail. - Detecting and gracefully handling a failed installation, should we fail 1.
Regarding 1., I think it may make the most sense to simply ask the user when we are unsure of what to do. We could preemptively select choices based on educated guesses, but if we rely on user input during the installation, we may have a better shot at a successful install. For example, to determine whether to pass the flag --clang-completer to build.py we could first check the executable path for clang. Having found it, we could then prompt the user with a truthy default response.
We could present these choices in a variety of different ways. The first thing that came to my mind was something like mag-menu, although it appears unmaintained, and I have not tried it out.
Regarding 2., I have less of an idea how to proceed, since I'm not really sure how ycmd behaves when it fails, or what we could do to amend the situation. (Worst case, we can always just delete the entire directory, and notify the user that they can try with different options, or install manually.)