Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased
<!-- Add all new changes here. They will be moved under a version at release -->
* `FIX` Plugin virtual comment style and behavior issues
* `FIX` Incorrect generation of function signatures with tuple-parameters
* `NEW` Doc output now contains file paths for `@alias` and `@enum` types
* `FIX` Typos in a few error messages.
Expand Down
3 changes: 3 additions & 0 deletions script/core/find-source.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ return function (state, position, accept)
local len = math.huge
local result
guide.eachSourceContain(state.ast, position, function (source)
if source.virtual then
return
end
if source.type == 'function' then
if not isValidFunctionPos(source, position) then
return
Expand Down
10 changes: 9 additions & 1 deletion script/parser/luadoc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2308,6 +2308,14 @@ local function luadoc(state)
bindDocs(state)
end

local function markVirtual(node)
if not node then
return
end
node.virtual = true
guide.eachChild(node, markVirtual)
end

return {
buildAndBindDoc = function (ast, src, comment, group)
local doc = buildLuaDoc(comment)
Expand All @@ -2316,7 +2324,7 @@ return {
pluginDocs[#pluginDocs+1] = doc
doc.special = src
doc.originalComment = comment
doc.virtual = true
markVirtual(doc)
doc.specialBindGroup = group
ast.state.pluginDocs = pluginDocs
return doc
Expand Down
Loading