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

TypeScript import is adding extra } character at the end of the statement #204037

Closed
alsoicode opened this issue Feb 1, 2024 · 10 comments · Fixed by #204661
Closed

TypeScript import is adding extra } character at the end of the statement #204037

alsoicode opened this issue Feb 1, 2024 · 10 comments · Fixed by #204661
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Milestone

Comments

@alsoicode
Copy link

alsoicode commented Feb 1, 2024

Type: Bug

Create a new TypeScript file.
Add a partial import statement to trigger an IntelliSense completion such as:

import { Observable

Allow IntelliSense to complete the statement, resulting in:

import { Observable } from 'rxjs'; }

Notice the trailing } character which is an error.

This issue also happens with all extensions off.
This issue is also present in the Insiders release.

The issue does not happen for imports that are added automatically. Example:

this.myService.pipe(
  filter 
)

when typing filter, I am provided a choice of imports. When I select the import from rxjs, the import statement is added as expected.

VS Code version: Code 1.86.0 (0504748, 2024-01-31T10:29:15.765Z)
OS version: Darwin x64 23.3.0
Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz (16 x 2400)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) 5, 4, 3
Memory (System) 16.00GB (0.23GB free)
Process Argv --disable-extensions --crash-reporter-id 5026a880-d1fa-478a-b897-c5d989528497
Screen Reader no
VM 0%
Extensions disabled
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805:30301674
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:30899288
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30951796
pythongtdpath:30769146
welcomedialog:30910333
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2:30936856
pyreplss1:30897532
pythonmypyd1:30879173
pythoncet0:30885854
pythontbext0:30879054
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
dsvsc019b:30953937
3ef8e399:30949928

@Vikingama
Copy link

Vikingama commented Feb 4, 2024

Same in macOS 14.3 (23D56) and Windows 11 22H2 22621.3007
Code-2024-02-04-03 16 02
Microsoft Remote Desktop-2024-02-04-06 27 19

@mibeon
Copy link

mibeon commented Feb 5, 2024

I have this annoying bug since the last release too. Every f__ng time I import some stuff in TS, there is this brace at the end. 🤯🤦‍♂️

image

@mjbvz mjbvz added the bug Issue identified by VS Code Team member as probable bug label Feb 5, 2024
mjbvz added a commit to mjbvz/vscode that referenced this issue Feb 7, 2024
Fixes microsoft#204037

- Replace span on item == use for both insert and replace
- Optional replacement span == use only for replace
mjbvz added a commit that referenced this issue Feb 7, 2024
Fixes #204037

- Replace span on item == use for both insert and replace
- Optional replacement span == use only for replace
@vscodenpa vscodenpa added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Feb 7, 2024
@DonJayamanne DonJayamanne added the verified Verification succeeded label Feb 21, 2024
@Vikingama
Copy link

Problem was not be resolved, ///^///

@Vikingama
Copy link

I mean, this bug was fixed in 1.87.0-insider rather than 1.86.2?

@so1ve
Copy link

so1ve commented Feb 23, 2024

Yes i think so

@nicitaacom
Copy link

I'm still have this issue - why it closed?

Steps to Reproduce:

  1. import something as shown on the video
2024-02-25.18-15-38.mp4

@kamafozilov
Copy link

I'm having the same problem. I submitted an issue report today as well. Let's hope for a quick fix!

@Vikingama
Copy link

I'm still have this issue - why it closed?

Steps to Reproduce:

  1. import something as shown on the video

2024-02-25.18-15-38.mp4

It Was Fixed in Insider Channel

@nicitaacom
Copy link

I'm still have this issue - why it closed?
Steps to Reproduce:

  1. import something as shown on the video

2024-02-25.18-15-38.mp4

It Was Fixed in Insider Channel

what?

Can you add more details how to fix it?

@Vikingama
Copy link

I'm still have this issue - why it closed?
Steps to Reproduce:

  1. import something as shown on the video

2024-02-25.18-15-38.mp4

It Was Fixed in Insider Channel

what?

Can you add more details how to fix it?

https://github.com/microsoft/vscode/pull/204661/files

They add a 'insiders-released' label on this issue.

I download a insider version, this was fixed indeed.

@microsoft microsoft locked and limited conversation to collaborators Jun 10, 2024
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 insiders-released Patch has been released in VS Code Insiders verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants