Adds column matching to the linter
This commit is contained in:
parent
0961446628
commit
032a024a4d
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user