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

javascript optional chain completions #97398

Closed
lc150303 opened this issue May 10, 2020 · 4 comments
Closed

javascript optional chain completions #97398

lc150303 opened this issue May 10, 2020 · 4 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug javascript JavaScript support issues verified Verification succeeded
Milestone

Comments

@lc150303
Copy link

Issue Type: Bug

After disable the javascript.suggest.includeAutomaticOptionalChainCompletions, and have an object A with declared type { B?: {C: 0} }. when I typed A.B.C, it will be auto replaced by A.B?.C, but in js file the '?.' operator should not exist.

VS Code version: Code 1.45.0 (d69a79b, 2020-05-07T16:18:48.860Z)
OS version: Windows_NT x64 10.0.18363

System Info
Item Value
CPUs Intel(R) Core(TM) i5-8265U CPU @ 1.60GHz (8 x 1800)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: enabled
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 7.81GB (1.76GB free)
Process Argv
Screen Reader no
VM 67%
Extensions: none
@mjbvz mjbvz self-assigned this May 10, 2020
@mjbvz
Copy link
Contributor

mjbvz commented May 10, 2020

Please share a complete code example

@mjbvz mjbvz added the info-needed Issue requires more information from poster label May 10, 2020
@lc150303
Copy link
Author

I have a jsconfig.json with

{  
    "include": [  
        "*"  
    ],  
    "compilerOptions": {  
        "checkJs": true,  
        "strict": true,  
    }  
}

and the setting is "javascript.suggest.includeAutomaticOptionalChainCompletions": false, and the code is

/**
 * @type {{b?:{c:number}}}
 */
let a = { b: { c: 7 } };
a.b?.c;

the '?' was inserted after i typed a.b.c;.

@lc150303
Copy link
Author

Please share a complete code example
@mjbvz
as above

@mjbvz
Copy link
Contributor

mjbvz commented May 11, 2020

Thanks. Opened microsoft/TypeScript#38487 to track upstream

@mjbvz mjbvz closed this as completed May 11, 2020
@mjbvz mjbvz added javascript JavaScript support issues upstream-issue-linked This is an upstream issue that has been reported upstream and removed info-needed Issue requires more information from poster labels May 11, 2020
@mjbvz mjbvz reopened this May 11, 2020
@mjbvz mjbvz added bug Issue identified by VS Code Team member as probable bug and removed upstream-issue-linked This is an upstream issue that has been reported upstream labels May 11, 2020
@mjbvz mjbvz added this to the May 2020 milestone May 11, 2020
@mjbvz mjbvz closed this as completed in e4e1099 May 11, 2020
@aeschli aeschli added the verified Verification succeeded label Jun 3, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jun 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug javascript JavaScript support issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants