Merge pull request #2849 from DonnieWest/excludeTsserverWarnings

Allow the user to remove warnings from completions
This commit is contained in:
w0rp
2020-08-09 01:32:27 +01:00
committed by GitHub
3 changed files with 65 additions and 5 deletions

View File

@@ -29,6 +29,51 @@ Execute(TypeScript completions responses should be parsed correctly):
\ ],
\})
Execute(TypeScript completions responses should include warnings):
AssertEqual
\ [
\ {
\ 'word': 'foo',
\ 'source': '/path/to/foo.ts',
\ },
\ {
\ 'word': 'bar',
\ 'source': '',
\ },
\ {
\ 'word': 'baz',
\ 'source': '',
\ }
\ ],
\ ale#completion#ParseTSServerCompletions({
\ 'body': [
\ {'name': 'foo', 'source': '/path/to/foo.ts'},
\ {'name': 'bar', 'kind': 'warning'},
\ {'name': 'baz'},
\ ],
\})
Execute(TypeScript completions responses should not include warnings if excluded):
let g:ale_completion_tsserver_remove_warnings = 1
AssertEqual
\ [
\ {
\ 'word': 'foo',
\ 'source': '/path/to/foo.ts',
\ },
\ {
\ 'word': 'baz',
\ 'source': '',
\ }
\ ],
\ ale#completion#ParseTSServerCompletions({
\ 'body': [
\ {'name': 'foo', 'source': '/path/to/foo.ts'},
\ {'name': 'bar', 'kind': 'warning'},
\ {'name': 'baz'},
\ ],
\})
Execute(TypeScript completion details responses should be parsed correctly):
AssertEqual
\ [