LuaLS / LuaLS/lua-language-server

怎么使用luals的文档导出功能

Open
#2,927 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
4.4k
Forks
442
PR merge metrics
No merged PRs in 30d

Description

### How are you using the lua-language-server?

Command Line

### Which OS are you using?

Windows

### What is the issue affecting?

Other

### Expected Behaviour

我想要通过这个命令:
``` lua
./lua-language-server.exe --doc="D:/lua/teast1/test.lua" --doc_out_path="D:/lua/teast1"
```
导出一个lua 文件的代码文档,但是,导出的确实是关于标准库 的代码文档

### Actual Behaviour

导出了标准库的代码文档,例如:
![图片](https://github.com/user-attachments/assets/b675f712-dba2-4bc0-8adf-0ec2432154c1)

### Reproduction steps

1. 新建文件夹和一个示例代码文件:
``` lua
---@meta

---相加
---@param a integer
---@param b integer
---@return integer
function add(a, b) end
```
2. 调用命令:
```
./lua-language-server.exe --doc="D:/lua/teast1/test.lua" --doc_out_path="D:/lua/teast1"
```
3. 输出:

```
root uri = file:///d%3A/lua/teast1/test.lua
Documentation exported:4/204

D:\lua\teast1\doc.json
D:\lua\teast1\doc.md
```

### Additional Notes

导出的两个文件
[doc.md](https://github.com/user-attachments/files/17606039/doc.md)
[doc.json](https://github.com/user-attachments/files/17606040/doc.json)

### Log File

文件日志:
[file_d%3A_lua_teast1_test.lua.log](https://github.com/user-attachments/files/17606043/file_d.3A_lua_teast1_test.lua.log)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the reported lua-language-server.exe command against the supplied test.lua example on Windows, then compare doc.md and doc.json with the attached log. Done means the exported documentation contains the add function from test.lua rather than only standard-library entries.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
cli, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.