mirror of
https://github.com/dense-analysis/ale
synced 2025-03-02 03:11:26 +00:00
Merge pull request #2223 from andreypopp/andreypopp/lsp-diagnostics-end
End position in LSP range is exclusive
This commit is contained in:
commit
37107df6f3
@ -33,7 +33,7 @@ function! ale#lsp#response#ReadDiagnostics(response) abort
|
|||||||
\ 'lnum': l:diagnostic.range.start.line + 1,
|
\ 'lnum': l:diagnostic.range.start.line + 1,
|
||||||
\ 'col': l:diagnostic.range.start.character + 1,
|
\ 'col': l:diagnostic.range.start.character + 1,
|
||||||
\ 'end_lnum': l:diagnostic.range.end.line + 1,
|
\ 'end_lnum': l:diagnostic.range.end.line + 1,
|
||||||
\ 'end_col': l:diagnostic.range.end.character + 1,
|
\ 'end_col': l:diagnostic.range.end.character,
|
||||||
\}
|
\}
|
||||||
|
|
||||||
if l:severity == s:SEVERITY_WARNING
|
if l:severity == s:SEVERITY_WARNING
|
||||||
|
@ -17,7 +17,7 @@ Execute(ale#lsp#response#ReadDiagnostics() should handle errors):
|
|||||||
\ 'lnum': 3,
|
\ 'lnum': 3,
|
||||||
\ 'col': 11,
|
\ 'col': 11,
|
||||||
\ 'end_lnum': 5,
|
\ 'end_lnum': 5,
|
||||||
\ 'end_col': 16,
|
\ 'end_col': 15,
|
||||||
\ 'code': 'some-error',
|
\ 'code': 'some-error',
|
||||||
\ }
|
\ }
|
||||||
\ ],
|
\ ],
|
||||||
@ -38,7 +38,7 @@ Execute(ale#lsp#response#ReadDiagnostics() should handle warnings):
|
|||||||
\ 'lnum': 2,
|
\ 'lnum': 2,
|
||||||
\ 'col': 4,
|
\ 'col': 4,
|
||||||
\ 'end_lnum': 2,
|
\ 'end_lnum': 2,
|
||||||
\ 'end_col': 4,
|
\ 'end_col': 3,
|
||||||
\ 'code': 'some-warning',
|
\ 'code': 'some-warning',
|
||||||
\ }
|
\ }
|
||||||
\ ],
|
\ ],
|
||||||
@ -59,7 +59,7 @@ Execute(ale#lsp#response#ReadDiagnostics() should treat messages with missing se
|
|||||||
\ 'lnum': 3,
|
\ 'lnum': 3,
|
||||||
\ 'col': 11,
|
\ 'col': 11,
|
||||||
\ 'end_lnum': 5,
|
\ 'end_lnum': 5,
|
||||||
\ 'end_col': 16,
|
\ 'end_col': 15,
|
||||||
\ 'code': 'some-error',
|
\ 'code': 'some-error',
|
||||||
\ }
|
\ }
|
||||||
\ ],
|
\ ],
|
||||||
@ -79,7 +79,7 @@ Execute(ale#lsp#response#ReadDiagnostics() should handle messages without codes)
|
|||||||
\ 'lnum': 3,
|
\ 'lnum': 3,
|
||||||
\ 'col': 11,
|
\ 'col': 11,
|
||||||
\ 'end_lnum': 5,
|
\ 'end_lnum': 5,
|
||||||
\ 'end_col': 16,
|
\ 'end_col': 15,
|
||||||
\ }
|
\ }
|
||||||
\ ],
|
\ ],
|
||||||
\ ale#lsp#response#ReadDiagnostics({'params': {'uri': 'filename.ts', 'diagnostics': [
|
\ ale#lsp#response#ReadDiagnostics({'params': {'uri': 'filename.ts', 'diagnostics': [
|
||||||
@ -98,7 +98,7 @@ Execute(ale#lsp#response#ReadDiagnostics() should include sources in detail):
|
|||||||
\ 'lnum': 10,
|
\ 'lnum': 10,
|
||||||
\ 'col': 15,
|
\ 'col': 15,
|
||||||
\ 'end_lnum': 12,
|
\ 'end_lnum': 12,
|
||||||
\ 'end_col': 23,
|
\ 'end_col': 22,
|
||||||
\ }
|
\ }
|
||||||
\ ],
|
\ ],
|
||||||
\ ale#lsp#response#ReadDiagnostics({'params': {'uri': 'filename.ts', 'diagnostics': [
|
\ ale#lsp#response#ReadDiagnostics({'params': {'uri': 'filename.ts', 'diagnostics': [
|
||||||
@ -117,7 +117,7 @@ Execute(ale#lsp#response#ReadDiagnostics() should consider -1 to be a meaningles
|
|||||||
\ 'lnum': 3,
|
\ 'lnum': 3,
|
||||||
\ 'col': 11,
|
\ 'col': 11,
|
||||||
\ 'end_lnum': 5,
|
\ 'end_lnum': 5,
|
||||||
\ 'end_col': 16,
|
\ 'end_col': 15,
|
||||||
\ }
|
\ }
|
||||||
\ ],
|
\ ],
|
||||||
\ ale#lsp#response#ReadDiagnostics({'params': {'uri': 'filename.ts', 'diagnostics': [
|
\ ale#lsp#response#ReadDiagnostics({'params': {'uri': 'filename.ts', 'diagnostics': [
|
||||||
@ -136,7 +136,7 @@ Execute(ale#lsp#response#ReadDiagnostics() should handle multiple messages):
|
|||||||
\ 'lnum': 1,
|
\ 'lnum': 1,
|
||||||
\ 'col': 3,
|
\ 'col': 3,
|
||||||
\ 'end_lnum': 1,
|
\ 'end_lnum': 1,
|
||||||
\ 'end_col': 3,
|
\ 'end_col': 2,
|
||||||
\ },
|
\ },
|
||||||
\ {
|
\ {
|
||||||
\ 'type': 'W',
|
\ 'type': 'W',
|
||||||
@ -144,7 +144,7 @@ Execute(ale#lsp#response#ReadDiagnostics() should handle multiple messages):
|
|||||||
\ 'lnum': 2,
|
\ 'lnum': 2,
|
||||||
\ 'col': 5,
|
\ 'col': 5,
|
||||||
\ 'end_lnum': 2,
|
\ 'end_lnum': 2,
|
||||||
\ 'end_col': 5,
|
\ 'end_col': 4,
|
||||||
\ },
|
\ },
|
||||||
\ ],
|
\ ],
|
||||||
\ ale#lsp#response#ReadDiagnostics({'params': {'uri': 'filename.ts', 'diagnostics': [
|
\ ale#lsp#response#ReadDiagnostics({'params': {'uri': 'filename.ts', 'diagnostics': [
|
||||||
@ -167,7 +167,7 @@ Execute(ale#lsp#response#ReadDiagnostics() should use relatedInformation for det
|
|||||||
\ 'lnum': 1,
|
\ 'lnum': 1,
|
||||||
\ 'col': 3,
|
\ 'col': 3,
|
||||||
\ 'end_lnum': 1,
|
\ 'end_lnum': 1,
|
||||||
\ 'end_col': 3,
|
\ 'end_col': 2,
|
||||||
\ 'detail': "Something went wrong!\n/tmp/someotherfile.txt:43:80:\n\tmight be this"
|
\ 'detail': "Something went wrong!\n/tmp/someotherfile.txt:43:80:\n\tmight be this"
|
||||||
\ }
|
\ }
|
||||||
\ ],
|
\ ],
|
||||||
|
@ -242,7 +242,7 @@ Execute(Buffer ignore lists should be applied for LSP linters):
|
|||||||
\ 'lnum': 1,
|
\ 'lnum': 1,
|
||||||
\ 'col': 10,
|
\ 'col': 10,
|
||||||
\ 'type': 'E',
|
\ 'type': 'E',
|
||||||
\ 'end_col': 10,
|
\ 'end_col': 9,
|
||||||
\ 'end_lnum': 1,
|
\ 'end_lnum': 1,
|
||||||
\ 'text': 'x',
|
\ 'text': 'x',
|
||||||
\ }
|
\ }
|
||||||
|
Loading…
Reference in New Issue
Block a user