Skip to content

Commit f88626a

Browse files
authored
Merge pull request #3072 from AndreasMatthias/fix_doc_config
fix: reimplement section luals.config in doc.json
2 parents 6618c2f + 8390e63 commit f88626a

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Unreleased
44
<!-- Add all new changes here. They will be moved under a version at release -->
55
* `FIX` incorrect argument skip pattern for `--check_out_path=`, which incorrectly skips the next argument
6+
* `FIX` reimplement section `luals.config` in file doc.json
67
* `FIX` incorrect file names in file doc.json
78
* `FIX` remove extra `./` path prefix in the check report when using `--check=.`
89

script/cli/doc/export.lua

+11-7
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,6 @@ export.makeDocObject['local'] = function(source, obj, has_seen)
217217
obj.name = source[1]
218218
end
219219

220-
export.makeDocObject['luals.config'] = function(source, obj, has_seen)
221-
222-
end
223-
224220
export.makeDocObject['self'] = export.makeDocObject['local']
225221

226222
export.makeDocObject['setfield'] = export.makeDocObject['doc.class']
@@ -287,17 +283,25 @@ end
287283
---@param callback fun(i, max)
288284
function export.makeDocs(globals, callback)
289285
local docs = {}
290-
291286
for i, global in ipairs(globals) do
292287
table.insert(docs, export.documentObject(global))
293288
callback(i, #globals)
294289
end
295-
290+
docs[#docs+1] = export.getLualsConfig()
296291
table.sort(docs, export.sortDoc)
297-
298292
return docs
299293
end
300294

295+
function export.getLualsConfig()
296+
return {
297+
name = 'LuaLS',
298+
type = 'luals.config',
299+
DOC = fs.canonical(fs.path(DOC)):string(),
300+
defines = {},
301+
fields = {}
302+
}
303+
end
304+
301305
---takes the table from `makeDocs`, serializes it, and exports it
302306
---@async
303307
---@param docs table

0 commit comments

Comments
 (0)