1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
Before:
Save g:ale_buffer_info
After:
Restore
Execute:
" Results from multiple buffers should be gathered together.
" Equal problems should be de-duplicated.
let g:ale_buffer_info = {
\ '1': {'loclist': [
\ {'type': 'E', 'bufnr': 2, 'lnum': 1, 'col': 2, 'text': 'foo'},
\ {'type': 'E', 'bufnr': 2, 'lnum': 1, 'col': 5, 'text': 'bar'},
\ {'type': 'E', 'bufnr': -1, 'filename': 'c', 'lnum': 3, 'col': 2, 'text': 'x'},
\ {'type': 'E', 'bufnr': 1, 'lnum': 5, 'col': 4, 'text': 'x'},
\ {'type': 'E', 'bufnr': 2, 'lnum': 5, 'col': 5, 'text': 'foo'},
\ {'type': 'E', 'bufnr': 1, 'lnum': 2, 'col': 10, 'text': 'x'},
\ {'type': 'E', 'bufnr': 1, 'lnum': 3, 'col': 2, 'text': 'x'},
\ {'type': 'E', 'bufnr': 1, 'lnum': 5, 'col': 5, 'text': 'x'},
\ {'type': 'E', 'bufnr': -1, 'filename': 'b', 'lnum': 4, 'col': 2, 'text': 'x'},
\ {'type': 'E', 'bufnr': -1, 'filename': 'b', 'lnum': 5, 'col': 2, 'text': 'x'},
\ {'type': 'E', 'bufnr': 3, 'lnum': 1, 'col': 1, 'text': 'foo'},
\ ]},
\ '2': {'loclist': [
\ {'type': 'E', 'bufnr': 1, 'lnum': 2, 'col': 10, 'text': 'x'},
\ {'type': 'E', 'bufnr': 1, 'lnum': 5, 'col': 5, 'text': 'x'},
\ {'type': 'E', 'bufnr': 2, 'lnum': 1, 'col': 2, 'text': 'foo'},
\ {'type': 'E', 'bufnr': 1, 'lnum': 3, 'col': 2, 'text': 'x'},
\ {'type': 'E', 'bufnr': 1, 'lnum': 5, 'col': 4, 'text': 'x'},
\ {'type': 'E', 'bufnr': 2, 'lnum': 1, 'col': 5, 'text': 'bar'},
\ {'type': 'E', 'bufnr': 2, 'lnum': 5, 'col': 5, 'text': 'another error'},
\ ]},
\}
AssertEqual
\ [
\ {'type': 'E', 'bufnr': -1, 'filename': 'b', 'lnum': 4, 'col': 2, 'text': 'x'},
\ {'type': 'E', 'bufnr': -1, 'filename': 'b', 'lnum': 5, 'col': 2, 'text': 'x'},
\ {'type': 'E', 'bufnr': -1, 'filename': 'c', 'lnum': 3, 'col': 2, 'text': 'x'},
\ {'type': 'E', 'bufnr': 1, 'lnum': 2, 'col': 10, 'text': 'x'},
\ {'type': 'E', 'bufnr': 1, 'lnum': 3, 'col': 2, 'text': 'x'},
\ {'type': 'E', 'bufnr': 1, 'lnum': 5, 'col': 4, 'text': 'x'},
\ {'type': 'E', 'bufnr': 1, 'lnum': 5, 'col': 5, 'text': 'x'},
\ {'type': 'E', 'bufnr': 2, 'lnum': 1, 'col': 2, 'text': 'foo'},
\ {'type': 'E', 'bufnr': 2, 'lnum': 1, 'col': 5, 'text': 'bar'},
\ {'type': 'E', 'bufnr': 2, 'lnum': 5, 'col': 5, 'text': 'another error'},
\ {'type': 'E', 'bufnr': 2, 'lnum': 5, 'col': 5, 'text': 'foo'},
\ {'type': 'E', 'bufnr': 3, 'lnum': 1, 'col': 1, 'text': 'foo'},
\ ],
\ ale#list#GetCombinedList()
|