LuaLS / LuaLS/lua-language-server
literal strings 'async' is mis-parsed
Personne n'a encore pris cette issue.
- Langage dominant
- Lua
- Étoiles
- 4.4k
- Forks
- 442
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
### 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_
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- lua
- Domaine
- devtools
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- Calme
- Clarté
- Plutôt claire
- Accessibilité débutants
- 55/100