未验证 提交 1bb1c3c9 编写于 作者: T Tomas Grosup 提交者: GitHub

Unignore files for formatting (.fantomasignore) if the underlying Fantomas...

Unignore files for formatting (.fantomasignore) if the underlying Fantomas issue has been resolved (#14960)

* SI.fs fantomas'd

* unignore .fsi files in Fsharp.Core

* Removing commented out files from fantomasignore

* Automated command ran: fantomas
Co-authored-by: NT-Gro <46543583+T-Gro@users.noreply.github.com>

---------
Co-authored-by: Ngithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
上级 ea1ba7ed
......@@ -107,9 +107,6 @@ src/FSharp.Core/printf.fs
src/FSharp.Core/Query.fs
src/FSharp.Core/seqcore.fs
# Fantomas limitation https://github.com/fsprojects/fantomas/issues/2264
src/FSharp.Core/SI.fs
# Fantomas limitations on implementation files (to investigate)
......@@ -139,8 +136,3 @@ src/FSharp.Core/Query.fsi
src/FSharp.Core/resumable.fsi
src/FSharp.Core/async.fsi
# Fantomas limitations on signature files in FSharp.Core (https://github.com/fsprojects/fantomas/issues/2230)
src/FSharp.Core/array.fsi
src/FSharp.Core/tasks.fsi
src/FSharp.Core/seq.fsi
......@@ -63,19 +63,19 @@ type coulomb = second ampere
/// The SI unit of electric potential difference, electromotive force
[<Measure>]
type volt = watt/ampere
type volt = watt / ampere
/// The SI unit of capacitance
[<Measure>]
type farad = coulomb/volt
type farad = coulomb / volt
/// The SI unit of electric resistance
[<Measure>]
type ohm = volt/ampere
type ohm = volt / ampere
/// The SI unit of electric conductance
[<Measure>]
type siemens = ampere/volt
type siemens = ampere / volt
/// The SI unit of magnetic flux
[<Measure>]
......@@ -83,11 +83,11 @@ type weber = volt second
/// The SI unit of magnetic flux density
[<Measure>]
type tesla = weber/metre^2
type tesla = weber / metre^2
/// The SI unit of inductance
[<Measure>]
type henry = weber/ampere
type henry = weber / ampere
/// The SI unit of luminous flux
[<Measure>]
......@@ -95,7 +95,7 @@ type lumen = candela
/// The SI unit of illuminance
[<Measure>]
type lux = lumen/metre^2
type lux = lumen / metre^2
/// The SI unit of activity referred to a radionuclide
[<Measure>]
......@@ -103,15 +103,15 @@ type becquerel = second^-1
/// The SI unit of absorbed dose
[<Measure>]
type gray = joule/kilogram
type gray = joule / kilogram
/// The SI unit of does equivalent
[<Measure>]
type sievert = joule/kilogram
type sievert = joule / kilogram
/// The SI unit of catalytic activity
[<Measure>]
type katal = mole/second
type katal = mole / second
// Common abbreviations for the International System of Units (SI)
namespace Microsoft.FSharp.Data.UnitSystems.SI.UnitSymbols
......
此差异已折叠。
此差异已折叠。
......@@ -4,19 +4,21 @@
namespace Microsoft.FSharp.Control
open System
open System.Runtime.CompilerServices
open System.Threading.Tasks
open Microsoft.FSharp.Core
open Microsoft.FSharp.Core.CompilerServices
open Microsoft.FSharp.Collections
/// <summary>
/// The extra data stored in ResumableStateMachine for tasks
/// </summary>
[<Struct; NoComparison; NoEquality>]
[<CompilerMessage("This construct is for use by compiled F# code and should not be used directly", 1204, IsHidden=true)>]
type TaskStateMachineData<'T> =
open System
open System.Runtime.CompilerServices
open System.Threading.Tasks
open Microsoft.FSharp.Core
open Microsoft.FSharp.Core.CompilerServices
open Microsoft.FSharp.Collections
/// <summary>
/// The extra data stored in ResumableStateMachine for tasks
/// </summary>
[<Struct; NoComparison; NoEquality>]
[<CompilerMessage("This construct is for use by compiled F# code and should not be used directly",
1204,
IsHidden = true)>]
type TaskStateMachineData<'T> =
/// <summary>
/// Holds the final result of the state machine
......@@ -30,30 +32,34 @@ namespace Microsoft.FSharp.Control
[<DefaultValue(false)>]
val mutable MethodBuilder: AsyncTaskMethodBuilder<'T>
/// <summary>
/// This is used by the compiler as a template for creating state machine structs
/// </summary>
and [<CompilerMessage("This construct is for use by compiled F# code and should not be used directly", 1204, IsHidden=true)>]
TaskStateMachine<'TOverall> = ResumableStateMachine<TaskStateMachineData<'TOverall>>
/// <summary>
/// Represents the runtime continuation of a task state machine created dynamically
/// </summary>
and [<CompilerMessage("This construct is for use by compiled F# code and should not be used directly", 1204, IsHidden=true)>]
TaskResumptionFunc<'TOverall> = ResumptionFunc<TaskStateMachineData<'TOverall>>
/// <summary>
/// A special compiler-recognised delegate type for specifying blocks of task code
/// with access to the state machine.
/// </summary>
and [<CompilerMessage("This construct is for use by compiled F# code and should not be used directly", 1204, IsHidden=true)>]
TaskCode<'TOverall, 'T> = ResumableCode<TaskStateMachineData<'TOverall>, 'T>
/// <summary>
/// Contains methods to build tasks using the F# computation expression syntax
/// </summary>
[<Class>]
type TaskBuilderBase =
/// <summary>
/// This is used by the compiler as a template for creating state machine structs
/// </summary>
and [<CompilerMessage("This construct is for use by compiled F# code and should not be used directly",
1204,
IsHidden = true)>] TaskStateMachine<'TOverall> =
ResumableStateMachine<TaskStateMachineData<'TOverall>>
/// <summary>
/// Represents the runtime continuation of a task state machine created dynamically
/// </summary>
and [<CompilerMessage("This construct is for use by compiled F# code and should not be used directly",
1204,
IsHidden = true)>] TaskResumptionFunc<'TOverall> = ResumptionFunc<TaskStateMachineData<'TOverall>>
/// <summary>
/// A special compiler-recognised delegate type for specifying blocks of task code
/// with access to the state machine.
/// </summary>
and [<CompilerMessage("This construct is for use by compiled F# code and should not be used directly",
1204,
IsHidden = true)>] TaskCode<'TOverall, 'T> = ResumableCode<TaskStateMachineData<'TOverall>, 'T>
/// <summary>
/// Contains methods to build tasks using the F# computation expression syntax
/// </summary>
[<Class>]
type TaskBuilderBase =
/// <summary>
/// Specifies the sequential composition of two units of task code.
......@@ -78,19 +84,22 @@ namespace Microsoft.FSharp.Control
/// <summary>
/// Specifies a unit of task code which excuted using try/finally semantics
/// </summary>
member inline TryFinally: body: TaskCode<'TOverall, 'T> * [<InlineIfLambda>] compensation: (unit -> unit) -> TaskCode<'TOverall, 'T>
member inline TryFinally:
body: TaskCode<'TOverall, 'T> * [<InlineIfLambda>] compensation: (unit -> unit) -> TaskCode<'TOverall, 'T>
/// <summary>
/// Specifies a unit of task code which excuted using try/with semantics
/// </summary>
member inline TryWith: body: TaskCode<'TOverall, 'T> * catch: (exn -> TaskCode<'TOverall, 'T>) -> TaskCode<'TOverall, 'T>
member inline TryWith:
body: TaskCode<'TOverall, 'T> * catch: (exn -> TaskCode<'TOverall, 'T>) -> TaskCode<'TOverall, 'T>
#if NETSTANDARD2_1
#if NETSTANDARD2_1
/// <summary>
/// Specifies a unit of task code which binds to the resource implementing IAsyncDisposable and disposes it asynchronously
/// </summary>
member inline Using<'Resource, 'TOverall, 'T when 'Resource :> IAsyncDisposable> : resource: 'Resource * body: ('Resource -> TaskCode<'TOverall, 'T>) -> TaskCode<'TOverall, 'T>
#endif
member inline Using<'Resource, 'TOverall, 'T when 'Resource :> IAsyncDisposable> :
resource: 'Resource * body: ('Resource -> TaskCode<'TOverall, 'T>) -> TaskCode<'TOverall, 'T>
#endif
/// <summary>
/// Specifies the iterative execution of a unit of task code.
......@@ -103,11 +112,11 @@ namespace Microsoft.FSharp.Control
[<DefaultValue>]
member inline Zero: unit -> TaskCode<'TOverall, unit>
/// <summary>
/// Contains methods to build tasks using the F# computation expression syntax
/// </summary>
[<Class>]
type TaskBuilder =
/// <summary>
/// Contains methods to build tasks using the F# computation expression syntax
/// </summary>
[<Class>]
type TaskBuilder =
inherit TaskBuilderBase
/// <summary>
......@@ -118,11 +127,11 @@ namespace Microsoft.FSharp.Control
/// Hosts the task code in a state machine and starts the task.
member inline Run: code: TaskCode<'T, 'T> -> Task<'T>
/// <summary>
/// Contains methods to build tasks using the F# computation expression syntax
/// </summary>
[<Class>]
type BackgroundTaskBuilder =
/// <summary>
/// Contains methods to build tasks using the F# computation expression syntax
/// </summary>
[<Class>]
type BackgroundTaskBuilder =
inherit TaskBuilderBase
/// <summary>
......@@ -135,9 +144,9 @@ namespace Microsoft.FSharp.Control
/// </summary>
member inline Run: code: TaskCode<'T, 'T> -> Task<'T>
/// Contains the `task` computation expression builder.
[<AutoOpen>]
module TaskBuilder =
/// Contains the `task` computation expression builder.
[<AutoOpen>]
module TaskBuilder =
/// <summary>
/// Builds a task using computation expression syntax.
......@@ -161,38 +170,37 @@ namespace Microsoft.FSharp.Control
/// <example-tbd></example-tbd>
val backgroundTask: BackgroundTaskBuilder
// Contains the `task` computation expression builder.
namespace Microsoft.FSharp.Control.TaskBuilderExtensions
open System
open System.Runtime.CompilerServices
open System.Threading.Tasks
open Microsoft.FSharp.Core
open Microsoft.FSharp.Control
open Microsoft.FSharp.Core.CompilerServices
open System
open System.Runtime.CompilerServices
open System.Threading.Tasks
open Microsoft.FSharp.Core
open Microsoft.FSharp.Control
open Microsoft.FSharp.Core.CompilerServices
/// <summary>
/// Contains low-priority overloads for the `task` computation expression builder.
/// </summary>
//
// Note: they are low priority because they are auto-opened first, and F# has a rule
// that extension method opened later in sequence get higher priority
//
// AutoOpen is by assembly attribute to get sequencing of AutoOpen correct and
// so each gives different priority
module LowPriority =
/// <summary>
/// Contains low-priority overloads for the `task` computation expression builder.
/// </summary>
//
// Note: they are low priority because they are auto-opened first, and F# has a rule
// that extension method opened later in sequence get higher priority
//
// AutoOpen is by assembly attribute to get sequencing of AutoOpen correct and
// so each gives different priority
module LowPriority =
type TaskBuilderBase with
/// <summary>
/// Specifies a unit of task code which draws a result from a task-like value
/// satisfying the GetAwaiter pattern and calls a continuation.
/// </summary>
[<NoEagerConstraintApplication>]
member inline Bind< ^TaskLike, 'TResult1, 'TResult2, ^Awaiter, 'TOverall > :
task: ^TaskLike *
continuation: ( 'TResult1 -> TaskCode<'TOverall, 'TResult2>)
-> TaskCode<'TOverall, 'TResult2>
member inline Bind< ^TaskLike, 'TResult1, 'TResult2, ^Awaiter, 'TOverall> :
task: ^TaskLike * continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>) ->
TaskCode<'TOverall, 'TResult2>
when ^TaskLike: (member GetAwaiter: unit -> ^Awaiter)
and ^Awaiter :> ICriticalNotifyCompletion
and ^Awaiter: (member get_IsCompleted: unit -> bool)
......@@ -204,8 +212,7 @@ namespace Microsoft.FSharp.Control.TaskBuilderExtensions
/// </summary>
[<NoEagerConstraintApplication>]
member inline ReturnFrom< ^TaskLike, ^Awaiter, 'T> :
task: ^TaskLike
-> TaskCode< 'T, 'T >
task: ^TaskLike -> TaskCode<'T, 'T>
when ^TaskLike: (member GetAwaiter: unit -> ^Awaiter)
and ^Awaiter :> ICriticalNotifyCompletion
and ^Awaiter: (member get_IsCompleted: unit -> bool)
......@@ -215,11 +222,11 @@ namespace Microsoft.FSharp.Control.TaskBuilderExtensions
/// The entry point for the dynamic implementation of the corresponding operation. Do not use directly, only used when executing quotations that involve tasks or other reflective execution of F# code.
/// </summary>
[<NoEagerConstraintApplication>]
static member inline BindDynamic< ^TaskLike, 'TResult1, 'TResult2, ^Awaiter, 'TOverall > :
static member inline BindDynamic< ^TaskLike, 'TResult1, 'TResult2, ^Awaiter, 'TOverall> :
sm: byref<TaskStateMachine<'TOverall>> *
task: ^TaskLike *
continuation: ( 'TResult1 -> TaskCode<'TOverall, 'TResult2>)
-> bool
continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>) ->
bool
when ^TaskLike: (member GetAwaiter: unit -> ^Awaiter)
and ^Awaiter :> ICriticalNotifyCompletion
and ^Awaiter: (member get_IsCompleted: unit -> bool)
......@@ -229,14 +236,13 @@ namespace Microsoft.FSharp.Control.TaskBuilderExtensions
/// Specifies a unit of task code which binds to the resource implementing IDisposable and disposes it synchronously
/// </summary>
member inline Using:
resource: 'Resource *
body: ('Resource -> TaskCode<'TOverall, 'T>)
-> TaskCode<'TOverall, 'T> when 'Resource :> IDisposable
resource: 'Resource * body: ('Resource -> TaskCode<'TOverall, 'T>) -> TaskCode<'TOverall, 'T>
when 'Resource :> IDisposable
/// <summary>
/// Contains medium-priority overloads for the `task` computation expression builder.
/// </summary>
module MediumPriority =
/// <summary>
/// Contains medium-priority overloads for the `task` computation expression builder.
/// </summary>
module MediumPriority =
type TaskBuilderBase with
......@@ -244,37 +250,32 @@ namespace Microsoft.FSharp.Control.TaskBuilderExtensions
/// Specifies a unit of task code which draws a result from an F# async value then calls a continuation.
/// </summary>
member inline Bind:
computation: Async<'TResult1> *
continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>)
-> TaskCode<'TOverall, 'TResult2>
computation: Async<'TResult1> * continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>) ->
TaskCode<'TOverall, 'TResult2>
/// <summary>
/// Specifies a unit of task code which draws a result from an F# async value.
/// </summary>
member inline ReturnFrom:
computation: Async<'T>
-> TaskCode<'T, 'T>
member inline ReturnFrom: computation: Async<'T> -> TaskCode<'T, 'T>
/// <summary>
/// Contains high-priority overloads for the `task` computation expression builder.
/// </summary>
module HighPriority =
/// <summary>
/// Contains high-priority overloads for the `task` computation expression builder.
/// </summary>
module HighPriority =
type TaskBuilderBase with
/// <summary>
/// Specifies a unit of task code which draws a result from a task then calls a continuation.
/// </summary>
member inline Bind:
task: Task<'TResult1> *
continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>)
-> TaskCode<'TOverall, 'TResult2>
task: Task<'TResult1> * continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>) ->
TaskCode<'TOverall, 'TResult2>
/// <summary>
/// Specifies a unit of task code which draws a result from a task.
/// </summary>
member inline ReturnFrom:
task: Task<'T>
-> TaskCode<'T, 'T>
member inline ReturnFrom: task: Task<'T> -> TaskCode<'T, 'T>
/// <summary>
/// The entry point for the dynamic implementation of the corresponding operation. Do not use directly, only used when executing quotations that involve tasks or other reflective execution of F# code.
......@@ -282,5 +283,5 @@ namespace Microsoft.FSharp.Control.TaskBuilderExtensions
static member BindDynamic:
sm: byref<TaskStateMachine<'TOverall>> *
task: Task<'TResult1> *
continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>)
-> bool
continuation: ('TResult1 -> TaskCode<'TOverall, 'TResult2>) ->
bool
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册