LuaLS / LuaLS/vscode-lua

Add a problemMatcher

未關閉
#134 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

enhancement good first issue
主要語言
TypeScript
星號
215
分支
62
PR 合併指標
30 天內沒有已合併 PR

描述

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
  1. Create a tasks.json as given in "Expected Behaviour"
  2. Crate a main.lua with an error such as "local i = 5 + "foo"
  3. 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

貢獻指南

這個儲存庫沒有索引到貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

未指定原始檔案或測試。使用提供的 tasks.json 和 main.lua 範例重現問題,然後檢查 VS Code 擴充功能如何參與工作整合和 problem matchers。完成的標準是:工作輸出中的 Lua 執行階段錯誤能被剖析,且受影響的 main.lua 行會反白顯示。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
lua, vscode
領域
tooling
Issue 類型
功能
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。