Skip to content

editor.codeActionsOnSave.source.fixAll.ts will result into invalid file #247476

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

Closed
Sysix opened this issue Apr 26, 2025 · 4 comments
Closed

editor.codeActionsOnSave.source.fixAll.ts will result into invalid file #247476

Sysix opened this issue Apr 26, 2025 · 4 comments
Assignees

Comments

@Sysix
Copy link

Sysix commented Apr 26, 2025

Type: Bug

VSCode Settings:

{
  "editor.codeActionsOnSave": {
    "source.fixAll.ts": "always" // with never, this bug does not happen
  }
}

Testfile:

const asyncFn = async () => { return Promise.resolve('ok'); };

const abc = (mode: string) => {
  switch (mode) {
    case 'debug':
      await asyncFn();
      break;
    case 'release':
      await asyncFn();
      break;
    default:
      await asyncFn();
  }
}

Saving the File with CTRL + S will result into changes in line 3:

const abc = async async async (mode: string) => {

Expected Result:

const abc = async (mode: string) => {

VS Code version: Code 1.99.3 (17baf84, 2025-04-15T23:18:46.076Z)
OS version: Windows_NT x64 10.0.19045
Modes:
Remote OS version: Linux x64 5.15.167.4-microsoft-standard-WSL2

System Info
Item Value
CPUs AMD Ryzen 9 7900X 12-Core Processor (24 x 4700)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
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
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 31.10GB (11.35GB free)
Process Argv --folder-uri=vscode-remote://wsl+Ubuntu/home/sysix/dev/oxc --remote=wsl+Ubuntu --crash-reporter-id 2b3612a4-60c2-4760-b864-459fece876bf
Screen Reader no
VM 0%
Item Value
Remote WSL: Ubuntu
OS Linux x64 5.15.167.4-microsoft-standard-WSL2
CPUs AMD Ryzen 9 7900X 12-Core Processor (24 x 0)
Memory (System) 15.18GB (9.33GB free)
VM 0%
Extensions (35)
Extension Author (truncated) Version
vscode-jetbrains-keybindings isu 0.1.9
remote-containers ms- 0.409.0
remote-wsl ms- 0.99.0
vscode-icons vsc 12.12.0
rust-bundle 1Yi 1.0.0
vscode-intelephense-client bme 1.14.4
vscode-eslint dba 3.0.10
composer-php-vscode DEV 1.57.17158
intelli-php-vscode DEV 0.12.15062
phptools-vscode DEV 1.57.17158
profiler-php-vscode DEV 1.57.17158
docker doc 0.4.10
githistory don 0.6.20
EditorConfig Edi 0.17.2
prettier-vscode esb 11.0.0
dependi fil 0.7.13
copilot Git 1.309.0
copilot-chat Git 0.26.7
vscode-github-actions git 0.27.1
gti-vscode Gra 0.6.1
php-cs-fixer jun 0.3.21
git-graph mhu 1.30.0
vscode-docker ms- 1.29.5
extension-test-runner ms- 0.0.12
live-server ms- 0.4.15
vscode-yaml red 1.17.0
rust-analyzer rus 0.3.2433
vscode-coverage-gutters rya 2.13.0
markdown-preview-enhanced shd 0.8.18
code-spell-checker str 4.0.47
even-better-toml tam 0.21.2
vscode-lldb vad 1.11.4
volar Vue 2.2.10
gitblame wad 11.1.2
markdown-all-in-one yzh 3.6.3
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyt551:31249599
vscod805:30301674
binariesv615:30325510
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
h48ei257:31000450
pythontbext0:30879054
cppperfnew:31000557
dwnewjupyter:31046869
pythonrstrctxt:31112756
nativeloc2:31192216
5fd0e150:31155592
dwcopilot:31170013
6074i472:31201624
dwoutputs:31242946
customenabled:31248079
hdaa2157:31222309
copilot_t_ci:31222730
e5gg6876:31282496
cp15370_c:31280196
pythoneinst12:31285622
bgtreat:31268568
4gafe986:31271826
31787653:31262186
3e8i5726:31271747
996jf627:31283433
usemplatestapi:31292913
7bj51361:31289155
747dc170:31275177
g20af354:31278749
aj953862:31281341
generatesymbolt:31295002
convertfstringf:31295003
gendocf:31295004

@albertosantini
Copy link

Which extension does use source.fixAll.ts, maybe vscode-eslint?

@Sysix
Copy link
Author

Sysix commented Apr 28, 2025

Which extension does use source.fixAll.ts, maybe vscode-eslint?

Eslint has source.fixAll.eslint, I expect it has something to do with TS, because the diagnostic I get (before saving) refers to a TS code error.

@albertosantini
Copy link

At least, I can reproduce the issue (with only 3 extensions, 2 Copilot and eslint). :)

@albertosantini
Copy link

albertosantini commented Apr 28, 2025

See #185103 forwarding to microsoft/TypeScript#29452

@Sysix Sysix closed this as completed Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants