@source - 源代码引用
September 5, 2025 · View on GitHub
指定符号的源代码位置。
语法
---@source <路径>
示例
-- 文件路径引用
---@source file:///src/utils/string.lua
function stringUtils() end
-- 相对路径引用
---@source ./helpers/math.lua
function mathHelpers() end
-- URL引用
---@source https://github.com/user/repo/blob/main/src/module.lua
function externalFunction() end
-- 带行号的引用
---@source file:///src/core.lua:42
function specificFunction() end
特性
- 源码定位
- 文件引用
- URL支持
- 行号定位
- 工具集成