]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
fix: codeaction command of cmd maybe not existed
authorshane.xb.qian <shane.qian@foxmail.com>
Thu, 12 Jan 2023 06:46:47 +0000 (14:46 +0800)
committershane.xb.qian <shane.qian@foxmail.com>
Thu, 12 Jan 2023 06:46:47 +0000 (14:46 +0800)
autoload/lsp/codeaction.vim

index 213460be94290678f112257dadf89b8ffc0f31a5..5a34d908c7c2d8303434200c4ecd2b0d123875da 100644 (file)
@@ -13,7 +13,7 @@ export def RegisterCmdHandler(cmd: string, Handler: func)
 enddef
 
 def DoCommand(lspserver: dict<any>, cmd: dict<any>)
-  if CommandHandlers->has_key(cmd.command)
+  if cmd->has_key('command') && CommandHandlers->has_key(cmd.command)
     var CmdHandler: func = CommandHandlers[cmd.command]
     call CmdHandler(cmd)
   else