Skip to content

在该工具能阅读的EmmyLua中如何给alias的多行类型加注释? #442

@ImpleLee

Description

@ImpleLee

需求是这样的:在下文中(来自love2d的api)我定义了一个类型CompareMode,然后我希望给这个类型和它的各个选项加上注释来帮助用户调用。

---#Different types of per-pixel stencil test and depth test comparisons. The pixels of an object will be drawn if the comparison succeeds, for each pixel that the object touches.
---@alias CompareMode
---| "'equal'" #* stencil tests: the stencil value of the pixel must be equal to the supplied value. 
---* depth tests: the depth value of the drawn object at that pixel must be equal to the existing depth value of that pixel.
---| "'notequal'" #* stencil tests: the stencil value of the pixel must not be equal to the supplied value.
---* depth tests: the depth value of the drawn object at that pixel must not be equal to the existing depth value of that pixel.
---| "'less'" #* stencil tests: the stencil value of the pixel must be less than the supplied value.
---* depth tests: the depth value of the drawn object at that pixel must be less than the existing depth value of that pixel.
---| "'lequal'" #* stencil tests: the stencil value of the pixel must be less than or equal to the supplied value.
---* depth tests: the depth value of the drawn object at that pixel must be less than or equal to the existing depth value of that pixel.
---| "'gequal'" #* stencil tests: the stencil value of the pixel must be greater than or equal to the supplied value.
---* depth tests: the depth value of the drawn object at that pixel must be greater than or equal to the existing depth value of that pixel.
---| "'greater'" #* stencil tests: the stencil value of the pixel must be greater than the supplied value.
---* depth tests: the depth value of the drawn object at that pixel must be greater than the existing depth value of that pixel.
---| "'never'" #Objects will never be drawn.
---| "'always'" #Objects will always be drawn. Effectively disables the depth or stencil test.

现在我已经知道可以通过

---| "'equal'" #* stencil tests: the stencil value of the pixel must be equal to the supplied value. 

的形式给'equal'加上单行注释,但没有找到给它加多行注释的方法。

另外,这个片段中我在最上面给CompareMode通过---#加了注释,但似乎也没有在提示中看到。

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfeat/LuaCats AnnotationsRelated to Lua Language Server Annotations (LuaCats)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions