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. 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)) 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