diff --git a/changelog.md b/changelog.md index be0599785..36c099f12 100644 --- a/changelog.md +++ b/changelog.md @@ -3,6 +3,7 @@ ## Unreleased * `FIX` incorrect argument skip pattern for `--check_out_path=`, which incorrectly skips the next argument +* `FIX` reimplement section `luals.config` in file doc.json * `FIX` incorrect file names in file doc.json * `FIX` remove extra `./` path prefix in the check report when using `--check=.` diff --git a/script/cli/doc/export.lua b/script/cli/doc/export.lua index 1b72f8af1..3e067576d 100644 --- a/script/cli/doc/export.lua +++ b/script/cli/doc/export.lua @@ -217,10 +217,6 @@ export.makeDocObject['local'] = function(source, obj, has_seen) obj.name = source[1] end -export.makeDocObject['luals.config'] = function(source, obj, has_seen) - -end - export.makeDocObject['self'] = export.makeDocObject['local'] export.makeDocObject['setfield'] = export.makeDocObject['doc.class'] @@ -287,17 +283,25 @@ end ---@param callback fun(i, max) function export.makeDocs(globals, callback) local docs = {} - for i, global in ipairs(globals) do table.insert(docs, export.documentObject(global)) callback(i, #globals) end - + docs[#docs+1] = export.getLualsConfig() table.sort(docs, export.sortDoc) - return docs end +function export.getLualsConfig() + return { + name = 'LuaLS', + type = 'luals.config', + DOC = fs.canonical(fs.path(DOC)):string(), + defines = {}, + fields = {} + } +end + ---takes the table from `makeDocs`, serializes it, and exports it ---@async ---@param docs table