This is indeed because love is a global variable that is set by the environment. I haven't "fixed" this problem in any way, but I wrote my own walker to report the errors the way I'd like to see them. Essentially, it works like this: metalua is used to build Abstract Syntax Tree (AST) for a file, lua-inspect then traverses that AST to identify and mark nodes that can correspond to various conditions it checks, ZeroBrane Studio then traverses that modified AST (the code is in src/editor/inspect.lua) to report the errors.Desty wrote:Could you elaborate on how you got lua-inspect to work? I installed it in Vim and it reports a series of errors like this:
Some of the modifications I made were around reporting only first changes to global variables to minimize the number of errors:
- first use of unknown global function '...'
- first use of unknown global variable '...'
- first assignment to global variable '...'
lua-inspect also includes --! syntax to provide hints to the module, but I can't find documentation for all the commands it supports. I also have a ticket in ZBS to provide similar syntax to turn reporting off for some variables or some error types.