mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-16 01:07:06 +08:00
#653 Collect items for quickfix from all buffers, and de-duplicate them. Set filename items in quickfix and loclist.
This commit is contained in:
50
test/test_quickfix_deduplication.vader
Normal file
50
test/test_quickfix_deduplication.vader
Normal file
@@ -0,0 +1,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': [
|
||||
\ {'bufnr': 2, 'lnum': 1, 'col': 2, 'text': 'foo'},
|
||||
\ {'bufnr': 2, 'lnum': 1, 'col': 5, 'text': 'bar'},
|
||||
\ {'bufnr': -1, 'filename': 'c', 'lnum': 3, 'col': 2, 'text': 'x'},
|
||||
\ {'bufnr': 1, 'lnum': 5, 'col': 4, 'text': 'x'},
|
||||
\ {'bufnr': 2, 'lnum': 5, 'col': 5, 'text': 'foo'},
|
||||
\ {'bufnr': 1, 'lnum': 2, 'col': 10, 'text': 'x'},
|
||||
\ {'bufnr': 1, 'lnum': 3, 'col': 2, 'text': 'x'},
|
||||
\ {'bufnr': 1, 'lnum': 5, 'col': 5, 'text': 'x'},
|
||||
\ {'bufnr': -1, 'filename': 'b', 'lnum': 4, 'col': 2, 'text': 'x'},
|
||||
\ {'bufnr': -1, 'filename': 'b', 'lnum': 5, 'col': 2, 'text': 'x'},
|
||||
\ {'bufnr': 3, 'lnum': 1, 'col': 1, 'text': 'foo'},
|
||||
\ ]},
|
||||
\ '2': {'loclist': [
|
||||
\ {'bufnr': 1, 'lnum': 2, 'col': 10, 'text': 'x'},
|
||||
\ {'bufnr': 1, 'lnum': 5, 'col': 5, 'text': 'x'},
|
||||
\ {'bufnr': 2, 'lnum': 1, 'col': 2, 'text': 'foo'},
|
||||
\ {'bufnr': 1, 'lnum': 3, 'col': 2, 'text': 'x'},
|
||||
\ {'bufnr': 1, 'lnum': 5, 'col': 4, 'text': 'x'},
|
||||
\ {'bufnr': 2, 'lnum': 1, 'col': 5, 'text': 'bar'},
|
||||
\ {'bufnr': 2, 'lnum': 5, 'col': 5, 'text': 'another error'},
|
||||
\ ]},
|
||||
\}
|
||||
|
||||
AssertEqual
|
||||
\ [
|
||||
\ {'bufnr': -1, 'filename': 'b', 'lnum': 4, 'col': 2, 'text': 'x'},
|
||||
\ {'bufnr': -1, 'filename': 'b', 'lnum': 5, 'col': 2, 'text': 'x'},
|
||||
\ {'bufnr': -1, 'filename': 'c', 'lnum': 3, 'col': 2, 'text': 'x'},
|
||||
\ {'bufnr': 1, 'lnum': 2, 'col': 10, 'text': 'x'},
|
||||
\ {'bufnr': 1, 'lnum': 3, 'col': 2, 'text': 'x'},
|
||||
\ {'bufnr': 1, 'lnum': 5, 'col': 4, 'text': 'x'},
|
||||
\ {'bufnr': 1, 'lnum': 5, 'col': 5, 'text': 'x'},
|
||||
\ {'bufnr': 2, 'lnum': 1, 'col': 2, 'text': 'foo'},
|
||||
\ {'bufnr': 2, 'lnum': 1, 'col': 5, 'text': 'bar'},
|
||||
\ {'bufnr': 2, 'lnum': 5, 'col': 5, 'text': 'another error'},
|
||||
\ {'bufnr': 2, 'lnum': 5, 'col': 5, 'text': 'foo'},
|
||||
\ {'bufnr': 3, 'lnum': 1, 'col': 1, 'text': 'foo'},
|
||||
\ ],
|
||||
\ ale#list#GetCombinedList()
|
||||
Reference in New Issue
Block a user