summaryrefslogtreecommitdiff
path: root/script-beta
diff options
context:
space:
mode:
Diffstat (limited to 'script-beta')
-rw-r--r--script-beta/provider/diagnostic.lua3
-rw-r--r--script-beta/service/service.lua2
-rw-r--r--script-beta/workspace/require-path.lua7
3 files changed, 11 insertions, 1 deletions
diff --git a/script-beta/provider/diagnostic.lua b/script-beta/provider/diagnostic.lua
index 89b70061..64d83c89 100644
--- a/script-beta/provider/diagnostic.lua
+++ b/script-beta/provider/diagnostic.lua
@@ -149,6 +149,9 @@ function m.diagnostics(uri)
end
function m.doDiagnostic(uri)
+ if files.isLibrary(uri) then
+ return
+ end
local ast = files.getAst(uri)
if not ast then
m.clear(uri)
diff --git a/script-beta/service/service.lua b/script-beta/service/service.lua
index 119e70aa..11cc7b19 100644
--- a/script-beta/service/service.lua
+++ b/script-beta/service/service.lua
@@ -110,7 +110,7 @@ function m.reportProto()
end
local lines = {}
- lines[#lines+1] = ' --------------- Cache ---------------'
+ lines[#lines+1] = ' --------------- Proto ---------------'
lines[#lines+1] = (' Holdon: %d'):format(holdon)
lines[#lines+1] = (' Waiting: %d'):format(waiting)
return table.concat(lines, '\n')
diff --git a/script-beta/workspace/require-path.lua b/script-beta/workspace/require-path.lua
index 79642a7f..cfdc0455 100644
--- a/script-beta/workspace/require-path.lua
+++ b/script-beta/workspace/require-path.lua
@@ -1,4 +1,6 @@
local platform = require 'bee.platform'
+local files = require 'files'
+local furi = require 'file-uri'
local m = {}
m.cache = {}
@@ -24,10 +26,15 @@ end
function m.getVisiblePath(path, searchers)
path = path:gsub('^[/\\]+', '')
+ local uri = furi.encode(path)
+ local libraryPath = files.getLibraryPath(uri)
if not m.cache[path] then
local result = {}
m.cache[path] = result
local pos = 1
+ if libraryPath then
+ pos = #libraryPath + 2
+ end
repeat
local cutedPath = path:sub(pos)
local head