diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-07-07 19:10:51 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-07-07 19:10:51 +0800 |
commit | 8d6d7b1a8c4474f3331d6445031c1a4bad267e06 (patch) | |
tree | 90b627e65366e3ae423cc748566e14dc395009fa /script/workspace/workspace.lua | |
parent | 2acaf8a90b8a0b061711b09f830515ac3861cfd2 (diff) | |
download | lua-language-server-8d6d7b1a8c4474f3331d6445031c1a4bad267e06.zip |
cleanup
Diffstat (limited to 'script/workspace/workspace.lua')
-rw-r--r-- | script/workspace/workspace.lua | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/script/workspace/workspace.lua b/script/workspace/workspace.lua index d426f6b5..36fc7771 100644 --- a/script/workspace/workspace.lua +++ b/script/workspace/workspace.lua @@ -12,6 +12,7 @@ local library = require 'library' local progress = require 'progress' local define = require "proto.define" local client = require 'client' +local plugin = require 'plugin' local m = {} m.type = 'workspace' @@ -28,13 +29,14 @@ m.matchOption = { } --- 初始化工作区 -function m.init(uri) +function m.initPath(uri) log.info('Workspace inited: ', uri) if not uri then return end m.uri = uri m.path = m.normalize(furi.decode(uri)) + plugin.workspace = m.path local logPath = fs.path(LOGPATH) / (uri:gsub('[/:]+', '_') .. '.log') client.logMessage('Log', 'Log path: ' .. furi.encode(logPath:string())) log.info('Log path: ', logPath) @@ -489,11 +491,17 @@ function m.flushCache() end function m.reload() + if TEST then + return + end await.call(m.awaitReload) end +function m.init() + m.reload() +end + function m.awaitReload() - local plugin = require 'plugin' m.ready = false m.hasHitMaxPreload = false files.flushAllLibrary() |