From 025b5de26ae76e867d47a4047d85d2ab5683940b Mon Sep 17 00:00:00 2001 From: Zaid Date: Fri, 26 Mar 2021 09:50:38 +0100 Subject: [PATCH] Npgsql.FSharp.Analyzer v3.23.0 fixe parser issue that wasn't able to pick up explicitly typed functions --- RELEASE_NOTES.md | 3 +++ src/FParsec/AssemblyInfo.fs | 20 +++++++++---------- src/NpgsqlFSharpAnalyzer.Core/AssemblyInfo.fs | 20 +++++++++---------- .../SyntacticAnalysis.fs | 2 ++ src/NpgsqlFSharpAnalyzer/AssemblyInfo.fs | 20 +++++++++---------- src/NpgsqlFSharpParser/AssemblyInfo.fs | 20 +++++++++---------- .../source.extension.vsixmanifest | 2 +- src/Ubik/AssemblyInfo.fs | 20 +++++++++---------- src/Ubik/Ubik.fsproj | 4 ++-- .../AssemblyInfo.fs | 20 +++++++++---------- tests/NpgsqlFSharpAnalyzer.Tests/Tests.fs | 2 +- tests/examples/hashing/AssemblyInfo.fs | 20 +++++++++---------- tests/examples/hashing/syntacticAnalysis.fs | 6 ++++++ 13 files changed, 85 insertions(+), 74 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 0adee46..004442f 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,6 @@ +### 3.23.0 - 2021-03-26 +* Detect typed let bindings + ### 3.22.1 - 2021-02-09 * Let the analyzer continue its work when it comes across enum types diff --git a/src/FParsec/AssemblyInfo.fs b/src/FParsec/AssemblyInfo.fs index 1a39b01..b5d6270 100644 --- a/src/FParsec/AssemblyInfo.fs +++ b/src/FParsec/AssemblyInfo.fs @@ -4,20 +4,20 @@ open System.Reflection [] [] -[] -[] -[] -[] +[] +[] +[] +[] [] -[] +[] do () module internal AssemblyVersionInformation = let [] AssemblyTitle = "FParsec" let [] AssemblyProduct = "NpgsqlFSharpAnalyzer" - let [] AssemblyVersion = "3.22.1" - let [] AssemblyMetadata_ReleaseDate = "2021-02-09T00:00:00.0000000" - let [] AssemblyFileVersion = "3.22.1" - let [] AssemblyInformationalVersion = "3.22.1" + let [] AssemblyVersion = "3.23.0" + let [] AssemblyMetadata_ReleaseDate = "2021-03-26T00:00:00.0000000" + let [] AssemblyFileVersion = "3.23.0" + let [] AssemblyInformationalVersion = "3.23.0" let [] AssemblyMetadata_ReleaseChannel = "release" - let [] AssemblyMetadata_GitHash = "959f00c74c33e6cb5064595bf6107bcb11b215b3" + let [] AssemblyMetadata_GitHash = "bc8bff18abbd6b4cfd14b67738c9ec22a5412c90" diff --git a/src/NpgsqlFSharpAnalyzer.Core/AssemblyInfo.fs b/src/NpgsqlFSharpAnalyzer.Core/AssemblyInfo.fs index 8c35713..f504a8e 100644 --- a/src/NpgsqlFSharpAnalyzer.Core/AssemblyInfo.fs +++ b/src/NpgsqlFSharpAnalyzer.Core/AssemblyInfo.fs @@ -4,20 +4,20 @@ open System.Reflection [] [] -[] -[] -[] -[] +[] +[] +[] +[] [] -[] +[] do () module internal AssemblyVersionInformation = let [] AssemblyTitle = "NpgsqlFSharpAnalyzer.Core" let [] AssemblyProduct = "NpgsqlFSharpAnalyzer" - let [] AssemblyVersion = "3.22.1" - let [] AssemblyMetadata_ReleaseDate = "2021-02-09T00:00:00.0000000" - let [] AssemblyFileVersion = "3.22.1" - let [] AssemblyInformationalVersion = "3.22.1" + let [] AssemblyVersion = "3.23.0" + let [] AssemblyMetadata_ReleaseDate = "2021-03-26T00:00:00.0000000" + let [] AssemblyFileVersion = "3.23.0" + let [] AssemblyInformationalVersion = "3.23.0" let [] AssemblyMetadata_ReleaseChannel = "release" - let [] AssemblyMetadata_GitHash = "959f00c74c33e6cb5064595bf6107bcb11b215b3" + let [] AssemblyMetadata_GitHash = "bc8bff18abbd6b4cfd14b67738c9ec22a5412c90" diff --git a/src/NpgsqlFSharpAnalyzer.Core/SyntacticAnalysis.fs b/src/NpgsqlFSharpAnalyzer.Core/SyntacticAnalysis.fs index cc02ef4..a11383e 100644 --- a/src/NpgsqlFSharpAnalyzer.Core/SyntacticAnalysis.fs +++ b/src/NpgsqlFSharpAnalyzer.Core/SyntacticAnalysis.fs @@ -513,6 +513,8 @@ module SyntacticAnalysis = match expr with | SynExpr.CompExpr(isArrayOrList, _, innerExpr, range) -> visitSyntacticExpression innerExpr range + | SynExpr.Typed(innerExpr, returnType, range) -> + visitSyntacticExpression innerExpr range | SynExpr.YieldOrReturn(_, innerExpr, innerRange) -> visitSyntacticExpression innerExpr innerRange | SynExpr.YieldOrReturnFrom(_, innerExpr, innerRange) -> diff --git a/src/NpgsqlFSharpAnalyzer/AssemblyInfo.fs b/src/NpgsqlFSharpAnalyzer/AssemblyInfo.fs index ffd7c64..fe204f0 100644 --- a/src/NpgsqlFSharpAnalyzer/AssemblyInfo.fs +++ b/src/NpgsqlFSharpAnalyzer/AssemblyInfo.fs @@ -4,20 +4,20 @@ open System.Reflection [] [] -[] -[] -[] -[] +[] +[] +[] +[] [] -[] +[] do () module internal AssemblyVersionInformation = let [] AssemblyTitle = "NpgsqlFSharpAnalyzer" let [] AssemblyProduct = "NpgsqlFSharpAnalyzer" - let [] AssemblyVersion = "3.22.1" - let [] AssemblyMetadata_ReleaseDate = "2021-02-09T00:00:00.0000000" - let [] AssemblyFileVersion = "3.22.1" - let [] AssemblyInformationalVersion = "3.22.1" + let [] AssemblyVersion = "3.23.0" + let [] AssemblyMetadata_ReleaseDate = "2021-03-26T00:00:00.0000000" + let [] AssemblyFileVersion = "3.23.0" + let [] AssemblyInformationalVersion = "3.23.0" let [] AssemblyMetadata_ReleaseChannel = "release" - let [] AssemblyMetadata_GitHash = "959f00c74c33e6cb5064595bf6107bcb11b215b3" + let [] AssemblyMetadata_GitHash = "bc8bff18abbd6b4cfd14b67738c9ec22a5412c90" diff --git a/src/NpgsqlFSharpParser/AssemblyInfo.fs b/src/NpgsqlFSharpParser/AssemblyInfo.fs index 2812ae1..08dc4c7 100644 --- a/src/NpgsqlFSharpParser/AssemblyInfo.fs +++ b/src/NpgsqlFSharpParser/AssemblyInfo.fs @@ -4,20 +4,20 @@ open System.Reflection [] [] -[] -[] -[] -[] +[] +[] +[] +[] [] -[] +[] do () module internal AssemblyVersionInformation = let [] AssemblyTitle = "NpgsqlFSharpParser" let [] AssemblyProduct = "NpgsqlFSharpAnalyzer" - let [] AssemblyVersion = "3.22.1" - let [] AssemblyMetadata_ReleaseDate = "2021-02-09T00:00:00.0000000" - let [] AssemblyFileVersion = "3.22.1" - let [] AssemblyInformationalVersion = "3.22.1" + let [] AssemblyVersion = "3.23.0" + let [] AssemblyMetadata_ReleaseDate = "2021-03-26T00:00:00.0000000" + let [] AssemblyFileVersion = "3.23.0" + let [] AssemblyInformationalVersion = "3.23.0" let [] AssemblyMetadata_ReleaseChannel = "release" - let [] AssemblyMetadata_GitHash = "959f00c74c33e6cb5064595bf6107bcb11b215b3" + let [] AssemblyMetadata_GitHash = "bc8bff18abbd6b4cfd14b67738c9ec22a5412c90" diff --git a/src/NpgsqlFSharpVs/source.extension.vsixmanifest b/src/NpgsqlFSharpVs/source.extension.vsixmanifest index e57832a..ce4d96b 100644 --- a/src/NpgsqlFSharpVs/source.extension.vsixmanifest +++ b/src/NpgsqlFSharpVs/source.extension.vsixmanifest @@ -3,7 +3,7 @@ xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011"> - + NpgsqlFSharpVs F# Analyzer for embedded SQL syntax analysis, type-checking for parameters and result sets and nullable column detection when writing queries using Npgsql.FSharp. https://github.com/Zaid-Ajaj/Npgsql.FSharp.Analyzer diff --git a/src/Ubik/AssemblyInfo.fs b/src/Ubik/AssemblyInfo.fs index 3954e80..22c830d 100644 --- a/src/Ubik/AssemblyInfo.fs +++ b/src/Ubik/AssemblyInfo.fs @@ -4,20 +4,20 @@ open System.Reflection [] [] -[] -[] -[] -[] +[] +[] +[] +[] [] -[] +[] do () module internal AssemblyVersionInformation = let [] AssemblyTitle = "Ubik" let [] AssemblyProduct = "NpgsqlFSharpAnalyzer" - let [] AssemblyVersion = "3.22.1" - let [] AssemblyMetadata_ReleaseDate = "2021-02-09T00:00:00.0000000" - let [] AssemblyFileVersion = "3.22.1" - let [] AssemblyInformationalVersion = "3.22.1" + let [] AssemblyVersion = "3.23.0" + let [] AssemblyMetadata_ReleaseDate = "2021-03-26T00:00:00.0000000" + let [] AssemblyFileVersion = "3.23.0" + let [] AssemblyInformationalVersion = "3.23.0" let [] AssemblyMetadata_ReleaseChannel = "release" - let [] AssemblyMetadata_GitHash = "959f00c74c33e6cb5064595bf6107bcb11b215b3" + let [] AssemblyMetadata_GitHash = "bc8bff18abbd6b4cfd14b67738c9ec22a5412c90" diff --git a/src/Ubik/Ubik.fsproj b/src/Ubik/Ubik.fsproj index 858ead3..e9e3a29 100644 --- a/src/Ubik/Ubik.fsproj +++ b/src/Ubik/Ubik.fsproj @@ -7,8 +7,8 @@ true true Major - 3.22.1 - Let the analyzer continue its work when it comes across enum types + 3.23.0 + Detect typed let bindings diff --git a/tests/NpgsqlFSharpAnalyzer.Tests/AssemblyInfo.fs b/tests/NpgsqlFSharpAnalyzer.Tests/AssemblyInfo.fs index 1c469aa..1064955 100644 --- a/tests/NpgsqlFSharpAnalyzer.Tests/AssemblyInfo.fs +++ b/tests/NpgsqlFSharpAnalyzer.Tests/AssemblyInfo.fs @@ -4,20 +4,20 @@ open System.Reflection [] [] -[] -[] -[] -[] +[] +[] +[] +[] [] -[] +[] do () module internal AssemblyVersionInformation = let [] AssemblyTitle = "NpgsqlFSharpAnalyzer.Tests" let [] AssemblyProduct = "NpgsqlFSharpAnalyzer" - let [] AssemblyVersion = "3.22.1" - let [] AssemblyMetadata_ReleaseDate = "2021-02-09T00:00:00.0000000" - let [] AssemblyFileVersion = "3.22.1" - let [] AssemblyInformationalVersion = "3.22.1" + let [] AssemblyVersion = "3.23.0" + let [] AssemblyMetadata_ReleaseDate = "2021-03-26T00:00:00.0000000" + let [] AssemblyFileVersion = "3.23.0" + let [] AssemblyInformationalVersion = "3.23.0" let [] AssemblyMetadata_ReleaseChannel = "release" - let [] AssemblyMetadata_GitHash = "959f00c74c33e6cb5064595bf6107bcb11b215b3" + let [] AssemblyMetadata_GitHash = "bc8bff18abbd6b4cfd14b67738c9ec22a5412c90" diff --git a/tests/NpgsqlFSharpAnalyzer.Tests/Tests.fs b/tests/NpgsqlFSharpAnalyzer.Tests/Tests.fs index 1525eea..dd010b9 100644 --- a/tests/NpgsqlFSharpAnalyzer.Tests/Tests.fs +++ b/tests/NpgsqlFSharpAnalyzer.Tests/Tests.fs @@ -38,7 +38,7 @@ let tests = | None -> failwith "Could not crack project" | Some context -> let operationBlocks = SyntacticAnalysis.findSqlOperations context - Expect.equal 11 (List.length operationBlocks) "Found 11 operation blocks" + Expect.equal (List.length operationBlocks) 12 "Found 12 operation blocks" } test "Syntactic analysis: no SQL blocks should be found using sprintf" { diff --git a/tests/examples/hashing/AssemblyInfo.fs b/tests/examples/hashing/AssemblyInfo.fs index 1fbb17e..bead391 100644 --- a/tests/examples/hashing/AssemblyInfo.fs +++ b/tests/examples/hashing/AssemblyInfo.fs @@ -4,20 +4,20 @@ open System.Reflection [] [] -[] -[] -[] -[] +[] +[] +[] +[] [] -[] +[] do () module internal AssemblyVersionInformation = let [] AssemblyTitle = "examples" let [] AssemblyProduct = "NpgsqlFSharpAnalyzer" - let [] AssemblyVersion = "3.22.1" - let [] AssemblyMetadata_ReleaseDate = "2021-02-09T00:00:00.0000000" - let [] AssemblyFileVersion = "3.22.1" - let [] AssemblyInformationalVersion = "3.22.1" + let [] AssemblyVersion = "3.23.0" + let [] AssemblyMetadata_ReleaseDate = "2021-03-26T00:00:00.0000000" + let [] AssemblyFileVersion = "3.23.0" + let [] AssemblyInformationalVersion = "3.23.0" let [] AssemblyMetadata_ReleaseChannel = "release" - let [] AssemblyMetadata_GitHash = "959f00c74c33e6cb5064595bf6107bcb11b215b3" + let [] AssemblyMetadata_GitHash = "bc8bff18abbd6b4cfd14b67738c9ec22a5412c90" diff --git a/tests/examples/hashing/syntacticAnalysis.fs b/tests/examples/hashing/syntacticAnalysis.fs index 91de699..3590a9a 100644 --- a/tests/examples/hashing/syntacticAnalysis.fs +++ b/tests/examples/hashing/syntacticAnalysis.fs @@ -92,6 +92,12 @@ module InsidePostgres = |> Sql.query "SELECT COUNT(*) as count FROM users" |> Sql.execute (fun read -> read.int64 "count") + let nextedDeclaretionWithExplicitReturnType() : Result= + Sql.host "localhost" + |> Sql.connectFromConfig + |> Sql.query "SELECT COUNT(*) as count FROM users" + |> Sql.execute (fun read -> read.int64 "count") + type NestedWhatever() = member this.Hello = let whateverSql() =