Skip to content

Commit b8da205

Browse files
authored
Merge pull request #3257 from tommaisey/alias-enum-doc-export
@alias and @enum file paths
2 parents 8821806 + 1c1f002 commit b8da205

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Unreleased
44
<!-- Add all new changes here. They will be moved under a version at release -->
5+
* `NEW` Doc output now contains file paths for `@alias` and `@enum` types
56
* `FIX` Typos in a few error messages.
67
* `FIX` Incorrect inject-field message for extra table field in exact class
78
* `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.

script/cli/doc/export.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,11 @@ export.makeDocObject['INIT'] = function(source, has_seen)
147147
end
148148

149149
export.makeDocObject['doc.alias'] = function(source, obj, has_seen)
150+
obj.file = export.getLocalPath(guide.getUri(source))
151+
end
150152

153+
export.makeDocObject['doc.enum'] = function(source, obj, has_seen)
154+
obj.file = export.getLocalPath(guide.getUri(source))
151155
end
152156

153157
export.makeDocObject['doc.field'] = function(source, obj, has_seen)
@@ -256,6 +260,7 @@ export.makeDocObject['variable'] = function(source, obj, has_seen)
256260
or set.type == 'setmethod'
257261
or set.type == 'setindex'
258262
or set.type == 'doc.alias'
263+
or set.type == 'doc.enum'
259264
or set.type == 'doc.class'
260265
then
261266
table.insert(obj.defines, export.documentObject(set, has_seen))

script/core/hover/description.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ local function tryDocEnum(source)
507507
end
508508
if field.value.type == 'integer'
509509
or field.value.type == 'string' then
510-
md:add('lua', (' %s: %s = %s,'):format(key, field.value.type, field.value[1]))
510+
md:add('lua', (' %s: %s = %q,'):format(key, field.value.type, field.value[1]))
511511
end
512512
if field.value.type == 'binary'
513513
or field.value.type == 'unary' then

0 commit comments

Comments
 (0)