]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Changed default value of missing workspaceConfig from [{}] to [null]
authorDaniel Viberg <daniel_viberg@outlook.com>
Tue, 19 Dec 2023 13:58:43 +0000 (14:58 +0100)
committerDaniel Viberg <daniel_viberg@outlook.com>
Tue, 19 Dec 2023 13:58:43 +0000 (14:58 +0100)
autoload/lsp/handlers.vim

index 2ecf525e21ef22e71411736327047ba8b99b58da..d92109995b491ac8bb2ffc91e4ca8e37735143b7 100644 (file)
@@ -171,6 +171,15 @@ enddef
 def ProcessWorkspaceConfiguration(lspserver: dict<any>, request: dict<any>)
   var items = request.params.items
   var response = items->map((_, item) => lspserver.workspaceConfigGet(item))
+  
+  # Server expect null value if no config is given
+  # TODO: Proper null return from workspaceConfigGet if no config is found
+  if response->type() == v:t_list 
+    && response[0]->type() == v:t_dict
+    && response[0] == null_dict
+    response[0] = null 
+  endif
+
   lspserver.sendResponse(request, response, {})
 enddef