Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a problemMatcher #134

Open
lukas-hofstaetter opened this issue Dec 15, 2023 · 2 comments
Open

Add a problemMatcher #134

lukas-hofstaetter opened this issue Dec 15, 2023 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@lukas-hofstaetter
Copy link

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

@Frityet
Copy link

Frityet commented Dec 28, 2023

+1 This would be very useful

@carsakiller carsakiller added the enhancement New feature or request label Jan 13, 2024
@carsakiller
Copy link
Collaborator

If someone wants to tackle this one, it should be relatively easy 🙂. I'm going to move this issue to the vscode-lua repo.

@carsakiller carsakiller transferred this issue from LuaLS/lua-language-server Jan 13, 2024
@carsakiller carsakiller added the good first issue Good for newcomers label Jan 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants