我推荐EmmyLua。
这是一个支持打字文档的 Intellij/VSCode 插件。我发现整体记录方法非常友好。也感谢它的 IDE 支持,EmmyLua 也支持提示。
这是 EmmyLua 文档的一个小片段:
--- @alias recipe_prototype any
--- @alias recipe_name string
--- @alias ingredient_name string
--- @class Coordinate
--- @field x number
--- @field y number
--- @class Entity
--- @field entity_number number unique identifier of entity
--- @field name string entity name
--- @field position Coordinate
--- @field direction any defines.direction.east/south/west/north
--- @class BlueprintSection
--- @field entities Entity[]
--- @field inlets number[] index of inlets in entities list
--- @field outlets number[] index of outlets in entities list
--- @type BlueprintSection
BlueprintSection = {}
--- @return BlueprintSection
function BlueprintSection.new()
--- ...
end
--- @param other BlueprintSection
--- @param xoff number optional, x-offset of the other section, default to width of self
--- @param yoff number optional, y-offset of the other section, default to 0
--- @return BlueprintSection new self
function BlueprintSection:concat(other, xoff, yoff)
-- ...
end
有关更多文档参考,请查看https://emmylua.github.io