-
Notifications
You must be signed in to change notification settings - Fork 90
Changes to cabal file is lost when saving using default formatter haskell.haskell and formatOnSave=true #945
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
Comments
Hi, thank you for your bug report! That's very weird, we use The provided logs aren't helpful for this scenario, please follow the instructions here https://github.com/haskell/vscode-haskell#investigating-and-reporting-problems |
Ok, after some more investigation I have found that I can reproduce the error by even though formatOnSave is false:
The changes are lost!!! It seems that the formatting is done on the unchanged file in the file system and then the result is copied to the editor effectively undoing the changes.
Here are the complete logs:
|
Ah yes, it actually makes sense. Yeah, this is an HLS bug that we need to fix. |
Just to clarify: When I follow this steps....
... the changes are lost in the editor. Nothing is saved to disk, but the file is marked as unsaved. |
Yes, same issue. I have a patch, perhaps we can sneak it into the ongoing release 🙈 |
Fix is here: haskell/haskell-language-server#3776 but I am not sure we can get it merged before the release. |
@konnik we managed to get haskell/haskell-language-server#3776 for the next release, but it has the side effect that |
That's awesome @fendor, thanks for the fast fix and all the hard work youre all doing with the Haskell tooling. 👍 |
I don't know if this is an issue with the VSCode extension or HLS?
Your environment
Ubuntu
VSCode Haskell extension v2.5.0 (pre-release)
HLS 2.1.0.0 (GHC: 9.6.2)
VSCode configured with:
Tool versions found on the $PATH
cabal: 3.10.1.0
stack: 2.11.1
ghc: 9.6.2
Steps to reproduce
Open cabal file in vscode and make some changes followed by CTRL-S
Expected behaviour
The cabal file should be formatted with changes persisted.
Actual behaviour
All changes are lost and the file is saved.
Include debug information
The text was updated successfully, but these errors were encountered: