2017-11-16 09:36:53 +00:00
|
|
|
Before:
|
|
|
|
runtime! ale_linters/markdown/redpen.vim
|
|
|
|
|
|
|
|
After:
|
|
|
|
call ale#linter#Reset()
|
|
|
|
|
|
|
|
Execute(redpen handler should handle errors output):
|
|
|
|
AssertEqual
|
|
|
|
\ [
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 1,
|
2017-11-17 06:21:54 +00:00
|
|
|
\ 'col': 10,
|
2017-11-16 10:28:30 +00:00
|
|
|
\ 'end_lnum': 1,
|
|
|
|
\ 'end_col': 15,
|
2017-11-21 06:41:19 +00:00
|
|
|
\ 'text': 'Found possibly misspelled word "plugin".',
|
2017-11-16 09:36:53 +00:00
|
|
|
\ 'type': 'W',
|
2017-11-21 06:41:19 +00:00
|
|
|
\ 'code': 'Spelling',
|
2017-11-16 09:36:53 +00:00
|
|
|
\ },
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 1,
|
|
|
|
\ 'col': 1,
|
2017-11-21 06:41:19 +00:00
|
|
|
\ 'text': 'Found possibly misspelled word "NeoVim".',
|
2017-11-16 09:36:53 +00:00
|
|
|
\ 'type': 'W',
|
2017-11-21 06:41:19 +00:00
|
|
|
\ 'code': 'Spelling',
|
2017-11-16 09:36:53 +00:00
|
|
|
\ },
|
2018-03-18 18:12:47 +00:00
|
|
|
\ {
|
|
|
|
\ 'lnum': 1,
|
|
|
|
\ 'col': 35,
|
|
|
|
\ 'end_lnum': 1,
|
|
|
|
\ 'end_col': 55,
|
|
|
|
\ 'text': 'Found possibly misspelled word "コードチェック".',
|
|
|
|
\ 'type': 'W',
|
|
|
|
\ 'code': 'Spelling',
|
|
|
|
\ },
|
2017-11-16 09:36:53 +00:00
|
|
|
\ ],
|
2017-11-17 06:21:18 +00:00
|
|
|
\ ale#handlers#redpen#HandleRedpenOutput(bufnr(''), [
|
2017-11-16 09:36:53 +00:00
|
|
|
\ '[',
|
|
|
|
\ ' {',
|
|
|
|
\ ' "document": "test.md",',
|
|
|
|
\ ' "errors": [',
|
|
|
|
\ ' {',
|
|
|
|
\ ' "sentence": "ALE is a plugin for providing linting in NeoVim and Vim 8 while you edit your text files.",',
|
|
|
|
\ ' "endPosition": {',
|
|
|
|
\ ' "offset": 15,',
|
|
|
|
\ ' "lineNum": 1',
|
|
|
|
\ ' },',
|
|
|
|
\ ' "validator": "Spelling",',
|
|
|
|
\ ' "lineNum": 1,',
|
|
|
|
\ ' "sentenceStartColumnNum": 0,',
|
|
|
|
\ ' "message": "Found possibly misspelled word \"plugin\".",',
|
|
|
|
\ ' "startPosition": {',
|
|
|
|
\ ' "offset": 9,',
|
|
|
|
\ ' "lineNum": 1',
|
|
|
|
\ ' }',
|
|
|
|
\ ' },',
|
|
|
|
\ ' {',
|
|
|
|
\ ' "sentence": "ALE is a plugin for providing linting in NeoVim and Vim 8 while you edit your text files.",',
|
|
|
|
\ ' "validator": "Spelling",',
|
|
|
|
\ ' "lineNum": 1,',
|
|
|
|
\ ' "sentenceStartColumnNum": 0,',
|
2017-11-16 10:42:51 +00:00
|
|
|
\ ' "message": "Found possibly misspelled word \"NeoVim\"."',
|
2018-03-18 18:12:47 +00:00
|
|
|
\ ' },',
|
|
|
|
\ ' {',
|
|
|
|
\ ' "sentence": "ALEはNeoVimとVim8で非同期のコードチェックを実現するプラグインです。",',
|
|
|
|
\ ' "endPosition": {',
|
|
|
|
\ ' "offset": 27,',
|
|
|
|
\ ' "lineNum": 1',
|
|
|
|
\ ' },',
|
|
|
|
\ ' "validator": "Spelling",',
|
|
|
|
\ ' "lineNum": 1,',
|
|
|
|
\ ' "sentenceStartColumnNum": 0,',
|
|
|
|
\ ' "message": "Found possibly misspelled word \"コードチェック\".",',
|
|
|
|
\ ' "startPosition": {',
|
|
|
|
\ ' "offset": 20,',
|
|
|
|
\ ' "lineNum": 1',
|
|
|
|
\ ' }',
|
2017-11-16 09:36:53 +00:00
|
|
|
\ ' }',
|
|
|
|
\ ' ]',
|
|
|
|
\ ' }',
|
|
|
|
\ ']',
|
|
|
|
\ ])
|
|
|
|
|
2019-03-29 16:09:27 +00:00
|
|
|
Execute(The redpen handler should handle an empty error list):
|
2017-11-16 09:36:53 +00:00
|
|
|
AssertEqual
|
|
|
|
\ [],
|
2017-11-17 06:21:18 +00:00
|
|
|
\ ale#handlers#redpen#HandleRedpenOutput(bufnr(''), [
|
2017-11-16 09:36:53 +00:00
|
|
|
\ '[',
|
|
|
|
\ ' {',
|
|
|
|
\ ' "document": "test.md",',
|
|
|
|
\ ' "errors": []',
|
|
|
|
\ ' }',
|
|
|
|
\ ']',
|
|
|
|
\ ])
|
2019-03-29 16:09:27 +00:00
|
|
|
|
|
|
|
Execute(The redpen handler should handle totally empty output):
|
|
|
|
AssertEqual
|
|
|
|
\ [],
|
|
|
|
\ ale#handlers#redpen#HandleRedpenOutput(bufnr(''), [])
|