nodejs / node

Node.js JavaScript runtime ✨🐢🚀✨
https://nodejs.org
Other
107.16k stars 29.37k forks source link

repl: /x/dg is autocompleted to bogus /x/dgram #50767

Open bnoordhuis opened 11 months ago

bnoordhuis commented 11 months ago

v21.2.0

$ node 
Welcome to Node.js v21.2.0.
Type ".help" for more information.
> /x/dg
/x/dgram
^

Uncaught SyntaxError: Invalid regular expression flags
> 

IOW, the REPL autocompletes /x/dg<CR> to /x/dgram.

BridgeAR commented 11 months ago

This mainly requires more fine granular suggestions. Regular expressions can definitely be handled better and this also applies to e.g., not suggesting top level modules as property (/a/.dg).

MrJithil commented 11 months ago

@nodejs/repl

xsbchen commented 9 months ago

The auto-suggest feature looks a bit weird right now, is this expected?

I think the suggested content should require confirmation before use. For example, if I input dg and then press Enter directly, I expect to execute dg, not dgram.

lucshi commented 5 months ago

The auto-suggest feature looks a bit weird right now, is this expected?

I think the suggested content should require confirmation before use. For example, if I input dg and then press Enter directly, I expect to execute dg, not dgram.

echo. IMO auto completion should be done by a "TAB".