abingham / emacs-ycmd

Emacs client for ycmd, the code completion system.
MIT License
384 stars 46 forks source link

Check if subcommand is available for completer #375

Closed ptrv closed 7 years ago

ptrv commented 7 years ago

Add function to retrieve supported subcommands and check when running /run_completer_command request. Thes subcommands are cached so it's a cheap operation to check against them.

IMHO it's more clear and comprehensive to check subcommand availability beforehand the run_completer_command instead of parsing the error message of a failed request. Also in the latter case we would need to forward the request to the exception to get the original subcommand of the request, which is IMHO also not very nice.

ptrv commented 7 years ago

Actually, checking the error when a subcommand is not supported is a nicer solution. :blush:

I'll open a new PR for it and close this.