LuaLS / LuaLS/lua-language-server

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

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

还没有人认领这个 Issue。

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

描述

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

贡献指南

打开贡献指南

从这里开始

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

调研方向

通过使用所示的 @see 和 lua:// 示例定义 foo 和 bar 来复现该问题,然后将文档导出为 JSON。检查将这些链接转换为绝对源路径的导出路径。完成的标准是 JSON 保留可读的 @see 数据和适合在生成的 HTML 中创建链接的原始 lua:// 链接信息。

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

评估

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

把新 issue 发到你的邮箱

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