@@ -12,24 +12,29 @@ local function checkDisableByLuaDocExits(uri, row, mode, code)
1212 local state = files .getState (uri )
1313 local lines = state .lines
1414 if state .ast .docs and lines then
15- return guide .eachSourceBetween (state .ast .docs , guide .positionOf (row , 0 ), guide .positionOf (row + 1 , 0 ), function (doc )
16- if doc .type == ' doc.diagnostic'
17- and doc .mode == mode then
18- if doc .names then
19- return {
20- start = doc .finish ,
21- finish = doc .finish ,
22- newText = ' , ' .. code ,
23- }
24- else
25- return {
26- start = doc .finish ,
27- finish = doc .finish ,
28- newText = ' : ' .. code ,
29- }
15+ return guide .eachSourceBetween (
16+ state .ast .docs ,
17+ guide .positionOf (row , 0 ),
18+ guide .positionOf (row + 1 , 0 ),
19+ function (doc )
20+ if doc .type == ' doc.diagnostic'
21+ and doc .mode == mode then
22+ if doc .names then
23+ return {
24+ start = doc .finish ,
25+ finish = doc .finish ,
26+ newText = ' , ' .. code ,
27+ }
28+ else
29+ return {
30+ start = doc .finish ,
31+ finish = doc .finish ,
32+ newText = ' : ' .. code ,
33+ }
34+ end
3035 end
3136 end
32- end )
37+ )
3338 end
3439 return nil
3540end
@@ -86,7 +91,7 @@ local function markGlobal(uri, name, results)
8691 kind = ' quickfix' ,
8792 command = {
8893 title = lang .script .COMMAND_MARK_GLOBAL ,
89- command = ' lua.setConfig' ,
94+ command = ' lua.setConfig' ,
9095 arguments = {
9196 {
9297 key = ' Lua.diagnostics.globals' ,
@@ -208,7 +213,7 @@ local function solveSyntaxByFix(uri, err, results)
208213 results [# results + 1 ] = {
209214 title = lang .script (' ACTION_' .. err .fix .title , err .fix ),
210215 kind = ' quickfix' ,
211- edit = {
216+ edit = {
212217 changes = {
213218 [uri ] = changes ,
214219 }
@@ -263,8 +268,8 @@ local function solveNewlineCall(uri, diag, results)
263268 changes = {
264269 [uri ] = {
265270 {
266- start = start ,
267- finish = start ,
271+ start = start ,
272+ finish = start ,
268273 newText = ' ;' ,
269274 }
270275 }
@@ -335,8 +340,8 @@ local function solveAwaitInSync(uri, diag, results)
335340 changes = {
336341 [uri ] = {
337342 {
338- start = pos ,
339- finish = pos ,
343+ start = pos ,
344+ finish = pos ,
340345 newText = ' ---@async\n ' ,
341346 }
342347 }
@@ -541,11 +546,11 @@ end
541546-- end
542547
543548local function checkJsonToLua (results , uri , start , finish )
544- local text = files .getText (uri )
545- local state = files .getState (uri )
549+ local text = files .getText (uri )
550+ local state = files .getState (uri )
546551 local startOffset = guide .positionToOffset (state , start )
547552 local finishOffset = guide .positionToOffset (state , finish )
548- local jsonStart = text :match (' ()[%{%[]' , startOffset + 1 )
553+ local jsonStart = text :match (' ()[%{%[]' , startOffset + 1 )
549554 if not jsonStart then
550555 return
551556 end
0 commit comments