From ed1b66bd998b98ee8cf76b5a23c323352588dd56 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Sun, 11 Feb 2024 12:37:20 +0000 Subject: refactor(lsp): move more code to client.lua The dispatchers used by the RPC client should be defined in the client, so they have been moved there. Due to this, it also made sense to move all code related to client configuration and the creation of the RPC client there too. Now vim.lsp.start_client is significantly simplified and now mostly contains logic for tracking open clients. - Renamed client.new -> client.start --- test/functional/plugin/lsp_spec.lua | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'test/functional') diff --git a/test/functional/plugin/lsp_spec.lua b/test/functional/plugin/lsp_spec.lua index ce76861b9a..fb153b83ca 100644 --- a/test/functional/plugin/lsp_spec.lua +++ b/test/functional/plugin/lsp_spec.lua @@ -139,30 +139,6 @@ describe('LSP', function() end) end) end) - - describe('lsp._cmd_parts test', function() - local function _cmd_parts(input) - return exec_lua( - [[ - lsp = require('vim.lsp') - return lsp._cmd_parts(...) - ]], - input - ) - end - it('should valid cmd argument', function() - eq(true, pcall(_cmd_parts, { 'nvim' })) - eq(true, pcall(_cmd_parts, { 'nvim', '--head' })) - end) - - it('should invalid cmd argument', function() - eq('.../lsp.lua:0: cmd: expected list, got nvim', pcall_err(_cmd_parts, 'nvim')) - eq( - '.../lsp.lua:0: cmd argument: expected string, got number', - pcall_err(_cmd_parts, { 'nvim', 1 }) - ) - end) - end) end) describe('LSP', function() -- cgit