summaryrefslogtreecommitdiff
path: root/script/service.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-07-08 19:51:10 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-07-08 19:51:10 +0800
commitae3a20cfd5ea89919326a6499c5a3c93fdfe2120 (patch)
treeb4b337b82bda3a14f300ab30862efd12b6e10650 /script/service.lua
parent5354d8c339ddb6487f3c0ec1b240eb3e93d19585 (diff)
downloadlua-language-server-ae3a20cfd5ea89919326a6499c5a3c93fdfe2120.zip
fix #187
Diffstat (limited to 'script/service.lua')
-rw-r--r--script/service.lua16
1 files changed, 3 insertions, 13 deletions
diff --git a/script/service.lua b/script/service.lua
index 073895e9..ef9d3d96 100644
--- a/script/service.lua
+++ b/script/service.lua
@@ -21,7 +21,8 @@ local files = require 'files'
local uric = require 'uri'
local capability = require 'capability'
local plugin = require 'plugin'
-local workspace = require 'workspace'
+local workspace = require 'workspace'
+local fn = require 'filename'
local ErrorCodes = {
-- Defined by JSON RPC
@@ -228,15 +229,7 @@ end
---@param uri uri
---@return boolean
function mt:isLua(uri)
- local ws = self:findWorkspaceFor(uri)
- if not ws then
- return true
- end
- local path = ws:absolutePathByUri(uri)
- if not path then
- return false
- end
- if ws:isLuaFile(path) then
+ if fn.isLuaFile(uric.decode(uri)) then
return true
end
return false
@@ -355,9 +348,6 @@ end
---@param buf string
---@param compiled table
function mt:readLibrary(ws, uri, path, buf, compiled)
- if self:findWorkspaceFor(uri) ~= ws then
- return
- end
if not self:isLua(uri) then
return
end