ionide / ionide/FsAutoComplete
UX: updating to a newer version of Fantomas
- Dominant language
- F#
- Stars
- 486
- Forks
- 169
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 5
Description
In #836, we introduced a whole new brave world of choosing your own Fantomas version.
These last weeks, we've published [two new versions of Fantomas](https://www.nuget.org/packages/fantomas-tool/4.6.0-alpha-006) that are also compatible with Ionide.
The question remains, how do we want to inform the user of these updates?
We can easily detect new versions via the NuGet API:
```fsharp
#r "nuget: NuGet.Protocol"
open System
open System.Threading
open NuGet.Common
open NuGet.Versioning
open NuGet.Protocol
open NuGet.Protocol.Core.Types
type SemanticVersion with
member this.Alpha: int option =
if isNull this.Release then
None
else
this.Release.Replace("alpha-", "")
|> Int32.TryParse
|> fun (success, alpha) -> if success then Some alpha else None
async {
let logger = NullLogger.Instance
let cancellationToken = CancellationToken.None
let cache = new SourceCacheContext()
let repository =
Repository.Factory.GetCoreV3("https://api.nuget.org/v3/index.json")
let! resource =
repository.GetResourceAsync()
|> Async.AwaitTask
let! versions =
resource.GetAllVersionsAsync(
"fantomas-tool",
cache,
logger,
cancellationToken
)
|> Async.AwaitTask
versions
|> Seq.filter (fun v ->
v.Major = 4
&& v.Minor = 6
&& (Option.map (fun alpha -> alpha >= 4) v.Alpha
|> Option.defaultValue true)
)
|> Seq.iter (fun v -> printfn "%A" v.Release)
}
|> Async.RunSynchronously
```
But how do we want to deal with this?
Some people will be interested in every version (alpha, beta, stable), while others will only care for revisions or minors.
Contributor guide
Assessment
This issue has not been assessed yet.