You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a suggestion for a feature that can be implemented. Whenever you are in a path that ends with autoload/foo/bar.vim and you are trying to call a function foo#bar#Baz that doesn't exist in the script, we could probably safely assume that the function doesn't exist in the if not defined in the file, and output a warning for calling it, just like the language server can for s: functions.
A potential gotcha for an implementation of this is that autoload files aren't the only place where it's actually possible to define them. ALE defines them in ale_linters files all over the place and in Vader tests. (The test code redefines functions to mock them.) I think a good implementation could output an error specifically in the context of an autoload/ file path, and say nothing about the functions in other files.
This suggestion is just for the functions defined and called inside of the same script, not for searching over all of &runtimepath to find if a function is defined anywhere, which may be impossible to know given the information above. We can at least make life easier in the one case where we can say for (almost) certain the the function being called isn't defined. I suggest the problem type is a warning as the function call could actually execute.
The text was updated successfully, but these errors were encountered:
This is a suggestion for a feature that can be implemented. Whenever you are in a path that ends with
autoload/foo/bar.vim
and you are trying to call a functionfoo#bar#Baz
that doesn't exist in the script, we could probably safely assume that the function doesn't exist in the if not defined in the file, and output a warning for calling it, just like the language server can fors:
functions.A potential gotcha for an implementation of this is that
autoload
files aren't the only place where it's actually possible to define them. ALE defines them in ale_linters files all over the place and in Vader tests. (The test code redefines functions to mock them.) I think a good implementation could output an error specifically in the context of anautoload/
file path, and say nothing about the functions in other files.This suggestion is just for the functions defined and called inside of the same script, not for searching over all of
&runtimepath
to find if a function is defined anywhere, which may be impossible to know given the information above. We can at least make life easier in the one case where we can say for (almost) certain the the function being called isn't defined. I suggest the problem type is a warning as the function call could actually execute.The text was updated successfully, but these errors were encountered: