summaryrefslogtreecommitdiff
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
parent5ccedb1cf07a73a8e0eb4ace84b320c8a997dbbb (diff)
downloadlua-language-server-f09aa4104a56996e838dd30d28bbef706e461469.zip
fix warning
-rw-r--r--script/files.lua2
-rw-r--r--script/parser/guide.lua6
-rw-r--r--script/vm/compiler.lua15
-rw-r--r--script/vm/doc.lua6
-rw-r--r--test/full/projects.lua2
-rw-r--r--test/full/self.lua2
6 files changed, 23 insertions, 10 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
diff --git a/test/full/projects.lua b/test/full/projects.lua
index dacc101c..20ef6724 100644
--- a/test/full/projects.lua
+++ b/test/full/projects.lua
@@ -41,7 +41,7 @@ local function doProjects(pathname)
print('开始诊断...')
- ws.ready = true
+ furi.encode(path:string())
diag.diagnosticsScope(furi.encode(path:string()))
local clock = os.clock()
diff --git a/test/full/self.lua b/test/full/self.lua
index 34b19b2b..d118e034 100644
--- a/test/full/self.lua
+++ b/test/full/self.lua
@@ -32,7 +32,7 @@ end
print('基准诊断目录:', path)
-ws.ready = true
+ws.awaitReady(furi.encode(path:string()))
diag.diagnosticsScope(furi.encode(path:string()))
local clock = os.clock()