summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/lsp/test_did_save_event.vader24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/lsp/test_did_save_event.vader b/test/lsp/test_did_save_event.vader
index 1d811363..fbec10e5 100644
--- a/test/lsp/test_did_save_event.vader
+++ b/test/lsp/test_did_save_event.vader
@@ -99,6 +99,30 @@ Execute(Server should be notified on save):
\ },
\ 'contentChanges': [{'text': join(getline(1, '$'), "\n") . "\n"}],
\ }],
+ \ ],
+ \ g:message_list
+
+Execute(Server should be notified on save with didSave is supported by server):
+
+ " Replace has capability function to simulate didSave server capability
+ function! ale#lsp#HasCapability(conn_id, capability) abort
+ if a:capability == 'did_save'
+ return 1
+ endif
+ return 0
+ endfunction
+
+ call ale#events#SaveEvent(bufnr(''))
+
+ AssertEqual
+ \ [
+ \ [1, 'textDocument/didChange', {
+ \ 'textDocument': {
+ \ 'uri': ale#path#ToURI(expand('%:p')),
+ \ 'version': g:ale_lsp_next_version_id - 1,
+ \ },
+ \ 'contentChanges': [{'text': join(getline(1, '$'), "\n") . "\n"}],
+ \ }],
\ [1, 'textDocument/didSave', {
\ 'textDocument': {
\ 'uri': ale#path#ToURI(expand('%:p')),