diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2023-08-14 18:01:58 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2023-08-14 18:01:58 +0800 |
commit | f09aa4104a56996e838dd30d28bbef706e461469 (patch) | |
tree | 47af5ff871d0cb28a4e563a4ad7ba16980eedea1 /script | |
parent | 5ccedb1cf07a73a8e0eb4ace84b320c8a997dbbb (diff) | |
download | lua-language-server-f09aa4104a56996e838dd30d28bbef706e461469.zip |
fix warning
Diffstat (limited to 'script')
-rw-r--r-- | script/files.lua | 2 | ||||
-rw-r--r-- | script/parser/guide.lua | 6 | ||||
-rw-r--r-- | script/vm/compiler.lua | 15 | ||||
-rw-r--r-- | script/vm/doc.lua | 6 |
4 files changed, 21 insertions, 8 deletions
diff --git a/script/files.lua b/script/files.lua index 5c3a1c72..490ae504 100644 --- a/script/files.lua +++ b/script/files.lua @@ -32,6 +32,7 @@ local pub = require 'pub' ---@field id integer ---@field state? parser.state ---@field compileCount? integer +---@field words? table ---@class files ---@field lazyCache? lazy-cacher @@ -708,6 +709,7 @@ end ---@field diffInfo? table[] ---@field originLines? integer[] ---@field originText? string +---@field lua? string --- 获取文件语法树 ---@param uri uri diff --git a/script/parser/guide.lua b/script/parser/guide.lua index d7399b4d..dc46fecf 100644 --- a/script/parser/guide.lua +++ b/script/parser/guide.lua @@ -56,7 +56,7 @@ local type = type ---@field returnIndex integer ---@field assignIndex integer ---@field docIndex integer ----@field docs parser.object[] +---@field docs parser.object ---@field state table ---@field comment table ---@field optional boolean @@ -74,7 +74,9 @@ local type = type ---@field hasBreak? true ---@field hasExit? true ---@field [integer] parser.object|any ----@field package _root parser.object +---@field package _root parser.object +---@field package _eachCache? parser.object[] +---@field package _isGlobal? boolean ---@class guide ---@field debugMode boolean 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 |