Comments (6)
Thank you for reporting this, @asik.
I agree with how it should behave - I originally didn't implement it because there might be a save-format-save-format loop, but that's been taken care of. I've published a new version, please update and try it out.
The issue got auto-closed by mentioning it in the commit.
If you still have any issues, feel free to re-open this.
Have a good day!
from fantomas-for-vs.
A real-life case of xkcd/1172!
@bddckr
These days I use Ctrl-K, Ctrl-D
, (keybind for formatting in VS).
Earlier I used exactly the workflow you described - I used to review the changes Fantomas made before hard-saving, because my comments or attributes would get eaten.
I'll make it configurable.
from fantomas-for-vs.
Just published 0.7.3 which features an option to not commit changes on save.
Have a nice weekend!
Feel free to reopen or file another issue if you have any more problems.
from fantomas-for-vs.
Thanks! I see what you did there in the Performance section 😆❤️
from fantomas-for-vs.
Is there a way to make this behavior configurable perhaps? 🙏 The old behavior was really handy for me:
Fantomas has a few bugs I keep running into:
- fsprojects/fantomas#1388: Forces me to keep peeking at the scrollbar and see if VS shows me any ping-ponging formatting on each save. I then scroll down to each change and have a look at each change to invoke the save once more until it's formatted the way I'd like the file to stay at that point.
- Various issues that end up removing comments in the code: I often don't want to remove the code I commented out - I'm just doing some changes to test something quickly, without other logic running.
I've turned off formatting on save in the options for now as I no longer have any ability to keep going back to the "correct" state of the file after this change.
E.g. with format on save turned on when I hit save it formats the code and removes the commented code accidentally:
- Before this change: Just hit Ctrl+Z once to get the file back to the saved state, which is the state I typed, but not the formatted state. This way I can bring back anything Fantomas accidentally did wrong. Once I'm done I will uncomment the code again and can hit save twice for it to format+save, this time with no issues.
- After this change: I can still undo the formatting changes, but I can't save it as that would format+save again. I have to turn off formatting on save.
While I'm here: Thanks for this extension and all the hard work on it!!!
from fantomas-for-vs.
Yeah I honestly gotta say formatting specifically triggering formatting is totally fine with me... If only I would stop forgetting to do it before raising PRs! I've yet to make Fantomas part of our CI 😅
Thanks for looking into making it an option, much appreciated!
from fantomas-for-vs.
Related Issues (20)
- Move to fsprojects/fantomas-for-vs? HOT 5
- Microsoft.VisualStudio.Shell.15.0 not found when loading extension HOT 8
- Missing Options: Fantomas Visual Studio 2022 Community Options Menu HOT 3
- Formatting doesn't work with WSL2 hosted files in VS2022 HOT 31
- Fantomas' package name changed from `fantomas-tool` to `fantomas` HOT 3
- Fantomas does not work in Visual Studio 2022 HOT 6
- Reformating on selection messes text following selection HOT 5
- Fantomas scrambled up a huge script file HOT 8
- Inconsistent version numbers
- Settings page looks different from screenshot and is missing many options HOT 2
- Broken "read the documentation" link HOT 2
- Enable or disable "Format on save" per repo
- The extension stopped working after upgrading Visual Studio 2022 to the latest version 17.4 HOT 2
- Unable to install the extension to VS 2022 on ARM64 HOT 2
- Extension does not load when a folder is opened in VS instead of a solution HOT 1
- Fantomas < 5.0 breaks nested lists HOT 16
- fsharp_multiline_bracket_style setting is not applied HOT 9
- Error in format files inside Visual Studio after updating fantomas to 6.0.0-alpha-010 HOT 7
- [Live buffers] Extension does not work with the new live buffers HOT 3
- Error: "Creating the Fantomas Deamon failed" when saving a file or trying to format in VS HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fantomas-for-vs.