Add textDocument/typeDefinition for LSP (#2226)

* Add textDocument/typeDefinition for LSP

Doc to spec https://microsoft.github.io/language-server-protocol/specification#textDocument_typeDefinition

This works like textDocument/definition but resolves a location of a
type of an expression under the cursor.

I'm not sure what to do with tsserver though.

* Fix passing column to LSP
* test_go_to_definition: wording
* Add tests for textDocument/typeDefinition
* Add docs for textDocument/typeDefinition
This commit is contained in:
Andrey Popp
2019-01-22 02:06:28 +03:00
committed by w0rp
parent a4932679b5
commit d0284f22ea
7 changed files with 201 additions and 16 deletions

View File

@@ -146,6 +146,20 @@ Execute(ale#lsp#message#Definition() should return correct messages):
\ ],
\ ale#lsp#message#Definition(bufnr(''), 12, 34)
Execute(ale#lsp#message#TypeDefinition() should return correct messages):
AssertEqual
\ [
\ 0,
\ 'textDocument/typeDefinition',
\ {
\ 'textDocument': {
\ 'uri': ale#path#ToURI(g:dir . '/foo/bar.ts'),
\ },
\ 'position': {'line': 11, 'character': 33},
\ }
\ ],
\ ale#lsp#message#TypeDefinition(bufnr(''), 12, 34)
Execute(ale#lsp#message#References() should return correct messages):
AssertEqual
\ [