Atom package to provide syntax highlighting for the MiniZinc constraint modelling language

Improve the error message parsing for underlined errors

+9 -4
+3
CHANGELOG.md
··· 1 + ## WIP 2 + - Improved error message parsing 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 + output = output[1..] 56 57 57 58 startcol = 0 58 59 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 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..] 62 64 63 65 message = { 64 66 severity: 'error', 65 - excerpt: output[1..].join('\n').replace(/MiniZinc: /, ""), 67 + excerpt: output.join('\n').replace(/MiniZinc: /, ""), 66 68 location:{ 67 69 file: filePath, 68 70 position: [[line-1,startcol], [line-1,endcol]],