LuaLS / LuaLS/lua-language-server
Feature: Adding support for custom @tags
Nessuno ha ancora preso questa issue.
- Lingua principale
- Lua
- Stelle
- 4.4k
- Fork
- 442
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia individuando l’esportatore della documentazione e il documento JSON che produce, quindi traccia il modo in cui le annotazioni Lua vengono analizzate ed esportate. Definisci come devono essere rappresentate nel JSON esportato le voci di custom_tags, inclusi i titoli, i flag nascosti e le funzioni di formattazione; il lavoro è completato quando i tag personalizzati possono essere analizzati e post-processati senza richiedere un uso interno.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- lua
- Ambito
- documentation
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100