Comments (18)
A dozen commits later, I've released version 0.8, which supports both bleeding edge and stable in a single extension. This can be changed in "Options > F# Formatting > Build Version". It defaults to stable (4.3.0 right now).
I believe this should be sorted for the immediate future.
Perhaps, a future addition can be the warning of an older tool version, or using the specified tool version to format.
from fantomas-for-vs.
@OkkeHendriks That's the plan. Although the implementation is slightly complicated because a number of types and libraries are incompatible between 4.3 and 4.4.
The biggest problem is that the nuget package uses an older version of FCS and this is something I need to control.
I also publish F# Linting for VS which uses a newer version of FCS, and it's sure to break it for anyone if I publish it.
Additionally, 4.3.0 uses an additional package called Fantomas.Extras
(which was removed in 4.4) - which depends on a number of other packages.
I've pushed a release here (https://github.com/deviousasti/fsharp-formatting-for-vs/releases/tag/v0.7.4).
Please manually install it for now. I'll try to sort out the dual version this weekend.
from fantomas-for-vs.
Hi Okke,
I see your conundrum. Yes, the mismatch is an issue.
There are ~1400 test cases, so my assumption is that a newer version which passes the existing tests, is assumed to be "more" correct. And this is all in a single assembly, so it likely won't be possible to have that as a setting in .editorconfig.
But it's difficult to keep the tool versions constantly updated.
How about I add an option to try and use the version present in dotnet tools?
Would that work out?
from fantomas-for-vs.
Yes, it does. That window opens when you don't have fantomas installed either globally or locally for the files which you're currently editing.
from fantomas-for-vs.
Yes I think that would definitely help!
When you say 'use the version present in dotnet tools' do you mean that it verifies that the versions match or would it be possible to actually use the dotnet-tool/apply a different version?
from fantomas-for-vs.
Verifying that the versions match might not be potentially very useful, because most of the time, they likely won't match up exactly.
It's a bit more nuanced, I think.
Suppose there's a solution with two projects
Solution
├───Project 1
│ └─── dotnet-tools.json
│ └─── File1.fs
├───Project 2
│ └─── dotnet-tools.json
│ └─── File2.fs
When you format File2.fs
, you should be formatting it with the version defined under Project 2
, correct?
from fantomas-for-vs.
We have the same problem:
"We found a mismatch in the resulting formatting due to the fact that the tool was pinned on 4.3.0, while the extension was 0.7.3, build against fantomas 4.4.0."
I did manage to build the F# Formatting tool with fantomas 4.3 (the latest stable version) and the problem was gone.
It would be nice if you could create an version of the tool (F# formatting) using the latest stable version.
from fantomas-for-vs.
@OkkeHendriks Would this be able to solve your problem as well? (temporarily)
from fantomas-for-vs.
Yeah, I think this will help. With extension 0.7.3
and fantomas-tool 4.4.0-alpha-001
we still see another discrepancy in formatting. Apparently 0.7.3
was not build against that exact version of the tool.
While trying to find the exact version the extension uses I could not find the tag 0.7.3
? Anyhow it seems to be build against whatever HEAD of fantomas is at the moment of building via the submodule. I am not too familiar with git submodules but isn't it possible to pin the version there?
Ah, I now see your latest commit (ce86917 ). Do you plan to build stable with the nuget package and bleeding edge using the submodule?
from fantomas-for-vs.
Thanks for making the v0.7.4 release available for direct download here on GitHub. Could you perhaps do this for future releases as well?
This would be useful, since it will allow easy downloading and installing of a specific version (as far as I know this isn't currently possible from Visual Studio Marketplace). Combined with disabling automatic updates, this will allow manual syncing of fantomas-tool and F# Formatting versions, if need be.
(I'm on the same project team as @OkkeHendriks by the way.)
from fantomas-for-vs.
Thank you very much for your quick work, installing it right now!
I was browsing through the diffs and this caught my eye.
https://github.com/deviousasti/fsharp-formatting-for-vs/blob/3a8d9b8f08d3b08d048572572fd4c70fdb58f22c/src/FantomasHandler.cs#L283
Shouldn't there be a branch between StableCodeFormatter
and LatestCodeFormatter
there?
from fantomas-for-vs.
That's just a convenience method which calls FSharp.Compiler.Range.mkRange
, so the behavior shouldn't change. But good spotting, nonetheless.
from fantomas-for-vs.
I'm having this issue now with version 4.6.0-alpha-007
How about I add an option to try and use the version present in dotnet tools?
Would that work out?
This would be the perfect solution for me.
from fantomas-for-vs.
Hello @peterhirn, we are looking for some help in #21 if you are interested.
from fantomas-for-vs.
Does this window open from this extension?
from fantomas-for-vs.
It is a typo in it
from fantomas-for-vs.
So at the end, will you migrate to #21 and not use the global tool?
from fantomas-for-vs.
@xperiandri #21 has been implemented. Global tool is only used as a fallback, in case the repository doesn't have fantomas installed. This is what's expected to happen when you format isolated files, like a script file.
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.