microsoft / vscode

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

VSCode inserts multiple "async" keyword #185103

Closed so1ve closed 1 year ago

so1ve commented 1 year ago

Type: Bug

Create a ts file and input:

() => {
  await 1;
  await 1;
}

And vscode settings:

{
  "editor.codeActionsOnSave": {
    "source.fixAll": true,
  },
}

Then ctrl+s, you will see there are multiple async keywords.

VS Code version: Code - Insiders 1.80.0-insider (990d40aad4e5fe57500132cae7ad8c69950399b0, 2023-06-14T00:18:56.269Z) OS version: Windows_NT x64 10.0.22000 Modes:

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5-8500 CPU @ 3.00GHz (6 x 3000)| |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
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|7.89GB (1.15GB free)| |Process Argv|C:\\Workspace\\language-tools --crash-reporter-id bd549914-474b-4148-8591-587bcc8d3b73| |Screen Reader|no| |VM|0%|
Extensions (88) Extension|Author (truncated)|Version ---|---|--- better-comments|aar|3.0.2 codesnap|adp|1.3.4 browse-lite|ant|0.3.2 iconify|ant|0.5.3 icons-carbon|ant|0.2.6 unocss|ant|0.53.1 vite|ant|0.2.5 language-mcfunction|arc|0.18.0 vscode-django|bat|1.10.0 htmltagwrap|bra|0.0.9 vscode-tailwindcss|bra|0.9.11 vscode-toggle-quotes|Bri|0.3.6 vscode-better-align|cho|1.4.2 path-intellisense|chr|2.8.4 language-postcss|cpy|1.1.0 vscode-eslint|dba|2.4.0 githistory|don|0.6.20 gitlens|eam|13.6.0 EditorConfig|Edi|0.16.4 prettier-vscode|esb|9.13.0 code-runner|for|0.12.0 copilot|Git|1.89.156 copilot-chat|Git|0.3.2023061301 copilot-labs|Git|0.14.884 vscode-github-actions|git|0.25.7 vscode-pull-request-github|Git|0.66.1 go|gol|0.39.0 vhs|gri|0.0.3 todo-tree|Gru|0.0.226 vscode-drawio|hed|1.6.6 rest-client|hum|0.25.1 highlight-icemode|ice|0.0.6 better-cpp-syntax|jef|1.17.2 volarjs-labs|joh|1.7.0 vscode-sshfs|Kel|1.26.1 vsc-python-indent|Kev|1.18.0 i18n-ally|lok|2.9.1 template-string-converter|meg|0.6.1 git-graph|mhu|1.30.0 dotenv|mik|1.0.1 milkdown|mir|0.0.15 tab-cycle|mpo|1.0.1 vscode-less|mrm|0.6.3 vscode-docker|ms-|1.25.1 vscode-language-pack-zh-hans|MS-|1.79.2023060709 isort|ms-|2023.9.11571010 python|ms-|2023.11.11581008 vscode-pylance|ms-|2023.6.11 jupyter|ms-|2023.6.1001661100 jupyter-keymap|ms-|1.1.2 jupyter-renderers|ms-|1.0.15 vscode-jupyter-cell-tags|ms-|0.1.8 vscode-jupyter-slideshow|ms-|0.1.5 remote-containers|ms-|0.296.0 remote-ssh|ms-|0.103.2023060715 remote-ssh-edit|ms-|0.86.0 remote-wsl|ms-|0.79.4 remote-explorer|ms-|0.5.2023060509 color-highlight|nau|2.5.0 indent-rainbow|ode|8.3.1 vscode-twoslash-queries|Ort|1.1.0 colorful-comments|Par|1.0.0 vscode-versionlens|pfl|1.5.0 nested-comments|phi|4.0.0 markdown-checkbox|PKi|1.9.0 material-icon-theme|PKi|4.28.0 quicktype|qui|12.0.46 vscode-thunder-client|ran|2.7.6 vscode-yaml|red|1.13.0 rust-analyzer|rus|0.4.1551 vscode-javascript-booster|sbu|14.0.1 crates|ser|0.5.11 datapack-language-server|SPG|3.4.14 vscode-stylelint|sty|1.2.4 svelte-vscode|sve|107.5.1 even-better-toml|tam|0.19.0 tauri-vscode|tau|0.2.6 vscode-nushell-lang|The|1.5.1 errorlens|use|3.11.1 intellicode-api-usage-examples|Vis|0.2.7 vscodeintellicode|Vis|1.2.30 volar|Vue|1.7.12 vscode-wakatime|Wak|24.0.7 vscode-todo-highlight|way|1.0.5 txt-syntax|xsh|0.2.2 pretty-ts-errors|yoa|0.4.1 cloudmusic|YXL|9.19.1 markdown-all-in-one|yzh|3.5.1 (1 theme extensions excluded)
A/B Experiments ``` vsliv695:30137379 vsins829:30139715 vsliv368:30146709 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vslsvsres303:30308271 pythontb:30258533 pythonptprofiler:30281269 vshan820:30294714 vscod805cf:30301675 bridge0708:30335490 bridge0723:30353136 vsaa593cf:30376535 pythonvs932:30404738 py29gd2263:30763246 vsclangdf:30492506 c4g48928:30535728 dsvsc012:30540252 pynewext54:30618038 pylantcb52:30590116 pyind779:30611226 pythonsymbol12:30651887 2i9eh265:30646982 showlangstatbar:30737417 pythonms35:30671666 pythonfmttext:30716741 pythoncmvfstr:30726892 fixhidewlkth:30724384 showindicator:30766888 pythongtdpath:30726887 dh2dc718:30763024 pythonnosmt12:30757129 pythonidxpt:30763123 pythondjangots:30763122 pythonnoceb:30766855 ```
so1ve commented 1 year ago

Actually sometimes the eslint extension will add some spaces into the async keyword 😅

mjbvz commented 1 year ago

Closing in favor of microsoft/typescript#29452