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

"editor.formatOnSaveMode": "modifications" broken anywhere & "editor.formatOnSaveMode": "modificationsIfAvailable" relies on modification anyway #203463

Closed
Malix-off opened this issue Jan 25, 2024 · 6 comments
Assignees
Labels
*caused-by-extension Issue identified to be caused by an extension info-needed Issue requires more information from poster

Comments

@Malix-off
Copy link
Contributor

Malix-off commented Jan 25, 2024

From Extension

Does this issue occur when all extensions (except the formatter's extension) are disabled?: Yes

Description

"editor.formatOnSaveMode": "modifications" is broken anywhere & "editor.formatOnSaveMode": "modificationsIfAvailable" relies on modification anyway
(Tested with Golang and TypeScript)

Version

  • VS Code Version: 1.85.2 - 8b37750 - x64
  • OS Version: Edition Windows 11 Home - Version 23H2 - 22635.3066

Steps to reproduce

  1. Clone https://github.com/Malix-off/vscode-issues-203463
  2. Disable every extension except golang.go.
  3. Test with "editor.formatOnSaveMode": "file"
    1. Make https://github.com/Malix-off/vscode-issues-203463/blob/master/main.go unformatted (for exemple, add a tabulation before L3)
    2. Save
    3. Check results (currently works)
  4. Test with "editor.formatOnSaveMode": "modifications"
    1. Make https://github.com/Malix-off/vscode-issues-203463/blob/master/main.go unformatted (for exemple, add a tabulation before L3)
    2. Save
    3. Check results (currently doesn't work)
  5. Test with "editor.formatOnSaveMode": "modificationsIfAvailable"
    1. Make https://github.com/Malix-off/vscode-issues-203463/blob/master/main.go unformatted (for exemple, add a tabulation before L3)
    2. Save
    3. Check results (currently call "modifications", thus doesn't work)
@jrieken
Copy link
Member

jrieken commented Jan 26, 2024

Screen.Recording.2024-01-26.at.09.17.21.mov

This works for me. Please clarify, esp the following is needed

  • copy-paste friendly source code sample, please use TS because that ships with VS Code
  • the name of the extension that provides formatting edits
  • complete steps

@jrieken jrieken added the info-needed Issue requires more information from poster label Jan 26, 2024
@Malix-off
Copy link
Contributor Author

Malix-off commented Jan 29, 2024

Hello @jrieken !

I did succeed to reproduce the TypeScript problem, but it seems to be due to my skill issue about having conflits by having Biome, Prettier, and Eslint enabled at the same time, my bad.

However, I did reproduced the issue with Golang with golang.go.

Check updated #203463 (comment)

@jrieken jrieken added the *caused-by-extension Issue identified to be caused by an extension label Jan 31, 2024
@VSCodeTriageBot
Copy link
Collaborator

This issue is caused by an extension, please file it with the repository (or contact) the extension has linked in its overview in VS Code or the marketplace for VS Code. See also our issue reporting guidelines. If you don't know which extension is causing the problem, you can run Help: Start extension bisect from the command palette (F1) to help identify the problem extension.

Happy Coding!

@VSCodeTriageBot VSCodeTriageBot closed this as not planned Won't fix, can't repro, duplicate, stale Jan 31, 2024
@jrieken
Copy link
Member

jrieken commented Jan 31, 2024

However, I did reproduced the issue with Golang with golang.go.

This is good digging but please file an issue against the extension. VS Code doesn't actually compute or "fix up" edits from formatters. We merely send ranges that need formatting and we trust the extension's result

@Malix-off
Copy link
Contributor Author

Okay, imma contact them then, thanks and have a great day!

@Malix-off
Copy link
Contributor Author

See golang/vscode-go#3174

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*caused-by-extension Issue identified to be caused by an extension info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants