From f02dd68c7c86378eeed3429a7c914b9441b2b795 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 1 Nov 2024 17:02:15 +0100 Subject: [PATCH] feat: make luacheck and typechecking happy --- lua/care/sources.lua | 2 +- lua/care/sources/path.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/care/sources.lua b/lua/care/sources.lua index 053ca75..b30b965 100644 --- a/lua/care/sources.lua +++ b/lua/care/sources.lua @@ -79,7 +79,7 @@ function care_sources.complete(context, source, callback) triggerKind = 1, } end - if source.incomplete and not context.reason == 3 then + if source.incomplete and context.reason ~= 3 then completion_context = { triggerKind = 3, } diff --git a/lua/care/sources/path.lua b/lua/care/sources/path.lua index 4514ebb..6683ef2 100644 --- a/lua/care/sources/path.lua +++ b/lua/care/sources/path.lua @@ -69,7 +69,7 @@ end local function get_candidates(dirname, options, callback) local fs, err = vim.uv.fs_scandir(dirname) - if err then + if err or not fs then return callback(err, nil) end