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

Auto import names should not include Mjs for mjs files #28359

Closed
joshunger opened this issue Nov 1, 2018 · 4 comments
Closed

Auto import names should not include Mjs for mjs files #28359

joshunger opened this issue Nov 1, 2018 · 4 comments
Labels
Bug A bug in TypeScript Domain: Completion Lists The issue relates to showing completion lists in an editor Duplicate An existing issue was already created

Comments

@joshunger
Copy link

Issue Type: Bug

  1. Create commands/sbdc.mjs
  2. Create index.mjs
  3. Open index.mjs and type await sbdc

Actual: Code recommends sbdcMjs.
image

Expecting: Code recommends sbdc.
image

VS Code version: Code - Insiders 1.29.0-insider (4b2fac2, 2018-10-30T16:46:24.907Z)
OS version: Darwin x64 18.0.0

System Info
Item Value
CPUs Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz (4 x 3100)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: enabled
rasterization: enabled
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 2, 2, 3
Memory (System) 16.00GB (0.12GB free)
Process Argv .
Screen Reader no
VM 0%
Extensions (16)
Extension Author (truncated) Version
vscode-eslint dba 1.6.1
xml Dot 2.3.2
gitlens eam 8.5.6
EditorConfig Edi 0.12.5
prettier-vscode esb 1.6.1
flow-for-vscode flo 0.8.4
python ms- 2018.9.2
vscode-docker Pet 0.3.1
java red 0.33.0
vscode-fileutils sle 2.11.0
code-spell-checker str 1.6.10
sort-lines Tyr 1.7.0
vscode-java-debug vsc 0.14.0
vscode-java-pack vsc 0.4.0
vscode-java-test vsc 0.10.0
vscode-maven vsc 0.11.1
@joshunger
Copy link
Author

Will this be fixed under #18442 ?

@mjbvz mjbvz transferred this issue from microsoft/vscode Nov 6, 2018
@microsoft microsoft deleted a comment from vscodebot bot Nov 6, 2018
@mjbvz mjbvz removed their assignment Nov 6, 2018
@mjbvz
Copy link
Contributor

mjbvz commented Nov 6, 2018

Simple repo:

abc.mjs:

export default function() {}

index.mjs

ab|
  1. Trigger suggestions after ab in index.mjs

In this case, the completionInfo response is has the incorrect name:

[Trace  - 4:43:40 PM] Response received: completionInfo (629). Request took 15 ms. Success: true 
Result: {
    "isGlobalCompletion": true,
    "isMemberCompletion": false,
    "isNewIdentifierLocation": false,
    "entries": [
        {
            "name": "abcMjs",
            "kind": "function",
            "kindModifiers": "export",
            "sortText": "0",
            "hasAction": true,
            "source": "/Users/matb/projects/san/abc.mjs"
        },
    ...
   ]
}

@weswigham weswigham added Bug A bug in TypeScript Domain: Completion Lists The issue relates to showing completion lists in an editor labels Nov 6, 2018
@weswigham
Copy link
Member

abcMjs is the generated symbol name for an unnamed default since .mjs isn't in our recognized set of file extensions (at least that's what looking at moduleSymbolToValidIdentifier in importFixes.ts tells me), leading me to believe that at heart, this is a duplicate of #27957. It's a manifestation of how we don't really support mjs input files.

@sheetalkamat sheetalkamat added the Duplicate An existing issue was already created label Dec 8, 2018
@sheetalkamat
Copy link
Member

Duplicate of #27957

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Completion Lists The issue relates to showing completion lists in an editor Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

4 participants