summaryrefslogtreecommitdiff
path: root/script/vm
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-08-14 18:01:58 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-08-14 18:01:58 +0800
commitf09aa4104a56996e838dd30d28bbef706e461469 (patch)
tree47af5ff871d0cb28a4e563a4ad7ba16980eedea1 /script/vm
parent5ccedb1cf07a73a8e0eb4ace84b320c8a997dbbb (diff)
downloadlua-language-server-f09aa4104a56996e838dd30d28bbef706e461469.zip
fix warning
Diffstat (limited to 'script/vm')
-rw-r--r--script/vm/compiler.lua15
-rw-r--r--script/vm/doc.lua6
2 files changed, 15 insertions, 6 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua
index f07bcdc6..7e026474 100644
--- a/script/vm/compiler.lua
+++ b/script/vm/compiler.lua
@@ -7,11 +7,14 @@ local files = require 'files'
local vm = require 'vm.vm'
---@class parser.object
----@field _compiledNodes boolean
----@field _node vm.node
----@field cindex integer
----@field func parser.object
----@field hideView boolean
+---@field _compiledNodes boolean
+---@field _node vm.node
+---@field cindex integer
+---@field func parser.object
+---@field hideView boolean
+---@field package _returns? parser.object[]
+---@field package _callReturns? parser.object[]
+---@field package _asCache? parser.object[]
-- 该函数有副作用,会给source绑定node!
---@param source parser.object
@@ -483,6 +486,7 @@ function vm.getReturnOfFunction(func, index)
func._returns = {}
end
if not func._returns[index] then
+ ---@diagnostic disable-next-line: missing-fields
func._returns[index] = {
type = 'function.return',
parent = func,
@@ -580,6 +584,7 @@ local function getReturn(func, index, args)
end
if not func._callReturns[index] then
local call = func.parent
+ ---@diagnostic disable-next-line: missing-fields
func._callReturns[index] = {
type = 'call.return',
parent = call,
diff --git a/script/vm/doc.lua b/script/vm/doc.lua
index a6ea248f..5cb039fe 100644
--- a/script/vm/doc.lua
+++ b/script/vm/doc.lua
@@ -5,7 +5,11 @@ local vm = require 'vm.vm'
local config = require 'config'
---@class parser.object
----@field package _castTargetHead parser.object | vm.global | false
+---@field package _castTargetHead? parser.object | vm.global | false
+---@field package _validVersions? table<string, boolean>
+---@field package _deprecated? parser.object | false
+---@field package _async? boolean
+---@field package _nodiscard? boolean
---获取class与alias
---@param suri uri