Skip to content

Commit 7c63635

Browse files
committed
fix missing fields
1 parent 998927a commit 7c63635

File tree

6 files changed

+26
-18
lines changed

6 files changed

+26
-18
lines changed

script/core/code-lens.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@ local getRef = require 'core.reference'
66
local lang = require 'language'
77

88
---@class parser.state
9-
---@field package _codeLens codeLens
9+
---@field package _codeLens? codeLens
1010

1111
---@class codeLens.resolving
1212
---@field mode 'reference'
1313
---@field source? parser.object
1414

1515
---@class codeLens.result
1616
---@field position integer
17-
---@field uri uri
1817
---@field id integer
1918

2019
---@class codeLens

script/core/completion/completion.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,6 +1614,7 @@ local function tryCallArg(state, position, results)
16141614
if arg and arg.type == 'function' then
16151615
return
16161616
end
1617+
---@diagnostic disable-next-line: missing-fields
16171618
local node = vm.compileCallArg({ type = 'dummyarg' }, call, argIndex)
16181619
if not node then
16191620
return

script/files.lua

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,19 @@ local sp = require 'bee.subprocess'
1919
local pub = require 'pub'
2020

2121
---@class file
22-
---@field uri uri
23-
---@field content string
24-
---@field ref? integer
25-
---@field trusted? boolean
26-
---@field rows? integer[]
27-
---@field originText? string
28-
---@field text string
29-
---@field version? integer
30-
---@field originLines? integer[]
31-
---@field diffInfo? table[]
32-
---@field cache table
33-
---@field id integer
34-
---@field state? parser.state
35-
---@field compileCount integer
22+
---@field uri uri
23+
---@field ref? integer
24+
---@field trusted? boolean
25+
---@field rows? integer[]
26+
---@field originText? string
27+
---@field text? string
28+
---@field version? integer
29+
---@field originLines? integer[]
30+
---@field diffInfo? table[]
31+
---@field cache? table
32+
---@field id integer
33+
---@field state? parser.state
34+
---@field compileCount? integer
3635

3736
---@class files
3837
---@field lazyCache? lazy-cacher
@@ -708,7 +707,7 @@ end
708707
---@class parser.state
709708
---@field diffInfo? table[]
710709
---@field originLines? integer[]
711-
---@field originText string
710+
---@field originText? string
712711

713712
--- 获取文件语法树
714713
---@param uri uri

script/parser/compile.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3937,7 +3937,7 @@ local function initState(lua, version, options)
39373937
else
39383938
state.ENVMode = '_ENV'
39393939
end
3940-
3940+
39413941
pushError = function (err)
39423942
local errs = state.errs
39433943
if err.finish < err.start then

script/vm/global.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,7 @@ function vm.getGlobalBase(source)
621621
end
622622
local name = global:asKeyName()
623623
if not root._globalBaseMap[name] then
624+
---@diagnostic disable-next-line: missing-fields
624625
root._globalBaseMap[name] = {
625626
type = 'globalbase',
626627
parent = root,

script/vm/operator.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ vm.unarySwich = util.switch()
126126
if result == nil then
127127
vm.setNode(source, vm.declareGlobal('type', 'boolean'))
128128
else
129+
---@diagnostic disable-next-line: missing-fields
129130
vm.setNode(source, {
130131
type = 'boolean',
131132
start = source.start,
@@ -155,6 +156,7 @@ vm.unarySwich = util.switch()
155156
vm.setNode(source, node or vm.declareGlobal('type', 'number'))
156157
end
157158
else
159+
---@diagnostic disable-next-line: missing-fields
158160
vm.setNode(source, {
159161
type = 'number',
160162
start = source.start,
@@ -171,6 +173,7 @@ vm.unarySwich = util.switch()
171173
local node = vm.runOperator('bnot', source[1])
172174
vm.setNode(source, node or vm.declareGlobal('type', 'integer'))
173175
else
176+
---@diagnostic disable-next-line: missing-fields
174177
vm.setNode(source, {
175178
type = 'integer',
176179
start = source.start,
@@ -223,6 +226,7 @@ vm.binarySwitch = util.switch()
223226
if source.op.type == '~=' then
224227
result = not result
225228
end
229+
---@diagnostic disable-next-line: missing-fields
226230
vm.setNode(source, {
227231
type = 'boolean',
228232
start = source.start,
@@ -247,6 +251,7 @@ vm.binarySwitch = util.switch()
247251
or op == '&' and a & b
248252
or op == '|' and a | b
249253
or op == '~' and a ~ b
254+
---@diagnostic disable-next-line: missing-fields
250255
vm.setNode(source, {
251256
type = 'integer',
252257
start = source.start,
@@ -285,6 +290,7 @@ vm.binarySwitch = util.switch()
285290
or op == '%' and a % b
286291
or op == '//' and a // b
287292
or op == '^' and a ^ b
293+
---@diagnostic disable-next-line: missing-fields
288294
vm.setNode(source, {
289295
type = (op == '//' or math.type(result) == 'integer') and 'integer' or 'number',
290296
start = source.start,
@@ -364,6 +370,7 @@ vm.binarySwitch = util.switch()
364370
end
365371
end
366372
end
373+
---@diagnostic disable-next-line: missing-fields
367374
vm.setNode(source, {
368375
type = 'string',
369376
start = source.start,
@@ -407,6 +414,7 @@ vm.binarySwitch = util.switch()
407414
or op == '<' and a < b
408415
or op == '>=' and a >= b
409416
or op == '<=' and a <= b
417+
---@diagnostic disable-next-line: missing-fields
410418
vm.setNode(source, {
411419
type = 'boolean',
412420
start = source.start,

0 commit comments

Comments
 (0)