From 641c0c797ba5dc4adac199fca4015d833a7e1f61 Mon Sep 17 00:00:00 2001 From: Ben Falconer Date: Wed, 6 Jun 2018 16:59:44 +0100 Subject: [PATCH] Pass rootUri to LSPs in addition to rootPath --- autoload/ale/lsp/message.vim | 2 ++ test/lsp/test_lsp_client_messages.vader | 1 + 2 files changed, 3 insertions(+) diff --git a/autoload/ale/lsp/message.vim b/autoload/ale/lsp/message.vim index 1c0499dc..9e05156d 100644 --- a/autoload/ale/lsp/message.vim +++ b/autoload/ale/lsp/message.vim @@ -26,11 +26,13 @@ endfunction function! ale#lsp#message#Initialize(root_path, initialization_options) abort " TODO: Define needed capabilities. + " NOTE: rootPath is deprecated in favour of rootUri return [0, 'initialize', { \ 'processId': getpid(), \ 'rootPath': a:root_path, \ 'capabilities': {}, \ 'initializationOptions': a:initialization_options, + \ 'rootUri': ale#path#ToURI(a:root_path), \}] endfunction diff --git a/test/lsp/test_lsp_client_messages.vader b/test/lsp/test_lsp_client_messages.vader index e7eda33a..dc28c2e9 100644 --- a/test/lsp/test_lsp_client_messages.vader +++ b/test/lsp/test_lsp_client_messages.vader @@ -17,6 +17,7 @@ Execute(ale#lsp#message#Initialize() should return correct messages): \ 'rootPath': '/foo/bar', \ 'capabilities': {}, \ 'initializationOptions': {'foo': 'bar'}, + \ 'rootUri': 'file:///foo/bar', \ } \ ], \ ale#lsp#message#Initialize('/foo/bar', {'foo': 'bar'})