mirror of
https://github.com/neovim/neovim.git
synced 2025-10-17 23:31:51 +00:00
provider: improve error message if provider is missing (#9487)
Move `has_eval_provider()` check to `eval_call_provider()` to make sure that every code path calls it first. Previously we would, when pynvim was missing, get a nice error message for `:python3 1`, but not for `:py3file blah`. Fixes https://github.com/neovim/neovim/issues/9485
This commit is contained in:
@@ -22706,6 +22706,16 @@ static void script_host_eval(char *name, typval_T *argvars, typval_T *rettv)
|
||||
|
||||
typval_T eval_call_provider(char *provider, char *method, list_T *arguments)
|
||||
{
|
||||
if (!eval_has_provider(provider)) {
|
||||
emsgf("E319: No \"%s\" provider found. Run \":checkhealth provider\"",
|
||||
provider);
|
||||
return (typval_T){
|
||||
.v_type = VAR_NUMBER,
|
||||
.v_lock = VAR_UNLOCKED,
|
||||
.vval.v_number = (varnumber_T)0
|
||||
};
|
||||
}
|
||||
|
||||
char func[256];
|
||||
int name_len = snprintf(func, sizeof(func), "provider#%s#Call", provider);
|
||||
|
||||
|
Reference in New Issue
Block a user