Improve the error message parsing for underlined errors
This commit is contained in:
parent
fc961a9a21
commit
6ee8ade534
@ -1,3 +1,6 @@
|
||||
## WIP
|
||||
- Improved error message parsing
|
||||
|
||||
## 0.7.0 - Split grammar definitions
|
||||
- Create seperate definitions for FlatZinc + Output models and DZN files.
|
||||
- Fixes linting error when opening DZN files
|
||||
|
@ -53,16 +53,18 @@ class LinterMZN
|
||||
generateMessage: (output, filePath) ->
|
||||
match = output[0].match(/:([0-9]+):/)
|
||||
line = parseInt(match[1])
|
||||
output = output[1..]
|
||||
|
||||
startcol = 0
|
||||
endcol = 500;
|
||||
if output.length > 2 and /\^/.test(output[2])
|
||||
startcol = output[2].match(/\^/).index
|
||||
endcol = output[2].match(/\^(\s|$)/).index + 1
|
||||
if output.length > 1 and /\^/.test(output[1])
|
||||
startcol = output[1].match(/\^/).index
|
||||
endcol = output[1].match(/\^(\s|$)/).index + 1
|
||||
output = output[2..]
|
||||
|
||||
message = {
|
||||
severity: 'error',
|
||||
excerpt: output[1..].join('\n').replace(/MiniZinc: /, ""),
|
||||
excerpt: output.join('\n').replace(/MiniZinc: /, ""),
|
||||
location:{
|
||||
file: filePath,
|
||||
position: [[line-1,startcol], [line-1,endcol]],
|
||||
|
Reference in New Issue
Block a user