summaryrefslogtreecommitdiff
path: root/script/provider
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-05 23:53:29 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-05 23:53:29 +0800
commitf2db41df39000bc3ca0c93e0d2ac8b8fafaf4d57 (patch)
tree46bfa6408497141dea719f5a9648da2abaef21b1 /script/provider
parentc0cf9ae2835f9a19fe6a9af743ddd24be7c3a123 (diff)
downloadlua-language-server-f2db41df39000bc3ca0c93e0d2ac8b8fafaf4d57.zip
#1018 add `inspect.lua`
Diffstat (limited to 'script/provider')
-rw-r--r--script/provider/provider.lua15
1 files changed, 8 insertions, 7 deletions
diff --git a/script/provider/provider.lua b/script/provider/provider.lua
index 1904301d..62284823 100644
--- a/script/provider/provider.lua
+++ b/script/provider/provider.lua
@@ -18,6 +18,7 @@ local filewatch = require 'filewatch'
local json = require 'json'
local scope = require 'workspace.scope'
local furi = require 'file-uri'
+local inspect = require 'inspect'
---@async
local function updateConfig(uri)
@@ -25,7 +26,7 @@ local function updateConfig(uri)
local specified = cfgLoader.loadLocalConfig(uri, CONFIGPATH)
if specified then
log.info('Load config from specified', CONFIGPATH)
- log.debug(util.dump(specified))
+ log.debug(inspect(specified))
-- watch directory
filewatch.watch(workspace.getAbsolutePath(uri, CONFIGPATH):gsub('[^/\\]+$', ''))
config.update(scope.override, specified)
@@ -35,13 +36,13 @@ local function updateConfig(uri)
local clientConfig = cfgLoader.loadClientConfig(folder.uri)
if clientConfig then
log.info('Load config from client', folder.uri)
- log.debug(util.dump(clientConfig))
+ log.debug(inspect(clientConfig))
end
local rc = cfgLoader.loadRCConfig(folder.uri, '.luarc.json')
if rc then
log.info('Load config from luarc.json', folder.uri)
- log.debug(util.dump(rc))
+ log.debug(inspect(rc))
end
config.update(folder, clientConfig, rc)
@@ -49,7 +50,7 @@ local function updateConfig(uri)
local global = cfgLoader.loadClientConfig()
log.info('Load config from client', 'fallback')
- log.debug(util.dump(global))
+ log.debug(inspect(global))
config.update(scope.fallback, global)
end
@@ -169,7 +170,7 @@ m.register 'workspace/didChangeConfiguration' {
m.register 'workspace/didCreateFiles' {
---@async
function (params)
- log.debug('workspace/didCreateFiles', util.dump(params))
+ log.debug('workspace/didCreateFiles', inspect(params))
for _, file in ipairs(params.files) do
if workspace.isValidLuaUri(file.uri) then
files.setText(file.uri, util.loadFile(furi.decode(file.uri)), false)
@@ -180,7 +181,7 @@ m.register 'workspace/didCreateFiles' {
m.register 'workspace/didDeleteFiles' {
function (params)
- log.debug('workspace/didDeleteFiles', util.dump(params))
+ log.debug('workspace/didDeleteFiles', inspect(params))
for _, file in ipairs(params.files) do
files.remove(file.uri)
local childs = files.getChildFiles(file.uri)
@@ -195,7 +196,7 @@ m.register 'workspace/didDeleteFiles' {
m.register 'workspace/didRenameFiles' {
---@async
function (params)
- log.debug('workspace/didRenameFiles', util.dump(params))
+ log.debug('workspace/didRenameFiles', inspect(params))
for _, file in ipairs(params.files) do
local text = files.getOriginText(file.oldUri)
if text then