aboutsummaryrefslogtreecommitdiff
path: root/settings/rust-analyzer.vim
diff options
context:
space:
mode:
authorYasuhiro Matsumoto <mattn.jp@gmail.com>2020-03-02 09:30:46 +0900
committerYasuhiro Matsumoto <mattn.jp@gmail.com>2020-03-02 09:30:46 +0900
commitb93a7cf76b01219ab3e5ea58623f7f3afdfc7dc6 (patch)
tree4f92a341ed8ace90f550d0cb8b072e642ededb84 /settings/rust-analyzer.vim
parentf9a2fa867bb8cc14b09a1dc40ad06d0224d45d10 (diff)
downloadvim-lsp-settings-b93a7cf76b01219ab3e5ea58623f7f3afdfc7dc6.tar.gz
vim-lsp-settings-b93a7cf76b01219ab3e5ea58623f7f3afdfc7dc6.tar.bz2
vim-lsp-settings-b93a7cf76b01219ab3e5ea58623f7f3afdfc7dc6.zip
Fix for review
Diffstat (limited to 'settings/rust-analyzer.vim')
-rw-r--r--settings/rust-analyzer.vim9
1 files changed, 6 insertions, 3 deletions
diff --git a/settings/rust-analyzer.vim b/settings/rust-analyzer.vim
index 14dd9d9..223b4d9 100644
--- a/settings/rust-analyzer.vim
+++ b/settings/rust-analyzer.vim
@@ -17,14 +17,17 @@ augroup END
function! s:rust_analyzer_apply_source_change(context)
let l:command = get(a:context, 'command', {})
- let l:workspace_edit = get(l:command['arguments'][0], 'workspaceEdit', {})
+ let l:arguments = get(l:command, 'arguments', [])
+ let l:argument = get(l:arguments, 0, {})
+
+ let l:workspace_edit = get(l:argument, 'workspaceEdit', {})
if !empty(l:workspace_edit)
call lsp#utils#workspace_edit#apply_workspace_edit(l:workspace_edit)
endif
- let l:cursor_position = get(l:command['arguments'][0], 'cursorPosition', {})
+ let l:cursor_position = get(l:argument, 'cursorPosition', {})
if !empty(l:cursor_position)
- call cursor(lsp#utils#position#_lsp_to_vim('%', l:cursor_position))
+ call cursor(lsp#utils#position#lsp_to_vim('%', l:cursor_position))
endif
endfunction