mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
#517 Add more code LSP support which makes the tssserver linter behave more like the LSP linters
This commit is contained in:
@@ -10,7 +10,7 @@ After:
|
||||
delfunction Range
|
||||
|
||||
Execute(ale#lsp#response#ReadDiagnostics() should handle errors):
|
||||
AssertEqual ['filename.ts', [
|
||||
AssertEqual [
|
||||
\ {
|
||||
\ 'type': 'E',
|
||||
\ 'text': 'Something went wrong!',
|
||||
@@ -20,18 +20,18 @@ Execute(ale#lsp#response#ReadDiagnostics() should handle errors):
|
||||
\ 'end_col': 16,
|
||||
\ 'nr': 'some-error',
|
||||
\ }
|
||||
\ ]],
|
||||
\ ale#lsp#response#ReadDiagnostics({'uri': 'filename.ts', 'diagnostics': [
|
||||
\ ],
|
||||
\ ale#lsp#response#ReadDiagnostics({'params': {'uri': 'filename.ts', 'diagnostics': [
|
||||
\ {
|
||||
\ 'severity': 1,
|
||||
\ 'range': Range(2, 10, 4, 15),
|
||||
\ 'code': 'some-error',
|
||||
\ 'message': 'Something went wrong!',
|
||||
\ },
|
||||
\ ]})
|
||||
\ ]}})
|
||||
|
||||
Execute(ale#lsp#response#ReadDiagnostics() should handle warnings):
|
||||
AssertEqual ['filename.ts', [
|
||||
AssertEqual [
|
||||
\ {
|
||||
\ 'type': 'W',
|
||||
\ 'text': 'Something went wrong!',
|
||||
@@ -41,18 +41,18 @@ Execute(ale#lsp#response#ReadDiagnostics() should handle warnings):
|
||||
\ 'end_col': 4,
|
||||
\ 'nr': 'some-warning',
|
||||
\ }
|
||||
\ ]],
|
||||
\ ale#lsp#response#ReadDiagnostics({'uri': 'filename.ts', 'diagnostics': [
|
||||
\ ],
|
||||
\ ale#lsp#response#ReadDiagnostics({'params': {'uri': 'filename.ts', 'diagnostics': [
|
||||
\ {
|
||||
\ 'severity': 2,
|
||||
\ 'range': Range(1, 3, 1, 3),
|
||||
\ 'code': 'some-warning',
|
||||
\ 'message': 'Something went wrong!',
|
||||
\ },
|
||||
\ ]})
|
||||
\ ]}})
|
||||
|
||||
Execute(ale#lsp#response#ReadDiagnostics() should treat messages with missing severity as errors):
|
||||
AssertEqual ['filename.ts', [
|
||||
AssertEqual [
|
||||
\ {
|
||||
\ 'type': 'E',
|
||||
\ 'text': 'Something went wrong!',
|
||||
@@ -62,17 +62,17 @@ Execute(ale#lsp#response#ReadDiagnostics() should treat messages with missing se
|
||||
\ 'end_col': 16,
|
||||
\ 'nr': 'some-error',
|
||||
\ }
|
||||
\ ]],
|
||||
\ ale#lsp#response#ReadDiagnostics({'uri': 'filename.ts', 'diagnostics': [
|
||||
\ ],
|
||||
\ ale#lsp#response#ReadDiagnostics({'params': {'uri': 'filename.ts', 'diagnostics': [
|
||||
\ {
|
||||
\ 'range': Range(2, 10, 4, 15),
|
||||
\ 'code': 'some-error',
|
||||
\ 'message': 'Something went wrong!',
|
||||
\ },
|
||||
\ ]})
|
||||
\ ]}})
|
||||
|
||||
Execute(ale#lsp#response#ReadDiagnostics() should handle messages without codes):
|
||||
AssertEqual ['filename.ts', [
|
||||
AssertEqual [
|
||||
\ {
|
||||
\ 'type': 'E',
|
||||
\ 'text': 'Something went wrong!',
|
||||
@@ -81,16 +81,16 @@ Execute(ale#lsp#response#ReadDiagnostics() should handle messages without codes)
|
||||
\ 'end_lnum': 5,
|
||||
\ 'end_col': 16,
|
||||
\ }
|
||||
\ ]],
|
||||
\ ale#lsp#response#ReadDiagnostics({'uri': 'filename.ts', 'diagnostics': [
|
||||
\ ],
|
||||
\ ale#lsp#response#ReadDiagnostics({'params': {'uri': 'filename.ts', 'diagnostics': [
|
||||
\ {
|
||||
\ 'range': Range(2, 10, 4, 15),
|
||||
\ 'message': 'Something went wrong!',
|
||||
\ },
|
||||
\ ]})
|
||||
\ ]}})
|
||||
|
||||
Execute(ale#lsp#response#ReadDiagnostics() should handle multiple messages):
|
||||
AssertEqual ['filename.ts', [
|
||||
AssertEqual [
|
||||
\ {
|
||||
\ 'type': 'E',
|
||||
\ 'text': 'Something went wrong!',
|
||||
@@ -107,8 +107,8 @@ Execute(ale#lsp#response#ReadDiagnostics() should handle multiple messages):
|
||||
\ 'end_lnum': 2,
|
||||
\ 'end_col': 5,
|
||||
\ },
|
||||
\ ]],
|
||||
\ ale#lsp#response#ReadDiagnostics({'uri': 'filename.ts', 'diagnostics': [
|
||||
\ ],
|
||||
\ ale#lsp#response#ReadDiagnostics({'params': {'uri': 'filename.ts', 'diagnostics': [
|
||||
\ {
|
||||
\ 'range': Range(0, 2, 0, 2),
|
||||
\ 'message': 'Something went wrong!',
|
||||
@@ -118,7 +118,7 @@ Execute(ale#lsp#response#ReadDiagnostics() should handle multiple messages):
|
||||
\ 'range': Range(1, 4, 1, 4),
|
||||
\ 'message': 'A warning',
|
||||
\ },
|
||||
\ ]})
|
||||
\ ]}})
|
||||
|
||||
Execute(ale#lsp#response#ReadTSServerDiagnostics() should handle tsserver responses):
|
||||
AssertEqual [
|
||||
|
||||
Reference in New Issue
Block a user