diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-11-25 15:53:04 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-11-25 15:53:04 +0800 |
commit | 672bec919c9199b9d70856b04620a05f3a03bf58 (patch) | |
tree | 40455a1c5ba21eb9fd1c0cd59fdf7e4cfc182556 /script | |
parent | 33caa5104855dec19a278f0feadc7bab2c4fbbcd (diff) | |
download | lua-language-server-672bec919c9199b9d70856b04620a05f3a03bf58.zip |
#269 workspace.library should be normalized first
Diffstat (limited to 'script')
-rw-r--r-- | script/workspace/workspace.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua index c5744666..31828245 100644 --- a/script/workspace/workspace.lua +++ b/script/workspace/workspace.lua @@ -134,10 +134,10 @@ function m.getLibraryMatchers() local librarys = {} for path, pattern in pairs(config.config.workspace.library) do - librarys[path] = pattern + librarys[m.normalize(path)] = pattern end if library.metaPath then - librarys[library.metaPath] = true + librarys[m.normalize(library.metaPath)] = true end m.libraryMatchers = {} for path, pattern in pairs(librarys) do @@ -294,11 +294,13 @@ end function m.normalize(path) if platform.OS == 'Windows' then path = path:gsub('[/\\]+', '\\') + :gsub('[/\\]+$', '') :gsub('^%a+%:', function (str) return str:upper() end) else path = path:gsub('[/\\]+', '/') + :gsub('[/\\]+$', '') end return path:gsub('^[/\\]+', '') end |