summaryrefslogtreecommitdiff
path: root/tools/lovr-api.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-01-12 14:52:30 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-01-12 14:52:30 +0800
commit62025440534df25cdfb3766f8b59536cedc707e6 (patch)
tree45849ac97269e11a8609711e34074513e5580af4 /tools/lovr-api.lua
parent6b3a0d0bb780b4eab4dbec77f3bb4d394aa5527f (diff)
downloadlua-language-server-62025440534df25cdfb3766f8b59536cedc707e6.zip
fix #902
Diffstat (limited to 'tools/lovr-api.lua')
-rw-r--r--tools/lovr-api.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/lovr-api.lua b/tools/lovr-api.lua
index 6bbc52b4..90ef1532 100644
--- a/tools/lovr-api.lua
+++ b/tools/lovr-api.lua
@@ -192,10 +192,10 @@ local function buildFile(defs)
for _, enum in ipairs(defs.enums or {}) do
text[#text+1] = ''
text[#text+1] = buildDescription(enum.description)
- text[#text+1] = ('---@class %s'):format(getTypeName(enum.name))
+ text[#text+1] = ('---@alias %s'):format(getTypeName(enum.name))
for _, constant in ipairs(enum.values) do
text[#text+1] = buildDescription(constant.description)
- text[#text+1] = ('---@field %s integer'):format(formatIndex(constant.name))
+ text[#text+1] = ([[---| '%s']]):format(('%q'):format(constant.name):gsub("'", "\\'"))
end
end