From 2c7553a237784ea746c7a397e7df7fa91db23379 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Mon, 8 Mar 2021 12:06:55 +0100 Subject: suppress luacheck upshadowing warnings for the event handler code --- init.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/init.lua b/init.lua index 1a36fa8..145d21e 100644 --- a/init.lua +++ b/init.lua @@ -627,8 +627,9 @@ local function lspc_open(ls, win, file) ls.open_files[file.path] = {file = file, version = 0} ls_send_notification(ls, 'textDocument/didOpen', params) - vis.events.subscribe(vis.events.FILE_CLOSE, function(file) - for _, ls in pairs(lspc.running) do + vis.events.subscribe(vis.events.FILE_CLOSE, + function(file) -- luacheck: ignore file + for _, ls in pairs(lspc.running) do -- luacheck: ignore ls if ls.open_files[file.path] then lspc_close(ls, file) end @@ -637,10 +638,11 @@ local function lspc_open(ls, win, file) -- the server is interested in didSave notifications if ls.capabilities.textDocumentSync.save then - vis.events.subscribe(vis.events.FILE_SAVE_POST, function(file, path) - for _, ls in pairs(lspc.running) do + vis.events.subscribe(vis.events.FILE_SAVE_POST, + function(file, path) -- luacheck: ignore file + for _, ls in pairs(lspc.running) do -- luacheck: ignore ls if ls.open_files[file.path] then - local params = {textDocument = {uri = path_to_uri(path)}} + local params = {textDocument = {uri = path_to_uri(path)}} -- luacheck: ignore params ls_send_notification(ls, 'textDocument/didSave', params) end end -- cgit v1.2.3