microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.27k stars 28.57k forks source link

Import autocomplete for named ES module export is broken #204823

Closed stan-p closed 7 months ago

stan-p commented 7 months ago

Type: Bug

Since the recent update, accepting import autocomplete suggestion for named ES module export leaves an extra closing curly brace at the end.

Steps to reproduce:

  1. Start typing import {
  2. Of course, you get the closing brace automaticaly: import {}
  3. Continue typing, e.g. import {verySpecial}
  4. Accept autocomplete suggestion
  5. You end up with something like import { verySpecialFunction } from "./very-special-function"} (notice the extra } at the end)

Expected result: import { verySpecialFunction } from "./very-special-function"

VS Code version: Code 1.86.1 (Universal) (31c37ee8f63491495ac49e43b8544550fbae4533, 2024-02-07T09:09:01.236Z) OS version: Darwin x64 23.2.0 Modes:

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz (12 x 2600)| |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)|3, 3, 2| |Memory (System)|32.00GB (0.49GB free)| |Process Argv|--crash-reporter-id 72f2521d-69c0-470e-aa80-31b73f52bbf1| |Screen Reader|no| |VM|0%|
Extensions (43) Extension|Author (truncated)|Version ---|---|--- terraform|4op|0.2.5 Bookmarks|ale|13.4.2 vscode-tailwindcss|bra|0.10.5 vscode-toggle-quotes|Bri|0.3.6 vscode-eslint|dba|2.4.4 vscode-notes|dio|1.2.1 gitlens|eam|14.8.0 prettier-vscode|esb|10.1.0 copilot|Git|1.159.0 copilot-chat|Git|0.12.1 vscode-github-actions|git|0.26.2 go|gol|0.40.3 vscode-graphql|Gra|0.9.1 vscode-graphql-execution|Gra|0.2.6 vscode-graphql-syntax|Gra|1.3.2 todo-tree|Gru|0.0.226 json2csv|kha|0.0.1 yarn-lock-syntax|mar|0.2.0 Kotlin|mat|1.7.1 rainbow-csv|mec|3.11.0 dotenv|mik|1.0.1 vscode-duplicate|mrm|1.2.1 vscode-scss|mrm|0.10.0 vscode-docker|ms-|1.28.0 debugpy|ms-|2024.0.0 python|ms-|2024.0.1 vscode-pylance|ms-|2024.2.1 vscode-react-native|msj|1.12.3 color-highlight|nau|2.5.0 vscode-jest|Ort|5.2.3 linesinfostatusbar|pet|0.0.9 material-icon-theme|PKi|4.33.0 prisma|Pri|5.9.1 project-snippets|reb|0.5.0 rust-analyzer|rus|0.3.1831 svg-preview|Sim|2.8.3 swift-lang|ssw|1.7.2 vscode-styled-components|sty|1.7.8 sort-lines|Tyr|1.11.0 vscode-lldb|vad|1.10.0 vscode-css-variables|vun|2.6.5 change-case|wma|1.0.0 markdown-all-in-one|yzh|3.6.2 (1 theme extensions excluded)
A/B Experiments ``` vsliv368cf:30146710 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscod805cf:30301675 binariesv615:30325510 vsaa593:30376534 py29gd2263:30899288 c4g48928:30535728 azure-dev_surveyone:30548225 2i9eh265:30646982 962ge761:30959799 pythongtdpath:30769146 welcomedialogc:30910334 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 pythontbext0:30879054 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 pydisww1:30959800 dsvsc019bcf:30953938 7j2b6412:30949929 ```
IllusionMH commented 7 months ago

/duplicate of #204037

@mjbvz is it possible to pull fix to next 1.86 recovery release?

VSCodeTriageBot commented 7 months ago

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for similar existing issues. See also our issue reporting guidelines.

Happy Coding!