Skip to content

Commit

Permalink
add command lua.getConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed Jan 30, 2023
1 parent c69e65f commit bb3f846
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions script/core/command/getConfig.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
local config = require 'config'

return function (data)
return config.get(data[1].uri, data[1].key)
end
4 changes: 4 additions & 0 deletions script/provider/provider.lua
Original file line number Diff line number Diff line change
Expand Up @@ -975,6 +975,7 @@ m.register 'workspace/executeCommand' {
'lua.solve',
'lua.jsonToLua',
'lua.setConfig',
'lua.getConfig',
'lua.autoRequire',
},
},
Expand All @@ -994,6 +995,9 @@ m.register 'workspace/executeCommand' {
elseif command == 'lua.setConfig' then
local core = require 'core.command.setConfig'
return core(params.arguments)
elseif command == 'lua.getConfig' then
local core = require 'core.command.getConfig'
return core(params.arguments)
elseif command == 'lua.autoRequire' then
local core = require 'core.command.autoRequire'
return core(params.arguments[1])
Expand Down

0 comments on commit bb3f846

Please sign in to comment.