diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-06-22 19:42:40 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-06-22 19:42:40 +0800 |
commit | d98dcf00478af9d16397ab11fc5e47a24f534c04 (patch) | |
tree | 5059f665188e1617471be601118e165e3dc28dd2 | |
parent | b3562693c86c30d6d762d1720e8660b9006273e0 (diff) | |
download | lua-language-server-d98dcf00478af9d16397ab11fc5e47a24f534c04.zip |
fix #179
-rw-r--r-- | script/workspace.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/script/workspace.lua b/script/workspace.lua index 8d869d9a..88d29431 100644 --- a/script/workspace.lua +++ b/script/workspace.lua @@ -199,9 +199,10 @@ function mt:isComplete() end function mt:isLuaFile(path) - local ext = path:extension():string() + local pathStr = path:string() for k, v in pairs(config.other.associations) do - if self:fileNameEq(ext, k:match('[^%*]+$')) then + k = k:gsub('^%*', '') + if self:fileNameEq(pathStr:sub(-#k), k) then if v == 'lua' then return true else @@ -209,7 +210,7 @@ function mt:isLuaFile(path) end end end - if self:fileNameEq(ext, '.lua') then + if self:fileNameEq(pathStr:sub(-4), '.lua') then return true end return false |