@@ -230,6 +230,15 @@ local function ofLocal(source, newname, callback)
230
230
renameLocal (ref , newname , callback )
231
231
end
232
232
end
233
+ if source .parent .type == ' funcargs'
234
+ and source .bindDocs then
235
+ for _ , doc in ipairs (source .bindDocs ) do
236
+ if doc .type == ' doc.param'
237
+ and doc .param [1 ] == source [1 ] then
238
+ callback (doc .param , doc .param .start , doc .param .finish , newname )
239
+ end
240
+ end
241
+ end
233
242
end
234
243
235
244
local function ofFieldThen (key , src , newname , callback )
@@ -298,6 +307,35 @@ local function ofLabel(source, newname, callback)
298
307
end
299
308
end
300
309
310
+ local function ofDocTypeName (source , newname , callback )
311
+ for _ , doc in ipairs (vm .getDocTypes (source [1 ])) do
312
+ if doc .type == ' doc.class.name'
313
+ or doc .type == ' doc.type.name'
314
+ or doc .type == ' doc.alias.name' then
315
+ callback (doc , doc .start , doc .finish , newname )
316
+ end
317
+ end
318
+ end
319
+
320
+ local function ofDocParamName (source , newname , callback )
321
+ callback (source , source .start , source .finish , newname )
322
+ local doc = guide .getDocState (source )
323
+ if doc .bindSources then
324
+ for _ , src in ipairs (doc .bindSources ) do
325
+ if src .type == ' local'
326
+ and src .parent .type == ' funcargs'
327
+ and src [1 ] == source [1 ] then
328
+ renameLocal (src , newname , callback )
329
+ if src .ref then
330
+ for _ , ref in ipairs (src .ref ) do
331
+ renameLocal (ref , newname , callback )
332
+ end
333
+ end
334
+ end
335
+ end
336
+ end
337
+ end
338
+
301
339
local function rename (source , newname , callback )
302
340
if source .type == ' label'
303
341
or source .type == ' goto' then
@@ -314,6 +352,12 @@ local function rename(source, newname, callback)
314
352
elseif source .type == ' setglobal'
315
353
or source .type == ' getglobal' then
316
354
return ofGlobal (source , newname , callback )
355
+ elseif source .type == ' doc.class.name'
356
+ or source .type == ' doc.type.name'
357
+ or source .type == ' doc.alias.name' then
358
+ return ofDocTypeName (source , newname , callback )
359
+ elseif source .type == ' doc.param.name' then
360
+ return ofDocParamName (source , newname , callback )
317
361
elseif source .type == ' string'
318
362
or source .type == ' number'
319
363
or source .type == ' boolean' then
@@ -340,7 +384,11 @@ local function prepareRename(source)
340
384
or source .type == ' method'
341
385
or source .type == ' tablefield'
342
386
or source .type == ' setglobal'
343
- or source .type == ' getglobal' then
387
+ or source .type == ' getglobal'
388
+ or source .type == ' doc.class.name'
389
+ or source .type == ' doc.type.name'
390
+ or source .type == ' doc.alias.name'
391
+ or source .type == ' doc.param.name' then
344
392
return source , source [1 ]
345
393
elseif source .type == ' string'
346
394
or source .type == ' number'
@@ -373,6 +421,11 @@ local accept = {
373
421
[' string' ] = true ,
374
422
[' boolean' ] = true ,
375
423
[' number' ] = true ,
424
+
425
+ [' doc.class.name' ] = true ,
426
+ [' doc.type.name' ] = true ,
427
+ [' doc.alias.name' ] = true ,
428
+ [' doc.param.name' ] = true ,
376
429
}
377
430
378
431
local m = {}
0 commit comments