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.