LuaLS / LuaLS/lua-language-server

Feature: Adding support for custom @tags

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

One of the nice things with LDoc was the ability to define custom tags, so they could be used to give additional annotations.

As an example, this is the tags section of one of our projects.
```lua
custom_tags = {
{"baseclass", title = "BaseClass", hidden = true},
{"state", title = "State", hidden = true},

{"warns", title = "Warnings", format = function(...)
return "" .. markup(...) .. ""
end},
{"bugs", title = "Known Issues", format = function(...)
return "" .. markup(...) .. ""
end},
{"deprecated", title = "Deprecated", format = function(str)
if str == "" then
return "This function is deprecated and may be removed in a future version."
else
return "This function is deprecated and may be removed in a future version.
" .. markup(str) .. "
"
end
end},
{"internal", title = "Internal", format = function(str)
if str == "" then
return "This function is internal. Whilst you can call it, you probably shouldn't."
else
return "This function is internal. Whilst you can call it, you probably shouldn't.
" .. markup(str) .. "
"
end
end}
}
```

Even if these aren't used internally, being able to define them for LuaLS to parse and export from the docs exporter in the json document would allow us to do post-processing on the files.

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 locating the documentation exporter and the JSON document it produces, then trace how Lua annotations are parsed and exported. Define how custom_tags entries, including titles, hidden flags, and format functions, should be represented in the exported JSON; done means custom tags can be parsed and post-processed without requiring internal use.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
documentation
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 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.