-
-
Notifications
You must be signed in to change notification settings - Fork 331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation generation does not respect --configpath
#2997
Comments
Hello, have you solved this problem? ---builds a lua table of based on `globals` and their elements
---@async
---@param globals table
---@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
table.sort(docs, export.sortDoc)
--- 筛选
local foreign = {}
local filterout = { exitcode = 1, filetype = 1, gcoptions = 1, hookmask = 1, infowhat = 1, loadmode = 1, localecategory = 1, openmode = 1, popenmode = 1, readmode = 1, seekwhence = 1, type = 1, vbuf = 1 }
for id, class in ipairs(docs) do
if filterout[class.name] ~= nil then
table.insert(foreign, id)
elseif class.defines then
for _, define in ipairs(class.defines) do
if type(define.file) == "string" and not string.find(define.file, "test", 1, true) then
table.insert(foreign, id)
break
end
end
end
end
for i, id in ipairs(foreign) do
table.remove(docs, id - i + 1)
end
-- print("\n", "docs:\n", serialize(docs))
return docs
end You can try it and see how it goes. |
基於覆寫 export.lua 方向的話,我想到更簡單的方法 🤔
local furi = require "file-uri"
function export.gatherGlobals()
local metaPathUri = furi.encode(METAPATH)
local all_globals = vm.getAllGlobals()
local globals = {}
for _, g in pairs(all_globals) do
for uri in pairs(g.links) do
-- ignore globals classes defined in built in metapath
if uri:find(metaPathUri, 1, true) then
goto continue
end
end
table.insert(globals, g)
::continue::
end
return globals
end
並且 #2821 其實提供1個
"docScriptPath": "export.lua",
"workspace.ignoreDir": [
"export.lua"
],
somehow the issue translate bot is not working ... 🙄 TranslatedIf we're going to override
local furi = require "file-uri"
function export.gatherGlobals()
local metaPathUri = furi.encode(METAPATH)
local all_globals = vm.getAllGlobals()
local globals = {}
for _, g in pairs(all_globals) do
for uri in pairs(g.links) do
-- ignore globals classes defined in built in metapath
if uri:find(metaPathUri, 1, true) then
goto continue
end
end
table.insert(globals, g)
::continue::
end
return globals
end
Also, #2821 actually provides a
"docScriptPath": "export.lua",
"workspace.ignoreDir": [
"export.lua"
],
|
After my investigation, the reason why the configuration file does not take effect seems to be that it is not loaded
|
In |
Hello, my PR seems to be able to help you solve this problem, after testing, the luarc configuration file you provided can be read normally, and the lua module can also be filtered in the exported document. |
How are you using the lua-language-server?
Command Line
Which OS are you using?
Windows WSL
What is the issue affecting?
Other
Expected Behaviour
The specified config file should be used.
Actual Behaviour
The specified config is ignored, meaning that
runtime.builtin
cannot be customized for export. See #2977 (comment)Reproduction steps
.luarc.docs.json
See that builtins are included in doc output, despite being disabled in specified config file.
Additional Notes
Actually built-ins should not be included regardless: #2977
Log File
No response
The text was updated successfully, but these errors were encountered: