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
···
1
1
+
## WIP
2
2
+
- Improved error message parsing
3
3
+
1
4
## 0.7.0 - Split grammar definitions
2
5
- Create seperate definitions for FlatZinc + Output models and DZN files.
3
6
- Fixes linting error when opening DZN files
+6
-4
lib/linter-mzn.coffee
···
53
53
generateMessage: (output, filePath) ->
54
54
match = output[0].match(/:([0-9]+):/)
55
55
line = parseInt(match[1])
56
56
+
output = output[1..]
56
57
57
58
startcol = 0
58
59
endcol = 500;
59
59
-
if output.length > 2 and /\^/.test(output[2])
60
60
-
startcol = output[2].match(/\^/).index
61
61
-
endcol = output[2].match(/\^(\s|$)/).index + 1
60
60
+
if output.length > 1 and /\^/.test(output[1])
61
61
+
startcol = output[1].match(/\^/).index
62
62
+
endcol = output[1].match(/\^(\s|$)/).index + 1
63
63
+
output = output[2..]
62
64
63
65
message = {
64
66
severity: 'error',
65
65
-
excerpt: output[1..].join('\n').replace(/MiniZinc: /, ""),
67
67
+
excerpt: output.join('\n').replace(/MiniZinc: /, ""),
66
68
location:{
67
69
file: filePath,
68
70
position: [[line-1,startcol], [line-1,endcol]],