#333 Save sign IDs back on loclist items, and make it possible to get line numbers again

This commit is contained in:
w0rp
2017-03-11 20:33:29 +00:00
parent ca78e4c150
commit 4bf6784d7d
4 changed files with 53 additions and 50 deletions

View File

@@ -1,14 +1,14 @@
Execute (Parsing English signs should work):
AssertEqual [1000001], ale#sign#ParseSigns(['Signs for app.js:', ' line=9 id=1000001 name=ALEWarningSign'])
AssertEqual [[9, 1000001]], ale#sign#ParseSigns(['Signs for app.js:', ' line=9 id=1000001 name=ALEWarningSign'])
Execute (Parsing Russian signs should work):
AssertEqual [1000001], ale#sign#ParseSigns([' строка=1 id=1000001 имя=ALEErrorSign'])
AssertEqual [[1, 1000001]], ale#sign#ParseSigns([' строка=1 id=1000001 имя=ALEErrorSign'])
Execute (Parsing Japanese signs should work):
AssertEqual [1000001], ale#sign#ParseSigns([' 行=1 識別子=1000001 名前=ALEWarningSign'])
AssertEqual [[1, 1000001]], ale#sign#ParseSigns([' 行=1 識別子=1000001 名前=ALEWarningSign'])
Execute (Parsing Spanish signs should work):
AssertEqual [1000001], ale#sign#ParseSigns([' línea=12 id=1000001 nombre=ALEWarningSign'])
AssertEqual [[12, 1000001]], ale#sign#ParseSigns([' línea=12 id=1000001 nombre=ALEWarningSign'])
Execute (Parsing Italian signs should work):
AssertEqual [1000001], ale#sign#ParseSigns([' riga=1 id=1000001, nome=ALEWarningSign'])
AssertEqual [[1, 1000001]], ale#sign#ParseSigns([' riga=1 id=1000001, nome=ALEWarningSign'])

View File

@@ -85,7 +85,7 @@ Execute(ALEToggle should reset everything and then run again):
" First check that everything is there...
AssertEqual g:expected_loclist, getloclist(0)
AssertEqual [1000001], ale#sign#FindCurrentSigns(bufnr('%'))
AssertEqual [[2, 1000001]], ale#sign#FindCurrentSigns(bufnr('%'))
AssertEqual
\ [{'group': 'ALEError', 'pos1': [2, 3, 1]}],
\ map(getmatches(), '{''group'': v:val.group, ''pos1'': v:val.pos1}')
@@ -105,7 +105,7 @@ Execute(ALEToggle should reset everything and then run again):
call ale#engine#WaitForJobs(2000)
AssertEqual g:expected_loclist, getloclist(0)
AssertEqual [1000001], ale#sign#FindCurrentSigns(bufnr('%'))
AssertEqual [[2, 1000001]], ale#sign#FindCurrentSigns(bufnr('%'))
AssertEqual
\ [{'group': 'ALEError', 'pos1': [2, 3, 1]}],
\ map(getmatches(), '{''group'': v:val.group, ''pos1'': v:val.pos1}')

View File

@@ -13,6 +13,7 @@ Before:
\ 'type': 'W',
\ 'col': 10,
\ 'text': 'Infix operators must be spaced. [Warning/space-infix-ops]',
\ 'sign_id': 1000001,
\ },
\ {
\ 'lnum': 2,
@@ -23,6 +24,7 @@ Before:
\ 'type': 'E',
\ 'col': 10,
\ 'text': 'Missing semicolon. [Error/semi]',
\ 'sign_id': 1000002,
\ }
\]