How to hide ".js" extension on import popup options Follow
Hi,
In a node.js project,
When I try to import a module from a file in my project,
the auto complete popup options shows the file with ".js" extension (there is no option without it).
I also verified if "Use file extension in module name" is disabled in Settings | Editor | Code Style | JavaScript and that checkbox is indeed disabled.
I'm using WebStorm 2020.
Is there a way to add an option to import the file without its ".js" extension?
Thanks.
Please sign in to leave a comment.
it's not added by default, unless Use file extension in module name is enabled.
Could you record a screencast that shows up the issue?
Elena Pogorelova
Yes, I couldn't attach a video clip here (used an hosting website)
https://streamable.com/e1i1rm
Here is a screenshot as well
The page can't be loaded unfortunately...
For me, the file is shown with extension in completion, but completed without it
Could you share your idea.log (Help > Show Log in ...) and your settings (File > Manage IDE Settings > Export settings...)?
Elena Pogorelova
Well, it's weird..
Here a the files:
Settings:
https://drive.google.com/file/d/18kCRPAXhytjI1oJFbxt055L97SqzkET_/view?usp=sharing
idea.log:
https://drive.google.com/file/d/1We795wFhy9Or_R25QQp354gtP4LGPqXW/view?usp=sharing
weird indeed... Even with your settings, the problem is not repeatable for me, and I can't see anything suspicious in your log.
Can you reproduce the issue in a new project?
I think that I figured it out now,
There are 2 options of the file that I want to import (schema.js),
I should select the option with the "js" icon as shown in the screenshot below if I want it to be without the ".js" extension.
The other option (without the icon) will import it with the ".js" extension.
Thanks Elena Pogorelova