diff options
-rw-r--r-- | changelog.md | 1 | ||||
-rw-r--r-- | script/core/collector.lua | 68 | ||||
-rw-r--r-- | script/core/completion/completion.lua | 2 | ||||
-rw-r--r-- | script/core/diagnostics/undefined-global.lua | 4 | ||||
-rw-r--r-- | script/core/noder.lua | 24 | ||||
-rw-r--r-- | script/core/searcher.lua | 16 | ||||
-rw-r--r-- | script/files.lua | 16 | ||||
-rw-r--r-- | script/plugin.lua | 46 | ||||
-rw-r--r-- | script/provider/diagnostic.lua | 8 | ||||
-rw-r--r-- | script/vm/getDocs.lua | 8 | ||||
-rw-r--r-- | script/vm/getGlobals.lua | 8 | ||||
-rw-r--r-- | script/workspace/loading.lua | 66 | ||||
-rw-r--r-- | script/workspace/require-path.lua | 93 |
13 files changed, 229 insertions, 131 deletions
diff --git a/changelog.md b/changelog.md index 88ab37f4..42fdaacb 100644 --- a/changelog.md +++ b/changelog.md @@ -5,6 +5,7 @@ + `Lua.diagnostics.workspaceDelay`: `0` sec -> `3` sec + `Lua.workspace.maxPreload`: `1000` -> `5000` + `Lua.workspace.preloadFileSize`: `100` KB -> `500` KB +* `CHG` improve performance * `FIX` modify luarc failed * `FIX` library files not recognized correctly * `FIX` [#906](https://github.com/sumneko/lua-language-server/issues/906) diff --git a/script/core/collector.lua b/script/core/collector.lua index 57ae3adc..1abfc51b 100644 --- a/script/core/collector.lua +++ b/script/core/collector.lua @@ -1,28 +1,29 @@ local scope = require 'workspace.scope' -local ws = require 'workspace' -local collect = {} -local subscribed = {} - -local m = {} +---@class collector +---@field subscribed table<uri, table<string, any>> +---@field collect table<string, table<uri, any>> +local mt = {} +mt.__index = mt --- 订阅一个名字 ---@param uri uri ---@param name string ---@param value any -function m.subscribe(uri, name, value) +function mt:subscribe(uri, name, value) + uri = uri or '<fallback>' -- 订阅部分 - local uriSubscribed = subscribed[uri] + local uriSubscribed = self.subscribed[uri] if not uriSubscribed then uriSubscribed = {} - subscribed[uri] = uriSubscribed + self.subscribed[uri] = uriSubscribed end uriSubscribed[name] = true -- 收集部分 - local nameCollect = collect[name] + local nameCollect = self.collect[name] if not nameCollect then nameCollect = {} - collect[name] = nameCollect + self.collect[name] = nameCollect end if value == nil then value = true @@ -32,27 +33,36 @@ end --- 丢弃掉某个 uri 中收集的所有信息 ---@param uri uri -function m.dropUri(uri) - local uriSubscribed = subscribed[uri] +function mt:dropUri(uri) + uri = uri or '<fallback>' + local uriSubscribed = self.subscribed[uri] if not uriSubscribed then return end - subscribed[uri] = nil + self.subscribed[uri] = nil for name in pairs(uriSubscribed) do - collect[name][uri] = nil + self.collect[name][uri] = nil + if not next(self.collect[name]) then + self.collect[name] = nil + end end end +function mt:dropAll() + self.subscribed = {} + self.collect = {} +end + --- 是否包含某个名字的订阅 ---@param name string ---@return boolean -function m.has(name) - local nameCollect = collect[name] +function mt:has(name) + local nameCollect = self.collect[name] if not nameCollect then return false end if next(nameCollect) == nil then - collect[name] = nil + self.collect[name] = nil return false end return true @@ -139,8 +149,9 @@ end --- 迭代某个名字的订阅 ---@param uri uri ---@param name string -function m.each(uri, name) - local nameCollect = collect[name] +function mt:each(uri, name) + uri = uri or '<fallback>' + local nameCollect = self.collect[name] if not nameCollect then return DUMMY_FUNCTION end @@ -160,4 +171,21 @@ function m.each(uri, name) return eachOfFallback(nameCollect, scope.fallback) end -return m +local collectors = {} + +local function new() + return setmetatable({ + collect = {}, + subscribed = {}, + }, mt) +end + +---@return collector +return function (name) + if name then + collectors[name] = collectors[name] or new() + return collectors[name] + else + return new() + end +end diff --git a/script/core/completion/completion.lua b/script/core/completion/completion.lua index 124ebee1..9eb33c2a 100644 --- a/script/core/completion/completion.lua +++ b/script/core/completion/completion.lua @@ -884,7 +884,7 @@ local function collectRequireNames(mode, myUri, literal, source, smark, position if myUri == uri then goto CONTINUE end - local path = workspace.getRelativePath(uri) + local path = furi.decode(uri) local infos = rpath.getVisiblePath(uri, path) for _, info in ipairs(infos) do if matchKey(literal, info.expect) then diff --git a/script/core/diagnostics/undefined-global.lua b/script/core/diagnostics/undefined-global.lua index 45fc390b..5ac5106d 100644 --- a/script/core/diagnostics/undefined-global.lua +++ b/script/core/diagnostics/undefined-global.lua @@ -4,7 +4,7 @@ local lang = require 'language' local config = require 'config' local guide = require 'parser.guide' local noder = require 'core.noder' -local collector = require 'core.collector' +local collector = require 'core.collector' 'searcher' local await = require 'await' local requireLike = { @@ -39,7 +39,7 @@ return function (uri, callback) end await.delay() local id = 'def:' .. noder.getID(src) - if not collector.has(id) then + if not collector:has(id) then local message = lang.script('DIAG_UNDEF_GLOBAL', key) if requireLike[key:lower()] then message = ('%s(%s)'):format(message, lang.script('DIAG_REQUIRE_LIKE', key)) diff --git a/script/core/noder.lua b/script/core/noder.lua index f648d6c5..4ecfb032 100644 --- a/script/core/noder.lua +++ b/script/core/noder.lua @@ -1,6 +1,6 @@ local util = require 'utility' local guide = require 'parser.guide' -local collector = require 'core.collector' +local collector = require 'core.collector' 'searcher' local files = require 'files' local config = require 'config' @@ -1254,19 +1254,19 @@ compileNodeMap = util.switch() : case 'doc.type.name' : call(function (noders, id, source) local uri = guide.getUri(source) - collector.subscribe(uri, id, noders) + collector:subscribe(uri, id, noders) end) : case 'doc.class.name' : case 'doc.alias.name' : call(function (noders, id, source) local uri = guide.getUri(source) - collector.subscribe(uri, id, noders) + collector:subscribe(uri, id, noders) local defID = 'def:' .. id - collector.subscribe(uri, defID, noders) + collector:subscribe(uri, defID, noders) local defAnyID = 'def:dn:' - collector.subscribe(uri, defAnyID, noders) + collector:subscribe(uri, defAnyID, noders) end) : case 'function' : call(function (noders, id, source) @@ -1511,24 +1511,24 @@ function m.compileNode(noders, source) if id and ssub(id, 1, 2) == 'g:' then local uri = guide.getUri(source) - collector.subscribe(uri, id, noders) + collector:subscribe(uri, id, noders) if guide.isSet(source) -- local t = Global --> t: g:.Global and source.type ~= 'local' and source.type ~= 'setlocal' then local defID = 'def:' .. id - collector.subscribe(uri, defID, noders) + collector:subscribe(uri, defID, noders) local fieldID = m.getLastID(id) if fieldID then local defNodeID = 'field:' .. fieldID - collector.subscribe(uri, defNodeID, noders) + collector:subscribe(uri, defNodeID, noders) end if guide.isGlobal(source) then local defAnyID = 'def:g:' - collector.subscribe(uri, defAnyID, noders) + collector:subscribe(uri, defAnyID, noders) end end end @@ -1737,7 +1737,7 @@ function m.compileAllNodes(source) end root._initedNoders = true if not root._compiledGlobals then - collector.dropUri(guide.getUri(root)) + collector:dropUri(guide.getUri(root)) end root._compiledGlobals = true --log.debug('compileNodes:', guide.getUri(root)) @@ -1876,7 +1876,7 @@ function m.compileGlobalNodes(root) return end if not root._compiledGlobals then - collector.dropUri(guide.getUri(root)) + collector:dropUri(guide.getUri(root)) end root._compiledGlobals = true local noders = m.getNoders(root) @@ -1909,7 +1909,7 @@ files.watch(function (ev, uri) end end if ev == 'remove' then - collector.dropUri(uri) + collector:dropUri(uri) end end) diff --git a/script/core/searcher.lua b/script/core/searcher.lua index 5beaf26b..17e14b9c 100644 --- a/script/core/searcher.lua +++ b/script/core/searcher.lua @@ -4,7 +4,7 @@ local files = require 'files' local generic = require 'core.generic' local rpath = require 'workspace.require-path' local vm = require 'vm.vm' -local collector = require 'core.collector' +local collector = require 'core.collector' 'searcher' local util = require 'utility' local TRACE = TRACE @@ -25,8 +25,6 @@ local sformat = string.format local getUri = guide.getUri -local ceach = collector.each - local getState = files.getState local getNoders = noder.getNoders @@ -817,7 +815,7 @@ function m.searchRefsByID(status, suri, expect, mode) or mode == 'alldef' or field or hasCall(field) then - for _, guri in ceach(suri, 'def:' .. id) do + for _, guri in collector:each(suri, 'def:' .. id) do if uri == guri then goto CONTINUE end @@ -826,14 +824,14 @@ function m.searchRefsByID(status, suri, expect, mode) end elseif mode == 'field' or mode == 'allfield' then - for _, guri in ceach(suri, 'def:' .. id) do + for _, guri in collector:each(suri, 'def:' .. id) do if uri == guri then goto CONTINUE end searchID(guri, id, field, uri) ::CONTINUE:: end - for _, guri in ceach(suri, 'field:' .. id) do + for _, guri in collector:each(suri, 'field:' .. id) do if uri == guri then goto CONTINUE end @@ -841,7 +839,7 @@ function m.searchRefsByID(status, suri, expect, mode) ::CONTINUE:: end else - for _, guri in ceach(suri, id) do + for _, guri in collector:each(suri, id) do if crossed[guri] then goto CONTINUE end @@ -869,7 +867,7 @@ function m.searchRefsByID(status, suri, expect, mode) or ignoredIDs[id] or id == 'dn:string' or hasCall(field) then - for _, guri in ceach(suri, 'def:' .. id) do + for _, guri in collector:each(suri, 'def:' .. id) do if uri == guri then goto CONTINUE end @@ -877,7 +875,7 @@ function m.searchRefsByID(status, suri, expect, mode) ::CONTINUE:: end else - for _, guri in ceach(suri, id) do + for _, guri in collector:each(suri, id) do if crossed[guri] then goto CONTINUE end diff --git a/script/files.lua b/script/files.lua index 009beba4..0b6c1e09 100644 --- a/script/files.lua +++ b/script/files.lua @@ -417,20 +417,20 @@ function m.remove(uri) end --- 获取一个包含所有文件uri的数组 +---@param scp? scope ---@return uri[] -function m.getAllUris() - local files = m._pairsCache +function m.getAllUris(scp) + local files = {} local i = 0 - if not files then - files = {} - m._pairsCache = files - for uri in pairs(m.fileMap) do + for uri in pairs(m.fileMap) do + if not scp + or scp:isChildUri(uri) + or scp:isLinkedUri(uri) then i = i + 1 files[i] = uri end - table.sort(files) end - return m._pairsCache + return files end --- 遍历文件 diff --git a/script/plugin.lua b/script/plugin.lua index 7f2165db..677644ef 100644 --- a/script/plugin.lua +++ b/script/plugin.lua @@ -7,25 +7,28 @@ local await = require 'await' ---@class plugin local m = {} -function m.showError(err) +function m.showError(scp, err) if m._hasShowedError then return end m._hasShowedError = true - client.showMessage('Error', lang.script('PLUGIN_RUNTIME_ERROR', m.pluginPath, err)) + client.showMessage('Error', lang.script('PLUGIN_RUNTIME_ERROR', scp:get('pluginPath'), err)) end -function m.dispatch(event, ...) - if not m.interface then +function m.dispatch(event, uri, ...) + local ws = require 'workspace' + local scp = ws.getScope(uri) + local interface = scp:get('pluginInterface') + if not interface then return false end - local method = m.interface[event] + local method = interface[event] if type(method) ~= 'function' then return false end local clock = os.clock() tracy.ZoneBeginN('plugin dispatch:' .. event) - local suc, res1, res2 = xpcall(method, log.error, ...) + local suc, res1, res2 = xpcall(method, log.error, uri, ...) tracy.ZoneEnd() local passed = os.clock() - clock if passed > 0.1 then @@ -34,36 +37,34 @@ function m.dispatch(event, ...) if suc then return true, res1, res2 else - m.showError(res1) + m.showError(scp, res1) end return false, res1 end -function m.isReady() - return m.interface ~= nil -end - ---@async -local function checkTrustLoad() +---@param scp scope +local function checkTrustLoad(scp) + local pluginPath = scp:get('pluginPath') local filePath = LOGPATH .. '/trusted' local trusted = util.loadFile(filePath) local lines = {} if trusted then for line in util.eachLine(trusted) do lines[#lines+1] = line - if line == m.pluginPath then + if line == pluginPath then return true end end end - local _, index = client.awaitRequestMessage('Warning', lang.script('PLUGIN_TRUST_LOAD', m.pluginPath), { + local _, index = client.awaitRequestMessage('Warning', lang.script('PLUGIN_TRUST_LOAD', pluginPath), { lang.script('PLUGIN_TRUST_YES'), lang.script('PLUGIN_TRUST_NO'), }) if not index then return false end - lines[#lines+1] = m.pluginPath + lines[#lines+1] = pluginPath util.saveFile(filePath, table.concat(lines, '\n')) return true end @@ -72,7 +73,8 @@ end function m.init(scp) await.call(function () ---@async local ws = require 'workspace' - m.interface = {} + local interface = {} + scp:set('pluginInterface', interface) local pluginPath = ws.getAbsolutePath(scp.uri, config.get(scp.uri, 'Lua.runtime.plugin')) log.info('plugin path:', pluginPath) @@ -83,20 +85,22 @@ function m.init(scp) if not pluginLua then return end - m.pluginPath = pluginPath - local env = setmetatable(m.interface, { __index = _ENV }) + + scp:set('pluginPath', pluginPath) + + local env = setmetatable(interface, { __index = _ENV }) local f, err = load(pluginLua, '@'..pluginPath, "t", env) if not f then log.error(err) - m.showError(err) + m.showError(scp, err) return end - if not client.isVSCode() and not checkTrustLoad() then + if not client.isVSCode() and not checkTrustLoad(scp) then return end local suc, err = xpcall(f, log.error, f) if not suc then - m.showError(err) + m.showError(scp, err) return end diff --git a/script/provider/diagnostic.lua b/script/provider/diagnostic.lua index 3152c332..0a3c4384 100644 --- a/script/provider/diagnostic.lua +++ b/script/provider/diagnostic.lua @@ -10,6 +10,7 @@ local ws = require 'workspace' local progress = require "progress" local client = require 'client' local converter = require 'proto.converter' +local loading = require 'workspace.loading' ---@class diagnosticProvider local m = {} @@ -364,8 +365,13 @@ function m.diagnosticsScope(uri, force) askForDisable(uri) end) end) - local uris = files.getAllUris() + local scp = ws.getScope(uri) + local uris = files.getAllUris(scp) + log.info(('diagnostics scope [%s], files count:[%d]'):format(scp, #uris)) for i, uri in ipairs(uris) do + while loading.count() > 0 do + await.sleep(1.0) + end bar:setMessage(('%d/%d'):format(i, #uris)) bar:setPercentage(i / #uris * 100) xpcall(m.doDiagnostic, log.error, uri, true) diff --git a/script/vm/getDocs.lua b/script/vm/getDocs.lua index c635b2a9..cfad021c 100644 --- a/script/vm/getDocs.lua +++ b/script/vm/getDocs.lua @@ -3,7 +3,7 @@ local guide = require 'parser.guide' ---@class vm local vm = require 'vm.vm' local config = require 'config' -local collector = require 'core.collector' +local collector = require 'core.collector' 'searcher' local define = require 'proto.define' local noder = require 'core.noder' @@ -17,7 +17,7 @@ function vm.getDocDefines(uri, name) end local results = {} if name == '*' then - for noders in collector.each(uri, 'def:dn:') do + for noders in collector:each(uri, 'def:dn:') do for id in noder.eachID(noders) do if id:sub(1, 3) == 'dn:' and not id:find(noder.SPLIT_CHAR) then @@ -31,7 +31,7 @@ function vm.getDocDefines(uri, name) end else local id = 'dn:' .. name - for noders in collector.each(uri, 'def:' .. id) do + for noders in collector:each(uri, 'def:' .. id) do for source in noder.eachSource(noders, id) do if source.type == 'doc.class.name' or source.type == 'doc.alias.name' then @@ -49,7 +49,7 @@ function vm.isDocDefined(name) return true end local id = 'def:dn:' .. name - if collector.has(id) then + if collector:has(id) then return true end return false diff --git a/script/vm/getGlobals.lua b/script/vm/getGlobals.lua index f6646559..b9ddedab 100644 --- a/script/vm/getGlobals.lua +++ b/script/vm/getGlobals.lua @@ -1,4 +1,4 @@ -local collector = require 'core.collector' +local collector = require 'core.collector' 'searcher' local guide = require 'parser.guide' ---@class vm local vm = require 'vm.vm' @@ -11,7 +11,7 @@ function vm.hasGlobalSets(name) else id = ('def:g:%s'):format(noder.STRING_CHAR, name) end - return collector.has(id) + return collector:has(id) end function vm.getGlobalSets(uri, name) @@ -22,7 +22,7 @@ function vm.getGlobalSets(uri, name) local results = {} cache[name] = results if name == '*' then - for noders in collector.each(uri, 'def:g:') do + for noders in collector:each(uri, 'def:g:') do for id in noder.eachID(noders) do if id:sub(1, 2) == 'g:' and not id:find(noder.SPLIT_CHAR) then @@ -41,7 +41,7 @@ function vm.getGlobalSets(uri, name) else id = ('g:%s'):format(noder.STRING_CHAR, name) end - for noders in collector.each(uri, 'def:' .. id) do + for noders in collector:each(uri, 'def:' .. id) do for source in noder.eachSource(noders, id) do if guide.isSet(source) then results[#results+1] = source diff --git a/script/workspace/loading.lua b/script/workspace/loading.lua index 19fe0728..8091cadf 100644 --- a/script/workspace/loading.lua +++ b/script/workspace/loading.lua @@ -13,6 +13,7 @@ local furi = require 'file-uri' ---@field _stash function[] ---@field _refs uri[] ---@field _cache table<uri, boolean> +---@field _removed boolean local mt = {} mt.__index = mt @@ -21,6 +22,10 @@ mt.read = 0 mt.max = 0 mt.preload = 0 +function mt:__close() + self:remove() +end + function mt:update() self._bar:setMessage(('%d/%d'):format(self.read, self.max)) self._bar:setPercentage(self.read / self.max * 100.0) @@ -114,46 +119,50 @@ function mt:loadFile(uri, libraryUri) await.delay() end -function mt:loadStashed() - self:update() - if self._loadLock then - return - end - self._loadLock = true - ---@async - await.call(function () - while true do - local loader = table.remove(self._stash) - if not loader then - break - end - loader() - await.delay() +---@async +function mt:loadStashed(max) + for _ = 1, max do + local loader = table.remove(self._stash) + if not loader then + return false end - self._loadLock = false - end) + loader() + await.delay() + end + return true end ---@async function mt:loadAll() - while self.read < self.max do + while true do log.info(('Loaded %d/%d files'):format(self.read, self.max)) - self:loadStashed() - await.sleep(0.1) + local suc = self:loadStashed(10) + self:update() + if not suc then + break + end end + log.info('Loaded finish.') end function mt:remove() + if self._removed then + return + end + self._removed = true self._bar:remove() end -function mt:__close() - self:remove() +function mt:isRemoved() + return self._removed == true end ---@class workspace.loading.manager local m = {} +---@type table<workspace.loading, boolean> +m._loadings = setmetatable({}, { __mode = 'k' }) + ---@return workspace.loading function m.create(scp) local loading = setmetatable({ @@ -163,7 +172,20 @@ function m.create(scp) _cache = {}, }, mt) scp:set('cachedUris', loading._cache) + m._loadings[loading] = true return loading end +function m.count() + local num = 0 + for ld in pairs(m._loadings) do + if ld:isRemoved() then + m._loadings[ld] = nil + else + num = num + 1 + end + end + return num +end + return m diff --git a/script/workspace/require-path.lua b/script/workspace/require-path.lua index 84541808..874c6743 100644 --- a/script/workspace/require-path.lua +++ b/script/workspace/require-path.lua @@ -3,9 +3,19 @@ local files = require 'files' local furi = require 'file-uri' local workspace = require "workspace" local config = require 'config' +local collector = require 'core.collector' + +---@class require-path local m = {} -m.cache = {} +local function addRequireName(suri, uri, name) + local separator = config.get(uri, 'Lua.completion.requireSeparator') + local fsname = name:gsub('%' .. separator, '/') + local scp = workspace.getScope(suri) + ---@type collector + local clt = scp:get('requireName') or scp:set('requireName', collector()) + clt:subscribe(uri, fsname, name) +end --- `aaa/bbb/ccc.lua` 与 `?.lua` 将返回 `aaa.bbb.cccc` local function getOnePath(uri, path, searcher) @@ -33,9 +43,11 @@ function m.getVisiblePath(suri, path) path = workspace.normalize(path) local uri = furi.encode(path) local libraryPath = files.getLibraryPath(uri) - if not m.cache[path] then + local scp = workspace.getScope(suri) + local cache = scp:get('visiblePath') or scp:set('visiblePath', {}) + if not cache[path] then local result = {} - m.cache[path] = result + cache[path] = result if libraryPath then libraryPath = libraryPath:gsub('^[/\\]+', '') end @@ -73,11 +85,12 @@ function m.getVisiblePath(suri, path) searcher = mySearcher, expect = expect, } + addRequireName(suri, uri, expect) end until not pos or strict end end - return m.cache[path] + return cache[path] end --- 查找符合指定require path的所有uri @@ -88,11 +101,6 @@ function m.findUrisByRequirePath(suri, path) end local separator = config.get(suri, 'Lua.completion.requireSeparator') local fspath = path:gsub('%' .. separator, '/') - local vm = require 'vm' - local cache = vm.getCache 'findUrisByRequirePath' - if cache[path] then - return cache[path].results, cache[path].searchers - end tracy.ZoneBeginN('findUrisByRequirePath') local results = {} local searchers = {} @@ -105,33 +113,64 @@ function m.findUrisByRequirePath(suri, path) end end - for uri in files.eachFile() do - local infos = m.getVisiblePath(suri, furi.decode(uri)) - for _, info in ipairs(infos) do - local fsexpect = info.expect:gsub('%' .. separator, '/') - if fsexpect == fspath then - results[#results+1] = uri - searchers[uri] = info.searcher + ---@type collector + local clt = workspace.getScope(suri):get('requireName') + if clt then + for _, uri in clt:each(suri, fspath) do + local infos = m.getVisiblePath(suri, furi.decode(uri)) + for _, info in ipairs(infos) do + local fsexpect = info.expect:gsub('%' .. separator, '/') + if fsexpect == fspath then + results[#results+1] = uri + searchers[uri] = info.searcher + end end end end tracy.ZoneEnd() - cache[path] = { - results = results, - searchers = searchers, - } return results, searchers end -function m.flush() - m.cache = {} +local function createVisiblePath(uri) + for _, scp in ipairs(workspace.folders) do + m.getVisiblePath(scp.uri, furi.decode(uri)) + end + m.getVisiblePath(nil, furi.decode(uri)) end -files.watch(function (ev) - if ev == 'create' - or ev == 'remove' then - m.flush() +local function removeVisiblePath(uri) + local path = furi.decode(uri) + path = workspace.normalize(path) + for _, scp in ipairs(workspace.folders) do + scp:get('visiblePath')[path] = nil + scp:get('requireName'):dropUri(uri) + end + workspace.getScope(nil):get('visiblePath')[path] = nil + workspace.getScope(nil):get('requireName'):dropUri(uri) +end + +function m.flush(suri) + local scp = workspace.getScope(suri) + scp:set('visiblePath', {}) + ---@type collector + local clt = scp:get('requireName') + if clt then + clt:dropAll() + end + for uri in files.eachFile() do + m.getVisiblePath(scp.uri, furi.decode(uri)) + end +end + +m.flush(nil) + +files.watch(function (ev, uri) + if ev == 'create' then + createVisiblePath(uri) + end + if ev == 'remove' then + removeVisiblePath(uri) end end) @@ -139,7 +178,7 @@ config.watch(function (uri, key, value, oldValue) if key == 'Lua.completion.requireSeparator' or key == 'Lua.runtime.path' or key == 'Lua.runtime.pathStrict' then - m.flush() + m.flush(uri) end end) |