Add a problemMatcher
评估
调研方向
未指定源文件或测试。使用提供的 tasks.json 和 main.lua 示例重现该问题,然后检查 VS Code 扩展如何参与任务集成和 problem matchers。完成的标准是:任务输出中的 Lua 运行时错误能够被解析,并且受影响的 main.lua 行被高亮显示。
由索引模型根据 Issue 内容生成。
描述
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
MacOS
What is the issue affecting?
Other
Expected Behaviour
I am not sure how you normally run your Lua application. But I am used to use the tasks feature of VS code, so I created a tasks.json with this content:
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Run main",
"type": "shell",
"command": "./main.lua",
"problemMatcher": [
"$lua"
]
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
Normally such a task makes use of a problemMatcher which parses the tasks console output for problems and then highlight the code line that was affected. But there seems no problemMatcher to be defined by the plugin.
Actual Behaviour
No problemMatcher provided.
Reproduction steps
- Create a tasks.json as given in "Expected Behaviour"
- Crate a main.lua with an error such as "local i = 5 + "foo"
- Run the task, the output shows something like
/usr/bin/lua: ./main.lua:3: attempt to add a 'number' with a 'string'
stack traceback:
[C]: in metamethod 'add'
./main.lua:3: in main chunk
[C]: in ?
See the main.lua, there is no highlight due to this error.
Additional Notes
No response
Log File
No response
- 主要语言
- TypeScript
- 星标
- 216
- 派生
- 63
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
LuaLS/vscode-lua 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 48/100
LuaLS/vscode-lua#189 ·
-
难度 5/5 一周以上 新手友好度 42/100
LuaLS/vscode-lua#186 ·
-
难度 3/5 1-2 天 新手友好度 35/100
LuaLS/vscode-lua#175 ·
-
难度 2/5 1-3 小时 新手友好度 58/100
LuaLS/vscode-lua#172 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
LuaLS/vscode-lua#170 · 1 条评论 ·
相似的 Issue
-
bug triage
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
hemi-earn
难度 2/5 1-3 小时 新手友好度 82/100
vetro-protocol/vetro-monorepo#1043 ·
维护者通常 1 天内回复
-
stage 2: bare names resolve against PATH differently from the shell (empty and relative entries)未关闭
难度 2/5 1-3 小时 新手友好度 82/100
STRML/omp-classifier#206 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
atlassian-labs/mermaid-diagrams-viewer#188 ·
维护者通常 1 天内回复
-
dashboard enhancement
难度 2/5 1-3 小时 新手友好度 76/100
Olanetsoft/agent-lookout#225 ·
维护者通常 1 天内回复