- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 385
 
Closed
Labels
enhancementNew feature or requestNew feature or requestfeat/LuaCats AnnotationsRelated to Lua Language Server Annotations (LuaCats)Related to Lua Language Server Annotations (LuaCats)
Milestone
Description
Describe the bug
In v3.x fields defined in ---@alias with '' get converted to string literals (inside ""). That wasn't the behavior of the older versions.
To Reproduce
Steps to reproduce the behavior, use the following code:
local ngx = {}
ngx.DEBUG  = 8
ngx.INFO   = 7
ngx.NOTICE = 6
ngx.WARN   = 5
ngx.ERR    = 4
ngx.CRIT   = 3
ngx.ALERT  = 2
ngx.EMERG  = 1
ngx.STDERR = 0
--- NGINX log level constants
--- https://github.com/openresty/lua-nginx-module/#nginx-log-level-constants
---@alias ngx.log.level
---| 'ngx.DEBUG'  # debug
---| 'ngx.INFO'   # info
---| 'ngx.NOTICE' # notice
---| 'ngx.WARN'   # warning
---| 'ngx.ERR'    # error
---| 'ngx.ALERT'  # alert
---| 'ngx.CRIT'   # critical
---| 'ngx.EMERG'  # emergency
---| 'ngx.STDERR' # standard error
---@param level ngx.log.level
---@param ... string|number|'nil'|'ngx.null'
function ngx.log(level, ...) end
ngx.log- Start typing (
 - See the error
 
Expected behavior
The expected behavior is the behavior from v2.6.8. The alias entries enclosed in single '' shouldn't be converted to string literals (enclosed with "").
Screenshots
- v3.0.2:
 
- The autocomplete suggestion.
 
- 
What the autocomplete expands to.
 - 
v2.6.8:
 
- The autocomplete suggestion.
 
- What the autocomplete expands to.
 
Environment:
- OS: Windows
 - Client: VSCode
 
Additional context
If there is a reason why this is changed, could you instruct me on how to achieve the same result with a different approach?
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestfeat/LuaCats AnnotationsRelated to Lua Language Server Annotations (LuaCats)Related to Lua Language Server Annotations (LuaCats)



