-
-
Notifications
You must be signed in to change notification settings - Fork 390
Open
Labels
enhancementNew feature or requestNew feature or request
Description
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
Windows
What is the issue affecting?
Annotations
Reproduction steps
I have the following code
local FONTFLAG_NONE = 0
local FONTFLAG_ITALIC = 0x001
local FONTFLAG_UNDERLINE = 0x002
local FONTFLAG_STRIKEOUT = 0x004
local FONTFLAG_SYMBOL = 0x008
local FONTFLAG_ANTIALIAS = 0x010
local FONTFLAG_GAUSSIANBLUR = 0x020
local FONTFLAG_ROTARY = 0x040
local FONTFLAG_DROPSHADOW = 0x080
local FONTFLAG_ADDITIVE = 0x100
local FONTFLAG_OUTLINE = 0x200
local FONTFLAG_CUSTOM = 0x400
local FONTFLAG_BITMAP = 0x800
---@alias FontFlags
---| `FONTFLAG_NONE` # 0
---| `FONTFLAG_ITALIC` # 1 (0x001)
---| `FONTFLAG_UNDERLINE` # 2 (0x002)
---| `FONTFLAG_STRIKEOUT` # 4 (0x004)
---| `FONTFLAG_SYMBOL` # 8 (0x008)
---| `FONTFLAG_ANTIALIAS` # 16 (0x010)
---| `FONTFLAG_GAUSSIANBLUR` # 32 (0x020)
---| `FONTFLAG_ROTARY` # 64 (0x040)
---| `FONTFLAG_DROPSHADOW` # 128 (0x080)
---| `FONTFLAG_ADDITIVE` # 256 (0x100)
---| `FONTFLAG_OUTLINE` # 512 (0x200)
---| `FONTFLAG_CUSTOM` # 1024 (0x400)
---| `FONTFLAG_BITMAP` # 2048 (0x800)
---@param name string
---@param height integer
---@param weight integer
---@param flags FontFlags|integer
---@return integer
---@nodiscard
function draw.CreateFont(name, height, weight, flags) end
Here, type completion does provide suggestion if param has not been filled

After that, i input a | character and open suggestion dialog again, and there's no more FontFlags type
I found a "hack" that works by changing function prototype
---@param name string
---@param height integer
---@param weight integer
---@param ... FontFlags|integer
---@return integer
---@nodiscard
function draw.CreateFont(name, height, weight, ...) endHowever this hack is not ideal
Additional Notes
No response
Log File
No response
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
