* Update to fantomas 5.0.3. 
* Expend ignore patterns.
This commit is contained in:
Florian Verdonck 2022-10-10 16:50:50 +02:00 коммит произвёл GitHub
Родитель 8d279634de
Коммит 67f9ccff7d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
12 изменённых файлов: 99 добавлений и 78 удалений

Просмотреть файл

@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"fantomas": {
"version": "5.0.0-beta-005",
"version": "5.0.3",
"commands": [
"fantomas"
]

Просмотреть файл

@ -12,14 +12,79 @@ artifacts/
# Explicitly unformatted implementation files
src/Compiler/Checking/**/*.fs
src/Compiler/DependencyManager/**/*.fs
src/Compiler/Facilities/**/*.fs
src/Compiler/Interactive/**/*.fs
src/Compiler/Legacy/**/*.fs
src/Compiler/Optimize/**/*.fs
src/Compiler/Symbols/**/*.fs
src/Compiler/TypedTree/**/*.fs
src/Compiler/Checking/AccessibilityLogic.fs
src/Compiler/Checking/AttributeChecking.fs
src/Compiler/Checking/AugmentWithHashCompare.fs
src/Compiler/Checking/CheckBasics.fs
src/Compiler/Checking/CheckComputationExpressions.fs
src/Compiler/Checking/CheckDeclarations.fs
src/Compiler/Checking/CheckExpressions.fs
src/Compiler/Checking/CheckFormatStrings.fs
src/Compiler/Checking/CheckIncrementalClasses.fs
src/Compiler/Checking/CheckPatterns.fs
src/Compiler/Checking/ConstraintSolver.fs
src/Compiler/Checking/FindUnsolved.fs
src/Compiler/Checking/import.fs
src/Compiler/Checking/InfoReader.fs
src/Compiler/Checking/infos.fs
src/Compiler/Checking/MethodCalls.fs
src/Compiler/Checking/MethodOverrides.fs
src/Compiler/Checking/NameResolution.fs
src/Compiler/Checking/NicePrint.fs
src/Compiler/Checking/PatternMatchCompilation.fs
src/Compiler/Checking/PostInferenceChecks.fs
src/Compiler/Checking/QuotationTranslator.fs
src/Compiler/Checking/SignatureConformance.fs
src/Compiler/Checking/TypeHierarchy.fs
src/Compiler/Checking/TypeRelations.fs
src/Compiler/DependencyManager/AssemblyResolveHandler.fs
src/Compiler/DependencyManager/DependencyProvider.fs
src/Compiler/DependencyManager/NativeDllResolveHandler.fs
src/Compiler/Facilities/BuildGraph.fs
src/Compiler/Facilities/CompilerLocation.fs
src/Compiler/Facilities/DiagnosticOptions.fs
src/Compiler/Facilities/DiagnosticResolutionHints.fs
src/Compiler/Facilities/DiagnosticsLogger.fs
src/Compiler/Facilities/LanguageFeatures.fs
src/Compiler/Facilities/Logger.fs
src/Compiler/Facilities/prim-lexing.fs
src/Compiler/Facilities/prim-parsing.fs
src/Compiler/Facilities/ReferenceResolver.fs
src/Compiler/Facilities/SimulatedMSBuildReferenceResolver.fs
src/Compiler/Facilities/TextLayoutRender.fs
src/Compiler/Interactive/ControlledExecution.fs
src/Compiler/Interactive/fsi.fs
src/Compiler/Legacy/LegacyHostedCompilerForTesting.fs
src/Compiler/Legacy/LegacyMSBuildReferenceResolver.fs
src/Compiler/Optimize/DetupleArgs.fs
src/Compiler/Optimize/InnerLambdasToTopLevelFuncs.fs
src/Compiler/Optimize/LowerCalls.fs
src/Compiler/Optimize/LowerComputedCollections.fs
src/Compiler/Optimize/LowerLocalMutables.fs
src/Compiler/Optimize/LowerSequences.fs
src/Compiler/Optimize/LowerStateMachines.fs
src/Compiler/Optimize/Optimizer.fs
src/Compiler/Symbols/Exprs.fs
src/Compiler/Symbols/FSharpDiagnostic.fs
src/Compiler/Symbols/SymbolHelpers.fs
src/Compiler/Symbols/SymbolPatterns.fs
src/Compiler/Symbols/Symbols.fs
src/Compiler/TypedTree/CompilerGlobalState.fs
src/Compiler/TypedTree/QuotationPickler.fs
src/Compiler/TypedTree/tainted.fs
src/Compiler/TypedTree/TcGlobals.fs
src/Compiler/TypedTree/TypedTree.fs
src/Compiler/TypedTree/TypedTreeBasics.fs
src/Compiler/TypedTree/TypedTreeOps.fs
src/Compiler/TypedTree/TypedTreePickle.fs
src/Compiler/TypedTree/TypeProviders.fs
# Explicitly unformatted file that needs more care to get it to format well

Просмотреть файл

@ -2840,9 +2840,7 @@ let ComputeDebugPointForBinding g bind =
| DebugPointAtBinding.NoneAtDo, _ -> false, None
| DebugPointAtBinding.NoneAtLet, _ -> false, None
// Don't emit debug points for lambdas.
| _,
(Expr.Lambda _
| Expr.TyLambda _) -> false, None
| _, (Expr.Lambda _ | Expr.TyLambda _) -> false, None
| DebugPointAtBinding.Yes m, _ -> false, Some m
//-------------------------------------------------------------------------
@ -5134,21 +5132,10 @@ and GenAsmCode cenv cgbuf eenv (il, tyargs, args, returnTys, m) sequel =
// For these we can just generate the argument and change the test (from a brfalse to a brtrue and vice versa)
| ([ AI_ceq ],
[ arg1
Expr.Const ((Const.Bool false
| Const.SByte 0y
| Const.Int16 0s
| Const.Int32 0
| Const.Int64 0L
| Const.Byte 0uy
| Const.UInt16 0us
| Const.UInt32 0u
| Const.UInt64 0UL),
Expr.Const ((Const.Bool false | Const.SByte 0y | Const.Int16 0s | Const.Int32 0 | Const.Int64 0L | Const.Byte 0uy | Const.UInt16 0us | Const.UInt32 0u | Const.UInt64 0UL),
_,
_) ],
CmpThenBrOrContinue (1,
[ I_brcmp ((BI_brfalse
| BI_brtrue) as bi,
label1) ]),
CmpThenBrOrContinue (1, [ I_brcmp ((BI_brfalse | BI_brtrue) as bi, label1) ]),
_) ->
let bi =
@ -7903,9 +7890,7 @@ and GenDecisionTreeTest
// If so, emit the failure logic, then came back and do the success target, then
// do any postponed failure target.
match successTree, failureTree with
| TDSuccess _,
(TDBind _
| TDSwitch _) ->
| TDSuccess _, (TDBind _ | TDSwitch _) ->
// OK, there is more logic in the decision tree on the failure branch
let success = CG.GenerateDelayMark cgbuf "testSuccess"
@ -10641,10 +10626,9 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) =
| None -> None
| Some memberInfo ->
match name, memberInfo.MemberFlags.MemberKind with
| ("Item"
| "op_IndexedLookup"),
(SynMemberKind.PropertyGet
| SynMemberKind.PropertySet) when not (isNil (ArgInfosOfPropertyVal g vref.Deref)) ->
| ("Item" | "op_IndexedLookup"), (SynMemberKind.PropertyGet | SynMemberKind.PropertySet) when
not (isNil (ArgInfosOfPropertyVal g vref.Deref))
->
Some(
mkILCustomAttribute (
g.FindSysILTypeRef "System.Reflection.DefaultMemberAttribute",

Просмотреть файл

@ -844,10 +844,7 @@ let ProcessMetaCommandsFromInput
| ParsedHashDirective ("nowarn", ParsedHashDirectiveArguments numbers, m) ->
List.fold (fun state d -> nowarnF state (m, d)) state numbers
| ParsedHashDirective (("reference"
| "r"),
ParsedHashDirectiveArguments args,
m) ->
| ParsedHashDirective (("reference" | "r"), ParsedHashDirectiveArguments args, m) ->
matchedm <- m
ProcessDependencyManagerDirective Directive.Resolution args m state

Просмотреть файл

@ -247,9 +247,7 @@ type FSharpSymbolUse(denv: DisplayEnv, symbol: FSharpSymbol, inst: TyparInstanti
// 'seq' in 'seq { ... }' gets colored as keywords
| Item.Value vref, ItemOccurence.Use when valRefEq denv.g denv.g.seq_vref vref -> true
// custom builders, custom operations get colored as keywords
| (Item.CustomBuilder _
| Item.CustomOperation _),
ItemOccurence.Use -> true
| (Item.CustomBuilder _ | Item.CustomOperation _), ItemOccurence.Use -> true
| _ -> false
member _.IsFromOpenStatement = itemOcc = ItemOccurence.Open
@ -2306,14 +2304,8 @@ module internal ParseAndCheckFile =
matchBraces stackAfterMatch
| LPAREN
| LBRACE _
| LBRACK
| LBRACE_BAR
| LBRACK_BAR
| LQUOTE _
| LBRACK_LESS as tok,
_ -> matchBraces ((tok, lexbuf.LexemeRange) :: stack)
| LPAREN | LBRACE _ | LBRACK | LBRACE_BAR | LBRACK_BAR | LQUOTE _ | LBRACK_LESS as tok, _ ->
matchBraces ((tok, lexbuf.LexemeRange) :: stack)
// INTERP_STRING_BEGIN_PART corresponds to $"... {" at the start of an interpolated string
//
@ -2322,9 +2314,7 @@ module internal ParseAndCheckFile =
// interpolation expression)
//
// Either way we start a new potential match at the last character
| INTERP_STRING_BEGIN_PART _
| INTERP_STRING_PART _ as tok,
_ ->
| INTERP_STRING_BEGIN_PART _ | INTERP_STRING_PART _ as tok, _ ->
let m = lexbuf.LexemeRange
let m2 =
@ -2332,9 +2322,7 @@ module internal ParseAndCheckFile =
matchBraces ((tok, m2) :: stack)
| (EOF _
| LEX_FAILURE _),
_ -> ()
| (EOF _ | LEX_FAILURE _), _ -> ()
| _ -> matchBraces stack
matchBraces [])

Просмотреть файл

@ -212,10 +212,8 @@ module TcResolutionsExtensions =
resolutions
|> Array.iter (fun cnr ->
match cnr.Item, cnr.ItemOccurence, cnr.Range with
| (Item.CustomBuilder _
| Item.CustomOperation _),
ItemOccurence.Use,
m -> add m SemanticClassificationType.ComputationExpression
| (Item.CustomBuilder _ | Item.CustomOperation _), ItemOccurence.Use, m ->
add m SemanticClassificationType.ComputationExpression
| Item.Value vref, _, m when isValRefMutable g vref -> add m SemanticClassificationType.MutableVar

Просмотреть файл

@ -205,13 +205,9 @@ module internal TokenClassifications =
// (this isn't entirely correct, but it'll work for now - see bug 3727)
(FSharpTokenColorKind.Number, FSharpTokenCharKind.Operator, FSharpTokenTriggerClass.None)
| INFIX_STAR_DIV_MOD_OP ("mod"
| "land"
| "lor"
| "lxor")
| INFIX_STAR_STAR_OP ("lsl"
| "lsr"
| "asr") -> (FSharpTokenColorKind.Keyword, FSharpTokenCharKind.Keyword, FSharpTokenTriggerClass.None)
| INFIX_STAR_DIV_MOD_OP ("mod" | "land" | "lor" | "lxor")
| INFIX_STAR_STAR_OP ("lsl" | "lsr" | "asr") ->
(FSharpTokenColorKind.Keyword, FSharpTokenCharKind.Keyword, FSharpTokenTriggerClass.None)
| LPAREN_STAR_RPAREN
| DOLLAR

Просмотреть файл

@ -2037,10 +2037,7 @@ module ParsedInput =
result <- Some(oldScope, oldPos, true)
| Some (oldScope, oldPos, _), _ ->
match kind, oldScope.Kind with
| (Namespace
| NestedModule
| TopModule),
OpenDeclaration
| (Namespace | NestedModule | TopModule), OpenDeclaration
| _ when oldPos.Line <= line ->
result <-
Some(

Просмотреть файл

@ -2,6 +2,7 @@
/// Code to pickle out quotations in the quotation binary format.
module internal FSharp.Compiler.QuotationPickler
#nowarn "1178"
type TypeData

Просмотреть файл

@ -1,6 +1,7 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
namespace Microsoft.FSharp.Core
open Microsoft.FSharp.Core
[<AutoOpen>]

Просмотреть файл

@ -942,14 +942,8 @@ module Patterns =
| VarSetOp, _
| AddressSetOp, _ -> typeof<Unit>
| AddressOfOp, [ expr ] -> (typeOf expr).MakeByRefType()
| (AddressOfOp
| QuoteOp _
| SequentialOp
| TryWithOp
| TryFinallyOp
| IfThenElseOp
| AppOp),
_ -> failwith "unreachable"
| (AddressOfOp | QuoteOp _ | SequentialOp | TryWithOp | TryFinallyOp | IfThenElseOp | AppOp), _ ->
failwith "unreachable"
//--------------------------------------------------------------------------
// Constructors for building Raw quotations
@ -2933,8 +2927,7 @@ module DerivedPatterns =
let (|SpecificCall|_|) templateParameter =
// Note: precomputation
match templateParameter with
| (Lambdas (_, Call (_, minfo1, _))
| Call (_, minfo1, _)) ->
| (Lambdas (_, Call (_, minfo1, _)) | Call (_, minfo1, _)) ->
let isg1 = minfo1.IsGenericMethod
let gmd =

Просмотреть файл

@ -1,6 +1,7 @@
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
namespace Microsoft.FSharp.Collections
open System
open System.Collections
open System.Collections.Generic