Skip to content

Commit bb3f846

Browse files
committed
add command lua.getConfig
1 parent c69e65f commit bb3f846

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

script/core/command/getConfig.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
local config = require 'config'
2+
3+
return function (data)
4+
return config.get(data[1].uri, data[1].key)
5+
end

script/provider/provider.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -975,6 +975,7 @@ m.register 'workspace/executeCommand' {
975975
'lua.solve',
976976
'lua.jsonToLua',
977977
'lua.setConfig',
978+
'lua.getConfig',
978979
'lua.autoRequire',
979980
},
980981
},
@@ -994,6 +995,9 @@ m.register 'workspace/executeCommand' {
994995
elseif command == 'lua.setConfig' then
995996
local core = require 'core.command.setConfig'
996997
return core(params.arguments)
998+
elseif command == 'lua.getConfig' then
999+
local core = require 'core.command.getConfig'
1000+
return core(params.arguments)
9971001
elseif command == 'lua.autoRequire' then
9981002
local core = require 'core.command.autoRequire'
9991003
return core(params.arguments[1])

0 commit comments

Comments
 (0)