LuaLS / LuaLS/lua-language-server

Operators are not included in the output when generating documentation via the --doc CLI argument

未关闭
#3,194 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Lua
星标
4.4k
派生
442
PR 合并指标
30 天内没有已合并 PR

描述

How are you using the lua-language-server?

Command Line

Which OS are you using?

Linux

What is the issue affecting?

Annotations, Other

Expected Behaviour

When generating markdown and JSON documentation via the command line argument --doc, the output files should contain operators defined by the @operator syntax.

Actual Behaviour

The expected behavior is that the operators are missing in both the markdown and JSON generated files.

Reproduction steps

Given the following Lua file:

---@meta

---@class Vector2f
---@operator unm:Vector2f
---@operator add(Vector2f | number):Vector2f
---@operator sub(Vector2f | number):Vector2f
Vector2f = {}

When the language server is run with the following args:

./LuaS/bin/lua-language-server --doc=./example.lua --doc_out_path=.

Then the output doc.md and doc.json do not contain any of the operators specified.

In the doc.json the type Vector2d is the following, notice the lack of any operators:

{
    "defines": [
        {
            "async": false,
            "deprecated": false,
            "file": ".",
            "finish": [
                2,
                18
            ],
            "start": [
                2,
                10
            ],
            "type": "doc.class",
            "view": "Vector2f",
            "visible": "public"
        }
    ],
    "fields": [],
    "name": "Vector2f",
    "type": "type",
    "view": "Vector2f"
}
Additional Notes

No response

Log File

No response

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

--doc CLI 入口开始,跟踪 example.lua 输入如何转换为 doc.mddoc.json。使用提供的 Vector2f 示例重现该问题,然后验证生成的两个文件都包含 @operator 定义。

由索引模型根据 Issue 内容生成。

评估

技术栈
lua
领域
cli, documentation
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。