mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-06 12:44:23 +08:00
Fix 3207 - do not send didSave notification if not supported (#3930)
This commit is contained in:
@@ -90,6 +90,30 @@ Given foobar (Some imaginary filetype):
|
||||
Execute(Server should be notified on save):
|
||||
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"}],
|
||||
\ }],
|
||||
\ ],
|
||||
\ 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', {
|
||||
|
||||
Reference in New Issue
Block a user