diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-07-07 09:30:43 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-07-07 09:30:43 +0800 |
commit | 38f1e8ef764d4016dcaf788efa07765f7ac961cd (patch) | |
tree | 0e028471db4e8de0c1a705b64b0a0ac73ce59bb0 /script | |
parent | d4281c472d88b4c69ea1f2c76703a974aca940c2 (diff) | |
download | lua-language-server-38f1e8ef764d4016dcaf788efa07765f7ac961cd.zip |
typo
Diffstat (limited to 'script')
-rw-r--r-- | script/files.lua | 4 | ||||
-rw-r--r-- | script/filewatch.lua | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/script/files.lua b/script/files.lua index 1961a4d4..5af29830 100644 --- a/script/files.lua +++ b/script/files.lua @@ -56,8 +56,8 @@ local uriMap = {} function m.getRealUri(uri) local filename = furi.decode(uri) local path = fs.path(filename) - local suc, exsits = pcall(fs.exists, path) - if not suc or not exsits then + local suc, exists = pcall(fs.exists, path) + if not suc or not exists then return uri end local suc, res = pcall(fs.canonical, path) diff --git a/script/filewatch.lua b/script/filewatch.lua index 1d75d1b3..81e0dab9 100644 --- a/script/filewatch.lua +++ b/script/filewatch.lua @@ -5,10 +5,10 @@ local await = require 'await' local MODIFY = 1 << 0 local RENAME = 1 << 1 -local function exists(filename) +local function isExists(filename) local path = fs.path(filename) - local suc, exsits = pcall(fs.exists, path) - if not suc or not exsits then + local suc, exists = pcall(fs.exists, path) + if not suc or not exists then return false end local suc, res = pcall(fs.canonical, path) @@ -85,7 +85,7 @@ function m.update() for path, flag in pairs(collect) do if flag & RENAME ~= 0 then - if exists(path) then + if isExists(path) then m._callEvent('create', path) else m._callEvent('delete', path) |