2017-06-25 16:12:40 +00:00
|
|
|
Before:
|
2017-09-11 21:25:15 +00:00
|
|
|
let b:tmp = has('win32') ? substitute($TMP, '\\', '\\\\', 'g') : $TMPDIR
|
|
|
|
|
2017-06-25 16:12:40 +00:00
|
|
|
runtime ale_linters/elm/make.vim
|
|
|
|
|
2017-09-11 21:25:15 +00:00
|
|
|
After:
|
|
|
|
unlet! b:tmp
|
|
|
|
unlet! g:config_error_lines
|
|
|
|
|
|
|
|
call ale#linter#Reset()
|
|
|
|
|
2017-06-25 16:12:40 +00:00
|
|
|
Execute(The elm-make handler should parse lines correctly):
|
|
|
|
AssertEqual
|
|
|
|
\ [
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 404,
|
|
|
|
\ 'col': 1,
|
2017-06-26 13:37:04 +00:00
|
|
|
\ 'end_lnum': 408,
|
|
|
|
\ 'end_col': 18,
|
2017-06-25 16:12:40 +00:00
|
|
|
\ 'type': 'E',
|
2018-05-11 17:15:40 +00:00
|
|
|
\ 'text': 'TYPE MISMATCH',
|
|
|
|
\ 'detail': "error details 1 styled details"
|
2017-06-25 16:12:40 +00:00
|
|
|
\ },
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 406,
|
|
|
|
\ 'col': 5,
|
2017-06-26 13:37:04 +00:00
|
|
|
\ 'end_lnum': 407,
|
|
|
|
\ 'end_col': 17,
|
2017-06-25 16:12:40 +00:00
|
|
|
\ 'type': 'E',
|
2018-05-11 17:15:40 +00:00
|
|
|
\ 'text': 'TYPE MISMATCH',
|
|
|
|
\ 'detail': "error details 2",
|
2017-06-25 16:12:40 +00:00
|
|
|
\ },
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 406,
|
|
|
|
\ 'col': 5,
|
2017-06-26 13:37:04 +00:00
|
|
|
\ 'end_lnum': 406,
|
|
|
|
\ 'end_col': 93,
|
2017-06-25 16:12:40 +00:00
|
|
|
\ 'type': 'E',
|
2018-05-11 17:15:40 +00:00
|
|
|
\ 'text': 'TYPE MISMATCH',
|
|
|
|
\ 'detail': "error details 3",
|
2017-06-25 16:12:40 +00:00
|
|
|
\ },
|
|
|
|
\ ],
|
|
|
|
\ ale_linters#elm#make#Handle(347, [
|
2018-05-11 17:15:40 +00:00
|
|
|
\ '{
|
|
|
|
\ "type":"compile-errors",
|
|
|
|
\ "errors": [
|
|
|
|
\ {
|
|
|
|
\ "path": "' . b:tmp . 'Module.elm",
|
|
|
|
\ "problems": [
|
|
|
|
\ {
|
|
|
|
\ "title": "TYPE MISMATCH",
|
|
|
|
\ "message": ["error details 1 ", { "string": "styled details" }],
|
|
|
|
\ "region": { "start": { "line": 404, "column":1 }, "end": { "line":408, "column":18} }
|
|
|
|
\ },
|
|
|
|
\ {
|
|
|
|
\ "title": "TYPE MISMATCH",
|
|
|
|
\ "message": ["error details 2"],
|
|
|
|
\ "region": { "start": {"line": 406, "column": 5}, "end": {"line": 407, "column": 17} }
|
|
|
|
\ },
|
|
|
|
\ {
|
|
|
|
\ "title": "TYPE MISMATCH",
|
|
|
|
\ "message": ["error details 3"],
|
|
|
|
\ "region": { "start": { "line": 406, "column": 5}, "end": {"line": 406, "column":93 } }
|
|
|
|
\ }
|
|
|
|
\ ]
|
|
|
|
\ }
|
|
|
|
\ ]
|
|
|
|
\ }'
|
2017-06-25 16:12:40 +00:00
|
|
|
\ ])
|
|
|
|
|
|
|
|
Execute(The elm-make handler should put an error on the first line if a line cannot be parsed):
|
|
|
|
AssertEqual
|
|
|
|
\ [
|
|
|
|
\ {
|
2018-05-11 17:15:40 +00:00
|
|
|
\ 'lnum': 404,
|
2017-06-25 16:12:40 +00:00
|
|
|
\ 'col': 1,
|
2018-05-11 17:15:40 +00:00
|
|
|
\ 'end_lnum': 408,
|
|
|
|
\ 'end_col': 18,
|
|
|
|
\ 'type': 'E',
|
|
|
|
\ 'text': 'TYPE MISMATCH',
|
|
|
|
\ 'detail': "error details 1 styled details"
|
2017-06-25 16:12:40 +00:00
|
|
|
\ },
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 1,
|
|
|
|
\ 'type': 'E',
|
|
|
|
\ 'text': 'Not JSON',
|
|
|
|
\ 'detail': "Not JSON\nAlso not JSON",
|
|
|
|
\ },
|
|
|
|
\ ],
|
|
|
|
\ ale_linters#elm#make#Handle(347, [
|
2018-05-11 17:15:40 +00:00
|
|
|
\ '{
|
|
|
|
\ "type":"compile-errors",
|
|
|
|
\ "errors": [
|
|
|
|
\ {
|
|
|
|
\ "path": "' . b:tmp . 'Module.elm",
|
|
|
|
\ "problems": [
|
|
|
|
\ {
|
|
|
|
\ "title": "TYPE MISMATCH",
|
|
|
|
\ "message": ["error details 1 ", { "string": "styled details" }],
|
|
|
|
\ "region": { "start": { "line": 404, "column":1 }, "end": { "line":408, "column":18} }
|
|
|
|
\ }
|
|
|
|
\ ]
|
|
|
|
\ }
|
|
|
|
\ ]
|
|
|
|
\ }',
|
|
|
|
\ "Not JSON",
|
|
|
|
\ "Also not JSON",
|
2017-06-25 16:12:40 +00:00
|
|
|
\ ])
|