LuaLS / LuaLS/lua-language-server

@see attribute and lua:// links not exposed in exported json

Open
#3,026 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?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

Linux

What is the issue affecting?

Other

Expected Behaviour

@see attribute data and lua:// links are written to the exported json documentation. Preferably being easily readable and containing the raw data to enable linking between different parts of a generated html documentation site.

Actual Behaviour

The @see attribute and lua:// links are transformed to raw markdown links that link directly to the source code using an absolute path.

Reproduction steps
  1. Make a new lua file.
  2. Add two functions:
function foo() end
--- @see foo
--- This function links to [`foo`](lua://foo)
function bar() end
  1. Export the documentation to json
  2. Observe the attribute and markdown link having been replaced with:
[`foo`]({path}#{location})
See: [foo]({path}#{location})
Additional Notes

I have been working on definition files for CC:T, and having been using the @see attribute and lua:// links as equivalents for the current links on https://tweaked.cc .
However, after trying to actually export the declarations, I've noticed that all links point directly towards absolute paths on disk. This is fine (or even needed) for editors to work, but it's undesirable for markdown output, and even worse for json.
If this method of exporting is intended to allow for things like generating static html pages, this information should be exposed better to allow for this.

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

Reproduce the issue by defining foo and bar with the shown @see and lua:// examples, then export the documentation to JSON. Inspect the export path that converts these links into absolute source paths. Done means the JSON preserves readable @see data and raw lua:// link information suitable for generated HTML linking.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
documentation
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.