Can VSCode linter warn undefined functions?

If my mouse hovers above a function call, VSCode usually tells me information about the function, i.e. the arguments that should be supplied. If the function doesn’t exist, VSCode will tell me nothing, so VSCode is aware that it’s not able to identify a function definition. Can the linter highlight such functions as potential wrong code (e.g. with red wiggly lines)? Such a feature would be very helpful in refactoring code. I know such errors wouldn’t be 100% accurate since static analysis in Julia is difficult (due to metaprogramming etc.), but the information can still be valuable to the user.

It does:

function foo()
    bar()       # <- Missing reference: bar
end

I’ve found out how to enable the feature: in Julia extension setting in VSCode, set Lint:Missingrefs to all. The default was none on my computer.

P.S. thanks for letting me know that it works on your computer, otherwise I wouldn’t have tried to fix it by tweaking the settings.

2 Likes

We disabled the setting by default because it has the potential to show a lot of incorrect messages. So now it is opt-in, i.e. you can decide yourself whether the upsides are worth the downsides :slight_smile: