Add a problemMatcher
- Dominant language
- TypeScript
- Stars
- 215
- Forks
- 62
- PR merge metrics
- No merged PRs in 30d
Description
### 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_
Contributor guide
No contributing guide indexed for this repository
Research direction
No source file or test is named. Reproduce the issue with the provided tasks.json and main.lua example, then inspect how the VS Code extension contributes task integration and problem matchers. Done means Lua runtime errors from the task output are parsed and the affected main.lua line is highlighted.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua, vscode
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100