Handle empty buffer-name (#730)

This commit is contained in:
mattn
2020-02-28 15:12:17 +09:00
committed by GitHub
parent 80ec75e1da
commit b2b3199f05
+7 -1
View File
@@ -601,6 +601,12 @@ function! s:ensure_changed(buf, server_name, cb) abort
let l:path = lsp#utils#get_buffer_uri(a:buf)
let l:buffers = l:server['buffers']
if !has_key(l:buffers, l:path)
let l:msg = s:new_rpc_success('file is not managed', { 'server_name': a:server_name, 'path': l:path })
call lsp#log(l:msg)
call a:cb(l:msg)
return
endif
let l:buffer_info = l:buffers[l:path]
let l:changed_tick = getbufvar(a:buf, 'changedtick')
@@ -634,7 +640,7 @@ function! s:ensure_open(buf, server_name, cb) abort
let l:path = lsp#utils#get_buffer_uri(a:buf)
if empty(l:path)
let l:msg = s:new_rpc_error('ignore open since not a valid uri', { 'server_name': a:server_name, 'path': l:path })
let l:msg = s:new_rpc_success('ignore open since not a valid uri', { 'server_name': a:server_name, 'path': l:path })
call lsp#log(l:msg)
call a:cb(l:msg)
return