Skip to content

Commit 945bc95

Browse files
fix: reimplement section luals.config in doc.json
Section luals.config was implemented in LuaLS#2562, but got lost after a major refactoring in LuaLS#2821. This commit reimplements it. See discussion LuaLS#2963.
1 parent 115a518 commit 945bc95

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-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

78
## 3.13.6
89
`2025-2-6`

script/cli/doc/export.lua

+13-7
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ local getLabel = require 'core.hover.label'
88
local jsonb = require 'json-beautify'
99
local util = require 'utility'
1010
local markdown = require 'provider.markdown'
11+
local fs = require 'bee.filesystem'
12+
local furi = require 'file-uri'
1113

1214
---@alias doctype
1315
---| 'doc.alias'
@@ -214,10 +216,6 @@ export.makeDocObject['local'] = function(source, obj, has_seen)
214216
obj.name = source[1]
215217
end
216218

217-
export.makeDocObject['luals.config'] = function(source, obj, has_seen)
218-
219-
end
220-
221219
export.makeDocObject['self'] = export.makeDocObject['local']
222220

223221
export.makeDocObject['setfield'] = export.makeDocObject['doc.class']
@@ -284,17 +282,25 @@ end
284282
---@param callback fun(i, max)
285283
function export.makeDocs(globals, callback)
286284
local docs = {}
287-
288285
for i, global in ipairs(globals) do
289286
table.insert(docs, export.documentObject(global))
290287
callback(i, #globals)
291288
end
292-
289+
docs[#docs+1] = export.getLualsConfig()
293290
table.sort(docs, export.sortDoc)
294-
295291
return docs
296292
end
297293

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

0 commit comments

Comments
 (0)