Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intellisense vs JavaScript Modules - lack of ".js" in completion #126171

Closed
BobFrankston opened this issue Jun 13, 2021 · 5 comments
Closed

Intellisense vs JavaScript Modules - lack of ".js" in completion #126171

BobFrankston opened this issue Jun 13, 2021 · 5 comments
Assignees
Labels
*question Issue represents a question, should be posted to StackOverflow (VS Code)

Comments

@BobFrankston
Copy link

We have written the needed data into you
Issue Type: Bug

[How do I find out which extension is causing this?]

Convert a project to a module (via package.json). Start an import and let it fill in the module name. The result is an import without ".js" which was correct until the introduction of modules that now require a .js.

While minor, it can cause a lot of confusion since the error messages about the module errors are not clear about the origin.

VS Code version: Code 1.57.0 (b4c1bd0, 2021-06-09T17:18:42.354Z)
OS version: Windows_NT x64 10.0.19042
Restricted Mode: No

System Info
Item Value
CPUs Intel(R) Core(TM) i7-10710U CPU @ 1.10GHz (12 x 1608)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 63.81GB (36.20GB free)
Process Argv . --crash-reporter-id b366e856-016b-4d6f-9330-3580467cd11b
Screen Reader no
VM 0%
Extensions (52)
Extension Author (truncated) Version
Bookmarks ale 13.1.0
vscode-sqlite ale 0.13.0
spellright ban 3.0.58
insert-unicode bru 0.12.0
npm-intellisense chr 1.3.1
bracket-pair-colorizer-2 Coe 0.2.1
vscode-svgviewer css 2.0.0
vscode-deno den 3.6.1
docs-markdown doc 0.2.95
xml Dot 2.5.1
vscode-npm-script eg2 0.3.22
kotlin-formatter esa 0.0.6
vs-code-xml-format fab 0.1.5
vscode-npm fkn 3.3.0
kotlin fwc 0.2.22
pwa-tools joh 0.1.0
vscode-peacock joh 3.9.1
vscode-icon-theme jtl 1.6.6
chat kar 0.35.0
adb-filesystem Mak 0.0.3
code-groovy mar 0.1.2
Kotlin mat 1.7.1
code-beautifier mic 2.3.3
prettify-json moh 0.0.3
csharp ms- 1.23.12
mssql ms- 1.10.1
python ms- 2021.5.926500501
jupyter ms- 2021.6.999230701
remote-ssh ms- 0.65.7
remote-ssh-edit ms- 0.65.7
remote-wsl ms- 0.56.5
cpptools ms- 1.4.1
powershell ms- 2021.5.1
vs-keybindings ms- 0.2.1
vsliveshare ms- 1.0.4419
vsliveshare-audio ms- 0.1.91
vsliveshare-pack ms- 0.4.0
debugger-for-chrome msj 4.12.12
material-icon-theme PKi 4.7.0
quicktype qui 12.0.46
vsc-nwjs rua 1.0.18
markdown-preview-enhanced shd 0.5.21
unique-window-colors stu 1.0.51
html-preview-vscode tht 0.2.5
designeditor tiz 1.1.0
taurine tiz 1.1.0
tizenweb tiz 1.1.0
wappl tiz 1.1.2
adb-interface-vscode vin 0.21.1
vscode-icons vsc 11.4.0
vscode-todo-highlight way 1.0.4
markdown-all-in-one yzh 3.4.0
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspyt653:30270858
pythonvspyt602:30300191
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyt639:30300192
pythontb:30283811
pythonvspyt551cf:30311713
vspre833:30267464
pythonptprofiler:30281270
vshan820:30294714
pythondataviewer:30285071
vscus158cf:30286554
pythonvsuse255:30319631
vscgsv2ct:30307505
vscorehov:30309549
vscod805cf:30301675
binariesv517:30312825

r clipboard because it was too large to send. Please paste.
@vscodebot
Copy link

vscodebot bot commented Jun 13, 2021

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@IllusionMH
Copy link
Contributor

VS Code has settings that allow to force extension in your case:
typescript.preferences.importModuleSpecifierEnding and javascript.preferences.importModuleSpecifierEnding.
In TS it's also valid to specify .js extension in imports of .ts file.

Have you tried these settings?

@BobFrankston
Copy link
Author

Thanks. I assume those will work but suggest that auto be updated to take into account the "module" setting as per node 16.

This seems to be different than the node: issue though part of the same challenge in tracking to shift to ES6 modules.

@mjbvz mjbvz added the *question Issue represents a question, should be posted to StackOverflow (VS Code) label Jun 13, 2021
@IllusionMH
Copy link
Contributor

For improvements related to auto behavior and other code completions and support for node specific behavior it make sense to create request in TypeScript repository.

There is already some work planed for Node modules so it's better to start from microsoft/TypeScript#44442 and linked https://gist.github.com/weswigham/22a064ffa961d5921077132ae2f8da78

@github-actions github-actions bot locked and limited conversation to collaborators Jul 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*question Issue represents a question, should be posted to StackOverflow (VS Code)
Projects
None yet
Development

No branches or pull requests

4 participants
@IllusionMH @BobFrankston @mjbvz and others