Skip to content

Commit 5aaecf5

Browse files
committed
support ---@meta [name]
once declared `name`, user can only require this file by declared name meta file can not be required with name `_`
1 parent a6798e6 commit 5aaecf5

27 files changed

+194
-26
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* `CHG` definition: supports finding definitions for `@class` and `@alias`, since they may be defined multi times
1010
* `CHG` rename: supports `@field`
1111
* `CHG` improve patch for `.luarc.json`
12+
* `CHG` `---@meta [name]`: once declared `name`, user can only require this file by declared name. meta file can not be required with name `_`
1213
* `CHG` remove telemetry
1314
* `FIX` [#831]
1415
* `FIX` [#1729]

meta/template/basic.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---@meta
1+
---@meta _
22

33
---#DES 'arg'
44
---@type string[]

meta/template/bit.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---#if not JIT then DISABLE() end
2-
---@meta
2+
---@meta bit
33

44
---@version JIT
55
---@class bitlib

meta/template/bit32.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---#if VERSION ~= 5.2 then DISABLE() end
2-
---@meta
2+
---@meta bit32
33

44
---@version 5.2
55
---#DES 'bit32'

meta/template/builtin.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---@meta
1+
---@meta _
22

33
---@class unknown
44
---@class any

meta/template/coroutine.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---@meta
1+
---@meta coroutine
22

33
---#DES 'coroutine'
44
---@class coroutinelib

meta/template/debug.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---@meta
1+
---@meta debug
22

33
---#DES 'debug'
44
---@class debuglib

meta/template/ffi.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---#if not JIT then DISABLE() end
2-
---@meta
2+
---@meta ffi
33

44
---@class ffi.namespace*: table
55
---@field [string] function

meta/template/io.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---@meta
1+
---@meta io
22

33
---#DES 'io'
44
---@class iolib

meta/template/jit.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---#if not JIT then DISABLE() end
2-
---@meta
2+
---@meta jit
33

44
---@version JIT
55
---@class jitlib

0 commit comments

Comments
 (0)