diff options
author | fesily <fesil@foxmail.com> | 2024-01-19 12:47:06 +0800 |
---|---|---|
committer | fesily <fesil@foxmail.com> | 2024-01-19 12:47:06 +0800 |
commit | 82c004e0ba166deaca282d2d6cfb8819eb830830 (patch) | |
tree | 29c59a864b9ce08f63b8a5cc89c9e00500b03841 /test/plugins | |
parent | dd49a6dd6afc35a14fba3b675a2d9f1ee2bb7ca4 (diff) | |
download | lua-language-server-82c004e0ba166deaca282d2d6cfb8819eb830830.zip |
recode plugin interface
Diffstat (limited to 'test/plugins')
-rw-r--r-- | test/plugins/node/test.lua | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/test/plugins/node/test.lua b/test/plugins/node/test.lua index 466d0189..15e4d16c 100644 --- a/test/plugins/node/test.lua +++ b/test/plugins/node/test.lua @@ -9,15 +9,19 @@ local pattern, msg = nodeHelper.createFieldPattern("*.components") assert(pattern, msg) ---@param source parser.object -function OnNodeCompileFunctionParam(uri, source) +function OnCompileFunctionParam(next, func, source) + if next(func, source) then + return true + end --从该参数的使用模式来推导该类型 if nodeHelper.matchPattern(source, pattern) then local type = vm.declareGlobal('type', 'TestClass', TESTURI) - return vm.createNode(type, source) + vm.setNode(source, vm.createNode(type, source)) + return true end end -local myplugin = { OnNodeCompileFunctionParam = OnNodeCompileFunctionParam } +local myplugin = { OnCompileFunctionParam = OnCompileFunctionParam } ---@diagnostic disable: await-in-sync local function TestPlugin(script) |