1
0

Adds column matching to the linter

This commit is contained in:
Jip J. Dekker 2016-01-21 15:44:33 +01:00
parent 0961446628
commit 032a024a4d
2 changed files with 10 additions and 4 deletions

View File

@ -1,3 +1,6 @@
## 0.5.0 - Column matching
- The linter now indicates the right column if indicated by `mzn2fzn`
## 0.4.1
- Enables the user to disable linting in the package settings
- Fixes problem in highlighting of numerical constants

View File

@ -53,17 +53,20 @@ class LinterMZN
generateMessage: (output, filePath) ->
match = output[0].match(/:([0-9]+):/)
line = parseInt(match[1])
console.log line + '\n'
startcol = 0
endcol = 500;
if output.length > 2 and /\^/.test(output[2])
startcol = output[2].match(/\^/).index
endcol = output[2].match(/\^(\s|$)/).index + 1
message = {
type: 'Error',
text: output[1..].join('\n').replace(/MiniZinc: /, ""),
range: [[line-1,0], [line-1,500]],
range: [[line-1,startcol], [line-1,endcol]],
filePath: filePath,
}
console.log message
return message