LuaLS / LuaLS/lua-language-server

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

Open
#3,194 1 comment 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?

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:

```lua
---@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:

```json
{
"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_

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 at the `--doc` CLI entry point and trace how the example.lua input is converted into `doc.md` and `doc.json`. Reproduce the issue with the supplied Vector2f example, then verify that both generated files include the `@operator` definitions.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.