From d9da18ad9072c01282930dd672ba1140e7c9cd02 Mon Sep 17 00:00:00 2001 From: Tom Maisey Date: Thu, 21 Aug 2025 17:35:01 +0100 Subject: [PATCH 1/3] Export @alias and @enum into docs with file path --- script/cli/doc/export.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/script/cli/doc/export.lua b/script/cli/doc/export.lua index 3e067576d..cd356b167 100644 --- a/script/cli/doc/export.lua +++ b/script/cli/doc/export.lua @@ -147,7 +147,11 @@ export.makeDocObject['INIT'] = function(source, has_seen) end export.makeDocObject['doc.alias'] = function(source, obj, has_seen) + obj.file = export.getLocalPath(guide.getUri(source)) +end +export.makeDocObject['doc.enum'] = function(source, obj, has_seen) + obj.file = export.getLocalPath(guide.getUri(source)) end export.makeDocObject['doc.field'] = function(source, obj, has_seen) @@ -256,6 +260,7 @@ export.makeDocObject['variable'] = function(source, obj, has_seen) or set.type == 'setmethod' or set.type == 'setindex' or set.type == 'doc.alias' + or set.type == 'doc.enum' or set.type == 'doc.class' then table.insert(obj.defines, export.documentObject(set, has_seen)) From 5d36ba15fe73c7907e5061631739d4ae140e1268 Mon Sep 17 00:00:00 2001 From: Tom Maisey Date: Thu, 21 Aug 2025 17:38:35 +0100 Subject: [PATCH 2/3] Render strings correctly in exported enum doc comments --- script/core/hover/description.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/core/hover/description.lua b/script/core/hover/description.lua index 368b311c9..ea7f16340 100644 --- a/script/core/hover/description.lua +++ b/script/core/hover/description.lua @@ -507,7 +507,7 @@ local function tryDocEnum(source) end if field.value.type == 'integer' or field.value.type == 'string' then - md:add('lua', (' %s: %s = %s,'):format(key, field.value.type, field.value[1])) + md:add('lua', (' %s: %s = %q,'):format(key, field.value.type, field.value[1])) end if field.value.type == 'binary' or field.value.type == 'unary' then From f2e803ee14393dc79e405e3d4a5cb7d4d6a147f4 Mon Sep 17 00:00:00 2001 From: Tom Maisey Date: Thu, 21 Aug 2025 23:18:58 +0100 Subject: [PATCH 3/3] Update changelog for alias/enum file paths improvement --- changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.md b/changelog.md index 59d4dee24..0c87deaec 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,7 @@ ## Unreleased +* `NEW` Doc output now contains file paths for `@alias` and `@enum` types * `FIX` Incorrect inject-field message for extra table field in exact class * `CHG` Rename configuration option `Lua.diagnostics.disableScheme` to `Lua.diagnostics.validScheme` and improve its description. Now it enables diagnostics for Lua files that use the specified scheme. * `FIX` adds the `|lambda|` operator to the `Lua.runtime.nonstandardSymbol` configuration template, which allows the use of that option. Previously, support for it existed in the parser, but we could not actually use the option because it is not recognised in the configuration.