diff options
Diffstat (limited to 'server/src')
-rw-r--r-- | server/src/service.lua | 2 | ||||
-rw-r--r-- | server/src/workspace.lua | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/server/src/service.lua b/server/src/service.lua index d88753f1..0026fb05 100644 --- a/server/src/service.lua +++ b/server/src/service.lua @@ -177,7 +177,7 @@ function mt:isLua(uri) if not self.workspace then return true end - local path = self.workspace:relativePathByUri(uri) + local path = self.workspace:absolutePathByUri(uri) if self.workspace:isLuaFile(path) then return true end diff --git a/server/src/workspace.lua b/server/src/workspace.lua index 3a67572a..18f9b15b 100644 --- a/server/src/workspace.lua +++ b/server/src/workspace.lua @@ -471,12 +471,21 @@ function mt:reset() self.lsp:reCompile() end +---@param uri uri +---@return path function mt:relativePathByUri(uri) local path = uric.decode(uri) local relate = fs.relative(path, self.root) return relate end +---@param uri uri +---@return path +function mt:absolutePathByUri(uri) + local path = uric.decode(uri) + return fs.absolute(path) +end + return function (lsp, name) local workspace = setmetatable({ lsp = lsp, |