IntelliJ-Luanalysis icon indicating copy to clipboard operation
IntelliJ-Luanalysis copied to clipboard

Globals become undeclared when the file contains ---@module

Open galsjel opened this issue 3 years ago • 1 comments

Environment

name version
IDEA version GoLand 2021.1.3
Luanalysis version v1.2.3
OS Windows 10

What are the steps to reproduce this issue?

  1. Create a Lua file containing the ---@module tag and a require()
local enum = require("enum")

---@module WeaponModule
local weapons                        = {}

What happens?

image

What were you expecting to happen?

The same behavior as using ---@class, which is to show as an existing function.

galsjel avatar Jul 14 '21 15:07 galsjel

I'm having the same issue.

I wanted to restrict the global scope of each file so I added ---@module at the top of all of my files. However I still want them to have globals declared in other files that doesn't have ---@module

LelouBil avatar Jan 14 '22 11:01 LelouBil