@@ -2373,6 +2373,90 @@ zzzz<??>
2373
2373
insertText = ' zzzz(${1:a: any}, ${2:b: any})' ,
2374
2374
},
2375
2375
}
2376
+
2377
+ TEST [[
2378
+ ---@param a any
2379
+ ---@param b? any
2380
+ ---@param c? any
2381
+ ---@vararg any
2382
+ local function foo(a, b, c, ...) end
2383
+ foo<??>
2384
+ ]]
2385
+ {
2386
+ {
2387
+ label = ' foo(a, b, c, ...)' ,
2388
+ kind = define .CompletionItemKind .Function ,
2389
+ insertText = ' foo' ,
2390
+ },
2391
+ {
2392
+ label = ' foo(a, b, c, ...)' ,
2393
+ kind = define .CompletionItemKind .Snippet ,
2394
+ insertText = ' foo(${1:a: any})' ,
2395
+ },
2396
+ }
2397
+
2398
+ TEST [[
2399
+ ---@param a any
2400
+ ---@param b? any
2401
+ ---@param c? any
2402
+ ---@vararg any
2403
+ local function foo(a, b, c, ...) end
2404
+ foo<??>
2405
+ ]]
2406
+ {
2407
+ {
2408
+ label = ' foo(a, b, c, ...)' ,
2409
+ kind = define .CompletionItemKind .Function ,
2410
+ insertText = ' foo' ,
2411
+ },
2412
+ {
2413
+ label = ' foo(a, b, c, ...)' ,
2414
+ kind = define .CompletionItemKind .Snippet ,
2415
+ insertText = ' foo(${1:a: any})' ,
2416
+ },
2417
+ }
2418
+
2419
+ TEST [[
2420
+ ---@param a? any
2421
+ ---@param b? any
2422
+ ---@param c? any
2423
+ ---@vararg any
2424
+ local function foo(a, b, c, ...) end
2425
+ foo<??>
2426
+ ]]
2427
+ {
2428
+ {
2429
+ label = ' foo(a, b, c, ...)' ,
2430
+ kind = define .CompletionItemKind .Function ,
2431
+ insertText = ' foo' ,
2432
+ },
2433
+ {
2434
+ label = ' foo(a, b, c, ...)' ,
2435
+ kind = define .CompletionItemKind .Snippet ,
2436
+ insertText = ' foo($1)' ,
2437
+ },
2438
+ }
2439
+
2440
+ TEST [[
2441
+ ---@param a? any
2442
+ ---@param b any
2443
+ ---@param c? any
2444
+ ---@vararg any
2445
+ local function foo(a, b, c, ...) end
2446
+ foo<??>
2447
+ ]]
2448
+ {
2449
+ {
2450
+ label = ' foo(a, b, c, ...)' ,
2451
+ kind = define .CompletionItemKind .Function ,
2452
+ insertText = ' foo' ,
2453
+ },
2454
+ {
2455
+ label = ' foo(a, b, c, ...)' ,
2456
+ kind = define .CompletionItemKind .Snippet ,
2457
+ insertText = ' foo(${1:a?: any}, ${2:b: any})' ,
2458
+ },
2459
+ }
2376
2460
Cared [' insertText' ] = false
2377
2461
2378
2462
TEST [[
0 commit comments