diff options
author | fesily <fesil@foxmail.com> | 2024-01-17 14:54:57 +0800 |
---|---|---|
committer | fesily <fesil@foxmail.com> | 2024-01-17 17:04:01 +0800 |
commit | 5f0cba4fef00f1c426052af421443bd72d38c8aa (patch) | |
tree | b16a72d70898a15c62ba8edfaa89d1635f3c4144 /script/vm/compiler.lua | |
parent | 4432dfea0fe8390be166b832a1ac416c8228296f (diff) | |
download | lua-language-server-5f0cba4fef00f1c426052af421443bd72d38c8aa.zip |
plugin interface add OnNodeCompileFunctionParam
Diffstat (limited to 'script/vm/compiler.lua')
-rw-r--r-- | script/vm/compiler.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua index 8a1fa96a..6b8b76cd 100644 --- a/script/vm/compiler.lua +++ b/script/vm/compiler.lua @@ -5,6 +5,7 @@ local rpath = require 'workspace.require-path' local files = require 'files' ---@class vm local vm = require 'vm.vm' +local plugin = require 'plugin' ---@class parser.object ---@field _compiledNodes boolean @@ -1091,6 +1092,13 @@ local function compileLocal(source) end end if not hasDocArg then + local suc, node = plugin.dispatch("OnNodeCompileFunctionParam", guide.getUri(source), source) + if suc and node then + hasDocArg = true + vm.setNode(source, node) + end + end + if not hasDocArg then vm.setNode(source, vm.declareGlobal('type', 'any')) end end |