From f496305a500f8c3846c4898c06ee313bec25a59b Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Fri, 25 Aug 2023 11:45:10 +0200 Subject: adapt communicate API released with vis 0.9 --- init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index 1d848d6..4332a67 100644 --- a/init.lua +++ b/init.lua @@ -1180,16 +1180,16 @@ local function ls_start_server(syntax) lspc.running[ls_conf.name] = ls -- register the response handler - vis.events.subscribe(vis.events.PROCESS_RESPONSE, function(name, msg, event) + vis.events.subscribe(vis.events.PROCESS_RESPONSE, function(name, event, code, msg) if name ~= ls.name then return end if event == 'EXIT' or event == 'SIGNAL' then if event == 'EXIT' then - vis:info('language server exited with: ' .. msg) + vis:info('language server exited with: ' .. code) else - vis:info('language server received signal: ' .. msg) + vis:info('language server received signal: ' .. code) end lspc.running[ls.name] = nil -- cgit v1.2.3 From 15fbc713017dc6db6bdca7b16a2b9a3f4e201867 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Fri, 25 Aug 2023 11:57:03 +0200 Subject: use vis default formatting options Since vis 0.9 the options are exposed via the vis.options table. --- init.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'init.lua') diff --git a/init.lua b/init.lua index 4332a67..edb2b6c 100644 --- a/init.lua +++ b/init.lua @@ -1407,8 +1407,10 @@ vis:command_register('lspc-format', function(_, _, win) options = ls.formatting_options, } if params.options == nil then - -- probably a safe default, but this should be hooked up to the vis options - params.options = {tabSize = 4, insertSpaces = true} + params.options = { + tabSize = win.options.tabwidth, + insertSpaces = win.options.expandtab, + } end ls_call_text_document_method(ls, 'formatting', params, win) -- cgit v1.2.3