Skip to content

Commit

Permalink
fix warning
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed Aug 14, 2023
1 parent 5ccedb1 commit f09aa41
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 10 deletions.
2 changes: 2 additions & 0 deletions script/files.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -708,6 +709,7 @@ end
---@field diffInfo? table[]
---@field originLines? integer[]
---@field originText? string
---@field lua? string

--- 获取文件语法树
---@param uri uri
Expand Down
6 changes: 4 additions & 2 deletions script/parser/guide.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
15 changes: 10 additions & 5 deletions script/vm/compiler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 5 additions & 1 deletion script/vm/doc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/full/projects.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion test/full/self.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit f09aa41

Please sign in to comment.