LuaLS / LuaLS/lua-language-server
literal strings 'async' is mis-parsed
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Lua
- Star
- 4.4k
- Fork
- 442
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
### How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
### Which OS are you using?
Linux
### What is the issue affecting?
Annotations
### Expected Behaviour
The following should work without errors:
```lua
---@class Unit
---@field mode "async" | "sync"
```
and:
```lua
---@type Unit
local test = {}
test.mode = (hint) --> "async" or "sync"
```
### Actual Behaviour
The follow shows an error
```lua
---@class Unit
---@field mode "async" (error here: expected.) | "sync"
```
and:
```lua
---@type Unit
local test = {}
test.mode = (hint) --> "sync"
```
### Reproduction steps
1. Copy and paste the expected behavior codeblock.
### Additional Notes
Only happens with `async` as far as I can see.
### Log File
_No response_
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Start by reproducing the annotation examples in the Visual Studio Code extension and compare how the parser handles the literal string "async" with "sync". Trace the annotation/type-name handling that produces the expected error, then add coverage showing both literal values are accepted without changing the reported type hint.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- lua
- Lĩnh vực
- devtools
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 55/100