LuaLS / LuaLS/lua-language-server

Documentation export is missing information

Open
#2,322 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

After generating documentation with `--doc`, I expected to have access to the all of the information available in the annotations that is presented or used by the language server.

### Actual Behaviour

There were a few things that are missing or strange:

- `@see` annotations are absent.
- Access levels (`@protected`, `@private`, `@package`) are absent.
- Aliases that extend other aliases include the documentation of the alias that they extend, which makes it difficult to tell which documentation belongs to only the extended alias.
- The `start` and `finish` fields seem odd; they're very large numbers (e.g., 5490009, 5490021) that clearly don't refer to character ranges within the files. What are these numbers?

For the purpose of generating documentation, the first two problems seem significant—it would be difficult to filter out `private` fields and methods, for example.

### Reproduction steps

1. Create a Lua file that uses access modifiers, `@see`, and an alias that extends another alias. I've provided a minimal example of such a file below.
2. Observe the missing data and oddities.

### Additional Notes

Example for reproduction:

```lua
---@class C
---@field private z integer
local C = {}

---Base alias doc comment.
---@alias Base
---| 'A'
---| 'B'

---Extended alias doc comment.
---@alias Derived
---| Base
---| 'C'

---@protected
function C.x()
end

---@see C.x
function C.y()
end
```

### 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 by running the `--doc` export against the Lua reproduction in the issue and inspect how its output represents `@see`, access modifiers, inherited alias documentation, and `start`/`finish`. Trace the documentation-export entry point and compare its output with the annotation information used by the language server. Done means the exported data preserves the requested annotation details and explains or corrects the range values.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
documentation, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.