diff options
author | Jerko Steiner <jerko.steiner@gmail.com> | 2019-09-13 03:53:23 +0700 |
---|---|---|
committer | w0rp <w0rp@users.noreply.github.com> | 2019-09-12 21:53:23 +0100 |
commit | 3e8c8d3ccbead8a6540b782686ab3751361a4ec1 (patch) | |
tree | 464f0eb87327ec02dd7818074ac8eed5c71f83d5 /test/completion/test_lsp_completion_messages.vader | |
parent | b66d202c1dfc1354d09f8d5eacef54404e9b2c57 (diff) | |
download | ale-3e8c8d3ccbead8a6540b782686ab3751361a4ec1.zip |
Add ALERename (tsserver & LSP), ALEOrganizeImports (tsserver) and auto import support (tsserver) (#2709)
This commit adds support for renaming symbols in tsserver and with LSP tools, and for organising imports with tsserver. Completion results for symbols that can be imported are now suggested if enabled for tsserver completion done via ALE.
Diffstat (limited to 'test/completion/test_lsp_completion_messages.vader')
-rw-r--r-- | test/completion/test_lsp_completion_messages.vader | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/test/completion/test_lsp_completion_messages.vader b/test/completion/test_lsp_completion_messages.vader index 6bd241a8..b997ac86 100644 --- a/test/completion/test_lsp_completion_messages.vader +++ b/test/completion/test_lsp_completion_messages.vader @@ -116,7 +116,13 @@ Execute(The right message should be sent for the initial tsserver request): \ string(g:Callback) " We should send the right message. AssertEqual - \ [[0, 'ts@completions', {'file': expand('%:p'), 'line': 1, 'offset': 3, 'prefix': 'fo'}]], + \ [[0, 'ts@completions', { + \ 'file': expand('%:p'), + \ 'line': 1, + \ 'offset': 3, + \ 'prefix': 'fo', + \ 'includeExternalModuleExports': g:ale_completion_tsserver_autoimport, + \ }]], \ g:message_list " We should set up the completion info correctly. AssertEqual @@ -151,7 +157,7 @@ Execute(The right message sent to the tsserver LSP when the first completion mes \ 'body': [ \ {'name': 'Baz'}, \ {'name': 'dingDong'}, - \ {'name': 'Foo'}, + \ {'name': 'Foo', 'source': '/path/to/foo.ts'}, \ {'name': 'FooBar'}, \ {'name': 'frazzle'}, \ {'name': 'FFS'}, @@ -160,8 +166,16 @@ Execute(The right message sent to the tsserver LSP when the first completion mes " We should save the names we got in the buffer, as TSServer doesn't return " details for every name. - AssertEqual - \ ['Foo', 'FooBar', 'frazzle'], + AssertEqual [{ + \ 'word': 'Foo', + \ 'source': '/path/to/foo.ts', + \ }, { + \ 'word': 'FooBar', + \ 'source': '', + \ }, { + \ 'word': 'frazzle', + \ 'source': '', + \}], \ get(b:, 'ale_tsserver_completion_names', []) " The entry details messages should have been sent. @@ -171,7 +185,16 @@ Execute(The right message sent to the tsserver LSP when the first completion mes \ 'ts@completionEntryDetails', \ { \ 'file': expand('%:p'), - \ 'entryNames': ['Foo', 'FooBar', 'frazzle'], + \ 'entryNames': [{ + \ 'name': 'Foo', + \ 'source': '/path/to/foo.ts', + \ }, { + \ 'name': 'FooBar', + \ 'source': '', + \ }, { + \ 'name': 'frazzle', + \ 'source': '', + \ }], \ 'offset': 1, \ 'line': 1, \ }, |