Autocomplete doesn't add a file extention
Hello!
When I try to add some js-file import, WebStorm doesn't add the ".js" or ".jsx" extention at the end of string.
Somewhen I found a solution on StackOverflow, smth like to use "Find Action" menu and change some checkbox. But now I can't find this solution and can't configure this parameter.
Does some way exist for this? Thanks!
Please sign in to leave a comment.
To complete imported filename with extension, set registry key
commonjs.complete.required.filename.with.extension
totrue
:commonjs.complete.required.filename.with.extension
there, tick the checkboxThank you very much!
Добрый день!
Пытаюсь повторить вашу инструкцию - не находит такой раздел в настройках
WebStorm 2017.2.5
Build #WS-172.4343.25, built on October 20, 2017
Subscription is active until May 11, 2018
JRE: 1.8.0_152-release-915-b12 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows Server 2008 R2 6.1
Здравствуйте!
он там определенно есть:
Подскажите пожалуйста, как вы открыли диалог Registry
Из меню Help > Find Action (Ctrl+Shift+A), там ввести сначала Registry..., а потом уже, в открывшемся окне, найти чекбокс
Как написано выше:
Вы в "Help | Find Action..." ищете непосредственно ключ, а надо искать Registry и уже в нем искать
Спасибо - пропустил пункт с поиском реестра )
Hello.
Is there any way to fix this in IntelliJ IDEA 2020.1.1 (Ultimate Edition)? There is no such registry setting.
Very annoying when you have to manually fix every single import or webpack build will error and stop compiling.
Please try enabling Use file extension in module name in Settings | Editor | Code Style | JavaScript | Imports
Why isn't this the default? Firefox gives an error when I import without .js extension.
Since 2021.3, the IDE tries to guess if the extension required or prohibited, see https://youtrack.jetbrains.com/issue/WEB-53257/Add-advanced-configuration-for-using-file-extensions-in-module-imports#focus=Comments-27-5335233.0-0. But there is no reliable way to know this in each and every case
But is there actually a case where the .js extension is prohibited when importing a local js file? Or maybe it is the auto setting (which I was using originally) that should add it?