diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-12-16 17:30:34 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-12-16 17:30:34 +0800 |
commit | 45408dd0e60d16b84a384080bb8a39f871640006 (patch) | |
tree | b108c56f26dd0d9d03015e6f7e0379af2f9475ee /script/workspace/workspace.lua | |
parent | 5bf01cf4db455da812a56d48251786d2da5355aa (diff) | |
download | lua-language-server-45408dd0e60d16b84a384080bb8a39f871640006.zip |
#306
Diffstat (limited to 'script/workspace/workspace.lua')
-rw-r--r-- | script/workspace/workspace.lua | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua index 10e4b2c9..fc6e90bd 100644 --- a/script/workspace/workspace.lua +++ b/script/workspace/workspace.lua @@ -144,16 +144,18 @@ function m.getLibraryMatchers() end m.libraryMatchers = {} for path, pattern in pairs(librarys) do - local nPath = fs.absolute(fs.path(path)):string() - local matcher = glob.gitignore(pattern, m.matchOption) - if platform.OS == 'Windows' then - matcher:setOption 'ignoreCase' + if fs.exists(fs.path(path)) then + local nPath = fs.absolute(fs.path(path)):string() + local matcher = glob.gitignore(pattern, m.matchOption) + if platform.OS == 'Windows' then + matcher:setOption 'ignoreCase' + end + log.debug('getLibraryMatchers', path, nPath) + m.libraryMatchers[#m.libraryMatchers+1] = { + path = nPath, + matcher = matcher + } end - log.debug('getLibraryMatchers', path, nPath) - m.libraryMatchers[#m.libraryMatchers+1] = { - path = nPath, - matcher = matcher - } end m.libraryVersion = config.version |