Commit 1e7bcec
committed
repl: add syntax highlighting, auto-indentation, and signature hints
Add experimental REPL enhancements behind the
--experimental-repl-enhancements flag:
1. Inline syntax highlighting using the Acorn tokenizer
to colorize keywords (magenta), strings (green),
numbers (yellow), booleans/null (yellow), regular
expressions (red), and comments (gray).
2. Auto-indentation for multiline input based on
brace/bracket/paren depth, using 2-space indentation.
3. Function signature hints that display parameter lists
as dimmed text below the input when the user types a
function call.
All features are off by default and require the CLI flag
to enable. Highlighting is applied at display time only
so cursor positioning and evaluation are unaffected.
Refs: #48164
Signed-off-by: hemanth <hemanth.hm@gmail.com>1 parent 14166a5 commit 1e7bcec
8 files changed
Lines changed: 1122 additions & 1 deletion
File tree
- doc/api
- lib
- internal/repl
- src
- test/parallel
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1381 | 1381 | | |
1382 | 1382 | | |
1383 | 1383 | | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
1384 | 1396 | | |
1385 | 1397 | | |
1386 | 1398 | | |
| |||
3829 | 3841 | | |
3830 | 3842 | | |
3831 | 3843 | | |
| 3844 | + | |
3832 | 3845 | | |
3833 | 3846 | | |
3834 | 3847 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
439 | 440 | | |
440 | 441 | | |
441 | 442 | | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
442 | 502 | | |
443 | 503 | | |
444 | 504 | | |
| |||
791 | 851 | | |
792 | 852 | | |
793 | 853 | | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
794 | 860 | | |
795 | 861 | | |
796 | 862 | | |
| |||
0 commit comments