You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a folder name ends in .js, the autocomplete suggestion in the repl will incorrectly remove the extension from the folder name.
To reproduce:
mkdir foo_bar.js
touch foo_bar.js/index.js
node
In the repl, enter require('./foo_ and press Tab
The autocomplete suggestion is require('./foo_bar') rather than require('./foo_bar.js'). Since foo_bar is a folder, removing the .js extension results in an error when calling require.
(I originally noticed this because I have a local clone of Inquirer.js, which was cloned into a folder with a .js extension.)
The text was updated successfully, but these errors were encountered:
When autocompleting `require` calls, the repl strips .js file extensions
from results. However, stripping an extension from a directory results
in an error. Update the autocompletion logic to avoid stripping
extensions from directories.
PR-URL: #14727Fixes: #14726
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
If a folder name ends in
.js
, the autocomplete suggestion in the repl will incorrectly remove the extension from the folder name.To reproduce:
mkdir foo_bar.js
touch foo_bar.js/index.js
node
require('./foo_
and press TabThe autocomplete suggestion is
require('./foo_bar')
rather thanrequire('./foo_bar.js')
. Sincefoo_bar
is a folder, removing the.js
extension results in an error when callingrequire
.(I originally noticed this because I have a local clone of Inquirer.js, which was cloned into a folder with a
.js
extension.)The text was updated successfully, but these errors were encountered: