LuaLS / LuaLS/lua-language-server

Feature: Adding support for custom @tags

Offen
#3,314 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Lua
Sterne
4.4k
Forks
442
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, den Dokumentationsexporter und das von ihm erzeugte JSON-Dokument zu finden, und verfolge anschließend, wie Lua-Annotationen geparst und exportiert werden. Lege fest, wie custom_tags-Einträge einschließlich Titeln, Hidden-Flags und Formatierungsfunktionen im exportierten JSON dargestellt werden sollen; fertig ist die Aufgabe, wenn benutzerdefinierte Tags geparst und nachbearbeitet werden können, ohne eine interne Verwendung zu erfordern.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
lua
Bereich
documentation
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.