LuaLS / LuaLS/vscode-lua

Add a problemMatcher

Offen
#134 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

enhancement good first issue
Vorherrschende Sprache
TypeScript
Sterne
215
Forks
62
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Es ist keine Quelldatei oder kein Test angegeben. Reproduziere das Problem mit der bereitgestellten tasks.json- und main.lua-Beispieldatei und untersuche anschließend, wie die VS Code-Erweiterung die Aufgabenintegration und problem matchers beiträgt. Das Ziel ist erreicht, wenn Lua-Laufzeitfehler aus der Aufgabenausgabe geparst werden und die betroffene main.lua-Zeile hervorgehoben wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
lua, vscode
Bereich
tooling
Issue-Typ
Feature
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.