LuaLS / LuaLS/lua-language-server
Syntax warning / error not flagged as such.
还没有人认领这个 Issue。
- 主要语言
- Lua
- 星标
- 4.4k
- 派生
- 442
- PR 合并指标
- 30 天内没有已合并 PR
描述
### 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?
Diagnostics/Syntax Checking
### Expected Behaviour
A warning or an error that the line in question is not complete, regardless of how the parser it's run in processes it:
```lua
local varA, varB functionCalledHere()
```
### Actual Behaviour
No warning or error was given, resulting in a 20 minute hunt for a `nil` in one of the variables that shouldn't exist. The plugin did not flag the line as having a syntax warning or error, even if the Lua engine did not have an issue with the code per se.
### Reproduction steps
.
### Additional Notes
Apologies for raising another issue, but I couldn't find any information on if this is a niche feature of Lua or a bug that just hadn't been fixed in `5.1`. But if it's not a feature and is an unintended side-effort, I feel like it should be raised as a warning by the LLS to alert the user like "hey, are you sure this is what you were intending to do" similar to variables lacking a `nil`.
### Log File
_No response_
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
使用 Lua 代码片段 `local varA, varB functionCalledHere()` 在 Visual Studio Code 扩展中复现该报告。首先跟踪此不完整声明的语法诊断是如何生成的,然后为该代码片段添加回归测试,并验证报告的是警告或错误,而不是没有诊断。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- lua
- 领域
- devtools
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 48/100