tangled
alpha
login
or
join now
dekker.one
/
atom-language-mzn
0
fork
atom
Atom package to provide syntax highlighting for the MiniZinc constraint modelling language
0
fork
atom
overview
issues
pulls
pipelines
Improve the error message parsing for underlined errors
dekker.one
8 years ago
6ee8ade5
fc961a9a
+9
-4
2 changed files
expand all
collapse all
unified
split
CHANGELOG.md
lib
linter-mzn.coffee
+3
CHANGELOG.md
···
0
0
0
1
## 0.7.0 - Split grammar definitions
2
- Create seperate definitions for FlatZinc + Output models and DZN files.
3
- Fixes linting error when opening DZN files
···
1
+
## WIP
2
+
- Improved error message parsing
3
+
4
## 0.7.0 - Split grammar definitions
5
- Create seperate definitions for FlatZinc + Output models and DZN files.
6
- Fixes linting error when opening DZN files
+6
-4
lib/linter-mzn.coffee
···
53
generateMessage: (output, filePath) ->
54
match = output[0].match(/:([0-9]+):/)
55
line = parseInt(match[1])
0
56
57
startcol = 0
58
endcol = 500;
59
-
if output.length > 2 and /\^/.test(output[2])
60
-
startcol = output[2].match(/\^/).index
61
-
endcol = output[2].match(/\^(\s|$)/).index + 1
0
62
63
message = {
64
severity: 'error',
65
-
excerpt: output[1..].join('\n').replace(/MiniZinc: /, ""),
66
location:{
67
file: filePath,
68
position: [[line-1,startcol], [line-1,endcol]],
···
53
generateMessage: (output, filePath) ->
54
match = output[0].match(/:([0-9]+):/)
55
line = parseInt(match[1])
56
+
output = output[1..]
57
58
startcol = 0
59
endcol = 500;
60
+
if output.length > 1 and /\^/.test(output[1])
61
+
startcol = output[1].match(/\^/).index
62
+
endcol = output[1].match(/\^(\s|$)/).index + 1
63
+
output = output[2..]
64
65
message = {
66
severity: 'error',
67
+
excerpt: output.join('\n').replace(/MiniZinc: /, ""),
68
location:{
69
file: filePath,
70
position: [[line-1,startcol], [line-1,endcol]],