From 6d47a3aa51978bb786db3c34cb6e096af5115e9e Mon Sep 17 00:00:00 2001 From: nojaf Date: Wed, 22 Nov 2023 16:33:50 +0100 Subject: [PATCH 1/2] Update SDK, FCS and tools. --- .config/dotnet-tools.json | 4 +- Directory.Build.props | 3 ++ Directory.Packages.props | 4 +- global.json | 2 +- src/FSharp.Analyzers.SDK/ASTCollecting.fs | 43 +++++++++++-------- .../FSharp.Analyzers.SDK.fs | 4 +- .../FSharp.Analyzers.SDK.fsi | 4 +- 7 files changed, 36 insertions(+), 28 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index acfe1f4..ad2d7f5 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,13 +3,13 @@ "isRoot": true, "tools": { "fantomas": { - "version": "6.2.1", + "version": "6.3.0-alpha-003", "commands": [ "fantomas" ] }, "fsdocs-tool": { - "version": "20.0.0-alpha-009", + "version": "20.0.0-alpha-014", "commands": [ "fsdocs" ] diff --git a/Directory.Build.props b/Directory.Build.props index e566491..d49507f 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -7,6 +7,9 @@ true $(MSBuildThisFileDirectory)CHANGELOG.md README.md + $(WarnOn);1182 + $(WarnOn);3390 + true $(OtherFlags) --test:GraphBasedChecking --test:ParallelOptimization --test:ParallelIlxGen diff --git a/Directory.Packages.props b/Directory.Packages.props index 1ba7b8c..2aeb53c 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,8 +5,8 @@ - - + + diff --git a/global.json b/global.json index 96f0cfd..c19a2e0 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "7.0.400", + "version": "8.0.100", "rollForward": "latestMinor" } } diff --git a/src/FSharp.Analyzers.SDK/ASTCollecting.fs b/src/FSharp.Analyzers.SDK/ASTCollecting.fs index 2c82266..d7c391a 100644 --- a/src/FSharp.Analyzers.SDK/ASTCollecting.fs +++ b/src/FSharp.Analyzers.SDK/ASTCollecting.fs @@ -121,9 +121,10 @@ module ASTCollecting = and walkAttribute (attr: SynAttribute) = walkExpr attr.ArgExpr - and walkTyparDecl (SynTyparDecl(attributes = AllAttrs attrs; Item2 = typar)) = + and walkTyparDecl (SynTyparDecl(attributes = AllAttrs attrs; typar = typar; intersectionConstraints = ts)) = List.iter walkAttribute attrs walkTypar typar + List.iter walkType ts and walkTyparDecls (typars: SynTyparDecls) = typars.TyparDecls |> List.iter walkTyparDecl @@ -180,7 +181,6 @@ module ASTCollecting = | SynPat.Record(_, r) -> () | SynPat.Null r -> () | SynPat.OptionalVal(_, r) -> () - | SynPat.DeprecatedCharRange(_, _, r) -> () | SynPat.InstanceMember(_, _, _, accessibility, r) -> () | SynPat.FromParseError(_, r) -> () | SynPat.As(lpat, rpat, r) -> @@ -251,6 +251,9 @@ module ASTCollecting = walkType lhs walkType rhs | SynType.FromParseError r -> () + | SynType.Intersection(typar, types, _, _) -> + Option.iter walkTypar typar + List.iter walkType types and walkClause (SynMatchClause(pat, e1, e2, r, _, _) as s) = walker.WalkClause s @@ -365,30 +368,30 @@ module ASTCollecting = walkType t walkMemberSig sign walkExpr e - | SynExpr.Const(SynConst.Measure(_, _, m), r) -> walkMeasure m + | SynExpr.Const(SynConst.Measure(synMeasure = m), _) -> walkMeasure m | SynExpr.Const(_, r) -> () | SynExpr.AnonRecd(isStruct, copyInfo, recordFields, r, trivia) -> () | SynExpr.Sequential(seqPoint, isTrueSeq, expr1, expr2, r) -> () | SynExpr.Ident _ -> () | SynExpr.LongIdent(isOptional, longDotId, altNameRefCell, r) -> () - | SynExpr.Set(_, _, r) -> () + | SynExpr.Set(range = r) -> () | SynExpr.Null r -> () | SynExpr.ImplicitZero r -> () | SynExpr.MatchBang(range = r) -> () - | SynExpr.LibraryOnlyILAssembly(_, _, _, _, r) -> () - | SynExpr.LibraryOnlyStaticOptimization(_, _, _, r) -> () + | SynExpr.LibraryOnlyILAssembly(range = r) -> () + | SynExpr.LibraryOnlyStaticOptimization(range = r) -> () | SynExpr.LibraryOnlyUnionCaseFieldGet(expr, longId, _, r) -> () - | SynExpr.LibraryOnlyUnionCaseFieldSet(_, longId, _, _, r) -> () + | SynExpr.LibraryOnlyUnionCaseFieldSet(longId = longId; range = r) -> () | SynExpr.ArbitraryAfterError(debugStr, r) -> () | SynExpr.FromParseError(expr, r) -> () - | SynExpr.DiscardAfterMissingQualificationAfterDot(_, _, r) -> () + | SynExpr.DiscardAfterMissingQualificationAfterDot(range = r) -> () | SynExpr.Fixed(expr, r) -> () | SynExpr.InterpolatedString(parts, kind, r) -> for part in parts do walkInterpolatedStringPart part | SynExpr.IndexFromEnd(itemExpr, r) -> walkExpr itemExpr - | SynExpr.IndexRange(e1, _, e2, _, _, r) -> + | SynExpr.IndexRange(expr1 = e1; expr2 = e2; range = r) -> Option.iter walkExpr e1 Option.iter walkExpr e2 | SynExpr.DebugPoint(innerExpr = expr) -> walkExpr expr @@ -396,21 +399,27 @@ module ASTCollecting = walkExpr e1 walkExpr e2 | SynExpr.Typar(t, r) -> walkTypar t + | SynExpr.DotLambda(expr = e) -> walkExpr e + | SynExpr.WhileBang(whileExpr = whileExpr; doExpr = doExpr) -> + walkExpr whileExpr + walkExpr doExpr and walkMeasure s = walker.WalkMeasure s match s with - | SynMeasure.Product(m1, m2, r) - | SynMeasure.Divide(m1, m2, r) -> + | SynMeasure.Product(measure1 = m1; measure2 = m2) -> walkMeasure m1 walkMeasure m2 - | SynMeasure.Named(longIdent, r) -> () - | SynMeasure.Seq(ms, r) -> List.iter walkMeasure ms - | SynMeasure.Power(m, _, r) -> walkMeasure m - | SynMeasure.Var(ty, r) -> walkTypar ty - | SynMeasure.Paren(m, r) -> walkMeasure m - | SynMeasure.One + | SynMeasure.Divide(measure1 = m1; measure2 = m2) -> + Option.iter walkMeasure m1 + walkMeasure m2 + | SynMeasure.Named _ -> () + | SynMeasure.Seq(ms, _) -> List.iter walkMeasure ms + | SynMeasure.Power(measure = m) -> walkMeasure m + | SynMeasure.Var(ty, _) -> walkTypar ty + | SynMeasure.Paren(m, _) -> walkMeasure m + | SynMeasure.One _ | SynMeasure.Anon _ -> () and walkSimplePat s = diff --git a/src/FSharp.Analyzers.SDK/FSharp.Analyzers.SDK.fs b/src/FSharp.Analyzers.SDK/FSharp.Analyzers.SDK.fs index 91c589b..564d950 100644 --- a/src/FSharp.Analyzers.SDK/FSharp.Analyzers.SDK.fs +++ b/src/FSharp.Analyzers.SDK/FSharp.Analyzers.SDK.fs @@ -90,9 +90,7 @@ type EditorAnalyzerAttribute member _.Name = name -type Context = - interface - end +type Context = interface end type CliContext = { diff --git a/src/FSharp.Analyzers.SDK/FSharp.Analyzers.SDK.fsi b/src/FSharp.Analyzers.SDK/FSharp.Analyzers.SDK.fsi index 6b574a2..960d586 100644 --- a/src/FSharp.Analyzers.SDK/FSharp.Analyzers.SDK.fsi +++ b/src/FSharp.Analyzers.SDK/FSharp.Analyzers.SDK.fsi @@ -44,9 +44,7 @@ type EditorAnalyzerAttribute = member Name: string /// Marker interface which both the CliContext and EditorContext implement -type Context = - interface - end +type Context = interface end /// All the relevant compiler information for a given file. /// Contains the source text, untyped and typed tree information. From 9b067395979fa034c0ab869676f4cf73f8f9b2b6 Mon Sep 17 00:00:00 2001 From: nojaf Date: Wed, 22 Nov 2023 16:34:31 +0100 Subject: [PATCH 2/2] Add changelog entry --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 08fcabc..060ae95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.21.0] - 2023-11-22 + +### Changed +* [Update FCS to 43.8.100](https://github.com/ionide/FSharp.Analyzers.SDK/pull/168) (thanks @nojaf!) + ## [0.20.2] - 2023-11-14 ### Fixed