diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-10-27 17:20:57 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-10-27 17:20:57 +0800 |
commit | f26bf237e49f90799fc3ff6ef0c0edc19c6ae9cb (patch) | |
tree | 38a9978538b6b70e94015167175e5dd1a8972c38 /script-beta | |
parent | d3acd3d9c4abe2349a6cd818415dabfdce835619 (diff) | |
download | lua-language-server-f26bf237e49f90799fc3ff6ef0c0edc19c6ae9cb.zip |
先判个类型
Diffstat (limited to 'script-beta')
-rw-r--r-- | script-beta/workspace/workspace.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/script-beta/workspace/workspace.lua b/script-beta/workspace/workspace.lua index bf930a5d..d2a0637f 100644 --- a/script-beta/workspace/workspace.lua +++ b/script-beta/workspace/workspace.lua @@ -195,6 +195,9 @@ end --- 查找符合指定file path的所有uri ---@param path string function m.findUrisByFilePath(path) + if type(path) ~= 'string' then + return {} + end local results = {} local posts = {} for uri in files.eachFile() do @@ -215,6 +218,9 @@ end --- 查找符合指定require path的所有uri ---@param path string function m.findUrisByRequirePath(path) + if type(path) ~= 'string' then + return {} + end local results = {} local mark = {} local searchers = {} |