LuaLS / LuaLS/lua-language-server
Feature: Adding support for custom @tags
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.
custom_tags = {
{"baseclass", title = "BaseClass", hidden = true},
{"state", title = "State", hidden = true},
{"warns", title = "Warnings", format = function(...)
return "<span class='tag-warning'>" .. markup(...) .. "</span>"
end},
{"bugs", title = "Known Issues", format = function(...)
return "<span class='tag-bugs'>" .. markup(...) .. "</span>"
end},
{"deprecated", title = "Deprecated", format = function(str)
if str == "" then
return "<span class='tag-deprecated'>This function is deprecated and may be removed in a future version.</span>"
else
return "<span class='tag-deprecated'>This function is deprecated and may be removed in a future version.<br>" .. markup(str) .. "</span>"
end
end},
{"internal", title = "Internal", format = function(str)
if str == "" then
return "<span class='tag-internal'>This function is internal. Whilst you can call it, you probably shouldn't.</span>"
else
return "<span class='tag-internal'>This function is internal. Whilst you can call it, you probably shouldn't.<br>" .. markup(str) .. "</span>"
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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