From 1e7ffd1e920ee419b3844643a75ae8bb4ad083af Mon Sep 17 00:00:00 2001 From: Jason Malinowski Date: Tue, 28 Nov 2017 16:32:45 -0800 Subject: [PATCH 001/147] Move F# to consume Roslyn 2.6.0-vs-for-mac-62317-08 This carries along some breaking changes (dotnet/roslyn@efd59a3bf863d2516ae96c95678f8200bb816982) in Roslyn's Quick Info implementation that we must react to. Since it's our first move to the 2.6 line it also carries along some deprecation of some APIs (namely, classification and comment handling) that we also respond to as well. --- .nuget/NuGet.Config | 2 +- src/FSharpSource.Settings.targets | 2 +- vsintegration/packages.config | 13 ++++---- .../BlockComment/CommentSelectionService.fs | 19 ++++++++++++ .../BlockComment/CommentUncommentService.fs | 15 --------- .../Classification/ColorizationService.fs | 5 +++ .../src/FSharp.Editor/FSharp.Editor.fsproj | 6 +++- .../src/FSharp.Editor/QuickInfo/Views.fs | 31 +++++++++++++------ .../unittests/VisualFSharp.Unittests.fsproj | 6 +++- 9 files changed, 64 insertions(+), 35 deletions(-) create mode 100644 vsintegration/src/FSharp.Editor/BlockComment/CommentSelectionService.fs delete mode 100644 vsintegration/src/FSharp.Editor/BlockComment/CommentUncommentService.fs diff --git a/.nuget/NuGet.Config b/.nuget/NuGet.Config index 225a0237b7..083aa0f1e4 100644 --- a/.nuget/NuGet.Config +++ b/.nuget/NuGet.Config @@ -16,7 +16,7 @@ - + diff --git a/src/FSharpSource.Settings.targets b/src/FSharpSource.Settings.targets index 75071b1ca4..2e1f112df7 100644 --- a/src/FSharpSource.Settings.targets +++ b/src/FSharpSource.Settings.targets @@ -32,7 +32,7 @@ false - 2.3.0-beta2-61719-01 + 2.6.0-vs-for-mac-62329-05 15.0 15.0.26201 1.3.1 diff --git a/vsintegration/packages.config b/vsintegration/packages.config index 0fdfec0de5..43a4e62ba2 100644 --- a/vsintegration/packages.config +++ b/vsintegration/packages.config @@ -8,12 +8,13 @@ - - - - - - + + + + + + + diff --git a/vsintegration/src/FSharp.Editor/BlockComment/CommentSelectionService.fs b/vsintegration/src/FSharp.Editor/BlockComment/CommentSelectionService.fs new file mode 100644 index 0000000000..4c54a45a51 --- /dev/null +++ b/vsintegration/src/FSharp.Editor/BlockComment/CommentSelectionService.fs @@ -0,0 +1,19 @@ +namespace Microsoft.VisualStudio.FSharp.Editor + +open Microsoft.CodeAnalysis.CommentSelection +open Microsoft.CodeAnalysis.Host.Mef +open System.Composition +open System.Threading.Tasks + +[] +[, FSharpConstants.FSharpLanguageName)>] +type CommentSelectionService() = + interface ICommentSelectionService with + member this.GetInfoAsync(_document, _textSpan, _cancellationToken) = + Task.FromResult(CommentSelectionInfo(supportsSingleLineComment=true, + supportsBlockComment=true, + singleLineCommentString="//", + blockCommentStartString="(*", + blockCommentEndString="*)")) + + member this.FormatAsync(document, _changes, _cancellationToken) = Task.FromResult(document) diff --git a/vsintegration/src/FSharp.Editor/BlockComment/CommentUncommentService.fs b/vsintegration/src/FSharp.Editor/BlockComment/CommentUncommentService.fs deleted file mode 100644 index c686b7ac81..0000000000 --- a/vsintegration/src/FSharp.Editor/BlockComment/CommentUncommentService.fs +++ /dev/null @@ -1,15 +0,0 @@ -namespace Microsoft.VisualStudio.FSharp.Editor - -open Microsoft.CodeAnalysis.Editor.Implementation.CommentSelection -open Microsoft.CodeAnalysis.Host.Mef -open System.Composition - -[] -[, FSharpConstants.FSharpLanguageName)>] -type CommentUncommentService() = - interface ICommentUncommentService with - member this.SingleLineCommentString = "//" - member this.SupportsBlockComment = true - member this.BlockCommentStartString = "(*" - member this.BlockCommentEndString = "*)" - member this.Format(document, _changes, _cancellationToken) = document \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/Classification/ColorizationService.fs b/vsintegration/src/FSharp.Editor/Classification/ColorizationService.fs index c3b199d4be..569a55e5a5 100644 --- a/vsintegration/src/FSharp.Editor/Classification/ColorizationService.fs +++ b/vsintegration/src/FSharp.Editor/Classification/ColorizationService.fs @@ -16,6 +16,11 @@ open Microsoft.CodeAnalysis.Text open Microsoft.FSharp.Compiler.SourceCodeServices +// IEditorClassificationService is marked as Obsolete, but is still supported. The replacement (IClassificationService) +// is internal to Microsoft.CodeAnalysis.Workspaces which we don't have internals visible to. Rather than add yet another +// IVT, we'll maintain the status quo. +#nowarn "44" + [, FSharpConstants.FSharpLanguageName)>] type internal FSharpColorizationService [] diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index 33d13b3eb2..b26e7a1832 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -85,7 +85,7 @@ - + @@ -256,6 +256,10 @@ $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.EditorFeatures.Text.$(RoslynVersion)\lib\net46\Microsoft.CodeAnalysis.EditorFeatures.Text.dll True + + $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.EditorFeatures.Wpf.$(RoslynVersion)\lib\net46\Microsoft.CodeAnalysis.EditorFeatures.Wpf.dll + True + $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.Features.$(RoslynVersion)\lib\netstandard1.3\Microsoft.CodeAnalysis.Features.dll True diff --git a/vsintegration/src/FSharp.Editor/QuickInfo/Views.fs b/vsintegration/src/FSharp.Editor/QuickInfo/Views.fs index 4402b6c9b1..3445021fa6 100644 --- a/vsintegration/src/FSharp.Editor/QuickInfo/Views.fs +++ b/vsintegration/src/FSharp.Editor/QuickInfo/Views.fs @@ -8,6 +8,7 @@ open System.Windows.Controls open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Classification open Microsoft.CodeAnalysis.Editor +open Microsoft.CodeAnalysis.Editor.QuickInfo open Microsoft.CodeAnalysis.Editor.Shared.Utilities open Microsoft.CodeAnalysis.Editor.Shared.Extensions open Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.QuickInfo @@ -19,6 +20,7 @@ open Microsoft.VisualStudio.PlatformUI open Microsoft.FSharp.Compiler open Internal.Utilities.StructuredFormat +open Microsoft.VisualStudio.Text.Classification module private SessionHandling = let mutable currentSession = None @@ -34,6 +36,9 @@ module private SessionHandling = member __.AugmentQuickInfoSession(session,_,_) = currentSession <- Some session member __.Dispose() = () } +type internal FSharpQuickInfoDeferredContent (toTextBlock, layout) = + member __.CreateFrameworkElement () = toTextBlock layout + interface IDeferredQuickInfoContent [] type internal QuickInfoViewProvider @@ -41,7 +46,7 @@ type internal QuickInfoViewProvider ( // lazy to try to mitigate #2756 (wrong tooltip font) typeMap: Lazy, - glyphService: IGlyphService + classificationFormatMapService: IClassificationFormatMapService ) = let styles = ResourceDictionary(Source = Uri(@"/FSharp.UIResources;component/HyperlinkStyles.xaml", UriKind.Relative)) @@ -56,7 +61,7 @@ type internal QuickInfoViewProvider else "no_underline" downcast styles.[key] - let formatMap = lazy typeMap.Value.ClassificationFormatMapService.GetClassificationFormatMap "tooltip" + let formatMap = lazy classificationFormatMapService.GetClassificationFormatMap "tooltip" let layoutTagToFormatting (layoutTag: LayoutTag) = layoutTag @@ -104,15 +109,12 @@ type internal QuickInfoViewProvider tb.MaxWidth <- maxWidth tb.HorizontalAlignment <- HorizontalAlignment.Left tb - - let defer toTextBlock layout = - { new IDeferredQuickInfoContent with member __.Create() = upcast toTextBlock layout } - + member __.ProvideContent(glyph: Glyph, description, documentation, typeParameterMap, usage, exceptions, navigation: QuickInfoNavigation) = - let navigable = defer (formatText navigation) - let wrapped = defer (formatText navigation >> wrap) - let empty = defer (fun () -> TextBlock(Visibility = Visibility.Collapsed)) () - let glyphContent = SymbolGlyphDeferredContent(glyph, glyphService) + let navigable x = FSharpQuickInfoDeferredContent((formatText navigation), x) + let wrapped x = FSharpQuickInfoDeferredContent((formatText navigation >> wrap), x) + let empty = FSharpQuickInfoDeferredContent((fun _ -> TextBlock(Visibility = Visibility.Collapsed)), Seq.empty) + let glyphContent = SymbolGlyphDeferredContent(glyph) QuickInfoDisplayDeferredContent (glyphContent, null, mainDescription = navigable description, @@ -121,3 +123,12 @@ type internal QuickInfoViewProvider anonymousTypes = empty, usageText = navigable usage, exceptionText = navigable exceptions) + +[)>] +type FSharpDeferredContentConverter () = + interface IDeferredQuickInfoContentToFrameworkElementConverter with + member this.CreateFrameworkElement(deferredContent, _factory) = + let fsharpDeferredContent = deferredContent :?> FSharpQuickInfoDeferredContent + upcast fsharpDeferredContent.CreateFrameworkElement() + member this.GetApplicableType () = + typeof \ No newline at end of file diff --git a/vsintegration/tests/unittests/VisualFSharp.Unittests.fsproj b/vsintegration/tests/unittests/VisualFSharp.Unittests.fsproj index e590ef7026..2855e6c0de 100644 --- a/vsintegration/tests/unittests/VisualFSharp.Unittests.fsproj +++ b/vsintegration/tests/unittests/VisualFSharp.Unittests.fsproj @@ -307,6 +307,10 @@ $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.EditorFeatures.Text.$(RoslynVersion)\lib\net46\Microsoft.CodeAnalysis.EditorFeatures.Text.dll True + + $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.EditorFeatures.Wpf.$(RoslynVersion)\lib\net46\Microsoft.CodeAnalysis.EditorFeatures.Wpf.dll + True + $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.Features.$(RoslynVersion)\lib\netstandard1.3\Microsoft.CodeAnalysis.Features.dll True @@ -403,4 +407,4 @@ - \ No newline at end of file + From ed534d98648768ea7d5683cf884be145a9e1a9da Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Mon, 4 Dec 2017 12:25:15 -0800 Subject: [PATCH 002/147] Merge master to dev15.6 (#4053) * fix compiler generated flag for auto properties fields * Remove unused mapFold and mapFoldBack functions (#4038) * Fixed readonly property appearing in obj initialization (#4036) * fix compiler generated flag for auto properties fields * Fixed readonly property appearing in obj initialization * Updating IL baselines * Using IsMember instead of MemberInfo.IsNone * Removed unneeded parens * Fix typo (#4048) --- src/absil/illib.fs | 19 - src/fsharp/NameResolution.fs | 15 +- src/fsharp/TypeChecker.fs | 1 + .../AsyncExpressionSteppingTest1.il.bsl | 15 +- .../AsyncExpressionSteppingTest2.il.bsl | 18 +- .../AsyncExpressionSteppingTest3.il.bsl | 15 +- .../AsyncExpressionSteppingTest4.il.bsl | 18 +- .../AsyncExpressionSteppingTest5.il.bsl | 24 +- .../AsyncExpressionSteppingTest6.il.bsl | 32 +- .../ComputationExpr01.il.bsl | 15 +- .../ComputationExpr02.il.bsl | 15 +- .../ComputationExpr03.il.bsl | 29 +- .../ComputationExpr04.il.bsl | 21 +- .../ComputationExpr05.il.bsl | 18 +- .../ComputationExpr06.il.bsl | 21 +- .../ComputationExpr07.il.bsl | 21 +- .../Linq101Aggregates01.il.bsl | 1026 +++++++++-------- .../Linq101ElementOperators01.il.bsl | 129 +-- .../Linq101Grouping01.il.bsl | 65 +- .../Linq101Joins01.il.bsl | 44 +- .../Linq101Ordering01.il.bsl | 22 +- .../Linq101Partitioning01.il.bsl | 28 +- .../Linq101Quantifiers01.il.bsl | 240 ++-- .../Linq101Select01.il.bsl | 50 +- .../Linq101SetOperators01.il.bsl | 16 +- .../Linq101Where01.il.bsl | 36 +- tests/service/ProjectAnalysisTests.fs | 27 +- .../unittests/CompletionProviderTests.fs | 22 +- .../Tests.LanguageService.Completion.fs | 12 - 29 files changed, 1115 insertions(+), 899 deletions(-) diff --git a/src/absil/illib.fs b/src/absil/illib.fs index 976cc1ac2e..b48b277a48 100644 --- a/src/absil/illib.fs +++ b/src/absil/illib.fs @@ -115,16 +115,6 @@ module Array = Array.length l1 = Array.length l2 && Array.forall2 p l1 l2 - let mapFold f s l = - let mutable acc = s - let n = Array.length l - let mutable res = Array.zeroCreate n - for i = 0 to n - 1 do - let h',s' = f acc l.[i] - res.[i] <- h'; - acc <- s' - res, acc - let order (eltOrder: IComparer<'T>) = { new IComparer> with member __.Compare(xs,ys) = @@ -449,15 +439,6 @@ module List = match l with | [] -> false | h::t -> LanguagePrimitives.PhysicalEquality x h || memq x t - - // Not tail recursive - let rec mapFoldBack f l s = - match l with - | [] -> ([],s) - | h::t -> - let t',s = mapFoldBack f t s - let h',s = f h s - (h'::t', s) let mapNth n f xs = let rec mn i = function diff --git a/src/fsharp/NameResolution.fs b/src/fsharp/NameResolution.fs index a80ddbf1df..e7326ac115 100644 --- a/src/fsharp/NameResolution.fs +++ b/src/fsharp/NameResolution.fs @@ -504,7 +504,7 @@ type BulkAdd = Yes | No /// or module, when we collapse the value table down to a dictionary. let AddValRefsToItems (bulkAddMode: BulkAdd) (eUnqualifiedItems: LayeredMap<_,_>) (vrefs:ValRef[]) = // Object model members are not added to the unqualified name resolution environment - let vrefs = vrefs |> Array.filter (fun vref -> vref.MemberInfo.IsNone) + let vrefs = vrefs |> Array.filter (fun vref -> not vref.IsMember) if vrefs.Length = 0 then eUnqualifiedItems else @@ -560,7 +560,7 @@ let AddValRefToNameEnv nenv (vref:ValRef) = let pri = NextExtensionMethodPriority() { nenv with eUnqualifiedItems = - if vref.MemberInfo.IsNone then + if not vref.IsMember then nenv.eUnqualifiedItems.Add (vref.LogicalName, Item.Value vref) else nenv.eUnqualifiedItems @@ -3700,7 +3700,7 @@ let rec private EntityRefContainsSomethingAccessible (ncenv: NameResolver) m ad let vref = mkNestedValRef modref v not vref.IsCompilerGenerated && not (IsValUnseen ad g m vref) && - (vref.IsExtensionMember || vref.MemberInfo.IsNone)))) || + (vref.IsExtensionMember || not vref.IsMember)))) || // Search the types in the namespace/module for an accessible tycon (mty.AllEntities @@ -3734,7 +3734,7 @@ let rec ResolvePartialLongIdentInModuleOrNamespace (ncenv: NameResolver) nenv is (mty.AllValsAndMembers |> Seq.toList |> List.choose (TryMkValRefInModRef modref) // if the assembly load set is incomplete and we get a None value here, then ignore the value - |> List.filter (fun v -> v.MemberInfo.IsNone) + |> List.filter (fun v -> not v.IsMember) |> List.filter (IsValUnseen ad g m >> not) |> List.map Item.Value) @@ -3848,7 +3848,10 @@ let rec ResolvePartialLongIdentPrim (ncenv: NameResolver) (nenv: NameResolutionE | FullyQualified -> [] | OpenQualified -> nenv.eUnqualifiedItems.Values - |> List.filter (function Item.UnqualifiedType _ -> false | _ -> true) + |> List.filter (function + | Item.UnqualifiedType _ -> false + | Item.Value v -> not v.IsMember + | _ -> true) |> List.filter (ItemIsUnseen ad g ncenv.amap m >> not) let activePatternItems = @@ -4287,7 +4290,7 @@ let rec ResolvePartialLongIdentInModuleOrNamespaceForItem (ncenv: NameResolver) mty.AllValsAndMembers |> Seq.toList |> List.choose (TryMkValRefInModRef modref) // if the assembly load set is incomplete and we get a None value here, then ignore the value - |> List.filter (fun v -> v.MemberInfo.IsNone) + |> List.filter (fun v -> not v.IsMember) |> List.filter (IsValUnseen ad g m >> not) |> List.map Item.Value | Item.UnionCase _ -> diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index c193ce6fc8..1a3d98740f 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -5090,6 +5090,7 @@ and TcSimplePatsOfUnknownType cenv optArgsOK checkCxs env tpenv spats = and TcPatBindingName cenv env id ty isMemberThis vis1 topValData (inlineFlag, declaredTypars, argAttribs, isMutable, vis2, compgen) (names, takenNames:Set) = let vis = if Option.isSome vis1 then vis1 else vis2 if takenNames.Contains id.idText then errorR (VarBoundTwice id) + let compgen = compgen || IsCompilerGeneratedName id.idText let baseOrThis = if isMemberThis then MemberThisVal else NormalVal let names = Map.add id.idText (PrelimValScheme1(id, declaredTypars, ty, topValData, None, isMutable, inlineFlag, baseOrThis, argAttribs, vis, compgen)) names let takenNames = Set.add id.idText takenNames diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest1.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest1.il.bsl index fae58af070..ec794be06a 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest1.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest1.il.bsl @@ -29,20 +29,20 @@ } .mresource public FSharpSignatureData.AsyncExpressionSteppingTest1 { - // Offset: 0x00000000 Length: 0x00000264 + // Offset: 0x00000000 Length: 0x0000024A } .mresource public FSharpOptimizationData.AsyncExpressionSteppingTest1 { - // Offset: 0x00000268 Length: 0x000000B1 + // Offset: 0x00000250 Length: 0x000000B1 } .module AsyncExpressionSteppingTest1.dll -// MVID: {59B19208-6394-B5D4-A745-03830892B159} +// MVID: {5A1F62A7-6394-B5D4-A745-0383A7621F5A} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x01980000 +// Image base: 0x05190000 // =============== CLASS MEMBERS DECLARATION =================== @@ -59,6 +59,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed { @@ -80,7 +83,7 @@ // Code size 62 (0x3e) .maxstack 8 .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 6,6 : 17,32 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\AsyncExpressionStepping\\AsyncExpressionSteppingTest1.fs' + .line 6,6 : 17,32 'C:\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\AsyncExpressionStepping\\AsyncExpressionSteppingTest1.fs' IL_0000: ldstr "hello" IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) @@ -109,7 +112,7 @@ { // Code size 21 (0x15) .maxstack 4 - .locals init ([0] class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) + .locals init ([0] class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_0) .line 6,6 : 9,14 '' IL_0000: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_DefaultAsyncBuilder() IL_0005: stloc.0 diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest2.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest2.il.bsl index 043afeacb1..6a87f0671a 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest2.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest2.il.bsl @@ -29,20 +29,20 @@ } .mresource public FSharpSignatureData.AsyncExpressionSteppingTest2 { - // Offset: 0x00000000 Length: 0x00000264 + // Offset: 0x00000000 Length: 0x0000024A } .mresource public FSharpOptimizationData.AsyncExpressionSteppingTest2 { - // Offset: 0x00000268 Length: 0x000000B1 + // Offset: 0x00000250 Length: 0x000000B1 } .module AsyncExpressionSteppingTest2.dll -// MVID: {59B19208-6394-D499-A745-03830892B159} +// MVID: {5A1F62A7-6394-D499-A745-0383A7621F5A} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x03260000 +// Image base: 0x00F10000 // =============== CLASS MEMBERS DECLARATION =================== @@ -80,7 +80,7 @@ // Code size 15 (0xf) .maxstack 8 .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 6,6 : 23,29 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\AsyncExpressionStepping\\AsyncExpressionSteppingTest2.fs' + .line 6,6 : 23,29 'C:\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\AsyncExpressionStepping\\AsyncExpressionSteppingTest2.fs' IL_0000: ldarg.0 IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 AsyncExpressionSteppingTest2/AsyncExpressionSteppingTest2/'f2@6-1'::x IL_0006: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::op_Dereference(class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1) @@ -96,6 +96,9 @@ { .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 x .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 x, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed @@ -144,6 +147,9 @@ { .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 x .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 x, class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed @@ -197,7 +203,7 @@ // Code size 29 (0x1d) .maxstack 5 .locals init ([0] class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 x, - [1] class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) + [1] class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_1) .line 5,5 : 9,22 '' IL_0000: ldc.i4.0 IL_0001: call class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::Ref(!!0) diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest3.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest3.il.bsl index 93adc353e1..83b7070f11 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest3.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest3.il.bsl @@ -29,20 +29,20 @@ } .mresource public FSharpSignatureData.AsyncExpressionSteppingTest3 { - // Offset: 0x00000000 Length: 0x0000026F + // Offset: 0x00000000 Length: 0x00000255 } .mresource public FSharpOptimizationData.AsyncExpressionSteppingTest3 { - // Offset: 0x00000278 Length: 0x000000B1 + // Offset: 0x00000260 Length: 0x000000B1 } .module AsyncExpressionSteppingTest3.dll -// MVID: {59B19208-6394-F35E-A745-03830892B159} +// MVID: {5A1F62A7-6394-F35E-A745-0383A7621F5A} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x01650000 +// Image base: 0x01210000 // =============== CLASS MEMBERS DECLARATION =================== @@ -59,6 +59,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed { @@ -83,7 +86,7 @@ [1] class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 y, [2] int32 z) .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 5,5 : 17,30 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\AsyncExpressionStepping\\AsyncExpressionSteppingTest3.fs' + .line 5,5 : 17,30 'C:\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\AsyncExpressionStepping\\AsyncExpressionSteppingTest3.fs' IL_0000: ldc.i4.0 IL_0001: call class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::Ref(!!0) IL_0006: stloc.0 @@ -122,7 +125,7 @@ { // Code size 21 (0x15) .maxstack 4 - .locals init ([0] class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) + .locals init ([0] class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_0) .line 5,5 : 9,14 '' IL_0000: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_DefaultAsyncBuilder() IL_0005: stloc.0 diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest4.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest4.il.bsl index fc3c015c59..02e29ae228 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest4.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest4.il.bsl @@ -29,20 +29,20 @@ } .mresource public FSharpSignatureData.AsyncExpressionSteppingTest4 { - // Offset: 0x00000000 Length: 0x0000026F + // Offset: 0x00000000 Length: 0x00000255 } .mresource public FSharpOptimizationData.AsyncExpressionSteppingTest4 { - // Offset: 0x00000278 Length: 0x000000B1 + // Offset: 0x00000260 Length: 0x000000B1 } .module AsyncExpressionSteppingTest4.dll -// MVID: {59B19208-6394-6D4B-A745-03830892B159} +// MVID: {5A1F62A7-6394-6D4B-A745-0383A7621F5A} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x013E0000 +// Image base: 0x038C0000 // =============== CLASS MEMBERS DECLARATION =================== @@ -59,6 +59,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 x .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@, @@ -87,7 +90,7 @@ .locals init ([0] class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 y, [1] int32 z) .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 7,7 : 21,34 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\AsyncExpressionStepping\\AsyncExpressionSteppingTest4.fs' + .line 7,7 : 21,34 'C:\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\AsyncExpressionStepping\\AsyncExpressionSteppingTest4.fs' IL_0000: ldc.i4.0 IL_0001: call class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::Ref(!!0) IL_0006: stloc.0 @@ -157,6 +160,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed { @@ -208,7 +214,7 @@ { // Code size 21 (0x15) .maxstack 4 - .locals init ([0] class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) + .locals init ([0] class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_0) .line 5,5 : 9,14 '' IL_0000: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_DefaultAsyncBuilder() IL_0005: stloc.0 diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest5.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest5.il.bsl index 86a41c5022..50407f757c 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest5.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest5.il.bsl @@ -29,20 +29,20 @@ } .mresource public FSharpSignatureData.AsyncExpressionSteppingTest5 { - // Offset: 0x00000000 Length: 0x000002B0 + // Offset: 0x00000000 Length: 0x00000296 } .mresource public FSharpOptimizationData.AsyncExpressionSteppingTest5 { - // Offset: 0x000002B8 Length: 0x000000BE + // Offset: 0x000002A0 Length: 0x000000BE } .module AsyncExpressionSteppingTest5.dll -// MVID: {59B19208-6394-30E8-A745-03830892B159} +// MVID: {5A1F62A7-6394-30E8-A745-0383A7621F5A} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x00D00000 +// Image base: 0x00C60000 // =============== CLASS MEMBERS DECLARATION =================== @@ -59,6 +59,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed { @@ -81,7 +84,7 @@ .maxstack 5 .locals init ([0] int32 x) .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 6,6 : 17,31 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\AsyncExpressionStepping\\AsyncExpressionSteppingTest5.fs' + .line 6,6 : 17,31 'C:\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\AsyncExpressionStepping\\AsyncExpressionSteppingTest5.fs' IL_0000: ldarg.1 IL_0001: stloc.0 .line 7,7 : 20,35 '' @@ -107,6 +110,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed { @@ -154,6 +160,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed { @@ -193,6 +202,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed { @@ -252,7 +264,7 @@ { // Code size 21 (0x15) .maxstack 4 - .locals init ([0] class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) + .locals init ([0] class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_0) .line 6,6 : 9,14 '' IL_0000: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_DefaultAsyncBuilder() IL_0005: stloc.0 diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest6.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest6.il.bsl index a38042285e..e027d17202 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest6.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest6.il.bsl @@ -29,20 +29,20 @@ } .mresource public FSharpSignatureData.AsyncExpressionSteppingTest6 { - // Offset: 0x00000000 Length: 0x0000029B + // Offset: 0x00000000 Length: 0x00000281 } .mresource public FSharpOptimizationData.AsyncExpressionSteppingTest6 { - // Offset: 0x000002A0 Length: 0x000000BE + // Offset: 0x00000288 Length: 0x000000BE } .module AsyncExpressionSteppingTest6.dll -// MVID: {59B19208-6394-4FAD-A745-03830892B159} +// MVID: {5A1F62A7-6394-4FAD-A745-0383A7621F5A} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x00940000 +// Image base: 0x03740000 // =============== CLASS MEMBERS DECLARATION =================== @@ -59,6 +59,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed { @@ -83,7 +86,7 @@ [1] class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 y, [2] int32 z) .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 5,5 : 17,30 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\AsyncExpressionStepping\\AsyncExpressionSteppingTest6.fs' + .line 5,5 : 17,30 'C:\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\AsyncExpressionStepping\\AsyncExpressionSteppingTest6.fs' IL_0000: ldc.i4.0 IL_0001: call class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::Ref(!!0) IL_0006: stloc.0 @@ -121,6 +124,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .field public int32 x1 .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 y .method assembly specialname rtspecialname @@ -181,6 +187,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .field public int32 x1 .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@, @@ -243,6 +252,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .field public int32 x1 .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@, @@ -294,6 +306,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed { @@ -339,6 +354,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) cil managed { @@ -379,7 +397,7 @@ { // Code size 21 (0x15) .maxstack 4 - .locals init ([0] class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) + .locals init ([0] class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_0) .line 5,5 : 9,14 '' IL_0000: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_DefaultAsyncBuilder() IL_0005: stloc.0 @@ -396,7 +414,7 @@ { // Code size 21 (0x15) .maxstack 4 - .locals init ([0] class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder builder@) + .locals init ([0] class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder V_0) .line 13,13 : 9,14 '' IL_0000: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_DefaultAsyncBuilder() IL_0005: stloc.0 diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExpr01.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExpr01.il.bsl index 7e2fecfcb4..056640724c 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExpr01.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExpr01.il.bsl @@ -33,20 +33,20 @@ } .mresource public FSharpSignatureData.ComputationExpr01 { - // Offset: 0x00000000 Length: 0x00000212 + // Offset: 0x00000000 Length: 0x000001F8 } .mresource public FSharpOptimizationData.ComputationExpr01 { - // Offset: 0x00000218 Length: 0x0000007D + // Offset: 0x00000200 Length: 0x0000007D } .module ComputationExpr01.exe -// MVID: {59B1920A-3703-E566-A745-03830A92B159} +// MVID: {5A1F62A7-3703-E566-A745-0383A7621F5A} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x00F30000 +// Image base: 0x007B0000 // =============== CLASS MEMBERS DECLARATION =================== @@ -59,6 +59,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [ComputationExprLibrary]Library.EventuallyBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [ComputationExprLibrary]Library.EventuallyBuilder builder@) cil managed { @@ -80,7 +83,7 @@ // Code size 15 (0xf) .maxstack 8 .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 8,8 : 9,17 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\ComputationExpressions\\ComputationExpr01.fs' + .line 8,8 : 9,17 'C:\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\ComputationExpressions\\ComputationExpr01.fs' IL_0000: ldarg.0 IL_0001: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder ComputationExpr01/res1@8::builder@ IL_0006: ldc.i4.1 @@ -123,7 +126,7 @@ // Code size 37 (0x25) .maxstack 4 .locals init ([0] class [ComputationExprLibrary]Library.Eventually`1 res1, - [1] class [ComputationExprLibrary]Library.EventuallyBuilder builder@) + [1] class [ComputationExprLibrary]Library.EventuallyBuilder V_1) .line 100001,100001 : 0,0 '' IL_0000: call class [ComputationExprLibrary]Library.EventuallyBuilder [ComputationExprLibrary]Library.TheEventuallyBuilder::get_eventually() IL_0005: stloc.1 diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExpr02.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExpr02.il.bsl index 1293dade45..80dd23ca0b 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExpr02.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExpr02.il.bsl @@ -33,20 +33,20 @@ } .mresource public FSharpSignatureData.ComputationExpr02 { - // Offset: 0x00000000 Length: 0x00000212 + // Offset: 0x00000000 Length: 0x000001F8 } .mresource public FSharpOptimizationData.ComputationExpr02 { - // Offset: 0x00000218 Length: 0x0000007D + // Offset: 0x00000200 Length: 0x0000007D } .module ComputationExpr02.exe -// MVID: {59B1920A-3624-E566-A745-03830A92B159} +// MVID: {5A1F62A7-3624-E566-A745-0383A7621F5A} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x00730000 +// Image base: 0x01010000 // =============== CLASS MEMBERS DECLARATION =================== @@ -59,6 +59,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [ComputationExprLibrary]Library.EventuallyBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [ComputationExprLibrary]Library.EventuallyBuilder builder@) cil managed { @@ -81,7 +84,7 @@ .maxstack 7 .locals init ([0] int32 x) .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 8,8 : 18,33 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\ComputationExpressions\\ComputationExpr02.fs' + .line 8,8 : 18,33 'C:\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\ComputationExpressions\\ComputationExpr02.fs' IL_0000: ldstr "hello" IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) @@ -135,7 +138,7 @@ // Code size 37 (0x25) .maxstack 4 .locals init ([0] class [ComputationExprLibrary]Library.Eventually`1 res2, - [1] class [ComputationExprLibrary]Library.EventuallyBuilder builder@) + [1] class [ComputationExprLibrary]Library.EventuallyBuilder V_1) .line 100001,100001 : 0,0 '' IL_0000: call class [ComputationExprLibrary]Library.EventuallyBuilder [ComputationExprLibrary]Library.TheEventuallyBuilder::get_eventually() IL_0005: stloc.1 diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExpr03.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExpr03.il.bsl index 3a70e0817b..46926f5d00 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExpr03.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExpr03.il.bsl @@ -33,20 +33,20 @@ } .mresource public FSharpSignatureData.ComputationExpr03 { - // Offset: 0x00000000 Length: 0x0000023C + // Offset: 0x00000000 Length: 0x00000222 } .mresource public FSharpOptimizationData.ComputationExpr03 { - // Offset: 0x00000240 Length: 0x0000008C + // Offset: 0x00000228 Length: 0x0000008C } .module ComputationExpr03.exe -// MVID: {59B1920A-3649-E566-A745-03830A92B159} +// MVID: {5A1F62A7-3649-E566-A745-0383A7621F5A} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x00C80000 +// Image base: 0x00BF0000 // =============== CLASS MEMBERS DECLARATION =================== @@ -59,6 +59,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [ComputationExprLibrary]Library.EventuallyBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [ComputationExprLibrary]Library.EventuallyBuilder builder@) cil managed { @@ -81,7 +84,7 @@ .maxstack 7 .locals init ([0] int32 x) .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 8,8 : 18,33 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\ComputationExpressions\\ComputationExpr03.fs' + .line 8,8 : 18,33 'C:\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\ComputationExpressions\\ComputationExpr03.fs' IL_0000: ldstr "hello" IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) @@ -107,6 +110,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [ComputationExprLibrary]Library.EventuallyBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [ComputationExprLibrary]Library.EventuallyBuilder builder@) cil managed { @@ -152,6 +158,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [ComputationExprLibrary]Library.EventuallyBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [ComputationExprLibrary]Library.EventuallyBuilder builder@) cil managed { @@ -191,6 +200,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [ComputationExprLibrary]Library.EventuallyBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [ComputationExprLibrary]Library.EventuallyBuilder builder@) cil managed { @@ -212,7 +224,7 @@ // Code size 45 (0x2d) .maxstack 7 .locals init ([0] int32 x, - [1] class [ComputationExprLibrary]Library.EventuallyBuilder builder@) + [1] class [ComputationExprLibrary]Library.EventuallyBuilder V_1) .line 14,14 : 9,23 '' IL_0000: ldarg.1 IL_0001: stloc.0 @@ -240,6 +252,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [ComputationExprLibrary]Library.EventuallyBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [ComputationExprLibrary]Library.EventuallyBuilder builder@) cil managed { @@ -325,7 +340,7 @@ .maxstack 4 .locals init ([0] class [ComputationExprLibrary]Library.Eventually`1 res2, [1] class [ComputationExprLibrary]Library.Eventually`1 res3, - [2] class [ComputationExprLibrary]Library.EventuallyBuilder builder@, + [2] class [ComputationExprLibrary]Library.EventuallyBuilder V_2, [3] class [ComputationExprLibrary]Library.EventuallyBuilder V_3) .line 100001,100001 : 0,0 '' IL_0000: call class [ComputationExprLibrary]Library.EventuallyBuilder [ComputationExprLibrary]Library.TheEventuallyBuilder::get_eventually() diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExpr04.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExpr04.il.bsl index 9e010e0d90..6f211063ee 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExpr04.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExpr04.il.bsl @@ -33,20 +33,20 @@ } .mresource public FSharpSignatureData.ComputationExpr04 { - // Offset: 0x00000000 Length: 0x00000212 + // Offset: 0x00000000 Length: 0x000001F8 } .mresource public FSharpOptimizationData.ComputationExpr04 { - // Offset: 0x00000218 Length: 0x0000007D + // Offset: 0x00000200 Length: 0x0000007D } .module ComputationExpr04.exe -// MVID: {59B1920A-366A-E566-A745-03830A92B159} +// MVID: {5A1F62A7-366A-E566-A745-0383A7621F5A} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x010B0000 +// Image base: 0x04DD0000 // =============== CLASS MEMBERS DECLARATION =================== @@ -59,6 +59,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [ComputationExprLibrary]Library.EventuallyBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [ComputationExprLibrary]Library.EventuallyBuilder builder@) cil managed { @@ -82,7 +85,7 @@ .locals init ([0] int32 x, [1] string V_1) .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 7,7 : 22,37 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\ComputationExpressions\\ComputationExpr04.fs' + .line 7,7 : 22,37 'C:\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\ComputationExpressions\\ComputationExpr04.fs' IL_0000: ldstr "hello" IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5::.ctor(string) IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) @@ -121,6 +124,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [ComputationExprLibrary]Library.EventuallyBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [ComputationExprLibrary]Library.EventuallyBuilder builder@) cil managed { @@ -172,6 +178,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [ComputationExprLibrary]Library.EventuallyBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [ComputationExprLibrary]Library.EventuallyBuilder builder@) cil managed { @@ -244,7 +253,7 @@ // Code size 37 (0x25) .maxstack 4 .locals init ([0] class [ComputationExprLibrary]Library.Eventually`1 res4, - [1] class [ComputationExprLibrary]Library.EventuallyBuilder builder@) + [1] class [ComputationExprLibrary]Library.EventuallyBuilder V_1) .line 100001,100001 : 0,0 '' IL_0000: call class [ComputationExprLibrary]Library.EventuallyBuilder [ComputationExprLibrary]Library.TheEventuallyBuilder::get_eventually() IL_0005: stloc.1 diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExpr05.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExpr05.il.bsl index b23b946762..8f5858d32b 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExpr05.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExpr05.il.bsl @@ -33,20 +33,20 @@ } .mresource public FSharpSignatureData.ComputationExpr05 { - // Offset: 0x00000000 Length: 0x00000212 + // Offset: 0x00000000 Length: 0x000001F8 } .mresource public FSharpOptimizationData.ComputationExpr05 { - // Offset: 0x00000218 Length: 0x0000007D + // Offset: 0x00000200 Length: 0x0000007D } .module ComputationExpr05.exe -// MVID: {59B1920A-3687-E566-A745-03830A92B159} +// MVID: {5A1F62A7-3687-E566-A745-0383A7621F5A} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x013E0000 +// Image base: 0x039D0000 // =============== CLASS MEMBERS DECLARATION =================== @@ -79,7 +79,7 @@ // Code size 1 (0x1) .maxstack 8 .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 9,9 : 68,70 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\ComputationExpressions\\ComputationExpr05.fs' + .line 9,9 : 68,70 'C:\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\ComputationExpressions\\ComputationExpr05.fs' IL_0000: ret } // end of method 'res5@9-1'::'System-IDisposable-Dispose' @@ -89,6 +89,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [ComputationExprLibrary]Library.EventuallyBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [ComputationExprLibrary]Library.EventuallyBuilder builder@) cil managed { @@ -140,6 +143,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [ComputationExprLibrary]Library.EventuallyBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [ComputationExprLibrary]Library.EventuallyBuilder builder@) cil managed { @@ -217,7 +223,7 @@ // Code size 37 (0x25) .maxstack 4 .locals init ([0] class [ComputationExprLibrary]Library.Eventually`1 res5, - [1] class [ComputationExprLibrary]Library.EventuallyBuilder builder@) + [1] class [ComputationExprLibrary]Library.EventuallyBuilder V_1) .line 100001,100001 : 0,0 '' IL_0000: call class [ComputationExprLibrary]Library.EventuallyBuilder [ComputationExprLibrary]Library.TheEventuallyBuilder::get_eventually() IL_0005: stloc.1 diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExpr06.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExpr06.il.bsl index 1c41b469b7..93152a9b90 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExpr06.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExpr06.il.bsl @@ -33,20 +33,20 @@ } .mresource public FSharpSignatureData.ComputationExpr06 { - // Offset: 0x00000000 Length: 0x00000212 + // Offset: 0x00000000 Length: 0x000001F8 } .mresource public FSharpOptimizationData.ComputationExpr06 { - // Offset: 0x00000218 Length: 0x0000007D + // Offset: 0x00000200 Length: 0x0000007D } .module ComputationExpr06.exe -// MVID: {59B1920A-35A8-E566-A745-03830A92B159} +// MVID: {5A1F62A7-35A8-E566-A745-0383A7621F5A} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x02E70000 +// Image base: 0x00DD0000 // =============== CLASS MEMBERS DECLARATION =================== @@ -80,7 +80,7 @@ // Code size 15 (0xf) .maxstack 8 .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 9,9 : 15,21 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\ComputationExpressions\\ComputationExpr06.fs' + .line 9,9 : 15,21 'C:\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\ComputationExpressions\\ComputationExpr06.fs' IL_0000: ldarg.0 IL_0001: ldfld class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 ComputationExpr06/'res6@9-1'::x IL_0006: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::op_Dereference(class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1) @@ -95,6 +95,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [ComputationExprLibrary]Library.EventuallyBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 x .method assembly specialname rtspecialname instance void .ctor(class [ComputationExprLibrary]Library.EventuallyBuilder builder@, @@ -163,6 +166,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [ComputationExprLibrary]Library.EventuallyBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [ComputationExprLibrary]Library.EventuallyBuilder builder@) cil managed { @@ -198,6 +204,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [ComputationExprLibrary]Library.EventuallyBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [ComputationExprLibrary]Library.EventuallyBuilder builder@) cil managed { @@ -286,7 +295,7 @@ // Code size 37 (0x25) .maxstack 4 .locals init ([0] class [ComputationExprLibrary]Library.Eventually`1 res6, - [1] class [ComputationExprLibrary]Library.EventuallyBuilder builder@) + [1] class [ComputationExprLibrary]Library.EventuallyBuilder V_1) .line 100001,100001 : 0,0 '' IL_0000: call class [ComputationExprLibrary]Library.EventuallyBuilder [ComputationExprLibrary]Library.TheEventuallyBuilder::get_eventually() IL_0005: stloc.1 diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExpr07.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExpr07.il.bsl index f4bfe1e063..2e07f1e3d6 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExpr07.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/ComputationExpressions/ComputationExpr07.il.bsl @@ -33,20 +33,20 @@ } .mresource public FSharpSignatureData.ComputationExpr07 { - // Offset: 0x00000000 Length: 0x00000212 + // Offset: 0x00000000 Length: 0x000001F8 } .mresource public FSharpOptimizationData.ComputationExpr07 { - // Offset: 0x00000218 Length: 0x0000007D + // Offset: 0x00000200 Length: 0x0000007D } .module ComputationExpr07.exe -// MVID: {59B1920A-35BD-E566-A745-03830A92B159} +// MVID: {5A1F62A7-35BD-E566-A745-0383A7621F5A} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x00690000 +// Image base: 0x03800000 // =============== CLASS MEMBERS DECLARATION =================== @@ -59,6 +59,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [ComputationExprLibrary]Library.EventuallyBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 x .method assembly specialname rtspecialname instance void .ctor(class [ComputationExprLibrary]Library.EventuallyBuilder builder@, @@ -86,7 +89,7 @@ .maxstack 7 .locals init ([0] int32 v) .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 9,9 : 9,29 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\ComputationExpressions\\ComputationExpr07.fs' + .line 9,9 : 9,29 'C:\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\ComputationExpressions\\ComputationExpr07.fs' IL_0000: ldarg.1 IL_0001: stloc.0 .line 10,10 : 13,24 '' @@ -113,6 +116,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [ComputationExprLibrary]Library.EventuallyBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .field public class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 x .method assembly specialname rtspecialname instance void .ctor(class [ComputationExprLibrary]Library.EventuallyBuilder builder@, @@ -155,6 +161,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [ComputationExprLibrary]Library.EventuallyBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [ComputationExprLibrary]Library.EventuallyBuilder builder@) cil managed { @@ -248,7 +257,7 @@ // Code size 37 (0x25) .maxstack 4 .locals init ([0] class [ComputationExprLibrary]Library.Eventually`1 res7, - [1] class [ComputationExprLibrary]Library.EventuallyBuilder builder@) + [1] class [ComputationExprLibrary]Library.EventuallyBuilder V_1) .line 100001,100001 : 0,0 '' IL_0000: call class [ComputationExprLibrary]Library.EventuallyBuilder [ComputationExprLibrary]Library.TheEventuallyBuilder::get_eventually() IL_0005: stloc.1 diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Aggregates01.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Aggregates01.il.bsl index 8c8c4d065d..2b6e924380 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Aggregates01.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Aggregates01.il.bsl @@ -38,20 +38,20 @@ } .mresource public FSharpSignatureData.Linq101Aggregates01 { - // Offset: 0x00000000 Length: 0x0000060C + // Offset: 0x00000000 Length: 0x000005F2 } .mresource public FSharpOptimizationData.Linq101Aggregates01 { - // Offset: 0x00000610 Length: 0x00000211 + // Offset: 0x000005F8 Length: 0x00000211 } .module Linq101Aggregates01.exe -// MVID: {59B19240-D281-4783-A745-03834092B159} +// MVID: {5A1F62A6-D281-4783-A745-0383A6621F5A} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x010C0000 +// Image base: 0x01280000 // =============== CLASS MEMBERS DECLARATION =================== @@ -116,7 +116,7 @@ // Code size 191 (0xbf) .maxstack 6 .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 100001,100001 : 0,0 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\QueryExpressionStepping\\Linq101Aggregates01.fs' + .line 100001,100001 : 0,0 'C:\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\QueryExpressionStepping\\Linq101Aggregates01.fs' IL_0000: ldarg.0 IL_0001: ldfld int32 Linq101Aggregates01/uniqueFactors@12::pc IL_0006: ldc.i4.1 @@ -1194,6 +1194,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -1685,6 +1688,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,int32>,object>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -1707,7 +1713,7 @@ .maxstack 10 .locals init ([0] class [System.Core]System.Linq.IGrouping`2 g, [1] int32 sum, - [2] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@, + [2] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_2, [3] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_3, [4] class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 V_4, [5] class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_5, @@ -2625,6 +2631,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -3116,6 +3125,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,valuetype [mscorlib]System.Decimal>,object>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -3134,44 +3146,41 @@ .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,valuetype [mscorlib]System.Decimal>,object> Invoke(class [System.Core]System.Linq.IGrouping`2 _arg2) cil managed { - // Code size 57 (0x39) + // Code size 55 (0x37) .maxstack 11 .locals init ([0] class [System.Core]System.Linq.IGrouping`2 g, - [1] valuetype [mscorlib]System.Decimal min, - [2] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) + [1] valuetype [mscorlib]System.Decimal min) .line 58,58 : 38,39 '' IL_0000: ldarg.1 IL_0001: stloc.0 IL_0002: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() - IL_0007: stloc.2 - IL_0008: ldloc.2 - IL_0009: ldloc.0 + IL_0007: ldloc.0 + IL_0008: ldnull + IL_0009: ldnull IL_000a: ldnull - IL_000b: ldnull + IL_000b: ldc.i4.0 IL_000c: ldnull - IL_000d: ldc.i4.0 - IL_000e: ldnull - IL_000f: newobj instance void Linq101Aggregates01/min@59::.ctor(class [System.Core]System.Linq.IGrouping`2, + IL_000d: newobj instance void Linq101Aggregates01/min@59::.ctor(class [System.Core]System.Linq.IGrouping`2, class [Utils]Utils/Product, class [Utils]Utils/Product, class [mscorlib]System.Collections.Generic.IEnumerator`1, int32, class [Utils]Utils/Product) - IL_0014: newobj instance void class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2::.ctor(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_0019: newobj instance void Linq101Aggregates01/'min@59-1'::.ctor() - IL_001e: callvirt instance !!2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::MinBy(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_0012: newobj instance void class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2::.ctor(class [mscorlib]System.Collections.Generic.IEnumerable`1) + IL_0017: newobj instance void Linq101Aggregates01/'min@59-1'::.ctor() + IL_001c: callvirt instance !!2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::MinBy(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_0023: stloc.1 + IL_0021: stloc.1 .line 60,60 : 9,28 '' - IL_0024: ldarg.0 - IL_0025: ldfld class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder Linq101Aggregates01/'categories2@58-3'::builder@ - IL_002a: ldloc.0 - IL_002b: ldloc.1 - IL_002c: newobj instance void class [mscorlib]System.Tuple`2,valuetype [mscorlib]System.Decimal>::.ctor(!0, + IL_0022: ldarg.0 + IL_0023: ldfld class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder Linq101Aggregates01/'categories2@58-3'::builder@ + IL_0028: ldloc.0 + IL_0029: ldloc.1 + IL_002a: newobj instance void class [mscorlib]System.Tuple`2,valuetype [mscorlib]System.Decimal>::.ctor(!0, !1) - IL_0031: tail. - IL_0033: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Yield,valuetype [mscorlib]System.Decimal>,object>(!!0) - IL_0038: ret + IL_002f: tail. + IL_0031: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Yield,valuetype [mscorlib]System.Decimal>,object>(!!0) + IL_0036: ret } // end of method 'categories2@58-3'::Invoke } // end of class 'categories2@58-3' @@ -3220,6 +3229,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -3746,6 +3758,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,valuetype [mscorlib]System.Decimal,class [mscorlib]System.Collections.Generic.IEnumerable`1>,object>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -3769,7 +3784,7 @@ .locals init ([0] class [System.Core]System.Linq.IGrouping`2 g, [1] valuetype [mscorlib]System.Decimal min, [2] class [mscorlib]System.Collections.Generic.IEnumerable`1 cheapestProducts, - [3] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) + [3] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_3) .line 67,67 : 38,39 '' IL_0000: ldarg.1 IL_0001: stloc.0 @@ -4640,6 +4655,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -5131,6 +5149,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,valuetype [mscorlib]System.Decimal>,object>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -5149,44 +5170,41 @@ .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,valuetype [mscorlib]System.Decimal>,object> Invoke(class [System.Core]System.Linq.IGrouping`2 _arg2) cil managed { - // Code size 57 (0x39) + // Code size 55 (0x37) .maxstack 11 .locals init ([0] class [System.Core]System.Linq.IGrouping`2 g, - [1] valuetype [mscorlib]System.Decimal mostExpensivePrice, - [2] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) + [1] valuetype [mscorlib]System.Decimal mostExpensivePrice) .line 83,83 : 38,39 '' IL_0000: ldarg.1 IL_0001: stloc.0 IL_0002: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() - IL_0007: stloc.2 - IL_0008: ldloc.2 - IL_0009: ldloc.0 + IL_0007: ldloc.0 + IL_0008: ldnull + IL_0009: ldnull IL_000a: ldnull - IL_000b: ldnull + IL_000b: ldc.i4.0 IL_000c: ldnull - IL_000d: ldc.i4.0 - IL_000e: ldnull - IL_000f: newobj instance void Linq101Aggregates01/mostExpensivePrice@84::.ctor(class [System.Core]System.Linq.IGrouping`2, + IL_000d: newobj instance void Linq101Aggregates01/mostExpensivePrice@84::.ctor(class [System.Core]System.Linq.IGrouping`2, class [Utils]Utils/Product, class [Utils]Utils/Product, class [mscorlib]System.Collections.Generic.IEnumerator`1, int32, class [Utils]Utils/Product) - IL_0014: newobj instance void class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2::.ctor(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_0019: newobj instance void Linq101Aggregates01/'mostExpensivePrice@84-1'::.ctor() - IL_001e: callvirt instance !!2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::MaxBy(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_0012: newobj instance void class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2::.ctor(class [mscorlib]System.Collections.Generic.IEnumerable`1) + IL_0017: newobj instance void Linq101Aggregates01/'mostExpensivePrice@84-1'::.ctor() + IL_001c: callvirt instance !!2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::MaxBy(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_0023: stloc.1 + IL_0021: stloc.1 .line 85,85 : 9,43 '' - IL_0024: ldarg.0 - IL_0025: ldfld class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder Linq101Aggregates01/'categories4@83-3'::builder@ - IL_002a: ldloc.0 - IL_002b: ldloc.1 - IL_002c: newobj instance void class [mscorlib]System.Tuple`2,valuetype [mscorlib]System.Decimal>::.ctor(!0, + IL_0022: ldarg.0 + IL_0023: ldfld class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder Linq101Aggregates01/'categories4@83-3'::builder@ + IL_0028: ldloc.0 + IL_0029: ldloc.1 + IL_002a: newobj instance void class [mscorlib]System.Tuple`2,valuetype [mscorlib]System.Decimal>::.ctor(!0, !1) - IL_0031: tail. - IL_0033: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Yield,valuetype [mscorlib]System.Decimal>,object>(!!0) - IL_0038: ret + IL_002f: tail. + IL_0031: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Yield,valuetype [mscorlib]System.Decimal>,object>(!!0) + IL_0036: ret } // end of method 'categories4@83-3'::Invoke } // end of class 'categories4@83-3' @@ -5235,6 +5253,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -6129,6 +6150,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,valuetype [mscorlib]System.Decimal,class [mscorlib]System.Collections.Generic.IEnumerable`1>,object>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -6147,71 +6171,68 @@ .method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,valuetype [mscorlib]System.Decimal,class [mscorlib]System.Collections.Generic.IEnumerable`1>,object> Invoke(class [System.Core]System.Linq.IGrouping`2 _arg2) cil managed { - // Code size 100 (0x64) + // Code size 96 (0x60) .maxstack 11 .locals init ([0] class [System.Core]System.Linq.IGrouping`2 g, [1] valuetype [mscorlib]System.Decimal maxPrice, - [2] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@, - [3] class [mscorlib]System.Collections.Generic.IEnumerable`1 mostExpensiveProducts, - [4] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_4) + [2] class [mscorlib]System.Collections.Generic.IEnumerable`1 mostExpensiveProducts, + [3] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_3) .line 92,92 : 38,39 '' IL_0000: ldarg.1 IL_0001: stloc.0 IL_0002: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() - IL_0007: stloc.2 - IL_0008: ldloc.2 - IL_0009: ldloc.0 + IL_0007: ldloc.0 + IL_0008: ldnull + IL_0009: ldnull IL_000a: ldnull - IL_000b: ldnull + IL_000b: ldc.i4.0 IL_000c: ldnull - IL_000d: ldc.i4.0 - IL_000e: ldnull - IL_000f: newobj instance void Linq101Aggregates01/maxPrice@93::.ctor(class [System.Core]System.Linq.IGrouping`2, + IL_000d: newobj instance void Linq101Aggregates01/maxPrice@93::.ctor(class [System.Core]System.Linq.IGrouping`2, class [Utils]Utils/Product, class [Utils]Utils/Product, class [mscorlib]System.Collections.Generic.IEnumerator`1, int32, class [Utils]Utils/Product) - IL_0014: newobj instance void class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2::.ctor(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_0019: newobj instance void Linq101Aggregates01/'maxPrice@93-1'::.ctor() - IL_001e: callvirt instance !!2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::MaxBy(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_0012: newobj instance void class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2::.ctor(class [mscorlib]System.Collections.Generic.IEnumerable`1) + IL_0017: newobj instance void Linq101Aggregates01/'maxPrice@93-1'::.ctor() + IL_001c: callvirt instance !!2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::MaxBy(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_0023: stloc.1 + IL_0021: stloc.1 .line 95,95 : 9,46 '' - IL_0024: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() - IL_0029: stloc.s V_4 - IL_002b: ldloc.s V_4 - IL_002d: ldloc.0 + IL_0022: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() + IL_0027: stloc.3 + IL_0028: ldloc.3 + IL_0029: ldloc.0 + IL_002a: ldnull + IL_002b: ldnull + IL_002c: ldnull + IL_002d: ldc.i4.0 IL_002e: ldnull - IL_002f: ldnull - IL_0030: ldnull - IL_0031: ldc.i4.0 - IL_0032: ldnull - IL_0033: newobj instance void Linq101Aggregates01/mostExpensiveProducts@94::.ctor(class [System.Core]System.Linq.IGrouping`2, + IL_002f: newobj instance void Linq101Aggregates01/mostExpensiveProducts@94::.ctor(class [System.Core]System.Linq.IGrouping`2, class [Utils]Utils/Product, class [Utils]Utils/Product, class [mscorlib]System.Collections.Generic.IEnumerator`1, int32, class [Utils]Utils/Product) - IL_0038: newobj instance void class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2::.ctor(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_003d: ldloc.1 - IL_003e: newobj instance void Linq101Aggregates01/'mostExpensiveProducts@94-1'::.ctor(valuetype [mscorlib]System.Decimal) - IL_0043: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Where(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_0034: newobj instance void class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2::.ctor(class [mscorlib]System.Collections.Generic.IEnumerable`1) + IL_0039: ldloc.1 + IL_003a: newobj instance void Linq101Aggregates01/'mostExpensiveProducts@94-1'::.ctor(valuetype [mscorlib]System.Decimal) + IL_003f: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Where(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_0048: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerable`1 class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2::get_Source() - IL_004d: stloc.3 + IL_0044: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerable`1 class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2::get_Source() + IL_0049: stloc.2 .line 95,95 : 9,46 '' - IL_004e: ldarg.0 - IL_004f: ldfld class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder Linq101Aggregates01/'categories5@92-3'::builder@ - IL_0054: ldloc.0 - IL_0055: ldloc.1 - IL_0056: ldloc.3 - IL_0057: newobj instance void class [mscorlib]System.Tuple`3,valuetype [mscorlib]System.Decimal,class [mscorlib]System.Collections.Generic.IEnumerable`1>::.ctor(!0, + IL_004a: ldarg.0 + IL_004b: ldfld class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder Linq101Aggregates01/'categories5@92-3'::builder@ + IL_0050: ldloc.0 + IL_0051: ldloc.1 + IL_0052: ldloc.2 + IL_0053: newobj instance void class [mscorlib]System.Tuple`3,valuetype [mscorlib]System.Decimal,class [mscorlib]System.Collections.Generic.IEnumerable`1>::.ctor(!0, !1, !2) - IL_005c: tail. - IL_005e: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Yield,valuetype [mscorlib]System.Decimal,class [mscorlib]System.Collections.Generic.IEnumerable`1>,object>(!!0) - IL_0063: ret + IL_0058: tail. + IL_005a: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Yield,valuetype [mscorlib]System.Decimal,class [mscorlib]System.Collections.Generic.IEnumerable`1>,object>(!!0) + IL_005f: ret } // end of method 'categories5@92-3'::Invoke } // end of class 'categories5@92-3' @@ -6649,6 +6670,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,object>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -6733,6 +6757,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -7224,6 +7251,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,valuetype [mscorlib]System.Decimal>,object>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -7246,7 +7276,7 @@ .maxstack 10 .locals init ([0] class [System.Core]System.Linq.IGrouping`2 g, [1] valuetype [mscorlib]System.Decimal averagePrice, - [2] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@, + [2] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_2, [3] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_3, [4] class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 V_4, [5] class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_5, @@ -7786,7 +7816,7 @@ .method public static void main@() cil managed { .entrypoint - // Code size 1813 (0x715) + // Code size 1797 (0x705) .maxstack 13 .locals init ([0] class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 factorsOf300, [1] int32 uniqueFactors, @@ -7808,7 +7838,7 @@ [17] float64 averageNum, [18] float64 averageLength, [19] class [mscorlib]System.Tuple`2[] categories6, - [20] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@, + [20] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_20, [21] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_21, [22] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_22, [23] class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 V_23, @@ -7834,33 +7864,29 @@ [43] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_43, [44] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_44, [45] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_45, - [46] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_46, - [47] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_47, - [48] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_48, - [49] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_49, - [50] class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 V_50, - [51] class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_51, - [52] class [mscorlib]System.Collections.Generic.IEnumerable`1 V_52, - [53] class [mscorlib]System.Collections.Generic.IEnumerator`1 V_53, - [54] float64 V_54, - [55] float64 V_55, - [56] int32 V_56, - [57] float64 V_57, - [58] int32 V_58, - [59] class [mscorlib]System.IDisposable V_59, - [60] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_60, - [61] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_61, - [62] class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,class [mscorlib]System.Collections.IEnumerable> V_62, - [63] class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,float64> V_63, - [64] class [mscorlib]System.Collections.Generic.IEnumerable`1> V_64, - [65] class [mscorlib]System.Collections.Generic.IEnumerator`1> V_65, - [66] float64 V_66, - [67] float64 V_67, - [68] int32 V_68, - [69] float64 V_69, - [70] int32 V_70, - [71] class [mscorlib]System.IDisposable V_71, - [72] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_72) + [46] class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 V_46, + [47] class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 V_47, + [48] class [mscorlib]System.Collections.Generic.IEnumerable`1 V_48, + [49] class [mscorlib]System.Collections.Generic.IEnumerator`1 V_49, + [50] float64 V_50, + [51] float64 V_51, + [52] int32 V_52, + [53] float64 V_53, + [54] int32 V_54, + [55] class [mscorlib]System.IDisposable V_55, + [56] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_56, + [57] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_57, + [58] class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,class [mscorlib]System.Collections.IEnumerable> V_58, + [59] class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,float64> V_59, + [60] class [mscorlib]System.Collections.Generic.IEnumerable`1> V_60, + [61] class [mscorlib]System.Collections.Generic.IEnumerator`1> V_61, + [62] float64 V_62, + [63] float64 V_63, + [64] int32 V_64, + [65] float64 V_65, + [66] int32 V_66, + [67] class [mscorlib]System.IDisposable V_67, + [68] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_68) .line 8,8 : 1,31 '' IL_0000: ldc.i4.2 IL_0001: ldc.i4.2 @@ -7883,8 +7909,8 @@ IL_0029: stloc.0 .line 10,14 : 1,20 '' IL_002a: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() - IL_002f: stloc.s builder@ - IL_0031: ldloc.s builder@ + IL_002f: stloc.s V_20 + IL_0031: ldloc.s V_20 IL_0033: ldc.i4.0 IL_0034: ldc.i4.0 IL_0035: ldnull @@ -8142,507 +8168,499 @@ IL_0239: stsfld class [mscorlib]System.Tuple`2[] ''.$Linq101Aggregates01::categories@37 IL_023e: stloc.s categories IL_0240: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() - IL_0245: stloc.s V_40 - IL_0247: ldloc.s V_40 + IL_0245: ldc.i4.0 + IL_0246: ldc.i4.0 + IL_0247: ldnull + IL_0248: ldc.i4.0 IL_0249: ldc.i4.0 - IL_024a: ldc.i4.0 - IL_024b: ldnull - IL_024c: ldc.i4.0 - IL_024d: ldc.i4.0 - IL_024e: newobj instance void Linq101Aggregates01/minNum@49::.ctor(int32, + IL_024a: newobj instance void Linq101Aggregates01/minNum@49::.ctor(int32, int32, class [mscorlib]System.Collections.Generic.IEnumerator`1, int32, int32) - IL_0253: newobj instance void class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2::.ctor(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_0258: newobj instance void Linq101Aggregates01/'minNum@49-1'::.ctor() - IL_025d: callvirt instance !!2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::MinBy(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_024f: newobj instance void class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2::.ctor(class [mscorlib]System.Collections.Generic.IEnumerable`1) + IL_0254: newobj instance void Linq101Aggregates01/'minNum@49-1'::.ctor() + IL_0259: callvirt instance !!2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::MinBy(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_0262: dup - IL_0263: stsfld int32 ''.$Linq101Aggregates01::minNum@49 - IL_0268: stloc.s minNum - IL_026a: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() - IL_026f: stloc.s V_41 - IL_0271: ldloc.s V_41 - IL_0273: ldnull - IL_0274: ldnull - IL_0275: ldnull - IL_0276: ldc.i4.0 - IL_0277: ldnull - IL_0278: newobj instance void Linq101Aggregates01/shortestWord@52::.ctor(string, + IL_025e: dup + IL_025f: stsfld int32 ''.$Linq101Aggregates01::minNum@49 + IL_0264: stloc.s minNum + IL_0266: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() + IL_026b: ldnull + IL_026c: ldnull + IL_026d: ldnull + IL_026e: ldc.i4.0 + IL_026f: ldnull + IL_0270: newobj instance void Linq101Aggregates01/shortestWord@52::.ctor(string, string, class [mscorlib]System.Collections.Generic.IEnumerator`1, int32, string) - IL_027d: newobj instance void class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2::.ctor(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_0282: newobj instance void Linq101Aggregates01/'shortestWord@52-1'::.ctor() - IL_0287: callvirt instance !!2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::MinBy(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_0275: newobj instance void class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2::.ctor(class [mscorlib]System.Collections.Generic.IEnumerable`1) + IL_027a: newobj instance void Linq101Aggregates01/'shortestWord@52-1'::.ctor() + IL_027f: callvirt instance !!2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::MinBy(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_028c: dup - IL_028d: stsfld int32 ''.$Linq101Aggregates01::shortestWord@52 - IL_0292: stloc.s shortestWord + IL_0284: dup + IL_0285: stsfld int32 ''.$Linq101Aggregates01::shortestWord@52 + IL_028a: stloc.s shortestWord .line 55,61 : 1,21 '' - IL_0294: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() - IL_0299: stloc.s V_42 - IL_029b: ldloc.s V_42 - IL_029d: ldloc.s V_42 - IL_029f: ldloc.s V_42 - IL_02a1: ldloc.s V_42 - IL_02a3: ldloc.s V_42 - IL_02a5: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Linq101Aggregates01::get_products() - IL_02aa: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Source(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_02af: ldloc.s V_42 - IL_02b1: newobj instance void Linq101Aggregates01/categories2@57::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) - IL_02b6: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_028c: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() + IL_0291: stloc.s V_40 + IL_0293: ldloc.s V_40 + IL_0295: ldloc.s V_40 + IL_0297: ldloc.s V_40 + IL_0299: ldloc.s V_40 + IL_029b: ldloc.s V_40 + IL_029d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Linq101Aggregates01::get_products() + IL_02a2: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Source(class [mscorlib]System.Collections.Generic.IEnumerable`1) + IL_02a7: ldloc.s V_40 + IL_02a9: newobj instance void Linq101Aggregates01/categories2@57::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) + IL_02ae: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_02bb: newobj instance void Linq101Aggregates01/'categories2@58-1'::.ctor() - IL_02c0: newobj instance void Linq101Aggregates01/'categories2@58-2'::.ctor() - IL_02c5: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,!!3> [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::GroupValBy(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_02b3: newobj instance void Linq101Aggregates01/'categories2@58-1'::.ctor() + IL_02b8: newobj instance void Linq101Aggregates01/'categories2@58-2'::.ctor() + IL_02bd: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,!!3> [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::GroupValBy(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_02ca: ldloc.s V_42 - IL_02cc: newobj instance void Linq101Aggregates01/'categories2@58-3'::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) - IL_02d1: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For,class [mscorlib]System.Collections.IEnumerable,class [mscorlib]System.Tuple`2,valuetype [mscorlib]System.Decimal>,object>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_02c2: ldloc.s V_40 + IL_02c4: newobj instance void Linq101Aggregates01/'categories2@58-3'::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) + IL_02c9: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For,class [mscorlib]System.Collections.IEnumerable,class [mscorlib]System.Tuple`2,valuetype [mscorlib]System.Decimal>,object>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_02d6: newobj instance void Linq101Aggregates01/'categories2@60-4'::.ctor() - IL_02db: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Select,valuetype [mscorlib]System.Decimal>,class [mscorlib]System.Collections.IEnumerable,class [mscorlib]System.Tuple`2>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_02ce: newobj instance void Linq101Aggregates01/'categories2@60-4'::.ctor() + IL_02d3: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Select,valuetype [mscorlib]System.Decimal>,class [mscorlib]System.Collections.IEnumerable,class [mscorlib]System.Tuple`2>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_02e0: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerable`1 class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,class [mscorlib]System.Collections.IEnumerable>::get_Source() - IL_02e5: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray>(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_02ea: dup - IL_02eb: stsfld class [mscorlib]System.Tuple`2[] ''.$Linq101Aggregates01::categories2@55 - IL_02f0: stloc.s categories2 + IL_02d8: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerable`1 class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,class [mscorlib]System.Collections.IEnumerable>::get_Source() + IL_02dd: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray>(class [mscorlib]System.Collections.Generic.IEnumerable`1) + IL_02e2: dup + IL_02e3: stsfld class [mscorlib]System.Tuple`2[] ''.$Linq101Aggregates01::categories2@55 + IL_02e8: stloc.s categories2 .line 64,71 : 1,21 '' - IL_02f2: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() - IL_02f7: stloc.s V_43 - IL_02f9: ldloc.s V_43 - IL_02fb: ldloc.s V_43 - IL_02fd: ldloc.s V_43 - IL_02ff: ldloc.s V_43 - IL_0301: ldloc.s V_43 - IL_0303: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Linq101Aggregates01::get_products() - IL_0308: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Source(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_030d: ldloc.s V_43 - IL_030f: newobj instance void Linq101Aggregates01/categories3@66::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) - IL_0314: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_02ea: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() + IL_02ef: stloc.s V_41 + IL_02f1: ldloc.s V_41 + IL_02f3: ldloc.s V_41 + IL_02f5: ldloc.s V_41 + IL_02f7: ldloc.s V_41 + IL_02f9: ldloc.s V_41 + IL_02fb: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Linq101Aggregates01::get_products() + IL_0300: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Source(class [mscorlib]System.Collections.Generic.IEnumerable`1) + IL_0305: ldloc.s V_41 + IL_0307: newobj instance void Linq101Aggregates01/categories3@66::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) + IL_030c: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_0319: newobj instance void Linq101Aggregates01/'categories3@67-1'::.ctor() - IL_031e: newobj instance void Linq101Aggregates01/'categories3@67-2'::.ctor() - IL_0323: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,!!3> [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::GroupValBy(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_0311: newobj instance void Linq101Aggregates01/'categories3@67-1'::.ctor() + IL_0316: newobj instance void Linq101Aggregates01/'categories3@67-2'::.ctor() + IL_031b: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,!!3> [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::GroupValBy(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_0328: ldloc.s V_43 - IL_032a: newobj instance void Linq101Aggregates01/'categories3@67-3'::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) - IL_032f: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For,class [mscorlib]System.Collections.IEnumerable,class [mscorlib]System.Tuple`3,valuetype [mscorlib]System.Decimal,class [mscorlib]System.Collections.Generic.IEnumerable`1>,object>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_0320: ldloc.s V_41 + IL_0322: newobj instance void Linq101Aggregates01/'categories3@67-3'::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) + IL_0327: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For,class [mscorlib]System.Collections.IEnumerable,class [mscorlib]System.Tuple`3,valuetype [mscorlib]System.Decimal,class [mscorlib]System.Collections.Generic.IEnumerable`1>,object>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_0334: newobj instance void Linq101Aggregates01/'categories3@70-4'::.ctor() - IL_0339: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Select,valuetype [mscorlib]System.Decimal,class [mscorlib]System.Collections.Generic.IEnumerable`1>,class [mscorlib]System.Collections.IEnumerable,class [mscorlib]System.Tuple`2>>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_032c: newobj instance void Linq101Aggregates01/'categories3@70-4'::.ctor() + IL_0331: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Select,valuetype [mscorlib]System.Decimal,class [mscorlib]System.Collections.Generic.IEnumerable`1>,class [mscorlib]System.Collections.IEnumerable,class [mscorlib]System.Tuple`2>>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_033e: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerable`1 class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2>,class [mscorlib]System.Collections.IEnumerable>::get_Source() - IL_0343: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray>>(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_0348: dup - IL_0349: stsfld class [mscorlib]System.Tuple`2>[] ''.$Linq101Aggregates01::categories3@64 - IL_034e: stloc.s categories3 - IL_0350: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() - IL_0355: stloc.s V_44 - IL_0357: ldloc.s V_44 - IL_0359: ldc.i4.0 - IL_035a: ldc.i4.0 - IL_035b: ldnull - IL_035c: ldc.i4.0 - IL_035d: ldc.i4.0 - IL_035e: newobj instance void Linq101Aggregates01/maxNum@74::.ctor(int32, + IL_0336: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerable`1 class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2>,class [mscorlib]System.Collections.IEnumerable>::get_Source() + IL_033b: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray>>(class [mscorlib]System.Collections.Generic.IEnumerable`1) + IL_0340: dup + IL_0341: stsfld class [mscorlib]System.Tuple`2>[] ''.$Linq101Aggregates01::categories3@64 + IL_0346: stloc.s categories3 + IL_0348: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() + IL_034d: ldc.i4.0 + IL_034e: ldc.i4.0 + IL_034f: ldnull + IL_0350: ldc.i4.0 + IL_0351: ldc.i4.0 + IL_0352: newobj instance void Linq101Aggregates01/maxNum@74::.ctor(int32, int32, class [mscorlib]System.Collections.Generic.IEnumerator`1, int32, int32) - IL_0363: newobj instance void class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2::.ctor(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_0368: newobj instance void Linq101Aggregates01/'maxNum@74-1'::.ctor() - IL_036d: callvirt instance !!2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::MaxBy(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_0357: newobj instance void class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2::.ctor(class [mscorlib]System.Collections.Generic.IEnumerable`1) + IL_035c: newobj instance void Linq101Aggregates01/'maxNum@74-1'::.ctor() + IL_0361: callvirt instance !!2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::MaxBy(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_0372: dup - IL_0373: stsfld int32 ''.$Linq101Aggregates01::maxNum@74 - IL_0378: stloc.s maxNum - IL_037a: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() - IL_037f: stloc.s V_45 - IL_0381: ldloc.s V_45 - IL_0383: ldnull - IL_0384: ldnull - IL_0385: ldnull - IL_0386: ldc.i4.0 - IL_0387: ldnull - IL_0388: newobj instance void Linq101Aggregates01/longestLength@77::.ctor(string, + IL_0366: dup + IL_0367: stsfld int32 ''.$Linq101Aggregates01::maxNum@74 + IL_036c: stloc.s maxNum + IL_036e: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() + IL_0373: ldnull + IL_0374: ldnull + IL_0375: ldnull + IL_0376: ldc.i4.0 + IL_0377: ldnull + IL_0378: newobj instance void Linq101Aggregates01/longestLength@77::.ctor(string, string, class [mscorlib]System.Collections.Generic.IEnumerator`1, int32, string) - IL_038d: newobj instance void class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2::.ctor(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_0392: newobj instance void Linq101Aggregates01/'longestLength@77-1'::.ctor() - IL_0397: callvirt instance !!2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::MaxBy(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_037d: newobj instance void class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2::.ctor(class [mscorlib]System.Collections.Generic.IEnumerable`1) + IL_0382: newobj instance void Linq101Aggregates01/'longestLength@77-1'::.ctor() + IL_0387: callvirt instance !!2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::MaxBy(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_039c: dup - IL_039d: stsfld int32 ''.$Linq101Aggregates01::longestLength@77 - IL_03a2: stloc.s longestLength + IL_038c: dup + IL_038d: stsfld int32 ''.$Linq101Aggregates01::longestLength@77 + IL_0392: stloc.s longestLength .line 80,86 : 1,21 '' - IL_03a4: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() - IL_03a9: stloc.s V_46 - IL_03ab: ldloc.s V_46 - IL_03ad: ldloc.s V_46 - IL_03af: ldloc.s V_46 - IL_03b1: ldloc.s V_46 - IL_03b3: ldloc.s V_46 - IL_03b5: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Linq101Aggregates01::get_products() - IL_03ba: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Source(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_03bf: ldloc.s V_46 - IL_03c1: newobj instance void Linq101Aggregates01/categories4@82::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) - IL_03c6: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_0394: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() + IL_0399: stloc.s V_42 + IL_039b: ldloc.s V_42 + IL_039d: ldloc.s V_42 + IL_039f: ldloc.s V_42 + IL_03a1: ldloc.s V_42 + IL_03a3: ldloc.s V_42 + IL_03a5: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Linq101Aggregates01::get_products() + IL_03aa: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Source(class [mscorlib]System.Collections.Generic.IEnumerable`1) + IL_03af: ldloc.s V_42 + IL_03b1: newobj instance void Linq101Aggregates01/categories4@82::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) + IL_03b6: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_03cb: newobj instance void Linq101Aggregates01/'categories4@83-1'::.ctor() - IL_03d0: newobj instance void Linq101Aggregates01/'categories4@83-2'::.ctor() - IL_03d5: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,!!3> [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::GroupValBy(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_03bb: newobj instance void Linq101Aggregates01/'categories4@83-1'::.ctor() + IL_03c0: newobj instance void Linq101Aggregates01/'categories4@83-2'::.ctor() + IL_03c5: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,!!3> [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::GroupValBy(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_03da: ldloc.s V_46 - IL_03dc: newobj instance void Linq101Aggregates01/'categories4@83-3'::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) - IL_03e1: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For,class [mscorlib]System.Collections.IEnumerable,class [mscorlib]System.Tuple`2,valuetype [mscorlib]System.Decimal>,object>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_03ca: ldloc.s V_42 + IL_03cc: newobj instance void Linq101Aggregates01/'categories4@83-3'::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) + IL_03d1: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For,class [mscorlib]System.Collections.IEnumerable,class [mscorlib]System.Tuple`2,valuetype [mscorlib]System.Decimal>,object>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_03e6: newobj instance void Linq101Aggregates01/'categories4@85-4'::.ctor() - IL_03eb: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Select,valuetype [mscorlib]System.Decimal>,class [mscorlib]System.Collections.IEnumerable,class [mscorlib]System.Tuple`2>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_03d6: newobj instance void Linq101Aggregates01/'categories4@85-4'::.ctor() + IL_03db: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Select,valuetype [mscorlib]System.Decimal>,class [mscorlib]System.Collections.IEnumerable,class [mscorlib]System.Tuple`2>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_03f0: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerable`1 class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,class [mscorlib]System.Collections.IEnumerable>::get_Source() - IL_03f5: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray>(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_03fa: dup - IL_03fb: stsfld class [mscorlib]System.Tuple`2[] ''.$Linq101Aggregates01::categories4@80 - IL_0400: stloc.s categories4 + IL_03e0: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerable`1 class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,class [mscorlib]System.Collections.IEnumerable>::get_Source() + IL_03e5: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray>(class [mscorlib]System.Collections.Generic.IEnumerable`1) + IL_03ea: dup + IL_03eb: stsfld class [mscorlib]System.Tuple`2[] ''.$Linq101Aggregates01::categories4@80 + IL_03f0: stloc.s categories4 .line 89,96 : 1,21 '' - IL_0402: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() - IL_0407: stloc.s V_47 - IL_0409: ldloc.s V_47 - IL_040b: ldloc.s V_47 - IL_040d: ldloc.s V_47 - IL_040f: ldloc.s V_47 - IL_0411: ldloc.s V_47 - IL_0413: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Linq101Aggregates01::get_products() - IL_0418: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Source(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_041d: ldloc.s V_47 - IL_041f: newobj instance void Linq101Aggregates01/categories5@91::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) - IL_0424: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_03f2: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() + IL_03f7: stloc.s V_43 + IL_03f9: ldloc.s V_43 + IL_03fb: ldloc.s V_43 + IL_03fd: ldloc.s V_43 + IL_03ff: ldloc.s V_43 + IL_0401: ldloc.s V_43 + IL_0403: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Linq101Aggregates01::get_products() + IL_0408: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Source(class [mscorlib]System.Collections.Generic.IEnumerable`1) + IL_040d: ldloc.s V_43 + IL_040f: newobj instance void Linq101Aggregates01/categories5@91::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) + IL_0414: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_0429: newobj instance void Linq101Aggregates01/'categories5@92-1'::.ctor() - IL_042e: newobj instance void Linq101Aggregates01/'categories5@92-2'::.ctor() - IL_0433: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,!!3> [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::GroupValBy(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_0419: newobj instance void Linq101Aggregates01/'categories5@92-1'::.ctor() + IL_041e: newobj instance void Linq101Aggregates01/'categories5@92-2'::.ctor() + IL_0423: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,!!3> [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::GroupValBy(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_0438: ldloc.s V_47 - IL_043a: newobj instance void Linq101Aggregates01/'categories5@92-3'::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) - IL_043f: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For,class [mscorlib]System.Collections.IEnumerable,class [mscorlib]System.Tuple`3,valuetype [mscorlib]System.Decimal,class [mscorlib]System.Collections.Generic.IEnumerable`1>,object>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_0428: ldloc.s V_43 + IL_042a: newobj instance void Linq101Aggregates01/'categories5@92-3'::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) + IL_042f: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For,class [mscorlib]System.Collections.IEnumerable,class [mscorlib]System.Tuple`3,valuetype [mscorlib]System.Decimal,class [mscorlib]System.Collections.Generic.IEnumerable`1>,object>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_0444: newobj instance void Linq101Aggregates01/'categories5@95-4'::.ctor() - IL_0449: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Select,valuetype [mscorlib]System.Decimal,class [mscorlib]System.Collections.Generic.IEnumerable`1>,class [mscorlib]System.Collections.IEnumerable,class [mscorlib]System.Tuple`2>>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_0434: newobj instance void Linq101Aggregates01/'categories5@95-4'::.ctor() + IL_0439: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Select,valuetype [mscorlib]System.Decimal,class [mscorlib]System.Collections.Generic.IEnumerable`1>,class [mscorlib]System.Collections.IEnumerable,class [mscorlib]System.Tuple`2>>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_044e: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerable`1 class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2>,class [mscorlib]System.Collections.IEnumerable>::get_Source() - IL_0453: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray>>(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_0458: dup - IL_0459: stsfld class [mscorlib]System.Tuple`2>[] ''.$Linq101Aggregates01::categories5@89 - IL_045e: stloc.s categories5 + IL_043e: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerable`1 class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2>,class [mscorlib]System.Collections.IEnumerable>::get_Source() + IL_0443: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray>>(class [mscorlib]System.Collections.Generic.IEnumerable`1) + IL_0448: dup + IL_0449: stsfld class [mscorlib]System.Tuple`2>[] ''.$Linq101Aggregates01::categories5@89 + IL_044e: stloc.s categories5 .line 99,99 : 1,66 '' - IL_0460: ldc.r8 5. - IL_0469: ldc.r8 4. - IL_0472: ldc.r8 1. - IL_047b: ldc.r8 3. - IL_0484: ldc.r8 9. - IL_048d: ldc.r8 8. - IL_0496: ldc.r8 6. - IL_049f: ldc.r8 7. - IL_04a8: ldc.r8 2. - IL_04b1: ldc.r8 0.0 - IL_04ba: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_04bf: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_0450: ldc.r8 5. + IL_0459: ldc.r8 4. + IL_0462: ldc.r8 1. + IL_046b: ldc.r8 3. + IL_0474: ldc.r8 9. + IL_047d: ldc.r8 8. + IL_0486: ldc.r8 6. + IL_048f: ldc.r8 7. + IL_0498: ldc.r8 2. + IL_04a1: ldc.r8 0.0 + IL_04aa: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_04af: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_04c4: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_04b4: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_04c9: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_04b9: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_04ce: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_04be: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_04d3: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_04c3: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_04d8: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_04c8: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_04dd: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_04cd: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_04e2: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_04d2: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_04e7: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_04d7: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_04ec: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_04dc: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_04f1: dup - IL_04f2: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$Linq101Aggregates01::numbers2@99 - IL_04f7: stloc.s numbers2 - IL_04f9: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() - IL_04fe: stloc.s V_48 - IL_0500: ldloc.s V_48 - IL_0502: stloc.s V_49 - IL_0504: ldc.r8 0.0 - IL_050d: ldc.r8 0.0 - IL_0516: ldnull - IL_0517: ldc.i4.0 - IL_0518: ldc.r8 0.0 - IL_0521: newobj instance void Linq101Aggregates01/averageNum@100::.ctor(float64, + IL_04e1: dup + IL_04e2: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$Linq101Aggregates01::numbers2@99 + IL_04e7: stloc.s numbers2 + IL_04e9: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() + IL_04ee: stloc.s V_44 + IL_04f0: ldloc.s V_44 + IL_04f2: stloc.s V_45 + IL_04f4: ldc.r8 0.0 + IL_04fd: ldc.r8 0.0 + IL_0506: ldnull + IL_0507: ldc.i4.0 + IL_0508: ldc.r8 0.0 + IL_0511: newobj instance void Linq101Aggregates01/averageNum@100::.ctor(float64, float64, class [mscorlib]System.Collections.Generic.IEnumerator`1, int32, float64) - IL_0526: newobj instance void class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2::.ctor(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_052b: stloc.s V_50 - IL_052d: newobj instance void Linq101Aggregates01/'averageNum@100-1'::.ctor() - IL_0532: stloc.s V_51 - IL_0534: ldloc.s V_50 - IL_0536: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerable`1 class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2::get_Source() - IL_053b: stloc.s V_52 - IL_053d: ldloc.s V_52 - IL_053f: box class [mscorlib]System.Collections.Generic.IEnumerable`1 - IL_0544: brfalse.s IL_0548 - - IL_0546: br.s IL_0553 + IL_0516: newobj instance void class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2::.ctor(class [mscorlib]System.Collections.Generic.IEnumerable`1) + IL_051b: stloc.s V_46 + IL_051d: newobj instance void Linq101Aggregates01/'averageNum@100-1'::.ctor() + IL_0522: stloc.s V_47 + IL_0524: ldloc.s V_46 + IL_0526: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerable`1 class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2::get_Source() + IL_052b: stloc.s V_48 + IL_052d: ldloc.s V_48 + IL_052f: box class [mscorlib]System.Collections.Generic.IEnumerable`1 + IL_0534: brfalse.s IL_0538 + + IL_0536: br.s IL_0543 .line 100001,100001 : 0,0 '' - IL_0548: ldstr "source" - IL_054d: newobj instance void [mscorlib]System.ArgumentNullException::.ctor(string) - IL_0552: throw + IL_0538: ldstr "source" + IL_053d: newobj instance void [mscorlib]System.ArgumentNullException::.ctor(string) + IL_0542: throw .line 100001,100001 : 0,0 '' - IL_0553: nop - IL_0554: ldloc.s V_52 - IL_0556: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerator`1 class [mscorlib]System.Collections.Generic.IEnumerable`1::GetEnumerator() - IL_055b: stloc.s V_53 + IL_0543: nop + IL_0544: ldloc.s V_48 + IL_0546: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerator`1 class [mscorlib]System.Collections.Generic.IEnumerable`1::GetEnumerator() + IL_054b: stloc.s V_49 .try { - IL_055d: ldc.r8 0.0 - IL_0566: stloc.s V_55 - IL_0568: ldc.i4.0 - IL_0569: stloc.s V_56 - IL_056b: ldloc.s V_53 - IL_056d: callvirt instance bool [mscorlib]System.Collections.IEnumerator::MoveNext() - IL_0572: brfalse.s IL_0590 - - IL_0574: ldloc.s V_55 - IL_0576: ldloc.s V_51 - IL_0578: ldloc.s V_53 - IL_057a: callvirt instance !0 class [mscorlib]System.Collections.Generic.IEnumerator`1::get_Current() - IL_057f: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_0584: add - IL_0585: stloc.s V_55 + IL_054d: ldc.r8 0.0 + IL_0556: stloc.s V_51 + IL_0558: ldc.i4.0 + IL_0559: stloc.s V_52 + IL_055b: ldloc.s V_49 + IL_055d: callvirt instance bool [mscorlib]System.Collections.IEnumerator::MoveNext() + IL_0562: brfalse.s IL_0580 + + IL_0564: ldloc.s V_51 + IL_0566: ldloc.s V_47 + IL_0568: ldloc.s V_49 + IL_056a: callvirt instance !0 class [mscorlib]System.Collections.Generic.IEnumerator`1::get_Current() + IL_056f: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0574: add + IL_0575: stloc.s V_51 .line 100,100 : 47,58 '' - IL_0587: ldloc.s V_56 - IL_0589: ldc.i4.1 - IL_058a: add - IL_058b: stloc.s V_56 + IL_0577: ldloc.s V_52 + IL_0579: ldc.i4.1 + IL_057a: add + IL_057b: stloc.s V_52 .line 100001,100001 : 0,0 '' - IL_058d: nop - IL_058e: br.s IL_056b + IL_057d: nop + IL_057e: br.s IL_055b - IL_0590: ldloc.s V_56 - IL_0592: brtrue.s IL_0596 + IL_0580: ldloc.s V_52 + IL_0582: brtrue.s IL_0586 - IL_0594: br.s IL_0598 + IL_0584: br.s IL_0588 - IL_0596: br.s IL_05a3 + IL_0586: br.s IL_0593 .line 100001,100001 : 0,0 '' - IL_0598: ldstr "source" - IL_059d: newobj instance void [mscorlib]System.InvalidOperationException::.ctor(string) - IL_05a2: throw + IL_0588: ldstr "source" + IL_058d: newobj instance void [mscorlib]System.InvalidOperationException::.ctor(string) + IL_0592: throw .line 100001,100001 : 0,0 '' - IL_05a3: nop - IL_05a4: ldloc.s V_55 - IL_05a6: stloc.s V_57 - IL_05a8: ldloc.s V_56 - IL_05aa: stloc.s V_58 - IL_05ac: ldloc.s V_57 - IL_05ae: ldloc.s V_58 - IL_05b0: conv.r8 - IL_05b1: div - IL_05b2: stloc.s V_54 - IL_05b4: leave.s IL_05d4 + IL_0593: nop + IL_0594: ldloc.s V_51 + IL_0596: stloc.s V_53 + IL_0598: ldloc.s V_52 + IL_059a: stloc.s V_54 + IL_059c: ldloc.s V_53 + IL_059e: ldloc.s V_54 + IL_05a0: conv.r8 + IL_05a1: div + IL_05a2: stloc.s V_50 + IL_05a4: leave.s IL_05c4 } // end .try finally { - IL_05b6: ldloc.s V_53 - IL_05b8: isinst [mscorlib]System.IDisposable - IL_05bd: stloc.s V_59 - IL_05bf: ldloc.s V_59 - IL_05c1: brfalse.s IL_05c5 + IL_05a6: ldloc.s V_49 + IL_05a8: isinst [mscorlib]System.IDisposable + IL_05ad: stloc.s V_55 + IL_05af: ldloc.s V_55 + IL_05b1: brfalse.s IL_05b5 - IL_05c3: br.s IL_05c7 + IL_05b3: br.s IL_05b7 - IL_05c5: br.s IL_05d1 + IL_05b5: br.s IL_05c1 .line 100001,100001 : 0,0 '' - IL_05c7: ldloc.s V_59 - IL_05c9: callvirt instance void [mscorlib]System.IDisposable::Dispose() - IL_05ce: ldnull - IL_05cf: pop - IL_05d0: endfinally + IL_05b7: ldloc.s V_55 + IL_05b9: callvirt instance void [mscorlib]System.IDisposable::Dispose() + IL_05be: ldnull + IL_05bf: pop + IL_05c0: endfinally .line 100001,100001 : 0,0 '' - IL_05d1: ldnull - IL_05d2: pop - IL_05d3: endfinally + IL_05c1: ldnull + IL_05c2: pop + IL_05c3: endfinally .line 100001,100001 : 0,0 '' } // end handler - IL_05d4: ldloc.s V_54 - IL_05d6: dup - IL_05d7: stsfld float64 ''.$Linq101Aggregates01::averageNum@100 - IL_05dc: stloc.s averageNum - IL_05de: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() - IL_05e3: stloc.s V_60 - IL_05e5: ldloc.s V_60 - IL_05e7: stloc.s V_61 - IL_05e9: ldloc.s V_60 - IL_05eb: ldloc.s V_60 - IL_05ed: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Linq101Aggregates01::get_words() - IL_05f2: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Source(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_05f7: ldloc.s V_60 - IL_05f9: newobj instance void Linq101Aggregates01/averageLength@105::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) - IL_05fe: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For,object>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_05c4: ldloc.s V_50 + IL_05c6: dup + IL_05c7: stsfld float64 ''.$Linq101Aggregates01::averageNum@100 + IL_05cc: stloc.s averageNum + IL_05ce: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() + IL_05d3: stloc.s V_56 + IL_05d5: ldloc.s V_56 + IL_05d7: stloc.s V_57 + IL_05d9: ldloc.s V_56 + IL_05db: ldloc.s V_56 + IL_05dd: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Linq101Aggregates01::get_words() + IL_05e2: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Source(class [mscorlib]System.Collections.Generic.IEnumerable`1) + IL_05e7: ldloc.s V_56 + IL_05e9: newobj instance void Linq101Aggregates01/averageLength@105::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) + IL_05ee: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For,object>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_0603: stloc.s V_62 - IL_0605: newobj instance void Linq101Aggregates01/'averageLength@107-1'::.ctor() - IL_060a: stloc.s V_63 - IL_060c: ldloc.s V_62 - IL_060e: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerable`1 class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,class [mscorlib]System.Collections.IEnumerable>::get_Source() - IL_0613: stloc.s V_64 - IL_0615: ldloc.s V_64 - IL_0617: box class [mscorlib]System.Collections.Generic.IEnumerable`1> - IL_061c: brfalse.s IL_0620 - - IL_061e: br.s IL_062b + IL_05f3: stloc.s V_58 + IL_05f5: newobj instance void Linq101Aggregates01/'averageLength@107-1'::.ctor() + IL_05fa: stloc.s V_59 + IL_05fc: ldloc.s V_58 + IL_05fe: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerable`1 class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,class [mscorlib]System.Collections.IEnumerable>::get_Source() + IL_0603: stloc.s V_60 + IL_0605: ldloc.s V_60 + IL_0607: box class [mscorlib]System.Collections.Generic.IEnumerable`1> + IL_060c: brfalse.s IL_0610 + + IL_060e: br.s IL_061b .line 100001,100001 : 0,0 '' - IL_0620: ldstr "source" - IL_0625: newobj instance void [mscorlib]System.ArgumentNullException::.ctor(string) - IL_062a: throw + IL_0610: ldstr "source" + IL_0615: newobj instance void [mscorlib]System.ArgumentNullException::.ctor(string) + IL_061a: throw .line 100001,100001 : 0,0 '' - IL_062b: nop - IL_062c: ldloc.s V_64 - IL_062e: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerator`1 class [mscorlib]System.Collections.Generic.IEnumerable`1>::GetEnumerator() - IL_0633: stloc.s V_65 + IL_061b: nop + IL_061c: ldloc.s V_60 + IL_061e: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerator`1 class [mscorlib]System.Collections.Generic.IEnumerable`1>::GetEnumerator() + IL_0623: stloc.s V_61 .try { - IL_0635: ldc.r8 0.0 - IL_063e: stloc.s V_67 - IL_0640: ldc.i4.0 - IL_0641: stloc.s V_68 - IL_0643: ldloc.s V_65 - IL_0645: callvirt instance bool [mscorlib]System.Collections.IEnumerator::MoveNext() - IL_064a: brfalse.s IL_0668 - - IL_064c: ldloc.s V_67 - IL_064e: ldloc.s V_63 - IL_0650: ldloc.s V_65 - IL_0652: callvirt instance !0 class [mscorlib]System.Collections.Generic.IEnumerator`1>::get_Current() - IL_0657: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,float64>::Invoke(!0) - IL_065c: add - IL_065d: stloc.s V_67 + IL_0625: ldc.r8 0.0 + IL_062e: stloc.s V_63 + IL_0630: ldc.i4.0 + IL_0631: stloc.s V_64 + IL_0633: ldloc.s V_61 + IL_0635: callvirt instance bool [mscorlib]System.Collections.IEnumerator::MoveNext() + IL_063a: brfalse.s IL_0658 + + IL_063c: ldloc.s V_63 + IL_063e: ldloc.s V_59 + IL_0640: ldloc.s V_61 + IL_0642: callvirt instance !0 class [mscorlib]System.Collections.Generic.IEnumerator`1>::get_Current() + IL_0647: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,float64>::Invoke(!0) + IL_064c: add + IL_064d: stloc.s V_63 .line 107,107 : 9,21 '' - IL_065f: ldloc.s V_68 - IL_0661: ldc.i4.1 - IL_0662: add - IL_0663: stloc.s V_68 + IL_064f: ldloc.s V_64 + IL_0651: ldc.i4.1 + IL_0652: add + IL_0653: stloc.s V_64 .line 100001,100001 : 0,0 '' - IL_0665: nop - IL_0666: br.s IL_0643 + IL_0655: nop + IL_0656: br.s IL_0633 - IL_0668: ldloc.s V_68 - IL_066a: brtrue.s IL_066e + IL_0658: ldloc.s V_64 + IL_065a: brtrue.s IL_065e - IL_066c: br.s IL_0670 + IL_065c: br.s IL_0660 - IL_066e: br.s IL_067b + IL_065e: br.s IL_066b .line 100001,100001 : 0,0 '' - IL_0670: ldstr "source" - IL_0675: newobj instance void [mscorlib]System.InvalidOperationException::.ctor(string) - IL_067a: throw + IL_0660: ldstr "source" + IL_0665: newobj instance void [mscorlib]System.InvalidOperationException::.ctor(string) + IL_066a: throw .line 100001,100001 : 0,0 '' - IL_067b: nop - IL_067c: ldloc.s V_67 - IL_067e: stloc.s V_69 - IL_0680: ldloc.s V_68 - IL_0682: stloc.s V_70 - IL_0684: ldloc.s V_69 - IL_0686: ldloc.s V_70 - IL_0688: conv.r8 - IL_0689: div - IL_068a: stloc.s V_66 - IL_068c: leave.s IL_06ac + IL_066b: nop + IL_066c: ldloc.s V_63 + IL_066e: stloc.s V_65 + IL_0670: ldloc.s V_64 + IL_0672: stloc.s V_66 + IL_0674: ldloc.s V_65 + IL_0676: ldloc.s V_66 + IL_0678: conv.r8 + IL_0679: div + IL_067a: stloc.s V_62 + IL_067c: leave.s IL_069c } // end .try finally { - IL_068e: ldloc.s V_65 - IL_0690: isinst [mscorlib]System.IDisposable - IL_0695: stloc.s V_71 - IL_0697: ldloc.s V_71 - IL_0699: brfalse.s IL_069d + IL_067e: ldloc.s V_61 + IL_0680: isinst [mscorlib]System.IDisposable + IL_0685: stloc.s V_67 + IL_0687: ldloc.s V_67 + IL_0689: brfalse.s IL_068d - IL_069b: br.s IL_069f + IL_068b: br.s IL_068f - IL_069d: br.s IL_06a9 + IL_068d: br.s IL_0699 .line 100001,100001 : 0,0 '' - IL_069f: ldloc.s V_71 - IL_06a1: callvirt instance void [mscorlib]System.IDisposable::Dispose() - IL_06a6: ldnull - IL_06a7: pop - IL_06a8: endfinally + IL_068f: ldloc.s V_67 + IL_0691: callvirt instance void [mscorlib]System.IDisposable::Dispose() + IL_0696: ldnull + IL_0697: pop + IL_0698: endfinally .line 100001,100001 : 0,0 '' - IL_06a9: ldnull - IL_06aa: pop - IL_06ab: endfinally + IL_0699: ldnull + IL_069a: pop + IL_069b: endfinally .line 100001,100001 : 0,0 '' } // end handler - IL_06ac: ldloc.s V_66 - IL_06ae: dup - IL_06af: stsfld float64 ''.$Linq101Aggregates01::averageLength@103 - IL_06b4: stloc.s averageLength + IL_069c: ldloc.s V_62 + IL_069e: dup + IL_069f: stsfld float64 ''.$Linq101Aggregates01::averageLength@103 + IL_06a4: stloc.s averageLength .line 111,117 : 1,21 '' - IL_06b6: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() - IL_06bb: stloc.s V_72 - IL_06bd: ldloc.s V_72 - IL_06bf: ldloc.s V_72 - IL_06c1: ldloc.s V_72 - IL_06c3: ldloc.s V_72 - IL_06c5: ldloc.s V_72 - IL_06c7: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Linq101Aggregates01::get_products() - IL_06cc: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Source(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_06d1: ldloc.s V_72 - IL_06d3: newobj instance void Linq101Aggregates01/categories6@113::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) - IL_06d8: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_06a6: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() + IL_06ab: stloc.s V_68 + IL_06ad: ldloc.s V_68 + IL_06af: ldloc.s V_68 + IL_06b1: ldloc.s V_68 + IL_06b3: ldloc.s V_68 + IL_06b5: ldloc.s V_68 + IL_06b7: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Linq101Aggregates01::get_products() + IL_06bc: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Source(class [mscorlib]System.Collections.Generic.IEnumerable`1) + IL_06c1: ldloc.s V_68 + IL_06c3: newobj instance void Linq101Aggregates01/categories6@113::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) + IL_06c8: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_06dd: newobj instance void Linq101Aggregates01/'categories6@114-1'::.ctor() - IL_06e2: newobj instance void Linq101Aggregates01/'categories6@114-2'::.ctor() - IL_06e7: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,!!3> [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::GroupValBy(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_06cd: newobj instance void Linq101Aggregates01/'categories6@114-1'::.ctor() + IL_06d2: newobj instance void Linq101Aggregates01/'categories6@114-2'::.ctor() + IL_06d7: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,!!3> [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::GroupValBy(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_06ec: ldloc.s V_72 - IL_06ee: newobj instance void Linq101Aggregates01/'categories6@114-3'::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) - IL_06f3: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For,class [mscorlib]System.Collections.IEnumerable,class [mscorlib]System.Tuple`2,valuetype [mscorlib]System.Decimal>,object>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_06dc: ldloc.s V_68 + IL_06de: newobj instance void Linq101Aggregates01/'categories6@114-3'::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) + IL_06e3: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For,class [mscorlib]System.Collections.IEnumerable,class [mscorlib]System.Tuple`2,valuetype [mscorlib]System.Decimal>,object>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_06f8: newobj instance void Linq101Aggregates01/'categories6@116-4'::.ctor() - IL_06fd: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Select,valuetype [mscorlib]System.Decimal>,class [mscorlib]System.Collections.IEnumerable,class [mscorlib]System.Tuple`2>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_06e8: newobj instance void Linq101Aggregates01/'categories6@116-4'::.ctor() + IL_06ed: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Select,valuetype [mscorlib]System.Decimal>,class [mscorlib]System.Collections.IEnumerable,class [mscorlib]System.Tuple`2>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_0702: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerable`1 class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,class [mscorlib]System.Collections.IEnumerable>::get_Source() - IL_0707: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray>(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_070c: dup - IL_070d: stsfld class [mscorlib]System.Tuple`2[] ''.$Linq101Aggregates01::categories6@111 - IL_0712: stloc.s categories6 - IL_0714: ret + IL_06f2: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerable`1 class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,class [mscorlib]System.Collections.IEnumerable>::get_Source() + IL_06f7: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray>(class [mscorlib]System.Collections.Generic.IEnumerable`1) + IL_06fc: dup + IL_06fd: stsfld class [mscorlib]System.Tuple`2[] ''.$Linq101Aggregates01::categories6@111 + IL_0702: stloc.s categories6 + IL_0704: ret } // end of method $Linq101Aggregates01::main@ } // end of class ''.$Linq101Aggregates01 diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101ElementOperators01.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101ElementOperators01.il.bsl index 9c0fa95202..f6b3a2887c 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101ElementOperators01.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101ElementOperators01.il.bsl @@ -33,20 +33,20 @@ } .mresource public FSharpSignatureData.Linq101ElementOperators01 { - // Offset: 0x00000000 Length: 0x00000382 + // Offset: 0x00000000 Length: 0x00000368 } .mresource public FSharpOptimizationData.Linq101ElementOperators01 { - // Offset: 0x00000388 Length: 0x00000127 + // Offset: 0x00000370 Length: 0x00000127 } .module Linq101ElementOperators01.exe -// MVID: {59B19240-19D7-C20D-A745-03834092B159} +// MVID: {5A1F62A6-19D7-C20D-A745-0383A6621F5A} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x01020000 +// Image base: 0x036D0000 // =============== CLASS MEMBERS DECLARATION =================== @@ -111,7 +111,7 @@ // Code size 191 (0xbf) .maxstack 6 .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 100001,100001 : 0,0 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\QueryExpressionStepping\\Linq101ElementOperators01.fs' + .line 100001,100001 : 0,0 'C:\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\QueryExpressionStepping\\Linq101ElementOperators01.fs' IL_0000: ldarg.0 IL_0001: ldfld int32 Linq101ElementOperators01/products12@12::pc IL_0006: ldc.i4.1 @@ -1721,7 +1721,7 @@ .method public static void main@() cil managed { .entrypoint - // Code size 389 (0x185) + // Code size 385 (0x181) .maxstack 13 .locals init ([0] class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 products, [1] class [Utils]Utils/Product products12, @@ -1731,19 +1731,18 @@ [5] int32 firstNumOrDefault, [6] class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 numbers2, [7] int32 fourthLowNum, - [8] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@, + [8] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_8, [9] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_9, - [10] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_10, - [11] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_11) + [10] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_10) .line 8,8 : 1,32 '' IL_0000: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [Utils]Utils::getProductList() IL_0005: dup IL_0006: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$Linq101ElementOperators01::'products@8-2' IL_000b: stloc.0 IL_000c: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() - IL_0011: stloc.s builder@ - IL_0013: ldloc.s builder@ - IL_0015: ldloc.s builder@ + IL_0011: stloc.s V_8 + IL_0013: ldloc.s V_8 + IL_0015: ldloc.s V_8 IL_0017: ldnull IL_0018: ldnull IL_0019: ldnull @@ -1823,83 +1822,81 @@ IL_00dc: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Linq101ElementOperators01::get_numbers() IL_00e1: stloc.s numbers IL_00e3: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() - IL_00e8: stloc.s V_10 - IL_00ea: ldloc.s V_10 + IL_00e8: ldc.i4.0 + IL_00e9: ldc.i4.0 + IL_00ea: ldnull + IL_00eb: ldc.i4.0 IL_00ec: ldc.i4.0 - IL_00ed: ldc.i4.0 - IL_00ee: ldnull - IL_00ef: ldc.i4.0 - IL_00f0: ldc.i4.0 - IL_00f1: newobj instance void Linq101ElementOperators01/firstNumOrDefault@31::.ctor(int32, + IL_00ed: newobj instance void Linq101ElementOperators01/firstNumOrDefault@31::.ctor(int32, int32, class [mscorlib]System.Collections.Generic.IEnumerator`1, int32, int32) - IL_00f6: newobj instance void class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2::.ctor(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_00fb: callvirt instance !!0 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::HeadOrDefault(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2) - IL_0100: dup - IL_0101: stsfld int32 ''.$Linq101ElementOperators01::firstNumOrDefault@29 - IL_0106: stloc.s firstNumOrDefault + IL_00f2: newobj instance void class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2::.ctor(class [mscorlib]System.Collections.Generic.IEnumerable`1) + IL_00f7: callvirt instance !!0 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::HeadOrDefault(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2) + IL_00fc: dup + IL_00fd: stsfld int32 ''.$Linq101ElementOperators01::firstNumOrDefault@29 + IL_0102: stloc.s firstNumOrDefault .line 48,48 : 1,48 '' - IL_0108: ldc.i4.5 - IL_0109: ldc.i4.4 - IL_010a: ldc.i4.1 - IL_010b: ldc.i4.3 - IL_010c: ldc.i4.s 9 - IL_010e: ldc.i4.8 - IL_010f: ldc.i4.6 - IL_0110: ldc.i4.7 - IL_0111: ldc.i4.2 - IL_0112: ldc.i4.0 - IL_0113: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_0118: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_0104: ldc.i4.5 + IL_0105: ldc.i4.4 + IL_0106: ldc.i4.1 + IL_0107: ldc.i4.3 + IL_0108: ldc.i4.s 9 + IL_010a: ldc.i4.8 + IL_010b: ldc.i4.6 + IL_010c: ldc.i4.7 + IL_010d: ldc.i4.2 + IL_010e: ldc.i4.0 + IL_010f: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_0114: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_011d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_0119: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0122: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_011e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0127: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_0123: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_012c: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_0128: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0131: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_012d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0136: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_0132: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_013b: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_0137: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0140: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_013c: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0145: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_0141: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_014a: dup - IL_014b: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$Linq101ElementOperators01::'numbers2@48-2' - IL_0150: stloc.s numbers2 - IL_0152: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() - IL_0157: stloc.s V_11 - IL_0159: ldloc.s V_11 - IL_015b: ldloc.s V_11 + IL_0146: dup + IL_0147: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$Linq101ElementOperators01::'numbers2@48-2' + IL_014c: stloc.s numbers2 + IL_014e: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() + IL_0153: stloc.s V_10 + IL_0155: ldloc.s V_10 + IL_0157: ldloc.s V_10 + IL_0159: ldc.i4.0 + IL_015a: ldc.i4.0 + IL_015b: ldnull + IL_015c: ldc.i4.0 IL_015d: ldc.i4.0 - IL_015e: ldc.i4.0 - IL_015f: ldnull - IL_0160: ldc.i4.0 - IL_0161: ldc.i4.0 - IL_0162: newobj instance void Linq101ElementOperators01/fourthLowNum@52::.ctor(int32, + IL_015e: newobj instance void Linq101ElementOperators01/fourthLowNum@52::.ctor(int32, int32, class [mscorlib]System.Collections.Generic.IEnumerator`1, int32, int32) - IL_0167: newobj instance void class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2::.ctor(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_016c: newobj instance void Linq101ElementOperators01/'fourthLowNum@53-1'::.ctor() - IL_0171: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Where(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_0163: newobj instance void class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2::.ctor(class [mscorlib]System.Collections.Generic.IEnumerable`1) + IL_0168: newobj instance void Linq101ElementOperators01/'fourthLowNum@53-1'::.ctor() + IL_016d: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Where(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_0176: ldc.i4.1 - IL_0177: callvirt instance !!0 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Nth(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_0172: ldc.i4.1 + IL_0173: callvirt instance !!0 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Nth(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, int32) - IL_017c: dup - IL_017d: stsfld int32 ''.$Linq101ElementOperators01::fourthLowNum@50 - IL_0182: stloc.s fourthLowNum - IL_0184: ret + IL_0178: dup + IL_0179: stsfld int32 ''.$Linq101ElementOperators01::fourthLowNum@50 + IL_017e: stloc.s fourthLowNum + IL_0180: ret } // end of method $Linq101ElementOperators01::main@ } // end of class ''.$Linq101ElementOperators01 diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Grouping01.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Grouping01.il.bsl index 791d8d26a1..23fdb97b51 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Grouping01.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Grouping01.il.bsl @@ -38,20 +38,20 @@ } .mresource public FSharpSignatureData.Linq101Grouping01 { - // Offset: 0x00000000 Length: 0x00000407 + // Offset: 0x00000000 Length: 0x000003ED } .mresource public FSharpOptimizationData.Linq101Grouping01 { - // Offset: 0x00000410 Length: 0x00000129 + // Offset: 0x000003F8 Length: 0x00000129 } .module Linq101Grouping01.exe -// MVID: {59B19240-FB79-E5BF-A745-03834092B159} +// MVID: {5A1F62A6-FB79-E5BF-A745-0383A6621F5A} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x001E0000 +// Image base: 0x03810000 // =============== CLASS MEMBERS DECLARATION =================== @@ -64,6 +64,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -86,7 +89,7 @@ .maxstack 6 .locals init ([0] int32 n) .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 14,14 : 9,28 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\QueryExpressionStepping\\Linq101Grouping01.fs' + .line 14,14 : 9,28 'C:\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\QueryExpressionStepping\\Linq101Grouping01.fs' IL_0000: ldarg.1 IL_0001: stloc.0 .line 15,15 : 9,29 '' @@ -160,6 +163,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,object>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -230,6 +236,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -325,6 +334,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,object>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -395,6 +407,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -490,6 +505,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,object>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -560,6 +578,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -658,6 +679,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -756,6 +780,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,object>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -826,6 +853,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,class [mscorlib]System.Collections.Generic.IEnumerable`1>>,object>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -848,7 +878,7 @@ .maxstack 10 .locals init ([0] class [System.Core]System.Linq.IGrouping`2 yg, [1] class [mscorlib]System.Collections.Generic.IEnumerable`1> monthGroups, - [2] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) + [2] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_2) .line 48,48 : 54,56 '' IL_0000: ldarg.1 IL_0001: stloc.0 @@ -938,6 +968,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2[]>>>,object>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -960,7 +993,7 @@ .maxstack 10 .locals init ([0] class [Utils]Utils/Customer c, [1] class [mscorlib]System.Collections.Generic.IEnumerable`1[]>> yearGroups, - [2] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) + [2] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_2) .line 44,44 : 9,30 '' IL_0000: ldarg.1 IL_0001: stloc.0 @@ -1224,7 +1257,7 @@ [6] class [mscorlib]System.Tuple`2[] orderGroups, [7] class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 customers, [8] class [mscorlib]System.Tuple`2[]>[]>[] customerOrderGroups, - [9] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@, + [9] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_9, [10] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_10, [11] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_11, [12] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_12) @@ -1300,15 +1333,15 @@ IL_00b8: stloc.1 .line 12,17 : 1,21 '' IL_00b9: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() - IL_00be: stloc.s builder@ - IL_00c0: ldloc.s builder@ - IL_00c2: ldloc.s builder@ - IL_00c4: ldloc.s builder@ - IL_00c6: ldloc.s builder@ - IL_00c8: ldloc.s builder@ + IL_00be: stloc.s V_9 + IL_00c0: ldloc.s V_9 + IL_00c2: ldloc.s V_9 + IL_00c4: ldloc.s V_9 + IL_00c6: ldloc.s V_9 + IL_00c8: ldloc.s V_9 IL_00ca: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Linq101Grouping01::get_numbers() IL_00cf: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Source(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_00d4: ldloc.s builder@ + IL_00d4: ldloc.s V_9 IL_00d6: newobj instance void Linq101Grouping01/numberGroups@14::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) IL_00db: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) @@ -1317,7 +1350,7 @@ IL_00ea: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,!!3> [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::GroupValBy(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_00ef: ldloc.s builder@ + IL_00ef: ldloc.s V_9 IL_00f1: newobj instance void Linq101Grouping01/'numberGroups@15-3'::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) IL_00f6: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For,class [mscorlib]System.Collections.IEnumerable,class [System.Core]System.Linq.IGrouping`2,object>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Joins01.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Joins01.il.bsl index 6e3d08b989..22342da9b9 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Joins01.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Joins01.il.bsl @@ -38,20 +38,20 @@ } .mresource public FSharpSignatureData.Linq101Joins01 { - // Offset: 0x00000000 Length: 0x0000030E + // Offset: 0x00000000 Length: 0x000002F4 } .mresource public FSharpOptimizationData.Linq101Joins01 { - // Offset: 0x00000318 Length: 0x000000C3 + // Offset: 0x000002F8 Length: 0x000000C3 } .module Linq101Joins01.exe -// MVID: {59B19240-151B-685E-A745-03834092B159} +// MVID: {5A1F62A6-151B-685E-A745-0383A6621F5A} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x01760000 +// Image base: 0x03830000 // =============== CLASS MEMBERS DECLARATION =================== @@ -81,7 +81,7 @@ // Code size 2 (0x2) .maxstack 8 .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 14,14 : 32,33 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\QueryExpressionStepping\\Linq101Joins01.fs' + .line 14,14 : 32,33 'C:\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\QueryExpressionStepping\\Linq101Joins01.fs' IL_0000: ldarg.1 IL_0001: ret } // end of method q@14::Invoke @@ -152,6 +152,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,object>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -328,6 +331,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>,class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2>,object>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -503,6 +509,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [Utils]Utils/Product>,object>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .field public class [mscorlib]System.Collections.Generic.IEnumerable`1 ps .field public string c .method assembly specialname rtspecialname @@ -559,6 +568,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>,class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,class [Utils]Utils/Product>,class [mscorlib]System.Collections.IEnumerable>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -747,6 +759,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [Utils]Utils/Product,string>,object>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .field public class [mscorlib]System.Collections.Generic.IEnumerable`1 ps .field public string c .method assembly specialname rtspecialname @@ -831,6 +846,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>,class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,class [Utils]Utils/Product,string>,class [mscorlib]System.Collections.IEnumerable>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -1054,7 +1072,7 @@ [3] class [mscorlib]System.Tuple`2>[] q2, [4] class [mscorlib]System.Tuple`2[] q3, [5] class [mscorlib]System.Tuple`2[] q4, - [6] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@, + [6] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_6, [7] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_7, [8] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_8, [9] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_9) @@ -1085,14 +1103,14 @@ IL_0049: stloc.1 .line 11,16 : 1,21 '' IL_004a: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() - IL_004f: stloc.s builder@ - IL_0051: ldloc.s builder@ - IL_0053: ldloc.s builder@ - IL_0055: ldloc.s builder@ - IL_0057: ldloc.s builder@ + IL_004f: stloc.s V_6 + IL_0051: ldloc.s V_6 + IL_0053: ldloc.s V_6 + IL_0055: ldloc.s V_6 + IL_0057: ldloc.s V_6 IL_0059: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Linq101Joins01::get_categories() IL_005e: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Source(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_0063: ldloc.s builder@ + IL_0063: ldloc.s V_6 IL_0065: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Linq101Joins01::get_products() IL_006a: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Source(class [mscorlib]System.Collections.Generic.IEnumerable`1) IL_006f: newobj instance void Linq101Joins01/q@14::.ctor() @@ -1103,7 +1121,7 @@ class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_0083: ldloc.s builder@ + IL_0083: ldloc.s V_6 IL_0085: newobj instance void Linq101Joins01/'q@14-3'::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) IL_008a: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For,class [mscorlib]System.Collections.IEnumerable,class [mscorlib]System.Tuple`2,object>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Ordering01.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Ordering01.il.bsl index 93a639c276..17019e93cd 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Ordering01.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Ordering01.il.bsl @@ -33,20 +33,20 @@ } .mresource public FSharpSignatureData.Linq101Ordering01 { - // Offset: 0x00000000 Length: 0x000003B2 + // Offset: 0x00000000 Length: 0x00000398 } .mresource public FSharpOptimizationData.Linq101Ordering01 { - // Offset: 0x000003B8 Length: 0x00000134 + // Offset: 0x000003A0 Length: 0x00000134 } .module Linq101Ordering01.exe -// MVID: {59B19240-649A-6956-A745-03834092B159} +// MVID: {5A1F62A6-649A-6956-A745-0383A6621F5A} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x015E0000 +// Image base: 0x03640000 // =============== CLASS MEMBERS DECLARATION =================== @@ -111,7 +111,7 @@ // Code size 191 (0xbf) .maxstack 6 .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 100001,100001 : 0,0 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\QueryExpressionStepping\\Linq101Ordering01.fs' + .line 100001,100001 : 0,0 'C:\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\QueryExpressionStepping\\Linq101Ordering01.fs' IL_0000: ldarg.0 IL_0001: ldfld int32 Linq101Ordering01/sortedWords@11::pc IL_0006: ldc.i4.1 @@ -831,6 +831,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -1726,6 +1729,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -2019,7 +2025,7 @@ [6] class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 digits, [7] class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 sortedDigits, [8] class [Utils]Utils/Product[] sortedProducts3, - [9] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@, + [9] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_9, [10] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_10, [11] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_11, [12] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_12, @@ -2041,8 +2047,8 @@ IL_0029: stloc.0 .line 9,13 : 1,20 '' IL_002a: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() - IL_002f: stloc.s builder@ - IL_0031: ldloc.s builder@ + IL_002f: stloc.s V_9 + IL_0031: ldloc.s V_9 IL_0033: ldnull IL_0034: ldnull IL_0035: ldnull diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Partitioning01.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Partitioning01.il.bsl index c54ef80f62..c94810a403 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Partitioning01.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Partitioning01.il.bsl @@ -33,20 +33,20 @@ } .mresource public FSharpSignatureData.Linq101Partitioning01 { - // Offset: 0x00000000 Length: 0x000003D6 + // Offset: 0x00000000 Length: 0x000003BC } .mresource public FSharpOptimizationData.Linq101Partitioning01 { - // Offset: 0x000003E0 Length: 0x00000138 + // Offset: 0x000003C0 Length: 0x00000138 } .module Linq101Partitioning01.exe -// MVID: {59B19240-B280-A6A2-A745-03834092B159} +// MVID: {5A1F62A6-B280-A6A2-A745-0383A6621F5A} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x010A0000 +// Image base: 0x006A0000 // =============== CLASS MEMBERS DECLARATION =================== @@ -111,7 +111,7 @@ // Code size 191 (0xbf) .maxstack 6 .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 100001,100001 : 0,0 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\QueryExpressionStepping\\Linq101Partitioning01.fs' + .line 100001,100001 : 0,0 'C:\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\QueryExpressionStepping\\Linq101Partitioning01.fs' IL_0000: ldarg.0 IL_0001: ldfld int32 Linq101Partitioning01/first3Numbers@12::pc IL_0006: ldc.i4.1 @@ -418,6 +418,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,object>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .field public class [Utils]Utils/Customer c .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@, @@ -466,6 +469,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [mscorlib]System.Collections.IEnumerable>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -957,6 +963,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,object>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .field public class [Utils]Utils/Customer c .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@, @@ -1005,6 +1014,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [mscorlib]System.Collections.IEnumerable>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -2070,7 +2082,7 @@ [5] class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> WAOrders2, [6] class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 firstNumbersLessThan6, [7] class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 allButFirst3Numbers, - [8] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@, + [8] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_8, [9] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_9, [10] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_10, [11] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_11, @@ -2113,8 +2125,8 @@ IL_0048: stloc.0 .line 10,14 : 1,20 '' IL_0049: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() - IL_004e: stloc.s builder@ - IL_0050: ldloc.s builder@ + IL_004e: stloc.s V_8 + IL_0050: ldloc.s V_8 IL_0052: ldc.i4.0 IL_0053: ldc.i4.0 IL_0054: ldnull diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Quantifiers01.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Quantifiers01.il.bsl index 2627c41935..087bbda253 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Quantifiers01.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Quantifiers01.il.bsl @@ -38,20 +38,20 @@ } .mresource public FSharpSignatureData.Linq101Quantifiers01 { - // Offset: 0x00000000 Length: 0x00000397 + // Offset: 0x00000000 Length: 0x0000037D } .mresource public FSharpOptimizationData.Linq101Quantifiers01 { - // Offset: 0x000003A0 Length: 0x000000FF + // Offset: 0x00000388 Length: 0x000000FF } .module Linq101Quantifiers01.exe -// MVID: {59B19240-76DD-E373-A745-03834092B159} +// MVID: {5A1F62A6-76DD-E373-A745-0383A6621F5A} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x01260000 +// Image base: 0x01080000 // =============== CLASS MEMBERS DECLARATION =================== @@ -116,7 +116,7 @@ // Code size 191 (0xbf) .maxstack 6 .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 100001,100001 : 0,0 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\QueryExpressionStepping\\Linq101Quantifiers01.fs' + .line 100001,100001 : 0,0 'C:\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\QueryExpressionStepping\\Linq101Quantifiers01.fs' IL_0000: ldarg.0 IL_0001: ldfld int32 Linq101Quantifiers01/iAfterE@12::pc IL_0006: ldc.i4.1 @@ -452,6 +452,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -547,6 +550,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,object>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -1067,6 +1073,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -1162,6 +1171,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,object>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -1418,7 +1430,7 @@ .method public static void main@() cil managed { .entrypoint - // Code size 419 (0x1a3) + // Code size 411 (0x19b) .maxstack 10 .locals init ([0] class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 words, [1] bool iAfterE, @@ -1427,10 +1439,8 @@ [4] class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 numbers, [5] bool onlyOdd, [6] class [mscorlib]System.Tuple`2>[] productGroups2, - [7] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@, - [8] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_8, - [9] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_9, - [10] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_10) + [7] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_7, + [8] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_8) .line 8,8 : 1,54 '' IL_0000: ldstr "believe" IL_0005: ldstr "relief" @@ -1449,147 +1459,143 @@ IL_002e: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$Linq101Quantifiers01::'words@8-6' IL_0033: stloc.0 IL_0034: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() - IL_0039: stloc.s builder@ - IL_003b: ldloc.s builder@ + IL_0039: ldnull + IL_003a: ldnull + IL_003b: ldnull + IL_003c: ldc.i4.0 IL_003d: ldnull - IL_003e: ldnull - IL_003f: ldnull - IL_0040: ldc.i4.0 - IL_0041: ldnull - IL_0042: newobj instance void Linq101Quantifiers01/iAfterE@12::.ctor(string, + IL_003e: newobj instance void Linq101Quantifiers01/iAfterE@12::.ctor(string, string, class [mscorlib]System.Collections.Generic.IEnumerator`1, int32, string) - IL_0047: newobj instance void class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2::.ctor(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_004c: newobj instance void Linq101Quantifiers01/'iAfterE@13-1'::.ctor() - IL_0051: callvirt instance bool [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Exists(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_0043: newobj instance void class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2::.ctor(class [mscorlib]System.Collections.Generic.IEnumerable`1) + IL_0048: newobj instance void Linq101Quantifiers01/'iAfterE@13-1'::.ctor() + IL_004d: callvirt instance bool [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Exists(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_0056: dup - IL_0057: stsfld bool ''.$Linq101Quantifiers01::iAfterE@10 - IL_005c: stloc.1 + IL_0052: dup + IL_0053: stsfld bool ''.$Linq101Quantifiers01::iAfterE@10 + IL_0058: stloc.1 .line 17,17 : 1,32 '' - IL_005d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [Utils]Utils::getProductList() - IL_0062: dup - IL_0063: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$Linq101Quantifiers01::'products@17-10' - IL_0068: stloc.2 + IL_0059: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [Utils]Utils::getProductList() + IL_005e: dup + IL_005f: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$Linq101Quantifiers01::'products@17-10' + IL_0064: stloc.2 .line 19,25 : 1,21 '' - IL_0069: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() - IL_006e: stloc.s V_8 - IL_0070: ldloc.s V_8 - IL_0072: ldloc.s V_8 - IL_0074: ldloc.s V_8 - IL_0076: ldloc.s V_8 - IL_0078: ldloc.s V_8 - IL_007a: ldloc.s V_8 - IL_007c: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Linq101Quantifiers01::get_products() - IL_0081: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Source(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_0086: ldloc.s V_8 - IL_0088: newobj instance void Linq101Quantifiers01/productGroups@21::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) - IL_008d: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_0065: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() + IL_006a: stloc.s V_7 + IL_006c: ldloc.s V_7 + IL_006e: ldloc.s V_7 + IL_0070: ldloc.s V_7 + IL_0072: ldloc.s V_7 + IL_0074: ldloc.s V_7 + IL_0076: ldloc.s V_7 + IL_0078: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Linq101Quantifiers01::get_products() + IL_007d: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Source(class [mscorlib]System.Collections.Generic.IEnumerable`1) + IL_0082: ldloc.s V_7 + IL_0084: newobj instance void Linq101Quantifiers01/productGroups@21::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) + IL_0089: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_0092: newobj instance void Linq101Quantifiers01/'productGroups@22-1'::.ctor() - IL_0097: newobj instance void Linq101Quantifiers01/'productGroups@22-2'::.ctor() - IL_009c: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,!!3> [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::GroupValBy(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_008e: newobj instance void Linq101Quantifiers01/'productGroups@22-1'::.ctor() + IL_0093: newobj instance void Linq101Quantifiers01/'productGroups@22-2'::.ctor() + IL_0098: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,!!3> [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::GroupValBy(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_00a1: ldloc.s V_8 - IL_00a3: newobj instance void Linq101Quantifiers01/'productGroups@22-3'::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) - IL_00a8: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For,class [mscorlib]System.Collections.IEnumerable,class [System.Core]System.Linq.IGrouping`2,object>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_009d: ldloc.s V_7 + IL_009f: newobj instance void Linq101Quantifiers01/'productGroups@22-3'::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) + IL_00a4: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For,class [mscorlib]System.Collections.IEnumerable,class [System.Core]System.Linq.IGrouping`2,object>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_00ad: newobj instance void Linq101Quantifiers01/'productGroups@23-4'::.ctor() - IL_00b2: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Where,class [mscorlib]System.Collections.IEnumerable>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_00a9: newobj instance void Linq101Quantifiers01/'productGroups@23-4'::.ctor() + IL_00ae: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Where,class [mscorlib]System.Collections.IEnumerable>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_00b7: newobj instance void Linq101Quantifiers01/'productGroups@24-6'::.ctor() - IL_00bc: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Select,class [mscorlib]System.Collections.IEnumerable,class [mscorlib]System.Tuple`2>>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_00b3: newobj instance void Linq101Quantifiers01/'productGroups@24-6'::.ctor() + IL_00b8: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Select,class [mscorlib]System.Collections.IEnumerable,class [mscorlib]System.Tuple`2>>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_00c1: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerable`1 class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2>,class [mscorlib]System.Collections.IEnumerable>::get_Source() - IL_00c6: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray>>(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_00cb: dup - IL_00cc: stsfld class [mscorlib]System.Tuple`2>[] ''.$Linq101Quantifiers01::productGroups@19 - IL_00d1: stloc.3 + IL_00bd: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerable`1 class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2>,class [mscorlib]System.Collections.IEnumerable>::get_Source() + IL_00c2: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray>>(class [mscorlib]System.Collections.Generic.IEnumerable`1) + IL_00c7: dup + IL_00c8: stsfld class [mscorlib]System.Tuple`2>[] ''.$Linq101Quantifiers01::productGroups@19 + IL_00cd: stloc.3 .line 28,28 : 1,35 '' - IL_00d2: ldc.i4.1 - IL_00d3: ldc.i4.s 11 - IL_00d5: ldc.i4.3 - IL_00d6: ldc.i4.s 19 - IL_00d8: ldc.i4.s 41 - IL_00da: ldc.i4.s 65 - IL_00dc: ldc.i4.s 19 - IL_00de: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_00e3: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_00ce: ldc.i4.1 + IL_00cf: ldc.i4.s 11 + IL_00d1: ldc.i4.3 + IL_00d2: ldc.i4.s 19 + IL_00d4: ldc.i4.s 41 + IL_00d6: ldc.i4.s 65 + IL_00d8: ldc.i4.s 19 + IL_00da: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_00df: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00e8: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_00e4: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00ed: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_00e9: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00f2: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_00ee: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00f7: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_00f3: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00fc: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_00f8: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0101: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_00fd: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0106: dup - IL_0107: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$Linq101Quantifiers01::'numbers@28-7' - IL_010c: stloc.s numbers - IL_010e: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() - IL_0113: stloc.s V_9 - IL_0115: ldloc.s V_9 - IL_0117: ldc.i4.0 - IL_0118: ldc.i4.0 - IL_0119: ldnull - IL_011a: ldc.i4.0 - IL_011b: ldc.i4.0 - IL_011c: newobj instance void Linq101Quantifiers01/onlyOdd@32::.ctor(int32, + IL_0102: dup + IL_0103: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 ''.$Linq101Quantifiers01::'numbers@28-7' + IL_0108: stloc.s numbers + IL_010a: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() + IL_010f: ldc.i4.0 + IL_0110: ldc.i4.0 + IL_0111: ldnull + IL_0112: ldc.i4.0 + IL_0113: ldc.i4.0 + IL_0114: newobj instance void Linq101Quantifiers01/onlyOdd@32::.ctor(int32, int32, class [mscorlib]System.Collections.Generic.IEnumerator`1, int32, int32) - IL_0121: newobj instance void class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2::.ctor(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_0126: newobj instance void Linq101Quantifiers01/'onlyOdd@33-1'::.ctor() - IL_012b: callvirt instance bool [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::All(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_0119: newobj instance void class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2::.ctor(class [mscorlib]System.Collections.Generic.IEnumerable`1) + IL_011e: newobj instance void Linq101Quantifiers01/'onlyOdd@33-1'::.ctor() + IL_0123: callvirt instance bool [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::All(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_0130: dup - IL_0131: stsfld bool ''.$Linq101Quantifiers01::onlyOdd@30 - IL_0136: stloc.s onlyOdd + IL_0128: dup + IL_0129: stsfld bool ''.$Linq101Quantifiers01::onlyOdd@30 + IL_012e: stloc.s onlyOdd .line 37,43 : 1,21 '' - IL_0138: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() - IL_013d: stloc.s V_10 - IL_013f: ldloc.s V_10 - IL_0141: ldloc.s V_10 - IL_0143: ldloc.s V_10 - IL_0145: ldloc.s V_10 - IL_0147: ldloc.s V_10 - IL_0149: ldloc.s V_10 - IL_014b: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Linq101Quantifiers01::get_products() - IL_0150: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Source(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_0155: ldloc.s V_10 - IL_0157: newobj instance void Linq101Quantifiers01/productGroups2@39::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) - IL_015c: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_0130: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() + IL_0135: stloc.s V_8 + IL_0137: ldloc.s V_8 + IL_0139: ldloc.s V_8 + IL_013b: ldloc.s V_8 + IL_013d: ldloc.s V_8 + IL_013f: ldloc.s V_8 + IL_0141: ldloc.s V_8 + IL_0143: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Linq101Quantifiers01::get_products() + IL_0148: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Source(class [mscorlib]System.Collections.Generic.IEnumerable`1) + IL_014d: ldloc.s V_8 + IL_014f: newobj instance void Linq101Quantifiers01/productGroups2@39::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) + IL_0154: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_0161: newobj instance void Linq101Quantifiers01/'productGroups2@40-1'::.ctor() - IL_0166: newobj instance void Linq101Quantifiers01/'productGroups2@40-2'::.ctor() - IL_016b: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,!!3> [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::GroupValBy(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_0159: newobj instance void Linq101Quantifiers01/'productGroups2@40-1'::.ctor() + IL_015e: newobj instance void Linq101Quantifiers01/'productGroups2@40-2'::.ctor() + IL_0163: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2,!!3> [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::GroupValBy(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_0170: ldloc.s V_10 - IL_0172: newobj instance void Linq101Quantifiers01/'productGroups2@40-3'::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) - IL_0177: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For,class [mscorlib]System.Collections.IEnumerable,class [System.Core]System.Linq.IGrouping`2,object>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_0168: ldloc.s V_8 + IL_016a: newobj instance void Linq101Quantifiers01/'productGroups2@40-3'::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) + IL_016f: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For,class [mscorlib]System.Collections.IEnumerable,class [System.Core]System.Linq.IGrouping`2,object>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_017c: newobj instance void Linq101Quantifiers01/'productGroups2@41-4'::.ctor() - IL_0181: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Where,class [mscorlib]System.Collections.IEnumerable>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_0174: newobj instance void Linq101Quantifiers01/'productGroups2@41-4'::.ctor() + IL_0179: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Where,class [mscorlib]System.Collections.IEnumerable>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_0186: newobj instance void Linq101Quantifiers01/'productGroups2@42-6'::.ctor() - IL_018b: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Select,class [mscorlib]System.Collections.IEnumerable,class [mscorlib]System.Tuple`2>>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, + IL_017e: newobj instance void Linq101Quantifiers01/'productGroups2@42-6'::.ctor() + IL_0183: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Select,class [mscorlib]System.Collections.IEnumerable,class [mscorlib]System.Tuple`2>>(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2) - IL_0190: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerable`1 class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2>,class [mscorlib]System.Collections.IEnumerable>::get_Source() - IL_0195: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray>>(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_019a: dup - IL_019b: stsfld class [mscorlib]System.Tuple`2>[] ''.$Linq101Quantifiers01::productGroups2@37 - IL_01a0: stloc.s productGroups2 - IL_01a2: ret + IL_0188: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerable`1 class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2>,class [mscorlib]System.Collections.IEnumerable>::get_Source() + IL_018d: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray>>(class [mscorlib]System.Collections.Generic.IEnumerable`1) + IL_0192: dup + IL_0193: stsfld class [mscorlib]System.Tuple`2>[] ''.$Linq101Quantifiers01::productGroups2@37 + IL_0198: stloc.s productGroups2 + IL_019a: ret } // end of method $Linq101Quantifiers01::main@ } // end of class ''.$Linq101Quantifiers01 diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Select01.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Select01.il.bsl index 27824a8dae..40268338b8 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Select01.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Select01.il.bsl @@ -33,20 +33,20 @@ } .mresource public FSharpSignatureData.Linq101Select01 { - // Offset: 0x00000000 Length: 0x0000065B + // Offset: 0x00000000 Length: 0x00000641 } .mresource public FSharpOptimizationData.Linq101Select01 { - // Offset: 0x00000660 Length: 0x00000204 + // Offset: 0x00000648 Length: 0x00000204 } .module Linq101Select01.exe -// MVID: {59B19240-6057-8F80-A745-03834092B159} +// MVID: {5A1F62A6-6057-8F80-A745-0383A6621F5A} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x01780000 +// Image base: 0x00F30000 // =============== CLASS MEMBERS DECLARATION =================== @@ -77,7 +77,7 @@ .maxstack 5 .locals init ([0] int32 n) .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 12,12 : 9,28 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\QueryExpressionStepping\\Linq101Select01.fs' + .line 12,12 : 9,28 'C:\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\QueryExpressionStepping\\Linq101Select01.fs' IL_0000: ldarg.1 IL_0001: stloc.0 .line 13,13 : 9,23 '' @@ -2347,6 +2347,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -2445,6 +2448,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,object>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .field public int32 a .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@, @@ -2493,6 +2499,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [mscorlib]System.Collections.IEnumerable>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -2618,6 +2627,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,object>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .field public class [Utils]Utils/Customer c .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@, @@ -2666,6 +2678,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [mscorlib]System.Collections.IEnumerable>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -2808,6 +2823,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,object>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .field public class [Utils]Utils/Customer c .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@, @@ -2856,6 +2874,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [mscorlib]System.Collections.IEnumerable>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -2995,6 +3016,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,object>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .field public class [Utils]Utils/Customer c .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@, @@ -3043,6 +3067,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [mscorlib]System.Collections.IEnumerable>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -3185,6 +3212,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -3255,6 +3285,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,object>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .field public class [Utils]Utils/Customer c .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@, @@ -3303,6 +3336,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [mscorlib]System.Collections.IEnumerable>> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -3821,7 +3857,7 @@ [18] class [mscorlib]System.Collections.Generic.IEnumerable`1> orders3, [19] valuetype [mscorlib]System.DateTime cutOffDate, [20] class [mscorlib]System.Collections.Generic.IEnumerable`1> orders4, - [21] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@, + [21] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_21, [22] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_22, [23] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_23, [24] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_24, @@ -3872,7 +3908,7 @@ IL_0048: stloc.0 .line 10,14 : 1,20 '' IL_0049: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() - IL_004e: stloc.s builder@ + IL_004e: stloc.s V_21 IL_0050: ldc.i4.0 IL_0051: ldnull IL_0052: ldc.i4.0 diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101SetOperators01.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101SetOperators01.il.bsl index 3ad14c878e..4f0446cfc6 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101SetOperators01.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101SetOperators01.il.bsl @@ -33,20 +33,20 @@ } .mresource public FSharpSignatureData.Linq101SetOperators01 { - // Offset: 0x00000000 Length: 0x00000390 + // Offset: 0x00000000 Length: 0x00000376 } .mresource public FSharpOptimizationData.Linq101SetOperators01 { - // Offset: 0x00000398 Length: 0x0000011E + // Offset: 0x00000380 Length: 0x0000011E } .module Linq101SetOperators01.exe -// MVID: {59B19240-4EE5-349F-A745-03834092B159} +// MVID: {5A1F62A6-4EE5-349F-A745-0383A6621F5A} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x02C00000 +// Image base: 0x00DB0000 // =============== CLASS MEMBERS DECLARATION =================== @@ -111,7 +111,7 @@ // Code size 191 (0xbf) .maxstack 6 .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 100001,100001 : 0,0 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\QueryExpressionStepping\\Linq101SetOperators01.fs' + .line 100001,100001 : 0,0 'C:\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\QueryExpressionStepping\\Linq101SetOperators01.fs' IL_0000: ldarg.0 IL_0001: ldfld int32 Linq101SetOperators01/'uniqueFactors@13-1'::pc IL_0006: ldc.i4.1 @@ -1689,7 +1689,7 @@ [4] class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 customers, [5] class [mscorlib]System.Collections.Generic.IEnumerable`1 productFirstChars, [6] class [mscorlib]System.Collections.Generic.IEnumerable`1 customerFirstChars, - [7] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@, + [7] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_7, [8] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_8, [9] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_9, [10] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_10) @@ -1715,8 +1715,8 @@ IL_0029: stloc.0 .line 11,15 : 1,20 '' IL_002a: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() - IL_002f: stloc.s builder@ - IL_0031: ldloc.s builder@ + IL_002f: stloc.s V_7 + IL_0031: ldloc.s V_7 IL_0033: ldc.i4.0 IL_0034: ldc.i4.0 IL_0035: ldnull diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Where01.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Where01.il.bsl index 0601dbe41b..b1bc5d04fb 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Where01.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/QueryExpressionStepping/Linq101Where01.il.bsl @@ -33,20 +33,20 @@ } .mresource public FSharpSignatureData.Linq101Where01 { - // Offset: 0x00000000 Length: 0x000003CE + // Offset: 0x00000000 Length: 0x000003B4 } .mresource public FSharpOptimizationData.Linq101Where01 { - // Offset: 0x000003D8 Length: 0x0000012E + // Offset: 0x000003B8 Length: 0x0000012E } .module Linq101Where01.exe -// MVID: {59B19240-FF23-CD21-A745-03834092B159} +// MVID: {5A1F62A6-FF23-CD21-A745-0383A6621F5A} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x028F0000 +// Image base: 0x00B60000 // =============== CLASS MEMBERS DECLARATION =================== @@ -59,6 +59,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -81,7 +84,7 @@ .maxstack 6 .locals init ([0] int32 n) .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 14,14 : 9,28 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\QueryExpressionStepping\\Linq101Where01.fs' + .line 14,14 : 9,28 'C:\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\QueryExpressionStepping\\Linq101Where01.fs' IL_0000: ldarg.1 IL_0001: stloc.0 .line 15,15 : 9,22 '' @@ -155,6 +158,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -251,6 +257,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -371,6 +380,9 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2> { .field public class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) .method assembly specialname rtspecialname instance void .ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@) cil managed { @@ -1088,7 +1100,7 @@ [6] class [Utils]Utils/Customer[] waCustomers, [7] class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 digits, [8] class [mscorlib]System.Collections.Generic.IEnumerable`1 shortDigits, - [9] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder builder@, + [9] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_9, [10] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_10, [11] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_11, [12] class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder V_12, @@ -1130,14 +1142,14 @@ IL_0048: stloc.0 .line 12,17 : 1,20 '' IL_0049: call class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_query() - IL_004e: stloc.s builder@ - IL_0050: ldloc.s builder@ - IL_0052: ldloc.s builder@ - IL_0054: ldloc.s builder@ - IL_0056: ldloc.s builder@ + IL_004e: stloc.s V_9 + IL_0050: ldloc.s V_9 + IL_0052: ldloc.s V_9 + IL_0054: ldloc.s V_9 + IL_0056: ldloc.s V_9 IL_0058: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 Linq101Where01::get_numbers() IL_005d: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::Source(class [mscorlib]System.Collections.Generic.IEnumerable`1) - IL_0062: ldloc.s builder@ + IL_0062: ldloc.s V_9 IL_0064: newobj instance void Linq101Where01/'lowNums@14-3'::.ctor(class [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder) IL_0069: callvirt instance class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2 [FSharp.Core]Microsoft.FSharp.Linq.QueryBuilder::For(class [FSharp.Core]Microsoft.FSharp.Linq.QuerySource`2, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) diff --git a/tests/service/ProjectAnalysisTests.fs b/tests/service/ProjectAnalysisTests.fs index c1283e1527..d1000d6b84 100644 --- a/tests/service/ProjectAnalysisTests.fs +++ b/tests/service/ProjectAnalysisTests.fs @@ -3445,12 +3445,7 @@ let ``Test Project24 all symbols`` () = ["member"; "getter"]); ("StaticAutoPropGetSet", "file1", ((31, 22), (31, 42)), ["defn"], ["member"; "getter"]); - ("( AutoPropGet@ )", "file1", ((27, 29), (27, 30)), ["defn"], []); - ("( AutoPropGetSet@ )", "file1", ((28, 32), (28, 33)), ["defn"], - ["mutable"]); - ("( StaticAutoPropGet@ )", "file1", ((30, 42), (30, 43)), ["defn"], []); - ("( StaticAutoPropGetSet@ )", "file1", ((31, 45), (31, 46)), ["defn"], - ["mutable"]); ("x", "file1", ((5, 11), (5, 12)), ["defn"], []); + ("x", "file1", ((5, 11), (5, 12)), ["defn"], []); ("int", "file1", ((7, 20), (7, 23)), ["type"], ["abbrev"]); ("v", "file1", ((7, 17), (7, 18)), ["defn"], []); ("x", "file1", ((9, 11), (9, 12)), ["defn"], []); @@ -3465,12 +3460,12 @@ let ``Test Project24 all symbols`` () = ("v", "file1", ((22, 17), (22, 18)), ["defn"], []); ("int", "file1", ((25, 21), (25, 24)), ["type"], ["abbrev"]); ("v", "file1", ((25, 18), (25, 19)), ["defn"], []); - ("( AutoPropGet@ )", "file1", ((27, 15), (27, 26)), [], []); - ("( AutoPropGetSet@ )", "file1", ((28, 15), (28, 29)), [], ["mutable"]); + ("( AutoPropGet@ )", "file1", ((27, 15), (27, 26)), [], ["compgen"]); + ("( AutoPropGetSet@ )", "file1", ((28, 15), (28, 29)), [], ["compgen";"mutable"]); ("v", "file1", ((28, 15), (28, 29)), ["defn"], []); - ("( StaticAutoPropGet@ )", "file1", ((30, 22), (30, 39)), [], []); + ("( StaticAutoPropGet@ )", "file1", ((30, 22), (30, 39)), [], ["compgen"]); ("( StaticAutoPropGetSet@ )", "file1", ((31, 22), (31, 42)), [], - ["mutable"]); ("v", "file1", ((31, 22), (31, 42)), ["defn"], []); + ["compgen";"mutable"]); ("v", "file1", ((31, 22), (31, 42)), ["defn"], []); ("( .cctor )", "file1", ((4, 5), (4, 23)), ["defn"], ["member"]); ("TypeWithProperties", "file1", ((33, 9), (33, 27)), [], ["member"; "ctor"]); @@ -3551,10 +3546,6 @@ let ``Test symbol uses of properties with both getters and setters`` () = ("StaticAutoPropGet", "file1", ((30, 22), (30, 39)), ["member"; "getter"]); ("StaticAutoPropGetSet", "file1", ((31, 22), (31, 42)), ["member"; "getter"]); - ("( AutoPropGet@ )", "file1", ((27, 29), (27, 30)), []); - ("( AutoPropGetSet@ )", "file1", ((28, 32), (28, 33)), ["mutable"]); - ("( StaticAutoPropGet@ )", "file1", ((30, 42), (30, 43)), []); - ("( StaticAutoPropGetSet@ )", "file1", ((31, 45), (31, 46)), ["mutable"]); ("x", "file1", ((5, 11), (5, 12)), []); ("int", "file1", ((7, 20), (7, 23)), ["abbrev"]); ("v", "file1", ((7, 17), (7, 18)), []); @@ -3570,11 +3561,11 @@ let ``Test symbol uses of properties with both getters and setters`` () = ("v", "file1", ((22, 17), (22, 18)), []); ("int", "file1", ((25, 21), (25, 24)), ["abbrev"]); ("v", "file1", ((25, 18), (25, 19)), []); - ("( AutoPropGet@ )", "file1", ((27, 15), (27, 26)), []); - ("( AutoPropGetSet@ )", "file1", ((28, 15), (28, 29)), ["mutable"]); + ("( AutoPropGet@ )", "file1", ((27, 15), (27, 26)), ["compgen"]); + ("( AutoPropGetSet@ )", "file1", ((28, 15), (28, 29)), ["compgen";"mutable"]); ("v", "file1", ((28, 15), (28, 29)), []); - ("( StaticAutoPropGet@ )", "file1", ((30, 22), (30, 39)), []); - ("( StaticAutoPropGetSet@ )", "file1", ((31, 22), (31, 42)), ["mutable"]); + ("( StaticAutoPropGet@ )", "file1", ((30, 22), (30, 39)), ["compgen"]); + ("( StaticAutoPropGetSet@ )", "file1", ((31, 22), (31, 42)), ["compgen";"mutable"]); ("v", "file1", ((31, 22), (31, 42)), []); ("( .cctor )", "file1", ((4, 5), (4, 23)), ["member"]); ("TypeWithProperties", "file1", ((33, 9), (33, 27)), ["member"; "ctor"]); diff --git a/vsintegration/tests/unittests/CompletionProviderTests.fs b/vsintegration/tests/unittests/CompletionProviderTests.fs index 1fdd57d90f..8799801cb3 100644 --- a/vsintegration/tests/unittests/CompletionProviderTests.fs +++ b/vsintegration/tests/unittests/CompletionProviderTests.fs @@ -295,7 +295,7 @@ x. "ToArray"; "ToString"; "TrimExcess"; "TrueForAll"] VerifyCompletionListExactly(fileContents, "x.", expected) -[] +[] let ``Constructing a new class with object initializer syntax``() = let fileContents = """ type A() = @@ -303,14 +303,14 @@ type A() = member val AnotherSettableProperty = 1 with get, set member val NonSettableProperty = 1 -let _ = new A(Setta +let _ = new A(Setta) """ let expected = ["SettableProperty"; "AnotherSettableProperty"] let notExpected = ["NonSettableProperty"] VerifyCompletionList(fileContents, "(Setta", expected, notExpected) -[] +[] let ``Constructing a new class with object initializer syntax and verifying 'at' character doesn't exist.``() = let fileContents = """ type A() = @@ -318,7 +318,7 @@ type A() = member val AnotherSettableProperty = 1 with get, set member val NonSettableProperty = 1 -let _ = new A(Setta +let _ = new A(Setta) """ let expected = [] @@ -326,7 +326,7 @@ let _ = new A(Setta VerifyCompletionList(fileContents, "(Setta", expected, notExpected) [] -let ``Constructing a new fully qualified class with object initializer syntax``() = +let ``Constructing a new fully qualified class with object initializer syntax without ending paren``() = let fileContents = """ module M = type A() = @@ -476,6 +476,18 @@ let _ = fun (p:i) -> () """ VerifyCompletionList(fileContents, "let _ = fun (p:i", ["int"], []) +[] +let ``Extensions.Bug5162``() = + let fileContents = """ +module Extensions = + type System.Object with + member x.P = 1 +module M2 = + let x = 1 + Ext +""" + VerifyCompletionList(fileContents, " Ext", ["Extensions"; "ExtraTopLevelOperators"], []) + #if EXE ShouldDisplaySystemNamespace() #endif diff --git a/vsintegration/tests/unittests/Tests.LanguageService.Completion.fs b/vsintegration/tests/unittests/Tests.LanguageService.Completion.fs index 6550016be4..ed9b6160a7 100644 --- a/vsintegration/tests/unittests/Tests.LanguageService.Completion.fs +++ b/vsintegration/tests/unittests/Tests.LanguageService.Completion.fs @@ -3996,18 +3996,6 @@ let x = query { for bbbb in abbbbc(*D0*) do " if x" ] "if x" // move to marker ["xyz"] [] // should contain 'xyz' - - [] - member public this.``Extensions.Bug5162``() = - AssertCtrlSpaceCompleteContains - [ "module Extensions =" - " type System.Object with" - " member x.P = 1" - "module M2 =" - " let x = 1" - " (*loc*)Ext" ] - "(*loc*)Ext" // marker - [ "Extensions" ] [] // should contain (* Tests for various uses of ObsoleteAttribute ----------------------------------------- *) (* Members marked with obsolete shouldn't be visible, but we should support *) From a0414e7203bce6d42fcdbab2606f55e40603d978 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Thu, 7 Dec 2017 10:42:32 -0800 Subject: [PATCH 003/147] Update Version Numbers (#4064) * Rev version numbers to 4.4.3.0 * updates * Fix fcs builds --- ...FSharp.Compiler.Service.MSBuild.v12.fsproj | 2 +- ...arp.Compiler.Service.ProjectCracker.fsproj | 2 +- ...Compiler.Service.ProjectCrackerTool.fsproj | 2 +- .../FSharp.Compiler.Service.fsproj | 2 +- .../EditorService/EditorService.fsproj | 2 +- packages.config | 2 +- setup/FSharp.SDK/Common.Wix.Properties.wxs | 11 +- setup/FSharp.SDK/FSharp.SDK.wxs | 2 +- .../component-groups/Compiler_LangPack.wxs | 2 +- .../component-groups/Compiler_Redist.wxs | 18 +- .../component-groups/Runtime_LangPack.wxs | 246 +++++++++--------- .../component-groups/Runtime_Redist.wxs | 29 ++- setup/FSharp.Setup.props | 6 +- .../FSharp.Wix.Extensions.csproj | 2 +- .../Swix/Microsoft.FSharp.SDK.Core/Files.swr | 2 +- .../Microsoft.FSharp.SDK.Resources/Empty.swr | 2 +- .../Microsoft.FSharp.SDK.Resources/Files.swr | 2 +- .../Microsoft.FSharp.NetSdk.Shim.props | 2 +- .../Microsoft.FSharp.NetSdk.Shim.targets | 2 +- setup/resources/Microsoft.FSharp.Shim.targets | 2 +- .../Microsoft.Portable.FSharp.Shim.targets | 2 +- src/FSharpSource.Settings.targets | 11 +- src/FSharpSource.targets | 5 +- ....nuspec => FSharp.Core.LatestNuget.nuspec} | 6 +- .../FSharp.Core.nuget/FSharp.Core.nuget.proj | 20 +- ... => Microsoft.Portable.FSharp.Core.nuspec} | 18 +- src/fsharp/FSharp.Core/FSharp.Core.fsproj | 2 +- src/utils/CompilerLocationUtils.fs | 2 +- ...mple_VS2012_FSharp_ConsoleApp_net40.fsproj | 2 +- ...rp_ConsoleApp_net40_upgraded_VS2013.fsproj | 2 +- ...mple_VS2012_FSharp_Portable_Library.fsproj | 2 +- ...harp_Portable_Library_upgraded_2013.fsproj | 2 +- ...Sharp_Portable_Library_Legacy_net40.fsproj | 2 +- ...Sharp_Portable_Library_Legacy_net45.fsproj | 2 +- ...harp_Portable_Library_Legacy_net451.fsproj | 2 +- ...S2013_FSharp_Portable_Library_net45.fsproj | 2 +- ...2013_FSharp_Portable_Library_net451.fsproj | 2 +- ...2013_FSharp_Portable_Library_net451.fsproj | 2 +- ...2013_FSharp_Portable_Library_net451.fsproj | 2 +- ...e_VS2015_FSharp_Portable259_Library.fsproj | 2 +- ...le_VS2015_FSharp_Portable47_Library.fsproj | 2 +- ...le_VS2015_FSharp_Portable78_Library.fsproj | 2 +- ...ple_VS2015_FSharp_Portable7_Library.fsproj | 2 +- .../data/DifferingOutputDir/Dir1/Test1.fsproj | 2 +- .../data/DifferingOutputDir/Dir2/Test2.fsproj | 2 +- tests/service/data/FsAndFsiFiles.fsproj | 6 +- .../ConsoleApplication1.fsproj | 2 +- .../ConsoleApplication2.fsproj | 2 +- tests/service/data/Space in name.fsproj | 2 +- tests/service/data/Test1.fsproj | 2 +- tests/service/data/Test2.fsproj | 2 +- tests/service/data/Test3.fsproj | 2 +- .../data/TestProject/TestProject.fsproj | 2 +- tests/service/data/TestTP/TestTP.fsproj | 2 +- .../TypeProviderConsole.fsproj | 2 +- .../TypeProviderLibrary.fsproj | 2 +- .../TestConsole/TestConsole.fsproj | 2 +- .../TypeProvidersBug/TypeProvidersBug.fsproj | 2 +- .../sqlite-net-spike/sqlite-net-spike.fsproj | 2 +- .../Template/ConsoleApplication.fsproj | 2 +- .../LibraryProject/Template/Library.fsproj | 2 +- .../TutorialProject/Template/Tutorial.fsproj | 2 +- .../LanguageServiceProfiling.fsproj | 2 +- .../Vsix/RegisterFsharpPackage.pkgdef | 14 +- .../VisualFSharpFull/VisualFSharpFull.csproj | 2 +- .../VisualFSharpOpenSource.csproj | 2 +- .../VisualFSharpTemplates.csproj | 2 +- .../FSharp.LanguageService.Base.csproj | 2 +- .../Project/ProjectSystem.Base.csproj | 2 +- .../AppConfigHelper.fs | 8 +- .../FSharp.ProjectSystem.FSharp/Project.fs | 4 +- .../VSPackage.resx | 6 +- .../xlf/VSPackage.cs.xlf | 12 +- .../xlf/VSPackage.de.xlf | 12 +- .../xlf/VSPackage.en.xlf | 12 +- .../xlf/VSPackage.es.xlf | 12 +- .../xlf/VSPackage.fr.xlf | 12 +- .../xlf/VSPackage.it.xlf | 12 +- .../xlf/VSPackage.ja.xlf | 12 +- .../xlf/VSPackage.ko.xlf | 12 +- .../xlf/VSPackage.pl.xlf | 12 +- .../xlf/VSPackage.pt-BR.xlf | 12 +- .../xlf/VSPackage.ru.xlf | 12 +- .../xlf/VSPackage.tr.xlf | 12 +- .../xlf/VSPackage.zh-Hans.xlf | 12 +- .../xlf/VSPackage.zh-Hant.xlf | 12 +- .../FSharp.PropertiesPages.vbproj | 2 +- .../PropertyPages/ApplicationPropPage.resx | 2 +- .../PropertyPages/ApplicationPropPage.vb | 4 +- .../PropertyPages/BuildPropPage.resx | 2 +- .../PropertyPages/DebugPropPage.resx | 4 +- .../FSharp.UIResources.csproj | 2 +- .../SupportedRuntimes/SupportedRuntimes.xml | 1 + .../unittests/Tests.LanguageService.Script.fs | 2 +- .../VisualFSharp.Unittests.dll.config | 2 +- vsintegration/update-vsintegration.cmd | 4 +- 96 files changed, 376 insertions(+), 339 deletions(-) rename src/fsharp/FSharp.Core.nuget/{FSharp.Core.4.2.xxx.nuspec => FSharp.Core.LatestNuget.nuspec} (95%) rename src/fsharp/FSharp.Core.nuget/{Microsoft.Portable.FSharp.Core.4.1.xxx.nuspec => Microsoft.Portable.FSharp.Core.nuspec} (51%) diff --git a/fcs/FSharp.Compiler.Service.MSBuild.v12/FSharp.Compiler.Service.MSBuild.v12.fsproj b/fcs/FSharp.Compiler.Service.MSBuild.v12/FSharp.Compiler.Service.MSBuild.v12.fsproj index f66cda2f77..7c41060403 100644 --- a/fcs/FSharp.Compiler.Service.MSBuild.v12/FSharp.Compiler.Service.MSBuild.v12.fsproj +++ b/fcs/FSharp.Compiler.Service.MSBuild.v12/FSharp.Compiler.Service.MSBuild.v12.fsproj @@ -77,7 +77,7 @@ - $(FSharpSourcesRoot)\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\net40\FSharp.Core.dll + $(FSharpSourcesRoot)\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll false diff --git a/fcs/FSharp.Compiler.Service.ProjectCracker/FSharp.Compiler.Service.ProjectCracker.fsproj b/fcs/FSharp.Compiler.Service.ProjectCracker/FSharp.Compiler.Service.ProjectCracker.fsproj index b75f912c98..52d00fb400 100644 --- a/fcs/FSharp.Compiler.Service.ProjectCracker/FSharp.Compiler.Service.ProjectCracker.fsproj +++ b/fcs/FSharp.Compiler.Service.ProjectCracker/FSharp.Compiler.Service.ProjectCracker.fsproj @@ -46,7 +46,7 @@ - $(FSharpSourcesRoot)\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\net40\FSharp.Core.dll + $(FSharpSourcesRoot)\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll false diff --git a/fcs/FSharp.Compiler.Service.ProjectCrackerTool/FSharp.Compiler.Service.ProjectCrackerTool.fsproj b/fcs/FSharp.Compiler.Service.ProjectCrackerTool/FSharp.Compiler.Service.ProjectCrackerTool.fsproj index 66d196a1d5..91c908e30d 100644 --- a/fcs/FSharp.Compiler.Service.ProjectCrackerTool/FSharp.Compiler.Service.ProjectCrackerTool.fsproj +++ b/fcs/FSharp.Compiler.Service.ProjectCrackerTool/FSharp.Compiler.Service.ProjectCrackerTool.fsproj @@ -58,7 +58,7 @@ - $(FSharpSourcesRoot)\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\net40\FSharp.Core.dll + $(FSharpSourcesRoot)\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll false diff --git a/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj b/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj index eebbaa0a93..3b12a19882 100644 --- a/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj +++ b/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj @@ -651,7 +651,7 @@ - $(FSharpSourcesRoot)\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\net40\FSharp.Core.dll + $(FSharpSourcesRoot)\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll false diff --git a/fcs/samples/EditorService/EditorService.fsproj b/fcs/samples/EditorService/EditorService.fsproj index e232d6c5ef..ffdf63d5c6 100644 --- a/fcs/samples/EditorService/EditorService.fsproj +++ b/fcs/samples/EditorService/EditorService.fsproj @@ -41,7 +41,7 @@ - $(SolutionDir)\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\net40\FSharp.Core.dll + $(SolutionDir)\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll false diff --git a/packages.config b/packages.config index 8ef434167e..99063830de 100644 --- a/packages.config +++ b/packages.config @@ -45,7 +45,7 @@ - + diff --git a/setup/FSharp.SDK/Common.Wix.Properties.wxs b/setup/FSharp.SDK/Common.Wix.Properties.wxs index f9f1994caf..d5ade2c8d2 100644 --- a/setup/FSharp.SDK/Common.Wix.Properties.wxs +++ b/setup/FSharp.SDK/Common.Wix.Properties.wxs @@ -11,6 +11,9 @@ + + + @@ -78,10 +81,10 @@ - - - - + + + + diff --git a/setup/FSharp.SDK/FSharp.SDK.wxs b/setup/FSharp.SDK/FSharp.SDK.wxs index f05fa1e4bd..4a91e24122 100644 --- a/setup/FSharp.SDK/FSharp.SDK.wxs +++ b/setup/FSharp.SDK/FSharp.SDK.wxs @@ -2,7 +2,7 @@ - + diff --git a/setup/FSharp.SDK/component-groups/Compiler_LangPack.wxs b/setup/FSharp.SDK/component-groups/Compiler_LangPack.wxs index f75f257202..bec0781fed 100644 --- a/setup/FSharp.SDK/component-groups/Compiler_LangPack.wxs +++ b/setup/FSharp.SDK/component-groups/Compiler_LangPack.wxs @@ -9,7 +9,7 @@ - + diff --git a/setup/FSharp.SDK/component-groups/Compiler_Redist.wxs b/setup/FSharp.SDK/component-groups/Compiler_Redist.wxs index c9d7182c01..e843e8de21 100644 --- a/setup/FSharp.SDK/component-groups/Compiler_Redist.wxs +++ b/setup/FSharp.SDK/component-groups/Compiler_Redist.wxs @@ -39,7 +39,7 @@ - + @@ -131,18 +131,18 @@ - - - + + + - - - - + + + + - + diff --git a/setup/FSharp.SDK/component-groups/Runtime_LangPack.wxs b/setup/FSharp.SDK/component-groups/Runtime_LangPack.wxs index 189a6f8dd6..44bf70904a 100644 --- a/setup/FSharp.SDK/component-groups/Runtime_LangPack.wxs +++ b/setup/FSharp.SDK/component-groups/Runtime_LangPack.wxs @@ -8,6 +8,10 @@ + + + + @@ -43,123 +47,131 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/setup/FSharp.SDK/component-groups/Runtime_Redist.wxs b/setup/FSharp.SDK/component-groups/Runtime_Redist.wxs index 46dd92b7f7..d44607726e 100644 --- a/setup/FSharp.SDK/component-groups/Runtime_Redist.wxs +++ b/setup/FSharp.SDK/component-groups/Runtime_Redist.wxs @@ -5,6 +5,9 @@ + + + @@ -32,12 +35,28 @@ + + + + + + + + + + + + + + + + + - - - + + @@ -47,8 +66,8 @@ - - + + diff --git a/setup/FSharp.Setup.props b/setup/FSharp.Setup.props index 8dc87c36ea..cf780ae0de 100644 --- a/setup/FSharp.Setup.props +++ b/setup/FSharp.Setup.props @@ -8,16 +8,16 @@ $(SetupRootFolder)\..\packages\WiX.Toolset.2015.$(WiXToolset2015Version)\tools\wix $(SetupRootFolder)\..\packages - + - 4.1 + 4.3 $([System.DateTime]::Now.ToString(yyyyMMdd.0)) $(FSharpProductVersion).$(BUILD_BUILDNUMBER.Replace(".DRAFT", "")) - + net40 Debug diff --git a/setup/FSharp.Wix.Extensions/FSharp.Wix.Extensions.csproj b/setup/FSharp.Wix.Extensions/FSharp.Wix.Extensions.csproj index 135d678cae..d21a4f209d 100644 --- a/setup/FSharp.Wix.Extensions/FSharp.Wix.Extensions.csproj +++ b/setup/FSharp.Wix.Extensions/FSharp.Wix.Extensions.csproj @@ -11,7 +11,7 @@ CSharp 15.0 - 4.4.1.0 + $(FSCoreVersion) cs diff --git a/setup/Swix/Microsoft.FSharp.SDK.Core/Files.swr b/setup/Swix/Microsoft.FSharp.SDK.Core/Files.swr index 67a6272ceb..cb51e56c9f 100644 --- a/setup/Swix/Microsoft.FSharp.SDK.Core/Files.swr +++ b/setup/Swix/Microsoft.FSharp.SDK.Core/Files.swr @@ -3,7 +3,7 @@ use vs package name=Microsoft.FSharp.SDK.Core version=$(FSharpPackageVersion) vs.package.type=msi - vs.package.providerKey=Microsoft.FSharp.SDK.Core,v4.1 + vs.package.providerKey=Microsoft.FSharp.SDK.Core,v4.3 vs.installSize SystemDrive=194670592 diff --git a/setup/Swix/Microsoft.FSharp.SDK.Resources/Empty.swr b/setup/Swix/Microsoft.FSharp.SDK.Resources/Empty.swr index 262ef0c9ff..95a13eb66a 100644 --- a/setup/Swix/Microsoft.FSharp.SDK.Resources/Empty.swr +++ b/setup/Swix/Microsoft.FSharp.SDK.Resources/Empty.swr @@ -4,4 +4,4 @@ package name=Microsoft.FSharp.SDK.Resources version=$(FSharpPackageVersion) vs.package.language=$(LocaleSpecificCulture) vs.package.installSize=1 - vs.package.providerKey=Microsoft.FSharp.SDK.Resources,$(LocaleSpecificCulture),v4.1 + vs.package.providerKey=Microsoft.FSharp.SDK.Resources,$(LocaleSpecificCulture),v4.3 diff --git a/setup/Swix/Microsoft.FSharp.SDK.Resources/Files.swr b/setup/Swix/Microsoft.FSharp.SDK.Resources/Files.swr index a21afbd796..82648036b0 100644 --- a/setup/Swix/Microsoft.FSharp.SDK.Resources/Files.swr +++ b/setup/Swix/Microsoft.FSharp.SDK.Resources/Files.swr @@ -4,7 +4,7 @@ package name=Microsoft.FSharp.SDK.Resources version=$(FSharpPackageVersion) vs.package.type=msi vs.package.language=$(LocaleSpecificCulture) - vs.package.providerKey=Microsoft.FSharp.SDK.Resources,$(LocaleSpecificCulture),v4.1 + vs.package.providerKey=Microsoft.FSharp.SDK.Resources,$(LocaleSpecificCulture),v4.3 vs.installSize SystemDrive=12681438 diff --git a/setup/resources/Microsoft.FSharp.NetSdk.Shim.props b/setup/resources/Microsoft.FSharp.NetSdk.Shim.props index d29f23cf40..d9fe97d929 100644 --- a/setup/resources/Microsoft.FSharp.NetSdk.Shim.props +++ b/setup/resources/Microsoft.FSharp.NetSdk.Shim.props @@ -1,5 +1,5 @@ - + diff --git a/setup/resources/Microsoft.FSharp.NetSdk.Shim.targets b/setup/resources/Microsoft.FSharp.NetSdk.Shim.targets index d209944225..7a669fd4d1 100644 --- a/setup/resources/Microsoft.FSharp.NetSdk.Shim.targets +++ b/setup/resources/Microsoft.FSharp.NetSdk.Shim.targets @@ -1,5 +1,5 @@ - + diff --git a/setup/resources/Microsoft.FSharp.Shim.targets b/setup/resources/Microsoft.FSharp.Shim.targets index e54e9c4de7..b1df5fba66 100644 --- a/setup/resources/Microsoft.FSharp.Shim.targets +++ b/setup/resources/Microsoft.FSharp.Shim.targets @@ -1,5 +1,5 @@ - + diff --git a/setup/resources/Microsoft.Portable.FSharp.Shim.targets b/setup/resources/Microsoft.Portable.FSharp.Shim.targets index 055c0d2741..22a4e746ee 100644 --- a/setup/resources/Microsoft.Portable.FSharp.Shim.targets +++ b/setup/resources/Microsoft.Portable.FSharp.Shim.targets @@ -1,5 +1,5 @@ - + diff --git a/src/FSharpSource.Settings.targets b/src/FSharpSource.Settings.targets index ffd3f4226c..048383214e 100644 --- a/src/FSharpSource.Settings.targets +++ b/src/FSharpSource.Settings.targets @@ -45,10 +45,13 @@ obj\$(Configuration)\$(TargetDotnetProfile)\ obj\$(Configuration)\$(TargetDotnetProfile)\$(PortableProfileBeingReferenced)\ - 4.1.19 - 4.1.20 - 4.1.21 - 4.2.4 + 4.1.19 + 4.1 + + 4.3.0 + + 4.3.1 + 4.3 3.5.0 3.5.0.0 diff --git a/src/FSharpSource.targets b/src/FSharpSource.targets index 7cf5b833cc..2302f62503 100644 --- a/src/FSharpSource.targets +++ b/src/FSharpSource.targets @@ -3,9 +3,8 @@ - 4.4.1.0 + 4.4.3.0 - @@ -33,7 +32,7 @@ true $(FSCoreVersion) - 15.4.1.0 + 15.4.3.0 fs diff --git a/src/fsharp/FSharp.Core.nuget/FSharp.Core.4.2.xxx.nuspec b/src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec similarity index 95% rename from src/fsharp/FSharp.Core.nuget/FSharp.Core.4.2.xxx.nuspec rename to src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec index 26e9755364..e04681e361 100644 --- a/src/fsharp/FSharp.Core.nuget/FSharp.Core.4.2.xxx.nuspec +++ b/src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec @@ -3,10 +3,10 @@ FSharp.Core - FSharp.Core for F# 4.1 - FSharp.Core for F# 4.1 + FSharp.Core for F# 4.3 + FSharp.Core for F# 4.3 - FSharp.Core redistributables from Visual F# 4.1.0 + FSharp.Core redistributables from Visual F# 4.3.0 Supported Platforms: .NET 4.5+ (net45) netstandard1.6 (netstandard1.6) diff --git a/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj b/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj index 6373fc3fb3..7a75f92786 100644 --- a/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj +++ b/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj @@ -16,9 +16,9 @@ - + - + @@ -37,8 +37,8 @@ - + @@ -52,14 +52,14 @@ X.X.XXX - $(FSharpCore41TargetVersion) - 4.1 + $(FSharpCoreFrozenPortableTargetPackageVersion) + $(FSharpCoreFrozenPortableTargetMajorVersion) - $(FSharpCore42TargetVersion) - 4.2 + $(FSharpCore41TargetPackageVersion) + $(FSharpCore41TargetMajorVersion) - $(FSharpCore41FrozenPortableTargetVersion) - 4.1 + $(FSharpCoreFrozenPortableTargetPackageVersion) + $(FSharpCoreFrozenPortableTargetMajorVersion) -prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(PackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)" diff --git a/src/fsharp/FSharp.Core.nuget/Microsoft.Portable.FSharp.Core.4.1.xxx.nuspec b/src/fsharp/FSharp.Core.nuget/Microsoft.Portable.FSharp.Core.nuspec similarity index 51% rename from src/fsharp/FSharp.Core.nuget/Microsoft.Portable.FSharp.Core.4.1.xxx.nuspec rename to src/fsharp/FSharp.Core.nuget/Microsoft.Portable.FSharp.Core.nuspec index 22812ebf2e..7ca41bb216 100644 --- a/src/fsharp/FSharp.Core.nuget/Microsoft.Portable.FSharp.Core.4.1.xxx.nuspec +++ b/src/fsharp/FSharp.Core.nuget/Microsoft.Portable.FSharp.Core.nuspec @@ -14,14 +14,14 @@ - - - - - - - - - + + + + + + + + + diff --git a/src/fsharp/FSharp.Core/FSharp.Core.fsproj b/src/fsharp/FSharp.Core/FSharp.Core.fsproj index 4902847305..ae91eec9df 100644 --- a/src/fsharp/FSharp.Core/FSharp.Core.fsproj +++ b/src/fsharp/FSharp.Core/FSharp.Core.fsproj @@ -278,7 +278,7 @@ Outputs='$(FSharpSourcesRoot)\..\$(Configuration)\artifacts\"%(PackageNuspec.Filename)).nupkg'> - -prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(FSharpCore42TargetVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)" + -prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(FSharpCoreFrozenPortablePackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)" diff --git a/src/utils/CompilerLocationUtils.fs b/src/utils/CompilerLocationUtils.fs index 2cc60b183d..e9961da9bb 100644 --- a/src/utils/CompilerLocationUtils.fs +++ b/src/utils/CompilerLocationUtils.fs @@ -12,7 +12,7 @@ open System.Runtime.InteropServices module internal FSharpEnvironment = /// The F# version reported in the banner - let FSharpBannerVersion = "4.1" + let FSharpBannerVersion = "4.3" let versionOf<'t> = #if FX_RESHAPED_REFLECTION diff --git a/tests/projects/Sample_VS2012_FSharp_ConsoleApp_net40/Sample_VS2012_FSharp_ConsoleApp_net40/Sample_VS2012_FSharp_ConsoleApp_net40.fsproj b/tests/projects/Sample_VS2012_FSharp_ConsoleApp_net40/Sample_VS2012_FSharp_ConsoleApp_net40/Sample_VS2012_FSharp_ConsoleApp_net40.fsproj index 4eddaeffb8..0b4c365d7b 100644 --- a/tests/projects/Sample_VS2012_FSharp_ConsoleApp_net40/Sample_VS2012_FSharp_ConsoleApp_net40/Sample_VS2012_FSharp_ConsoleApp_net40.fsproj +++ b/tests/projects/Sample_VS2012_FSharp_ConsoleApp_net40/Sample_VS2012_FSharp_ConsoleApp_net40/Sample_VS2012_FSharp_ConsoleApp_net40.fsproj @@ -43,7 +43,7 @@ - ..\..\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll diff --git a/tests/projects/Sample_VS2012_FSharp_ConsoleApp_net40_upgraded_VS2013/Sample_VS2012_FSharp_ConsoleApp_net40_upgraded_VS2013/Sample_VS2012_FSharp_ConsoleApp_net40_upgraded_VS2013.fsproj b/tests/projects/Sample_VS2012_FSharp_ConsoleApp_net40_upgraded_VS2013/Sample_VS2012_FSharp_ConsoleApp_net40_upgraded_VS2013/Sample_VS2012_FSharp_ConsoleApp_net40_upgraded_VS2013.fsproj index 0c174af62d..ed2fa4ea5e 100644 --- a/tests/projects/Sample_VS2012_FSharp_ConsoleApp_net40_upgraded_VS2013/Sample_VS2012_FSharp_ConsoleApp_net40_upgraded_VS2013/Sample_VS2012_FSharp_ConsoleApp_net40_upgraded_VS2013.fsproj +++ b/tests/projects/Sample_VS2012_FSharp_ConsoleApp_net40_upgraded_VS2013/Sample_VS2012_FSharp_ConsoleApp_net40_upgraded_VS2013/Sample_VS2012_FSharp_ConsoleApp_net40_upgraded_VS2013.fsproj @@ -43,7 +43,7 @@ - ..\..\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll diff --git a/tests/projects/Sample_VS2012_FSharp_Portable_Library/Sample_VS2012_FSharp_Portable_Library.fsproj b/tests/projects/Sample_VS2012_FSharp_Portable_Library/Sample_VS2012_FSharp_Portable_Library.fsproj index 921365806d..1bd9fcf104 100644 --- a/tests/projects/Sample_VS2012_FSharp_Portable_Library/Sample_VS2012_FSharp_Portable_Library.fsproj +++ b/tests/projects/Sample_VS2012_FSharp_Portable_Library/Sample_VS2012_FSharp_Portable_Library.fsproj @@ -36,7 +36,7 @@ FSharp.Core FSharp.Core.dll - ..\..\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll diff --git a/tests/projects/Sample_VS2012_FSharp_Portable_Library_upgraded_2013/Sample_VS2012_FSharp_Portable_Library_upgraded_2013.fsproj b/tests/projects/Sample_VS2012_FSharp_Portable_Library_upgraded_2013/Sample_VS2012_FSharp_Portable_Library_upgraded_2013.fsproj index 75b8b871bd..deff760e73 100644 --- a/tests/projects/Sample_VS2012_FSharp_Portable_Library_upgraded_2013/Sample_VS2012_FSharp_Portable_Library_upgraded_2013.fsproj +++ b/tests/projects/Sample_VS2012_FSharp_Portable_Library_upgraded_2013/Sample_VS2012_FSharp_Portable_Library_upgraded_2013.fsproj @@ -35,7 +35,7 @@ - ..\..\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll True diff --git a/tests/projects/Sample_VS2013_FSharp_Portable_Library_Legacy_net40/Sample_VS2013_FSharp_Portable_Library_Legacy_net40.fsproj b/tests/projects/Sample_VS2013_FSharp_Portable_Library_Legacy_net40/Sample_VS2013_FSharp_Portable_Library_Legacy_net40.fsproj index 727a28f6d8..14fe941407 100644 --- a/tests/projects/Sample_VS2013_FSharp_Portable_Library_Legacy_net40/Sample_VS2013_FSharp_Portable_Library_Legacy_net40.fsproj +++ b/tests/projects/Sample_VS2013_FSharp_Portable_Library_Legacy_net40/Sample_VS2013_FSharp_Portable_Library_Legacy_net40.fsproj @@ -37,7 +37,7 @@ FSharp.Core FSharp.Core.dll - ..\..\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll diff --git a/tests/projects/Sample_VS2013_FSharp_Portable_Library_Legacy_net45/Sample_VS2013_FSharp_Portable_Library_Legacy_net45.fsproj b/tests/projects/Sample_VS2013_FSharp_Portable_Library_Legacy_net45/Sample_VS2013_FSharp_Portable_Library_Legacy_net45.fsproj index 77e65fa263..e541b68e46 100644 --- a/tests/projects/Sample_VS2013_FSharp_Portable_Library_Legacy_net45/Sample_VS2013_FSharp_Portable_Library_Legacy_net45.fsproj +++ b/tests/projects/Sample_VS2013_FSharp_Portable_Library_Legacy_net45/Sample_VS2013_FSharp_Portable_Library_Legacy_net45.fsproj @@ -37,7 +37,7 @@ FSharp.Core FSharp.Core.dll - ..\..\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll diff --git a/tests/projects/Sample_VS2013_FSharp_Portable_Library_Legacy_net451/Sample_VS2013_FSharp_Portable_Library_Legacy_net451.fsproj b/tests/projects/Sample_VS2013_FSharp_Portable_Library_Legacy_net451/Sample_VS2013_FSharp_Portable_Library_Legacy_net451.fsproj index 4fc3681cb3..207cd13232 100644 --- a/tests/projects/Sample_VS2013_FSharp_Portable_Library_Legacy_net451/Sample_VS2013_FSharp_Portable_Library_Legacy_net451.fsproj +++ b/tests/projects/Sample_VS2013_FSharp_Portable_Library_Legacy_net451/Sample_VS2013_FSharp_Portable_Library_Legacy_net451.fsproj @@ -37,7 +37,7 @@ FSharp.Core FSharp.Core.dll - ..\..\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll diff --git a/tests/projects/Sample_VS2013_FSharp_Portable_Library_net45/Sample_VS2013_FSharp_Portable_Library_net45.fsproj b/tests/projects/Sample_VS2013_FSharp_Portable_Library_net45/Sample_VS2013_FSharp_Portable_Library_net45.fsproj index 5ee9437dc1..b44150d5af 100644 --- a/tests/projects/Sample_VS2013_FSharp_Portable_Library_net45/Sample_VS2013_FSharp_Portable_Library_net45.fsproj +++ b/tests/projects/Sample_VS2013_FSharp_Portable_Library_net45/Sample_VS2013_FSharp_Portable_Library_net45.fsproj @@ -38,7 +38,7 @@ FSharp.Core FSharp.Core.dll - ..\..\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\portable-net45+netcore45\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\portable-net45+netcore45\FSharp.Core.dll diff --git a/tests/projects/Sample_VS2013_FSharp_Portable_Library_net451/Sample_VS2013_FSharp_Portable_Library_net451.fsproj b/tests/projects/Sample_VS2013_FSharp_Portable_Library_net451/Sample_VS2013_FSharp_Portable_Library_net451.fsproj index 2bd9905029..eb60ed1d6c 100644 --- a/tests/projects/Sample_VS2013_FSharp_Portable_Library_net451/Sample_VS2013_FSharp_Portable_Library_net451.fsproj +++ b/tests/projects/Sample_VS2013_FSharp_Portable_Library_net451/Sample_VS2013_FSharp_Portable_Library_net451.fsproj @@ -38,7 +38,7 @@ FSharp.Core FSharp.Core.dll - ..\..\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\portable-net45+netcore45\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\portable-net45+netcore45\FSharp.Core.dll diff --git a/tests/projects/Sample_VS2013_FSharp_Portable_Library_net451_adjusted_to_profile259/Sample_VS2013_FSharp_Portable_Library_net451.fsproj b/tests/projects/Sample_VS2013_FSharp_Portable_Library_net451_adjusted_to_profile259/Sample_VS2013_FSharp_Portable_Library_net451.fsproj index 84cd51e717..119d6805e7 100644 --- a/tests/projects/Sample_VS2013_FSharp_Portable_Library_net451_adjusted_to_profile259/Sample_VS2013_FSharp_Portable_Library_net451.fsproj +++ b/tests/projects/Sample_VS2013_FSharp_Portable_Library_net451_adjusted_to_profile259/Sample_VS2013_FSharp_Portable_Library_net451.fsproj @@ -38,7 +38,7 @@ FSharp.Core FSharp.Core.dll - ..\..\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\portable-net45+netcore45+wpa81+wp8\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\portable-net45+netcore45+wpa81+wp8\FSharp.Core.dll diff --git a/tests/projects/Sample_VS2013_FSharp_Portable_Library_net451_adjusted_to_profile78/Sample_VS2013_FSharp_Portable_Library_net451.fsproj b/tests/projects/Sample_VS2013_FSharp_Portable_Library_net451_adjusted_to_profile78/Sample_VS2013_FSharp_Portable_Library_net451.fsproj index 960a7f5a33..319f6dc420 100644 --- a/tests/projects/Sample_VS2013_FSharp_Portable_Library_net451_adjusted_to_profile78/Sample_VS2013_FSharp_Portable_Library_net451.fsproj +++ b/tests/projects/Sample_VS2013_FSharp_Portable_Library_net451_adjusted_to_profile78/Sample_VS2013_FSharp_Portable_Library_net451.fsproj @@ -38,7 +38,7 @@ FSharp.Core FSharp.Core.dll - ..\..\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\portable-net45+netcore45+wp8\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\portable-net45+netcore45+wp8\FSharp.Core.dll diff --git a/tests/projects/Sample_VS2015_FSharp_Portable259_Library/Sample_VS2015_FSharp_Portable259_Library.fsproj b/tests/projects/Sample_VS2015_FSharp_Portable259_Library/Sample_VS2015_FSharp_Portable259_Library.fsproj index 3860254ff7..160e117760 100644 --- a/tests/projects/Sample_VS2015_FSharp_Portable259_Library/Sample_VS2015_FSharp_Portable259_Library.fsproj +++ b/tests/projects/Sample_VS2015_FSharp_Portable259_Library/Sample_VS2015_FSharp_Portable259_Library.fsproj @@ -39,7 +39,7 @@ FSharp.Core FSharp.Core.dll - ..\..\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\portable-net45+netcore45+wpa81+wp8\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\portable-net45+netcore45+wpa81+wp8\FSharp.Core.dll diff --git a/tests/projects/Sample_VS2015_FSharp_Portable47_Library/Sample_VS2015_FSharp_Portable47_Library.fsproj b/tests/projects/Sample_VS2015_FSharp_Portable47_Library/Sample_VS2015_FSharp_Portable47_Library.fsproj index 2497d03f00..ace02e6235 100644 --- a/tests/projects/Sample_VS2015_FSharp_Portable47_Library/Sample_VS2015_FSharp_Portable47_Library.fsproj +++ b/tests/projects/Sample_VS2015_FSharp_Portable47_Library/Sample_VS2015_FSharp_Portable47_Library.fsproj @@ -38,7 +38,7 @@ FSharp.Core FSharp.Core.dll - ..\..\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\portable-net45+sl5+netcore45\FSharp.Core.dll diff --git a/tests/projects/Sample_VS2015_FSharp_Portable78_Library/Sample_VS2015_FSharp_Portable78_Library.fsproj b/tests/projects/Sample_VS2015_FSharp_Portable78_Library/Sample_VS2015_FSharp_Portable78_Library.fsproj index 7741d5f5b3..c422bd847c 100644 --- a/tests/projects/Sample_VS2015_FSharp_Portable78_Library/Sample_VS2015_FSharp_Portable78_Library.fsproj +++ b/tests/projects/Sample_VS2015_FSharp_Portable78_Library/Sample_VS2015_FSharp_Portable78_Library.fsproj @@ -39,7 +39,7 @@ FSharp.Core FSharp.Core.dll - ..\..\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\portable-net45+netcore45+wp8\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\portable-net45+netcore45+wp8\FSharp.Core.dll diff --git a/tests/projects/Sample_VS2015_FSharp_Portable7_Library/Sample_VS2015_FSharp_Portable7_Library.fsproj b/tests/projects/Sample_VS2015_FSharp_Portable7_Library/Sample_VS2015_FSharp_Portable7_Library.fsproj index 8ebe0160da..08c0756194 100644 --- a/tests/projects/Sample_VS2015_FSharp_Portable7_Library/Sample_VS2015_FSharp_Portable7_Library.fsproj +++ b/tests/projects/Sample_VS2015_FSharp_Portable7_Library/Sample_VS2015_FSharp_Portable7_Library.fsproj @@ -39,7 +39,7 @@ FSharp.Core FSharp.Core.dll - ..\..\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\portable-net45+netcore45+wpa81+wp8\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\portable-net45+netcore45+wpa81+wp8\FSharp.Core.dll diff --git a/tests/service/data/DifferingOutputDir/Dir1/Test1.fsproj b/tests/service/data/DifferingOutputDir/Dir1/Test1.fsproj index c63d10731d..7966db8e94 100644 --- a/tests/service/data/DifferingOutputDir/Dir1/Test1.fsproj +++ b/tests/service/data/DifferingOutputDir/Dir1/Test1.fsproj @@ -37,7 +37,7 @@ - ..\..\..\..\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\net40\FSharp.Core.dll + ..\..\..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll false diff --git a/tests/service/data/DifferingOutputDir/Dir2/Test2.fsproj b/tests/service/data/DifferingOutputDir/Dir2/Test2.fsproj index 0ee82b31cb..85e94a19ca 100644 --- a/tests/service/data/DifferingOutputDir/Dir2/Test2.fsproj +++ b/tests/service/data/DifferingOutputDir/Dir2/Test2.fsproj @@ -37,7 +37,7 @@ - ..\..\..\..\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\net40\FSharp.Core.dll + ..\..\..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll false diff --git a/tests/service/data/FsAndFsiFiles.fsproj b/tests/service/data/FsAndFsiFiles.fsproj index 95b10fad1b..aa575fbace 100644 --- a/tests/service/data/FsAndFsiFiles.fsproj +++ b/tests/service/data/FsAndFsiFiles.fsproj @@ -35,7 +35,7 @@ - ..\..\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\net40\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll @@ -45,8 +45,8 @@ - - + + diff --git a/tests/service/data/MultiLanguageProject/ConsoleApplication1.fsproj b/tests/service/data/MultiLanguageProject/ConsoleApplication1.fsproj index e12ade0ff4..4afeee66ed 100644 --- a/tests/service/data/MultiLanguageProject/ConsoleApplication1.fsproj +++ b/tests/service/data/MultiLanguageProject/ConsoleApplication1.fsproj @@ -39,7 +39,7 @@ - ..\..\..\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\net40\FSharp.Core.dll + ..\..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll false diff --git a/tests/service/data/MultiLanguageProject/ConsoleApplication2.fsproj b/tests/service/data/MultiLanguageProject/ConsoleApplication2.fsproj index 38bb936cab..d2b29591d4 100644 --- a/tests/service/data/MultiLanguageProject/ConsoleApplication2.fsproj +++ b/tests/service/data/MultiLanguageProject/ConsoleApplication2.fsproj @@ -39,7 +39,7 @@ - ..\..\..\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\net40\FSharp.Core.dll + ..\..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll false diff --git a/tests/service/data/Space in name.fsproj b/tests/service/data/Space in name.fsproj index ec67bc9742..86dc385fcc 100644 --- a/tests/service/data/Space in name.fsproj +++ b/tests/service/data/Space in name.fsproj @@ -35,7 +35,7 @@ - ..\..\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\net40\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.4.3.0\lib\profiles\net40\FSharp.Core.dll false diff --git a/tests/service/data/Test1.fsproj b/tests/service/data/Test1.fsproj index 6cb171ba60..1802858145 100644 --- a/tests/service/data/Test1.fsproj +++ b/tests/service/data/Test1.fsproj @@ -35,7 +35,7 @@ - ..\..\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\net40\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.4.3.0\lib\profiles\net40\FSharp.Core.dll false diff --git a/tests/service/data/Test2.fsproj b/tests/service/data/Test2.fsproj index 96ff7ac180..1ae856b278 100644 --- a/tests/service/data/Test2.fsproj +++ b/tests/service/data/Test2.fsproj @@ -36,7 +36,7 @@ - ..\..\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\net40\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.4.3.0\lib\profiles\net40\FSharp.Core.dll false diff --git a/tests/service/data/Test3.fsproj b/tests/service/data/Test3.fsproj index 31c2d33c56..22a810bb24 100644 --- a/tests/service/data/Test3.fsproj +++ b/tests/service/data/Test3.fsproj @@ -36,7 +36,7 @@ - ..\..\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\net40\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.4.3.0\lib\profiles\net40\FSharp.Core.dll false diff --git a/tests/service/data/TestProject/TestProject.fsproj b/tests/service/data/TestProject/TestProject.fsproj index dde260ce99..80c50f3109 100644 --- a/tests/service/data/TestProject/TestProject.fsproj +++ b/tests/service/data/TestProject/TestProject.fsproj @@ -35,7 +35,7 @@ - ..\..\..\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\net40\FSharp.Core.dll + ..\..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll false diff --git a/tests/service/data/TestTP/TestTP.fsproj b/tests/service/data/TestTP/TestTP.fsproj index 5f7d7c0543..5490fdb320 100644 --- a/tests/service/data/TestTP/TestTP.fsproj +++ b/tests/service/data/TestTP/TestTP.fsproj @@ -47,7 +47,7 @@ - ..\..\..\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\net40\FSharp.Core.dll + ..\..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll false diff --git a/tests/service/data/TypeProviderConsole/TypeProviderConsole.fsproj b/tests/service/data/TypeProviderConsole/TypeProviderConsole.fsproj index 6b50e360a0..3affe9671d 100644 --- a/tests/service/data/TypeProviderConsole/TypeProviderConsole.fsproj +++ b/tests/service/data/TypeProviderConsole/TypeProviderConsole.fsproj @@ -39,7 +39,7 @@ - ..\..\..\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\net40\FSharp.Core.dll + ..\..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll false diff --git a/tests/service/data/TypeProviderLibrary/TypeProviderLibrary.fsproj b/tests/service/data/TypeProviderLibrary/TypeProviderLibrary.fsproj index baa89f49b3..28e44d8661 100644 --- a/tests/service/data/TypeProviderLibrary/TypeProviderLibrary.fsproj +++ b/tests/service/data/TypeProviderLibrary/TypeProviderLibrary.fsproj @@ -37,7 +37,7 @@ - ..\..\..\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\net40\FSharp.Core.dll + ..\..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll false diff --git a/tests/service/data/TypeProvidersBug/TestConsole/TestConsole.fsproj b/tests/service/data/TypeProvidersBug/TestConsole/TestConsole.fsproj index 54448fef5c..9f13bc475f 100644 --- a/tests/service/data/TypeProvidersBug/TestConsole/TestConsole.fsproj +++ b/tests/service/data/TypeProvidersBug/TestConsole/TestConsole.fsproj @@ -47,7 +47,7 @@ - ..\..\..\..\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\net40\FSharp.Core.dll + ..\..\..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll false diff --git a/tests/service/data/TypeProvidersBug/TypeProvidersBug/TypeProvidersBug.fsproj b/tests/service/data/TypeProvidersBug/TypeProvidersBug/TypeProvidersBug.fsproj index 00ef54f652..f2e74b93d7 100644 --- a/tests/service/data/TypeProvidersBug/TypeProvidersBug/TypeProvidersBug.fsproj +++ b/tests/service/data/TypeProvidersBug/TypeProvidersBug/TypeProvidersBug.fsproj @@ -42,7 +42,7 @@ - ..\..\..\..\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\net40\FSharp.Core.dll + ..\..\..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll false diff --git a/tests/service/data/sqlite-net-spike/sqlite-net-spike.fsproj b/tests/service/data/sqlite-net-spike/sqlite-net-spike.fsproj index 93cc75f002..48359e32e2 100644 --- a/tests/service/data/sqlite-net-spike/sqlite-net-spike.fsproj +++ b/tests/service/data/sqlite-net-spike/sqlite-net-spike.fsproj @@ -37,7 +37,7 @@ - ..\..\..\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\net40\FSharp.Core.dll + ..\..\..\..\packages\Microsoft.Portable.FSharp.Core.$(FSharpCoreFrozenPortablePackageVersion)\lib\profiles\net40\FSharp.Core.dll false diff --git a/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj b/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj index eaa135412c..c7d3ac014a 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj +++ b/vsintegration/ProjectTemplates/ConsoleProject/Template/ConsoleApplication.fsproj @@ -13,7 +13,7 @@ true true $if$ ($targetframeworkversion$ >= 4.0) - 4.4.1.0 + 4.4.3.0 $else$ 2.3.0.0 $endif$ diff --git a/vsintegration/ProjectTemplates/LibraryProject/Template/Library.fsproj b/vsintegration/ProjectTemplates/LibraryProject/Template/Library.fsproj index 8e23b34437..35512503ea 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/Template/Library.fsproj +++ b/vsintegration/ProjectTemplates/LibraryProject/Template/Library.fsproj @@ -12,7 +12,7 @@ true v$targetframeworkversion$ $if$ ($targetframeworkversion$ >= 4.0) - 4.4.1.0 + 4.4.3.0 $else$ 2.3.0.0 $endif$ diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.fsproj b/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.fsproj index 200061cf39..e388d819f9 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.fsproj +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/Tutorial.fsproj @@ -13,7 +13,7 @@ true true $if$ ($targetframeworkversion$ >= 4.0) - 4.4.1.0 + 4.4.3.0 $else$ 2.3.0.0 $endif$ diff --git a/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj b/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj index 3c4dd3e74f..5af51a83ca 100644 --- a/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj +++ b/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj @@ -16,7 +16,7 @@ LanguageServiceProfiling v4.6 true - 4.4.1.0 + 4.4.3.0 LanguageServiceProfiling diff --git a/vsintegration/Vsix/RegisterFsharpPackage.pkgdef b/vsintegration/Vsix/RegisterFsharpPackage.pkgdef index ec8375a91b..827a62ed67 100644 --- a/vsintegration/Vsix/RegisterFsharpPackage.pkgdef +++ b/vsintegration/Vsix/RegisterFsharpPackage.pkgdef @@ -53,7 +53,7 @@ "1"="{92EF0900-2251-11D2-B72E-0000F87572EF}" [$RootKey$\Packages\{91a04a73-4f2c-4e7c-ad38-c1a68e7da05c}] -"ProductVersion"="4.1" +"ProductVersion"="4.3" "ProductName"="Visual F#" "CompanyName"="Microsoft Corp." @@ -63,42 +63,42 @@ [$RootKey$\CLSID\{e1194663-db3c-49eb-8b45-276fcdc440ea}] "InprocServer32"="$WinDir$\SYSTEM32\MSCOREE.DLL" "Class"="Microsoft.VisualStudio.FSharp.ProjectSystem.FSharpBuildPropertyPage" -"Assembly"="FSharp.ProjectSystem.FSharp, Version=15.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +"Assembly"="FSharp.ProjectSystem.FSharp, Version=15.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" "ThreadingModel"="Both" @="Microsoft.VisualStudio.FSharp.ProjectSystem.FSharpBuildPropertyPage" [$RootKey$\CLSID\{6d2d9b56-2691-4624-a1bf-d07a14594748}] "InprocServer32"="$WinDir$\SYSTEM32\MSCOREE.DLL" "Class"="Microsoft.VisualStudio.Editors.PropertyPages.FSharpApplicationPropPageComClass" -"Assembly"="FSharp.ProjectSystem.PropertyPages, Version=15.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +"Assembly"="FSharp.ProjectSystem.PropertyPages, Version=15.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" "ThreadingModel"="Both" @="Microsoft.VisualStudio.Editors.PropertyPages.FSharpApplicationPropPageComClass" [$RootKey$\CLSID\{dd84aa8f-71bb-462a-8ef8-c9992cb325b7}] "InprocServer32"="$System$mscoree.dll" "Class"="Microsoft.VisualStudio.Editors.PropertyPages.FSharpBuildEventsPropPageComClass" -"Assembly"="FSharp.ProjectSystem.PropertyPages, Version=15.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +"Assembly"="FSharp.ProjectSystem.PropertyPages, Version=15.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" "ThreadingModel"="Both" @="Microsoft.VisualStudio.Editors.PropertyPages.FSharpBuildEventsPropPageComClass" [$RootKey$\CLSID\{fac0a17e-2e70-4211-916a-0d34fb708bff}] "InprocServer32"="$System$mscoree.dll" "Class"="Microsoft.VisualStudio.Editors.PropertyPages.FSharpBuildPropPageComClass" -"Assembly"="FSharp.ProjectSystem.PropertyPages, Version=15.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +"Assembly"="FSharp.ProjectSystem.PropertyPages, Version=15.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" "ThreadingModel"="Both" @="Microsoft.VisualStudio.Editors.PropertyPages.FSharpBuildPropPageComClass" [$RootKey$\CLSID\{9cfbeb2a-6824-43e2-bd3b-b112febc3772}] "InprocServer32"="$WinDir$\SYSTEM32\MSCOREE.DLL" "Class"="Microsoft.VisualStudio.Editors.PropertyPages.FSharpDebugPropPageComClass" -"Assembly"="FSharp.ProjectSystem.PropertyPages, Version=15.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +"Assembly"="FSharp.ProjectSystem.PropertyPages, Version=15.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" "ThreadingModel"="Both" @="Microsoft.VisualStudio.Editors.PropertyPages.FSharpDebugPropPageComClass" [$RootKey$\CLSID\{df16b1a2-0e91-4499-ae60-c7144e614bf1}] "InprocServer32"="$WinDir$\SYSTEM32\MSCOREE.DLL" "Class"="Microsoft.VisualStudio.Editors.PropertyPages.FSharpReferencePathsPropPageComClass" -"Assembly"="FSharp.ProjectSystem.PropertyPages, Version=15.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +"Assembly"="FSharp.ProjectSystem.PropertyPages, Version=15.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" "ThreadingModel"="Both" @="Microsoft.VisualStudio.Editors.PropertyPages.FSharpReferencePathsPropPageComClass" diff --git a/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj b/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj index 0b1ec774b1..678547796e 100644 --- a/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj +++ b/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj @@ -53,7 +53,7 @@ $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin VisualFSharpFull $(RootBinPath) - 15.4.1.0 + 15.4.3.0 cs false diff --git a/vsintegration/Vsix/VisualFSharpOpenSource/VisualFSharpOpenSource.csproj b/vsintegration/Vsix/VisualFSharpOpenSource/VisualFSharpOpenSource.csproj index 1845d75fa5..0f277e7d44 100644 --- a/vsintegration/Vsix/VisualFSharpOpenSource/VisualFSharpOpenSource.csproj +++ b/vsintegration/Vsix/VisualFSharpOpenSource/VisualFSharpOpenSource.csproj @@ -53,7 +53,7 @@ $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin VisualFSharpOpenSource $(RootBinPath) - 15.4.1.0 + 15.4.3.0 cs diff --git a/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj b/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj index 62c290d92b..16496c8e12 100644 --- a/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj +++ b/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj @@ -51,7 +51,7 @@ $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin VisualFSharpTemplate $(RootBinPath) - 15.4.1.0 + 15.4.3.0 cs false diff --git a/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj b/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj index 25fc0ea845..c58a03c5a1 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj +++ b/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj @@ -4,7 +4,7 @@ $(MSBuildProjectDirectory)\..\..\..\src CSharp - 15.4.1.0 + 15.4.3.0 cs diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj index 80e39d0888..137ce91268 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj @@ -6,7 +6,7 @@ CSharp 11 3001,3002,3003,3005,3008,3009,3021,3024 - 15.4.1.0 + 15.4.3.0 cs $(VsSDKTools) diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/AppConfigHelper.fs b/vsintegration/src/FSharp.ProjectSystem.FSharp/AppConfigHelper.fs index cc641682bd..4a8bb83157 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/AppConfigHelper.fs +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/AppConfigHelper.fs @@ -359,10 +359,10 @@ namespace Microsoft.VisualStudio.FSharp.ProjectSystem "3.78.41.0", "3.78.41.0", ["3.78.41.0"] "3.259.4.0", "3.259.41.0", ["3.259.3.1"; "3.259.4.0"] "3.259.41.0", "3.259.41.0", ["3.259.41.0"] - "4.3.0.0", "4.4.1.0", ["2.0.0.0"; "2.3.0.0"; "2.3.5.0"; "4.0.0.0"; "4.3.0.0"] - "4.3.1.0", "4.4.1.0", ["3.3.1.0"; "2.3.5.1"; "3.78.3.1"; "3.259.3.1"; "4.3.1.0"] - "4.4.0.0", "4.4.1.0", ["3.47.4.0"; "3.78.4.0"; "3.259.4.0"; "4.4.0.0"] - "4.4.1.0", "4.4.1.0", ["3.47.41.0"; "3.78.41.0"; "3.259.41.0"; "4.4.0.0"; "4.4.1.0"] + "4.3.0.0", "4.4.3.0", ["2.0.0.0"; "2.3.0.0"; "2.3.5.0"; "4.0.0.0"; "4.3.0.0"] + "4.3.1.0", "4.4.3.0", ["3.3.1.0"; "2.3.5.1"; "3.78.3.1"; "3.259.3.1"; "4.3.1.0"] + "4.4.0.0", "4.4.3.0", ["3.47.4.0"; "3.78.4.0"; "3.259.4.0"; "4.4.0.0"] + "4.4.1.0", "4.4.3.0", ["3.47.41.0"; "3.78.41.0"; "3.259.41.0"; "4.4.0.0"; "4.4.3.0"] ] |> Seq.where(fun (min, max, _) -> targetFSharpCoreVersion >= min && targetFSharpCoreVersion <= max) // some helpers to simplify work with XLinq diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs b/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs index 9e91f0c052..cf2cf8ecc0 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs @@ -45,7 +45,7 @@ namespace rec Microsoft.VisualStudio.FSharp.ProjectSystem [] [] [] - [] + [] do () module internal VSHiveUtilities = @@ -509,7 +509,7 @@ namespace rec Microsoft.VisualStudio.FSharp.ProjectSystem "3.259.3.1"; "3.259.4.0"] // portable 259 |> List.map (fun s -> System.Version(s)) let latestOnlyVersions = - ["4.4.1.0" // .NET 4 desktop + ["4.4.3.0" // .NET 4 desktop "3.47.41.0" // portable 47 "3.7.41.0" // portable 7 "3.78.41.0" // portable 78 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/VSPackage.resx b/vsintegration/src/FSharp.ProjectSystem.FSharp/VSPackage.resx index 70b9cdf465..a9e740e858 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/VSPackage.resx +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/VSPackage.resx @@ -468,10 +468,10 @@ Customizes the environment to maximize code editor screen space and improve the visibility of F# commands and tool windows. - Microsoft Visual F# 4.1 + Microsoft Visual F# 4.3 - Microsoft Visual F# 4.1 + Microsoft Visual F# 4.3 1.0 @@ -480,7 +480,7 @@ Microsoft Visual F# - Visual F# 4.1 + Visual F# 4.3 F# Interactive diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.cs.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.cs.xlf index 191d2145d0..92e34270ea 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.cs.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.cs.xlf @@ -433,13 +433,13 @@ - Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# 4.3 + Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# 4.3 + Microsoft Visual F# 4.1 @@ -453,8 +453,8 @@ - Visual F# 4.1 - Visual F# 4.1 + Visual F# 4.3 + Visual F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf index 33454b90a0..ad58acbe8c 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf @@ -433,13 +433,13 @@ - Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# 4.3 + Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# 4.3 + Microsoft Visual F# 4.1 @@ -453,8 +453,8 @@ - Visual F# 4.1 - Visual F# 4.1 + Visual F# 4.3 + Visual F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.en.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.en.xlf index 8e5a0e5992..33f8437518 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.en.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.en.xlf @@ -433,13 +433,13 @@ - Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# 4.3 + Microsoft Visual F# 4.3 - Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# 4.3 + Microsoft Visual F# 4.3 @@ -453,8 +453,8 @@ - Visual F# 4.1 - Visual F# 4.1 + Visual F# 4.3 + Visual F# 4.3 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.es.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.es.xlf index 34033ccb09..5d8440dac6 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.es.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.es.xlf @@ -433,13 +433,13 @@ - Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# 4.3 + Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# 4.3 + Microsoft Visual F# 4.1 @@ -453,8 +453,8 @@ - Visual F# 4.1 - Visual F# 4.1 + Visual F# 4.3 + Visual F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.fr.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.fr.xlf index 400301c269..3b224b66f8 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.fr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.fr.xlf @@ -433,13 +433,13 @@ - Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# 4.3 + Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# 4.3 + Microsoft Visual F# 4.1 @@ -453,8 +453,8 @@ - Visual F# 4.1 - Visual F# 4.1 + Visual F# 4.3 + Visual F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.it.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.it.xlf index 3ef5dc13ea..c4452c560c 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.it.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.it.xlf @@ -433,13 +433,13 @@ - Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# 4.3 + Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# 4.3 + Microsoft Visual F# 4.1 @@ -453,8 +453,8 @@ - Visual F# 4.1 - Visual F# 4.1 + Visual F# 4.3 + Visual F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf index 2a27c53c5e..5c78991d0a 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf @@ -433,13 +433,13 @@ - Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# 4.3 + Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# 4.3 + Microsoft Visual F# 4.1 @@ -453,8 +453,8 @@ - Visual F# 4.1 - Visual F# 4.1 + Visual F# 4.3 + Visual F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf index f2e22b114c..b7ab2c97d4 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf @@ -433,13 +433,13 @@ - Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# 4.3 + Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# 4.3 + Microsoft Visual F# 4.1 @@ -453,8 +453,8 @@ - Visual F# 4.1 - Visual F# 4.1 + Visual F# 4.3 + Visual F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pl.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pl.xlf index ccc4632b7f..8a3a0dc0bc 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pl.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pl.xlf @@ -433,13 +433,13 @@ - Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# 4.3 + Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# 4.3 + Microsoft Visual F# 4.1 @@ -453,8 +453,8 @@ - Visual F# 4.1 - Visual F# 4.1 + Visual F# 4.3 + Visual F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pt-BR.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pt-BR.xlf index 97dba65330..14f7dd51aa 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pt-BR.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pt-BR.xlf @@ -433,13 +433,13 @@ - Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# 4.3 + Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# 4.3 + Microsoft Visual F# 4.1 @@ -453,8 +453,8 @@ - Visual F# 4.1 - Visual F# 4.1 + Visual F# 4.3 + Visual F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ru.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ru.xlf index 26e822ac34..fcc92564a6 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ru.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ru.xlf @@ -433,13 +433,13 @@ - Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# 4.3 + Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# 4.3 + Microsoft Visual F# 4.1 @@ -453,8 +453,8 @@ - Visual F# 4.1 - Visual F# 4.1 + Visual F# 4.3 + Visual F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf index af0ca367a2..815d48396a 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf @@ -433,13 +433,13 @@ - Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# 4.3 + Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# 4.3 + Microsoft Visual F# 4.1 @@ -453,8 +453,8 @@ - Visual F# 4.1 - Visual F# 4.1 + Visual F# 4.3 + Visual F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hans.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hans.xlf index db397a9c24..3e48a1f913 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hans.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hans.xlf @@ -433,13 +433,13 @@ - Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# 4.3 + Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# 4.3 + Microsoft Visual F# 4.1 @@ -453,8 +453,8 @@ - Visual F# 4.1 - Visual F# 4.1 + Visual F# 4.3 + Visual F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hant.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hant.xlf index 5b1c22417f..148b5f8d97 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hant.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hant.xlf @@ -433,13 +433,13 @@ - Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# 4.3 + Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# 4.3 + Microsoft Visual F# 4.1 @@ -453,8 +453,8 @@ - Visual F# 4.1 - Visual F# 4.1 + Visual F# 4.3 + Visual F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj index ae27650232..1fce9c8a86 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj @@ -4,7 +4,7 @@ $(MSBuildProjectDirectory)\..\..\..\src VisualBasic - 15.4.1.0 + 15.4.3.0 vb diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPage.resx b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPage.resx index bfd51e76d9..e1668f2208 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPage.resx +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPage.resx @@ -661,6 +661,6 @@ ApplicationPropPage - Microsoft.VisualStudio.Editors.PropertyPages.ApplicationPropPageBase, FSharp.ProjectSystem.PropertyPages, Version=15.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Microsoft.VisualStudio.Editors.PropertyPages.ApplicationPropPageBase, FSharp.ProjectSystem.PropertyPages, Version=15.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPage.vb b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPage.vb index b76c242469..fc307096bf 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPage.vb +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPage.vb @@ -80,8 +80,8 @@ Namespace Microsoft.VisualStudio.Editors.PropertyPages Dim v40FSharpRedistKey As String = "HKEY_LOCAL_MACHINE\Software\Microsoft\FSharp\4.0\Runtime\v4.0" #End If #If VS_VERSION_DEV15 Then - Dim v20FSharpRedistKey As String = "HKEY_LOCAL_MACHINE\Software\Microsoft\FSharp\4.1\Runtime\v2.0" - Dim v40FSharpRedistKey As String = "HKEY_LOCAL_MACHINE\Software\Microsoft\FSharp\4.1\Runtime\v4.0" + Dim v20FSharpRedistKey As String = "HKEY_LOCAL_MACHINE\Software\Microsoft\FSharp\4.3\Runtime\v2.0" + Dim v40FSharpRedistKey As String = "HKEY_LOCAL_MACHINE\Software\Microsoft\FSharp\4.3\Runtime\v4.0" #End If m_v20FSharpRedistInstalled = Not (IsNothing(Microsoft.Win32.Registry.GetValue(v20FSharpRedistKey, Nothing, Nothing))) diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/BuildPropPage.resx b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/BuildPropPage.resx index 0c2a860a54..4377119cfe 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/BuildPropPage.resx +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/BuildPropPage.resx @@ -1351,6 +1351,6 @@ BuildPropPage - Microsoft.VisualStudio.Editors.PropertyPages.PropPageUserControlBase, FSharp.ProjectSystem.PropertyPages, Version=15.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Microsoft.VisualStudio.Editors.PropertyPages.PropPageUserControlBase, FSharp.ProjectSystem.PropertyPages, Version=15.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/DebugPropPage.resx b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/DebugPropPage.resx index 14b23d5e90..fab0a10653 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/DebugPropPage.resx +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/DebugPropPage.resx @@ -523,7 +523,7 @@ StartArguments - Microsoft.VisualStudio.Editors.PropertyPages.DebugPropPage+MultilineTextBoxRejectsEnter, FSharp.ProjectSystem.PropertyPages, Version=15.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Microsoft.VisualStudio.Editors.PropertyPages.DebugPropPage+MultilineTextBoxRejectsEnter, FSharp.ProjectSystem.PropertyPages, Version=15.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a overarchingTableLayoutPanel @@ -982,6 +982,6 @@ DebugPropPage - Microsoft.VisualStudio.Editors.PropertyPages.PropPageUserControlBase, FSharp.ProjectSystem.PropertyPages, Version=15.4.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Microsoft.VisualStudio.Editors.PropertyPages.PropPageUserControlBase, FSharp.ProjectSystem.PropertyPages, Version=15.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj b/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj index a4173a6f85..d9890e0b5e 100644 --- a/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj +++ b/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj @@ -4,7 +4,7 @@ $(MSBuildProjectDirectory)\..\..\..\src CSharp - 15.4.1.0 + 15.4.3.0 cs diff --git a/vsintegration/src/SupportedRuntimes/SupportedRuntimes.xml b/vsintegration/src/SupportedRuntimes/SupportedRuntimes.xml index 0c23512c43..6b9322207a 100644 --- a/vsintegration/src/SupportedRuntimes/SupportedRuntimes.xml +++ b/vsintegration/src/SupportedRuntimes/SupportedRuntimes.xml @@ -11,6 +11,7 @@ + diff --git a/vsintegration/tests/unittests/Tests.LanguageService.Script.fs b/vsintegration/tests/unittests/Tests.LanguageService.Script.fs index a43eb1a372..31440789fa 100644 --- a/vsintegration/tests/unittests/Tests.LanguageService.Script.fs +++ b/vsintegration/tests/unittests/Tests.LanguageService.Script.fs @@ -1343,7 +1343,7 @@ type UsingMSBuild() as this = "4.4.0.0" #endif #if VS_VERSION_DEV15 - "4.4.1.0" + "4.4.3.0" #endif let binariesFolder = match Internal.Utilities.FSharpEnvironment.BinFolderOfDefaultFSharpCompiler(None) with | Some(x) -> x diff --git a/vsintegration/tests/unittests/VisualFSharp.Unittests.dll.config b/vsintegration/tests/unittests/VisualFSharp.Unittests.dll.config index 7aae3905c1..4bd17f79c6 100644 --- a/vsintegration/tests/unittests/VisualFSharp.Unittests.dll.config +++ b/vsintegration/tests/unittests/VisualFSharp.Unittests.dll.config @@ -28,7 +28,7 @@ - + diff --git a/vsintegration/update-vsintegration.cmd b/vsintegration/update-vsintegration.cmd index 35dd801433..1add84847d 100644 --- a/vsintegration/update-vsintegration.cmd +++ b/vsintegration/update-vsintegration.cmd @@ -158,8 +158,8 @@ set SN64="%WINSDKNETFXTOOLS%x64\sn.exe" set NGEN32=%windir%\Microsoft.NET\Framework\v4.0.30319\ngen.exe set NGEN64=%windir%\Microsoft.NET\Framework64\v4.0.30319\ngen.exe -set FSHARPVERSION=4.1 -set FSHARPVERSION2=41 +set FSHARPVERSION=4.3 +set FSHARPVERSION2=43 rem The various locations of the SDK and tools From dc0bf5eec3521be8bb6c196af34eb7a3a7e76cec Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Thu, 7 Dec 2017 10:42:56 -0800 Subject: [PATCH 004/147] Merge master to dev15.6 (#4071) * do not simplify open statements (#4068) * Do not trigger completion on operators (#4054) * No triggered completion on operators * Check with classification data instead of stupid custom stuff * Fix silly tests * Feedback --- src/fsharp/NameResolution.fs | 2 + src/fsharp/NameResolution.fsi | 1 + src/fsharp/TypeChecker.fs | 2 +- src/fsharp/symbols/Symbols.fs | 12 +-- src/fsharp/symbols/Symbols.fsi | 3 + .../Completion/CompletionProvider.fs | 10 +-- .../Completion/CompletionUtils.fs | 11 +-- .../SimplifyNameDiagnosticAnalyzer.fs | 1 + .../unittests/CompletionProviderTests.fs | 77 +++++++++++++++++++ 9 files changed, 102 insertions(+), 17 deletions(-) diff --git a/src/fsharp/NameResolution.fs b/src/fsharp/NameResolution.fs index e7326ac115..2b93e3fb1e 100644 --- a/src/fsharp/NameResolution.fs +++ b/src/fsharp/NameResolution.fs @@ -1223,6 +1223,8 @@ type ItemOccurence = | Implemented /// Result gets suppressed over this text range | RelatedText + /// This is a usage of a module or namespace name in open statement + | Open type OpenDeclaration = { LongId: Ident list diff --git a/src/fsharp/NameResolution.fsi b/src/fsharp/NameResolution.fsi index 93f0009ff8..a092b61ffc 100755 --- a/src/fsharp/NameResolution.fsi +++ b/src/fsharp/NameResolution.fsi @@ -246,6 +246,7 @@ type internal ItemOccurence = | Pattern | Implemented | RelatedText + | Open /// Check for equality, up to signature matching val ItemsAreEffectivelyEqual : TcGlobals -> Item -> Item -> bool diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index 1a3d98740f..d250992ecf 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -466,7 +466,7 @@ let OpenModulesOrNamespaces tcSink g amap scopem root env mvvs openDeclaration = loop acc rest for item, range in loop [] (List.rev openDeclaration.LongId) do - CallNameResolutionSink tcSink (range, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Use, env.DisplayEnv, env.eAccessRights) + CallNameResolutionSink tcSink (range, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Open, env.DisplayEnv, env.eAccessRights) env let AddRootModuleOrNamespaceRefs g amap m env modrefs = diff --git a/src/fsharp/symbols/Symbols.fs b/src/fsharp/symbols/Symbols.fs index c97b62e9d4..209151eef4 100644 --- a/src/fsharp/symbols/Symbols.fs +++ b/src/fsharp/symbols/Symbols.fs @@ -2281,11 +2281,11 @@ type FSharpSymbolUse(g:TcGlobals, denv: DisplayEnv, symbol:FSharpSymbol, itemOcc member __.Symbol = symbol member __.DisplayContext = FSharpDisplayContext(fun _ -> denv) member x.IsDefinition = x.IsFromDefinition - member __.IsFromDefinition = (match itemOcc with ItemOccurence.Binding -> true | _ -> false) - member __.IsFromPattern = (match itemOcc with ItemOccurence.Pattern -> true | _ -> false) - member __.IsFromType = (match itemOcc with ItemOccurence.UseInType -> true | _ -> false) - member __.IsFromAttribute = (match itemOcc with ItemOccurence.UseInAttribute -> true | _ -> false) - member __.IsFromDispatchSlotImplementation = (match itemOcc with ItemOccurence.Implemented -> true | _ -> false) + member __.IsFromDefinition = itemOcc = ItemOccurence.Binding + member __.IsFromPattern = itemOcc = ItemOccurence.Pattern + member __.IsFromType = itemOcc = ItemOccurence.UseInType + member __.IsFromAttribute = itemOcc = ItemOccurence.UseInAttribute + member __.IsFromDispatchSlotImplementation = itemOcc = ItemOccurence.Implemented member __.IsFromComputationExpression = match symbol.Item, itemOcc with // 'seq' in 'seq { ... }' gets colored as keywords @@ -2293,7 +2293,7 @@ type FSharpSymbolUse(g:TcGlobals, denv: DisplayEnv, symbol:FSharpSymbol, itemOcc // custom builders, custom operations get colored as keywords | (Item.CustomBuilder _ | Item.CustomOperation _), ItemOccurence.Use -> true | _ -> false - + member __.IsFromOpenStatement = itemOcc = ItemOccurence.Open member __.FileName = range.FileName member __.Range = Range.toZ range member __.RangeAlternate = range diff --git a/src/fsharp/symbols/Symbols.fsi b/src/fsharp/symbols/Symbols.fsi index 2cfd8a2f47..8b3a0e4e6d 100644 --- a/src/fsharp/symbols/Symbols.fsi +++ b/src/fsharp/symbols/Symbols.fsi @@ -1125,6 +1125,9 @@ type internal FSharpSymbolUse = /// Indicates if the reference is either a builder or a custom operation in a computation expression member IsFromComputationExpression : bool + /// Indicates if the reference is in open statement + member IsFromOpenStatement : bool + /// The file name the reference occurs in member FileName: string diff --git a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs index 7825ccc1bd..a7007136f9 100644 --- a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs +++ b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs @@ -84,17 +84,17 @@ type internal FSharpCompletionProvider // Skip if we are not on a completion trigger else let triggerPosition = caretPosition - 1 - let c = sourceText.[triggerPosition] + let triggerChar = sourceText.[triggerPosition] + let prevChar = sourceText.[triggerPosition - 1] // do not trigger completion if it's not single dot, i.e. range expression - if not Settings.IntelliSense.ShowAfterCharIsTyped && sourceText.[triggerPosition - 1] = '.' then + if not Settings.IntelliSense.ShowAfterCharIsTyped && prevChar = '.' then false - - // Trigger completion if we are on a valid classification type else let documentId, filePath, defines = getInfo() CompletionUtils.shouldProvideCompletion(documentId, filePath, defines, sourceText, triggerPosition) && - (c = '.' || (Settings.IntelliSense.ShowAfterCharIsTyped && CompletionUtils.isStartingNewWord(sourceText, triggerPosition))) + (triggerChar = '.' || (Settings.IntelliSense.ShowAfterCharIsTyped && CompletionUtils.isStartingNewWord(sourceText, triggerPosition))) + static member ProvideCompletionsAsyncAux(checker: FSharpChecker, sourceText: SourceText, caretPosition: int, options: FSharpProjectOptions, filePath: string, textVersionHash: int, getAllSymbols: unit -> AssemblySymbol list) = diff --git a/vsintegration/src/FSharp.Editor/Completion/CompletionUtils.fs b/vsintegration/src/FSharp.Editor/Completion/CompletionUtils.fs index a8fe56dbdb..22c976bf72 100644 --- a/vsintegration/src/FSharp.Editor/Completion/CompletionUtils.fs +++ b/vsintegration/src/FSharp.Editor/Completion/CompletionUtils.fs @@ -82,18 +82,19 @@ module internal CompletionUtils = let isStartingNewWord (sourceText, position) = CommonCompletionUtilities.IsStartingNewWord(sourceText, position, (fun ch -> isIdentifierStartCharacter ch), (fun ch -> isIdentifierPartCharacter ch)) - let shouldProvideCompletion (documentId: DocumentId, filePath: string, defines: string list, text: SourceText, position: int) : bool = - let textLines = text.Lines - let triggerLine = textLines.GetLineFromPosition position - let colorizationData = Tokenizer.getColorizationData(documentId, text, triggerLine.Span, Some filePath, defines, CancellationToken.None) + let shouldProvideCompletion (documentId: DocumentId, filePath: string, defines: string list, sourceText: SourceText, triggerPosition: int) : bool = + let textLines = sourceText.Lines + let triggerLine = textLines.GetLineFromPosition triggerPosition + let colorizationData = Tokenizer.getColorizationData(documentId, sourceText, triggerLine.Span, Some filePath, defines, CancellationToken.None) colorizationData.Count = 0 || // we should provide completion at the start of empty line, where there are no tokens at all colorizationData.Exists (fun classifiedSpan -> - classifiedSpan.TextSpan.IntersectsWith position && + classifiedSpan.TextSpan.IntersectsWith triggerPosition && ( match classifiedSpan.ClassificationType with | ClassificationTypeNames.Comment | ClassificationTypeNames.StringLiteral | ClassificationTypeNames.ExcludedCode + | ClassificationTypeNames.Operator | ClassificationTypeNames.NumericLiteral -> false | _ -> true // anything else is a valid classification type )) \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs b/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs index ace07bf57f..cc7c46debb 100644 --- a/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs +++ b/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs @@ -66,6 +66,7 @@ type internal SimplifyNameDiagnosticAnalyzer() = let mutable result = ResizeArray() let symbolUses = symbolUses + |> Array.filter (fun symbolUse -> not symbolUse.IsFromOpenStatement) |> Array.Parallel.map (fun symbolUse -> let lineStr = sourceText.Lines.[Line.toZ symbolUse.RangeAlternate.StartLine].ToString() // for `System.DateTime.Now` it returns ([|"System"; "DateTime"|], "Now") diff --git a/vsintegration/tests/unittests/CompletionProviderTests.fs b/vsintegration/tests/unittests/CompletionProviderTests.fs index 8799801cb3..68776c246e 100644 --- a/vsintegration/tests/unittests/CompletionProviderTests.fs +++ b/vsintegration/tests/unittests/CompletionProviderTests.fs @@ -196,6 +196,83 @@ System.Console.WriteLine() let triggered = FSharpCompletionProvider.ShouldTriggerCompletionAux(SourceText.From(fileContents), caretPosition, CompletionTriggerKind.Insertion, getInfo) Assert.IsFalse(triggered, "FSharpCompletionProvider.ShouldTriggerCompletionAux() should not trigger") +[] +let ShouldNotTriggerCompletionInOperatorWithDot() = + // Simulate mistyping '|>' as '|.' + let fileContents = """ +let f() = + 12.0 |. sqrt +""" + let caretPosition = fileContents.IndexOf("|.") + let documentId = DocumentId.CreateNewId(ProjectId.CreateNewId()) + let getInfo() = documentId, filePath, [] + let triggered = FSharpCompletionProvider.ShouldTriggerCompletionAux(SourceText.From(fileContents), caretPosition, CompletionTriggerKind.Insertion, getInfo) + Assert.IsFalse(triggered, "FSharpCompletionProvider.ShouldTriggerCompletionAux() should not trigger on operators") + +[] +let ShouldTriggerCompletionInAttribute() = + let fileContents = """ +[] +let ShouldTriggerCompletionAfterDerefOperator() = + let fileContents = """ +let foo = ref 12 +printfn "%d" !f +""" + let marker = "!f" + let caretPosition = fileContents.IndexOf(marker) + marker.Length + let documentId = DocumentId.CreateNewId(ProjectId.CreateNewId()) + let getInfo() = documentId, filePath, [] + let triggered = FSharpCompletionProvider.ShouldTriggerCompletionAux(SourceText.From(fileContents), caretPosition, CompletionTriggerKind.Insertion, getInfo) + Assert.IsTrue(triggered, "Completion should trigger after typing an identifier that follows a dereference operator (!).") + +[] +let ShouldTriggerCompletionAfterAddressOfOperator() = + let fileContents = """ +type Point = { mutable X: int; mutable Y: int } +let pnt = { X = 1; Y = 2 } +use ptr = fixed &p +""" + let marker = "&p" + let caretPosition = fileContents.IndexOf(marker) + marker.Length + let documentId = DocumentId.CreateNewId(ProjectId.CreateNewId()) + let getInfo() = documentId, filePath, [] + let triggered = FSharpCompletionProvider.ShouldTriggerCompletionAux(SourceText.From(fileContents), caretPosition, CompletionTriggerKind.Insertion, getInfo) + Assert.IsTrue(triggered, "Completion should trigger after typing an identifier that follows an addressOf operator (&).") + +[] +let ShouldTriggerCompletionAfterArithmeticOperation() = + let fileContents = """ +let xVal = 1.0 +let yVal = 2.0 +let zVal + +xVal+y +xVal-y +xVal*y +xVal/y +xVal%y +xVal**y +""" + + let markers = [ "+y"; "-y"; "*y"; "/y"; "%y"; "**y"] + + for marker in markers do + let caretPosition = fileContents.IndexOf(marker) + marker.Length + let documentId = DocumentId.CreateNewId(ProjectId.CreateNewId()) + let getInfo() = documentId, filePath, [] + let triggered = FSharpCompletionProvider.ShouldTriggerCompletionAux(SourceText.From(fileContents), caretPosition, CompletionTriggerKind.Insertion, getInfo) + Assert.IsTrue(triggered, "Completion should trigger after typing an identifier that follows a mathematical operation") + [] let ShouldDisplayTypeMembers() = let fileContents = """ From 0b05b0cbafe2f1592da7bc22768c4e756ddbbad0 Mon Sep 17 00:00:00 2001 From: Saul Rennison Date: Thu, 7 Dec 2017 21:58:21 +0000 Subject: [PATCH 005/147] [FS-1041] Add IReadOnlyCollection/List/Dictionary implementations to FSharp.Core collections (#4014) * Add IReadOnlyCollection/List/Dictionary implementations to FSharp.Core collections * Add tests, remove FSCORE_PORTABLE_OLD as it's not used anywhere --- .../assemblyinfo.FSharp.Core.dll.fs | 2 - .../Microsoft.FSharp.Collections/ListType.fs | 17 ++++++- .../Microsoft.FSharp.Collections/MapType.fs | 33 ++++++++++++++ .../Microsoft.FSharp.Collections/SetType.fs | 10 +++++ .../Microsoft.FSharp.Control/AsyncModule.fs | 11 +++-- .../Microsoft.FSharp.Core/BigIntType.fs | 3 +- src/fsharp/FSharp.Core/map.fs | 10 +++++ src/fsharp/FSharp.Core/map.fsi | 2 + src/fsharp/FSharp.Core/math/z.fs | 44 ------------------- src/fsharp/FSharp.Core/prim-types.fs | 11 +++-- src/fsharp/FSharp.Core/prim-types.fsi | 4 +- src/fsharp/FSharp.Core/set.fs | 5 ++- src/fsharp/FSharp.Core/set.fsi | 2 +- 13 files changed, 87 insertions(+), 67 deletions(-) diff --git a/src/assemblyinfo/assemblyinfo.FSharp.Core.dll.fs b/src/assemblyinfo/assemblyinfo.FSharp.Core.dll.fs index b0058b3cfd..ea8a5c50c8 100644 --- a/src/assemblyinfo/assemblyinfo.FSharp.Core.dll.fs +++ b/src/assemblyinfo/assemblyinfo.FSharp.Core.dll.fs @@ -9,9 +9,7 @@ open System.Runtime.InteropServices [] [] [] -#if !FSCORE_PORTABLE_OLD [] -#endif #if PORTABLE [] diff --git a/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/ListType.fs b/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/ListType.fs index 452add35fd..f58ed6b350 100644 --- a/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/ListType.fs +++ b/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/ListType.fs @@ -83,7 +83,6 @@ type ListType() = Assert.AreEqual(false, enum.MoveNext()) CheckThrowsInvalidOperationExn(fun () -> enum.Current |> ignore) - #if !FSCORE_PORTABLE_OLD [] member this.IReadOnlyCollection_T() = @@ -100,7 +99,21 @@ type ListType() = let c = [] :> IReadOnlyCollection Assert.AreEqual(c.Count, 0) -#endif + + [] + member this.IReadOnlyList_T() = + + let c = ['a'; 'b'; 'c'] :> IReadOnlyList + + Assert.AreEqual(c.[1], 'b') + + let c = [1..10] :> IReadOnlyList + + Assert.AreEqual(c.[5], 6) + + let c = [] :> IReadOnlyList + + CheckThrowsArgumentException(fun () -> c.[0] |> ignore) // Base class methods [] diff --git a/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/MapType.fs b/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/MapType.fs index f95ce3e47c..5829ed2b5c 100644 --- a/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/MapType.fs +++ b/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/MapType.fs @@ -111,6 +111,27 @@ type MapType() = CheckThrowsKeyNotFoundException(fun () -> id.[1] |> ignore) Assert.AreEqual(id.Keys, [| |] ) Assert.AreEqual(id.Values, [| |] ) + + [] + member this.IReadOnlyDictionary() = + let irod = (Map.ofArray [|(1,1);(2,4);(3,9)|]) :> IReadOnlyDictionary<_,_> + + Assert.IsTrue(irod.ContainsKey(1)) + Assert.IsFalse(irod.ContainsKey(5)) + Assert.AreEqual(irod.[1], 1) + Assert.AreEqual(irod.[3], 9) + Assert.AreEqual(irod.Keys, [| 1; 2; 3|]) + Assert.AreEqual(irod.Values, [| 1; 4; 9|]) + + Assert.IsTrue(irod.TryGetValue(1, ref 1)) + Assert.IsFalse(irod.TryGetValue(100, ref 1)) + + // Empty IROD + let irod = Map.empty :> IReadOnlyDictionary // Note no type args + Assert.IsFalse(irod.ContainsKey(5)) + CheckThrowsKeyNotFoundException(fun () -> irod.[1] |> ignore) + Assert.AreEqual(irod.Keys, [| |] ) + Assert.AreEqual(irod.Values, [| |] ) [] member this.ICollection() = @@ -136,6 +157,18 @@ type MapType() = let newArr = Array.create 5 (new KeyValuePair(0,0)) ic.CopyTo(newArr,0) + [] + member this.IReadOnlyCollection() = + // Legit IROC + let iroc = (Map.ofArray [|(1,1);(2,4);(3,9)|]) :> IReadOnlyCollection> + + Assert.AreEqual(iroc.Count, 3) + + // Empty IROC + let iroc = Map.empty :> IReadOnlyCollection> + + Assert.AreEqual(iroc.Count, 0) + [] member this.IComparable() = // Legit IC diff --git a/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/SetType.fs b/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/SetType.fs index aa556c5aa0..d1cb3710d7 100644 --- a/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/SetType.fs +++ b/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/SetType.fs @@ -99,6 +99,16 @@ type SetType() = Assert.IsFalse(ic.Contains("A") ) let newArr = Array.create 5 "a" ic.CopyTo(newArr,0) + + [] + member this.IReadOnlyCollection() = + // Legit IROC + let iroc = (new Set([1;2;3;4])) :> IReadOnlyCollection + Assert.AreEqual(iroc.Count, 4) + + // Empty IROC + let iroc = (new Set([])) :> IReadOnlyCollection + Assert.AreEqual(iroc.Count, 0) [] member this.IComparable() = diff --git a/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Control/AsyncModule.fs b/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Control/AsyncModule.fs index d0574d52d6..77a9724069 100644 --- a/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Control/AsyncModule.fs +++ b/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Control/AsyncModule.fs @@ -9,7 +9,7 @@ open System open System.Threading open FSharp.Core.Unittests.LibraryTestFx open NUnit.Framework -#if !(FSCORE_PORTABLE_OLD || FSCORE_PORTABLE_NEW) +#if !FSCORE_PORTABLE_NEW open FsCheck #endif @@ -25,7 +25,7 @@ type [] Dummy (x: int) = member this.Dispose () = () -#if !(FSCORE_PORTABLE_OLD || FSCORE_PORTABLE_NEW) +#if !FSCORE_PORTABLE_NEW [] module ChoiceUtils = @@ -417,7 +417,7 @@ type AsyncModule() = Assert.Fail("TimeoutException expected") with :? System.TimeoutException -> () -#if !FSCORE_PORTABLE_OLD + [] member this.``RunSynchronously.NoThreadJumpsAndTimeout.DifferentSyncContexts``() = let run syncContext = @@ -434,7 +434,6 @@ type AsyncModule() = if !failed then Assert.Fail("TimeoutException expected") run null run (System.Threading.SynchronizationContext()) -#endif [] member this.``RaceBetweenCancellationAndError.AwaitWaitHandle``() = @@ -447,7 +446,7 @@ type AsyncModule() = member this.``RaceBetweenCancellationAndError.Sleep``() = testErrorAndCancelRace (Async.Sleep (-5)) -#if !(FSCORE_PORTABLE_OLD || FSCORE_PORTABLE_NEW || coreclr) +#if !(FSCORE_PORTABLE_NEW || coreclr) [] // takes 3 minutes! member this.``Async.Choice specification test``() = ThreadPool.SetMinThreads(100,100) |> ignore @@ -573,7 +572,7 @@ type AsyncModule() = Assert.AreEqual("boom", !r) -#if !FSCORE_PORTABLE_OLD && !FSCORE_PORTABLE_NEW +#if !FSCORE_PORTABLE_NEW [] member this.``SleepContinuations``() = let okCount = ref 0 diff --git a/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Core/BigIntType.fs b/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Core/BigIntType.fs index d3dfeb3c64..d9cfc9ee42 100644 --- a/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Core/BigIntType.fs +++ b/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Core/BigIntType.fs @@ -198,7 +198,7 @@ type BigIntType() = Assert.AreEqual(BigInteger.One,1I) () -#if !FSCORE_PORTABLE_OLD + [] member this.Parse() = Assert.AreEqual(BigInteger.Parse("12345678901234567890"), @@ -220,7 +220,6 @@ type BigIntType() = CheckThrowsArgumentNullException(fun() -> BigInteger.Parse(null) |> ignore) () -#endif [] member this.Pow() = diff --git a/src/fsharp/FSharp.Core/map.fs b/src/fsharp/FSharp.Core/map.fs index fd8012c170..97c747e4ae 100644 --- a/src/fsharp/FSharp.Core/map.fs +++ b/src/fsharp/FSharp.Core/map.fs @@ -612,6 +612,16 @@ namespace Microsoft.FSharp.Collections | _ -> invalidArg "obj" (SR.GetString(SR.notComparable)) + interface IReadOnlyCollection> with + member s.Count = s.Count + + interface IReadOnlyDictionary<'Key, 'Value> with + member s.Item with get(key) = s.[key] + member s.Keys = seq { for kvp in s -> kvp.Key } + member s.TryGetValue(key, value) = if s.ContainsKey(key) then (value <- s.[key]; true) else false + member s.Values = seq { for kvp in s -> kvp.Value } + member s.ContainsKey key = s.ContainsKey key + override x.ToString() = match List.ofSeq (Seq.truncate 4 x) with | [] -> "map []" diff --git a/src/fsharp/FSharp.Core/map.fsi b/src/fsharp/FSharp.Core/map.fsi index 959acd0316..ca60206900 100644 --- a/src/fsharp/FSharp.Core/map.fsi +++ b/src/fsharp/FSharp.Core/map.fsi @@ -61,6 +61,8 @@ namespace Microsoft.FSharp.Collections interface IEnumerable> interface System.IComparable interface System.Collections.IEnumerable + interface IReadOnlyCollection> + interface IReadOnlyDictionary<'Key,'Value> override Equals : obj -> bool /// Functional programming operators related to the Map<_,_> type. diff --git a/src/fsharp/FSharp.Core/math/z.fs b/src/fsharp/FSharp.Core/math/z.fs index 587c5280a4..0527143491 100644 --- a/src/fsharp/FSharp.Core/math/z.fs +++ b/src/fsharp/FSharp.Core/math/z.fs @@ -402,49 +402,6 @@ namespace Microsoft.FSharp.Core if ok then res else -#if FSCORE_PORTABLE_OLD - // SL5 (and therefore Portable Profile47) does not have Parse, so make our own simple implementation - let parse(s : string) = - // ws* sign? digits+ ws* - let mutable i = 0 - // leading whitespace - while i < s.Length && System.Char.IsWhiteSpace(s.[i]) do - i <- i + 1 - if i = s.Length then - raise <| new System.ArgumentException() - // optional sign - let mutable isNegative = false - if s.[i] = '+' then - i <- i + 1 - elif s.[i] = '-' then - isNegative <- true - i <- i + 1 - if i = s.Length then - raise <| new System.ArgumentException() - // digits - let startDigits = i - while i < s.Length && System.Char.IsDigit(s.[i]) do - i <- i + 1 - let endDigits = i - let len = endDigits - startDigits - if len = 0 then - raise <| new System.ArgumentException() - // trailing whitespace - while i < s.Length && System.Char.IsWhiteSpace(s.[i]) do - i <- i + 1 - if i <> s.Length then - raise <| new System.ArgumentException() - // text is now valid, parse it - let mutable r = new System.Numerics.BigInteger(int(s.[startDigits]) - int('0')) - let ten = new System.Numerics.BigInteger(10) - for j in startDigits+1 .. endDigits-1 do - r <- r * ten - r <- r + new System.Numerics.BigInteger(int(s.[j]) - int('0')) - if isNegative then - r <- new System.Numerics.BigInteger(0) - r - r - let v = parse s -#else let v = #if FX_NO_BIGINT BigInteger.Parse s @@ -453,7 +410,6 @@ namespace Microsoft.FSharp.Core BigInteger.Parse (s.[2..],NumberStyles.AllowHexSpecifier,CultureInfo.InvariantCulture) else BigInteger.Parse (s,NumberStyles.AllowLeadingSign,CultureInfo.InvariantCulture) -#endif #endif res <- v tabParse.[s] <- res diff --git a/src/fsharp/FSharp.Core/prim-types.fs b/src/fsharp/FSharp.Core/prim-types.fs index 36ae18b7ae..6fc939898c 100644 --- a/src/fsharp/FSharp.Core/prim-types.fs +++ b/src/fsharp/FSharp.Core/prim-types.fs @@ -3034,10 +3034,8 @@ namespace Microsoft.FSharp.Collections | (::) : Head: 'T * Tail: 'T list -> 'T list interface System.Collections.Generic.IEnumerable<'T> interface System.Collections.IEnumerable - -#if !FSCORE_PORTABLE_OLD interface System.Collections.Generic.IReadOnlyCollection<'T> -#endif + interface System.Collections.Generic.IReadOnlyList<'T> and 'T list = List<'T> @@ -3220,11 +3218,12 @@ namespace Microsoft.FSharp.Collections interface System.Collections.IEnumerable with member l.GetEnumerator() = (PrivateListHelpers.mkListEnumerator l :> System.Collections.IEnumerator) - -#if !FSCORE_PORTABLE_OLD + interface IReadOnlyCollection<'T> with member l.Count = l.Length -#endif + + interface IReadOnlyList<'T> with + member l.Item with get(index) = l.[index] type seq<'T> = IEnumerable<'T> diff --git a/src/fsharp/FSharp.Core/prim-types.fsi b/src/fsharp/FSharp.Core/prim-types.fsi index 9d3eabf7f7..3b8d5d0526 100644 --- a/src/fsharp/FSharp.Core/prim-types.fsi +++ b/src/fsharp/FSharp.Core/prim-types.fsi @@ -1702,10 +1702,8 @@ namespace Microsoft.FSharp.Collections interface System.Collections.Generic.IEnumerable<'T> interface System.Collections.IEnumerable - -#if !FSCORE_PORTABLE_OLD interface System.Collections.Generic.IReadOnlyCollection<'T> -#endif + interface System.Collections.Generic.IReadOnlyList<'T> /// An abbreviation for the type of immutable singly-linked lists. /// diff --git a/src/fsharp/FSharp.Core/set.fs b/src/fsharp/FSharp.Core/set.fs index a05d852755..72ac3ed908 100644 --- a/src/fsharp/FSharp.Core/set.fs +++ b/src/fsharp/FSharp.Core/set.fs @@ -711,7 +711,10 @@ namespace Microsoft.FSharp.Collections member s.Contains(x) = SetTree.mem s.Comparer x s.Tree member s.CopyTo(arr,i) = SetTree.copyToArray s.Tree arr i member s.IsReadOnly = true - member s.Count = SetTree.count s.Tree + member s.Count = s.Count + + interface IReadOnlyCollection<'T> with + member s.Count = s.Count interface IEnumerable<'T> with member s.GetEnumerator() = SetTree.mkIEnumerator s.Tree diff --git a/src/fsharp/FSharp.Core/set.fsi b/src/fsharp/FSharp.Core/set.fsi index e9dc5d4d6d..9293a52331 100644 --- a/src/fsharp/FSharp.Core/set.fsi +++ b/src/fsharp/FSharp.Core/set.fsi @@ -93,8 +93,8 @@ namespace Microsoft.FSharp.Collections interface ICollection<'T> interface IEnumerable<'T> interface System.Collections.IEnumerable - interface System.IComparable + interface IReadOnlyCollection<'T> override Equals : obj -> bool From aa5307e4b7eec35f4d77644a612a027e2c92a02b Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Fri, 8 Dec 2017 12:52:55 -0800 Subject: [PATCH 006/147] Merge master to dev15.6 (#4076) * do not simplify open statements (#4068) * Do not trigger completion on operators (#4054) * No triggered completion on operators * Check with classification data instead of stupid custom stuff * Fix silly tests * Feedback From 981f5a4a25d4bc160ba14ec18247f5bb3b8da465 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Mon, 11 Dec 2017 11:09:21 -0800 Subject: [PATCH 007/147] Update TypeChecker.fs --- src/fsharp/TypeChecker.fs | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index d461f5767f..be9bd01a54 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -447,26 +447,6 @@ let OpenModulesOrNamespaces tcSink g amap scopem root env mvvs openDeclaration = ModifyNameResEnv (fun nenv -> AddModulesAndNamespacesContentsToNameEnv g amap env.eAccessRights scopem root nenv mvvs) env CallEnvSink tcSink (scopem, env.NameEnv, env.eAccessRights) CallOpenDeclarationSink tcSink openDeclaration - match openDeclaration.Range with - | None -> () - | Some _ -> - let rec loop (acc: (Item * range) list) (idents: Ident list) = - match idents with - | [] -> acc - | [id] when id.idText = MangledGlobalName -> acc - | id :: rest -> - let idents = List.rev idents - let range = id.idRange - let acc = - match ResolveLongIndentAsModuleOrNamespace ResultCollectionSettings.AllResults amap range OpenQualified env.NameEnv env.eAccessRights idents with - | Result modrefs -> - (acc, modrefs) ||> List.fold (fun acc (_, modref, _) -> - (Item.ModuleOrNamespaces [modref], range) :: acc) - | _ -> acc - loop acc rest - - for item, range in loop [] (List.rev openDeclaration.LongId) do - CallNameResolutionSink tcSink (range, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Open, env.DisplayEnv, env.eAccessRights) env let AddRootModuleOrNamespaceRefs g amap m env modrefs = From 5d5a2d294bd5ed1cfb0e264023a942b3d792fb61 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Thu, 14 Dec 2017 17:05:48 -0800 Subject: [PATCH 008/147] update binding redirects to match new assembly versions (#4118) --- src/fsharp/Fsc/app.config | 2 +- src/fsharp/fsi/app.config | 2 +- src/fsharp/fsiAnyCpu/app.config | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fsharp/Fsc/app.config b/src/fsharp/Fsc/app.config index 493b8a7276..4e10e78a90 100644 --- a/src/fsharp/Fsc/app.config +++ b/src/fsharp/Fsc/app.config @@ -6,7 +6,7 @@ - + diff --git a/src/fsharp/fsi/app.config b/src/fsharp/fsi/app.config index 6ae94a8e65..7e6dfe3009 100644 --- a/src/fsharp/fsi/app.config +++ b/src/fsharp/fsi/app.config @@ -5,7 +5,7 @@ - + diff --git a/src/fsharp/fsiAnyCpu/app.config b/src/fsharp/fsiAnyCpu/app.config index 1308027da2..26007af4c5 100644 --- a/src/fsharp/fsiAnyCpu/app.config +++ b/src/fsharp/fsiAnyCpu/app.config @@ -6,7 +6,7 @@ - + From 72281393fcdbab99fb18c7da64b10374d6571162 Mon Sep 17 00:00:00 2001 From: mjmckp Date: Sat, 16 Dec 2017 07:20:49 +1100 Subject: [PATCH 009/147] [FS-1044] Add NativePtr.toByRef (#3691) * Add toByref * Add signature for toByref * toByref -> toByRef * toByref -> toByRef * Add equivalent test for NativePtr.toByref * Add corresponding test for NativePtr.toByRef * Add corresponding test for NativePtr.toByRef * Add corresponding test for NativePtr.toByRef --- src/fsharp/FSharp.Core/nativeptr.fs | 3 +++ src/fsharp/FSharp.Core/nativeptr.fsi | 8 ++++++++ .../Core/NativeInterop/stackalloc/ofDateTime01.fs | 9 +++++++++ .../Libraries/Core/NativeInterop/stackalloc/ofenum01.fs | 9 +++++++++ .../Libraries/Core/NativeInterop/stackalloc/ofint01.fs | 9 +++++++++ .../Libraries/Core/NativeInterop/stackalloc/ofint6401.fs | 9 +++++++++ 6 files changed, 47 insertions(+) diff --git a/src/fsharp/FSharp.Core/nativeptr.fs b/src/fsharp/FSharp.Core/nativeptr.fs index bb70928c47..29e2ecb67a 100644 --- a/src/fsharp/FSharp.Core/nativeptr.fs +++ b/src/fsharp/FSharp.Core/nativeptr.fs @@ -49,3 +49,6 @@ module NativePtr = [] let inline stackalloc (count:int) : nativeptr<'T> = (# "localloc" (count * sizeof<'T>) : nativeptr<'T> #) + [] + [] + let inline toByRef (address: nativeptr<'T>) : byref<'T> = (# "" address : 'T byref #) diff --git a/src/fsharp/FSharp.Core/nativeptr.fsi b/src/fsharp/FSharp.Core/nativeptr.fsi index 0a5b959ff6..47a0509e71 100644 --- a/src/fsharp/FSharp.Core/nativeptr.fsi +++ b/src/fsharp/FSharp.Core/nativeptr.fsi @@ -81,3 +81,11 @@ namespace Microsoft.FSharp.NativeInterop [] [] val inline stackalloc : count:int -> nativeptr<'T> + + /// Converts a given typed native pointer to a managed pointer. + /// The input pointer. + /// The managed pointer. + [] + [] + [] + val inline toByRef : nativeptr<'T> -> byref<'T> diff --git a/tests/fsharpqa/Source/Libraries/Core/NativeInterop/stackalloc/ofDateTime01.fs b/tests/fsharpqa/Source/Libraries/Core/NativeInterop/stackalloc/ofDateTime01.fs index a58902665f..19c259bb0c 100644 --- a/tests/fsharpqa/Source/Libraries/Core/NativeInterop/stackalloc/ofDateTime01.fs +++ b/tests/fsharpqa/Source/Libraries/Core/NativeInterop/stackalloc/ofDateTime01.fs @@ -15,4 +15,13 @@ module M3 = if not (NativeInterop.NativePtr.get data i = now) then noerr <- false + let later = now.AddDays 1. + for i = 0 to 99 do + let datai = NativeInterop.NativePtr.toByRef (NativeInterop.NativePtr.add data i) + datai <- later + for i = 0 to 99 do + let datai = NativeInterop.NativePtr.toByRef (NativeInterop.NativePtr.add data i) + if not (datai = later) then + noerr <- false + (if noerr then 0 else 1) |> exit diff --git a/tests/fsharpqa/Source/Libraries/Core/NativeInterop/stackalloc/ofenum01.fs b/tests/fsharpqa/Source/Libraries/Core/NativeInterop/stackalloc/ofenum01.fs index d10b2b7051..885f3b88ac 100644 --- a/tests/fsharpqa/Source/Libraries/Core/NativeInterop/stackalloc/ofenum01.fs +++ b/tests/fsharpqa/Source/Libraries/Core/NativeInterop/stackalloc/ofenum01.fs @@ -19,4 +19,13 @@ module M6 = if not (NativeInterop.NativePtr.get data i = (if (i % 2)=0 then E.A else E.B)) then noerr <- false + for i = 0 to 9 do + let datai = NativeInterop.NativePtr.toByRef (NativeInterop.NativePtr.add data i) + datai <- (if (i % 2)=1 then E.A else E.B) + + for i = 0 to 9 do + let datai = NativeInterop.NativePtr.toByRef (NativeInterop.NativePtr.add data i) + if not (datai = (if (i % 2)=1 then E.A else E.B)) then + noerr <- false + (if noerr then 0 else 1) |> exit diff --git a/tests/fsharpqa/Source/Libraries/Core/NativeInterop/stackalloc/ofint01.fs b/tests/fsharpqa/Source/Libraries/Core/NativeInterop/stackalloc/ofint01.fs index a882d32448..e81be3fa1b 100644 --- a/tests/fsharpqa/Source/Libraries/Core/NativeInterop/stackalloc/ofint01.fs +++ b/tests/fsharpqa/Source/Libraries/Core/NativeInterop/stackalloc/ofint01.fs @@ -16,5 +16,14 @@ module M1 = if not (NativeInterop.NativePtr.get data i = (i*i)) then noerr <- false + for i = 0 to 99 do + let datai = NativeInterop.NativePtr.toByRef (NativeInterop.NativePtr.add data i) + datai <- 1-i + + for i = 0 to 99 do + let datai = NativeInterop.NativePtr.toByRef (NativeInterop.NativePtr.add data i) + if not (datai = 1-i) then + noerr <- false + (if noerr then 0 else 1) |> exit diff --git a/tests/fsharpqa/Source/Libraries/Core/NativeInterop/stackalloc/ofint6401.fs b/tests/fsharpqa/Source/Libraries/Core/NativeInterop/stackalloc/ofint6401.fs index 182b80f3e4..401855c5de 100644 --- a/tests/fsharpqa/Source/Libraries/Core/NativeInterop/stackalloc/ofint6401.fs +++ b/tests/fsharpqa/Source/Libraries/Core/NativeInterop/stackalloc/ofint6401.fs @@ -14,5 +14,14 @@ module M2 = if not (NativeInterop.NativePtr.get data i = (int64 (i*i))) then noerr <- false + for i = 0 to 99 do + let datai = NativeInterop.NativePtr.toByRef (NativeInterop.NativePtr.add data i) + datai <- int64 (1-i) + + for i = 0 to 99 do + let datai = NativeInterop.NativePtr.toByRef (NativeInterop.NativePtr.add data i) + if not (datai = int64 (1-i)) then + noerr <- false + (if noerr then 0 else 1) |> exit From 4054701c43f19e233458dd4c727aa9e212dd854e Mon Sep 17 00:00:00 2001 From: Onur Gumus Date: Sat, 16 Dec 2017 00:26:39 +0400 Subject: [PATCH 010/147] [RFC FS-1028] - Implement Async.StartImmediateAsTask (#2534) Thank you for this contribution Kevin --- .../Microsoft.FSharp.Control/AsyncType.fs | 96 +++++++++++++++++++ src/fsharp/FSharp.Core/control.fs | 11 +++ src/fsharp/FSharp.Core/control.fsi | 17 ++++ 3 files changed, 124 insertions(+) diff --git a/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Control/AsyncType.fs b/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Control/AsyncType.fs index c1cfe673bf..400c713355 100644 --- a/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Control/AsyncType.fs +++ b/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Control/AsyncType.fs @@ -275,6 +275,102 @@ type AsyncType() = Assert.IsTrue(t.IsCanceled) Assert.IsTrue(!cancelled) + [] + member this.CreateImmediateAsTask () = + let s = "Hello tasks!" + let a = async { return s } +#if FSCORE_PORTABLE_NEW || coreclr + let t : Task = +#else + use t : Task = +#endif + Async.StartImmediateAsTask a + this.WaitASec t + Assert.IsTrue (t.IsCompleted) + Assert.AreEqual(s, t.Result) + + [] + member this.StartImmediateAsTask () = + let s = "Hello tasks!" + let a = async { return s } +#if FSCORE_PORTABLE_NEW || coreclr + let t = +#else + use t = +#endif + Async.StartImmediateAsTask a + this.WaitASec t + Assert.IsTrue (t.IsCompleted) + Assert.AreEqual(s, t.Result) + + + [] + member this.ExceptionPropagatesToImmediateTask () = + let a = async { + do raise (Exception ()) + } +#if FSCORE_PORTABLE_NEW || coreclr + let t = +#else + use t = +#endif + Async.StartImmediateAsTask a + let mutable exceptionThrown = false + try + this.WaitASec t + with + e -> exceptionThrown <- true + Assert.IsTrue (t.IsFaulted) + Assert.IsTrue(exceptionThrown) + + [] + member this.CancellationPropagatesToImmediateTask () = + let a = async { + while true do () + } +#if FSCORE_PORTABLE_NEW || coreclr + let t = +#else + use t = +#endif + Async.StartImmediateAsTask a + Async.CancelDefaultToken () + let mutable exceptionThrown = false + try + this.WaitASec t + with e -> exceptionThrown <- true + Assert.IsTrue (exceptionThrown) + Assert.IsTrue(t.IsCanceled) + + [] + member this.CancellationPropagatesToGroupImmediate () = + let ewh = new ManualResetEvent(false) + let cancelled = ref false + let a = async { + use! holder = Async.OnCancel (fun _ -> cancelled := true) + ewh.Set() |> Assert.IsTrue + while true do () + } + let cts = new CancellationTokenSource() + let token = cts.Token +#if FSCORE_PORTABLE_NEW || coreclr + let t = +#else + use t = +#endif + Async.StartImmediateAsTask(a, cancellationToken=token) +// printfn "%A" t.Status + ewh.WaitOne() |> Assert.IsTrue + cts.Cancel() +// printfn "%A" t.Status + let mutable exceptionThrown = false + try + this.WaitASec t + with e -> exceptionThrown <- true + Assert.IsTrue (exceptionThrown) + Assert.IsTrue(t.IsCanceled) + Assert.IsTrue(!cancelled) + [] member this.TaskAsyncValue () = diff --git a/src/fsharp/FSharp.Core/control.fs b/src/fsharp/FSharp.Core/control.fs index a614813e4b..aac964744e 100644 --- a/src/fsharp/FSharp.Core/control.fs +++ b/src/fsharp/FSharp.Core/control.fs @@ -1218,6 +1218,17 @@ namespace Microsoft.FSharp.Control static member StartWithContinuations(computation:Async<'T>, continuation, exceptionContinuation, cancellationContinuation, ?cancellationToken) : unit = Async.StartWithContinuationsUsingDispatchInfo(computation, continuation, (fun edi -> exceptionContinuation (edi.GetAssociatedSourceException())), cancellationContinuation, ?cancellationToken=cancellationToken) + static member StartImmediateAsTask (computation : Async<'T>, ?cancellationToken ) : Task<'T>= + let token = defaultArg cancellationToken defaultCancellationTokenSource.Token + let ts = new TaskCompletionSource<'T>() + let task = ts.Task + Async.StartWithContinuations( + computation, + (fun (k) -> ts.SetResult(k)), + (fun exn -> ts.SetException(exn)), + (fun _ -> ts.SetCanceled()), + token) + task static member StartImmediate(computation:Async, ?cancellationToken) : unit = let token = defaultArg cancellationToken defaultCancellationTokenSource.Token CancellationTokenOps.StartWithContinuations(token, computation, id, (fun edi -> edi.ThrowAny()), ignore) diff --git a/src/fsharp/FSharp.Core/control.fsi b/src/fsharp/FSharp.Core/control.fsi index 77be1ceae1..99a50852cb 100644 --- a/src/fsharp/FSharp.Core/control.fsi +++ b/src/fsharp/FSharp.Core/control.fsi @@ -415,6 +415,23 @@ namespace Microsoft.FSharp.Control computation:Async * ?cancellationToken:CancellationToken-> unit + /// Runs an asynchronous computation, starting immediately on the current operating system, + /// but also returns the execution as System.Threading.Tasks.Task + /// + /// If no cancellation token is provided then the default cancellation token is used. + /// You may prefer using this method if you want to achive a similar behviour to async await in C# as + /// async computation starts on the current thread with an ability to return a result. + /// + /// The asynchronous computation to execute. + /// The CancellationToken to associate with the computation. + /// The default is used if this parameter is not provided. + /// A System.Threading.Tasks.Task that will be completed + /// in the corresponding state once the computation terminates (produces the result, throws exception or gets canceled) + /// + static member StartImmediateAsTask: + computation:Async<'T> * ?cancellationToken:CancellationToken-> Task<'T> + + [] [] From a2c1bc0832f5aaa8d7cd01e0bc14004bf581eb12 Mon Sep 17 00:00:00 2001 From: Patrick McDonald Date: Mon, 18 Dec 2017 16:34:10 +0000 Subject: [PATCH 011/147] [FS-1042] Implement transpose on Seq, List and Array (#4020) * Implement transpose on Seq, List and Array * Fix transpose list of empty lists * Update signatures of List.transpose and Array.transpose * Avoid clone when Array.transpose called with an array * Update implentation of Seq.transpose --- .../ArrayModule2.fs | 25 +++++++ .../ListModule2.fs | 21 ++++++ .../SeqModule2.fs | 27 +++++++- .../SurfaceArea.coreclr.fs | 3 + .../SurfaceArea.net40.fs | 3 + src/fsharp/FSharp.Core/array.fs | 23 +++++++ src/fsharp/FSharp.Core/array.fsi | 8 +++ src/fsharp/FSharp.Core/list.fs | 15 +++-- src/fsharp/FSharp.Core/list.fsi | 8 +++ src/fsharp/FSharp.Core/local.fs | 65 +++++++++++++++++++ src/fsharp/FSharp.Core/local.fsi | 1 + src/fsharp/FSharp.Core/seq.fs | 9 ++- src/fsharp/FSharp.Core/seq.fsi | 10 +++ 13 files changed, 212 insertions(+), 6 deletions(-) diff --git a/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/ArrayModule2.fs b/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/ArrayModule2.fs index 4df85c5ef0..e057bd126f 100644 --- a/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/ArrayModule2.fs +++ b/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/ArrayModule2.fs @@ -921,6 +921,31 @@ type ArrayModule2() = () + [] + member this.Transpose() = + // integer array + Assert.AreEqual([|[|1;4|]; [|2;5|]; [|3;6|]|], Array.transpose (seq [[|1..3|]; [|4..6|]])) + Assert.AreEqual([|[|1|]; [|2|]; [|3|]|], Array.transpose [|[|1..3|]|]) + Assert.AreEqual([|[|1..2|]|], Array.transpose [|[|1|]; [|2|]|]) + + // string array + Assert.AreEqual([|[|"a";"d"|]; [|"b";"e"|]; [|"c";"f"|]|], Array.transpose (seq [[|"a";"b";"c"|]; [|"d";"e";"f"|]])) + + // empty array + Assert.AreEqual([| |], Array.transpose [| |]) + + // array of empty arrays - m x 0 array transposes to 0 x m (i.e. empty) + Assert.AreEqual([| |], Array.transpose [| [||] |]) + Assert.AreEqual([| |], Array.transpose [| [||]; [||] |]) + + // null array + let nullArr = null: string[][] + CheckThrowsArgumentNullException (fun () -> nullArr |> Array.transpose |> ignore) + + // jagged arrays + CheckThrowsArgumentException (fun () -> Array.transpose [| [|1; 2|]; [|3|] |] |> ignore) + CheckThrowsArgumentException (fun () -> Array.transpose [| [|1|]; [|2; 3|] |] |> ignore) + [] member this.Truncate() = // integer array diff --git a/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/ListModule2.fs b/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/ListModule2.fs index 3ebec0af3c..e1672fe36a 100644 --- a/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/ListModule2.fs +++ b/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/ListModule2.fs @@ -813,6 +813,27 @@ type ListModule02() = () + [] + member this.Transpose() = + // integer list + Assert.AreEqual([[1; 4]; [2; 5]; [3; 6]], List.transpose (seq [[1..3]; [4..6]])) + Assert.AreEqual([[1]; [2]; [3]], List.transpose [[1..3]]) + Assert.AreEqual([[1..2]], List.transpose [[1]; [2]]) + + // string list + Assert.AreEqual([["a";"d"]; ["b";"e"]; ["c";"f"]], List.transpose (seq [["a";"b";"c"]; ["d";"e";"f"]])) + + // empty list + Assert.AreEqual([], List.transpose []) + + // list of empty lists - m x 0 list transposes to 0 x m (i.e. empty) + Assert.AreEqual([], List.transpose [[]]) + Assert.AreEqual([], List.transpose [[]; []]) + + // jagged lists + CheckThrowsArgumentException (fun () -> List.transpose [[1; 2]; [3]] |> ignore) + CheckThrowsArgumentException (fun () -> List.transpose [[1]; [2; 3]] |> ignore) + [] member this.Truncate() = // integer list diff --git a/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/SeqModule2.fs b/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/SeqModule2.fs index 102c045c6e..62de650bac 100644 --- a/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/SeqModule2.fs +++ b/src/fsharp/FSharp.Core.Unittests/FSharp.Core/Microsoft.FSharp.Collections/SeqModule2.fs @@ -1522,7 +1522,32 @@ type SeqModule2() = // null Seq CheckThrowsArgumentNullException(fun() -> Seq.toList null |> ignore) () - + + [] + member this.Transpose() = + // integer seq + VerifySeqsEqual [seq [1; 4]; seq [2; 5]; seq [3; 6]] <| Seq.transpose (seq [seq {1..3}; seq {4..6}]) + VerifySeqsEqual [seq [1]; seq [2]; seq [3]] <| Seq.transpose (seq [seq {1..3}]) + VerifySeqsEqual [seq {1..2}] <| Seq.transpose (seq [seq [1]; seq [2]]) + + // string seq + VerifySeqsEqual [seq ["a";"d"]; seq ["b";"e"]; seq ["c";"f"]] <| Seq.transpose (seq [seq ["a";"b";"c"]; seq ["d";"e";"f"]]) + + // empty seq + VerifySeqsEqual Seq.empty <| Seq.transpose Seq.empty + + // seq of empty seqs - m x 0 seq transposes to 0 x m (i.e. empty) + VerifySeqsEqual Seq.empty <| Seq.transpose (seq [Seq.empty]) + VerifySeqsEqual Seq.empty <| Seq.transpose (seq [Seq.empty; Seq.empty]) + + // null seq + let nullSeq = null : seq> + CheckThrowsArgumentNullException (fun () -> Seq.transpose nullSeq |> ignore) + + // sequences of lists + VerifySeqsEqual [seq ["a";"c"]; seq ["b";"d"]] <| Seq.transpose [["a";"b"]; ["c";"d"]] + VerifySeqsEqual [seq ["a";"c"]; seq ["b";"d"]] <| Seq.transpose (seq { yield ["a";"b"]; yield ["c";"d"] }) + [] member this.Truncate() = // integer Seq diff --git a/src/fsharp/FSharp.Core.Unittests/SurfaceArea.coreclr.fs b/src/fsharp/FSharp.Core.Unittests/SurfaceArea.coreclr.fs index c762979fd6..46c3d02d01 100644 --- a/src/fsharp/FSharp.Core.Unittests/SurfaceArea.coreclr.fs +++ b/src/fsharp/FSharp.Core.Unittests/SurfaceArea.coreclr.fs @@ -177,6 +177,7 @@ Microsoft.FSharp.Collections.ArrayModule: T[] Where[T](Microsoft.FSharp.Core.FSh Microsoft.FSharp.Collections.ArrayModule: T[] ZeroCreate[T](Int32) Microsoft.FSharp.Collections.ArrayModule: T[][] ChunkBySize[T](Int32, T[]) Microsoft.FSharp.Collections.ArrayModule: T[][] SplitInto[T](Int32, T[]) +Microsoft.FSharp.Collections.ArrayModule: T[][] Transpose[T](System.Collections.Generic.IEnumerable`1[T[]]) Microsoft.FSharp.Collections.ArrayModule: T[][] Windowed[T](Int32, T[]) Microsoft.FSharp.Collections.ArrayModule: Void CopyTo[T](T[], Int32, T[], Int32, Int32) Microsoft.FSharp.Collections.ArrayModule: Void Fill[T](T[], Int32, Int32, T) @@ -307,6 +308,7 @@ Microsoft.FSharp.Collections.ListModule: Int32 GetHashCode() Microsoft.FSharp.Collections.ListModule: Int32 Length[T](Microsoft.FSharp.Collections.FSharpList`1[T]) Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Collections.FSharpList`1[T]] ChunkBySize[T](Int32, Microsoft.FSharp.Collections.FSharpList`1[T]) Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Collections.FSharpList`1[T]] SplitInto[T](Int32, Microsoft.FSharp.Collections.FSharpList`1[T]) +Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Collections.FSharpList`1[T]] Transpose[T](System.Collections.Generic.IEnumerable`1[Microsoft.FSharp.Collections.FSharpList`1[T]]) Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Collections.FSharpList`1[T]] Windowed[T](Int32, Microsoft.FSharp.Collections.FSharpList`1[T]) Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[System.Int32,T]] Indexed[T](Microsoft.FSharp.Collections.FSharpList`1[T]) Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[T,T]] Pairwise[T](Microsoft.FSharp.Collections.FSharpList`1[T]) @@ -446,6 +448,7 @@ Microsoft.FSharp.Collections.SeqModule: Microsoft.FSharp.Core.FSharpOption`1[T] Microsoft.FSharp.Collections.SeqModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryHead[T](System.Collections.Generic.IEnumerable`1[T]) Microsoft.FSharp.Collections.SeqModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryItem[T](Int32, System.Collections.Generic.IEnumerable`1[T]) Microsoft.FSharp.Collections.SeqModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryLast[T](System.Collections.Generic.IEnumerable`1[T]) +Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[T]] Transpose[TCollection,T](System.Collections.Generic.IEnumerable`1[TCollection]) Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[System.Tuple`2[System.Int32,T]] Indexed[T](System.Collections.Generic.IEnumerable`1[T]) Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[System.Tuple`2[T,T]] Pairwise[T](System.Collections.Generic.IEnumerable`1[T]) Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[System.Tuple`2[T1,T2]] AllPairs[T1,T2](System.Collections.Generic.IEnumerable`1[T1], System.Collections.Generic.IEnumerable`1[T2]) diff --git a/src/fsharp/FSharp.Core.Unittests/SurfaceArea.net40.fs b/src/fsharp/FSharp.Core.Unittests/SurfaceArea.net40.fs index 7db771e825..78785fa9cf 100644 --- a/src/fsharp/FSharp.Core.Unittests/SurfaceArea.net40.fs +++ b/src/fsharp/FSharp.Core.Unittests/SurfaceArea.net40.fs @@ -176,6 +176,7 @@ Microsoft.FSharp.Collections.ArrayModule: T[] Where[T](Microsoft.FSharp.Core.FSh Microsoft.FSharp.Collections.ArrayModule: T[] ZeroCreate[T](Int32) Microsoft.FSharp.Collections.ArrayModule: T[][] ChunkBySize[T](Int32, T[]) Microsoft.FSharp.Collections.ArrayModule: T[][] SplitInto[T](Int32, T[]) +Microsoft.FSharp.Collections.ArrayModule: T[][] Transpose[T](System.Collections.Generic.IEnumerable`1[T[]]) Microsoft.FSharp.Collections.ArrayModule: T[][] Windowed[T](Int32, T[]) Microsoft.FSharp.Collections.ArrayModule: Void CopyTo[T](T[], Int32, T[], Int32, Int32) Microsoft.FSharp.Collections.ArrayModule: Void Fill[T](T[], Int32, Int32, T) @@ -294,6 +295,7 @@ Microsoft.FSharp.Collections.ListModule: Int32 GetHashCode() Microsoft.FSharp.Collections.ListModule: Int32 Length[T](Microsoft.FSharp.Collections.FSharpList`1[T]) Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Collections.FSharpList`1[T]] ChunkBySize[T](Int32, Microsoft.FSharp.Collections.FSharpList`1[T]) Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Collections.FSharpList`1[T]] SplitInto[T](Int32, Microsoft.FSharp.Collections.FSharpList`1[T]) +Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Collections.FSharpList`1[T]] Transpose[T](System.Collections.Generic.IEnumerable`1[Microsoft.FSharp.Collections.FSharpList`1[T]]) Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[Microsoft.FSharp.Collections.FSharpList`1[T]] Windowed[T](Int32, Microsoft.FSharp.Collections.FSharpList`1[T]) Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[System.Int32,T]] Indexed[T](Microsoft.FSharp.Collections.FSharpList`1[T]) Microsoft.FSharp.Collections.ListModule: Microsoft.FSharp.Collections.FSharpList`1[System.Tuple`2[T,T]] Pairwise[T](Microsoft.FSharp.Collections.FSharpList`1[T]) @@ -433,6 +435,7 @@ Microsoft.FSharp.Collections.SeqModule: Microsoft.FSharp.Core.FSharpOption`1[T] Microsoft.FSharp.Collections.SeqModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryHead[T](System.Collections.Generic.IEnumerable`1[T]) Microsoft.FSharp.Collections.SeqModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryItem[T](Int32, System.Collections.Generic.IEnumerable`1[T]) Microsoft.FSharp.Collections.SeqModule: Microsoft.FSharp.Core.FSharpOption`1[T] TryLast[T](System.Collections.Generic.IEnumerable`1[T]) +Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[System.Collections.Generic.IEnumerable`1[T]] Transpose[TCollection,T](System.Collections.Generic.IEnumerable`1[TCollection]) Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[System.Tuple`2[System.Int32,T]] Indexed[T](System.Collections.Generic.IEnumerable`1[T]) Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[System.Tuple`2[T,T]] Pairwise[T](System.Collections.Generic.IEnumerable`1[T]) Microsoft.FSharp.Collections.SeqModule: System.Collections.Generic.IEnumerable`1[System.Tuple`2[T1,T2]] AllPairs[T1,T2](System.Collections.Generic.IEnumerable`1[T1], System.Collections.Generic.IEnumerable`1[T2]) diff --git a/src/fsharp/FSharp.Core/array.fs b/src/fsharp/FSharp.Core/array.fs index dfcc0a9def..a158389b7f 100644 --- a/src/fsharp/FSharp.Core/array.fs +++ b/src/fsharp/FSharp.Core/array.fs @@ -1238,6 +1238,29 @@ namespace Microsoft.FSharp.Collections elif array.Length = 0 then invalidArg "array" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString else invalidArg "array" (SR.GetString(SR.inputSequenceTooLong)) + let transposeArrays (array:'T[][]) = + let len = array.Length + if len = 0 then Microsoft.FSharp.Primitives.Basics.Array.zeroCreateUnchecked 0 else + let lenInner = array.[0].Length + + for j in 1..len-1 do + if lenInner <> array.[j].Length then + invalidArgDifferentArrayLength "array.[0]" lenInner (String.Format("array.[{0}]", j)) array.[j].Length + + let result : 'T[][] = Microsoft.FSharp.Primitives.Basics.Array.zeroCreateUnchecked lenInner + for i in 0..lenInner-1 do + result.[i] <- Microsoft.FSharp.Primitives.Basics.Array.zeroCreateUnchecked len + for j in 0..len-1 do + result.[i].[j] <- array.[j].[i] + result + + [] + let transpose (arrays:seq<'T[]>) = + checkNonNull "arrays" arrays + match arrays with + | :? ('T[][]) as ts -> ts |> transposeArrays // avoid a clone, since we only read the array + | _ -> arrays |> Seq.toArray |> transposeArrays + [] let truncate count (array:'T[]) = checkNonNull "array" array diff --git a/src/fsharp/FSharp.Core/array.fsi b/src/fsharp/FSharp.Core/array.fsi index d101533cfe..57fbd543a3 100644 --- a/src/fsharp/FSharp.Core/array.fsi +++ b/src/fsharp/FSharp.Core/array.fsi @@ -985,6 +985,14 @@ namespace Microsoft.FSharp.Collections [] val toSeq: array:'T[] -> seq<'T> + /// Returns the transpose of the given sequence of arrays. + /// The input sequence of arrays. + /// The transposed array. + /// Thrown when the input sequence is null. + /// Thrown when the input arrays differ in length. + [] + val transpose: arrays:seq<'T[]> -> 'T[][] + /// Returns at most N elements in a new array. /// The maximum number of items to return. /// The input array. diff --git a/src/fsharp/FSharp.Core/list.fs b/src/fsharp/FSharp.Core/list.fs index 45eccc3f3a..3e9a75e3cc 100644 --- a/src/fsharp/FSharp.Core/list.fs +++ b/src/fsharp/FSharp.Core/list.fs @@ -17,6 +17,11 @@ namespace Microsoft.FSharp.Collections [] module List = + let inline checkNonNull argName arg = + match box arg with + | null -> nullArg argName + | _ -> () + let inline indexNotFound() = raise (KeyNotFoundException(SR.GetString(SR.keyNotFoundAlt))) [] @@ -411,10 +416,7 @@ namespace Microsoft.FSharp.Collections [] let except itemsToExclude list = - match box itemsToExclude with - | null -> nullArg "itemsToExclude" - | _ -> () - + checkNonNull "itemsToExclude" itemsToExclude match list with | [] -> list | _ -> @@ -665,6 +667,11 @@ namespace Microsoft.FSharp.Collections | [] -> invalidArg "source" LanguagePrimitives.ErrorStrings.InputSequenceEmptyString | _ -> invalidArg "source" (SR.GetString(SR.inputSequenceTooLong)) + [] + let transpose (lists : seq<'T list>) = + checkNonNull "lists" lists + Microsoft.FSharp.Primitives.Basics.List.transpose (ofSeq lists) + [] let truncate count list = Microsoft.FSharp.Primitives.Basics.List.truncate count list diff --git a/src/fsharp/FSharp.Core/list.fsi b/src/fsharp/FSharp.Core/list.fsi index 6ba6f988a2..5a2edea971 100644 --- a/src/fsharp/FSharp.Core/list.fsi +++ b/src/fsharp/FSharp.Core/list.fsi @@ -782,6 +782,14 @@ namespace Microsoft.FSharp.Collections [] val tryHead: list:'T list -> 'T option + /// Returns the transpose of the given sequence of lists. + /// The input sequence of list. + /// The transposed list. + /// Thrown when the input sequence is null. + /// Thrown when the input lists differ in length. + [] + val transpose: lists:seq<'T list> -> 'T list list + /// Returns at most N elements in a new list. /// The maximum number of items to return. /// The input list. diff --git a/src/fsharp/FSharp.Core/local.fs b/src/fsharp/FSharp.Core/local.fs index 1fe10797cd..f319cf592e 100644 --- a/src/fsharp/FSharp.Core/local.fs +++ b/src/fsharp/FSharp.Core/local.fs @@ -685,6 +685,71 @@ module internal List = then cons, (partitionToFreshConsTailLeft cons predicate t) else (partitionToFreshConsTailRight cons predicate t), cons + let rec transposeGetHeadsFreshConsTail headsCons tailsCons list headCount = + match list with + | [] -> + setFreshConsTail headsCons [] + setFreshConsTail tailsCons [] + headCount + | head::tail -> + match head with + | [] -> + setFreshConsTail headsCons [] + setFreshConsTail tailsCons [] + headCount + | h::t -> + let headsCons2 = freshConsNoTail h + setFreshConsTail headsCons headsCons2 + let tailsCons2 = freshConsNoTail t + setFreshConsTail tailsCons tailsCons2 + transposeGetHeadsFreshConsTail headsCons2 tailsCons2 tail (headCount + 1) + + /// Split off the heads of the lists + let transposeGetHeads list = + match list with + | [] -> [],[],0 + | head::tail -> + match head with + | [] -> + let mutable j = 0 + for t in tail do + j <- j + 1 + if not t.IsEmpty then + invalidArgDifferentListLength "list.[0]" (System.String.Format("list.[{0}]", j)) t.Length + [],[],0 + | h::t -> + let headsCons = freshConsNoTail h + let tailsCons = freshConsNoTail t + let headCount = transposeGetHeadsFreshConsTail headsCons tailsCons tail 1 + headsCons, tailsCons, headCount + + /// Append the next element to the transposed list + let rec transposeToFreshConsTail cons list expectedCount = + match list with + | [] -> setFreshConsTail cons [] + | _ -> + match transposeGetHeads list with + | [],_,_ -> + setFreshConsTail cons [] + | heads,tails,headCount -> + if headCount < expectedCount then + invalidArgDifferentListLength (System.String.Format("list.[{0}]", headCount)) "list.[0]" <| tails.[0].Length + 1 + let cons2 = freshConsNoTail heads + setFreshConsTail cons cons2 + transposeToFreshConsTail cons2 tails expectedCount + + /// Build the transposed list + let transpose (list: 'T list list) = + match list with + | [] -> list + | [[]] -> [] + | _ -> + let heads, tails, headCount = transposeGetHeads list + if headCount = 0 then [] else + let cons = freshConsNoTail heads + transposeToFreshConsTail cons tails headCount + cons + let rec truncateToFreshConsTail cons count list = if count = 0 then setFreshConsTail cons [] else match list with diff --git a/src/fsharp/FSharp.Core/local.fsi b/src/fsharp/FSharp.Core/local.fsi index 8ee4bbcdcf..3181dcbc6e 100644 --- a/src/fsharp/FSharp.Core/local.fsi +++ b/src/fsharp/FSharp.Core/local.fsi @@ -63,6 +63,7 @@ module internal List = val toArray : 'T list -> 'T[] val inline ofSeq : seq<'T> -> 'T List val splitAt : int -> 'T list -> ('T list * 'T list) + val transpose : 'T list list -> 'T list list val truncate : int -> 'T list -> 'T list module internal Array = diff --git a/src/fsharp/FSharp.Core/seq.fs b/src/fsharp/FSharp.Core/seq.fs index 3d82bff790..8e48cc985d 100644 --- a/src/fsharp/FSharp.Core/seq.fs +++ b/src/fsharp/FSharp.Core/seq.fs @@ -854,7 +854,6 @@ namespace Microsoft.FSharp.Collections [] let singleton value = mkSeq (fun () -> IEnumerator.Singleton value) - [] let truncate count (source: seq<'T>) = checkNonNull "source" source @@ -1079,6 +1078,14 @@ namespace Microsoft.FSharp.Collections then mkDelayedSeq (fun () -> groupByValueType projection source) else mkDelayedSeq (fun () -> groupByRefType projection source) + [] + let transpose (source: seq<#seq<'T>>) = + checkNonNull "source" source + source + |> collect indexed + |> groupBy fst + |> map (snd >> (map snd)) + [] let distinct source = checkNonNull "source" source diff --git a/src/fsharp/FSharp.Core/seq.fsi b/src/fsharp/FSharp.Core/seq.fsi index 38a96793f7..016ef6373b 100644 --- a/src/fsharp/FSharp.Core/seq.fsi +++ b/src/fsharp/FSharp.Core/seq.fsi @@ -1276,6 +1276,16 @@ namespace Microsoft.FSharp.Collections [] val tryPick: chooser:('T -> 'U option) -> source:seq<'T> -> 'U option + /// Returns the transpose of the given sequence of sequences. + /// This function returns a sequence that digests the whole initial sequence as soon as + /// that sequence is iterated. As a result this function should not be used with + /// large or infinite sequences. + /// The input sequence. + /// The transposed sequence. + /// Thrown when the input sequence is null. + [] + val transpose: source:seq<'Collection> -> seq> when 'Collection :> seq<'T> + /// Returns a sequence that when enumerated returns at most N elements. /// /// The maximum number of items to enumerate. From 5f9e8df3ff3eebd57b325ba9afa983bbf0284b8c Mon Sep 17 00:00:00 2001 From: dotnet bot Date: Fri, 22 Dec 2017 10:30:17 -0800 Subject: [PATCH 012/147] Merge master to dev15.6 (#4156) * fix resource name (#4151) otherwise instead of expected `FSStrings.resources` will use `FSharp.Compiler.Service.netstandard.FSStrings.resources` * Use ConcurrentDictionary in ImportMap (#4148) * Fix IndexOutOfRangeException in check for providing completion (#4138) * Fix IndexOutOfRange in check for providing completion: * Add test * Remove repeating arguments processing in IncrementalBuilder creation (#4124) * Report builder creation warnings according to compiler args (#4125) * Filter incremental builder creation errors according to compiler args * Fix CompilationErrorLogger ignores WarsAsError options * Add test for WarnAsError * Cleanup * Add more tests; cover WarnAsError-, no warnings at all * Refactor tests * Add test --- ...FSharp.Compiler.Service.netstandard.fsproj | 1 + src/fsharp/import.fs | 3 +- src/fsharp/service/IncrementalBuild.fs | 33 ++++++++++--------- src/fsharp/symbols/SymbolHelpers.fs | 7 ++-- tests/service/Common.fs | 17 ++++++++++ tests/service/ProjectAnalysisTests.fs | 13 ++++++++ .../Completion/CompletionProvider.fs | 5 ++- .../unittests/CompletionProviderTests.fs | 12 +++++++ 8 files changed, 68 insertions(+), 23 deletions(-) diff --git a/fcs/FSharp.Compiler.Service.netstandard/FSharp.Compiler.Service.netstandard.fsproj b/fcs/FSharp.Compiler.Service.netstandard/FSharp.Compiler.Service.netstandard.fsproj index 535a4a590b..5b035b3c9f 100644 --- a/fcs/FSharp.Compiler.Service.netstandard/FSharp.Compiler.Service.netstandard.fsproj +++ b/fcs/FSharp.Compiler.Service.netstandard/FSharp.Compiler.Service.netstandard.fsproj @@ -81,6 +81,7 @@ FSStrings.resx + FSStrings.resources --module Microsoft.FSharp.Compiler.AbstractIL.Internal.AsciiParser --open Microsoft.FSharp.Compiler.AbstractIL --internal --lexlib Internal.Utilities.Text.Lexing --parslib Internal.Utilities.Text.Parsing diff --git a/src/fsharp/import.fs b/src/fsharp/import.fs index dab3e6eec9..6db631a031 100644 --- a/src/fsharp/import.fs +++ b/src/fsharp/import.fs @@ -4,6 +4,7 @@ module internal Microsoft.FSharp.Compiler.Import open System.Reflection +open System.Collections.Concurrent open System.Collections.Generic open Microsoft.FSharp.Compiler.AbstractIL.IL @@ -52,7 +53,7 @@ type AssemblyLoader = /// serves as an interface through to the tables stored in the primary TcImports structures defined in CompileOps.fs. [] type ImportMap(g:TcGlobals,assemblyLoader:AssemblyLoader) = - let typeRefToTyconRefCache = new System.Collections.Generic.Dictionary() + let typeRefToTyconRefCache = ConcurrentDictionary() member this.g = g member this.assemblyLoader = assemblyLoader member this.ILTypeRefToTyconRefCache = typeRefToTyconRefCache diff --git a/src/fsharp/service/IncrementalBuild.fs b/src/fsharp/service/IncrementalBuild.fs index 0028b76720..3fd19dacfe 100755 --- a/src/fsharp/service/IncrementalBuild.fs +++ b/src/fsharp/service/IncrementalBuild.fs @@ -1698,14 +1698,16 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput /// CreateIncrementalBuilder (for background type checking). Note that fsc.fs also /// creates an incremental builder used by the command line compiler. static member TryCreateBackgroundBuilderForProjectOptions (ctok, legacyReferenceResolver, defaultFSharpBinariesDir, frameworkTcImportsCache: FrameworkImportsCache, loadClosureOpt:LoadClosure option, sourceFiles:string list, commandLineArgs:string list, projectReferences, projectDirectory, useScriptResolutionRules, keepAssemblyContents, keepAllBackgroundResolutions, maxTimeShareMilliseconds) = - let targetProfileSwitch = "--targetprofile:" let useSimpleResolutionSwitch = "--simpleresolution" cancellable { // Trap and report warnings and errors from creation. - use errorScope = new ErrorScope() - let! builderOpt = + let delayedLogger = CapturingErrorLogger("IncrementalBuilderCreation") + use _unwindEL = PushErrorLoggerPhaseUntilUnwind (fun _ -> delayedLogger) + use _unwindBP = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter + + let! builderOpt = cancellable { try @@ -1741,22 +1743,12 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput #else tcConfigB.useSimpleResolution <- (getSwitchValue useSimpleResolutionSwitch) |> Option.isSome #endif - match (getSwitchValue targetProfileSwitch) with - | Some v -> - let _s = v - CompileOptions.SetTargetProfile tcConfigB v - | None -> () - // Apply command-line arguments and collect more source files if they are in the arguments let sourceFilesNew = ApplyCommandLineArgs(tcConfigB, sourceFiles, commandLineArgs) // Never open PDB files for the language service, even if --standalone is specified tcConfigB.openDebugInformationForLaterStaticLinking <- false - match commandLineArgs |> Seq.tryFind(fun s -> s.StartsWith(targetProfileSwitch)) with - | Some arg -> - let profile = arg.Substring(targetProfileSwitch.Length) - CompileOptions.SetTargetProfile tcConfigB profile - | _ -> () + tcConfigB, sourceFilesNew match loadClosureOpt with @@ -1825,7 +1817,18 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput return None } - return builderOpt, errorScope.Diagnostics + let diagnostics = + match builderOpt with + | Some builder -> + let errorSeverityOptions = builder.TcConfig.errorSeverityOptions + let errorLogger = CompilationErrorLogger("IncrementalBuilderCreation", errorSeverityOptions) + delayedLogger.CommitDelayedDiagnostics(errorLogger) + errorLogger.GetErrors() |> List.map (fun (d, severity) -> d, severity = FSharpErrorSeverity.Error) + | _ -> + delayedLogger.Diagnostics + |> List.map (fun (d, isError) -> FSharpErrorInfo.CreateFromException(d, isError, range.Zero)) + + return builderOpt, diagnostics } static member KeepBuilderAlive (builderOpt: IncrementalBuilder option) = match builderOpt with diff --git a/src/fsharp/symbols/SymbolHelpers.fs b/src/fsharp/symbols/SymbolHelpers.fs index 935fbf2547..c13731306d 100644 --- a/src/fsharp/symbols/SymbolHelpers.fs +++ b/src/fsharp/symbols/SymbolHelpers.fs @@ -150,15 +150,14 @@ type internal CompilationErrorLogger (debugName: string, options: FSharpErrorSev override x.DiagnosticSink(exn, isError) = if isError || ReportWarningAsError options exn then - diagnostics.Add(exn, isError) + diagnostics.Add(exn, FSharpErrorSeverity.Error) errorCount <- errorCount + 1 else if ReportWarning options exn then - diagnostics.Add(exn, isError) + diagnostics.Add(exn, FSharpErrorSeverity.Warning) override x.ErrorCount = errorCount - member x.GetErrors() = - [ for (e, isError) in diagnostics -> e, (if isError then FSharpErrorSeverity.Error else FSharpErrorSeverity.Warning) ] + member x.GetErrors() = List.ofSeq diagnostics /// This represents the global state established as each task function runs as part of the build. diff --git a/tests/service/Common.fs b/tests/service/Common.fs index 8b76fa107c..d038ff178a 100644 --- a/tests/service/Common.fs +++ b/tests/service/Common.fs @@ -160,6 +160,23 @@ let mkProjectCommandLineArgsForScript (dllName, fileNames) = |] #endif +let mkTestFileAndOptions source additionalArgs = + let fileName = Path.ChangeExtension(Path.GetTempFileName(), ".fs") + let project = Path.GetTempFileName() + let dllName = Path.ChangeExtension(project, ".dll") + let projFileName = Path.ChangeExtension(project, ".fsproj") + let fileSource1 = "module M" + File.WriteAllText(fileName, fileSource1) + + let args = Array.append (mkProjectCommandLineArgs (dllName, [fileName])) additionalArgs + let options = checker.GetProjectOptionsFromCommandLineArgs (projFileName, args) + fileName, options + +let parseAndCheckFile fileName source options = + match checker.ParseAndCheckFileInProject(fileName, 0, source, options) |> Async.RunSynchronously with + | parseResults, FSharpCheckFileAnswer.Succeeded(checkResults) -> parseResults, checkResults + | _ -> failwithf "Parsing aborted unexpectedly..." + let parseAndCheckScript (file, input) = #if DOTNETCORE diff --git a/tests/service/ProjectAnalysisTests.fs b/tests/service/ProjectAnalysisTests.fs index 6cf1795c1c..93463d6a20 100644 --- a/tests/service/ProjectAnalysisTests.fs +++ b/tests/service/ProjectAnalysisTests.fs @@ -5195,3 +5195,16 @@ type A(i:int) = | Some decl -> failwithf "unexpected declaration %A" decl | None -> failwith "declaration list is empty" + + +[] +[] +[] +[] +[] +let ``#4030, Incremental builder creation warnings`` (args, errorSeverities) = + let source = "module M" + let fileName, options = mkTestFileAndOptions source args + + let _, checkResults = parseAndCheckFile fileName source options + checkResults.Errors |> Array.map (fun e -> e.Severity = FSharpErrorSeverity.Error) |> shouldEqual errorSeverities diff --git a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs index ee47b94e08..b5da2f6bb2 100644 --- a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs +++ b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs @@ -85,10 +85,9 @@ type internal FSharpCompletionProvider else let triggerPosition = caretPosition - 1 let triggerChar = sourceText.[triggerPosition] - let prevChar = sourceText.[triggerPosition - 1] - + // do not trigger completion if it's not single dot, i.e. range expression - if not Settings.IntelliSense.ShowAfterCharIsTyped && prevChar = '.' then + if not Settings.IntelliSense.ShowAfterCharIsTyped && triggerPosition > 0 && sourceText.[triggerPosition - 1] = '.' then false else let documentId, filePath, defines = getInfo() diff --git a/vsintegration/tests/unittests/CompletionProviderTests.fs b/vsintegration/tests/unittests/CompletionProviderTests.fs index 6a6c64f44b..5e0212f62b 100644 --- a/vsintegration/tests/unittests/CompletionProviderTests.fs +++ b/vsintegration/tests/unittests/CompletionProviderTests.fs @@ -273,6 +273,18 @@ xVal**y let triggered = FSharpCompletionProvider.ShouldTriggerCompletionAux(SourceText.From(fileContents), caretPosition, CompletionTriggerKind.Insertion, getInfo) Assert.IsTrue(triggered, "Completion should trigger after typing an identifier that follows a mathematical operation") +[] +let ShouldTriggerCompletionAtStartOfFileWithInsertion = + let fileContents = """ +l""" + + let marker = "l" + let caretPosition = fileContents.IndexOf(marker) + marker.Length + let documentId = DocumentId.CreateNewId(ProjectId.CreateNewId()) + let getInfo() = documentId, filePath, [] + let triggered = FSharpCompletionProvider.ShouldTriggerCompletionAux(SourceText.From(fileContents), caretPosition, CompletionTriggerKind.Insertion, getInfo) + Assert.IsTrue(triggered, "Completion should trigger after typing an Insertion character at the top of the file, e.g. a function definition in a new script file.") + [] let ShouldDisplayTypeMembers() = let fileContents = """ From e03bc82a7f8367503dcb50af4ecabefacdecf09f Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Mon, 1 Jan 2018 14:14:03 -0800 Subject: [PATCH 013/147] Versioning Redux (#4112) * Versioning Redux * Supported runtimes * No this is better * Refactor targets slightly and parameterize VS version throughout * Update fcs tests for new portable version * Property pages versioning, additional text * Fix VS tests --- fcs/.gitignore | 10 +++ packages.config | 2 +- setup/FSharp.SDK/Common.Wix.Properties.wxs | 8 +-- setup/FSharp.SDK/FSharp.SDK.wxs | 2 +- .../component-groups/Compiler_LangPack.wxs | 2 +- .../component-groups/Compiler_Redist.wxs | 18 ++--- .../component-groups/Runtime_LangPack.wxs | 6 +- .../component-groups/Runtime_Redist.wxs | 1 + setup/FSharp.Setup.props | 2 +- .../Swix/Microsoft.FSharp.SDK.Core/Files.swr | 2 +- .../Microsoft.FSharp.SDK.Resources/Empty.swr | 2 +- .../Microsoft.FSharp.SDK.Resources/Files.swr | 2 +- .../Microsoft.FSharp.NetSdk.Shim.props | 2 +- .../Microsoft.FSharp.NetSdk.Shim.targets | 2 +- setup/resources/Microsoft.FSharp.Shim.targets | 2 +- .../Microsoft.Portable.FSharp.Shim.targets | 2 +- src/FSharpSource.Settings.targets | 66 +++++++++++++------ src/fsharp/FSharp.Build/FSharp.Build.fsproj | 2 + ...Sharp.Compiler.Interactive.Settings.fsproj | 2 + .../FSharp.Compiler.Private.fsproj | 2 + .../FSharp.Compiler.Server.Shared.fsproj | 1 + .../FSharp.Compiler.nuget.proj | 2 +- .../FSharp.Core.4.1.xxx.nuspec | 2 +- .../FSharp.Core.LatestNuget.nuspec | 6 +- src/fsharp/Fsc/Fsc.fsproj | 2 + src/fsharp/fsi/Fsi.fsproj | 2 + src/fsharp/fsiAnyCpu/FsiAnyCPU.fsproj | 2 + src/utils/CompilerLocationUtils.fs | 29 ++++---- tests/service/data/Test1.fsproj | 2 +- tests/service/data/Test2.fsproj | 2 +- tests/service/data/Test3.fsproj | 2 +- .../Vsix/RegisterFsharpPackage.pkgdef | 14 ++-- .../VisualFSharpFull/VisualFSharpFull.csproj | 2 +- .../VisualFSharpOpenSource.csproj | 2 +- .../VisualFSharpTemplates.csproj | 2 +- .../FSharp.LanguageService.Base.csproj | 2 +- .../FSharp.LanguageService.fsproj | 1 - .../Project/ProjectSystem.Base.csproj | 2 +- .../AppConfigHelper.fs | 4 +- .../VSPackage.resx | 8 +-- .../xlf/VSPackage.cs.xlf | 10 +-- .../xlf/VSPackage.de.xlf | 10 +-- .../xlf/VSPackage.en.xlf | 16 ++--- .../xlf/VSPackage.es.xlf | 10 +-- .../xlf/VSPackage.fr.xlf | 10 +-- .../xlf/VSPackage.it.xlf | 10 +-- .../xlf/VSPackage.ja.xlf | 10 +-- .../xlf/VSPackage.ko.xlf | 10 +-- .../xlf/VSPackage.pl.xlf | 10 +-- .../xlf/VSPackage.pt-BR.xlf | 10 +-- .../xlf/VSPackage.ru.xlf | 10 +-- .../xlf/VSPackage.tr.xlf | 10 +-- .../xlf/VSPackage.zh-Hans.xlf | 10 +-- .../xlf/VSPackage.zh-Hant.xlf | 10 +-- .../FSharp.PropertiesPages.vbproj | 2 +- .../PropertyPages/ApplicationPropPage.resx | 2 +- .../PropertyPages/ApplicationPropPage.vb | 4 +- .../PropertyPages/BuildPropPage.resx | 2 +- .../PropertyPages/DebugPropPage.resx | 4 +- .../FSharp.UIResources.csproj | 2 +- .../SupportedRuntimes/SupportedRuntimes.xml | 2 +- 61 files changed, 218 insertions(+), 172 deletions(-) create mode 100644 fcs/.gitignore diff --git a/fcs/.gitignore b/fcs/.gitignore new file mode 100644 index 0000000000..176f453284 --- /dev/null +++ b/fcs/.gitignore @@ -0,0 +1,10 @@ +FSharp.Compiler.Service.netstandard/illex.fs +FSharp.Compiler.Service.netstandard/ilpars.fs +FSharp.Compiler.Service.netstandard/ilpars.fsi +FSharp.Compiler.Service.netstandard/lex.fs +FSharp.Compiler.Service.netstandard/pars.fs +FSharp.Compiler.Service.netstandard/pars.fsi +FSharp.Compiler.Service.netstandard/pplex.fs +FSharp.Compiler.Service.netstandard/pppars.fs +FSharp.Compiler.Service.netstandard/pppars.fsi + diff --git a/packages.config b/packages.config index 99063830de..ee97e4a98d 100644 --- a/packages.config +++ b/packages.config @@ -45,7 +45,7 @@ - + diff --git a/setup/FSharp.SDK/Common.Wix.Properties.wxs b/setup/FSharp.SDK/Common.Wix.Properties.wxs index d5ade2c8d2..5a3f1cd1b3 100644 --- a/setup/FSharp.SDK/Common.Wix.Properties.wxs +++ b/setup/FSharp.SDK/Common.Wix.Properties.wxs @@ -81,10 +81,10 @@ - - - - + + + + diff --git a/setup/FSharp.SDK/FSharp.SDK.wxs b/setup/FSharp.SDK/FSharp.SDK.wxs index 4a91e24122..21faef5e33 100644 --- a/setup/FSharp.SDK/FSharp.SDK.wxs +++ b/setup/FSharp.SDK/FSharp.SDK.wxs @@ -2,7 +2,7 @@ - + diff --git a/setup/FSharp.SDK/component-groups/Compiler_LangPack.wxs b/setup/FSharp.SDK/component-groups/Compiler_LangPack.wxs index bec0781fed..81dc312484 100644 --- a/setup/FSharp.SDK/component-groups/Compiler_LangPack.wxs +++ b/setup/FSharp.SDK/component-groups/Compiler_LangPack.wxs @@ -9,7 +9,7 @@ - + diff --git a/setup/FSharp.SDK/component-groups/Compiler_Redist.wxs b/setup/FSharp.SDK/component-groups/Compiler_Redist.wxs index e843e8de21..e4c9ca82d3 100644 --- a/setup/FSharp.SDK/component-groups/Compiler_Redist.wxs +++ b/setup/FSharp.SDK/component-groups/Compiler_Redist.wxs @@ -39,7 +39,7 @@ - + @@ -131,18 +131,18 @@ - - - + + + - - - - + + + + - + diff --git a/setup/FSharp.SDK/component-groups/Runtime_LangPack.wxs b/setup/FSharp.SDK/component-groups/Runtime_LangPack.wxs index 44bf70904a..de1467d1bd 100644 --- a/setup/FSharp.SDK/component-groups/Runtime_LangPack.wxs +++ b/setup/FSharp.SDK/component-groups/Runtime_LangPack.wxs @@ -51,7 +51,7 @@ - + @@ -59,7 +59,7 @@ - + @@ -167,7 +167,7 @@ - + diff --git a/setup/FSharp.SDK/component-groups/Runtime_Redist.wxs b/setup/FSharp.SDK/component-groups/Runtime_Redist.wxs index d44607726e..bf7e2b793c 100644 --- a/setup/FSharp.SDK/component-groups/Runtime_Redist.wxs +++ b/setup/FSharp.SDK/component-groups/Runtime_Redist.wxs @@ -39,6 +39,7 @@ + diff --git a/setup/FSharp.Setup.props b/setup/FSharp.Setup.props index 6f48a2b1b2..713620cd55 100644 --- a/setup/FSharp.Setup.props +++ b/setup/FSharp.Setup.props @@ -11,7 +11,7 @@ - 4.3 + 10.1 $([System.DateTime]::Now.ToString(yyyyMMdd.0)) diff --git a/setup/Swix/Microsoft.FSharp.SDK.Core/Files.swr b/setup/Swix/Microsoft.FSharp.SDK.Core/Files.swr index cb51e56c9f..2ce5288a19 100644 --- a/setup/Swix/Microsoft.FSharp.SDK.Core/Files.swr +++ b/setup/Swix/Microsoft.FSharp.SDK.Core/Files.swr @@ -3,7 +3,7 @@ use vs package name=Microsoft.FSharp.SDK.Core version=$(FSharpPackageVersion) vs.package.type=msi - vs.package.providerKey=Microsoft.FSharp.SDK.Core,v4.3 + vs.package.providerKey=Microsoft.FSharp.SDK.Core,v10.1 vs.installSize SystemDrive=194670592 diff --git a/setup/Swix/Microsoft.FSharp.SDK.Resources/Empty.swr b/setup/Swix/Microsoft.FSharp.SDK.Resources/Empty.swr index 95a13eb66a..bfb98e5723 100644 --- a/setup/Swix/Microsoft.FSharp.SDK.Resources/Empty.swr +++ b/setup/Swix/Microsoft.FSharp.SDK.Resources/Empty.swr @@ -4,4 +4,4 @@ package name=Microsoft.FSharp.SDK.Resources version=$(FSharpPackageVersion) vs.package.language=$(LocaleSpecificCulture) vs.package.installSize=1 - vs.package.providerKey=Microsoft.FSharp.SDK.Resources,$(LocaleSpecificCulture),v4.3 + vs.package.providerKey=Microsoft.FSharp.SDK.Resources,$(LocaleSpecificCulture),v10.1 diff --git a/setup/Swix/Microsoft.FSharp.SDK.Resources/Files.swr b/setup/Swix/Microsoft.FSharp.SDK.Resources/Files.swr index 82648036b0..d68202aac6 100644 --- a/setup/Swix/Microsoft.FSharp.SDK.Resources/Files.swr +++ b/setup/Swix/Microsoft.FSharp.SDK.Resources/Files.swr @@ -4,7 +4,7 @@ package name=Microsoft.FSharp.SDK.Resources version=$(FSharpPackageVersion) vs.package.type=msi vs.package.language=$(LocaleSpecificCulture) - vs.package.providerKey=Microsoft.FSharp.SDK.Resources,$(LocaleSpecificCulture),v4.3 + vs.package.providerKey=Microsoft.FSharp.SDK.Resources,$(LocaleSpecificCulture),v10.1 vs.installSize SystemDrive=12681438 diff --git a/setup/resources/Microsoft.FSharp.NetSdk.Shim.props b/setup/resources/Microsoft.FSharp.NetSdk.Shim.props index d9fe97d929..f70ace49bf 100644 --- a/setup/resources/Microsoft.FSharp.NetSdk.Shim.props +++ b/setup/resources/Microsoft.FSharp.NetSdk.Shim.props @@ -1,5 +1,5 @@ - + diff --git a/setup/resources/Microsoft.FSharp.NetSdk.Shim.targets b/setup/resources/Microsoft.FSharp.NetSdk.Shim.targets index 7a669fd4d1..10844657e7 100644 --- a/setup/resources/Microsoft.FSharp.NetSdk.Shim.targets +++ b/setup/resources/Microsoft.FSharp.NetSdk.Shim.targets @@ -1,5 +1,5 @@ - + diff --git a/setup/resources/Microsoft.FSharp.Shim.targets b/setup/resources/Microsoft.FSharp.Shim.targets index b1df5fba66..406acd5d36 100644 --- a/setup/resources/Microsoft.FSharp.Shim.targets +++ b/setup/resources/Microsoft.FSharp.Shim.targets @@ -1,5 +1,5 @@ - + diff --git a/setup/resources/Microsoft.Portable.FSharp.Shim.targets b/setup/resources/Microsoft.Portable.FSharp.Shim.targets index 22a4e746ee..0a0d927347 100644 --- a/setup/resources/Microsoft.Portable.FSharp.Shim.targets +++ b/setup/resources/Microsoft.Portable.FSharp.Shim.targets @@ -1,5 +1,5 @@ - + diff --git a/src/FSharpSource.Settings.targets b/src/FSharpSource.Settings.targets index 05bce49848..c623fe55cc 100644 --- a/src/FSharpSource.Settings.targets +++ b/src/FSharpSource.Settings.targets @@ -62,18 +62,10 @@ - - true - net40 - - - net40 - FSharp - true - true - true - - false + 4.4.3.0 + 10.1.0.0 + 10.1.0 + 15.6.0.0 2.6.0-vs-for-mac-62329-05 15.0 @@ -84,26 +76,60 @@ 15.3.23 15.3.15 - - obj\$(Configuration)\$(TargetDotnetProfile)\ - obj\$(Configuration)\$(TargetDotnetProfile)\$(PortableProfileBeingReferenced)\ - + 4.1.19 4.1 - 4.3.0 - - 4.3.1 - 4.3 + + 10.1.0 + 10.1.1 + 10.1 + 3.5.0 3.5.0.0 $(FSharpSourcesRoot)\..\packages\NUnit.$(NUnitVersion)\lib\net45 $(FSharpSourcesRoot)\..\packages\NUnit.ConsoleRunner\$(NUnitVersion)\tools\ + true 0.2.0-beta-000076 + + + + + fs + + + + $(FSCoreVersion) + + + $(FSProductVersion) + + + $(VSAssemblyVersion) + + + + + true + net40 + + + net40 + FSharp + true + true + true + + false + + + obj\$(Configuration)\$(TargetDotnetProfile)\ + obj\$(Configuration)\$(TargetDotnetProfile)\$(PortableProfileBeingReferenced)\ + diff --git a/src/fsharp/FSharp.Build/FSharp.Build.fsproj b/src/fsharp/FSharp.Build/FSharp.Build.fsproj index e432279f74..8afac8cfdb 100644 --- a/src/fsharp/FSharp.Build/FSharp.Build.fsproj +++ b/src/fsharp/FSharp.Build/FSharp.Build.fsproj @@ -3,6 +3,8 @@ $(MSBuildProjectDirectory)\..\.. + FSharp + true diff --git a/src/fsharp/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj b/src/fsharp/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj index 59ad94d167..5e0d312c22 100644 --- a/src/fsharp/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj +++ b/src/fsharp/FSharp.Compiler.Interactive.Settings/FSharp.Compiler.Interactive.Settings.fsproj @@ -3,6 +3,8 @@ $(MSBuildProjectDirectory)\..\.. + FSharp + true diff --git a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj index e871d61d4c..f812dd3569 100644 --- a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj +++ b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj @@ -3,6 +3,8 @@ $(MSBuildProjectDirectory)\..\.. + FSharp + true diff --git a/src/fsharp/FSharp.Compiler.Server.Shared/FSharp.Compiler.Server.Shared.fsproj b/src/fsharp/FSharp.Compiler.Server.Shared/FSharp.Compiler.Server.Shared.fsproj index 7bf9cc4607..03d1dc689a 100644 --- a/src/fsharp/FSharp.Compiler.Server.Shared/FSharp.Compiler.Server.Shared.fsproj +++ b/src/fsharp/FSharp.Compiler.Server.Shared/FSharp.Compiler.Server.Shared.fsproj @@ -3,6 +3,7 @@ $(MSBuildProjectDirectory)\..\.. + FSharp true diff --git a/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.nuget.proj b/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.nuget.proj index bb860ccbb8..763ce2f6e8 100644 --- a/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.nuget.proj +++ b/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.nuget.proj @@ -14,7 +14,7 @@ Visual F# Compiler FSharp functional programming $(FSharpSourcesRoot)\..\$(Configuration)\coreclr\bin -rtm-$(BuildRevision.Trim())-0 - 4.2.0$(PreReleaseSuffix) + $(FSPackageVersion)$(PreReleaseSuffix) -prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(PackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)" diff --git a/src/fsharp/FSharp.Core.nuget/FSharp.Core.4.1.xxx.nuspec b/src/fsharp/FSharp.Core.nuget/FSharp.Core.4.1.xxx.nuspec index 84ca12cf79..19e0476dac 100644 --- a/src/fsharp/FSharp.Core.nuget/FSharp.Core.4.1.xxx.nuspec +++ b/src/fsharp/FSharp.Core.nuget/FSharp.Core.4.1.xxx.nuspec @@ -4,7 +4,7 @@ FSharp.Core - FSharp.Core redistributables from Visual F# 4.1.0 + FSharp.Core redistributables from Visual F# 10.1.0 Supported Platforms: .NET 2.0 (net20) .NET 4.0 (net40) diff --git a/src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec b/src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec index e04681e361..a250800f44 100644 --- a/src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec +++ b/src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec @@ -3,10 +3,10 @@ FSharp.Core - FSharp.Core for F# 4.3 - FSharp.Core for F# 4.3 + FSharp.Core for F# 4.1 + FSharp.Core for F# 4.1 - FSharp.Core redistributables from Visual F# 4.3.0 + FSharp.Core redistributables from Visual F# Tools version 10.1 For F# 4.1 Supported Platforms: .NET 4.5+ (net45) netstandard1.6 (netstandard1.6) diff --git a/src/fsharp/Fsc/Fsc.fsproj b/src/fsharp/Fsc/Fsc.fsproj index 589dddf52b..7550e3257a 100644 --- a/src/fsharp/Fsc/Fsc.fsproj +++ b/src/fsharp/Fsc/Fsc.fsproj @@ -4,6 +4,8 @@ $(MSBuildProjectDirectory)\..\.. + FSharp + true diff --git a/src/fsharp/fsi/Fsi.fsproj b/src/fsharp/fsi/Fsi.fsproj index 465cf5980a..e5a435cf6d 100644 --- a/src/fsharp/fsi/Fsi.fsproj +++ b/src/fsharp/fsi/Fsi.fsproj @@ -3,6 +3,8 @@ $(MSBuildProjectDirectory)\..\.. + FSharp + true diff --git a/src/fsharp/fsiAnyCpu/FsiAnyCPU.fsproj b/src/fsharp/fsiAnyCpu/FsiAnyCPU.fsproj index 374ceb9056..dfd78843ce 100644 --- a/src/fsharp/fsiAnyCpu/FsiAnyCPU.fsproj +++ b/src/fsharp/fsiAnyCpu/FsiAnyCPU.fsproj @@ -3,6 +3,8 @@ $(MSBuildProjectDirectory)\..\.. + FSharp + true diff --git a/src/utils/CompilerLocationUtils.fs b/src/utils/CompilerLocationUtils.fs index e9961da9bb..9bfcbf3fc2 100644 --- a/src/utils/CompilerLocationUtils.fs +++ b/src/utils/CompilerLocationUtils.fs @@ -12,7 +12,7 @@ open System.Runtime.InteropServices module internal FSharpEnvironment = /// The F# version reported in the banner - let FSharpBannerVersion = "4.3" + let FSharpBannerVersion = "10.1.0 for F# 4.1" let versionOf<'t> = #if FX_RESHAPED_REFLECTION @@ -210,31 +210,28 @@ module internal FSharpEnvironment = let result = tryAppConfig "fsharp-compiler-location" match result with | Some _ -> result - | None -> - + | None -> + let safeExists f = (try File.Exists(f) with _ -> false) // Look in the probePoint if given, e.g. look for a compiler alongside of FSharp.Build.dll match probePoint with | Some p when safeExists (Path.Combine(p,"FSharp.Core.dll")) -> Some p | _ -> - + // On windows the location of the compiler is via a registry key // Note: If the keys below change, be sure to update code in: // Property pages (ApplicationPropPage.vb) - - let key1 = @"Software\Microsoft\FSharp\4.1\Runtime\v4.0" - let key2 = @"Software\Microsoft\FSharp\4.0\Runtime\v4.0" - - let result = tryRegKey key1 - match result with - | Some _ -> result - | None -> - let result = tryRegKey key2 - match result with - | Some _ -> result + let keys = + [| + @"Software\Microsoft\FSharp\10.1\Runtime\v4.0"; + @"Software\Microsoft\FSharp\4.1\Runtime\v4.0"; + @"Software\Microsoft\FSharp\4.0\Runtime\v4.0" + |] + let path = keys |> Seq.tryPick(fun k -> tryRegKey k) + match path with + | Some _ -> path | None -> - // On Unix we let you set FSHARP_COMPILER_BIN. I've rarely seen this used and its not documented in the install instructions. let result = let var = System.Environment.GetEnvironmentVariable("FSHARP_COMPILER_BIN") diff --git a/tests/service/data/Test1.fsproj b/tests/service/data/Test1.fsproj index 1802858145..2d813e2b2e 100644 --- a/tests/service/data/Test1.fsproj +++ b/tests/service/data/Test1.fsproj @@ -35,7 +35,7 @@ - ..\..\..\packages\Microsoft.Portable.FSharp.Core.4.3.0\lib\profiles\net40\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\net40\FSharp.Core.dll false diff --git a/tests/service/data/Test2.fsproj b/tests/service/data/Test2.fsproj index 1ae856b278..8ce5a58a26 100644 --- a/tests/service/data/Test2.fsproj +++ b/tests/service/data/Test2.fsproj @@ -36,7 +36,7 @@ - ..\..\..\packages\Microsoft.Portable.FSharp.Core.4.3.0\lib\profiles\net40\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\net40\FSharp.Core.dll false diff --git a/tests/service/data/Test3.fsproj b/tests/service/data/Test3.fsproj index 22a810bb24..cc3a350104 100644 --- a/tests/service/data/Test3.fsproj +++ b/tests/service/data/Test3.fsproj @@ -36,7 +36,7 @@ - ..\..\..\packages\Microsoft.Portable.FSharp.Core.4.3.0\lib\profiles\net40\FSharp.Core.dll + ..\..\..\packages\Microsoft.Portable.FSharp.Core.10.1.0\lib\profiles\net40\FSharp.Core.dll false diff --git a/vsintegration/Vsix/RegisterFsharpPackage.pkgdef b/vsintegration/Vsix/RegisterFsharpPackage.pkgdef index 827a62ed67..08ed367411 100644 --- a/vsintegration/Vsix/RegisterFsharpPackage.pkgdef +++ b/vsintegration/Vsix/RegisterFsharpPackage.pkgdef @@ -53,7 +53,7 @@ "1"="{92EF0900-2251-11D2-B72E-0000F87572EF}" [$RootKey$\Packages\{91a04a73-4f2c-4e7c-ad38-c1a68e7da05c}] -"ProductVersion"="4.3" +"ProductVersion"="10.1" "ProductName"="Visual F#" "CompanyName"="Microsoft Corp." @@ -63,42 +63,42 @@ [$RootKey$\CLSID\{e1194663-db3c-49eb-8b45-276fcdc440ea}] "InprocServer32"="$WinDir$\SYSTEM32\MSCOREE.DLL" "Class"="Microsoft.VisualStudio.FSharp.ProjectSystem.FSharpBuildPropertyPage" -"Assembly"="FSharp.ProjectSystem.FSharp, Version=15.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +"Assembly"="FSharp.ProjectSystem.FSharp, Version=15.6.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" "ThreadingModel"="Both" @="Microsoft.VisualStudio.FSharp.ProjectSystem.FSharpBuildPropertyPage" [$RootKey$\CLSID\{6d2d9b56-2691-4624-a1bf-d07a14594748}] "InprocServer32"="$WinDir$\SYSTEM32\MSCOREE.DLL" "Class"="Microsoft.VisualStudio.Editors.PropertyPages.FSharpApplicationPropPageComClass" -"Assembly"="FSharp.ProjectSystem.PropertyPages, Version=15.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +"Assembly"="FSharp.ProjectSystem.PropertyPages, Version=15.6.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" "ThreadingModel"="Both" @="Microsoft.VisualStudio.Editors.PropertyPages.FSharpApplicationPropPageComClass" [$RootKey$\CLSID\{dd84aa8f-71bb-462a-8ef8-c9992cb325b7}] "InprocServer32"="$System$mscoree.dll" "Class"="Microsoft.VisualStudio.Editors.PropertyPages.FSharpBuildEventsPropPageComClass" -"Assembly"="FSharp.ProjectSystem.PropertyPages, Version=15.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +"Assembly"="FSharp.ProjectSystem.PropertyPages, Version=15.6.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" "ThreadingModel"="Both" @="Microsoft.VisualStudio.Editors.PropertyPages.FSharpBuildEventsPropPageComClass" [$RootKey$\CLSID\{fac0a17e-2e70-4211-916a-0d34fb708bff}] "InprocServer32"="$System$mscoree.dll" "Class"="Microsoft.VisualStudio.Editors.PropertyPages.FSharpBuildPropPageComClass" -"Assembly"="FSharp.ProjectSystem.PropertyPages, Version=15.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +"Assembly"="FSharp.ProjectSystem.PropertyPages, Version=15.6.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" "ThreadingModel"="Both" @="Microsoft.VisualStudio.Editors.PropertyPages.FSharpBuildPropPageComClass" [$RootKey$\CLSID\{9cfbeb2a-6824-43e2-bd3b-b112febc3772}] "InprocServer32"="$WinDir$\SYSTEM32\MSCOREE.DLL" "Class"="Microsoft.VisualStudio.Editors.PropertyPages.FSharpDebugPropPageComClass" -"Assembly"="FSharp.ProjectSystem.PropertyPages, Version=15.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +"Assembly"="FSharp.ProjectSystem.PropertyPages, Version=15.6.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" "ThreadingModel"="Both" @="Microsoft.VisualStudio.Editors.PropertyPages.FSharpDebugPropPageComClass" [$RootKey$\CLSID\{df16b1a2-0e91-4499-ae60-c7144e614bf1}] "InprocServer32"="$WinDir$\SYSTEM32\MSCOREE.DLL" "Class"="Microsoft.VisualStudio.Editors.PropertyPages.FSharpReferencePathsPropPageComClass" -"Assembly"="FSharp.ProjectSystem.PropertyPages, Version=15.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" +"Assembly"="FSharp.ProjectSystem.PropertyPages, Version=15.6.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" "ThreadingModel"="Both" @="Microsoft.VisualStudio.Editors.PropertyPages.FSharpReferencePathsPropPageComClass" diff --git a/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj b/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj index 327df4246e..954c8ac8c3 100644 --- a/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj +++ b/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj @@ -53,7 +53,7 @@ $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin VisualFSharpFull $(RootBinPath) - 15.4.3.0 + true cs false diff --git a/vsintegration/Vsix/VisualFSharpOpenSource/VisualFSharpOpenSource.csproj b/vsintegration/Vsix/VisualFSharpOpenSource/VisualFSharpOpenSource.csproj index fcb4d3303b..7aa2bb60aa 100644 --- a/vsintegration/Vsix/VisualFSharpOpenSource/VisualFSharpOpenSource.csproj +++ b/vsintegration/Vsix/VisualFSharpOpenSource/VisualFSharpOpenSource.csproj @@ -53,7 +53,7 @@ $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin VisualFSharpOpenSource $(RootBinPath) - 15.4.3.0 + true cs diff --git a/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj b/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj index 39e0ebf671..4080b65175 100644 --- a/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj +++ b/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj @@ -51,7 +51,7 @@ $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin VisualFSharpTemplate $(RootBinPath) - 15.4.3.0 + true cs false diff --git a/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj b/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj index b19e3fd07f..8d1c8c695f 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj +++ b/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj @@ -4,7 +4,7 @@ $(MSBuildProjectDirectory)\..\..\..\src CSharp - 15.4.3.0 + true cs diff --git a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj index 72cb1c1263..e934e149a6 100644 --- a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj +++ b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj @@ -7,7 +7,6 @@ FSharp v4.6 true - true false false true diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj index 4d3035b43d..20748be4ff 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj @@ -6,7 +6,7 @@ CSharp 11 3001,3002,3003,3005,3008,3009,3021,3024 - 15.4.3.0 + true cs $(VsSDKTools) diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/AppConfigHelper.fs b/vsintegration/src/FSharp.ProjectSystem.FSharp/AppConfigHelper.fs index 4a8bb83157..376eaa39fa 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/AppConfigHelper.fs +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/AppConfigHelper.fs @@ -362,7 +362,7 @@ namespace Microsoft.VisualStudio.FSharp.ProjectSystem "4.3.0.0", "4.4.3.0", ["2.0.0.0"; "2.3.0.0"; "2.3.5.0"; "4.0.0.0"; "4.3.0.0"] "4.3.1.0", "4.4.3.0", ["3.3.1.0"; "2.3.5.1"; "3.78.3.1"; "3.259.3.1"; "4.3.1.0"] "4.4.0.0", "4.4.3.0", ["3.47.4.0"; "3.78.4.0"; "3.259.4.0"; "4.4.0.0"] - "4.4.1.0", "4.4.3.0", ["3.47.41.0"; "3.78.41.0"; "3.259.41.0"; "4.4.0.0"; "4.4.3.0"] + "4.4.1.0", "4.4.3.0", ["3.47.41.0"; "3.78.41.0"; "3.259.41.0"; "4.4.1.0"; "4.4.3.0"] ] |> Seq.where(fun (min, max, _) -> targetFSharpCoreVersion >= min && targetFSharpCoreVersion <= max) // some helpers to simplify work with XLinq @@ -392,7 +392,7 @@ namespace Microsoft.VisualStudio.FSharp.ProjectSystem el let createRedirect p (oldVersion, newVersion) = - create p (xnameAsmV1 BindingRedirect) [xname OldVersion, oldVersion; xname NewVersion, newVersion] |> ignore + if oldVersion < newVersion then create p (xnameAsmV1 BindingRedirect) [xname OldVersion, oldVersion; xname NewVersion, newVersion] |> ignore let getOrCreate(p : System.Xml.Linq.XElement) name = match p.Element(name) with diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/VSPackage.resx b/vsintegration/src/FSharp.ProjectSystem.FSharp/VSPackage.resx index a9e740e858..96eb52761e 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/VSPackage.resx +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/VSPackage.resx @@ -468,19 +468,19 @@ Customizes the environment to maximize code editor screen space and improve the visibility of F# commands and tool windows. - Microsoft Visual F# 4.3 + Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# 4.3 + Microsoft Visual F# Tools 10.1 for F# 4.1 1.0 - Microsoft Visual F# + Microsoft Visual F# Tools - Visual F# 4.3 + Visual F# Tools 10.1 for F# 4.1 F# Interactive diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.cs.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.cs.xlf index 92e34270ea..6c12879261 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.cs.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.cs.xlf @@ -433,12 +433,12 @@ - Microsoft Visual F# 4.3 + Microsoft Visual F# Tools 10.1 for F# 4.1 Microsoft Visual F# 4.1 - Microsoft Visual F# 4.3 + Microsoft Visual F# Tools 10.1 for F# 4.1 Microsoft Visual F# 4.1 @@ -448,12 +448,12 @@ - Microsoft Visual F# - Microsoft Visual F# + Microsoft Visual F# Tools + Microsoft Visual F# - Visual F# 4.3 + Visual F# Tools 10.1 for F# 4.1 Visual F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf index ad58acbe8c..225f5a0144 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf @@ -433,12 +433,12 @@ - Microsoft Visual F# 4.3 + Microsoft Visual F# Tools 10.1 for F# 4.1 Microsoft Visual F# 4.1 - Microsoft Visual F# 4.3 + Microsoft Visual F# Tools 10.1 for F# 4.1 Microsoft Visual F# 4.1 @@ -448,12 +448,12 @@ - Microsoft Visual F# - Microsoft Visual F# + Microsoft Visual F# Tools + Microsoft Visual F# - Visual F# 4.3 + Visual F# Tools 10.1 for F# 4.1 Visual F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.en.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.en.xlf index 33f8437518..47c5e09b12 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.en.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.en.xlf @@ -433,13 +433,13 @@ - Microsoft Visual F# 4.3 - Microsoft Visual F# 4.3 + Microsoft Visual F# Tools 10.1 for F# 4.1 + Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# 4.3 - Microsoft Visual F# 4.3 + Microsoft Visual F# Tools 10.1 for F# 4.1 + Microsoft Visual F# Tools 10.1 for F# 4.1 @@ -448,13 +448,13 @@ - Microsoft Visual F# - Microsoft Visual F# + Microsoft Visual F# Tools + Microsoft Visual F# Tools - Visual F# 4.3 - Visual F# 4.3 + Visual F# Tools 10.1 for F# 4.1 + Visual F# Tools 10.1 for F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.es.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.es.xlf index 5d8440dac6..c905201e46 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.es.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.es.xlf @@ -433,12 +433,12 @@ - Microsoft Visual F# 4.3 + Microsoft Visual F# Tools 10.1 for F# 4.1 Microsoft Visual F# 4.1 - Microsoft Visual F# 4.3 + Microsoft Visual F# Tools 10.1 for F# 4.1 Microsoft Visual F# 4.1 @@ -448,12 +448,12 @@ - Microsoft Visual F# - Microsoft Visual F# + Microsoft Visual F# Tools + Microsoft Visual F# - Visual F# 4.3 + Visual F# Tools 10.1 for F# 4.1 Visual F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.fr.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.fr.xlf index 3b224b66f8..ca6e834ef3 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.fr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.fr.xlf @@ -433,12 +433,12 @@ - Microsoft Visual F# 4.3 + Microsoft Visual F# Tools 10.1 for F# 4.1 Microsoft Visual F# 4.1 - Microsoft Visual F# 4.3 + Microsoft Visual F# Tools 10.1 for F# 4.1 Microsoft Visual F# 4.1 @@ -448,12 +448,12 @@ - Microsoft Visual F# - Microsoft Visual F# + Microsoft Visual F# Tools + Microsoft Visual F# - Visual F# 4.3 + Visual F# Tools 10.1 for F# 4.1 Visual F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.it.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.it.xlf index 0e9ee32b47..f6b954d7f1 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.it.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.it.xlf @@ -433,12 +433,12 @@ - Microsoft Visual F# 4.3 + Microsoft Visual F# Tools 10.1 for F# 4.1 Microsoft Visual F# 4.1 - Microsoft Visual F# 4.3 + Microsoft Visual F# Tools 10.1 for F# 4.1 Microsoft Visual F# 4.1 @@ -448,12 +448,12 @@ - Microsoft Visual F# - Microsoft Visual F# + Microsoft Visual F# Tools + Microsoft Visual F# - Visual F# 4.3 + Visual F# Tools 10.1 for F# 4.1 Visual F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf index 5c78991d0a..11cd810b6a 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf @@ -433,12 +433,12 @@ - Microsoft Visual F# 4.3 + Microsoft Visual F# Tools 10.1 for F# 4.1 Microsoft Visual F# 4.1 - Microsoft Visual F# 4.3 + Microsoft Visual F# Tools 10.1 for F# 4.1 Microsoft Visual F# 4.1 @@ -448,12 +448,12 @@ - Microsoft Visual F# - Microsoft Visual F# + Microsoft Visual F# Tools + Microsoft Visual F# - Visual F# 4.3 + Visual F# Tools 10.1 for F# 4.1 Visual F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf index 55924f3b8b..0f81736c59 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf @@ -433,12 +433,12 @@ - Microsoft Visual F# 4.3 + Microsoft Visual F# Tools 10.1 for F# 4.1 Microsoft Visual F# 4.1 - Microsoft Visual F# 4.3 + Microsoft Visual F# Tools 10.1 for F# 4.1 Microsoft Visual F# 4.1 @@ -448,12 +448,12 @@ - Microsoft Visual F# - Microsoft Visual F# + Microsoft Visual F# Tools + Microsoft Visual F# - Visual F# 4.3 + Visual F# Tools 10.1 for F# 4.1 Visual F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pl.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pl.xlf index 8a3a0dc0bc..5937f9a66f 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pl.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pl.xlf @@ -433,12 +433,12 @@ - Microsoft Visual F# 4.3 + Microsoft Visual F# Tools 10.1 for F# 4.1 Microsoft Visual F# 4.1 - Microsoft Visual F# 4.3 + Microsoft Visual F# Tools 10.1 for F# 4.1 Microsoft Visual F# 4.1 @@ -448,12 +448,12 @@ - Microsoft Visual F# - Microsoft Visual F# + Microsoft Visual F# Tools + Microsoft Visual F# - Visual F# 4.3 + Visual F# Tools 10.1 for F# 4.1 Visual F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pt-BR.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pt-BR.xlf index 14f7dd51aa..ea13b97eca 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pt-BR.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pt-BR.xlf @@ -433,12 +433,12 @@ - Microsoft Visual F# 4.3 + Microsoft Visual F# Tools 10.1 for F# 4.1 Microsoft Visual F# 4.1 - Microsoft Visual F# 4.3 + Microsoft Visual F# Tools 10.1 for F# 4.1 Microsoft Visual F# 4.1 @@ -448,12 +448,12 @@ - Microsoft Visual F# - Microsoft Visual F# + Microsoft Visual F# Tools + Microsoft Visual F# - Visual F# 4.3 + Visual F# Tools 10.1 for F# 4.1 Visual F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ru.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ru.xlf index fcc92564a6..49dd2c071b 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ru.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ru.xlf @@ -433,12 +433,12 @@ - Microsoft Visual F# 4.3 + Microsoft Visual F# Tools 10.1 for F# 4.1 Microsoft Visual F# 4.1 - Microsoft Visual F# 4.3 + Microsoft Visual F# Tools 10.1 for F# 4.1 Microsoft Visual F# 4.1 @@ -448,12 +448,12 @@ - Microsoft Visual F# - Microsoft Visual F# + Microsoft Visual F# Tools + Microsoft Visual F# - Visual F# 4.3 + Visual F# Tools 10.1 for F# 4.1 Visual F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf index 815d48396a..5a04d4e69a 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf @@ -433,12 +433,12 @@ - Microsoft Visual F# 4.3 + Microsoft Visual F# Tools 10.1 for F# 4.1 Microsoft Visual F# 4.1 - Microsoft Visual F# 4.3 + Microsoft Visual F# Tools 10.1 for F# 4.1 Microsoft Visual F# 4.1 @@ -448,12 +448,12 @@ - Microsoft Visual F# - Microsoft Visual F# + Microsoft Visual F# Tools + Microsoft Visual F# - Visual F# 4.3 + Visual F# Tools 10.1 for F# 4.1 Visual F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hans.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hans.xlf index 3e48a1f913..7430f25d6d 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hans.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hans.xlf @@ -433,12 +433,12 @@ - Microsoft Visual F# 4.3 + Microsoft Visual F# Tools 10.1 for F# 4.1 Microsoft Visual F# 4.1 - Microsoft Visual F# 4.3 + Microsoft Visual F# Tools 10.1 for F# 4.1 Microsoft Visual F# 4.1 @@ -448,12 +448,12 @@ - Microsoft Visual F# - Microsoft Visual F# + Microsoft Visual F# Tools + Microsoft Visual F# - Visual F# 4.3 + Visual F# Tools 10.1 for F# 4.1 Visual F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hant.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hant.xlf index 148b5f8d97..9f75cd89bc 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hant.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hant.xlf @@ -433,12 +433,12 @@ - Microsoft Visual F# 4.3 + Microsoft Visual F# Tools 10.1 for F# 4.1 Microsoft Visual F# 4.1 - Microsoft Visual F# 4.3 + Microsoft Visual F# Tools 10.1 for F# 4.1 Microsoft Visual F# 4.1 @@ -448,12 +448,12 @@ - Microsoft Visual F# - Microsoft Visual F# + Microsoft Visual F# Tools + Microsoft Visual F# - Visual F# 4.3 + Visual F# Tools 10.1 for F# 4.1 Visual F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj index f268836cae..36e4f696d5 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj @@ -4,7 +4,7 @@ $(MSBuildProjectDirectory)\..\..\..\src VisualBasic - 15.4.3.0 + true vb diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPage.resx b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPage.resx index e1668f2208..d8769c3090 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPage.resx +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPage.resx @@ -661,6 +661,6 @@ ApplicationPropPage - Microsoft.VisualStudio.Editors.PropertyPages.ApplicationPropPageBase, FSharp.ProjectSystem.PropertyPages, Version=15.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Microsoft.VisualStudio.Editors.PropertyPages.ApplicationPropPageBase, FSharp.ProjectSystem.PropertyPages, Version=15.6.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPage.vb b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPage.vb index fc307096bf..b5f3463910 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPage.vb +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPage.vb @@ -80,8 +80,8 @@ Namespace Microsoft.VisualStudio.Editors.PropertyPages Dim v40FSharpRedistKey As String = "HKEY_LOCAL_MACHINE\Software\Microsoft\FSharp\4.0\Runtime\v4.0" #End If #If VS_VERSION_DEV15 Then - Dim v20FSharpRedistKey As String = "HKEY_LOCAL_MACHINE\Software\Microsoft\FSharp\4.3\Runtime\v2.0" - Dim v40FSharpRedistKey As String = "HKEY_LOCAL_MACHINE\Software\Microsoft\FSharp\4.3\Runtime\v4.0" + Dim v20FSharpRedistKey As String = "HKEY_LOCAL_MACHINE\Software\Microsoft\FSharp\10.1\Runtime\v2.0" + Dim v40FSharpRedistKey As String = "HKEY_LOCAL_MACHINE\Software\Microsoft\FSharp\10.1\Runtime\v4.0" #End If m_v20FSharpRedistInstalled = Not (IsNothing(Microsoft.Win32.Registry.GetValue(v20FSharpRedistKey, Nothing, Nothing))) diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/BuildPropPage.resx b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/BuildPropPage.resx index 4377119cfe..6e71272e55 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/BuildPropPage.resx +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/BuildPropPage.resx @@ -1351,6 +1351,6 @@ BuildPropPage - Microsoft.VisualStudio.Editors.PropertyPages.PropPageUserControlBase, FSharp.ProjectSystem.PropertyPages, Version=15.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Microsoft.VisualStudio.Editors.PropertyPages.PropPageUserControlBase, FSharp.ProjectSystem.PropertyPages, Version=15.6.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/DebugPropPage.resx b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/DebugPropPage.resx index fab0a10653..f245dd33ee 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/DebugPropPage.resx +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/DebugPropPage.resx @@ -523,7 +523,7 @@ StartArguments - Microsoft.VisualStudio.Editors.PropertyPages.DebugPropPage+MultilineTextBoxRejectsEnter, FSharp.ProjectSystem.PropertyPages, Version=15.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Microsoft.VisualStudio.Editors.PropertyPages.DebugPropPage+MultilineTextBoxRejectsEnter, FSharp.ProjectSystem.PropertyPages, Version=15.6.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a overarchingTableLayoutPanel @@ -982,6 +982,6 @@ DebugPropPage - Microsoft.VisualStudio.Editors.PropertyPages.PropPageUserControlBase, FSharp.ProjectSystem.PropertyPages, Version=15.4.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Microsoft.VisualStudio.Editors.PropertyPages.PropPageUserControlBase, FSharp.ProjectSystem.PropertyPages, Version=15.6.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj b/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj index d04dceba35..11f403d214 100644 --- a/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj +++ b/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj @@ -4,7 +4,7 @@ $(MSBuildProjectDirectory)\..\..\..\src CSharp - 15.4.3.0 + true cs diff --git a/vsintegration/src/SupportedRuntimes/SupportedRuntimes.xml b/vsintegration/src/SupportedRuntimes/SupportedRuntimes.xml index 6b9322207a..c92ea3c459 100644 --- a/vsintegration/src/SupportedRuntimes/SupportedRuntimes.xml +++ b/vsintegration/src/SupportedRuntimes/SupportedRuntimes.xml @@ -11,7 +11,7 @@ - + From 592b863afef70f00c79a08a27f8a257a12709347 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Wed, 10 Jan 2018 09:55:33 -0800 Subject: [PATCH 014/147] Wrong Nuget package version following version # update (#4184) * fix core package ver * Update reference --- src/FSharpSource.Settings.targets | 2 ++ src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.targets | 2 +- src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/FSharpSource.Settings.targets b/src/FSharpSource.Settings.targets index c623fe55cc..01db1bba96 100644 --- a/src/FSharpSource.Settings.targets +++ b/src/FSharpSource.Settings.targets @@ -79,6 +79,8 @@ 4.1.19 4.1 + 4.3.0 + 4.3 10.1.0 diff --git a/src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.targets b/src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.targets index ceb5be0494..93b116b761 100644 --- a/src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.targets +++ b/src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.targets @@ -54,7 +54,7 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and - 4.2.* + 4.3.* diff --git a/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj b/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj index 7a75f92786..f8dc68b0c9 100644 --- a/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj +++ b/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj @@ -58,8 +58,8 @@ $(FSharpCore41TargetPackageVersion) $(FSharpCore41TargetMajorVersion) - $(FSharpCoreFrozenPortableTargetPackageVersion) - $(FSharpCoreFrozenPortableTargetMajorVersion) + $(FSharpCoreLatestTargetPackageVersion) + $(FSharpCoreLatestTargetMajorVersion) -prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(PackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)" From 7ea142facd318b6fc26b1f6b781efdc39521acec Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Wed, 10 Jan 2018 22:29:02 -0800 Subject: [PATCH 015/147] Fixversioningmerge --- Fix merge issue that messed with versioning (#4186) * Fix merge issue with versioning * Rev buildFrom source versions * Fixup vs tests --- src/FSharpSource.Settings.targets | 20 ++++++++++++------- src/buildfromsource/BuildFromSource.targets | 2 +- .../FSharp.Build/AssemblyInfo.fs | 4 ++-- .../AssemblyInfo.fs | 4 ++-- .../FSharp.Compiler.Private/AssemblyInfo.fs | 4 ++-- .../FSharp.Core/AssemblyInfo.fs | 4 ++-- src/buildfromsource/Fsc/AssemblyInfo.fs | 4 ++-- src/buildfromsource/Fsi/AssemblyInfo.fs | 4 ++-- .../Tests.LanguageService.Script.fs | 2 +- 9 files changed, 27 insertions(+), 21 deletions(-) diff --git a/src/FSharpSource.Settings.targets b/src/FSharpSource.Settings.targets index 01db1bba96..8ac29ef6f2 100644 --- a/src/FSharpSource.Settings.targets +++ b/src/FSharpSource.Settings.targets @@ -19,6 +19,13 @@ + + 4.4.3.0 + 10.1.0.0 + 10.1.0 + 15.6.0.0 + + $([System.DateTime]::Now.ToString(yyyyMMdd.0)) @@ -38,9 +45,13 @@ <_Build_Number>$(BUILD_BUILDNUMBER.Substring(9)) $(_Build_Year).$(_Build_Month).$(_Build_Day).$(_Build_Number) - 4.4.3.0 $(FSCoreVersion) - 15.4.3.0 + + + $(FSProductVersion) + + + $(VSAssemblyVersion) + 2003;$(NoWarn) + + + + <_AssemblyVersionAttributes Include="System.Reflection.AssemblyCompanyAttribute"> + <_Parameter1>Microsoft Corporation + + <_AssemblyVersionAttributes Include="System.Reflection.AssemblyCopyrightAttribute"> + <_Parameter1>© Microsoft Corporation. All Rights Reserved. + + <_AssemblyVersionAttributes Include="System.Reflection.AssemblyDescriptionAttribute"> + <_Parameter1>$(AssemblyName).dll + + <_AssemblyVersionAttributes Include="System.Reflection.AssemblyFileVersionAttribute"> + <_Parameter1>$(Build_FileVersion) + + <_AssemblyVersionAttributes Include="System.Reflection.AssemblyInformationalVersionAttribute"> + <_Parameter1>$(MicroBuildAssemblyVersion). Commit Hash: $(GitHeadSha). + + <_AssemblyVersionAttributes Include="System.Reflection.AssemblyProductAttribute"> + <_Parameter1>Microsoft® F# + + <_AssemblyVersionAttributes Include="System.Reflection.AssemblyTitleAttribute"> + <_Parameter1>$(AssemblyName).dll + + <_AssemblyVersionAttributes Include="System.Reflection.AssemblyVersionAttribute"> + <_Parameter1>$(MicroBuildAssemblyVersion) + + + + + + + + + + + + + diff --git a/src/FSharpSource.targets b/src/FSharpSource.targets index c3f6de5505..93e556026d 100644 --- a/src/FSharpSource.targets +++ b/src/FSharpSource.targets @@ -6,8 +6,6 @@ $(MSBuildThisFileDirectory)..\ - - @@ -368,89 +366,7 @@ - - $(IntermediateOutputPath)$(MSBuildProjectName).InternalsVisibleTo$(DefaultLanguageSourceExtension) - - - - - false - - - - - - <_PublicKey>002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293 - - - <_InternalsVisibleToAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute"> - <_Parameter1 Condition="'%(InternalsVisibleTo.Key)' != ''">%(InternalsVisibleTo.Identity), PublicKey=%(InternalsVisibleTo.Key) - <_Parameter1 Condition="'%(InternalsVisibleTo.Key)' == ''">%(InternalsVisibleTo.Identity), PublicKey=$(_PublicKey) - - - - - - - - - - - - - - $(IntermediateOutputPath)$(MSBuildProjectName).AssemblyVersion$(DefaultLanguageSourceExtension) - - 2003;$(NoWarn) - - - - <_AssemblyVersionAttributes Include="System.Reflection.AssemblyCompanyAttribute"> - <_Parameter1>Microsoft Corporation - - <_AssemblyVersionAttributes Include="System.Reflection.AssemblyCopyrightAttribute"> - <_Parameter1>© Microsoft Corporation. All Rights Reserved. - - <_AssemblyVersionAttributes Include="System.Reflection.AssemblyDescriptionAttribute"> - <_Parameter1>$(AssemblyName).dll - - <_AssemblyVersionAttributes Include="System.Reflection.AssemblyFileVersionAttribute"> - <_Parameter1>$(Build_FileVersion) - - <_AssemblyVersionAttributes Include="System.Reflection.AssemblyInformationalVersionAttribute"> - <_Parameter1>$(MicroBuildAssemblyVersion). Commit Hash: $(GitHeadSha). - - <_AssemblyVersionAttributes Include="System.Reflection.AssemblyProductAttribute"> - <_Parameter1>Microsoft® F# - - <_AssemblyVersionAttributes Include="System.Reflection.AssemblyTitleAttribute"> - <_Parameter1>$(AssemblyName).dll - - <_AssemblyVersionAttributes Include="System.Reflection.AssemblyVersionAttribute"> - <_Parameter1>$(MicroBuildAssemblyVersion) - - - - - - - - - - - + diff --git a/tests/fsharpqa/testenv/src/AssemblyVersionCheck/AssemblyVersionCheck.fsproj b/tests/fsharpqa/testenv/src/AssemblyVersionCheck/AssemblyVersionCheck.fsproj new file mode 100644 index 0000000000..b1ba63d83f --- /dev/null +++ b/tests/fsharpqa/testenv/src/AssemblyVersionCheck/AssemblyVersionCheck.fsproj @@ -0,0 +1,16 @@ + + + + Exe + netcoreapp2.0 + + + + + + + + + + + diff --git a/tests/fsharpqa/testenv/src/AssemblyVersionCheck/Program.fs b/tests/fsharpqa/testenv/src/AssemblyVersionCheck/Program.fs new file mode 100644 index 0000000000..0289499804 --- /dev/null +++ b/tests/fsharpqa/testenv/src/AssemblyVersionCheck/Program.fs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +open System +open System.Diagnostics +open System.IO +open System.Reflection +open System.Text.RegularExpressions +open Newtonsoft.Json.Linq + +module AssemblyVersionCheck = + + let private versionZero = Version(0, 0, 0, 0) + let private commitHashPattern = new Regex(@"Commit Hash: ()|([0-9a-fA-F]{40})", RegexOptions.Compiled) + + let verifyAssemblyVersions (signToolData:string) (binariesPath:string) = + let json = File.ReadAllText(signToolData) + let jobject = JObject.Parse(json) + + // could either contain things like 'net40\bin\FSharp.Core.dll' or patterns like 'net40\bin\*\FSharp.Core.resources.dll' + let assemblyPatterns = + (jobject.["sign"] :?> JArray) + |> Seq.map (fun a -> (a :?> JObject).["values"] :?> JArray) + |> Seq.map (fun a -> a :> seq) + |> Seq.collect (fun t -> t) + |> Seq.map (fun t -> t.ToString()) + |> Seq.filter (fun p -> p.EndsWith(".dll") || p.EndsWith(".exe")) // only check assemblies + + // map the assembly patterns to actual files on disk + let actualAssemblies = + assemblyPatterns + |> Seq.map (fun a -> + if not (a.Contains("*")) then + [a] // just a raw file name + else + let parts = a.Split([|'\\'|]) + let mutable candidatePaths = [binariesPath] + for p in parts do + match p with + | "*" -> + // expand all candidates into multiples + let expansions = + candidatePaths + |> List.filter Directory.Exists + |> List.map (Directory.EnumerateDirectories >> Seq.toList) + |> List.collect (fun x -> x) + candidatePaths <- expansions + | _ -> + // regular path part, just append it to all candidates + candidatePaths <- List.map (fun d -> Path.Combine(d, p)) candidatePaths + candidatePaths) + |> Seq.collect (fun a -> a) + |> Seq.map (fun a -> Path.Combine(binariesPath, a)) + |> Seq.filter (fun p -> File.Exists(p)) // not all test runs produce all files + |> Seq.toList + + // verify that all assemblies have a version number other than 0.0.0.0 + let failedVersionCheck = + actualAssemblies + |> List.filter (fun a -> + let assemblyVersion = AssemblyName.GetAssemblyName(a).Version + printfn "Checking version: %s (%A)" a assemblyVersion + assemblyVersion = versionZero) + if failedVersionCheck.Length > 0 then + printfn "The following assemblies had a version of %A" versionZero + printfn "%s\r\n" <| String.Join("\r\n", failedVersionCheck) + + // verify that all assemblies have a commit hash + let failedCommitHash = + actualAssemblies + |> List.filter (fun a -> + let fileProductVersion = FileVersionInfo.GetVersionInfo(a).ProductVersion + printfn "Checking commit hash: %s (%s)" a fileProductVersion + not <| commitHashPattern.IsMatch(fileProductVersion)) + if failedCommitHash.Length > 0 then + printfn "The following assemblies don't have a commit hash set" + printfn "%s\r\n" <| String.Join("\r\n", failedCommitHash) + + // return code is the number of failures + failedVersionCheck.Length + failedCommitHash.Length + +[] +let main argv = + if argv.Length <> 2 then + printfn "Usage: AssemblyVersionCheck.exe SignToolData.json path/to/binaries" + 1 + else + AssemblyVersionCheck.verifyAssemblyVersions argv.[0] argv.[1] diff --git a/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj b/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj index 8d1c8c695f..15f1ada9fe 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj +++ b/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj @@ -260,4 +260,5 @@ + \ No newline at end of file diff --git a/vsintegration/src/FSharp.LanguageService.Base/Properties/AssemblyInfo.cs b/vsintegration/src/FSharp.LanguageService.Base/Properties/AssemblyInfo.cs index c6088175c9..cb03110f1a 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/Properties/AssemblyInfo.cs +++ b/vsintegration/src/FSharp.LanguageService.Base/Properties/AssemblyInfo.cs @@ -9,12 +9,7 @@ // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("FSharp.LanguageService.Base")] -[assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft.VisualFSharpTools")] -[assembly: AssemblyProduct("FSharp.LanguageService.Base")] -[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/AssemblyInfo.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/AssemblyInfo.cs index 81e294739c..7c1f858184 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/AssemblyInfo.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/AssemblyInfo.cs @@ -6,11 +6,6 @@ using System.Runtime.InteropServices; /* F# additions: begin. */ -[assembly:AssemblyDescription("FSharp.ProjectSystem.Base.dll")] -[assembly:AssemblyCompany("Microsoft Corporation")] -[assembly:AssemblyTitle("FSharp.ProjectSystem.Base.dll")] -[assembly:AssemblyCopyright("\x00a9 Microsoft Corporation. All rights reserved.")] -[assembly:AssemblyProduct("Microsoft\x00ae F#")] [assembly:AssemblyConfiguration("")] [assembly:AssemblyCulture("")] [assembly:ComVisible(false)] diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj index 20748be4ff..795c9c465b 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj @@ -293,4 +293,5 @@ + \ No newline at end of file diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/AssemblyInfo.vb b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/AssemblyInfo.vb index 488f284286..cc5533ac7e 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/AssemblyInfo.vb +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/AssemblyInfo.vb @@ -6,11 +6,6 @@ Imports System.Runtime.CompilerServices Imports Microsoft.VisualStudio.Shell '/* F# additions: begin. */ - - - - - diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj index 36e4f696d5..918e1b7415 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj @@ -382,4 +382,5 @@ + \ No newline at end of file diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/My Project/AssemblyInfo.vb b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/My Project/AssemblyInfo.vb index 7987ce7728..301c34e96a 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/My Project/AssemblyInfo.vb +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/My Project/AssemblyInfo.vb @@ -10,13 +10,6 @@ Imports System.Runtime.InteropServices ' Review the values of the assembly attributes - - - - - - - 'The following GUID is for the ID of the typelib if this project is exposed to COM diff --git a/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj b/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj index 11f403d214..cd1012a326 100644 --- a/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj +++ b/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj @@ -108,4 +108,5 @@ + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/Properties/AssemblyInfo.cs b/vsintegration/src/FSharp.UIResources/Properties/AssemblyInfo.cs index 18439c74d3..a67fb08160 100644 --- a/vsintegration/src/FSharp.UIResources/Properties/AssemblyInfo.cs +++ b/vsintegration/src/FSharp.UIResources/Properties/AssemblyInfo.cs @@ -8,12 +8,7 @@ // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("FSharp.UIResources")] -[assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft.VisualFSharpTools")] -[assembly: AssemblyProduct("FSharp.UIResources")] -[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation.")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] From 472893ad35ce435ee0c2f8bb93a2decfa2a15741 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Thu, 18 Jan 2018 11:21:15 -0800 Subject: [PATCH 017/147] include satellite assemblies in compiler packages (#4210) --- .../FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec | 5 +++++ .../FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec b/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec index 0b70058263..23bc64d34a 100644 --- a/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec +++ b/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec @@ -65,5 +65,10 @@ + + + + + diff --git a/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec b/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec index 021b458ed3..81093eb472 100644 --- a/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec +++ b/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec @@ -57,5 +57,10 @@ + + + + + From 3f864027a6522e86d0957b28b4e87fb942d279c4 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Thu, 18 Jan 2018 14:59:42 -0800 Subject: [PATCH 018/147] include satellite assemblies in FSharp.Core packages --- src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec b/src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec index a250800f44..4bdef1b8ed 100644 --- a/src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec +++ b/src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec @@ -62,5 +62,8 @@ + + + From 61b765817e57e9bb53a8170d593367c2179fcca0 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Tue, 23 Jan 2018 23:07:07 -0800 Subject: [PATCH 019/147] Update nuget package versions (#4248) * Update nuget package versions * Update tools version numbers --- src/FSharpSource.Settings.targets | 8 ++++---- .../LegacyLanguageService/Tests.LanguageService.Script.fs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/FSharpSource.Settings.targets b/src/FSharpSource.Settings.targets index 8ac29ef6f2..3e498a6b0c 100644 --- a/src/FSharpSource.Settings.targets +++ b/src/FSharpSource.Settings.targets @@ -21,8 +21,8 @@ 4.4.3.0 - 10.1.0.0 - 10.1.0 + 10.1.1.0 + 10.1.1 15.6.0.0 @@ -85,12 +85,12 @@ 4.1.19 4.1 - 4.3.0 + 4.3.1 4.3 10.1.0 - 10.1.1 + 10.2.0 10.1 diff --git a/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.Script.fs b/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.Script.fs index f38ae3f880..50450a205b 100644 --- a/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.Script.fs +++ b/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.Script.fs @@ -1343,7 +1343,7 @@ type UsingMSBuild() as this = "4.4.0.0" #endif #if VS_VERSION_DEV15 - "10.1.0.0" + "10.1.1.0" #endif let binariesFolder = match Internal.Utilities.FSharpEnvironment.BinFolderOfDefaultFSharpCompiler(None) with | Some(x) -> x From 19c27746cf280b17abbc9f600e7ec8d51500ab1d Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Wed, 24 Jan 2018 16:22:12 -0800 Subject: [PATCH 020/147] always set %FSHARPINSTALLDIR% on install (#4261) --- setup/FSharp.SDK/component-groups/Compiler_Redist.wxs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/FSharp.SDK/component-groups/Compiler_Redist.wxs b/setup/FSharp.SDK/component-groups/Compiler_Redist.wxs index e4c9ca82d3..9c4e65e6ca 100644 --- a/setup/FSharp.SDK/component-groups/Compiler_Redist.wxs +++ b/setup/FSharp.SDK/component-groups/Compiler_Redist.wxs @@ -131,7 +131,7 @@ - + From dad172eba357eac3d757d14e5f0de632f82baf6a Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Fri, 26 Jan 2018 11:38:41 -0800 Subject: [PATCH 021/147] Update fsharp.core nuget package version (#4270) * Update fsharp.core nuget package version * Encore une fois --- src/FSharpSource.Settings.targets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FSharpSource.Settings.targets b/src/FSharpSource.Settings.targets index 3e498a6b0c..ba7f575de8 100644 --- a/src/FSharpSource.Settings.targets +++ b/src/FSharpSource.Settings.targets @@ -22,7 +22,7 @@ 4.4.3.0 10.1.1.0 - 10.1.1 + 10.1.2 15.6.0.0 @@ -85,7 +85,7 @@ 4.1.19 4.1 - 4.3.1 + 4.3.3 4.3 From 7c07673876fa2c5767621a36c3818b19ba064124 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Fri, 26 Jan 2018 17:16:52 -0800 Subject: [PATCH 022/147] build nuget packages after signing (#4269) --- build-everything.proj | 8 ++----- build-nuget-packages.proj | 21 +++++++++++++++++ build.cmd | 6 +++++ .../FSharp.Compiler.Template.nuget.props | 20 ++++++++++++++++ ...=> FSharp.Compiler.Template.nuget.targets} | 23 ------------------- .../Microsoft.FSharp.Compiler.nuget.proj | 11 +++++++++ .../Testing.FSharp.Compiler.nuget.proj | 11 +++++++++ 7 files changed, 71 insertions(+), 29 deletions(-) create mode 100644 build-nuget-packages.proj create mode 100644 src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.props rename src/fsharp/FSharp.Compiler.nuget/{FSharp.Compiler.nuget.proj => FSharp.Compiler.Template.nuget.targets} (57%) create mode 100644 src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuget.proj create mode 100644 src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuget.proj diff --git a/build-everything.proj b/build-everything.proj index f236cde62c..5c52b99ae6 100644 --- a/build-everything.proj +++ b/build-everything.proj @@ -24,8 +24,8 @@ - - + + @@ -47,10 +47,6 @@ - - - - diff --git a/build-nuget-packages.proj b/build-nuget-packages.proj new file mode 100644 index 0000000000..2aab5455e9 --- /dev/null +++ b/build-nuget-packages.proj @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/build.cmd b/build.cmd index 0201854c86..6f7e9d5062 100644 --- a/build.cmd +++ b/build.cmd @@ -686,6 +686,12 @@ if not "%SIGN_TYPE%" == "" ( if ERRORLEVEL 1 echo Error running sign tool && goto :failure ) +echo ---------------- Done with assembly signing, start package creation --------------- + +echo %_msbuildexe% %msbuildflags% build-nuget-packages.proj /p:Configuration=%BUILD_CONFIG% + %_msbuildexe% %msbuildflags% build-nuget-packages.proj /p:Configuration=%BUILD_CONFIG% +if ERRORLEVEL 1 echo Error building NuGet packages && goto :failure + if "%BUILD_SETUP%" == "1" ( echo %_msbuildexe% %msbuildflags% setup\build-msi.proj /p:Configuration=%BUILD_CONFIG% %_msbuildexe% %msbuildflags% setup\build-msi.proj /p:Configuration=%BUILD_CONFIG% diff --git a/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.props b/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.props new file mode 100644 index 0000000000..bb30ab3a76 --- /dev/null +++ b/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.props @@ -0,0 +1,20 @@ + + + $(MSBuildProjectDirectory)\..\.. + rc + obj\BuildVersionFile.props + + + + + + https://github.com/Microsoft/visualfsharp/blob/master/License.txt + https://github.com/Microsoft/visualfsharp + Microsoft and F# Software Foundation + Visual F# Compiler FSharp functional programming + $(FSharpSourcesRoot)\..\$(Configuration)\coreclr\bin + -rtm-$(BuildRevision.Trim())-0 + $(FSPackageVersion)$(PreReleaseSuffix) + -prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(PackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)" + + diff --git a/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.nuget.proj b/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.targets similarity index 57% rename from src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.nuget.proj rename to src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.targets index 763ce2f6e8..d8a8818e91 100644 --- a/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.nuget.proj +++ b/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.targets @@ -1,27 +1,4 @@ - - $(MSBuildProjectDirectory)\..\.. - rc - obj\BuildVersionFile.props - - - - - - https://github.com/Microsoft/visualfsharp/blob/master/License.txt - https://github.com/Microsoft/visualfsharp - Microsoft and F# Software Foundation - Visual F# Compiler FSharp functional programming - $(FSharpSourcesRoot)\..\$(Configuration)\coreclr\bin - -rtm-$(BuildRevision.Trim())-0 - $(FSPackageVersion)$(PreReleaseSuffix) - -prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(PackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)" - - - - - - diff --git a/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuget.proj b/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuget.proj new file mode 100644 index 0000000000..53ed79e8ac --- /dev/null +++ b/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuget.proj @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuget.proj b/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuget.proj new file mode 100644 index 0000000000..dc9f19add5 --- /dev/null +++ b/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuget.proj @@ -0,0 +1,11 @@ + + + + + + + + + + + From 923f42cbf33c0b17dd51ce54529b228db9aff968 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Wed, 31 Jan 2018 09:42:21 -0800 Subject: [PATCH 023/147] Dev15.6 -- Fix multi-targetting / F# IDE (#4286) * Fix multi-targetting * Refactor * address project relative paths --- .../FSharp.Editor/LanguageService/LanguageService.fs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index 96540a8373..25c9fe6a28 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -226,13 +226,21 @@ type internal FSharpProjectOptionsManager [] /// This handles commandline change notifications from the Dotnet Project-system + /// Prior to VS 15.7 path contained path to project file, post 15.7 contains target binpath + /// binpath is more accurate because a project file can have multiple in memory projects based on configuration member this.HandleCommandLineChanges(path:string, sources:ImmutableArray, references:ImmutableArray, options:ImmutableArray) = + let projectId = + match workspace.ProjectTracker.TryGetProjectByBinPath(path) with + | true, project -> project.Id + | false, _ -> workspace.ProjectTracker.GetOrCreateProjectIdForPath(path, projectDisplayNameOf path) + let project = workspace.ProjectTracker.GetProject(projectId) + let path = project.ProjectFilePath let fullPath p = - if Path.IsPathRooted(p) then p + if Path.IsPathRooted(p) || path = null then p else Path.Combine(Path.GetDirectoryName(path), p) let sourcePaths = sources |> Seq.map(fun s -> fullPath s.Path) |> Seq.toArray let referencePaths = references |> Seq.map(fun r -> fullPath r.Reference) |> Seq.toArray - let projectId = workspace.ProjectTracker.GetOrCreateProjectIdForPath(path, projectDisplayNameOf path) + projectOptionsTable.SetOptionsWithProjectId(projectId, sourcePaths, referencePaths, options.ToArray()) this.UpdateProjectInfoWithProjectId(projectId, "HandleCommandLineChanges", invalidateConfig=true) From a11a8b6ce9155f83134e12aafed0e64468b6d4be Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Wed, 31 Jan 2018 13:32:46 -0800 Subject: [PATCH 024/147] Add manifests for product construction (#4290) --- PublishToBlob.proj | 17 ++++++++++++++--- packages.config | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/PublishToBlob.proj b/PublishToBlob.proj index 21dbb9300e..8066cb1ef3 100644 --- a/PublishToBlob.proj +++ b/PublishToBlob.proj @@ -10,7 +10,7 @@ Microsoft.DotNet.Build.Tasks.Feed - 1.0.0-prerelease-02219-01 + 2.1.0-prerelease-02419-02 @@ -24,12 +24,23 @@ + Overwrite="$(PublishOverwrite)" + ManifestBranch="$(ManifestBranch)" + ManifestBuildId="$(ManifestBuildId)" + ManifestCommit="$(ManifestCommit)" + ManifestName="fsharp" + SkipCreateManifest="false" /> + + Overwrite="$(PublishOverwrite)" + ManifestBranch="$(ManifestBranch)" + ManifestBuildId="$(ManifestBuildId)" + ManifestCommit="$(ManifestCommit)" + ManifestName="fsharp" + SkipCreateManifest="false" /> diff --git a/packages.config b/packages.config index ee97e4a98d..12479d822d 100644 --- a/packages.config +++ b/packages.config @@ -12,7 +12,7 @@ - + From 316976ec394d6a7af7c85a73005783153475b478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbyn=C4=9Bk=20Sailer?= Date: Fri, 2 Feb 2018 18:12:57 +0100 Subject: [PATCH 025/147] LOC CHECKIN | visualfsharp dev15.6 | 20180202 (#4305) --- src/fsharp/xlf/FSComp.txt.cs.xlf | 2 +- src/fsharp/xlf/FSComp.txt.de.xlf | 2 +- src/fsharp/xlf/FSComp.txt.es.xlf | 2 +- src/fsharp/xlf/FSComp.txt.fr.xlf | 2 +- src/fsharp/xlf/FSComp.txt.it.xlf | 2 +- src/fsharp/xlf/FSComp.txt.ja.xlf | 2 +- src/fsharp/xlf/FSComp.txt.ko.xlf | 2 +- src/fsharp/xlf/FSComp.txt.pl.xlf | 2 +- src/fsharp/xlf/FSComp.txt.pt-BR.xlf | 2 +- src/fsharp/xlf/FSComp.txt.ru.xlf | 2 +- src/fsharp/xlf/FSComp.txt.tr.xlf | 2 +- src/fsharp/xlf/FSComp.txt.zh-Hans.xlf | 2 +- src/fsharp/xlf/FSComp.txt.zh-Hant.xlf | 2 +- .../TutorialProject/Template/xlf/Tutorial.fsx.ja.xlf | 4 ++-- .../src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.cs.xlf | 8 ++++---- .../src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf | 8 ++++---- .../src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.es.xlf | 8 ++++---- .../src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.fr.xlf | 8 ++++---- .../src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.it.xlf | 8 ++++---- .../src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf | 8 ++++---- .../src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf | 8 ++++---- .../src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pl.xlf | 8 ++++---- .../FSharp.ProjectSystem.FSharp/xlf/VSPackage.pt-BR.xlf | 8 ++++---- .../src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ru.xlf | 8 ++++---- .../src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf | 8 ++++---- .../FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hans.xlf | 8 ++++---- .../FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hant.xlf | 8 ++++---- 27 files changed, 67 insertions(+), 67 deletions(-) diff --git a/src/fsharp/xlf/FSComp.txt.cs.xlf b/src/fsharp/xlf/FSComp.txt.cs.xlf index 476c099ebd..c79be706d1 100644 --- a/src/fsharp/xlf/FSComp.txt.cs.xlf +++ b/src/fsharp/xlf/FSComp.txt.cs.xlf @@ -6969,7 +6969,7 @@ This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. - This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. + Tato metoda nebo vlastnost se obvykle z kódu F# nepoužívá, použijte místo toho pro dekonstrukci explicitní vzor řazené kolekce členů. diff --git a/src/fsharp/xlf/FSComp.txt.de.xlf b/src/fsharp/xlf/FSComp.txt.de.xlf index b29c138b02..8ff290372d 100644 --- a/src/fsharp/xlf/FSComp.txt.de.xlf +++ b/src/fsharp/xlf/FSComp.txt.de.xlf @@ -6969,7 +6969,7 @@ This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. - This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. + Diese Methode oder Eigenschaft wird normalerweise nicht aus dem F#-Code verwendet. Nutzen Sie stattdessen zur Dekonstruktion ein explizites Tupelmuster. diff --git a/src/fsharp/xlf/FSComp.txt.es.xlf b/src/fsharp/xlf/FSComp.txt.es.xlf index d8c26154a4..fac5764866 100644 --- a/src/fsharp/xlf/FSComp.txt.es.xlf +++ b/src/fsharp/xlf/FSComp.txt.es.xlf @@ -6969,7 +6969,7 @@ This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. - This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. + Este método o propiedad no se utiliza normalmente desde código F#, use un modelo de tupla explícito para la deconstrucción en su lugar. diff --git a/src/fsharp/xlf/FSComp.txt.fr.xlf b/src/fsharp/xlf/FSComp.txt.fr.xlf index 198262498d..10f4b9f2fc 100644 --- a/src/fsharp/xlf/FSComp.txt.fr.xlf +++ b/src/fsharp/xlf/FSComp.txt.fr.xlf @@ -6969,7 +6969,7 @@ This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. - This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. + Normalement, cette méthode ou propriété n'est pas utilisée dans le code F#. Utilisez plutôt un modèle de tuple explicite pour la déconstruction. diff --git a/src/fsharp/xlf/FSComp.txt.it.xlf b/src/fsharp/xlf/FSComp.txt.it.xlf index dfd630f692..e53aa55a45 100644 --- a/src/fsharp/xlf/FSComp.txt.it.xlf +++ b/src/fsharp/xlf/FSComp.txt.it.xlf @@ -6969,7 +6969,7 @@ This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. - This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. + Questo metodo o questa proprietà non è in genere usato dal codice F#. Per la decostruzione usare invece un criterio di tupla esplicito. diff --git a/src/fsharp/xlf/FSComp.txt.ja.xlf b/src/fsharp/xlf/FSComp.txt.ja.xlf index e2d550f93b..e1f5ceff5f 100644 --- a/src/fsharp/xlf/FSComp.txt.ja.xlf +++ b/src/fsharp/xlf/FSComp.txt.ja.xlf @@ -6969,7 +6969,7 @@ This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. - This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. + このメソッドまたはプロパティは通常、F# コードから使用されません。代わりに、明示的なタプル パターンを分解に使用してください。 diff --git a/src/fsharp/xlf/FSComp.txt.ko.xlf b/src/fsharp/xlf/FSComp.txt.ko.xlf index db7e9de8df..5b559a63ca 100644 --- a/src/fsharp/xlf/FSComp.txt.ko.xlf +++ b/src/fsharp/xlf/FSComp.txt.ko.xlf @@ -6969,7 +6969,7 @@ This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. - This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. + 이 메서드 또는 속성은 일반적으로 F# 코드에서 사용되지 않습니다. 대신 분해에 대해 명시적 튜플 패턴을 사용하세요. diff --git a/src/fsharp/xlf/FSComp.txt.pl.xlf b/src/fsharp/xlf/FSComp.txt.pl.xlf index 51e36c34c8..ad7667fb07 100644 --- a/src/fsharp/xlf/FSComp.txt.pl.xlf +++ b/src/fsharp/xlf/FSComp.txt.pl.xlf @@ -6969,7 +6969,7 @@ This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. - This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. + Ta metoda lub właściwość nie jest zwykle używana z kodu języka F#. Zamiast tego do dekonstrukcji użyj jawnego wzorca krotki. diff --git a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf index de3c1d8bc3..cdaeee1cdc 100644 --- a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf +++ b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf @@ -6969,7 +6969,7 @@ This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. - This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. + Essa propriedade ou esse método normalmente não é usado no código F#. Use um padrão de tupla explícito para a desconstrução. diff --git a/src/fsharp/xlf/FSComp.txt.ru.xlf b/src/fsharp/xlf/FSComp.txt.ru.xlf index bd4e2fefc1..98dbe82166 100644 --- a/src/fsharp/xlf/FSComp.txt.ru.xlf +++ b/src/fsharp/xlf/FSComp.txt.ru.xlf @@ -6969,7 +6969,7 @@ This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. - This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. + Этот метод или свойство обычно не используется в коде F#. Вместо этого используйте явный шаблон кортежа для деконструкции. diff --git a/src/fsharp/xlf/FSComp.txt.tr.xlf b/src/fsharp/xlf/FSComp.txt.tr.xlf index 0519a565c1..8e3f343c17 100644 --- a/src/fsharp/xlf/FSComp.txt.tr.xlf +++ b/src/fsharp/xlf/FSComp.txt.tr.xlf @@ -6969,7 +6969,7 @@ This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. - This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. + Bu metot veya özellik normalde F# kodundan kullanılmaz, bunun yerine ayrıştırma için açıkça bir demet deseni kullanın. diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf index 9a280a5257..874613201b 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf @@ -6969,7 +6969,7 @@ This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. - This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. + 通常不通过 F# 代码使用此方法或属性,而是改用显式元组模式进行析构。 diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf index d051d6988f..08102beb66 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf @@ -6969,7 +6969,7 @@ This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. - This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. + F# 程式碼不常使用這個方法或屬性,請改用明確的元組模式進行解構。 diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.ja.xlf b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.ja.xlf index a384149acd..6e1fe4af58 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.ja.xlf +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.ja.xlf @@ -159,12 +159,12 @@ Values in F# are immutable by default. They cannot be changed - 既定では、F# の値は不変です。明示的に変更可能として指定しない限り、プログラムの実行の過程で変更することはできません。 + 既定では、F# の値は不変です。明示的に変更可能として指定しない限り、 in the course of a program's execution unless explicitly marked as mutable. - + プログラムの実行の過程で変更することはできません。 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.cs.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.cs.xlf index 6c12879261..e0b731bc07 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.cs.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.cs.xlf @@ -434,12 +434,12 @@ Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# Tools 10.1 pro F# 4.1 Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# Tools 10.1 pro F# 4.1 @@ -449,12 +449,12 @@ Microsoft Visual F# Tools - Microsoft Visual F# + Microsoft Visual F# Tools Visual F# Tools 10.1 for F# 4.1 - Visual F# 4.1 + Visual F# Tools 10.1 pro F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf index 225f5a0144..02cbc8a503 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf @@ -434,12 +434,12 @@ Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# Tools 10.1 für F# 4.1 Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# Tools 10.1 für F# 4.1 @@ -449,12 +449,12 @@ Microsoft Visual F# Tools - Microsoft Visual F# + Microsoft Visual F# Tools Visual F# Tools 10.1 for F# 4.1 - Visual F# 4.1 + Visual F# Tools 10.1 für F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.es.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.es.xlf index c905201e46..acf633e91f 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.es.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.es.xlf @@ -434,12 +434,12 @@ Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# 4.1 + Herramientas de Microsoft Visual F# 10.1 para F# 4.1 Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# 4.1 + Herramientas de Microsoft Visual F# 10.1 para F# 4.1 @@ -449,12 +449,12 @@ Microsoft Visual F# Tools - Microsoft Visual F# + Herramientas de Microsoft Visual F# Visual F# Tools 10.1 for F# 4.1 - Visual F# 4.1 + Herramientas de Visual F# 10.1 para F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.fr.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.fr.xlf index ca6e834ef3..7e044d3523 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.fr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.fr.xlf @@ -434,12 +434,12 @@ Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# Tools 10.1 pour F# 4.1 Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# Tools 10.1 pour F# 4.1 @@ -449,12 +449,12 @@ Microsoft Visual F# Tools - Microsoft Visual F# + Microsoft Visual F# Tools Visual F# Tools 10.1 for F# 4.1 - Visual F# 4.1 + Visual F# Tools 10.1 pour F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.it.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.it.xlf index f6b954d7f1..e7f5739ea4 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.it.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.it.xlf @@ -434,12 +434,12 @@ Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# Tools 10.1 per F# 4.1 Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# Tools 10.1 per F# 4.1 @@ -449,12 +449,12 @@ Microsoft Visual F# Tools - Microsoft Visual F# + Microsoft Visual F# Tools Visual F# Tools 10.1 for F# 4.1 - Visual F# 4.1 + Visual F# Tools 10.1 per F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf index 11cd810b6a..a93164380e 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf @@ -434,12 +434,12 @@ Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# Tools 10.1 for F# 4.1 Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# Tools 10.1 for F# 4.1 @@ -449,12 +449,12 @@ Microsoft Visual F# Tools - Microsoft Visual F# + Microsoft Visual F# Tools Visual F# Tools 10.1 for F# 4.1 - Visual F# 4.1 + Visual F# Tools 10.1 for F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf index 0f81736c59..01446eb80d 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf @@ -434,12 +434,12 @@ Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# 4.1 + F# 4.1용 Microsoft Visual F# Tools 10.1 Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# 4.1 + F# 4.1용 Microsoft Visual F# Tools 10.1 @@ -449,12 +449,12 @@ Microsoft Visual F# Tools - Microsoft Visual F# + Microsoft Visual F# Tools Visual F# Tools 10.1 for F# 4.1 - Visual F# 4.1 + F# 4.1용 Visual F# Tools 10.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pl.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pl.xlf index 5937f9a66f..5fc2d93bc8 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pl.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pl.xlf @@ -434,12 +434,12 @@ Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# Tools 10.1 for F# 4.1 Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# Tools 10.1 for F# 4.1 @@ -449,12 +449,12 @@ Microsoft Visual F# Tools - Microsoft Visual F# + Microsoft Visual F# Tools Visual F# Tools 10.1 for F# 4.1 - Visual F# 4.1 + Visual F# Tools 10.1 for F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pt-BR.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pt-BR.xlf index ea13b97eca..83d2731d30 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pt-BR.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.pt-BR.xlf @@ -434,12 +434,12 @@ Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# Tools 10.1 para F# 4.1 Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# Tools 10.1 para F# 4.1 @@ -449,12 +449,12 @@ Microsoft Visual F# Tools - Microsoft Visual F# + Microsoft Visual F# Tools Visual F# Tools 10.1 for F# 4.1 - Visual F# 4.1 + Visual F# Tools 10.1 para F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ru.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ru.xlf index 49dd2c071b..5d5828acf8 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ru.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ru.xlf @@ -434,12 +434,12 @@ Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# Tools 10.1 для F# 4.1 Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# Tools 10.1 для F# 4.1 @@ -449,12 +449,12 @@ Microsoft Visual F# Tools - Microsoft Visual F# + Microsoft Visual F# Tools Visual F# Tools 10.1 for F# 4.1 - Visual F# 4.1 + Visual F# Tools 10.1 для F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf index 5a04d4e69a..ec718c3ec1 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf @@ -434,12 +434,12 @@ Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# 4.1 + F# 4.1 için Microsoft Visual F# Tools 10.1 Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# 4.1 + F# 4.1 için Microsoft Visual F# Tools 10.1 @@ -449,12 +449,12 @@ Microsoft Visual F# Tools - Microsoft Visual F# + Microsoft Visual F# Tools Visual F# Tools 10.1 for F# 4.1 - Visual F# 4.1 + F# 4.1 için Visual F# Araçları 10.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hans.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hans.xlf index 7430f25d6d..898b3599dc 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hans.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hans.xlf @@ -434,12 +434,12 @@ Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# Tools 10.1 for F# 4.1 Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# Tools 10.1 for F# 4.1 @@ -449,12 +449,12 @@ Microsoft Visual F# Tools - Microsoft Visual F# + Microsoft Visual F# Tools Visual F# Tools 10.1 for F# 4.1 - Visual F# 4.1 + Visual F# Tools 10.1 for F# 4.1 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hant.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hant.xlf index 4a3c1624a0..b2cb3abbc2 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hant.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hant.xlf @@ -434,12 +434,12 @@ Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# Tools 10.1 for F# 4.1 Microsoft Visual F# Tools 10.1 for F# 4.1 - Microsoft Visual F# 4.1 + Microsoft Visual F# Tools 10.1 for F# 4.1 @@ -449,12 +449,12 @@ Microsoft Visual F# Tools - Microsoft Visual F# + Microsoft Visual F# Tools Visual F# Tools 10.1 for F# 4.1 - Visual F# 4.1 + Visual F# Tools 10.1 for F# 4.1 From e13a0584ac4b2c8af576cdb6ff692b8df3a7904c Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Mon, 5 Feb 2018 12:54:07 -0800 Subject: [PATCH 026/147] enable Microsoft.DiaSymReader* packages to be overridden during build --- build.cmd | 21 +++++++++++ build.sh | 16 +++++++++ build/projects/PrepareDependencyUptake.proj | 35 +++++++++++++++++++ src/FSharpSource.Settings.targets | 6 ++++ .../FSharp.Compiler.Private.fsproj | 4 +-- 5 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 build/projects/PrepareDependencyUptake.proj diff --git a/build.cmd b/build.cmd index 6f7e9d5062..01d2d0f27d 100644 --- a/build.cmd +++ b/build.cmd @@ -605,6 +605,27 @@ if "%RestorePackages%" == "true" ( call %~dp0init-tools.cmd +echo ----------- Done with package restore, starting dependency uptake check ------------- + +if not "%PB_PackageVersionPropsUrl%" == "" ( + set dependencyUptakeDir=%~dp0Tools\dependencyUptake + if not exist "!dependencyUptakeDir!" mkdir "!dependencyUptakeDir!" + + :: download package version overrides + echo powershell -noprofile -executionPolicy RemoteSigned -command "Invoke-WebRequest -Uri '%PB_PackageVersionPropsUrl%' -OutFile '!dependencyUptakeDir!\PackageVersions.props'" + powershell -noprofile -executionPolicy RemoteSigned -command "Invoke-WebRequest -Uri '%PB_PackageVersionPropsUrl%' -OutFile '!dependencyUptakeDir!\PackageVersions.props'" + if ERRORLEVEL 1 echo Error downloading package version properties && goto :failure + + :: prepare dependency uptake files + echo %_msbuildexe% %msbuildflags% %~dp0build\projects\PrepareDependencyUptake.proj /t:Build + %_msbuildexe% %msbuildflags% %~dp0build\projects\PrepareDependencyUptake.proj /t:Build + if ERRORLEVEL 1 echo Error building dependency uptake files && goto :failure + + :: restore dependencies + %_nugetexe% restore !dependencyUptakeDir!\packages.config -PackagesDirectory packages -ConfigFile !dependencyUptakeDir!\NuGet.config + if ERRORLEVEL 1 echo Error restoring dependency uptake packages && goto :failure +) + set _dotnetcliexe=%~dp0Tools\dotnetcli\dotnet.exe set _dotnet20exe=%~dp0Tools\dotnet20\dotnet.exe set NUGET_PACKAGES=%~dp0Packages diff --git a/build.sh b/build.sh index 2d15c1a934..8e3e2c9e6a 100755 --- a/build.sh +++ b/build.sh @@ -486,6 +486,22 @@ fi # TODO: Check for existence of fsi (either on the system, or from the FSharp.Compiler.Tools package that was restored). +build_status "Done with package restore, starting dependency uptake check" + +if [ "$PB_PACKAGEVERSIONPROPSURL" != "" ]; then + dependencyUptakeDir="${_scriptdir}Tools/dependencyUptake" + mkdir -p "$dependencyUptakeDir" + + # download package version overrides + { printeval "curl '$PB_PACKAGEVERSIONPROPSURL' -o '$dependencyUptakeDir/PackageVersions.props'"; } || failwith "downloading package version properties failed" + + # prepare dependency uptake files + { printeval "$_msbuildexe $msbuildflags ${scriptdir}build/projects/PrepareDependencyUptake.proj /t:Build"; } || failwith "building dependency uptake files failed" + + # restore dependencies + { printeval "$_nugetexe restore '$dependencyUptakeDir/packages.config' -PackagesDirectory packages -ConfigFile '$dependencyUptakeDir/NuGet.config'"; } || failwith "restoring dependency uptake packages failed" +fi + build_status "Done with package restore, starting proto" # Decide if Proto need building diff --git a/build/projects/PrepareDependencyUptake.proj b/build/projects/PrepareDependencyUptake.proj new file mode 100644 index 0000000000..0f8d1931cb --- /dev/null +++ b/build/projects/PrepareDependencyUptake.proj @@ -0,0 +1,35 @@ + + + + $(MSBuildThisFileDirectory)..\..\Tools\dependencyUptake + $(DependencyUptakeDirectory)\PackageVersions.props + $(DependencyUptakeDirectory)\packages.config + $(DependencyUptakeDirectory)\NuGet.config + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/FSharpSource.Settings.targets b/src/FSharpSource.Settings.targets index ba7f575de8..f40da98682 100644 --- a/src/FSharpSource.Settings.targets +++ b/src/FSharpSource.Settings.targets @@ -82,6 +82,9 @@ 15.3.23 15.3.15 + 1.1.0 + 1.2.0 + 4.1.19 4.1 @@ -99,6 +102,7 @@ $(FSharpSourcesRoot)\..\packages\NUnit.$(NUnitVersion)\lib\net45 $(FSharpSourcesRoot)\..\packages\NUnit.ConsoleRunner\$(NUnitVersion)\tools\ + $(MSBuildThisFileDirectory)..\Tools\dependencyUptake\PackageVersions.props true @@ -106,6 +110,8 @@ + + fs diff --git a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj index f812dd3569..b9aebe7952 100644 --- a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj +++ b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj @@ -671,10 +671,10 @@ - ..\..\..\packages\Microsoft.DiaSymReader.PortablePdb.1.2.0\lib\portable-net45+win8\Microsoft.DiaSymReader.PortablePdb.dll + ..\..\..\packages\Microsoft.DiaSymReader.PortablePdb.$(MicrosoftDiaSymReaderPortablePdbPackageVersion)\lib\netstandard1.1\Microsoft.DiaSymReader.PortablePdb.dll - ..\..\..\packages\Microsoft.DiaSymReader.1.1.0\lib\portable-net45+win8\Microsoft.DiaSymReader.dll + ..\..\..\packages\Microsoft.DiaSymReader.$(MicrosoftDiaSymReaderPackageVersion)\lib\netstandard1.1\Microsoft.DiaSymReader.dll ..\..\..\packages\System.Reflection.Metadata.1.4.2\lib\portable-net45+win8\System.Reflection.Metadata.dll From bfeb5d2396d4af5ee1e625dd5e7cab5d6183af63 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Mon, 5 Feb 2018 16:02:22 -0800 Subject: [PATCH 027/147] propagate Microsoft.DiaSymReader* version overrides to NuGet packages --- .../FSharp.Compiler.nuget/FSharp.Compiler.nuget.fsproj | 4 ++-- .../FSharp.Compiler.Template.nuget.props | 2 +- .../FSharp.Compiler.Template.nuget.targets | 2 +- .../FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec | 4 ++-- .../FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/buildfromsource/FSharp.Compiler.nuget/FSharp.Compiler.nuget.fsproj b/src/buildfromsource/FSharp.Compiler.nuget/FSharp.Compiler.nuget.fsproj index 3737779f56..4b53785231 100644 --- a/src/buildfromsource/FSharp.Compiler.nuget/FSharp.Compiler.nuget.fsproj +++ b/src/buildfromsource/FSharp.Compiler.nuget/FSharp.Compiler.nuget.fsproj @@ -21,12 +21,12 @@ Visual F# Compiler FSharp functional programming -rc-$(BuildRevision.Trim())-0 4.2.0$(PreReleaseSuffix) - -prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(PackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)" + -prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(PackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)" -prop "diasymreaderversion=1.1.0" -prop "diasymreaderportablepdbversion=1.2.0" $(FSharpSourcesRoot)\fsharp\FSharp.Compiler.nuget\Microsoft.FSharp.Compiler.nuspec - licenseUrl=$(PackageLicenceUrl);version=$(PackageVersion);authors=$(PackageAuthors);projectUrl=$(PackageProjectUrl);tags=$(PackageTags) + licenseUrl=$(PackageLicenceUrl);version=$(PackageVersion);authors=$(PackageAuthors);projectUrl=$(PackageProjectUrl);tags=$(PackageTags);diasymreaderversion=1.1.0;diasymreaderportablepdbversion=1.2.0 $(OutputPath)/$(TargetFramework) diff --git a/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.props b/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.props index bb30ab3a76..ca04df941b 100644 --- a/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.props +++ b/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.props @@ -15,6 +15,6 @@ $(FSharpSourcesRoot)\..\$(Configuration)\coreclr\bin -rtm-$(BuildRevision.Trim())-0 $(FSPackageVersion)$(PreReleaseSuffix) - -prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(PackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)" + -prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(PackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)" -prop "diasymreaderversion=$(MicrosoftDiaSymReaderPackageVersion)" -prop "diasymreaderportablepdbversion=$(MicrosoftDiaSymReaderPortablePdbPackageVersion)" diff --git a/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.targets b/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.targets index d8a8818e91..d6715e4aa3 100644 --- a/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.targets +++ b/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.targets @@ -34,7 +34,7 @@ Outputs='$(FSharpSourcesRoot)\$(Configuration)\artifacts\$(PackageVersion)\"%(PackageNuspec.Filename)).nupkg'> - -prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(PackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)" + -prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(PackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)" -prop "diasymreaderversion=$(MicrosoftDiaSymReaderPackageVersion)" -prop "diasymreaderportablepdbversion=$(MicrosoftDiaSymReaderPortablePdbPackageVersion)" diff --git a/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec b/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec index 23bc64d34a..bc4d615110 100644 --- a/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec +++ b/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec @@ -33,8 +33,8 @@ - - + + diff --git a/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec b/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec index 81093eb472..0782573e05 100644 --- a/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec +++ b/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec @@ -32,8 +32,8 @@ - - + + From 2f971f76d4602189f7c836ac3222c5c5ccfc3cb4 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Thu, 8 Feb 2018 11:22:36 -0800 Subject: [PATCH 028/147] bump shipping nuget package version numbers --- src/FSharpSource.Settings.targets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FSharpSource.Settings.targets b/src/FSharpSource.Settings.targets index f40da98682..e2f59659cb 100644 --- a/src/FSharpSource.Settings.targets +++ b/src/FSharpSource.Settings.targets @@ -22,7 +22,7 @@ 4.4.3.0 10.1.1.0 - 10.1.2 + 10.1.3 15.6.0.0 @@ -88,7 +88,7 @@ 4.1.19 4.1 - 4.3.3 + 4.3.4 4.3 From d54adbcc6bade5ac645cee5886f974354eed2fde Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Wed, 7 Feb 2018 09:45:42 -0800 Subject: [PATCH 029/147] use fsi for assembly version check --- build.cmd | 9 +++++++-- .../AssemblyVersionCheck.fsproj | 16 ---------------- .../{Program.fs => AssemblyVersionCheck.fsx} | 16 ++++++++++++---- 3 files changed, 19 insertions(+), 22 deletions(-) delete mode 100644 tests/fsharpqa/testenv/src/AssemblyVersionCheck/AssemblyVersionCheck.fsproj rename tests/fsharpqa/testenv/src/AssemblyVersionCheck/{Program.fs => AssemblyVersionCheck.fsx} (88%) diff --git a/build.cmd b/build.cmd index 01d2d0f27d..fb3a968541 100644 --- a/build.cmd +++ b/build.cmd @@ -603,7 +603,10 @@ if "%RestorePackages%" == "true" ( ) ) -call %~dp0init-tools.cmd +if "%BUILD_PROTO_WITH_CORECLR_LKG%" == "1" ( + :: Restore the Tools directory + call %~dp0init-tools.cmd +) echo ----------- Done with package restore, starting dependency uptake check ------------- @@ -696,7 +699,9 @@ if "%BUILD_PHASE%" == "1" ( echo ---------------- Done with build, starting assembly version checks --------------- set asmvercheckpath=%~dp0tests\fsharpqa\testenv\src\AssemblyVersionCheck -%_dotnet20exe% run -p "%asmvercheckpath%\AssemblyVersionCheck.fsproj" "%~dp0build\config\AssemblySignToolData.json" "%~dp0%BUILD_CONFIG%" + +echo "%~dp0%BUILD_CONFIG%\net40\bin\fsi.exe" %asmvercheckpath%\AssemblyVersionCheck.fsx -- "%~dp0build\config\AssemblySignToolData.json" "%~dp0%BUILD_CONFIG%" + "%~dp0%BUILD_CONFIG%\net40\bin\fsi.exe" %asmvercheckpath%\AssemblyVersionCheck.fsx -- "%~dp0build\config\AssemblySignToolData.json" "%~dp0%BUILD_CONFIG%" if ERRORLEVEL 1 echo Error verifying assembly versions and commit hashes. && goto :failure echo ---------------- Done with assembly version checks, starting assembly signing --------------- diff --git a/tests/fsharpqa/testenv/src/AssemblyVersionCheck/AssemblyVersionCheck.fsproj b/tests/fsharpqa/testenv/src/AssemblyVersionCheck/AssemblyVersionCheck.fsproj deleted file mode 100644 index b1ba63d83f..0000000000 --- a/tests/fsharpqa/testenv/src/AssemblyVersionCheck/AssemblyVersionCheck.fsproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - Exe - netcoreapp2.0 - - - - - - - - - - - diff --git a/tests/fsharpqa/testenv/src/AssemblyVersionCheck/Program.fs b/tests/fsharpqa/testenv/src/AssemblyVersionCheck/AssemblyVersionCheck.fsx similarity index 88% rename from tests/fsharpqa/testenv/src/AssemblyVersionCheck/Program.fs rename to tests/fsharpqa/testenv/src/AssemblyVersionCheck/AssemblyVersionCheck.fsx index 0289499804..17621946c5 100644 --- a/tests/fsharpqa/testenv/src/AssemblyVersionCheck/Program.fs +++ b/tests/fsharpqa/testenv/src/AssemblyVersionCheck/AssemblyVersionCheck.fsx @@ -1,4 +1,7 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +// this was restored by packages.config in the root +#r @"..\..\..\..\..\packages\Newtonsoft.Json.8.0.1\lib\net45\Newtonsoft.Json.dll" open System open System.Diagnostics @@ -78,10 +81,15 @@ module AssemblyVersionCheck = // return code is the number of failures failedVersionCheck.Length + failedCommitHash.Length -[] -let main argv = +let main (argv:string array) = if argv.Length <> 2 then - printfn "Usage: AssemblyVersionCheck.exe SignToolData.json path/to/binaries" + printfn "Usage: fsi.exe AssemblyVersionCheck.fsx -- SignToolData.json path/to/binaries" 1 else AssemblyVersionCheck.verifyAssemblyVersions argv.[0] argv.[1] + +Environment.GetCommandLineArgs() +|> Seq.skipWhile ((<>) "--") +|> Seq.skip 1 +|> Array.ofSeq +|> main From c9db2ce76ad1c939da192335426a2fb36742840c Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Thu, 8 Feb 2018 13:31:11 -0800 Subject: [PATCH 030/147] add manual helper script to verify all translations --- src/scripts/VerifyAllTranslations.fsx | 39 +++++++++++++++++++++++++++ verify-translations.cmd | 3 +++ 2 files changed, 42 insertions(+) create mode 100644 src/scripts/VerifyAllTranslations.fsx create mode 100644 verify-translations.cmd diff --git a/src/scripts/VerifyAllTranslations.fsx b/src/scripts/VerifyAllTranslations.fsx new file mode 100644 index 0000000000..24e2d4eebb --- /dev/null +++ b/src/scripts/VerifyAllTranslations.fsx @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +// verifies that all translations in all .xlf files have `state="translated"`. + +#r "System.Xml.Linq" + +open System +open System.IO +open System.Xml.Linq + +// usage: fsi VerifyAllTranslations.fsx -- baseDirectory +let baseDirectory = + Environment.GetCommandLineArgs() + |> Seq.skipWhile ((<>) "--") + |> Seq.skip 1 + |> Seq.head + +let hasUntranslatedStrings (xlfFile:string) = + let doc = XDocument.Load(xlfFile) + let untranslatedStates = + doc.Root.Descendants() + |> Seq.filter (fun (elem:XElement) -> elem.Name.LocalName = "target") + |> Seq.map (fun (elem:XElement) -> elem.Attribute(XName.op_Implicit("state"))) + |> Seq.filter (isNull >> not) + |> Seq.map (fun (attr:XAttribute) -> attr.Value) + |> Seq.filter ((<>) "translated") + Seq.length untranslatedStates > 0 + +let filesWithMissingTranslations = + Directory.EnumerateFiles(baseDirectory, "*.xlf", SearchOption.AllDirectories) + |> Seq.filter (fun (file:string) -> file.EndsWith(".en.xlf") |> not) // the english baseline files are never translated + |> Seq.filter hasUntranslatedStrings + |> Seq.toList + +match filesWithMissingTranslations with +| [] -> printfn "All .xlf files have translations assigned." +| _ -> + printfn "The following .xlf files have untranslated strings (state != 'translated'):\n\t%s" (String.Join("\n\t", filesWithMissingTranslations)) + Environment.Exit(1) diff --git a/verify-translations.cmd b/verify-translations.cmd new file mode 100644 index 0000000000..6717de0f77 --- /dev/null +++ b/verify-translations.cmd @@ -0,0 +1,3 @@ +@echo off + +%~dp0release\net40\bin\fsi.exe %~dp0src\scripts\VerifyAllTranslations.fsx -- %~dp0 From 5d666fa7d687a690920c3781f0ebe3eb28a72716 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Thu, 8 Feb 2018 23:24:12 -0800 Subject: [PATCH 031/147] miscfiles (#4318) --- .../src/FSharp.Editor/LanguageService/LanguageService.fs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index 25c9fe6a28..e7992ad410 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -359,6 +359,7 @@ type override this.Initialize() = base.Initialize() + let workspaceChanged (args:WorkspaceChangeEventArgs) = match args.Kind with | WorkspaceChangeKind.ProjectAdded -> this.OnProjectAdded(args.ProjectId) @@ -585,12 +586,13 @@ type match hier with | :? IProvideProjectSite as siteProvider when not (IsScript(filename)) -> this.SetupProjectFile(siteProvider, this.Workspace, "SetupNewTextView") - | _ when not (IsScript(filename)) -> + | h when not (IsScript(filename)) -> let docId = this.Workspace.CurrentSolution.GetDocumentIdsWithFilePath(filename).FirstOrDefault() match docId with | null -> - let fileContents = VsTextLines.GetFileContents(textLines, textViewAdapter) - this.SetupStandAloneFile(filename, fileContents, this.Workspace, hier) + if not (h.IsCapabilityMatch("CPS")) then + let fileContents = VsTextLines.GetFileContents(textLines, textViewAdapter) + this.SetupStandAloneFile(filename, fileContents, this.Workspace, hier) | id -> projectInfoManager.UpdateProjectInfoWithProjectId(id.ProjectId, "SetupNewTextView", invalidateConfig=true) | _ -> From 2bcb342c2687a13e586052de9000d44ad86b156a Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Thu, 8 Feb 2018 23:29:53 -0800 Subject: [PATCH 032/147] Revert "miscfiles (#4318)" This reverts commit 5d666fa7d687a690920c3781f0ebe3eb28a72716. --- .../src/FSharp.Editor/LanguageService/LanguageService.fs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index e7992ad410..25c9fe6a28 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -359,7 +359,6 @@ type override this.Initialize() = base.Initialize() - let workspaceChanged (args:WorkspaceChangeEventArgs) = match args.Kind with | WorkspaceChangeKind.ProjectAdded -> this.OnProjectAdded(args.ProjectId) @@ -586,13 +585,12 @@ type match hier with | :? IProvideProjectSite as siteProvider when not (IsScript(filename)) -> this.SetupProjectFile(siteProvider, this.Workspace, "SetupNewTextView") - | h when not (IsScript(filename)) -> + | _ when not (IsScript(filename)) -> let docId = this.Workspace.CurrentSolution.GetDocumentIdsWithFilePath(filename).FirstOrDefault() match docId with | null -> - if not (h.IsCapabilityMatch("CPS")) then - let fileContents = VsTextLines.GetFileContents(textLines, textViewAdapter) - this.SetupStandAloneFile(filename, fileContents, this.Workspace, hier) + let fileContents = VsTextLines.GetFileContents(textLines, textViewAdapter) + this.SetupStandAloneFile(filename, fileContents, this.Workspace, hier) | id -> projectInfoManager.UpdateProjectInfoWithProjectId(id.ProjectId, "SetupNewTextView", invalidateConfig=true) | _ -> From cb6c45689dfbe8452036b2c2622c719ab54dd7c2 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Mon, 12 Feb 2018 16:14:50 -0800 Subject: [PATCH 033/147] only publish Microsoft.FSharp.Compiler.* package to the blob feed --- PublishToBlob.proj | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/PublishToBlob.proj b/PublishToBlob.proj index 8066cb1ef3..6d71be84df 100644 --- a/PublishToBlob.proj +++ b/PublishToBlob.proj @@ -16,8 +16,7 @@ - - + @@ -30,17 +29,6 @@ ManifestCommit="$(ManifestCommit)" ManifestName="fsharp" SkipCreateManifest="false" /> - - From 72a18ee6c51e4df8c99d8d64ee5a9448d9f272de Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 13 Feb 2018 16:26:13 +0000 Subject: [PATCH 034/147] revert #4173 (i.e. reapply #1650 and #3366) This reverts commit f9893b6ad7c90aea37fe25e721840f8ea2033075. --- src/fsharp/ConstraintSolver.fs | 58 +++++++++++-------- .../OverloadingMembers/OverloadsAndSRTPs01.fs | 38 ------------ .../OverloadingMembers/RecursiveOverload01.fs | 26 --------- .../SlowOverloadResolution.fs | 4 +- .../OverloadingMembers/env.lst | 2 - 5 files changed, 36 insertions(+), 92 deletions(-) delete mode 100644 tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/OverloadsAndSRTPs01.fs delete mode 100644 tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/RecursiveOverload01.fs diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index 9758d9859b..336eea3e28 100644 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -370,6 +370,7 @@ let ShowAccessDomain ad = // Solve exception NonRigidTypar of DisplayEnv * string option * range * TType * TType * range +exception LocallyAbortOperationThatFailsToResolveOverload exception LocallyAbortOperationThatLosesAbbrevs let localAbortD = ErrorD LocallyAbortOperationThatLosesAbbrevs @@ -738,19 +739,19 @@ and solveTypMeetsTyparConstraints (csenv:ConstraintSolverEnv) ndeep m2 trace ty | Some destTypar -> AddConstraint csenv ndeep m2 trace destTypar (TyparConstraint.DefaultsTo(priority, dty, m)) - | TyparConstraint.SupportsNull m2 -> SolveTypSupportsNull csenv ndeep m2 trace ty - | TyparConstraint.IsEnum(underlying, m2) -> SolveTypIsEnum csenv ndeep m2 trace ty underlying - | TyparConstraint.SupportsComparison(m2) -> SolveTypeSupportsComparison csenv ndeep m2 trace ty - | TyparConstraint.SupportsEquality(m2) -> SolveTypSupportsEquality csenv ndeep m2 trace ty + | TyparConstraint.SupportsNull m2 -> SolveTypSupportsNull csenv ndeep m2 trace ty + | TyparConstraint.IsEnum(underlying, m2) -> SolveTypIsEnum csenv ndeep m2 trace ty underlying + | TyparConstraint.SupportsComparison(m2) -> SolveTypeSupportsComparison csenv ndeep m2 trace ty + | TyparConstraint.SupportsEquality(m2) -> SolveTypSupportsEquality csenv ndeep m2 trace ty | TyparConstraint.IsDelegate(aty, bty, m2) -> SolveTypIsDelegate csenv ndeep m2 trace ty aty bty - | TyparConstraint.IsNonNullableStruct m2 -> SolveTypIsNonNullableValueType csenv ndeep m2 trace ty - | TyparConstraint.IsUnmanaged m2 -> SolveTypIsUnmanaged csenv ndeep m2 trace ty - | TyparConstraint.IsReferenceType m2 -> SolveTypIsReferenceType csenv ndeep m2 trace ty - | TyparConstraint.RequiresDefaultConstructor m2 -> SolveTypRequiresDefaultConstructor csenv ndeep m2 trace ty + | TyparConstraint.IsNonNullableStruct m2 -> SolveTypIsNonNullableValueType csenv ndeep m2 trace ty + | TyparConstraint.IsUnmanaged m2 -> SolveTypIsUnmanaged csenv ndeep m2 trace ty + | TyparConstraint.IsReferenceType m2 -> SolveTypIsReferenceType csenv ndeep m2 trace ty + | TyparConstraint.RequiresDefaultConstructor m2 -> SolveTypRequiresDefaultConstructor csenv ndeep m2 trace ty | TyparConstraint.SimpleChoice(tys, m2) -> SolveTypChoice csenv ndeep m2 trace ty tys | TyparConstraint.CoercesTo(ty2, m2) -> SolveTypSubsumesTypKeepAbbrevs csenv ndeep m2 trace None ty2 ty - | TyparConstraint.MayResolveMember(traitInfo, m2) -> - SolveMemberConstraint csenv false ndeep m2 trace traitInfo ++ (fun _ -> CompleteD) + | TyparConstraint.MayResolveMember(traitInfo, m2) -> + SolveMemberConstraint csenv false false ndeep m2 trace traitInfo ++ (fun _ -> CompleteD) ))) @@ -760,7 +761,6 @@ and SolveTypEqualsTyp (csenv:ConstraintSolverEnv) ndeep m2 (trace: OptionalTrace let ndeep = ndeep + 1 let aenv = csenv.EquivEnv let g = csenv.g - if ty1 === ty2 then CompleteD else match cxsln with | Some (traitInfo, traitSln) when traitInfo.Solution.IsNone -> @@ -768,6 +768,8 @@ and SolveTypEqualsTyp (csenv:ConstraintSolverEnv) ndeep m2 (trace: OptionalTrace TransactMemberConstraintSolution traitInfo trace traitSln | _ -> () + if ty1 === ty2 then CompleteD else + let canShortcut = not trace.HasTrace let sty1 = stripTyEqnsA csenv.g canShortcut ty1 let sty2 = stripTyEqnsA csenv.g canShortcut ty2 @@ -941,7 +943,7 @@ and SolveDimensionlessNumericType (csenv:ConstraintSolverEnv) ndeep m2 trace ty /// We pretend int and other types support a number of operators. In the actual IL for mscorlib they /// don't, however the type-directed static optimization rules in the library code that makes use of this /// will deal with the problem. -and SolveMemberConstraint (csenv:ConstraintSolverEnv) permitWeakResolution ndeep m2 trace (TTrait(tys,nm,memFlags,argtys,rty,sln)) : OperationResult = +and SolveMemberConstraint (csenv:ConstraintSolverEnv) ignoreUnresolvedOverload permitWeakResolution ndeep m2 trace (TTrait(tys, nm, memFlags, argtys, rty, sln)): OperationResult = // Do not re-solve if already solved if sln.Value.IsSome then ResultD true else let g = csenv.g @@ -1298,9 +1300,12 @@ and SolveMemberConstraint (csenv:ConstraintSolverEnv) permitWeakResolution ndeep let frees = GetFreeTyparsOfMemberConstraint csenv traitInfo // If there's nothing left to learn then raise the errors - (if (permitWeakResolution && isNil support) || isNil frees then errors - // Otherwise re-record the trait waiting for canonicalization - else AddMemberConstraint csenv ndeep m2 trace traitInfo support frees) ++ (fun () -> ResultD TTraitUnsolved) + (if (permitWeakResolution && isNil support) || isNil frees then errors + // Otherwise re-record the trait waiting for canonicalization + else AddMemberConstraint csenv ndeep m2 trace traitInfo support frees) ++ (fun () -> + match errors with + | ErrorResult (_, UnresolvedOverloading _) when not ignoreUnresolvedOverload && (not (nm = "op_Explicit" || nm = "op_Implicit")) -> ErrorD LocallyAbortOperationThatFailsToResolveOverload + | _ -> ResultD TTraitUnsolved) ) ++ (fun res -> RecordMemberConstraintSolution csenv.SolverState m trace traitInfo res)) @@ -1442,7 +1447,7 @@ and SolveRelevantMemberConstraintsForTypar (csenv:ConstraintSolverEnv) ndeep per cxs |> AtLeastOneD (fun (traitInfo, m2) -> let csenv = { csenv with m = m2 } - SolveMemberConstraint csenv permitWeakResolution (ndeep+1) m2 trace traitInfo) + SolveMemberConstraint csenv true permitWeakResolution (ndeep+1) m2 trace traitInfo) and CanonicalizeRelevantMemberConstraints (csenv:ConstraintSolverEnv) ndeep trace tps = SolveRelevantMemberConstraints csenv ndeep true trace tps @@ -1957,10 +1962,12 @@ and CanMemberSigsMatchUpToCheck // to allow us to report the outer types involved in the constraint and private SolveTypSubsumesTypWithReport (csenv:ConstraintSolverEnv) ndeep m trace cxsln ty1 ty2 = TryD (fun () -> SolveTypSubsumesTypKeepAbbrevs csenv ndeep m trace cxsln ty1 ty2) - (fun res -> - match csenv.eContextInfo with - | ContextInfo.RuntimeTypeTest isOperator -> - // test if we can cast other way around + (function + | LocallyAbortOperationThatFailsToResolveOverload -> CompleteD + | res -> + match csenv.eContextInfo with + | ContextInfo.RuntimeTypeTest isOperator -> + // test if we can cast other way around match CollectThenUndo (fun newTrace -> SolveTypSubsumesTypKeepAbbrevs csenv ndeep m (OptionalTrace.WithTrace newTrace) cxsln ty2 ty1) with | OkResult _ -> ErrorD (ErrorsFromAddingSubsumptionConstraint(csenv.g, csenv.DisplayEnv, ty1, ty2, res, ContextInfo.DowncastUsedInsteadOfUpcast isOperator, m)) | _ -> ErrorD (ErrorsFromAddingSubsumptionConstraint(csenv.g, csenv.DisplayEnv, ty1, ty2, res, ContextInfo.NoContext, m)) @@ -1968,7 +1975,9 @@ and private SolveTypSubsumesTypWithReport (csenv:ConstraintSolverEnv) ndeep m tr and private SolveTypEqualsTypWithReport (csenv:ConstraintSolverEnv) ndeep m trace cxsln ty1 ty2 = TryD (fun () -> SolveTypEqualsTypKeepAbbrevsWithCxsln csenv ndeep m trace cxsln ty1 ty2) - (fun res -> ErrorD (ErrorFromAddingTypeEquation(csenv.g, csenv.DisplayEnv, ty1, ty2, res, m))) + (function + | LocallyAbortOperationThatFailsToResolveOverload -> CompleteD + | res -> ErrorD (ErrorFromAddingTypeEquation(csenv.g, csenv.DisplayEnv, ty1, ty2, res, m))) and ArgsMustSubsumeOrConvert (csenv:ConstraintSolverEnv) @@ -2534,7 +2543,7 @@ let AddCxTypeMustSubsumeType contextInfo denv css m trace ty1 ty2 = |> RaiseOperationResult let AddCxMethodConstraint denv css m trace traitInfo = - TryD (fun () -> SolveMemberConstraint (MakeConstraintSolverEnv ContextInfo.NoContext css m denv) false 0 m trace traitInfo ++ (fun _ -> CompleteD)) + TryD (fun () -> SolveMemberConstraint (MakeConstraintSolverEnv ContextInfo.NoContext css m denv) true false 0 m trace traitInfo ++ (fun _ -> CompleteD)) (fun res -> ErrorD (ErrorFromAddingConstraint(denv, res, m))) |> RaiseOperationResult @@ -2592,7 +2601,7 @@ let CodegenWitnessThatTypSupportsTraitConstraint tcVal g amap m (traitInfo:Trait InfoReader = new InfoReader(g, amap) } let csenv = MakeConstraintSolverEnv ContextInfo.NoContext css m (DisplayEnv.Empty g) - SolveMemberConstraint csenv true 0 m NoTrace traitInfo ++ (fun _res -> + SolveMemberConstraint csenv true true 0 m NoTrace traitInfo ++ (fun _res -> let sln = match traitInfo.Solution with | None -> Choice4Of4() @@ -2717,4 +2726,5 @@ let IsApplicableMethApprox g amap m (minfo:MethInfo) availObjTy = |> CommitOperationResult | _ -> true else - true \ No newline at end of file + true + diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/OverloadsAndSRTPs01.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/OverloadsAndSRTPs01.fs deleted file mode 100644 index 842d049dc9..0000000000 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/OverloadsAndSRTPs01.fs +++ /dev/null @@ -1,38 +0,0 @@ -// #Conformance #DeclarationElements #MemberDefinitions #Overloading -// Exotic case from F#+ https://github.com/gusty/FSharpPlus - -module Applicatives = - open System - - type Ap = Ap with - static member inline Invoke (x:'T) : '``Applicative<'T>`` = - let inline call (mthd : ^M, output : ^R) = ((^M or ^R) : (static member Return: _*_ -> _) output, mthd) - call (Ap, Unchecked.defaultof<'``Applicative<'T>``>) x - static member inline InvokeOnInstance (x:'T) = (^``Applicative<'T>`` : (static member Return: ^T -> ^``Applicative<'T>``) x) - static member inline Return (r:'R , _:obj) = Ap.InvokeOnInstance :_ -> 'R - static member Return (_:seq<'a> , Ap ) = fun x -> Seq.singleton x : seq<'a> - static member Return (_:Tuple<'a>, Ap ) = fun x -> Tuple x : Tuple<'a> - static member Return (_:'r -> 'a , Ap ) = fun k _ -> k : 'a -> 'r -> _ - - let inline result (x:'T) = Ap.Invoke x - - let inline (<*>) (f:'``Applicative<'T->'U>``) (x:'``Applicative<'T>``) : '``Applicative<'U>`` = - (( ^``Applicative<'T->'U>`` or ^``Applicative<'T>`` or ^``Applicative<'U>``) : (static member (<*>): _*_ -> _) f, x) - - let inline (+) (a:'Num) (b:'Num) :'Num = a + b - - type ZipList<'s> = ZipList of 's seq with - static member Return (x:'a) = ZipList (Seq.initInfinite (fun _ -> x)) - static member (<*>) (ZipList (f:seq<'a->'b>), ZipList x) = ZipList (Seq.zip f x |> Seq.map (fun (f, x) -> f x)) :ZipList<'b> - - type Ii = Ii - type Idiomatic = Idiomatic with - static member inline ($) (Idiomatic, si) = fun sfi x -> (Idiomatic $ x) (sfi <*> si) - static member ($) (Idiomatic, Ii) = id - let inline idiomatic a b = (Idiomatic $ b) a - let inline iI x = (idiomatic << result) x - - let res1n2n3 = iI (+) (result 0M ) (ZipList [1M;2M;3M]) Ii - let res2n3n4 = iI (+) (result LanguagePrimitives.GenericOne) (ZipList [1 ;2 ;3 ]) Ii - - exit 0 \ No newline at end of file diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/RecursiveOverload01.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/RecursiveOverload01.fs deleted file mode 100644 index e8d9355ad4..0000000000 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/RecursiveOverload01.fs +++ /dev/null @@ -1,26 +0,0 @@ -// #Conformance #DeclarationElements #MemberDefinitions #Overloading -// Originally from https://gist.github.com/gusty/b6fac370bff36a665d75 -type FoldArgs<'t> = FoldArgs of ('t -> 't -> 't) - -let inline foldArgs f (x:'t) (y:'t) :'rest = (FoldArgs f $ Unchecked.defaultof<'rest>) x y - -type FoldArgs<'t> with - static member inline ($) (FoldArgs f, _:'t-> 'rest) = fun (a:'t) -> f a >> foldArgs f - static member ($) (FoldArgs f, _:'t ) = f - -let test1() = - let x:int = foldArgs (+) 2 3 - let y:int = foldArgs (+) 2 3 4 - let z:int = foldArgs (+) 2 3 4 5 - let d:decimal = foldArgs (+) 2M 3M 4M - let e:string = foldArgs (+) "h" "e" "l" "l" "o" - let f:float = foldArgs (+) 2. 3. 4. - - let mult3Numbers a b c = a * b * c - let res2 = mult3Numbers 3 (foldArgs (+) 3 4) (foldArgs (+) 2 2 3 3) - () - -// Run the test -test1() - -exit 0 \ No newline at end of file diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/SlowOverloadResolution.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/SlowOverloadResolution.fs index 0f6d5f4353..5737cdebf2 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/SlowOverloadResolution.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/SlowOverloadResolution.fs @@ -1,6 +1,6 @@ // #Conformance #DeclarationElements #MemberDefinitions #Overloading // https://github.com/Microsoft/visualfsharp/issues/351 - slow overlaod resolution -//No overloads match +//This value is not a function and cannot be applied type Switcher = Switcher let inline checker< ^s, ^r when (^s or ^r) : (static member pass : ^r -> unit)> (s : ^s) (r : ^r) = () @@ -22,4 +22,4 @@ let main argv = let res : unit = format () "text" 5 "more text" () printfn "%A" res System.Console.ReadKey() - 0 // return an integer exit code \ No newline at end of file + 0 // return an integer exit code diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/env.lst b/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/env.lst index e123d552e6..7a3e95f230 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/env.lst +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/env.lst @@ -27,8 +27,6 @@ NOMONO,NoMT SOURCE=ConsumeOverloadGenericMethods.fs SCFLAGS="-r:lib.dll" PRECMD= SOURCE=InferenceForLambdaArgs.fs # InferenceForLambdaArgs.fs SOURCE=SlowOverloadResolution.fs # SlowOverloadResolution.fs - SOURCE=RecursiveOverload01.fs # RecursiveOverload01.fs - SOURCE=OverloadsAndSRTPs01.fs # OverloadsAndSRTPs01.fs SOURCE=E_OverloadCurriedFunc.fs # E_OverloadCurriedFunc.fs SOURCE=NoWarningWhenOverloadingInSubClass01.fs SCFLAGS="--warnaserror" # NoWarningWhenOverloadingInSubClass01.fs From 7e8574f82520748e9f51126202ec7a61cbb33f36 Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Tue, 13 Feb 2018 11:34:32 -0800 Subject: [PATCH 035/147] Update version numbers --- src/FSharpSource.Settings.targets | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FSharpSource.Settings.targets b/src/FSharpSource.Settings.targets index e2f59659cb..6fb4d68ae7 100644 --- a/src/FSharpSource.Settings.targets +++ b/src/FSharpSource.Settings.targets @@ -22,7 +22,7 @@ 4.4.3.0 10.1.1.0 - 10.1.3 + 10.1.4 15.6.0.0 @@ -88,7 +88,7 @@ 4.1.19 4.1 - 4.3.4 + 4.3.5 4.3 From fb54266950ec5ed8a1ffcf3e28abd91f47d51ec1 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Tue, 27 Feb 2018 16:46:42 -0800 Subject: [PATCH 036/147] convert FSharp.PropertyPages to use PackageReference --- build/targets/PackageVersions.props | 3 + .../fsharp-vsintegration-src-build.proj | 12 +- .../Project/ProjectSystem.Base.csproj | 2 +- .../AssemblyInfo.vb | 12 -- .../Directory.Build.props | 3 + .../Directory.Build.targets | 3 + .../FSharp.PropertiesPages.vbproj | 153 +++--------------- .../PropertyPages/ApplicationPropPage.vb | 6 - 8 files changed, 30 insertions(+), 164 deletions(-) create mode 100644 vsintegration/src/FSharp.ProjectSystem.PropertyPages/Directory.Build.props create mode 100644 vsintegration/src/FSharp.ProjectSystem.PropertyPages/Directory.Build.targets diff --git a/build/targets/PackageVersions.props b/build/targets/PackageVersions.props index 1f4aa446ad..54a5d08870 100644 --- a/build/targets/PackageVersions.props +++ b/build/targets/PackageVersions.props @@ -19,6 +19,7 @@ 15.0.26201 15.0.26201 15.0.26201 + 8.0.50727 15.0.26201 8.0.50727 14.3.25407 @@ -33,10 +34,12 @@ 7.10.6070 8.0.50727 10.0.30319 + 9.0.30729 15.1.192 12.0.4 7.0.4 8.0.4 + 11.0.4 7.0.4 diff --git a/vsintegration/fsharp-vsintegration-src-build.proj b/vsintegration/fsharp-vsintegration-src-build.proj index 0a1a54e3a3..4e0c3eb16d 100644 --- a/vsintegration/fsharp-vsintegration-src-build.proj +++ b/vsintegration/fsharp-vsintegration-src-build.proj @@ -16,20 +16,10 @@ - - - - - - - - - - - + diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj index 5a2a45325b..f4a34ebf7e 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj @@ -65,7 +65,7 @@ - + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/AssemblyInfo.vb b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/AssemblyInfo.vb index 488f284286..a852e3a339 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/AssemblyInfo.vb +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/AssemblyInfo.vb @@ -1,17 +1,5 @@ ' Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -Imports System -Imports System.Reflection -Imports System.Runtime.CompilerServices Imports Microsoft.VisualStudio.Shell -'/* F# additions: begin. */ - - - - - - - - diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Directory.Build.props b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Directory.Build.props new file mode 100644 index 0000000000..bb8eac309b --- /dev/null +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Directory.Build.props @@ -0,0 +1,3 @@ + + + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Directory.Build.targets b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Directory.Build.targets new file mode 100644 index 0000000000..ccd47cc0a9 --- /dev/null +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Directory.Build.targets @@ -0,0 +1,3 @@ + + + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj index b30b8687d9..6b09d70628 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj @@ -1,12 +1,7 @@  - - $(MSBuildProjectDirectory)\..\..\..\src - VisualBasic - 15.4.1.0 - vb - + Debug net40 @@ -29,35 +24,17 @@ false 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036 40026;42105;42107;42353 - - true v4.6 - true + true false false true true true - - true - $(FSharpSourcesRoot)\fsharp\msft.pubkey - STRONG_NAME_AND_DELAY_SIGN_FSHARP_COMPILER_WITH_MSFT_KEY=True,$(DefineConstants) - true - true - - - - $(FSharpSourcesRoot)\..\loc\lcl\{Lang}\$(AssemblyName).dll.lcl - $(FSharpSourcesRoot)\..\loc\lci\$(AssemblyName).dll.lci - false - false - - - - + @@ -78,106 +55,19 @@ - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.WCFReference.Interop.9.0.30729\lib\Microsoft.VisualStudio.WCFReference.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.ManagedInterfaces.8.0.50727\lib\Microsoft.VisualStudio.ManagedInterfaces.dll - True - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSLangProj.7.0.4\lib\net20\VSLangProj.dll - True - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSLangProj.8.8.0.4\lib\net20\VSLangProj80.dll - True - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSLangProj.9.9.0.4\lib\net20\VSLangProj90.dll - True - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSLangProj.10.10.0.4\lib\net20\VSLangProj100.dll - True - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSLangProj.11.11.0.4\lib\net20\VSLangProj110.dll - True - - - $(FSharpSourcesRoot)\..\packages\EnvDTE.8.0.1\lib\net10\EnvDTE.dll - True - - - $(FSharpSourcesRoot)\..\packages\EnvDTE80.8.0.1\lib\net10\EnvDTE80.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.OLE.Interop.7.10.6070\lib\Microsoft.VisualStudio.OLE.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Immutable.10.0.10.0.30319\lib\net40\Microsoft.VisualStudio.Shell.Immutable.10.0.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Immutable.11.0.11.0.50727\lib\net45\Microsoft.VisualStudio.Shell.Immutable.11.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.ProjectAggregator.8.0.50727\lib\net45\Microsoft.VisualStudio.ProjectAggregator.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Design.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Shell.Design.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.$(RoslynVSBinariesVersion).$(RoslynVSPackagesVersion)\lib\Microsoft.VisualStudio.Shell.$(RoslynVSBinariesVersion).dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Framework.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Shell.Framework.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Threading.$(MicrosoftVisualStudioThreadingVersion)\lib\net45\Microsoft.VisualStudio.Threading.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Utilities.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Utilities.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.7.10.6071\lib\Microsoft.VisualStudio.Shell.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.Shell.Interop.8.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.9.0.9.0.30729\lib\Microsoft.VisualStudio.Shell.Interop.9.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.10.0.10.0.30319\lib\Microsoft.VisualStudio.Shell.Interop.10.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.11.0.11.0.61030\lib\Microsoft.VisualStudio.Shell.Interop.11.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.TextManager.Interop.7.10.6070\lib\Microsoft.VisualStudio.TextManager.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSHelp.7.0.4\lib\net20\Microsoft.VisualStudio.VSHelp.dll - True - - - ProjectSystem.Base - {b700e38b-f8c0-4e49-b5ec-db7b7ac0c4e7} - True - + + + + + + + + + + + + + @@ -374,12 +264,7 @@ - + - - $(SuiteBinPath)\FSharp - - - - - \ No newline at end of file + + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPage.vb b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPage.vb index b76c242469..8d3e34c941 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPage.vb +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/ApplicationPropPage.vb @@ -75,14 +75,8 @@ Namespace Microsoft.VisualStudio.Editors.PropertyPages m_OutputTypeStringKeys(INDEX_COMMANDLINEAPP) = SR.GetString(SR.PPG_CommandLineApp) m_OutputTypeStringKeys(INDEX_WINDOWSCLASSLIB) = SR.GetString(SR.PPG_WindowsClassLib) -#If VS_VERSION_DEV14 Then - Dim v20FSharpRedistKey As String = "HKEY_LOCAL_MACHINE\Software\Microsoft\FSharp\4.0\Runtime\v2.0" - Dim v40FSharpRedistKey As String = "HKEY_LOCAL_MACHINE\Software\Microsoft\FSharp\4.0\Runtime\v4.0" -#End If -#If VS_VERSION_DEV15 Then Dim v20FSharpRedistKey As String = "HKEY_LOCAL_MACHINE\Software\Microsoft\FSharp\4.1\Runtime\v2.0" Dim v40FSharpRedistKey As String = "HKEY_LOCAL_MACHINE\Software\Microsoft\FSharp\4.1\Runtime\v4.0" -#End If m_v20FSharpRedistInstalled = Not (IsNothing(Microsoft.Win32.Registry.GetValue(v20FSharpRedistKey, Nothing, Nothing))) m_v40FSharpRedistInstalled = Not (IsNothing(Microsoft.Win32.Registry.GetValue(v40FSharpRedistKey, Nothing, Nothing))) From 8b2d73278e582ecc2accaabad189d0226125d67f Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Wed, 28 Feb 2018 08:49:41 -0800 Subject: [PATCH 037/147] Update feed tasks version Now matching the dev15.6 branch --- PublishToBlob.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PublishToBlob.proj b/PublishToBlob.proj index c4b4991b9a..6d71be84df 100644 --- a/PublishToBlob.proj +++ b/PublishToBlob.proj @@ -10,7 +10,7 @@ Microsoft.DotNet.Build.Tasks.Feed - 1.0.0-prerelease-02219-01 + 2.1.0-prerelease-02419-02 From fa801428f72c9f368452b5bb64e10844a7010911 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Wed, 28 Feb 2018 12:17:30 -0800 Subject: [PATCH 038/147] Remove unsupported `-c` switch from `dotnet restore` --- build.cmd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.cmd b/build.cmd index 5b1cca884b..278dadf852 100644 --- a/build.cmd +++ b/build.cmd @@ -662,8 +662,8 @@ set path=%~dp0Tools\dotnet20\;%path% if "%NEEDS_DOTNET_CLI_TOOLS%" == "1" ( :: Restore projects using dotnet CLI tool - echo %_dotnet20exe% restore -v:d build-everything.proj -c Proto %msbuildflags% %BUILD_DIAG% - %_dotnet20exe% restore -v:d build-everything.proj -c Proto %msbuildflags% %BUILD_DIAG% + echo %_dotnet20exe% restore -v:d build-everything.proj %msbuildflags% %BUILD_DIAG% + %_dotnet20exe% restore -v:d build-everything.proj %msbuildflags% %BUILD_DIAG% ) From a50f4c5dab26e1410e3f3e7333720ac4bb64bf4c Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Wed, 28 Feb 2018 13:41:57 -0800 Subject: [PATCH 039/147] Debugger View for lists (#4399) --- src/fsharp/FSharp.Core/prim-types.fs | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/fsharp/FSharp.Core/prim-types.fs b/src/fsharp/FSharp.Core/prim-types.fs index 4d77b8d81b..58a25a2b8e 100644 --- a/src/fsharp/FSharp.Core/prim-types.fs +++ b/src/fsharp/FSharp.Core/prim-types.fs @@ -3043,30 +3043,35 @@ namespace Microsoft.FSharp.Collections // List (debug view) //------------------------------------------------------------------------- - and + and ListDebugView<'T>(l:list<'T>) = - let ListDebugViewMaxLength = 50 - let rec count l n = - match l with - | [] -> n - | _::t -> if n > ListDebugViewMaxLength then n else count t (n+1) + let ListDebugViewMaxLength = 50 // default displayed Max Length + let ListDebugViewMaxFullLength = 5000 // display only when FullList opened (5000 is a super big display used to cut-off an infinite list or undebuggably huge one) + let rec count l n max = + match l with + | [] -> n + | _::t -> if n > max then n else count t (n+1) max - [] - member x.Items = - let n = count l 0 - let items = zeroCreate n + let items length = + let items = zeroCreate length let rec copy (items: 'T[]) l i = match l with | [] -> () | h::t -> - if i < n then + if i < length then SetArray items i h copy items t (i+1) copy items l 0 items + [] + member x.Items = items (count l 0 ListDebugViewMaxLength) + + [] + member x._FullList = items (count l 0 ListDebugViewMaxFullLength) + type ResizeArray<'T> = System.Collections.Generic.List<'T> //------------------------------------------------------------------------- From e0ce4a44da0ff255d567925a06bf427d4f9f4eb6 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Wed, 28 Feb 2018 11:33:14 -0800 Subject: [PATCH 040/147] consolidate Directory.Build.props/.targets --- vsintegration/src/{FSharp.Editor => }/Directory.Build.props | 0 vsintegration/src/{FSharp.Editor => }/Directory.Build.targets | 0 .../src/FSharp.LanguageService.Base/Directory.Build.props | 3 --- .../src/FSharp.LanguageService.Base/Directory.Build.targets | 3 --- vsintegration/src/FSharp.LanguageService/Directory.Build.props | 3 --- .../src/FSharp.LanguageService/Directory.Build.targets | 3 --- .../FSharp.ProjectSystem.Base/Project/Directory.Build.props | 3 --- .../FSharp.ProjectSystem.Base/Project/Directory.Build.targets | 3 --- .../src/FSharp.ProjectSystem.FSharp/Directory.Build.props | 3 --- .../src/FSharp.ProjectSystem.FSharp/Directory.Build.targets | 3 --- .../FSharp.ProjectSystem.PropertyPages/Directory.Build.props | 3 --- .../FSharp.ProjectSystem.PropertyPages/Directory.Build.targets | 3 --- vsintegration/src/FSharp.UIResources/Directory.Build.props | 3 --- vsintegration/src/FSharp.UIResources/Directory.Build.targets | 3 --- vsintegration/src/FSharp.VS.FSI/Directory.Build.props | 3 --- vsintegration/src/FSharp.VS.FSI/Directory.Build.targets | 3 --- 16 files changed, 42 deletions(-) rename vsintegration/src/{FSharp.Editor => }/Directory.Build.props (100%) rename vsintegration/src/{FSharp.Editor => }/Directory.Build.targets (100%) delete mode 100644 vsintegration/src/FSharp.LanguageService.Base/Directory.Build.props delete mode 100644 vsintegration/src/FSharp.LanguageService.Base/Directory.Build.targets delete mode 100644 vsintegration/src/FSharp.LanguageService/Directory.Build.props delete mode 100644 vsintegration/src/FSharp.LanguageService/Directory.Build.targets delete mode 100644 vsintegration/src/FSharp.ProjectSystem.Base/Project/Directory.Build.props delete mode 100644 vsintegration/src/FSharp.ProjectSystem.Base/Project/Directory.Build.targets delete mode 100644 vsintegration/src/FSharp.ProjectSystem.FSharp/Directory.Build.props delete mode 100644 vsintegration/src/FSharp.ProjectSystem.FSharp/Directory.Build.targets delete mode 100644 vsintegration/src/FSharp.ProjectSystem.PropertyPages/Directory.Build.props delete mode 100644 vsintegration/src/FSharp.ProjectSystem.PropertyPages/Directory.Build.targets delete mode 100644 vsintegration/src/FSharp.UIResources/Directory.Build.props delete mode 100644 vsintegration/src/FSharp.UIResources/Directory.Build.targets delete mode 100644 vsintegration/src/FSharp.VS.FSI/Directory.Build.props delete mode 100644 vsintegration/src/FSharp.VS.FSI/Directory.Build.targets diff --git a/vsintegration/src/FSharp.Editor/Directory.Build.props b/vsintegration/src/Directory.Build.props similarity index 100% rename from vsintegration/src/FSharp.Editor/Directory.Build.props rename to vsintegration/src/Directory.Build.props diff --git a/vsintegration/src/FSharp.Editor/Directory.Build.targets b/vsintegration/src/Directory.Build.targets similarity index 100% rename from vsintegration/src/FSharp.Editor/Directory.Build.targets rename to vsintegration/src/Directory.Build.targets diff --git a/vsintegration/src/FSharp.LanguageService.Base/Directory.Build.props b/vsintegration/src/FSharp.LanguageService.Base/Directory.Build.props deleted file mode 100644 index bb8eac309b..0000000000 --- a/vsintegration/src/FSharp.LanguageService.Base/Directory.Build.props +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/vsintegration/src/FSharp.LanguageService.Base/Directory.Build.targets b/vsintegration/src/FSharp.LanguageService.Base/Directory.Build.targets deleted file mode 100644 index ccd47cc0a9..0000000000 --- a/vsintegration/src/FSharp.LanguageService.Base/Directory.Build.targets +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/vsintegration/src/FSharp.LanguageService/Directory.Build.props b/vsintegration/src/FSharp.LanguageService/Directory.Build.props deleted file mode 100644 index bb8eac309b..0000000000 --- a/vsintegration/src/FSharp.LanguageService/Directory.Build.props +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/vsintegration/src/FSharp.LanguageService/Directory.Build.targets b/vsintegration/src/FSharp.LanguageService/Directory.Build.targets deleted file mode 100644 index ccd47cc0a9..0000000000 --- a/vsintegration/src/FSharp.LanguageService/Directory.Build.targets +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Directory.Build.props b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Directory.Build.props deleted file mode 100644 index bb8eac309b..0000000000 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Directory.Build.props +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Directory.Build.targets b/vsintegration/src/FSharp.ProjectSystem.Base/Project/Directory.Build.targets deleted file mode 100644 index ccd47cc0a9..0000000000 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/Directory.Build.targets +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/Directory.Build.props b/vsintegration/src/FSharp.ProjectSystem.FSharp/Directory.Build.props deleted file mode 100644 index bb8eac309b..0000000000 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/Directory.Build.props +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/Directory.Build.targets b/vsintegration/src/FSharp.ProjectSystem.FSharp/Directory.Build.targets deleted file mode 100644 index ccd47cc0a9..0000000000 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/Directory.Build.targets +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Directory.Build.props b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Directory.Build.props deleted file mode 100644 index bb8eac309b..0000000000 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Directory.Build.props +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Directory.Build.targets b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Directory.Build.targets deleted file mode 100644 index ccd47cc0a9..0000000000 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Directory.Build.targets +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/vsintegration/src/FSharp.UIResources/Directory.Build.props b/vsintegration/src/FSharp.UIResources/Directory.Build.props deleted file mode 100644 index bb8eac309b..0000000000 --- a/vsintegration/src/FSharp.UIResources/Directory.Build.props +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/vsintegration/src/FSharp.UIResources/Directory.Build.targets b/vsintegration/src/FSharp.UIResources/Directory.Build.targets deleted file mode 100644 index ccd47cc0a9..0000000000 --- a/vsintegration/src/FSharp.UIResources/Directory.Build.targets +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/vsintegration/src/FSharp.VS.FSI/Directory.Build.props b/vsintegration/src/FSharp.VS.FSI/Directory.Build.props deleted file mode 100644 index bb8eac309b..0000000000 --- a/vsintegration/src/FSharp.VS.FSI/Directory.Build.props +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/vsintegration/src/FSharp.VS.FSI/Directory.Build.targets b/vsintegration/src/FSharp.VS.FSI/Directory.Build.targets deleted file mode 100644 index ccd47cc0a9..0000000000 --- a/vsintegration/src/FSharp.VS.FSI/Directory.Build.targets +++ /dev/null @@ -1,3 +0,0 @@ - - - From b6cce2c9f41e1fe548b55441b91e8cd5d98e737a Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Wed, 28 Feb 2018 15:31:25 -0800 Subject: [PATCH 041/147] convert `vsintegration/tests` to the dotnet SDK --- VisualFSharp.sln | 36 +- build-everything.proj | 8 +- build/targets/PackageVersions.props | 1 + .../fsharp-vsintegration-unittests-build.proj | 14 +- .../FSharp.PropertiesPages.vbproj | 1 + vsintegration/tests/Directory.Build.props | 3 + vsintegration/tests/Directory.Build.targets | 3 + .../tests/Salsa/VisualFSharp.Salsa.fsproj | 211 ++---------- vsintegration/tests/Salsa/VsMocks.fs | 10 - .../Tests.LanguageService.Script.fs | 11 +- .../VisualFSharp.UnitTests.dll.config | 4 +- .../unittests/VisualFSharp.UnitTests.fsproj | 316 +++--------------- 12 files changed, 129 insertions(+), 489 deletions(-) create mode 100644 vsintegration/tests/Directory.Build.props create mode 100644 vsintegration/tests/Directory.Build.targets diff --git a/VisualFSharp.sln b/VisualFSharp.sln index 235b6ebec9..2611b0a6cb 100644 --- a/VisualFSharp.sln +++ b/VisualFSharp.sln @@ -30,9 +30,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ProjectTemplates", "Project EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "VisualFSharp.Salsa", "vsintegration\tests\Salsa\VisualFSharp.Salsa.fsproj", "{FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "VisualFSharp.Salsa", "vsintegration\tests\Salsa\VisualFSharp.Salsa.fsproj", "{FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "VisualFSharp.UnitTests", "vsintegration\tests\unittests\VisualFSharp.UnitTests.fsproj", "{EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "VisualFSharp.UnitTests", "vsintegration\tests\unittests\VisualFSharp.UnitTests.fsproj", "{EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DefinitionLocationAttribute", "vsintegration\tests\unittests\MockTypeProviders\DefinitionLocationAttribute\DefinitionLocationAttribute.csproj", "{DA39AD38-4A58-47BF-9215-E49768295169}" EndProject @@ -246,18 +246,18 @@ Global {B700E38B-F8C0-4E49-B5EC-DB7B7AC0C4E7}.Release|Any CPU.Build.0 = Release|Any CPU {B700E38B-F8C0-4E49-B5EC-DB7B7AC0C4E7}.Release|x86.ActiveCfg = Release|Any CPU {B700E38B-F8C0-4E49-B5EC-DB7B7AC0C4E7}.Release|x86.Build.0 = Release|Any CPU - {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Debug|x86.ActiveCfg = Debug|Any CPU - {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Debug|x86.Build.0 = Debug|Any CPU + {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Debug|Any CPU.ActiveCfg = Proto|Any CPU + {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Debug|Any CPU.Build.0 = Proto|Any CPU + {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Debug|x86.ActiveCfg = Proto|Any CPU + {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Debug|x86.Build.0 = Proto|Any CPU {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Proto|Any CPU.ActiveCfg = Proto|Any CPU {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Proto|Any CPU.Build.0 = Proto|Any CPU {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Proto|x86.ActiveCfg = Proto|Any CPU {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Proto|x86.Build.0 = Proto|Any CPU - {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Release|Any CPU.Build.0 = Release|Any CPU - {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Release|x86.ActiveCfg = Release|Any CPU - {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Release|x86.Build.0 = Release|Any CPU + {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Release|Any CPU.ActiveCfg = Proto|Any CPU + {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Release|Any CPU.Build.0 = Proto|Any CPU + {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Release|x86.ActiveCfg = Proto|Any CPU + {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Release|x86.Build.0 = Proto|Any CPU {6196B0F8-CAEA-4CF1-AF82-1B520F77FE44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6196B0F8-CAEA-4CF1-AF82-1B520F77FE44}.Debug|Any CPU.Build.0 = Debug|Any CPU {6196B0F8-CAEA-4CF1-AF82-1B520F77FE44}.Debug|x86.ActiveCfg = Debug|Any CPU @@ -274,10 +274,10 @@ Global {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Debug|Any CPU.Build.0 = Debug|Any CPU {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Debug|x86.ActiveCfg = Debug|Any CPU {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Debug|x86.Build.0 = Debug|Any CPU - {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Proto|Any CPU.Build.0 = Proto|Any CPU - {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Proto|x86.ActiveCfg = Proto|Any CPU - {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Proto|x86.Build.0 = Proto|Any CPU + {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Proto|Any CPU.ActiveCfg = Release|Any CPU + {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Proto|Any CPU.Build.0 = Release|Any CPU + {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Proto|x86.ActiveCfg = Release|Any CPU + {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Proto|x86.Build.0 = Release|Any CPU {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Release|Any CPU.ActiveCfg = Release|Any CPU {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Release|Any CPU.Build.0 = Release|Any CPU {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Release|x86.ActiveCfg = Release|Any CPU @@ -286,10 +286,10 @@ Global {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Debug|Any CPU.Build.0 = Debug|Any CPU {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Debug|x86.ActiveCfg = Debug|Any CPU {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Debug|x86.Build.0 = Debug|Any CPU - {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Proto|Any CPU.Build.0 = Proto|Any CPU - {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Proto|x86.ActiveCfg = Proto|Any CPU - {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Proto|x86.Build.0 = Proto|Any CPU + {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Proto|Any CPU.ActiveCfg = Release|Any CPU + {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Proto|Any CPU.Build.0 = Release|Any CPU + {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Proto|x86.ActiveCfg = Release|Any CPU + {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Proto|x86.Build.0 = Release|Any CPU {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Release|Any CPU.ActiveCfg = Release|Any CPU {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Release|Any CPU.Build.0 = Release|Any CPU {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Release|x86.ActiveCfg = Release|Any CPU diff --git a/build-everything.proj b/build-everything.proj index 625fc56409..95f28ccc06 100644 --- a/build-everything.proj +++ b/build-everything.proj @@ -103,13 +103,17 @@ - - + + + + true + + diff --git a/build/targets/PackageVersions.props b/build/targets/PackageVersions.props index 54a5d08870..4b11d28976 100644 --- a/build/targets/PackageVersions.props +++ b/build/targets/PackageVersions.props @@ -47,6 +47,7 @@ 8.0.0-alpha 1.0.1 10.0.2 + 3.5.0 0.2.0-beta-000081 diff --git a/vsintegration/fsharp-vsintegration-unittests-build.proj b/vsintegration/fsharp-vsintegration-unittests-build.proj index 73bb45764e..ece2c1eb69 100644 --- a/vsintegration/fsharp-vsintegration-unittests-build.proj +++ b/vsintegration/fsharp-vsintegration-unittests-build.proj @@ -5,8 +5,8 @@ - - + + @@ -23,6 +23,16 @@ + + + + + + + + + + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj index 6b09d70628..26ea4c3577 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj @@ -33,6 +33,7 @@ true true true + true diff --git a/vsintegration/tests/Directory.Build.props b/vsintegration/tests/Directory.Build.props new file mode 100644 index 0000000000..bb8eac309b --- /dev/null +++ b/vsintegration/tests/Directory.Build.props @@ -0,0 +1,3 @@ + + + diff --git a/vsintegration/tests/Directory.Build.targets b/vsintegration/tests/Directory.Build.targets new file mode 100644 index 0000000000..ccd47cc0a9 --- /dev/null +++ b/vsintegration/tests/Directory.Build.targets @@ -0,0 +1,3 @@ + + + diff --git a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj index d0e0cbceb3..be362a884c 100644 --- a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj +++ b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj @@ -1,21 +1,13 @@  - - - $(MSBuildProjectDirectory)\..\..\..\src - FSharp - VisualFSharp.Salsa - - + + - Debug - AnyCPU - 2.0 - {fbd4b354-dc6e-4032-8ec7-c81d8dfb1af7} + net46 Library - VisualFSharp.Salsa $(NoWarn);45;47;52;58;75 - v4.6 + true + true @@ -35,177 +27,40 @@ + + + + + + + + + + + - + - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Framework.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Utilities.Core.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Tasks.Core.dll - - - $(FSharpSourcesRoot)\..\packages\EnvDTE.8.0.1\lib\net10\EnvDTE.dll - True - - - $(FSharpSourcesRoot)\..\packages\EnvDTE80.8.0.1\lib\net10\EnvDTE80.dll - True - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSLangProj.7.0.4\lib\net20\VSLangProj.dll - True - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSLangProj.8.8.0.4\lib\net20\VSLangProj80.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.OLE.Interop.7.10.6070\lib\Microsoft.VisualStudio.OLE.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.7.10.6071\lib\Microsoft.VisualStudio.Shell.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.Shell.Interop.8.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.9.0.9.0.30729\lib\Microsoft.VisualStudio.Shell.Interop.9.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.10.0.10.0.30319\lib\Microsoft.VisualStudio.Shell.Interop.10.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.11.0.11.0.61030\lib\Microsoft.VisualStudio.Shell.Interop.11.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.ProjectAggregator.8.0.50727\lib\net45\Microsoft.VisualStudio.ProjectAggregator.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.TextManager.Interop.7.10.6070\lib\Microsoft.VisualStudio.TextManager.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.TextManager.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.TextManager.Interop.8.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Designer.Interfaces.1.1.4322\lib\microsoft.visualstudio.designer.interfaces.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.Internal.$(RoslynVSPackagesVersion)-alpha\lib\net46\Microsoft.VisualStudio.Text.Internal.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Platform.VSEditor.$(RoslynVSPackagesVersion)-alpha\lib\net46\Microsoft.VisualStudio.Platform.VSEditor.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Platform.VSEditor.Interop.$(RoslynVSPackagesVersion)-alpha\lib\net46\Microsoft.VisualStudio.Platform.VSEditor.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Telemetry.15.0.777-rtm6FAA2C78\lib\net45\Microsoft.VisualStudio.Telemetry.dll - True - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSHelp.7.0.4\lib\net20\Microsoft.VisualStudio.VSHelp.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Threading.$(MicrosoftVisualStudioThreadingVersion)\lib\net45\Microsoft.VisualStudio.Threading.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.UI.Wpf.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Text.UI.Wpf.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.Data.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Text.Data.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.CoreUtility.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.CoreUtility.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Design.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Shell.Design.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.$(RoslynVSBinariesVersion).$(RoslynVSPackagesVersion)\lib\Microsoft.VisualStudio.Shell.$(RoslynVSBinariesVersion).dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.Workspaces.Common.$(RoslynVersion)\lib\netstandard1.3\Microsoft.CodeAnalysis.Workspaces.dll - True - - - True - $(NUnitLibDir)\nunit.framework.dll - - - $(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll - true - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - - - FSharp.Build - {702a7979-bcf9-4c41-853e-3adfc9897890} - True - - - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3} - FSharp.Compiler.Private - True - - - FSharp.Editor - {65e0e82a-eace-4787-8994-888674c2fe87} - True - - - FSharp.LanguageService.Base - {1c5c163c-37ea-4a3c-8ccc-0d34b74bf8ef} - True - - - FSharp.LanguageService - {ee85aab7-cda0-4c4e-bda0-a64ccc413e3f} - True - - - ProjectSystem.Base - {b700e38b-f8c0-4e49-b5ec-db7b7ac0c4e7} - True - - - FSharp.ProjectSystem.FSharp - {6196B0F8-CAEA-4CF1-AF82-1B520F77FE44} - True - + + + + + + + + + + + + + + - - - \ No newline at end of file + + diff --git a/vsintegration/tests/Salsa/VsMocks.fs b/vsintegration/tests/Salsa/VsMocks.fs index d5cc21f4fb..270c41cfc8 100644 --- a/vsintegration/tests/Salsa/VsMocks.fs +++ b/vsintegration/tests/Salsa/VsMocks.fs @@ -1637,18 +1637,8 @@ module internal VsActual = let vsInstallDir = // use the environment variable to find the VS installdir -#if VS_VERSION_DEV12 - let vsvar = System.Environment.GetEnvironmentVariable("VS120COMNTOOLS") - if String.IsNullOrEmpty vsvar then failwith "VS120COMNTOOLS environment variable was not found." -#endif -#if VS_VERSION_DEV14 - let vsvar = System.Environment.GetEnvironmentVariable("VS140COMNTOOLS") - if String.IsNullOrEmpty vsvar then failwith "VS140COMNTOOLS environment variable was not found." -#endif -#if VS_VERSION_DEV15 let vsvar = System.Environment.GetEnvironmentVariable("VS150COMNTOOLS") if String.IsNullOrEmpty vsvar then failwith "VS150COMNTOOLS environment variable was not found." -#endif Path.Combine(vsvar, "..") let CreateEditorCatalog() = diff --git a/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.Script.fs b/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.Script.fs index a43eb1a372..3cd1c64511 100644 --- a/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.Script.fs +++ b/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.Script.fs @@ -1335,16 +1335,7 @@ type UsingMSBuild() as this = use _guard = this.UsingNewVS() let solution = this.CreateSolution() let project = CreateProject(solution,"testproject") - let fsVersion = -#if VS_VERSION_DEV12 - "4.3.1.0" -#endif -#if VS_VERSION_DEV14 - "4.4.0.0" -#endif -#if VS_VERSION_DEV15 - "4.4.1.0" -#endif + let fsVersion = "4.4.1.0" let binariesFolder = match Internal.Utilities.FSharpEnvironment.BinFolderOfDefaultFSharpCompiler(None) with | Some(x) -> x | None -> failwith "Location of binaries folder cannot be found" diff --git a/vsintegration/tests/unittests/VisualFSharp.UnitTests.dll.config b/vsintegration/tests/unittests/VisualFSharp.UnitTests.dll.config index 7aae3905c1..ecda3a7015 100644 --- a/vsintegration/tests/unittests/VisualFSharp.UnitTests.dll.config +++ b/vsintegration/tests/unittests/VisualFSharp.UnitTests.dll.config @@ -20,11 +20,11 @@ - + - + diff --git a/vsintegration/tests/unittests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/unittests/VisualFSharp.UnitTests.fsproj index 2bedabfac1..22ca25f498 100644 --- a/vsintegration/tests/unittests/VisualFSharp.UnitTests.fsproj +++ b/vsintegration/tests/unittests/VisualFSharp.UnitTests.fsproj @@ -1,24 +1,16 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\src - FSharp - VisualFSharp.UnitTests - - - - Debug - 2.0 - {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F} + net46 Library - VisualFSharp.UnitTests - LIBRARY - 58;75 - x86 - v4.6 + $(NoWarn);58;75 NO_PROJECTCRACKER;$(DefineConstants) + true + true + Internal.Utilities.Collections.fsi @@ -148,268 +140,58 @@ Roslyn\DocumentHighlightsServiceTests.fs - - VisualFSharp.UnitTests.dll.config - {VisualStudioVersion} - $(VisualStudioVersion) - {FinalDir} - $([System.IO.Path]::GetFullPath('$(OutputPath)'))\ - + + + + + + + + + + + + + + + + + + + - - + - - - - + + - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Framework.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Utilities.Core.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualFSharp.Msbuild.15.0.1.0.1\lib\net45\Microsoft.Build.Tasks.Core.dll - - - $(FSharpSourcesRoot)\..\packages\EnvDTE.8.0.1\lib\net10\EnvDTE.dll - True - - - $(FSharpSourcesRoot)\..\packages\EnvDTE80.8.0.1\lib\net10\EnvDTE80.dll - True - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSLangProj.7.0.4\lib\net20\VSLangProj.dll - True - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSLangProj.8.8.0.4\lib\net20\VSLangProj80.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.OLE.Interop.7.10.6070\lib\Microsoft.VisualStudio.OLE.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.7.10.6071\lib\Microsoft.VisualStudio.Shell.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.Shell.Interop.8.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.9.0.9.0.30729\lib\Microsoft.VisualStudio.Shell.Interop.9.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.10.0.10.0.30319\lib\Microsoft.VisualStudio.Shell.Interop.10.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Interop.11.0.11.0.61030\lib\Microsoft.VisualStudio.Shell.Interop.11.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.Logic.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Text.Logic.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Threading.$(MicrosoftVisualStudioThreadingVersion)\lib\net45\Microsoft.VisualStudio.Threading.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Validation.$(MicrosoftVisualStudioValidationVersion)\lib\net45\Microsoft.VisualStudio.Validation.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.UI.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Text.UI.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.UI.Wpf.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Text.UI.Wpf.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Text.Data.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Text.Data.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Design.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Shell.Design.dll - True - - - $(FSharpSourcesRoot)\..\packages\RoslynDependencies.Microsoft.VisualStudio.Text.Internal.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Text.Internal.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Language.Intellisense.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Language.Intellisense.dll - True - - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.$(RoslynVSBinariesVersion).$(RoslynVSPackagesVersion)\lib\Microsoft.VisualStudio.Shell.$(RoslynVSBinariesVersion).dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Framework.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Shell.Framework.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.CoreUtility.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.CoreUtility.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Editor.$(RoslynVSPackagesVersion)\lib\net45\Microsoft.VisualStudio.Editor.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.TextManager.Interop.7.10.6070\lib\Microsoft.VisualStudio.TextManager.Interop.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.TextManager.Interop.8.0.8.0.50727\lib\Microsoft.VisualStudio.TextManager.Interop.8.0.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Shell.Immutable.10.0.10.0.30319\lib\net40\Microsoft.VisualStudio.Shell.Immutable.10.0.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Designer.Interfaces.1.1.4322\lib\microsoft.visualstudio.designer.interfaces.dll - - - $(FSharpSourcesRoot)\..\packages\VSSDK.VSHelp.7.0.4\lib\net20\Microsoft.VisualStudio.VSHelp.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.Telemetry.15.0.777-rtm6FAA2C78\lib\net45\Microsoft.VisualStudio.Telemetry.dll - - - True - $(NUnitLibDir)\nunit.framework.dll - - - $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.Common.$(RoslynVersion)\lib\netstandard1.3\Microsoft.CodeAnalysis.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.EditorFeatures.$(RoslynVersion)\lib\net46\Microsoft.CodeAnalysis.EditorFeatures.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.EditorFeatures.Text.$(RoslynVersion)\lib\net46\Microsoft.CodeAnalysis.EditorFeatures.Text.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.Features.$(RoslynVersion)\lib\netstandard1.3\Microsoft.CodeAnalysis.Features.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.CodeAnalysis.Workspaces.Common.$(RoslynVersion)\lib\netstandard1.3\Microsoft.CodeAnalysis.Workspaces.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.VisualStudio.LanguageServices.$(RoslynVersion)\lib\net46\Microsoft.VisualStudio.LanguageServices.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Composition.1.0.30\lib\portable-net45+win8+wp8+wpa81\System.Composition.AttributedModel.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Composition.1.0.30\lib\portable-net45+win8+wp8+wpa81\System.Composition.Convention.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Composition.1.0.30\lib\portable-net45+win8+wp8+wpa81\System.Composition.Hosting.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Composition.1.0.30\lib\portable-net45+win8+wp8+wpa81\System.Composition.Runtime.dll - True - - - $(FSharpSourcesRoot)\..\packages\Microsoft.Composition.1.0.30\lib\portable-net45+win8+wp8+wpa81\System.Composition.TypedParts.dll - True - - - $(FSharpSourcesRoot)\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - True - - - $(FSharpSourcesRoot)\..\packages\System.Threading.Tasks.Dataflow.4.5.24\lib\portable-net45+win8+wp8+wpa81\System.Threading.Tasks.Dataflow.dll - True - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - - - FSharp.Build - {702a7979-bcf9-4c41-853e-3adfc9897890} - True - - - CSharp_Analysis - {887630A3-4B1D-40EA-B8B3-2D842E9C40DB} - True - - - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3} - FSharp.Compiler.Private - True - - - $(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll - true - - - VisualFSharp.Salsa - {fbd4b354-dc6e-4032-8ec7-c81d8dfb1af7} - True - - - FSharp.LanguageService.Base - {1c5c163c-37ea-4a3c-8ccc-0d34b74bf8ef} - True - - - FSharp.LanguageService - {ee85aab7-cda0-4c4e-bda0-a64ccc413e3f} - True - - - ProjectSystem.Base - {b700e38b-f8c0-4e49-b5ec-db7b7ac0c4e7} - True - - - FSharp.ProjectSystem.FSharp - {6196B0F8-CAEA-4CF1-AF82-1B520F77FE44} - True - - - FSharp.Editor - {65e0e82a-eace-4787-8994-888674c2fe87} - True - + + + + + + + + + + + + + + + + + + - - - \ No newline at end of file + + From dfd6b2e60100be3f78525d81a1493c834e4cc899 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Wed, 28 Feb 2018 15:37:07 -0800 Subject: [PATCH 042/147] consolidate Roslyn versions to `RoslynPackageVersion.txt` This will make updating (either manually or automatically) the Roslyn references much easier. --- RoslynPackageVersion.txt | 1 + build/targets/PackageVersions.props | 11 +++++++---- src/FSharpSource.Settings.targets | 2 -- vsintegration/packages.config | 7 ------- 4 files changed, 8 insertions(+), 13 deletions(-) create mode 100644 RoslynPackageVersion.txt diff --git a/RoslynPackageVersion.txt b/RoslynPackageVersion.txt new file mode 100644 index 0000000000..4a5d18b6a0 --- /dev/null +++ b/RoslynPackageVersion.txt @@ -0,0 +1 @@ +2.3.0-beta2-61719-01 diff --git a/build/targets/PackageVersions.props b/build/targets/PackageVersions.props index 4b11d28976..887d0239fd 100644 --- a/build/targets/PackageVersions.props +++ b/build/targets/PackageVersions.props @@ -2,14 +2,17 @@ + + $([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)..\..\RoslynPackageVersion.txt').Trim()) + 1.3.1 - 2.3.0-beta2-61719-01 - 2.3.0-beta2-61719-01 - 2.3.0-beta2-61719-01 - 2.3.0-beta2-61719-01 + $(RoslynPackageVersion) + $(RoslynPackageVersion) + $(RoslynPackageVersion) + $(RoslynPackageVersion) 8.0.1 diff --git a/src/FSharpSource.Settings.targets b/src/FSharpSource.Settings.targets index 635f509bed..f63efe6355 100644 --- a/src/FSharpSource.Settings.targets +++ b/src/FSharpSource.Settings.targets @@ -76,8 +76,6 @@ true - 2.3.0-beta2-61719-01 - 15.0 15.0.26201 1.3.1 Microsoft.VSSDK.BuildTools.15.1.192 diff --git a/vsintegration/packages.config b/vsintegration/packages.config index 0fdfec0de5..56f7c3e90b 100644 --- a/vsintegration/packages.config +++ b/vsintegration/packages.config @@ -8,13 +8,6 @@ - - - - - - - From fa9fa496ddf7cfcce4486c79a1e9555705b23d9e Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Wed, 28 Feb 2018 16:02:27 -0800 Subject: [PATCH 043/147] Add DesignTimeBuild=true to legacy build from ProjectSystem (#4407) * Add DesignTimeBuild=true to legacy build from ProjectSystem * update tests --- .../Project/ProjectNode.cs | 28 ++++++++++++++----- .../Project/ReferenceContainerNode.cs | 6 +++- .../FSharp.ProjectSystem.FSharp/Project.fs | 3 +- .../Tests.ProjectSystem.Miscellaneous.fs | 4 +-- .../Tests.ProjectSystem.Project.fs | 4 +-- .../Tests.ProjectSystem.UpToDate.fs | 20 ++++++------- .../tests/unittests/TestLib.ProjectSystem.fs | 2 +- 7 files changed, 42 insertions(+), 25 deletions(-) diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectNode.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectNode.cs index 252bd09901..fae3278f5d 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectNode.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectNode.cs @@ -2182,7 +2182,7 @@ internal virtual void BuildAsync(uint vsopts, ConfigCanonicalName configCanonica /// Do the build by invoking msbuild /// [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "vsopts")] - internal virtual BuildResult Build(ConfigCanonicalName configCanonicalName, IVsOutputWindowPane output, string target) + internal virtual BuildResult Build(ConfigCanonicalName configCanonicalName, IVsOutputWindowPane output, string target, IEnumerable> extraProperties) { bool engineLogOnlyCritical = BuildPrelude(output); BuildResult result = BuildResult.FAILED; @@ -2190,7 +2190,7 @@ internal virtual BuildResult Build(ConfigCanonicalName configCanonicalName, IVsO try { this.SetBuildConfigurationProperties(configCanonicalName); - result = this.InvokeMsBuild(target); + result = this.InvokeMsBuild(target, extraProperties); } finally { @@ -4115,15 +4115,23 @@ internal string GetCurrentOutputAssembly() /// internal BuildResult Build(string target) { - return this.Build(new ConfigCanonicalName(), null, target); + return this.Build(new ConfigCanonicalName(), null, target, null); + } + + /// + /// Overloaded method. Invokes MSBuild using the default configuration and does without logging on the output window pane. + /// + internal BuildResult BuildWithExtraProperties(string target, IEnumerable> extraProperties) + { + return this.Build(new ConfigCanonicalName(), null, target, extraProperties); } /// /// Overloaded method. Invokes MSBuild using the default configuration. /// - internal BuildResult BuildToOutput(string target, IVsOutputWindowPane output) + internal BuildResult BuildToOutput(string target, IVsOutputWindowPane output, IEnumerable> extraProperties) { - return this.Build(new ConfigCanonicalName(), output, target); + return this.Build(new ConfigCanonicalName(), output, target, extraProperties); } /// @@ -6512,9 +6520,15 @@ Tuple ResolveAssemblyPathInTargetFxImpl(string[] prgAssemblySpecs, ui { return new Tuple(0, VSConstants.E_FAIL); } + var projectInstance = this.buildProject.CreateProjectInstance(); - projectInstance.SetProperty("DesignTimeReference", String.Join(";", prgAssemblySpecs)); - BuildSubmission submission = DoMSBuildSubmission(BuildKind.SYNC, target, ref projectInstance, null); + var extraProperties = new KeyValuePair[] + { + new KeyValuePair("DesignTimeBuild", "true"), + new KeyValuePair("DesignTimeReference", String.Join(";", prgAssemblySpecs)) + }.AsEnumerable(); + + BuildSubmission submission = DoMSBuildSubmission(BuildKind.SYNC, target, ref projectInstance, null, extraProperties); if (submission.BuildResult.OverallResult != BuildResultCode.Success) { // can fail, e.g. if call happens during project unload/close, in which case failure is ok diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ReferenceContainerNode.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ReferenceContainerNode.cs index 4beee7b4d0..3850d0c4e0 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ReferenceContainerNode.cs +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ReferenceContainerNode.cs @@ -371,7 +371,11 @@ public void LoadReferencesFromBuildProject(Microsoft.Build.Evaluation.Project bu } } - BuildResult buildResult = this.ProjectMgr.Build(MsBuildTarget.ResolveAssemblyReferences); + var extraProperties = new KeyValuePair[] + { + new KeyValuePair("DesignTimeBuild", "true"), + }.AsEnumerable(); + BuildResult buildResult = this.ProjectMgr.BuildWithExtraProperties(MsBuildTarget.ResolveAssemblyReferences, extraProperties); foreach (string referenceType in SupportedReferenceTypes) { bool isAssemblyReference = referenceType == ProjectFileConstants.Reference; diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs b/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs index 477cc45afb..338d68aa43 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/Project.fs @@ -1368,8 +1368,7 @@ namespace rec Microsoft.VisualStudio.FSharp.ProjectSystem // If property is not set - msbuild will resolve only primary dependencies, // and compiler will be very unhappy when during processing of referenced assembly it will discover that all fundamental types should be // taken from System.Runtime that is not supplied - - let _ = x.InvokeMsBuild("Compile", extraProperties = [KeyValuePair("_ResolveReferenceDependencies", "true")]) + let _ = x.InvokeMsBuild("Compile", extraProperties = [KeyValuePair("_ResolveReferenceDependencies", "true"); KeyValuePair("DesignTimeBuild", "true")]) sourcesAndFlagsNotifier.Notify() finally actuallyBuild <- true diff --git a/vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.Miscellaneous.fs b/vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.Miscellaneous.fs index 118cdc4af5..d8fbe01d50 100644 --- a/vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.Miscellaneous.fs +++ b/vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.Miscellaneous.fs @@ -327,7 +327,7 @@ type Miscellaneous() = use project = TheTests.CreateProject(projFile) let srcFile = (Path.GetDirectoryName projFile) + "\\" + "foo.fs" File.AppendAllText(srcFile, "#light\nlet foo () =\n printfn \"A\"\n") - project.BuildToOutput("Build", vso) |> ignore // Build the project using vso as the output logger + project.BuildToOutput("Build", vso, null) |> ignore // Build the project using vso as the output logger let errors = List.filter (fun (s:string) -> s.Contains(expectedError)) !outputWindowPaneErrors AssertEqual 1 (List.length errors) ) @@ -419,7 +419,7 @@ type Miscellaneous() = let vso = VsMocks.vsOutputWindowPane(outputWindowPaneErrors) let srcFile = (Path.GetDirectoryName projFileName) + "\\" + "foo.fs" File.AppendAllText(srcFile, "let x = 5\n") - project.BuildToOutput("Build", vso) |> ignore // Build the project using vso as the output logger + project.BuildToOutput("Build", vso, null) |> ignore // Build the project using vso as the output logger printfn "Build output:" !outputWindowPaneErrors |> Seq.iter (printfn "%s") let expectedRegex = new Regex("\\s*ProjectExt\\[.fsproj\\]") diff --git a/vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.Project.fs b/vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.Project.fs index 6a37f44ba8..87994c1949 100644 --- a/vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.Project.fs +++ b/vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.Project.fs @@ -847,7 +847,7 @@ type Project() = use project = TheTests.CreateProject(projFile) let srcFile = (Path.GetDirectoryName projFile) + "\\" + "foo.fs" File.AppendAllText(srcFile, "bar") ; // foo.fs will be cleaned up by parent call to DoWithTempFile - project.BuildToOutput("Build", vso) |> ignore // Build the project using vso as the output logger + project.BuildToOutput("Build", vso, null) |> ignore // Build the project using vso as the output logger let errors = List.filter (fun s -> (new Regex(expectedError)).IsMatch(s)) !outputWindowPaneErrors @@ -870,7 +870,7 @@ type Project() = use project = TheTests.CreateProjectWithUTF8Output(projFile) let srcFile = (Path.GetDirectoryName projFile) + "\\" + "新規bcrogram.fs" File.AppendAllText(srcFile, "bar") ; // 新規bcrogram.fs will be cleaned up by parent call to DoWithTempFile - project.BuildToOutput("Build", vso) |> ignore // Build the project using vso as the output logger + project.BuildToOutput("Build", vso, null) |> ignore // Build the project using vso as the output logger // The console inserts hard line breaks accumulate the output as a single line then look for the expected output. let output = (!outputWindowPaneErrors |> String.concat "").Replace("\r\n", "") diff --git a/vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.UpToDate.fs b/vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.UpToDate.fs index 0d079f2f01..a101cce301 100644 --- a/vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.UpToDate.fs +++ b/vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.UpToDate.fs @@ -60,7 +60,7 @@ type UpToDate() = File.AppendAllText(embedPath, "some embedded resource") Assert.IsFalse(config.IsUpToDate(logger, true)) - project.Build(configNameDebug, output, "Build") |> AssertBuildSuccessful + project.Build(configNameDebug, output, "Build", null) |> AssertBuildSuccessful Assert.IsTrue(config.IsUpToDate(logger, true)) // None items should not affect up-to-date (unless captured by well-known items, e.g. App.config) @@ -112,7 +112,7 @@ type UpToDate() = project.SetConfiguration(config.ConfigCanonicalName); Assert.IsFalse(config.IsUpToDate(logger, true)) - project.Build(configNameDebug, output, "Build") |> AssertBuildSuccessful + project.Build(configNameDebug, output, "Build", null) |> AssertBuildSuccessful Assert.IsTrue(config.IsUpToDate(logger, true)) for path in [verPath; keyPath] do @@ -147,7 +147,7 @@ type UpToDate() = File.AppendAllText(absFilePath, "printfn \"hello\"") Assert.IsFalse(config.IsUpToDate(logger, true)) - project.Build(configNameDebug, output, "Build") |> AssertBuildSuccessful + project.Build(configNameDebug, output, "Build", null) |> AssertBuildSuccessful Assert.IsTrue(config.IsUpToDate(logger, true)) // touch proj file @@ -178,7 +178,7 @@ type UpToDate() = let config1 = project1.ConfigProvider.GetProjectConfiguration(configNameDebug) Assert.IsFalse(config1.IsUpToDate(logger, true)) - project1.Build(configNameDebug, output, "Build") |> AssertBuildSuccessful + project1.Build(configNameDebug, output, "Build", null) |> AssertBuildSuccessful Assert.IsTrue(config1.IsUpToDate(logger, true)) let output1 = Path.Combine(project1.ProjectFolder, "bin\\debug", project1.OutputFileName) @@ -197,7 +197,7 @@ type UpToDate() = let startTime = DateTime.UtcNow Assert.IsFalse(config2.IsUpToDate(logger, true)) - project2.Build(configNameDebug, output, "Build") |> AssertBuildSuccessful + project2.Build(configNameDebug, output, "Build", null) |> AssertBuildSuccessful Assert.IsTrue(config2.IsUpToDate(logger, true)) // reference is updated @@ -241,7 +241,7 @@ type UpToDate() = File.AppendAllText(appConfigPath, """""") Assert.IsFalse(config.IsUpToDate(logger, true)) - project.Build(configNameDebug, output, "Build") |> AssertBuildSuccessful + project.Build(configNameDebug, output, "Build", null) |> AssertBuildSuccessful Assert.IsTrue(config.IsUpToDate(logger, true)) let startTime = DateTime.UtcNow @@ -290,25 +290,25 @@ type UpToDate() = Assert.IsFalse(debugConfigAnyCPU.IsUpToDate(logger, true)) Assert.IsFalse(releaseConfigAnyCPU.IsUpToDate(logger, true)) - project.Build(configNameDebugx86, output, "Build") |> AssertBuildSuccessful + project.Build(configNameDebugx86, output, "Build", null) |> AssertBuildSuccessful Assert.IsTrue(debugConfigx86.IsUpToDate(logger, true)) Assert.IsFalse(releaseConfigx86.IsUpToDate(logger, true)) Assert.IsFalse(debugConfigAnyCPU.IsUpToDate(logger, true)) Assert.IsFalse(releaseConfigAnyCPU.IsUpToDate(logger, true)) - project.Build(configNameReleasex86, output, "Build") |> AssertBuildSuccessful + project.Build(configNameReleasex86, output, "Build", null) |> AssertBuildSuccessful Assert.IsTrue(debugConfigx86.IsUpToDate(logger, true)) Assert.IsTrue(releaseConfigx86.IsUpToDate(logger, true)) Assert.IsFalse(debugConfigAnyCPU.IsUpToDate(logger, true)) Assert.IsFalse(releaseConfigAnyCPU.IsUpToDate(logger, true)) - project.Build(configNameDebugAnyCPU, output, "Build") |> AssertBuildSuccessful + project.Build(configNameDebugAnyCPU, output, "Build", null) |> AssertBuildSuccessful Assert.IsTrue(debugConfigx86.IsUpToDate(logger, true)) Assert.IsTrue(releaseConfigx86.IsUpToDate(logger, true)) Assert.IsTrue(debugConfigAnyCPU.IsUpToDate(logger, true)) Assert.IsFalse(releaseConfigAnyCPU.IsUpToDate(logger, true)) - project.Build(configNameReleaseAnyCPU, output, "Build") |> AssertBuildSuccessful + project.Build(configNameReleaseAnyCPU, output, "Build", null) |> AssertBuildSuccessful Assert.IsTrue(debugConfigx86.IsUpToDate(logger, true)) Assert.IsTrue(releaseConfigx86.IsUpToDate(logger, true)) Assert.IsTrue(debugConfigAnyCPU.IsUpToDate(logger, true)) diff --git a/vsintegration/tests/unittests/TestLib.ProjectSystem.fs b/vsintegration/tests/unittests/TestLib.ProjectSystem.fs index 24ba2a6cc8..d8f31256b8 100644 --- a/vsintegration/tests/unittests/TestLib.ProjectSystem.fs +++ b/vsintegration/tests/unittests/TestLib.ProjectSystem.fs @@ -657,7 +657,7 @@ module LanguageServiceExtension = failwith "tried to build not-yet-created project" else let target = if target <> null then target else "Build" - projInfo.Project.BuildToOutput(target,vsOutputWindowPane) |> ignore // force build through project system for code coverage + projInfo.Project.BuildToOutput(target,vsOutputWindowPane, null) |> ignore // force build through project system for code coverage hooks.BuildHook(projFileName, target, vsOutputWindowPane) // use MSBuild to build and also return MainAssembly value member x.GetMainOutputAssemblyHook baseName = hooks.GetMainOutputAssemblyHook baseName From f697a7d8d8ff2269e49bc16e4513033b2f4ecea8 Mon Sep 17 00:00:00 2001 From: Avi Avni Date: Thu, 1 Mar 2018 02:09:28 +0200 Subject: [PATCH 044/147] Reduce memory footprint for Val type (#4375) * try reduce val memory size * keep logic order * undo val_member_info * add val_access to ValOptionalData * cosmetics * add val_xmldoc to ValOptionalData * add val_member_info to ValOptionalData * add val_declaring_entity to ValOptionalData * add val_xmldocsig to ValOptionalData * add val_attribs to ValOptionalData * cosmetics * cosmetics * cosmetics --- src/fsharp/PostInferenceChecks.fs | 2 +- src/fsharp/SignatureConformance.fs | 2 +- src/fsharp/TastOps.fs | 27 ++-- src/fsharp/TastPickle.fs | 57 ++++--- src/fsharp/tast.fs | 244 +++++++++++++++++------------ 5 files changed, 194 insertions(+), 138 deletions(-) diff --git a/src/fsharp/PostInferenceChecks.fs b/src/fsharp/PostInferenceChecks.fs index e999a80912..c22fb3f409 100644 --- a/src/fsharp/PostInferenceChecks.fs +++ b/src/fsharp/PostInferenceChecks.fs @@ -1191,7 +1191,7 @@ and CheckBinding cenv env alwaysCheckNoReraise (TBind(v,bindRhs,_) as bind) = // If we've already recorded a definition then skip this match v.ReflectedDefinition with - | None -> v.val_defn <- Some bindRhs + | None -> v.SetValDefn bindRhs | Some _ -> () // Run the conversion process over the reflected definition to report any errors in the // front end rather than the back end. We currently re-run this during ilxgen.fs but there's diff --git a/src/fsharp/SignatureConformance.fs b/src/fsharp/SignatureConformance.fs index 21d2fd0613..e4e8fc4252 100644 --- a/src/fsharp/SignatureConformance.fs +++ b/src/fsharp/SignatureConformance.fs @@ -291,7 +291,7 @@ type Checker(g, amap, denv, remapInfo: SignatureRepackageInfo, checkingSig) = elif not (checkValInfo aenv (err denv) implVal sigVal) then false elif not (implVal.IsExtensionMember = sigVal.IsExtensionMember) then err denv (FSComp.SR.ValueNotContainedMutabilityExtensionsDiffer) elif not (checkMemberDatasConform (err denv) (implVal.Attribs, implVal,implVal.MemberInfo) (sigVal.Attribs,sigVal,sigVal.MemberInfo)) then false - else checkAttribs aenv implVal.Attribs sigVal.Attribs (fun attribs -> implVal.val_attribs <- attribs) + else checkAttribs aenv implVal.Attribs sigVal.Attribs (fun attribs -> implVal.SetAttribs attribs) and checkExnInfo err aenv implTypeRepr sigTypeRepr = diff --git a/src/fsharp/TastOps.fs b/src/fsharp/TastOps.fs index e12c21f52b..6500430ed2 100644 --- a/src/fsharp/TastOps.fs +++ b/src/fsharp/TastOps.fs @@ -4632,14 +4632,23 @@ and remapValReprInfo g tmenv (ValReprInfo(tpNames, arginfosl, retInfo)) = and remapValData g tmenv (d: ValData) = let ty = d.val_type - let topValInfo = d.val_repr_info - let ty' = ty |> remapPossibleForallTy g tmenv + let topValInfo = d.ValReprInfo + let tyR = ty |> remapPossibleForallTy g tmenv + let declaringEntityR = d.DeclaringEntity |> remapParentRef tmenv + let reprInfoR = d.ValReprInfo |> Option.map (remapValReprInfo g tmenv) + let memberInfoR = d.MemberInfo |> Option.map (remapMemberInfo g d.val_range topValInfo ty tyR tmenv) + let attribsR = d.Attribs |> remapAttribs g tmenv { d with - val_type = ty'; - val_declaring_entity = d.val_declaring_entity |> remapParentRef tmenv; - val_repr_info = d.val_repr_info |> Option.map (remapValReprInfo g tmenv); - val_member_info = d.val_member_info |> Option.map (remapMemberInfo g d.val_range topValInfo ty ty' tmenv); - val_attribs = d.val_attribs |> remapAttribs g tmenv } + val_type = tyR + val_opt_data = + match d.val_opt_data with + | Some dd -> + Some { dd with + val_declaring_entity = declaringEntityR + val_repr_info = reprInfoR + val_member_info = memberInfoR + val_attribs = attribsR } + | None -> None } and remapParentRef tyenv p = match p with @@ -6997,8 +7006,8 @@ let etaExpandTypeLambda g m tps (tm, ty) = if isNil tps then tm else mkTypeLambda m tps (mkApps g ((tm, ty), [(List.map mkTyparTy tps)], [], m), ty) let AdjustValToTopVal (tmp:Val) parent valData = - tmp.SetValReprInfo (Some valData); - tmp.val_declaring_entity <- parent; + tmp.SetValReprInfo (Some valData) + tmp.SetDeclaringEntity parent tmp.SetIsMemberOrModuleBinding() /// For match with only one non-failing target T0, the other targets, T1... failing (say, raise exception). diff --git a/src/fsharp/TastPickle.fs b/src/fsharp/TastPickle.fs index 6e8c485c9a..1726db2607 100755 --- a/src/fsharp/TastPickle.fs +++ b/src/fsharp/TastPickle.fs @@ -1812,20 +1812,20 @@ and p_vrefFlags x st = and p_ValData x st = p_string x.val_logical_name st - p_option p_string x.val_compiled_name st + p_option p_string x.ValCompiledName st // only keep range information on published values, not on optimization data - p_ranges (if x.val_repr_info.IsSome then Some(x.val_range, x.DefinitionRange) else None) st + p_ranges (x.ValReprInfo |> Option.map (fun _ -> x.val_range, x.DefinitionRange)) st p_typ x.val_type st p_int64 x.val_flags.PickledBits st - p_option p_member_info x.val_member_info st - p_attribs x.val_attribs st - p_option p_ValReprInfo x.val_repr_info st - p_string x.val_xmldocsig st - p_access x.val_access st - p_parentref x.val_declaring_entity st - p_option p_const x.val_const st + p_option p_member_info x.MemberInfo st + p_attribs x.Attribs st + p_option p_ValReprInfo x.ValReprInfo st + p_string x.XmlDocSig st + p_access x.Accessibility st + p_parentref x.DeclaringEntity st + p_option p_const x.LiteralValue st if st.oInMem then - p_used_space1 (p_xmldoc x.val_xmldoc) st + p_used_space1 (p_xmldoc x.XmlDoc) st else p_space 1 () st @@ -2121,22 +2121,27 @@ and u_ValData st = (u_option u_const) (u_used_space1 u_xmldoc) st - { val_logical_name=x1 - val_compiled_name=x1z - val_range=(match x1a with None -> range0 | Some(a,_) -> a) - val_other_range=(match x1a with None -> None | Some(_,b) -> Some(b,true)) - val_type=x2 - val_stamp=newStamp() - val_flags=ValFlags(x4) - val_defn = None - val_member_info=x8 - val_attribs=x9 - val_repr_info=x10 - val_xmldoc= defaultArg x15 XmlDoc.Empty - val_xmldocsig=x12 - val_access=x13 - val_declaring_entity=x13b - val_const=x14 + + { val_logical_name = x1 + val_range = (match x1a with None -> range0 | Some(a,_) -> a) + val_type = x2 + val_stamp = newStamp() + val_flags = ValFlags(x4) + val_opt_data = + match x1z, x1a, x10, x14, x13, x15, x8, x13b, x12, x9 with + | None, None, None, None, TAccess [], None, None, ParentNone, "", [] -> None + | _ -> + Some { val_compiled_name = x1z + val_other_range = (match x1a with None -> None | Some(_,b) -> Some(b,true)) + val_defn = None + val_repr_info = x10 + val_const = x14 + val_access = x13 + val_xmldoc = defaultArg x15 XmlDoc.Empty + val_member_info = x8 + val_declaring_entity = x13b + val_xmldocsig = x12 + val_attribs = x9 } } and u_Val st = u_osgn_decl st.ivals u_ValData st diff --git a/src/fsharp/tast.fs b/src/fsharp/tast.fs index 77552c18d8..ea3c0e2de0 100755 --- a/src/fsharp/tast.fs +++ b/src/fsharp/tast.fs @@ -2156,57 +2156,21 @@ and ValLinkageFullKey(partialKey: ValLinkagePartialKey, typeForLinkage:TType op /// The full type of the value for the purposes of linking. May be None for non-members, since they can't be overloaded. member x.TypeForLinkage = typeForLinkage - -and ValData = Val -and [] - Val = - // ValData is 19 words!! CONSIDER THIS TINY FORMAT, for all local, immutable, attribute-free values - // val_logical_name: string - // val_range: range - // mutable val_type: TType - // val_stamp: Stamp - - { - /// MUTABILITY: for unpickle linkage - mutable val_logical_name: string - +and ValOptionalData = + { /// MUTABILITY: for unpickle linkage mutable val_compiled_name: string option - /// MUTABILITY: for unpickle linkage - mutable val_range: range - /// If this field is populated, this is the implementation range for an item in a signature, otherwise it is /// the signature range for an item in an implementation mutable val_other_range: (range * bool) option - mutable val_type: TType - - /// MUTABILITY: for unpickle linkage - mutable val_stamp: Stamp - - /// See vflags section further below for encoding/decodings here - mutable val_flags: ValFlags - mutable val_const: Const option /// What is the original, unoptimized, closed-term definition, if any? /// Used to implement [] mutable val_defn: Expr option - /// How visible is this? - /// MUTABILITY: for unpickle linkage - mutable val_access: Accessibility - - /// Is the value actually an instance method/property/event that augments - /// a type, and if so what name does it take in the IL? - /// MUTABILITY: for unpickle linkage - mutable val_member_info: ValMemberInfo option - - /// Custom attributes attached to the value. These contain references to other values (i.e. constructors in types). Mutable to fixup - /// these value references after copying a collection of values. - mutable val_attribs: Attribs - // MUTABILITY CLEANUP: mutability of this field is used by // -- adjustAllUsesOfRecValue // -- TLR optimizations @@ -2216,29 +2180,65 @@ and [] // type-checked expression. mutable val_repr_info: ValReprInfo option + /// How visible is this? + /// MUTABILITY: for unpickle linkage + mutable val_access: Accessibility + + /// XML documentation attached to a value. + /// MUTABILITY: for unpickle linkage + mutable val_xmldoc : XmlDoc + + /// Is the value actually an instance method/property/event that augments + /// a type, and if so what name does it take in the IL? + /// MUTABILITY: for unpickle linkage + mutable val_member_info: ValMemberInfo option + // MUTABILITY CLEANUP: mutability of this field is used by // -- LinearizeTopMatch // // The fresh temporary should just be created with the right parent mutable val_declaring_entity: ParentRef - /// XML documentation attached to a value. + /// XML documentation signature for the value + mutable val_xmldocsig : string + + /// Custom attributes attached to the value. These contain references to other values (i.e. constructors in types). Mutable to fixup + /// these value references after copying a collection of values. + mutable val_attribs: Attribs + } + +and ValData = Val +and [] + Val = + { /// MUTABILITY: for unpickle linkage - mutable val_xmldoc : XmlDoc + mutable val_logical_name: string + + /// MUTABILITY: for unpickle linkage + mutable val_range: range + + mutable val_type: TType + + /// MUTABILITY: for unpickle linkage + mutable val_stamp: Stamp + + /// See vflags section further below for encoding/decodings here + mutable val_flags: ValFlags - /// XML documentation signature for the value - mutable val_xmldocsig : string } + mutable val_opt_data : ValOptionalData option } + + static member EmptyValOptData = { val_compiled_name = None; val_other_range = None; val_const = None; val_defn = None; val_repr_info = None; val_access = TAccess []; val_xmldoc = XmlDoc [||]; val_member_info = None; val_declaring_entity = ParentNone; val_xmldocsig = String.Empty; val_attribs = [] } /// Range of the definition (implementation) of the value, used by Visual Studio member x.DefinitionRange = - match x.val_other_range with - | Some (m,true) -> m + match x.val_opt_data with + | Some { val_other_range = Some(m,true) } -> m | _ -> x.val_range /// Range of the definition (signature) of the value, used by Visual Studio member x.SigRange = - match x.val_other_range with - | Some (m,false) -> m + match x.val_opt_data with + | Some { val_other_range = Some(m,false) } -> m | _ -> x.val_range /// The place where the value was defined. @@ -2255,10 +2255,16 @@ and [] member x.Type = x.val_type /// How visible is this value, function or member? - member x.Accessibility = x.val_access + member x.Accessibility = + match x.val_opt_data with + | Some optData -> optData.val_access + | _ -> TAccess [] /// The value of a value or member marked with [] - member x.LiteralValue = x.val_const + member x.LiteralValue = + match x.val_opt_data with + | Some optData -> optData.val_const + | _ -> None /// Records the "extra information" for a value compiled as a method. /// @@ -2275,7 +2281,10 @@ and [] /// /// TLR also sets this for inner bindings that it wants to /// represent as "top level" bindings. - member x.ValReprInfo : ValReprInfo option = x.val_repr_info + member x.ValReprInfo : ValReprInfo option = + match x.val_opt_data with + | Some optData -> optData.val_repr_info + | _ -> None member x.Id = ident(x.LogicalName,x.Range) @@ -2311,13 +2320,19 @@ and [] member x.IsExtensionMember = x.val_flags.IsExtensionMember /// The quotation expression associated with a value given the [] tag - member x.ReflectedDefinition = x.val_defn + member x.ReflectedDefinition = + match x.val_opt_data with + | Some optData -> optData.val_defn + | _ -> None /// Is this a member, if so some more data about the member. /// /// Note, the value may still be (a) an extension member or (b) and abstract slot without /// a true body. These cases are often causes of bugs in the compiler. - member x.MemberInfo = x.val_member_info + member x.MemberInfo = + match x.val_opt_data with + | Some optData -> optData.val_member_info + | _ -> None /// Indicates if this is a member member x.IsMember = x.MemberInfo.IsSome @@ -2401,18 +2416,33 @@ and [] member x.IsCompilerGenerated = x.val_flags.IsCompilerGenerated /// Get the declared attributes for the value - member x.Attribs = x.val_attribs + member x.Attribs = + match x.val_opt_data with + | Some optData -> optData.val_attribs + | _ -> [] /// Get the declared documentation for the value - member x.XmlDoc = x.val_xmldoc + member x.XmlDoc = + match x.val_opt_data with + | Some optData -> optData.val_xmldoc + | _ -> XmlDoc.Empty ///Get the signature for the value's XML documentation member x.XmlDocSig - with get() = x.val_xmldocsig - and set(v) = x.val_xmldocsig <- v + with get() = + match x.val_opt_data with + | Some optData -> optData.val_xmldocsig + | _ -> String.Empty + and set(v) = + match x.val_opt_data with + | Some optData -> optData.val_xmldocsig <- v + | _ -> x.val_opt_data <- Some { Val.EmptyValOptData with val_xmldocsig = v } /// The parent type or module, if any (None for expression bindings and parameters) - member x.DeclaringEntity = x.val_declaring_entity + member x.DeclaringEntity = + match x.val_opt_data with + | Some optData -> optData.val_declaring_entity + | _ -> ParentNone /// Get the actual parent entity for the value (a module or a type), i.e. the entity under which the /// value will appear in compiled code. For extension members this is the module where the extension member @@ -2503,6 +2533,11 @@ and [] | slotsig :: _ -> slotsig.Name | _ -> x.val_logical_name + member x.ValCompiledName = + match x.val_opt_data with + | Some optData -> optData.val_compiled_name + | _ -> None + /// The name of the method in compiled code (with some exceptions where ilxgen.fs decides not to use a method impl) /// - If this is a property then this is 'get_Foo' or 'set_Foo' /// - If this is an implementation of an abstract slot then this may be a mangled name @@ -2510,9 +2545,9 @@ and [] /// - If this is an operator then this is 'op_Addition' member x.CompiledName = let givenName = - match x.val_compiled_name with - | Some n -> n - | None -> x.LogicalName + match x.val_opt_data with + | Some { val_compiled_name = Some n } -> n + | _ -> x.LogicalName // These cases must get stable unique names for their static field & static property. This name // must be stable across quotation generation and IL code generation (quotations can refer to the // properties implicit in these) @@ -2568,28 +2603,40 @@ and [] member x.SetHasBeenReferenced() = x.val_flags <- x.val_flags.SetHasBeenReferenced member x.SetIsCompiledAsStaticPropertyWithoutField() = x.val_flags <- x.val_flags.SetIsCompiledAsStaticPropertyWithoutField member x.SetIsFixed() = x.val_flags <- x.val_flags.SetIsFixed - member x.SetValReprInfo info = x.val_repr_info <- info + member x.SetValReprInfo info = + match x.val_opt_data with + | Some optData -> optData.val_repr_info <- info + | _ -> x.val_opt_data <- Some { Val.EmptyValOptData with val_repr_info = info } member x.SetType ty = x.val_type <- ty - member x.SetOtherRange m = x.val_other_range <- Some m + member x.SetOtherRange m = + match x.val_opt_data with + | Some optData -> optData.val_other_range <- Some m + | _ -> x.val_opt_data <- Some { Val.EmptyValOptData with val_other_range = Some m } + member x.SetDeclaringEntity parent = + match x.val_opt_data with + | Some optData -> optData.val_declaring_entity <- parent + | _ -> x.val_opt_data <- Some { Val.EmptyValOptData with val_declaring_entity = parent } + member x.SetAttribs attribs = + match x.val_opt_data with + | Some optData -> optData.val_attribs <- attribs + | _ -> x.val_opt_data <- Some { Val.EmptyValOptData with val_attribs = attribs } + member x.SetMemberInfo member_info = + match x.val_opt_data with + | Some optData -> optData.val_member_info <- Some member_info + | _ -> x.val_opt_data <- Some { Val.EmptyValOptData with val_member_info = Some member_info } + member x.SetValDefn val_defn = + match x.val_opt_data with + | Some optData -> optData.val_defn <- Some val_defn + | _ -> x.val_opt_data <- Some { Val.EmptyValOptData with val_defn = Some val_defn } /// Create a new value with empty, unlinked data. Only used during unpickling of F# metadata. static member NewUnlinked() : Val = { val_logical_name = Unchecked.defaultof<_> - val_compiled_name = Unchecked.defaultof<_> val_range = Unchecked.defaultof<_> - val_other_range = Unchecked.defaultof<_> val_type = Unchecked.defaultof<_> val_stamp = Unchecked.defaultof<_> val_flags = Unchecked.defaultof<_> - val_const = Unchecked.defaultof<_> - val_defn = Unchecked.defaultof<_> - val_access = Unchecked.defaultof<_> - val_member_info = Unchecked.defaultof<_> - val_attribs = Unchecked.defaultof<_> - val_repr_info = Unchecked.defaultof<_> - val_declaring_entity = Unchecked.defaultof<_> - val_xmldoc = Unchecked.defaultof<_> - val_xmldocsig = Unchecked.defaultof<_> } + val_opt_data = Unchecked.defaultof<_> } /// Create a new value with the given backing data. Only used during unpickling of F# metadata. @@ -2601,24 +2648,16 @@ and [] /// Set all the data on a value member x.SetData (tg: ValData) = x.val_logical_name <- tg.val_logical_name - x.val_compiled_name <- tg.val_compiled_name x.val_range <- tg.val_range - x.val_other_range <- tg.val_other_range x.val_type <- tg.val_type x.val_stamp <- tg.val_stamp x.val_flags <- tg.val_flags - x.val_const <- tg.val_const - x.val_defn <- tg.val_defn - x.val_access <- tg.val_access - x.val_member_info <- tg.val_member_info - x.val_attribs <- tg.val_attribs - x.val_repr_info <- tg.val_repr_info - x.val_declaring_entity <- tg.val_declaring_entity - x.val_xmldoc <- tg.val_xmldoc - x.val_xmldocsig <- tg.val_xmldocsig + match tg.val_opt_data with + | Some tg -> x.val_opt_data <- Some { val_compiled_name = tg.val_compiled_name; val_other_range = tg.val_other_range; val_const = tg.val_const; val_defn = tg.val_defn; val_repr_info = tg.val_repr_info; val_access = tg.val_access; val_xmldoc = tg.val_xmldoc; val_member_info = tg.val_member_info; val_declaring_entity = tg.val_declaring_entity; val_xmldocsig = tg.val_xmldocsig; val_attribs = tg.val_attribs } + | None -> () /// Indicates if a value is linked to backing data yet. Only used during unpickling of F# metadata. - member x.IsLinked = match box x.val_attribs with null -> false | _ -> true + member x.IsLinked = match box x.val_logical_name with null -> false | _ -> true override x.ToString() = x.LogicalName @@ -4980,24 +5019,27 @@ exception FullAbstraction of string * range let NewModuleOrNamespace cpath access (id:Ident) xml attribs mtype = Construct.NewModuleOrNamespace cpath access id xml attribs mtype let NewVal (logicalName:string,m:range,compiledName,ty,isMutable,isCompGen,arity,access,recValInfo,specialRepr,baseOrThis,attribs,inlineInfo,doc,isModuleOrMemberBinding,isExtensionMember,isIncrClassSpecialMember,isTyFunc,allowTypeInst,isGeneratedEventVal,konst,actualParent) : Val = - let stamp = newStamp() + let stamp = newStamp() Val.New - { val_stamp = stamp - val_logical_name=logicalName - val_compiled_name= (match compiledName with Some v when v <> logicalName -> compiledName | _ -> None) - val_range=m - val_other_range=None - val_defn=None - val_repr_info= arity - val_declaring_entity= actualParent - val_flags = ValFlags(recValInfo,baseOrThis,isCompGen,inlineInfo,isMutable,isModuleOrMemberBinding,isExtensionMember,isIncrClassSpecialMember,isTyFunc,allowTypeInst,isGeneratedEventVal) - val_const= konst - val_access=access - val_member_info=specialRepr - val_attribs=attribs - val_type = ty - val_xmldoc = doc - val_xmldocsig = ""} + { val_stamp = stamp + val_logical_name = logicalName + val_range = m + val_flags = ValFlags(recValInfo,baseOrThis,isCompGen,inlineInfo,isMutable,isModuleOrMemberBinding,isExtensionMember,isIncrClassSpecialMember,isTyFunc,allowTypeInst,isGeneratedEventVal) + val_type = ty + val_opt_data = + match compiledName, arity, konst, access, doc, specialRepr, actualParent, attribs with + | None, None, None, TAccess [], XmlDoc [||], None, ParentNone, [] -> None + | _ -> + Some { Val.EmptyValOptData with + val_compiled_name = (match compiledName with Some v when v <> logicalName -> compiledName | _ -> None) + val_repr_info = arity + val_const = konst + val_access = access + val_xmldoc = doc + val_member_info = specialRepr + val_declaring_entity = actualParent + val_attribs = attribs } + } let NewCcuContents sref m nm mty = From ee2927d94ca7e937056cdf90242b9d37032fc157 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Wed, 28 Feb 2018 16:33:26 -0800 Subject: [PATCH 045/147] convert item template projects to the dotnet SDK --- build-everything.proj | 4 +- .../ItemTemplates/AppConfig/AppConfig.csproj | 40 +++--------------- .../ItemTemplates/CodeFile/CodeFile.csproj | 40 +++--------------- .../ItemTemplates/Directory.Build.props | 9 ++++ .../ItemTemplates/Directory.Build.targets | 3 ++ .../ResourceFile/ResourceFile.csproj | 41 +++---------------- .../ScriptFile/ScriptFile.csproj | 39 +++--------------- .../SignatureFile/SignatureFile.csproj | 40 +++--------------- .../ItemTemplates/TextFile/TextFile.csproj | 40 +++--------------- .../ItemTemplates/XMLFile/XMLFile.csproj | 39 +++--------------- vsintegration/Templates.Directory.Build.props | 22 ++++++++++ .../Templates.Directory.Build.targets | 22 ++++++++++ ...rp-vsintegration-item-templates-build.proj | 6 ++- 13 files changed, 99 insertions(+), 246 deletions(-) create mode 100644 vsintegration/ItemTemplates/Directory.Build.props create mode 100644 vsintegration/ItemTemplates/Directory.Build.targets create mode 100644 vsintegration/Templates.Directory.Build.props create mode 100644 vsintegration/Templates.Directory.Build.targets diff --git a/build-everything.proj b/build-everything.proj index 95f28ccc06..6dc58bdfd3 100644 --- a/build-everything.proj +++ b/build-everything.proj @@ -34,8 +34,9 @@ - + true + true @@ -114,6 +115,7 @@ + diff --git a/vsintegration/ItemTemplates/AppConfig/AppConfig.csproj b/vsintegration/ItemTemplates/AppConfig/AppConfig.csproj index 0a53562afc..48500b15a8 100644 --- a/vsintegration/ItemTemplates/AppConfig/AppConfig.csproj +++ b/vsintegration/ItemTemplates/AppConfig/AppConfig.csproj @@ -1,48 +1,18 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\src AppConfig - ItemTemplates - true - true - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - false - false - false - false - false - false - false - false - false - false - - Debug - net40 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\$(TemplateCategory)\$(AssemblyName) - - - - - + - - - - - - - - - - \ No newline at end of file + + diff --git a/vsintegration/ItemTemplates/CodeFile/CodeFile.csproj b/vsintegration/ItemTemplates/CodeFile/CodeFile.csproj index 8f726c6d9a..cf6a5e3e4f 100644 --- a/vsintegration/ItemTemplates/CodeFile/CodeFile.csproj +++ b/vsintegration/ItemTemplates/CodeFile/CodeFile.csproj @@ -1,48 +1,18 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\src CodeFile - ItemTemplates - true - true - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - false - false - false - false - false - false - false - false - false - false - - Debug - net40 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\$(TemplateCategory)\$(AssemblyName) - - - - - + - - - - - - - - - - \ No newline at end of file + + diff --git a/vsintegration/ItemTemplates/Directory.Build.props b/vsintegration/ItemTemplates/Directory.Build.props new file mode 100644 index 0000000000..ef2e287509 --- /dev/null +++ b/vsintegration/ItemTemplates/Directory.Build.props @@ -0,0 +1,9 @@ + + + + ItemTemplates + + + + + diff --git a/vsintegration/ItemTemplates/Directory.Build.targets b/vsintegration/ItemTemplates/Directory.Build.targets new file mode 100644 index 0000000000..6dd437b28f --- /dev/null +++ b/vsintegration/ItemTemplates/Directory.Build.targets @@ -0,0 +1,3 @@ + + + diff --git a/vsintegration/ItemTemplates/ResourceFile/ResourceFile.csproj b/vsintegration/ItemTemplates/ResourceFile/ResourceFile.csproj index 61287d631d..17760a303b 100644 --- a/vsintegration/ItemTemplates/ResourceFile/ResourceFile.csproj +++ b/vsintegration/ItemTemplates/ResourceFile/ResourceFile.csproj @@ -1,49 +1,18 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\src ResourceFile - ItemTemplates - true - true - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - false - false - false - false - false - false - false - false - false - false - {0385564F-07B4-4264-AB8A-17C393E9140C} - - Debug - net40 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\$(TemplateCategory)\$(AssemblyName) - - - - - + - - - - - - - - - - \ No newline at end of file + + diff --git a/vsintegration/ItemTemplates/ScriptFile/ScriptFile.csproj b/vsintegration/ItemTemplates/ScriptFile/ScriptFile.csproj index 583e0c3e23..d8affe8360 100644 --- a/vsintegration/ItemTemplates/ScriptFile/ScriptFile.csproj +++ b/vsintegration/ItemTemplates/ScriptFile/ScriptFile.csproj @@ -1,47 +1,18 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\src ScriptFile - ItemTemplates - true - true - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - false - false - false - false - false - false - false - false - false - false - - - Debug - net40 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\$(TemplateCategory)\$(AssemblyName) - - - + - - - - - - - - - - \ No newline at end of file + + diff --git a/vsintegration/ItemTemplates/SignatureFile/SignatureFile.csproj b/vsintegration/ItemTemplates/SignatureFile/SignatureFile.csproj index 0bc28446b5..89a34c354b 100644 --- a/vsintegration/ItemTemplates/SignatureFile/SignatureFile.csproj +++ b/vsintegration/ItemTemplates/SignatureFile/SignatureFile.csproj @@ -1,48 +1,18 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\src SignatureFile - ItemTemplates - true - true - false - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - false - false - false - false - false - false - false - false - false - - Debug - net40 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\$(TemplateCategory)\$(AssemblyName) - - - - - + - - - - - - - - - - \ No newline at end of file + + diff --git a/vsintegration/ItemTemplates/TextFile/TextFile.csproj b/vsintegration/ItemTemplates/TextFile/TextFile.csproj index d8d84130c7..880085abaa 100644 --- a/vsintegration/ItemTemplates/TextFile/TextFile.csproj +++ b/vsintegration/ItemTemplates/TextFile/TextFile.csproj @@ -1,48 +1,18 @@  - - - $(MSBuildProjectDirectory)\..\..\..\src - TextFile - ItemTemplates - true - true - false - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - false - false - false - false - false - false - false - false - false - + - Debug - net40 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\$(TemplateCategory)\$(AssemblyName) + TextFile - - - + - - - - - - - - - - \ No newline at end of file + + diff --git a/vsintegration/ItemTemplates/XMLFile/XMLFile.csproj b/vsintegration/ItemTemplates/XMLFile/XMLFile.csproj index 1f4178befc..bef2612dc2 100644 --- a/vsintegration/ItemTemplates/XMLFile/XMLFile.csproj +++ b/vsintegration/ItemTemplates/XMLFile/XMLFile.csproj @@ -1,47 +1,18 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\src XMLFile - ItemTemplates - true - true - false - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - false - false - false - false - false - false - false - false - false - - - Debug - net40 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\$(TemplateCategory)\$(AssemblyName) - - - + - - - - - - - - - - \ No newline at end of file + + diff --git a/vsintegration/Templates.Directory.Build.props b/vsintegration/Templates.Directory.Build.props new file mode 100644 index 0000000000..daa0975d3d --- /dev/null +++ b/vsintegration/Templates.Directory.Build.props @@ -0,0 +1,22 @@ + + + + + + net46 + v4.6 + true + true + false + false + false + false + false + false + false + false + false + false + + + diff --git a/vsintegration/Templates.Directory.Build.targets b/vsintegration/Templates.Directory.Build.targets new file mode 100644 index 0000000000..45a477f2f2 --- /dev/null +++ b/vsintegration/Templates.Directory.Build.targets @@ -0,0 +1,22 @@ + + + + + + $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\$(TemplateCategory)\$(AssemblyName) + + + + + + + + + + + + + + + + diff --git a/vsintegration/fsharp-vsintegration-item-templates-build.proj b/vsintegration/fsharp-vsintegration-item-templates-build.proj index 0442857df1..7a463780dc 100644 --- a/vsintegration/fsharp-vsintegration-item-templates-build.proj +++ b/vsintegration/fsharp-vsintegration-item-templates-build.proj @@ -15,5 +15,9 @@ - + + + + + From 668825a43c73abffc3343d80a496d7ebc4be6db1 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Wed, 28 Feb 2018 16:40:37 -0800 Subject: [PATCH 046/147] convert project template projects to the dotnet SDK --- build-everything.proj | 2 + .../ConsoleProject/ConsoleProject.csproj | 33 ++-------------- .../ProjectTemplates/Directory.Build.props | 9 +++++ .../ProjectTemplates/Directory.Build.targets | 3 ++ .../LibraryProject/LibraryProject.csproj | 33 ++-------------- .../TutorialProject/TutorialProject.csproj | 32 ++-------------- ...vsintegration-project-templates-build.proj | 5 +++ vsintegration/src/fsharp.common.props | 38 ------------------- 8 files changed, 28 insertions(+), 127 deletions(-) create mode 100644 vsintegration/ProjectTemplates/Directory.Build.props create mode 100644 vsintegration/ProjectTemplates/Directory.Build.targets delete mode 100644 vsintegration/src/fsharp.common.props diff --git a/build-everything.proj b/build-everything.proj index 6dc58bdfd3..4b892b23a5 100644 --- a/build-everything.proj +++ b/build-everything.proj @@ -37,6 +37,7 @@ true true + true @@ -116,6 +117,7 @@ + diff --git a/vsintegration/ProjectTemplates/ConsoleProject/ConsoleProject.csproj b/vsintegration/ProjectTemplates/ConsoleProject/ConsoleProject.csproj index bec2b66b38..82e55b95ec 100644 --- a/vsintegration/ProjectTemplates/ConsoleProject/ConsoleProject.csproj +++ b/vsintegration/ProjectTemplates/ConsoleProject/ConsoleProject.csproj @@ -1,34 +1,11 @@  - - - $(MSBuildProjectDirectory)\..\..\..\src - ConsoleProject - ProjectTemplates - true - true - false - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - false - false - false - false - false - false - false - false - false - {604F0DAA-2D33-48DD-B162-EDF0B672803D} - + - Debug - net40 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\$(TemplateCategory)\$(AssemblyName) + ConsoleProject - - @@ -38,8 +15,4 @@ - - - - - \ No newline at end of file + diff --git a/vsintegration/ProjectTemplates/Directory.Build.props b/vsintegration/ProjectTemplates/Directory.Build.props new file mode 100644 index 0000000000..a67b0e382e --- /dev/null +++ b/vsintegration/ProjectTemplates/Directory.Build.props @@ -0,0 +1,9 @@ + + + + ProjectTemplates + + + + + diff --git a/vsintegration/ProjectTemplates/Directory.Build.targets b/vsintegration/ProjectTemplates/Directory.Build.targets new file mode 100644 index 0000000000..6dd437b28f --- /dev/null +++ b/vsintegration/ProjectTemplates/Directory.Build.targets @@ -0,0 +1,3 @@ + + + diff --git a/vsintegration/ProjectTemplates/LibraryProject/LibraryProject.csproj b/vsintegration/ProjectTemplates/LibraryProject/LibraryProject.csproj index 57f5428915..23239f0047 100644 --- a/vsintegration/ProjectTemplates/LibraryProject/LibraryProject.csproj +++ b/vsintegration/ProjectTemplates/LibraryProject/LibraryProject.csproj @@ -1,34 +1,11 @@  - - - $(MSBuildProjectDirectory)\..\..\..\src - LibraryProject - ProjectTemplates - true - true - false - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - false - false - false - false - false - false - false - false - false - {01678CDA-A11F-4DEE-9344-2EDF91CF1AE7} - + - Debug - net40 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\$(TemplateCategory)\$(AssemblyName) + LibraryProject - - @@ -38,8 +15,4 @@ - - - - - \ No newline at end of file + diff --git a/vsintegration/ProjectTemplates/TutorialProject/TutorialProject.csproj b/vsintegration/ProjectTemplates/TutorialProject/TutorialProject.csproj index 86b7c4649a..72afa7b760 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/TutorialProject.csproj +++ b/vsintegration/ProjectTemplates/TutorialProject/TutorialProject.csproj @@ -1,33 +1,11 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\src TutorialProject - ProjectTemplates - true - true - false - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - false - false - false - false - false - false - false - false - false - {2FACEE44-48BD-40B5-A2EE-B54A0C9BB7C4} - - - Debug - net40 - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\$(TemplateCategory)\$(AssemblyName) - - @@ -36,8 +14,4 @@ - - - - - \ No newline at end of file + diff --git a/vsintegration/fsharp-vsintegration-project-templates-build.proj b/vsintegration/fsharp-vsintegration-project-templates-build.proj index d810cea4de..59683fa3f9 100644 --- a/vsintegration/fsharp-vsintegration-project-templates-build.proj +++ b/vsintegration/fsharp-vsintegration-project-templates-build.proj @@ -11,5 +11,10 @@ + + + + + diff --git a/vsintegration/src/fsharp.common.props b/vsintegration/src/fsharp.common.props deleted file mode 100644 index 47dee9fdbd..0000000000 --- a/vsintegration/src/fsharp.common.props +++ /dev/null @@ -1,38 +0,0 @@ - - - - - Debug - AnyCPU - - - - - - - - ..\.. - net40 - - - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin - - - - true - full - false - DEBUG;TRACE - prompt - 4 - - - - pdbonly - true - TRACE - prompt - 4 - - - \ No newline at end of file From cb2990e49f27f5c774b6e24f254b5247fa6cc39a Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Thu, 1 Mar 2018 10:28:09 -0800 Subject: [PATCH 047/147] Update feed tasks version --- packages.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages.config b/packages.config index 9a15ceeb46..e7a40afa17 100644 --- a/packages.config +++ b/packages.config @@ -12,7 +12,7 @@ - + From 59fadd0dc270cefd1cef671481c63ea3b48e7fcf Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Thu, 1 Mar 2018 10:38:38 -0800 Subject: [PATCH 048/147] convert LanguageServiceProfiling to the dotnet SDK --- VisualFSharp.sln | 10 +-- build-everything.proj | 2 + .../Directory.Build.props | 3 + .../Directory.Build.targets | 3 + .../LanguageServiceProfiling.fsproj | 76 ++++--------------- .../LanguageServiceProfiling/packages.config | 4 - 6 files changed, 27 insertions(+), 71 deletions(-) create mode 100644 vsintegration/Utils/LanguageServiceProfiling/Directory.Build.props create mode 100644 vsintegration/Utils/LanguageServiceProfiling/Directory.Build.targets delete mode 100644 vsintegration/Utils/LanguageServiceProfiling/packages.config diff --git a/VisualFSharp.sln b/VisualFSharp.sln index 2611b0a6cb..6b4387b559 100644 --- a/VisualFSharp.sln +++ b/VisualFSharp.sln @@ -124,7 +124,7 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "ILComparer", "tests\fsharpq EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Utils", "Utils", "{D086C8C6-D00D-4C3B-9AB2-A4286C9F5922}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "LanguageServiceProfiling", "vsintegration\Utils\LanguageServiceProfiling\LanguageServiceProfiling.fsproj", "{E7FA3A71-51AF-4FCA-9C2F-7C853E515903}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "LanguageServiceProfiling", "vsintegration\Utils\LanguageServiceProfiling\LanguageServiceProfiling.fsproj", "{E7FA3A71-51AF-4FCA-9C2F-7C853E515903}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FSharp.UIResources", "vsintegration\src\FSharp.UIResources\FSharp.UIResources.csproj", "{C4586A06-1402-48BC-8E35-A1B8642F895B}" EndProject @@ -694,10 +694,10 @@ Global {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Debug|Any CPU.Build.0 = Debug|Any CPU {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Debug|x86.ActiveCfg = Debug|Any CPU {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Debug|x86.Build.0 = Debug|Any CPU - {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Proto|Any CPU.Build.0 = Proto|Any CPU - {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Proto|x86.ActiveCfg = Proto|Any CPU - {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Proto|x86.Build.0 = Proto|Any CPU + {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Proto|Any CPU.ActiveCfg = Release|Any CPU + {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Proto|Any CPU.Build.0 = Release|Any CPU + {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Proto|x86.ActiveCfg = Release|Any CPU + {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Proto|x86.Build.0 = Release|Any CPU {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Release|Any CPU.ActiveCfg = Release|Any CPU {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Release|Any CPU.Build.0 = Release|Any CPU {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Release|x86.ActiveCfg = Release|Any CPU diff --git a/build-everything.proj b/build-everything.proj index 4b892b23a5..6f7a43a56c 100644 --- a/build-everything.proj +++ b/build-everything.proj @@ -36,6 +36,7 @@ true + true true true @@ -114,6 +115,7 @@ + diff --git a/vsintegration/Utils/LanguageServiceProfiling/Directory.Build.props b/vsintegration/Utils/LanguageServiceProfiling/Directory.Build.props new file mode 100644 index 0000000000..bb8eac309b --- /dev/null +++ b/vsintegration/Utils/LanguageServiceProfiling/Directory.Build.props @@ -0,0 +1,3 @@ + + + diff --git a/vsintegration/Utils/LanguageServiceProfiling/Directory.Build.targets b/vsintegration/Utils/LanguageServiceProfiling/Directory.Build.targets new file mode 100644 index 0000000000..ccd47cc0a9 --- /dev/null +++ b/vsintegration/Utils/LanguageServiceProfiling/Directory.Build.targets @@ -0,0 +1,3 @@ + + + diff --git a/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj b/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj index 3c4dd3e74f..08d3108041 100644 --- a/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj +++ b/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj @@ -1,80 +1,32 @@  - - + + - $(MSBuildProjectDirectory)\..\..\..\src - FSharp - - - - Debug - AnyCPU - 2.0 - e7fa3a71-51af-4fca-9c2f-7c853e515903 + net46 Exe - LanguageServiceProfiling - LanguageServiceProfiling - v4.6 - true - 4.4.1.0 - LanguageServiceProfiling - - - true - false - false - bin\$(Configuration)\ - DEBUG;TRACE - 3 - x86 - - - true - - - true - true - bin\$(Configuration)\ - TRACE - 3 - x86 - - - true + true + true + - + + + + + + - - $(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll - - - - FSharp.Core - {ded3bbd7-53f4-428a-8c9f-27968e768605} - True - - - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3} - FSharp.Compiler.Private - True - - - $(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll - true - - - - \ No newline at end of file + + diff --git a/vsintegration/Utils/LanguageServiceProfiling/packages.config b/vsintegration/Utils/LanguageServiceProfiling/packages.config deleted file mode 100644 index 222429db2b..0000000000 --- a/vsintegration/Utils/LanguageServiceProfiling/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file From 226ca5331c28406edcb495dc792c58d6eabc8df4 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Thu, 1 Mar 2018 11:18:31 -0800 Subject: [PATCH 049/147] convert VisualFSharpTemplates to the dotnet SDK --- build-everything.proj | 2 + vsintegration/FSharp.Directory.Build.targets | 5 ++ .../Vsix/FSharp.Directory.Build.props | 17 ++++++ .../Vsix/FSharp.Directory.Build.targets | 3 + .../Directory.Build.props | 3 + .../Directory.Build.targets | 3 + .../VisualFSharpTemplates.csproj | 59 ++++--------------- .../fsharp-vsintegration-vsix-build.proj | 17 ++++-- 8 files changed, 57 insertions(+), 52 deletions(-) create mode 100644 vsintegration/Vsix/FSharp.Directory.Build.props create mode 100644 vsintegration/Vsix/FSharp.Directory.Build.targets create mode 100644 vsintegration/Vsix/VisualFSharpTemplates/Directory.Build.props create mode 100644 vsintegration/Vsix/VisualFSharpTemplates/Directory.Build.targets diff --git a/build-everything.proj b/build-everything.proj index 6f7a43a56c..c00af28c8c 100644 --- a/build-everything.proj +++ b/build-everything.proj @@ -39,6 +39,7 @@ true true true + true @@ -120,6 +121,7 @@ + diff --git a/vsintegration/FSharp.Directory.Build.targets b/vsintegration/FSharp.Directory.Build.targets index 528e41da3a..dc6955ffc2 100644 --- a/vsintegration/FSharp.Directory.Build.targets +++ b/vsintegration/FSharp.Directory.Build.targets @@ -11,6 +11,11 @@ net462 + + + $(OutputPath)\ + + diff --git a/vsintegration/Vsix/FSharp.Directory.Build.props b/vsintegration/Vsix/FSharp.Directory.Build.props new file mode 100644 index 0000000000..d10bc29318 --- /dev/null +++ b/vsintegration/Vsix/FSharp.Directory.Build.props @@ -0,0 +1,17 @@ + + + + + + RoslynDev + false + False + True + Program + $(DevEnvDir)devenv.exe + /rootsuffix $(VSRootSuffix) /log + $(VSRootSuffix) + true + + + diff --git a/vsintegration/Vsix/FSharp.Directory.Build.targets b/vsintegration/Vsix/FSharp.Directory.Build.targets new file mode 100644 index 0000000000..ccd47cc0a9 --- /dev/null +++ b/vsintegration/Vsix/FSharp.Directory.Build.targets @@ -0,0 +1,3 @@ + + + diff --git a/vsintegration/Vsix/VisualFSharpTemplates/Directory.Build.props b/vsintegration/Vsix/VisualFSharpTemplates/Directory.Build.props new file mode 100644 index 0000000000..bb8eac309b --- /dev/null +++ b/vsintegration/Vsix/VisualFSharpTemplates/Directory.Build.props @@ -0,0 +1,3 @@ + + + diff --git a/vsintegration/Vsix/VisualFSharpTemplates/Directory.Build.targets b/vsintegration/Vsix/VisualFSharpTemplates/Directory.Build.targets new file mode 100644 index 0000000000..ccd47cc0a9 --- /dev/null +++ b/vsintegration/Vsix/VisualFSharpTemplates/Directory.Build.targets @@ -0,0 +1,3 @@ + + + diff --git a/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj b/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj index c1b48d1d2e..2fdd766124 100644 --- a/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj +++ b/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj @@ -1,17 +1,11 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\src - net40 - 15.0 - 11.0 - $(FSharpSourcesRoot)\..\packages\Microsoft.VSSDK.BuildTools.$(RoslynVSPackagesVersion)\tools - - 15.0 - 2.0 - {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - + VisualFSharpTemplate + net46 + Library publish\ true Disk @@ -22,8 +16,6 @@ true false true - 0 - v4.6 false false false @@ -37,43 +29,16 @@ CommonExtensions Microsoft\FSharpTemplates None - Debug - AnyCPU - Library - Properties - RoslynDev - true - False - True - {385035C1-9171-408A-8EAA-67DDC14E2CF3} true - VisualFSharpTemplate - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin - VisualFSharpTemplate - $(RootBinPath) - 15.4.1.0 - cs false - - Program - $(DevEnvDir)devenv.exe - /rootsuffix $(VSRootSuffix) /log - $(VSRootSuffix) - true - - - Program - $(DevEnvDir)devenv.exe - true - /rootsuffix $(VSRootSuffix) /log - $(VSRootSuffix) - + Designer + False @@ -91,8 +56,9 @@ false + - + {604f0daa-2d33-48dd-b162-edf0b672803d} ConsoleProject ProjectTemplates @@ -100,7 +66,7 @@ false True - + {01678cda-a11f-4dee-9344-2edf91cf1ae7} LibraryProject ProjectTemplates @@ -108,7 +74,7 @@ false True - + {2facee44-48bd-40b5-a2ee-b54a0c9bb7c4} TutorialProject ProjectTemplates @@ -117,6 +83,5 @@ True - - + diff --git a/vsintegration/fsharp-vsintegration-vsix-build.proj b/vsintegration/fsharp-vsintegration-vsix-build.proj index 518b3639eb..83cf691219 100644 --- a/vsintegration/fsharp-vsintegration-vsix-build.proj +++ b/vsintegration/fsharp-vsintegration-vsix-build.proj @@ -5,12 +5,19 @@ - - - + + + - - + + + + + + + + + From be22484b2cfae98aeb9dd71e1e16682d2c6486a3 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Thu, 1 Mar 2018 13:30:01 -0800 Subject: [PATCH 050/147] convert VisualFSharpOpenSource to the dotnet SDK --- VisualFSharp.sln | 12 +- .../Vsix/FSharp.Directory.Build.props | 28 ++++- .../Vsix/FSharp.Directory.Build.targets | 20 ++++ .../Directory.Build.props | 3 + .../Directory.Build.targets | 3 + .../Properties/launchSettings.json | 9 ++ .../VisualFSharpOpenSource.csproj | 106 ++---------------- .../VisualFSharpTemplates.csproj | 42 ------- .../fsharp-vsintegration-vsix-build.proj | 1 + 9 files changed, 78 insertions(+), 146 deletions(-) create mode 100644 vsintegration/Vsix/VisualFSharpOpenSource/Directory.Build.props create mode 100644 vsintegration/Vsix/VisualFSharpOpenSource/Directory.Build.targets create mode 100644 vsintegration/Vsix/VisualFSharpOpenSource/Properties/launchSettings.json diff --git a/VisualFSharp.sln b/VisualFSharp.sln index 6b4387b559..986f1ef833 100644 --- a/VisualFSharp.sln +++ b/VisualFSharp.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.27130.2024 +VisualStudioVersion = 15.0.27130.2036 MinimumVisualStudioVersion = 10.0.40219.1 Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Compiler.Private", "src\fsharp\FSharp.Compiler.Private\FSharp.Compiler.Private.fsproj", "{2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}" EndProject @@ -116,7 +116,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Vsix", "Vsix", "{141F6C23-E EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisualFSharpFull", "vsintegration\Vsix\VisualFSharpFull\VisualFSharpFull.csproj", "{59ADCE46-9740-4079-834D-9A03A3494EBC}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisualFSharpOpenSource", "vsintegration\Vsix\VisualFSharpOpenSource\VisualFSharpOpenSource.csproj", "{E6A45CDF-B408-420F-B475-74611BEFC52B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VisualFSharpOpenSource", "vsintegration\Vsix\VisualFSharpOpenSource\VisualFSharpOpenSource.csproj", "{E6A45CDF-B408-420F-B475-74611BEFC52B}" EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "HostedCompilerServer", "tests\fsharpqa\testenv\src\HostedCompilerServer\HostedCompilerServer.fsproj", "{4239EFEA-E746-446A-BF7A-51FCBAB13946}" EndProject @@ -658,10 +658,10 @@ Global {E6A45CDF-B408-420F-B475-74611BEFC52B}.Debug|Any CPU.Build.0 = Debug|Any CPU {E6A45CDF-B408-420F-B475-74611BEFC52B}.Debug|x86.ActiveCfg = Debug|Any CPU {E6A45CDF-B408-420F-B475-74611BEFC52B}.Debug|x86.Build.0 = Debug|Any CPU - {E6A45CDF-B408-420F-B475-74611BEFC52B}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {E6A45CDF-B408-420F-B475-74611BEFC52B}.Proto|Any CPU.Build.0 = Proto|Any CPU - {E6A45CDF-B408-420F-B475-74611BEFC52B}.Proto|x86.ActiveCfg = Proto|Any CPU - {E6A45CDF-B408-420F-B475-74611BEFC52B}.Proto|x86.Build.0 = Proto|Any CPU + {E6A45CDF-B408-420F-B475-74611BEFC52B}.Proto|Any CPU.ActiveCfg = Release|Any CPU + {E6A45CDF-B408-420F-B475-74611BEFC52B}.Proto|Any CPU.Build.0 = Release|Any CPU + {E6A45CDF-B408-420F-B475-74611BEFC52B}.Proto|x86.ActiveCfg = Release|Any CPU + {E6A45CDF-B408-420F-B475-74611BEFC52B}.Proto|x86.Build.0 = Release|Any CPU {E6A45CDF-B408-420F-B475-74611BEFC52B}.Release|Any CPU.ActiveCfg = Release|Any CPU {E6A45CDF-B408-420F-B475-74611BEFC52B}.Release|Any CPU.Build.0 = Release|Any CPU {E6A45CDF-B408-420F-B475-74611BEFC52B}.Release|x86.ActiveCfg = Release|Any CPU diff --git a/vsintegration/Vsix/FSharp.Directory.Build.props b/vsintegration/Vsix/FSharp.Directory.Build.props index d10bc29318..02bdb97830 100644 --- a/vsintegration/Vsix/FSharp.Directory.Build.props +++ b/vsintegration/Vsix/FSharp.Directory.Build.props @@ -7,11 +7,33 @@ false False True - Program - $(DevEnvDir)devenv.exe - /rootsuffix $(VSRootSuffix) /log $(VSRootSuffix) true + publish\ + true + Disk + false + Foreground + 7 + Days + true + false + true + false + false + false + false + false + false + false + false + true + true + CommonExtensions + None + true + false + true diff --git a/vsintegration/Vsix/FSharp.Directory.Build.targets b/vsintegration/Vsix/FSharp.Directory.Build.targets index ccd47cc0a9..b1d570e793 100644 --- a/vsintegration/Vsix/FSharp.Directory.Build.targets +++ b/vsintegration/Vsix/FSharp.Directory.Build.targets @@ -1,3 +1,23 @@ + + + + + False + Microsoft .NET Framework 4.6 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + false + + + diff --git a/vsintegration/Vsix/VisualFSharpOpenSource/Directory.Build.props b/vsintegration/Vsix/VisualFSharpOpenSource/Directory.Build.props new file mode 100644 index 0000000000..bb8eac309b --- /dev/null +++ b/vsintegration/Vsix/VisualFSharpOpenSource/Directory.Build.props @@ -0,0 +1,3 @@ + + + diff --git a/vsintegration/Vsix/VisualFSharpOpenSource/Directory.Build.targets b/vsintegration/Vsix/VisualFSharpOpenSource/Directory.Build.targets new file mode 100644 index 0000000000..ccd47cc0a9 --- /dev/null +++ b/vsintegration/Vsix/VisualFSharpOpenSource/Directory.Build.targets @@ -0,0 +1,3 @@ + + + diff --git a/vsintegration/Vsix/VisualFSharpOpenSource/Properties/launchSettings.json b/vsintegration/Vsix/VisualFSharpOpenSource/Properties/launchSettings.json new file mode 100644 index 0000000000..b25381cd71 --- /dev/null +++ b/vsintegration/Vsix/VisualFSharpOpenSource/Properties/launchSettings.json @@ -0,0 +1,9 @@ +{ + "profiles": { + "VisualFSharpOpenSource": { + "commandName": "Executable", + "executablePath": "$(DevEnvDir)devenv.exe", + "commandLineArgs": "/rootsuffix $(VSSDKTargetPlatformRegRootSuffix) /log" + } + } +} \ No newline at end of file diff --git a/vsintegration/Vsix/VisualFSharpOpenSource/VisualFSharpOpenSource.csproj b/vsintegration/Vsix/VisualFSharpOpenSource/VisualFSharpOpenSource.csproj index 56bb08bfeb..3433449054 100644 --- a/vsintegration/Vsix/VisualFSharpOpenSource/VisualFSharpOpenSource.csproj +++ b/vsintegration/Vsix/VisualFSharpOpenSource/VisualFSharpOpenSource.csproj @@ -1,77 +1,14 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\src - net40 - 15.0 - 11.0 - $(FSharpSourcesRoot)\..\packages\Microsoft.VSSDK.BuildTools.$(RoslynVSPackagesVersion)\tools - - - 15.0 - 2.0 - {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - publish\ - true - Disk - false - Foreground - 7 - Days - true - false - true - 0 - v4.6 - false - false - false - false - false - false - false - false - true - false - CommonExtensions - Microsoft\FSharp - None - Debug - AnyCPU + net46 Library - Properties - RoslynDev - true - True - False - {E6A45CDF-B408-420F-B475-74611BEFC52B} - true - VisualFSharpOpenSource - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin - VisualFSharpOpenSource - $(RootBinPath) - 15.4.1.0 - cs - - - - - Program - $(DevEnvDir)devenv.exe - /rootsuffix $(VSRootSuffix) /log - $(VSRootSuffix) - true - - - Program - $(DevEnvDir)devenv.exe - true - /rootsuffix $(VSRootSuffix) /log - $(VSRootSuffix) + Microsoft\FSharp + netcoreapp1.0 + Designer @@ -92,23 +29,7 @@ true - - - False - Microsoft .NET Framework 4.6 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - false - - + {649FA588-F02E-457C-9FCF-87E46407481E} @@ -289,15 +210,10 @@ True + - - False - $(FSharpSourcesRoot)\..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll - - - $(FSharpSourcesRoot)\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - + + - - + diff --git a/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj b/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj index 2fdd766124..1debf5d2d8 100644 --- a/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj +++ b/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj @@ -6,31 +6,7 @@ VisualFSharpTemplate net46 Library - publish\ - true - Disk - false - Foreground - 7 - Days - true - false - true - false - false - false - false - false - false - false - false - true - true - CommonExtensions Microsoft\FSharpTemplates - None - true - false @@ -39,24 +15,6 @@ - - - False - Microsoft .NET Framework 4.6 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - false - - - {604f0daa-2d33-48dd-b162-edf0b672803d} diff --git a/vsintegration/fsharp-vsintegration-vsix-build.proj b/vsintegration/fsharp-vsintegration-vsix-build.proj index 83cf691219..a267fb50fd 100644 --- a/vsintegration/fsharp-vsintegration-vsix-build.proj +++ b/vsintegration/fsharp-vsintegration-vsix-build.proj @@ -12,6 +12,7 @@ + From 4314d69a769ee807fb4a0725cc0967b0b6b860ac Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Thu, 1 Mar 2018 13:40:22 -0800 Subject: [PATCH 051/147] convert VisualFSharpFull to the dotnet SDK --- VisualFSharp.sln | 10 +- build/targets/AssemblyVersions.props | 4 + .../VisualFSharpFull/Directory.Build.props | 3 + .../VisualFSharpFull/Directory.Build.targets | 3 + .../Properties/launchSettings.json | 9 ++ .../VisualFSharpFull/VisualFSharpFull.csproj | 103 ++---------------- .../fsharp-vsintegration-vsix-build.proj | 7 +- 7 files changed, 35 insertions(+), 104 deletions(-) create mode 100644 vsintegration/Vsix/VisualFSharpFull/Directory.Build.props create mode 100644 vsintegration/Vsix/VisualFSharpFull/Directory.Build.targets create mode 100644 vsintegration/Vsix/VisualFSharpFull/Properties/launchSettings.json diff --git a/VisualFSharp.sln b/VisualFSharp.sln index 986f1ef833..fbdf9695b3 100644 --- a/VisualFSharp.sln +++ b/VisualFSharp.sln @@ -114,7 +114,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XMLFile", "vsintegration\It EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Vsix", "Vsix", "{141F6C23-E1B1-4D89-9F10-F0B8AD58E71F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VisualFSharpFull", "vsintegration\Vsix\VisualFSharpFull\VisualFSharpFull.csproj", "{59ADCE46-9740-4079-834D-9A03A3494EBC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VisualFSharpFull", "vsintegration\Vsix\VisualFSharpFull\VisualFSharpFull.csproj", "{59ADCE46-9740-4079-834D-9A03A3494EBC}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VisualFSharpOpenSource", "vsintegration\Vsix\VisualFSharpOpenSource\VisualFSharpOpenSource.csproj", "{E6A45CDF-B408-420F-B475-74611BEFC52B}" EndProject @@ -646,10 +646,10 @@ Global {59ADCE46-9740-4079-834D-9A03A3494EBC}.Debug|Any CPU.Build.0 = Debug|Any CPU {59ADCE46-9740-4079-834D-9A03A3494EBC}.Debug|x86.ActiveCfg = Debug|Any CPU {59ADCE46-9740-4079-834D-9A03A3494EBC}.Debug|x86.Build.0 = Debug|Any CPU - {59ADCE46-9740-4079-834D-9A03A3494EBC}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {59ADCE46-9740-4079-834D-9A03A3494EBC}.Proto|Any CPU.Build.0 = Proto|Any CPU - {59ADCE46-9740-4079-834D-9A03A3494EBC}.Proto|x86.ActiveCfg = Proto|Any CPU - {59ADCE46-9740-4079-834D-9A03A3494EBC}.Proto|x86.Build.0 = Proto|Any CPU + {59ADCE46-9740-4079-834D-9A03A3494EBC}.Proto|Any CPU.ActiveCfg = Release|Any CPU + {59ADCE46-9740-4079-834D-9A03A3494EBC}.Proto|Any CPU.Build.0 = Release|Any CPU + {59ADCE46-9740-4079-834D-9A03A3494EBC}.Proto|x86.ActiveCfg = Release|Any CPU + {59ADCE46-9740-4079-834D-9A03A3494EBC}.Proto|x86.Build.0 = Release|Any CPU {59ADCE46-9740-4079-834D-9A03A3494EBC}.Release|Any CPU.ActiveCfg = Release|Any CPU {59ADCE46-9740-4079-834D-9A03A3494EBC}.Release|Any CPU.Build.0 = Release|Any CPU {59ADCE46-9740-4079-834D-9A03A3494EBC}.Release|x86.ActiveCfg = Release|Any CPU diff --git a/build/targets/AssemblyVersions.props b/build/targets/AssemblyVersions.props index 0fa632f91e..809003cf80 100644 --- a/build/targets/AssemblyVersions.props +++ b/build/targets/AssemblyVersions.props @@ -43,4 +43,8 @@ $(MicroBuildAssemblyVersion_WithoutRevision).$(BuildTimeStamp) $(BuildTimeStamp_Date)-$(BuildTimeStamp_Number) + + + + diff --git a/vsintegration/Vsix/VisualFSharpFull/Directory.Build.props b/vsintegration/Vsix/VisualFSharpFull/Directory.Build.props new file mode 100644 index 0000000000..bb8eac309b --- /dev/null +++ b/vsintegration/Vsix/VisualFSharpFull/Directory.Build.props @@ -0,0 +1,3 @@ + + + diff --git a/vsintegration/Vsix/VisualFSharpFull/Directory.Build.targets b/vsintegration/Vsix/VisualFSharpFull/Directory.Build.targets new file mode 100644 index 0000000000..ccd47cc0a9 --- /dev/null +++ b/vsintegration/Vsix/VisualFSharpFull/Directory.Build.targets @@ -0,0 +1,3 @@ + + + diff --git a/vsintegration/Vsix/VisualFSharpFull/Properties/launchSettings.json b/vsintegration/Vsix/VisualFSharpFull/Properties/launchSettings.json new file mode 100644 index 0000000000..b25381cd71 --- /dev/null +++ b/vsintegration/Vsix/VisualFSharpFull/Properties/launchSettings.json @@ -0,0 +1,9 @@ +{ + "profiles": { + "VisualFSharpOpenSource": { + "commandName": "Executable", + "executablePath": "$(DevEnvDir)devenv.exe", + "commandLineArgs": "/rootsuffix $(VSSDKTargetPlatformRegRootSuffix) /log" + } + } +} \ No newline at end of file diff --git a/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj b/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj index b5918c11cc..49dfe5af59 100644 --- a/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj +++ b/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj @@ -1,78 +1,14 @@  - + + - $(MSBuildProjectDirectory)\..\..\..\src - net40 - 15.0 - 11.0 - $(FSharpSourcesRoot)\..\packages\Microsoft.VSSDK.BuildTools.$(RoslynVSPackagesVersion)\tools - - - 15.0 - 2.0 - {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - publish\ - true - Disk - false - Foreground - 7 - Days - true - false - true - 0 - v4.6 - false - false - false - false - false - false - false - false - true - true - CommonExtensions - Microsoft\FSharp - None - Debug - AnyCPU + net46 Library - Properties - RoslynDev - true - False - True - {59ADCE46-9740-4079-834D-9A03A3494EBC} - true - VisualFSharpFull - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin - VisualFSharpFull - $(RootBinPath) - 15.4.1.0 - cs - false - - - - - Program - $(DevEnvDir)devenv.exe - /rootsuffix $(VSRootSuffix) /log - $(VSRootSuffix) - true - - - Program - $(DevEnvDir)devenv.exe - true - /rootsuffix $(VSRootSuffix) /log - $(VSRootSuffix) + Microsoft\FSharp + netcoreapp1.0 + Designer @@ -93,23 +29,7 @@ true - - - False - Microsoft .NET Framework 4.6 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - false - - + {649FA588-F02E-457C-9FCF-87E46407481E} @@ -266,12 +186,9 @@ True + - - False - $(FSharpSourcesRoot)\..\packages\Newtonsoft.Json.10.0.2\lib\net45\Newtonsoft.Json.dll - + - - + diff --git a/vsintegration/fsharp-vsintegration-vsix-build.proj b/vsintegration/fsharp-vsintegration-vsix-build.proj index a267fb50fd..8d3c826e8e 100644 --- a/vsintegration/fsharp-vsintegration-vsix-build.proj +++ b/vsintegration/fsharp-vsintegration-vsix-build.proj @@ -10,15 +10,10 @@ - - - - - - + From 2296c2b1c3858b63c416eef5b2a6c7223a16a103 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Thu, 1 Mar 2018 13:50:34 -0800 Subject: [PATCH 052/147] cleanup Directory.Build.props/.targets and remove packages.config --- build.cmd | 5 -- ...tory.Build.props => Directory.Build.props} | 0 ....Build.targets => Directory.Build.targets} | 0 vsintegration/Templates.Directory.Build.props | 2 +- .../Templates.Directory.Build.targets | 2 +- .../Directory.Build.props | 3 - .../Directory.Build.targets | 3 - ...tory.Build.props => Directory.Build.props} | 2 +- ....Build.targets => Directory.Build.targets} | 2 +- .../VisualFSharpFull/Directory.Build.props | 3 - .../VisualFSharpFull/Directory.Build.targets | 3 - .../Directory.Build.props | 3 - .../Directory.Build.targets | 3 - .../Directory.Build.props | 3 - .../Directory.Build.targets | 3 - vsintegration/packages.config | 68 ------------------- vsintegration/src/Directory.Build.props | 3 - vsintegration/src/Directory.Build.targets | 3 - vsintegration/src/fsharp.tools.targets | 13 ---- vsintegration/tests/Directory.Build.props | 3 - vsintegration/tests/Directory.Build.targets | 3 - 21 files changed, 4 insertions(+), 126 deletions(-) rename vsintegration/{FSharp.Directory.Build.props => Directory.Build.props} (100%) rename vsintegration/{FSharp.Directory.Build.targets => Directory.Build.targets} (100%) delete mode 100644 vsintegration/Utils/LanguageServiceProfiling/Directory.Build.props delete mode 100644 vsintegration/Utils/LanguageServiceProfiling/Directory.Build.targets rename vsintegration/Vsix/{FSharp.Directory.Build.props => Directory.Build.props} (94%) rename vsintegration/Vsix/{FSharp.Directory.Build.targets => Directory.Build.targets} (85%) delete mode 100644 vsintegration/Vsix/VisualFSharpFull/Directory.Build.props delete mode 100644 vsintegration/Vsix/VisualFSharpFull/Directory.Build.targets delete mode 100644 vsintegration/Vsix/VisualFSharpOpenSource/Directory.Build.props delete mode 100644 vsintegration/Vsix/VisualFSharpOpenSource/Directory.Build.targets delete mode 100644 vsintegration/Vsix/VisualFSharpTemplates/Directory.Build.props delete mode 100644 vsintegration/Vsix/VisualFSharpTemplates/Directory.Build.targets delete mode 100644 vsintegration/packages.config delete mode 100644 vsintegration/src/Directory.Build.props delete mode 100644 vsintegration/src/Directory.Build.targets delete mode 100644 vsintegration/src/fsharp.tools.targets delete mode 100644 vsintegration/tests/Directory.Build.props delete mode 100644 vsintegration/tests/Directory.Build.targets diff --git a/build.cmd b/build.cmd index 278dadf852..d146e6cc24 100644 --- a/build.cmd +++ b/build.cmd @@ -624,11 +624,6 @@ if "%RestorePackages%" == "true" ( %_nugetexe% restore packages.config !_nugetoptions! @if ERRORLEVEL 1 echo Error: Nuget restore failed && goto :failure - if "%BUILD_VS%" == "1" ( - %_nugetexe% restore vsintegration\packages.config !_nugetoptions! - @if ERRORLEVEL 1 echo Error: Nuget restore failed && goto :failure - ) - if "%BUILD_SETUP%" == "1" ( %_nugetexe% restore setup\packages.config !_nugetoptions! @if ERRORLEVEL 1 echo Error: Nuget restore failed && goto :failure diff --git a/vsintegration/FSharp.Directory.Build.props b/vsintegration/Directory.Build.props similarity index 100% rename from vsintegration/FSharp.Directory.Build.props rename to vsintegration/Directory.Build.props diff --git a/vsintegration/FSharp.Directory.Build.targets b/vsintegration/Directory.Build.targets similarity index 100% rename from vsintegration/FSharp.Directory.Build.targets rename to vsintegration/Directory.Build.targets diff --git a/vsintegration/Templates.Directory.Build.props b/vsintegration/Templates.Directory.Build.props index daa0975d3d..9be1daa15b 100644 --- a/vsintegration/Templates.Directory.Build.props +++ b/vsintegration/Templates.Directory.Build.props @@ -1,6 +1,6 @@ - + net46 diff --git a/vsintegration/Templates.Directory.Build.targets b/vsintegration/Templates.Directory.Build.targets index 45a477f2f2..190f81e7c1 100644 --- a/vsintegration/Templates.Directory.Build.targets +++ b/vsintegration/Templates.Directory.Build.targets @@ -1,6 +1,6 @@ - + $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\$(TemplateCategory)\$(AssemblyName) diff --git a/vsintegration/Utils/LanguageServiceProfiling/Directory.Build.props b/vsintegration/Utils/LanguageServiceProfiling/Directory.Build.props deleted file mode 100644 index bb8eac309b..0000000000 --- a/vsintegration/Utils/LanguageServiceProfiling/Directory.Build.props +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/vsintegration/Utils/LanguageServiceProfiling/Directory.Build.targets b/vsintegration/Utils/LanguageServiceProfiling/Directory.Build.targets deleted file mode 100644 index ccd47cc0a9..0000000000 --- a/vsintegration/Utils/LanguageServiceProfiling/Directory.Build.targets +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/vsintegration/Vsix/FSharp.Directory.Build.props b/vsintegration/Vsix/Directory.Build.props similarity index 94% rename from vsintegration/Vsix/FSharp.Directory.Build.props rename to vsintegration/Vsix/Directory.Build.props index 02bdb97830..ab021b1e3b 100644 --- a/vsintegration/Vsix/FSharp.Directory.Build.props +++ b/vsintegration/Vsix/Directory.Build.props @@ -1,6 +1,6 @@ - + RoslynDev diff --git a/vsintegration/Vsix/FSharp.Directory.Build.targets b/vsintegration/Vsix/Directory.Build.targets similarity index 85% rename from vsintegration/Vsix/FSharp.Directory.Build.targets rename to vsintegration/Vsix/Directory.Build.targets index b1d570e793..fa37bc2cd1 100644 --- a/vsintegration/Vsix/FSharp.Directory.Build.targets +++ b/vsintegration/Vsix/Directory.Build.targets @@ -1,6 +1,6 @@ - + diff --git a/vsintegration/Vsix/VisualFSharpFull/Directory.Build.props b/vsintegration/Vsix/VisualFSharpFull/Directory.Build.props deleted file mode 100644 index bb8eac309b..0000000000 --- a/vsintegration/Vsix/VisualFSharpFull/Directory.Build.props +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/vsintegration/Vsix/VisualFSharpFull/Directory.Build.targets b/vsintegration/Vsix/VisualFSharpFull/Directory.Build.targets deleted file mode 100644 index ccd47cc0a9..0000000000 --- a/vsintegration/Vsix/VisualFSharpFull/Directory.Build.targets +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/vsintegration/Vsix/VisualFSharpOpenSource/Directory.Build.props b/vsintegration/Vsix/VisualFSharpOpenSource/Directory.Build.props deleted file mode 100644 index bb8eac309b..0000000000 --- a/vsintegration/Vsix/VisualFSharpOpenSource/Directory.Build.props +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/vsintegration/Vsix/VisualFSharpOpenSource/Directory.Build.targets b/vsintegration/Vsix/VisualFSharpOpenSource/Directory.Build.targets deleted file mode 100644 index ccd47cc0a9..0000000000 --- a/vsintegration/Vsix/VisualFSharpOpenSource/Directory.Build.targets +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/vsintegration/Vsix/VisualFSharpTemplates/Directory.Build.props b/vsintegration/Vsix/VisualFSharpTemplates/Directory.Build.props deleted file mode 100644 index bb8eac309b..0000000000 --- a/vsintegration/Vsix/VisualFSharpTemplates/Directory.Build.props +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/vsintegration/Vsix/VisualFSharpTemplates/Directory.Build.targets b/vsintegration/Vsix/VisualFSharpTemplates/Directory.Build.targets deleted file mode 100644 index ccd47cc0a9..0000000000 --- a/vsintegration/Vsix/VisualFSharpTemplates/Directory.Build.targets +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/vsintegration/packages.config b/vsintegration/packages.config deleted file mode 100644 index 56f7c3e90b..0000000000 --- a/vsintegration/packages.config +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vsintegration/src/Directory.Build.props b/vsintegration/src/Directory.Build.props deleted file mode 100644 index bb8eac309b..0000000000 --- a/vsintegration/src/Directory.Build.props +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/vsintegration/src/Directory.Build.targets b/vsintegration/src/Directory.Build.targets deleted file mode 100644 index ccd47cc0a9..0000000000 --- a/vsintegration/src/Directory.Build.targets +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/vsintegration/src/fsharp.tools.targets b/vsintegration/src/fsharp.tools.targets deleted file mode 100644 index 6ef78a7016..0000000000 --- a/vsintegration/src/fsharp.tools.targets +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/vsintegration/tests/Directory.Build.props b/vsintegration/tests/Directory.Build.props deleted file mode 100644 index bb8eac309b..0000000000 --- a/vsintegration/tests/Directory.Build.props +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/vsintegration/tests/Directory.Build.targets b/vsintegration/tests/Directory.Build.targets deleted file mode 100644 index ccd47cc0a9..0000000000 --- a/vsintegration/tests/Directory.Build.targets +++ /dev/null @@ -1,3 +0,0 @@ - - - From a98b8064948468c626cbcbaed004fc3aa605fa7a Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Mon, 5 Mar 2018 13:22:43 -0800 Subject: [PATCH 053/147] upgrade System.ValueTuple to 4.4.0 (asm ver 4.0.2.0) --- build/config/AssemblySignToolData.json | 2 +- fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj | 2 +- packages.config | 2 +- setup/FSharp.SDK/component-groups/Compiler_Redist.wxs | 2 +- setup/packages.config | 2 +- .../FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj | 2 +- .../FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj | 2 +- .../FSharp.Compiler.Private.netcore.nuspec | 2 +- src/fsharp/FSharp.Compiler.Private/project.json | 2 +- .../FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec | 2 +- .../FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec | 2 +- src/fsharp/Fsc-proto/Fsc-proto.fsproj | 2 +- .../FSharp.Compiler.Unittests.fsproj | 2 +- tests/FSharp.Core.UnitTests/FSharp.Core.Unittests.fsproj | 2 +- .../FSharp.Core/SampleTuples/TupleSample.csproj | 2 +- tests/FSharp.Core.UnitTests/project.json | 2 +- .../src/HostedCompilerServer/HostedCompilerServer.fsproj | 2 +- .../ProjectWithBuildErrors/ProjectWithBuildErrors.fsproj | 2 +- .../ProjectWithBuildErrors/packages.config | 2 +- .../Library2/Library2.fsproj | 2 +- .../Library2/packages.config | 2 +- .../SameFileBelongsToMultipleProjects.fsproj | 2 +- .../Library1AlwaysInMatchingConfiguration.fsproj | 2 +- .../Library1AlwaysInMatchingConfiguration/fff.config | 2 +- .../Library2AlwaysInDebugConfiguration.fsproj | 2 +- .../Library2AlwaysInDebugConfiguration/packages.config | 2 +- .../TestProjectChanges/TestProjectChanges.fsproj | 2 +- .../ConsoleProject/Template/ConsoleApplication.fsproj | 2 +- .../ConsoleProject/Template/ConsoleApplication.vstemplate | 2 +- .../ProjectTemplates/LibraryProject/Template/Library.fsproj | 2 +- .../LibraryProject/Template/Library.vstemplate | 2 +- .../ProjectTemplates/TutorialProject/Template/Tutorial.fsproj | 2 +- .../TutorialProject/Template/Tutorial.vstemplate | 2 +- vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj | 4 ++-- .../Vsix/VisualFSharpOpenSource/VisualFSharpOpenSource.csproj | 4 ++-- 35 files changed, 37 insertions(+), 37 deletions(-) diff --git a/build/config/AssemblySignToolData.json b/build/config/AssemblySignToolData.json index a2dcc54b65..0348dab38f 100644 --- a/build/config/AssemblySignToolData.json +++ b/build/config/AssemblySignToolData.json @@ -66,7 +66,7 @@ "Microsoft.DiaSymReader.dll", "Microsoft.DiaSymReader.PortablePdb.dll", "Newtonsoft.Json.dll", - "System.ValueTuple.4.3.1.nupkg", + "System.ValueTuple.4.4.0.nupkg", "System.Collections.Immutable.dll", "System.Reflection.Metadata.dll", "System.ValueTuple.dll" diff --git a/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj b/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj index 8d7f42d4ee..ce45abbc31 100644 --- a/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj +++ b/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj @@ -651,7 +651,7 @@ - $(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll + $(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll diff --git a/packages.config b/packages.config index 81622c1d5d..ed756fd43a 100644 --- a/packages.config +++ b/packages.config @@ -19,7 +19,7 @@ - + diff --git a/setup/FSharp.SDK/component-groups/Compiler_Redist.wxs b/setup/FSharp.SDK/component-groups/Compiler_Redist.wxs index 9c4e65e6ca..356e355b0b 100644 --- a/setup/FSharp.SDK/component-groups/Compiler_Redist.wxs +++ b/setup/FSharp.SDK/component-groups/Compiler_Redist.wxs @@ -187,7 +187,7 @@ - + diff --git a/setup/packages.config b/setup/packages.config index 036cb40085..af635aca17 100644 --- a/setup/packages.config +++ b/setup/packages.config @@ -12,6 +12,6 @@ - + diff --git a/src/buildfromsource/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj b/src/buildfromsource/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj index 15ca88bacb..a9f459e9a2 100644 --- a/src/buildfromsource/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj +++ b/src/buildfromsource/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj @@ -637,7 +637,7 @@ - + diff --git a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj index d2eb7dad98..25aa3782ff 100644 --- a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj +++ b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj @@ -683,7 +683,7 @@ ..\..\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - ..\..\..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll + ..\..\..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll true diff --git a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.netcore.nuspec b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.netcore.nuspec index 3b663e8d3d..f245cf71c9 100644 --- a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.netcore.nuspec +++ b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.netcore.nuspec @@ -33,7 +33,7 @@ - + diff --git a/src/fsharp/FSharp.Compiler.Private/project.json b/src/fsharp/FSharp.Compiler.Private/project.json index 09cfefb19f..51cef4f7ef 100644 --- a/src/fsharp/FSharp.Compiler.Private/project.json +++ b/src/fsharp/FSharp.Compiler.Private/project.json @@ -19,7 +19,7 @@ "System.Threading.ThreadPool": "4.3.0", "Microsoft.DiaSymReader.PortablePdb": "1.2.0", "Microsoft.DiaSymReader": "1.1.0", - "System.ValueTuple": "4.3.1" + "System.ValueTuple": "4.4.0" }, "runtimes": { "win7-x86": { }, diff --git a/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec b/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec index bc4d615110..91a5f25302 100644 --- a/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec +++ b/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec @@ -32,7 +32,7 @@ - + diff --git a/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec b/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec index 0782573e05..91c9447518 100644 --- a/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec +++ b/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec @@ -31,7 +31,7 @@ - + diff --git a/src/fsharp/Fsc-proto/Fsc-proto.fsproj b/src/fsharp/Fsc-proto/Fsc-proto.fsproj index a7e0cca04f..96dbedfa11 100644 --- a/src/fsharp/Fsc-proto/Fsc-proto.fsproj +++ b/src/fsharp/Fsc-proto/Fsc-proto.fsproj @@ -467,7 +467,7 @@ $(FSharpSourcesRoot)\..\packages\System.Collections.Immutable.$(SystemCollectionsImmutableVersion)\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - $(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll + $(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll {DED3BBD7-53F4-428A-8C9F-27968E768605} diff --git a/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.Unittests.fsproj b/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.Unittests.fsproj index 195324d085..4bd20fd6b2 100644 --- a/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.Unittests.fsproj +++ b/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.Unittests.fsproj @@ -44,7 +44,7 @@ - ..\..\..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll + ..\..\..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core.Unittests.fsproj b/tests/FSharp.Core.UnitTests/FSharp.Core.Unittests.fsproj index 6bdebe09cc..361537fcfd 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core.Unittests.fsproj +++ b/tests/FSharp.Core.UnitTests/FSharp.Core.Unittests.fsproj @@ -52,7 +52,7 @@ $(FsCheckLibDir)\net452\FsCheck.dll - ..\..\packages\System.ValueTuple.4.3.1\lib\portable-net40+sl4+win8+wp8\System.ValueTuple.dll + ..\..\packages\System.ValueTuple.4.4.0\lib\portable-net40+sl4+win8+wp8\System.ValueTuple.dll True diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/SampleTuples/TupleSample.csproj b/tests/FSharp.Core.UnitTests/FSharp.Core/SampleTuples/TupleSample.csproj index 23d1a8f54d..c4e46fb690 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/SampleTuples/TupleSample.csproj +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/SampleTuples/TupleSample.csproj @@ -25,7 +25,7 @@ - ..\..\..\..\..\packages\System.ValueTuple.4.3.1\lib\portable-net40+sl4+win8+wp8\System.ValueTuple.dll + ..\..\..\..\..\packages\System.ValueTuple.4.4.0\lib\portable-net40+sl4+win8+wp8\System.ValueTuple.dll diff --git a/tests/FSharp.Core.UnitTests/project.json b/tests/FSharp.Core.UnitTests/project.json index 58fec9e698..36a6823bf2 100644 --- a/tests/FSharp.Core.UnitTests/project.json +++ b/tests/FSharp.Core.UnitTests/project.json @@ -8,7 +8,7 @@ "dependencies": { "nunit": "3.5.0", "nunitlite": "3.5.0", - "System.ValueTuple": "4.3.1", + "System.ValueTuple": "4.4.0", "FsCheck": "3.0.0-alpha3", "Testing.FSharp.Core": "4.2.4", "Microsoft.FSharp.TupleSample": "1.0.0-alpha-161112" diff --git a/tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj b/tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj index c03e0df50f..8a5ff94b44 100644 --- a/tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj +++ b/tests/fsharpqa/testenv/src/HostedCompilerServer/HostedCompilerServer.fsproj @@ -50,7 +50,7 @@ FSharp.Compiler.Private - $(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll + $(FSharpSourcesRoot)\..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll true diff --git a/tests/projects/misc/ProjectWithBuildErrors/ProjectWithBuildErrors/ProjectWithBuildErrors.fsproj b/tests/projects/misc/ProjectWithBuildErrors/ProjectWithBuildErrors/ProjectWithBuildErrors.fsproj index 8a07b57459..43aa06b77c 100644 --- a/tests/projects/misc/ProjectWithBuildErrors/ProjectWithBuildErrors/ProjectWithBuildErrors.fsproj +++ b/tests/projects/misc/ProjectWithBuildErrors/ProjectWithBuildErrors/ProjectWithBuildErrors.fsproj @@ -70,7 +70,7 @@ - ..\packages\System.ValueTuple.4.3.1\lib\netstandard1.0\System.ValueTuple.dll + ..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll - 2003;$(NoWarn) - - - - <_AssemblyVersionAttributes Include="System.Reflection.AssemblyCompanyAttribute"> - <_Parameter1>Microsoft Corporation - - <_AssemblyVersionAttributes Include="System.Reflection.AssemblyCopyrightAttribute"> - <_Parameter1>© Microsoft Corporation. All Rights Reserved. - - <_AssemblyVersionAttributes Include="System.Reflection.AssemblyDescriptionAttribute"> - <_Parameter1>$(AssemblyName).dll - - <_AssemblyVersionAttributes Include="System.Reflection.AssemblyFileVersionAttribute"> - <_Parameter1>$(Build_FileVersion) - - <_AssemblyVersionAttributes Include="System.Reflection.AssemblyInformationalVersionAttribute"> - <_Parameter1>$(MicroBuildAssemblyVersion). Commit Hash: $(GitHeadSha). - - <_AssemblyVersionAttributes Include="System.Reflection.AssemblyProductAttribute"> - <_Parameter1>Microsoft® F# - - <_AssemblyVersionAttributes Include="System.Reflection.AssemblyTitleAttribute"> - <_Parameter1>$(AssemblyName).dll - - <_AssemblyVersionAttributes Include="System.Reflection.AssemblyVersionAttribute"> - <_Parameter1>$(MicroBuildAssemblyVersion) - - - - - - - - - - - - - diff --git a/build/targets/GenerateAssemblyAttributes.targets b/build/targets/GenerateAssemblyAttributes.targets index 595ec97973..d7f7be7603 100644 --- a/build/targets/GenerateAssemblyAttributes.targets +++ b/build/targets/GenerateAssemblyAttributes.targets @@ -1,7 +1,10 @@ + + + BeforeTargets="CoreCompile" + Condition="'$(Configuration)' != 'Proto'"> $(IntermediateOutputPath)$(MSBuildProjectName).AssemblyVersion$(DefaultLanguageSourceExtension) @@ -41,6 +44,17 @@ + + + + + + + + <_LinesToWrite Include="// <auto-generated>" /> <_LinesToWrite Include="namespace FSharp" /> @@ -54,17 +68,6 @@ - - - - - - - - $(MSBuildThisFileDirectory)..\ - - fs @@ -338,7 +336,8 @@ - + + From a044057150ebcf95ae7964ea8357b9bfe2db5a49 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Tue, 6 Mar 2018 13:22:14 -0800 Subject: [PATCH 056/147] don't try to invoke fsi.exe if it wasn't built --- build.cmd | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/build.cmd b/build.cmd index 4ae0f06223..3758950758 100644 --- a/build.cmd +++ b/build.cmd @@ -742,9 +742,11 @@ if "%BUILD_PHASE%" == "1" ( echo ---------------- Done with build, starting assembly version checks --------------- set asmvercheckpath=%~dp0tests\fsharpqa\testenv\src\AssemblyVersionCheck -echo "%~dp0%BUILD_CONFIG%\net40\bin\fsi.exe" %asmvercheckpath%\AssemblyVersionCheck.fsx -- "%~dp0build\config\AssemblySignToolData.json" "%~dp0%BUILD_CONFIG%" - "%~dp0%BUILD_CONFIG%\net40\bin\fsi.exe" %asmvercheckpath%\AssemblyVersionCheck.fsx -- "%~dp0build\config\AssemblySignToolData.json" "%~dp0%BUILD_CONFIG%" -if ERRORLEVEL 1 echo Error verifying assembly versions and commit hashes. && goto :failure +if "%BUILD_NET40%" == "1" ( + echo "%~dp0%BUILD_CONFIG%\net40\bin\fsi.exe" %asmvercheckpath%\AssemblyVersionCheck.fsx -- "%~dp0build\config\AssemblySignToolData.json" "%~dp0%BUILD_CONFIG%" + "%~dp0%BUILD_CONFIG%\net40\bin\fsi.exe" %asmvercheckpath%\AssemblyVersionCheck.fsx -- "%~dp0build\config\AssemblySignToolData.json" "%~dp0%BUILD_CONFIG%" + if ERRORLEVEL 1 echo Error verifying assembly versions and commit hashes. && goto :failure +) echo ---------------- Done with assembly version checks, starting assembly signing --------------- From a15c1f4fef67950ef55273a38c59637b0e05e055 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Tue, 6 Mar 2018 13:27:36 -0800 Subject: [PATCH 057/147] ensure all resources assemblies get shipped --- setup/Swix/Microsoft.FSharp.Vsix.Resources/Files.swr | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup/Swix/Microsoft.FSharp.Vsix.Resources/Files.swr b/setup/Swix/Microsoft.FSharp.Vsix.Resources/Files.swr index 77153f3fde..a8c5becc80 100644 --- a/setup/Swix/Microsoft.FSharp.Vsix.Resources/Files.swr +++ b/setup/Swix/Microsoft.FSharp.Vsix.Resources/Files.swr @@ -10,9 +10,11 @@ folder "InstallDir:Common7\IDE\PublicAssemblies\$(LocaleParentCulture)" folder "InstallDir:Common7\IDE\CommonExtensions\Microsoft\FSharp\$(LocaleParentCulture)" file source="$(BinariesFolder)\net40\bin\$(LocaleParentCulture)\FSharp.Compiler.Private.resources.dll" vs.file.ngen=yes file source="$(BinariesFolder)\net40\bin\$(LocaleParentCulture)\FSharp.Core.resources.dll" vs.file.ngen=yes + file source="$(BinariesFolder)\net40\bin\$(LocaleParentCulture)\FSharp.Editor.resources.dll" vs.file.ngen=yes file source="$(BinariesFolder)\net40\bin\$(LocaleParentCulture)\FSharp.LanguageService.Base.resources.dll" vs.file.ngen=yes file source="$(BinariesFolder)\net40\bin\$(LocaleParentCulture)\FSharp.LanguageService.resources.dll" vs.file.ngen=yes file source="$(BinariesFolder)\net40\bin\$(LocaleParentCulture)\FSharp.ProjectSystem.Base.resources.dll" vs.file.ngen=yes file source="$(BinariesFolder)\net40\bin\$(LocaleParentCulture)\FSharp.ProjectSystem.FSharp.resources.dll" vs.file.ngen=yes file source="$(BinariesFolder)\net40\bin\$(LocaleParentCulture)\FSharp.ProjectSystem.PropertyPages.resources.dll" vs.file.ngen=yes + file source="$(BinariesFolder)\net40\bin\$(LocaleParentCulture)\FSharp.UIResources.resources.dll" vs.file.ngen=yes file source="$(BinariesFolder)\net40\bin\$(LocaleParentCulture)\FSharp.VS.FSI.resources.dll" vs.file.ngen=yes From 3188acfc457530add2451b817ee36f34de99919d Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Tue, 6 Mar 2018 14:34:52 -0800 Subject: [PATCH 058/147] restore SDK projects after proto has been built This is necessary due to the projects expecting some targets files to be present. --- build.cmd | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/build.cmd b/build.cmd index 4ae0f06223..de57676d5f 100644 --- a/build.cmd +++ b/build.cmd @@ -656,12 +656,6 @@ set _dotnet20exe=%~dp0Tools\dotnet20\dotnet.exe set NUGET_PACKAGES=%~dp0Packages set path=%~dp0Tools\dotnet20\;%path% -if "%NEEDS_DOTNET_CLI_TOOLS%" == "1" ( - :: Restore projects using dotnet CLI tool - echo %_dotnet20exe% restore -v:d build-everything.proj %msbuildflags% %BUILD_DIAG% - %_dotnet20exe% restore -v:d build-everything.proj %msbuildflags% %BUILD_DIAG% -) - echo ----------- Done with package restore, starting dependency uptake check ------------- if not "%PB_PackageVersionPropsUrl%" == "" ( @@ -726,7 +720,14 @@ if "%BUILD_PROTO%" == "1" ( @if ERRORLEVEL 1 echo Error: NGen of proto failed && goto :failure ) -echo ---------------- Done with proto, starting build ------------------------ +if "%NEEDS_DOTNET_CLI_TOOLS%" == "1" ( + echo ---------------- Done with proto, starting SDK restore ------------------------ + :: Restore projects using dotnet CLI tool + echo %_dotnet20exe% restore -v:d build-everything.proj %msbuildflags% %BUILD_DIAG% + %_dotnet20exe% restore -v:d build-everything.proj %msbuildflags% %BUILD_DIAG% +) + +echo ---------------- Done with SDK restore, starting build ------------------------ if "%BUILD_PHASE%" == "1" ( From 970c0fe0dff6ebb251f59a07557907a355f134b0 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Wed, 7 Mar 2018 17:05:59 +0100 Subject: [PATCH 059/147] fixes typos (#4459) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b994fc999b..93328665a1 100644 --- a/README.md +++ b/README.md @@ -51,8 +51,8 @@ These are the branches in use: * `dev15.x` - Latest release branch for the particular point release of Visual Studio. - Incorporates features and fixes from master up to a particular branch point, then selective cherry-picks. - - May contain new features that depend on new things or fixes in th corresponding Visual Studio release. - - Gets ingegrated back into master once the corresponding Visual Studio release is made. + - May contain new features that depend on new things or fixes in the corresponding Visual Studio release. + - Gets integrated back into master once the corresponding Visual Studio release is made. - Used to build Visual F# Tool updates From 29a3bddd29c6eb1dcc7cdbf27bd952c5266389cf Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Wed, 7 Mar 2018 17:06:44 +0100 Subject: [PATCH 060/147] Faster check if IsExtensionMember (#4458) * Faster check if IsExtensionMember * Faster check if IsExtensionMember --- src/fsharp/infos.fs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/fsharp/infos.fs b/src/fsharp/infos.fs index d173e06c7f..f117f36cca 100755 --- a/src/fsharp/infos.fs +++ b/src/fsharp/infos.fs @@ -1177,7 +1177,11 @@ type MethInfo = | _ -> failwith "not supported" /// Indicates if this is an extension member. - member x.IsExtensionMember = x.IsCSharpStyleExtensionMember || x.IsFSharpStyleExtensionMember + member x.IsExtensionMember = + match x with + | FSMeth (_,_,vref,pri) -> pri.IsSome || vref.IsExtensionMember + | ILMeth (_,_,Some _) -> true + | _ -> false /// Indicates if this is an F# extension member. member x.IsFSharpStyleExtensionMember = @@ -1185,8 +1189,10 @@ type MethInfo = /// Indicates if this is an C#-style extension member. member x.IsCSharpStyleExtensionMember = - x.ExtensionMemberPriorityOption.IsSome && - (match x with ILMeth _ -> true | FSMeth (_,_,vref,_) -> not vref.IsExtensionMember | _ -> false) + match x with + | FSMeth (_,_,vref,Some _) -> not vref.IsExtensionMember + | ILMeth (_,_,Some _) -> true + | _ -> false /// Add the actual type instantiation of the apparent type of an F# extension method. // From 3d17049fe897155fcc0161ca5b7671ea26548508 Mon Sep 17 00:00:00 2001 From: Boloutare Doubeni <7613722+boloutaredoubeni@users.noreply.github.com> Date: Wed, 7 Mar 2018 11:31:32 -0500 Subject: [PATCH 061/147] Add instructions to install fsharp to custom user defined path; fix a typo in DEVGUIDE.md (#4455) --- DEVGUIDE.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/DEVGUIDE.md b/DEVGUIDE.md index 7ae36f2d57..12b263da28 100644 --- a/DEVGUIDE.md +++ b/DEVGUIDE.md @@ -93,6 +93,11 @@ Then to replace your machine-wide installation: Full testing is not yet enabled on macOS. +### [Optional] Specifying the install path (Linux or macOS) + +You can specify a custom installation path using the DESTDIR shell variable + + DESTDIR=/my/path/to/fsharp make install ### Developing the F# Compiler (Linux or macOS - .NET Core) @@ -107,7 +112,7 @@ Outputs are placed in This uses an installed .NET SDK 2.0 to build the various duplicated project -Testing the .NET Core version of the F# compiler on mwcOS and Linux is TBD. +Testing the .NET Core version of the F# compiler on macOS and Linux is TBD. ### Developing the Visual F# IDE Tools (Windows Only) From 214475eb33ef82f61e18b6dcc979a3b629f360d2 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Wed, 7 Mar 2018 17:33:05 +0100 Subject: [PATCH 062/147] small cleanup in TProvidedNamespaceExtensionPoint (#4441) --- src/fsharp/NameResolution.fs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/fsharp/NameResolution.fs b/src/fsharp/NameResolution.fs index dcbc1f074e..6120dba0c2 100644 --- a/src/fsharp/NameResolution.fs +++ b/src/fsharp/NameResolution.fs @@ -1100,14 +1100,9 @@ let ResolveProvidedTypeNameInEntity (amap, m, typeName, modref: ModuleOrNamespac | TProvidedNamespaceExtensionPoint(resolutionEnvironment,resolvers) -> match modref.Deref.PublicPath with | Some(PubPath path) -> - let matches = resolvers |> List.map (fun r-> ExtensionTyping.TryResolveProvidedType(r,m,path,typeName)) - let tcrefs = - [ for st in matches do - match st with - | None -> () - | Some st -> - yield AddEntityForProvidedType (amap, modref, resolutionEnvironment, st, m) ] - tcrefs + resolvers + |> List.choose (fun r-> ExtensionTyping.TryResolveProvidedType(r,m,path,typeName)) + |> List.map (fun st -> AddEntityForProvidedType (amap, modref, resolutionEnvironment, st, m)) | None -> [] // We have a provided type, look up its nested types (populating them on-demand if necessary) From b7c20994594591b8e2fe5cdc522676f43e0f1f7e Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Wed, 7 Mar 2018 17:43:06 +0100 Subject: [PATCH 063/147] Reduce intermediate collections when checking symboluse (#4442) --- src/fsharp/NameResolution.fs | 14 ++++++-------- src/fsharp/NameResolution.fsi | 13 ++++++++++--- src/fsharp/service/service.fs | 35 ++++++++++++++++++----------------- 3 files changed, 34 insertions(+), 28 deletions(-) diff --git a/src/fsharp/NameResolution.fs b/src/fsharp/NameResolution.fs index 6120dba0c2..fabb6e515b 100644 --- a/src/fsharp/NameResolution.fs +++ b/src/fsharp/NameResolution.fs @@ -1450,20 +1450,18 @@ type TcSymbolUseData = type TcSymbolUses(g, capturedNameResolutions : ResizeArray, formatSpecifierLocations: (range * int)[]) = // Make sure we only capture the information we really need to report symbol uses - let cnrs = [| for cnr in capturedNameResolutions -> { Item=cnr.Item; ItemOccurence=cnr.ItemOccurence; DisplayEnv=cnr.DisplayEnv; Range=cnr.Range } |] + let allUsesOfSymbols = [| for cnr in capturedNameResolutions -> { Item=cnr.Item; ItemOccurence=cnr.ItemOccurence; DisplayEnv=cnr.DisplayEnv; Range=cnr.Range } |] let capturedNameResolutions = () do ignore capturedNameResolutions // don't capture this! member this.GetUsesOfSymbol(item) = - [| for cnr in cnrs do - if protectAssemblyExploration false (fun () -> ItemsAreEffectivelyEqual g item cnr.Item) then - yield (cnr.ItemOccurence, cnr.DisplayEnv, cnr.Range) |] + [| for symbolUse in allUsesOfSymbols do + if protectAssemblyExploration false (fun () -> ItemsAreEffectivelyEqual g item symbolUse.Item) then + yield symbolUse |] - member this.GetAllUsesOfSymbols() = - [| for cnr in cnrs do - yield (cnr.Item, cnr.ItemOccurence, cnr.DisplayEnv, cnr.Range) |] + member this.AllUsesOfSymbols = allUsesOfSymbols - member this.GetFormatSpecifierLocationsAndArity() = formatSpecifierLocations + member this.GetFormatSpecifierLocationsAndArity() = formatSpecifierLocations /// An accumulator for the results being emitted into the tcSink. diff --git a/src/fsharp/NameResolution.fsi b/src/fsharp/NameResolution.fsi index af3a4a6e3c..859009e364 100755 --- a/src/fsharp/NameResolution.fsi +++ b/src/fsharp/NameResolution.fsi @@ -298,15 +298,22 @@ type internal TcResolutions = static member Empty : TcResolutions +[] +type TcSymbolUseData = + { Item: Item + ItemOccurence: ItemOccurence + DisplayEnv: DisplayEnv + Range: range } + [] /// Represents container for all name resolutions that were met so far when typechecking some particular file type internal TcSymbolUses = /// Get all the uses of a particular item within the file - member GetUsesOfSymbol : Item -> (ItemOccurence * DisplayEnv * range)[] + member GetUsesOfSymbol : Item -> TcSymbolUseData[] - /// Get all the uses of all items within the file - member GetAllUsesOfSymbols : unit -> (Item * ItemOccurence * DisplayEnv * range)[] + /// All the uses of all items within the file + member AllUsesOfSymbols : TcSymbolUseData[] /// Get the locations of all the printf format specifiers in the file member GetFormatSpecifierLocationsAndArity : unit -> (range * int)[] diff --git a/src/fsharp/service/service.fs b/src/fsharp/service/service.fs index 2896a17f43..38e95e816d 100644 --- a/src/fsharp/service/service.fs +++ b/src/fsharp/service/service.fs @@ -1855,10 +1855,11 @@ type FSharpCheckProjectResults(projectFileName:string, tcConfigOption, keepAssem member info.GetUsesOfSymbol(symbol:FSharpSymbol) = let (tcGlobals, _tcImports, _thisCcu, _ccuSig, tcSymbolUses, _topAttribs, _tcAssemblyData, _ilAssemRef, _ad, _tcAssemblyExpr, _dependencyFiles) = getDetails() - [| for r in tcSymbolUses do yield! r.GetUsesOfSymbol(symbol.Item) |] - |> Seq.distinctBy (fun (itemOcc,_denv,m) -> itemOcc, m) - |> Seq.filter (fun (itemOcc,_,_) -> itemOcc <> ItemOccurence.RelatedText) - |> Seq.map (fun (itemOcc,denv,m) -> FSharpSymbolUse(tcGlobals, denv, symbol, itemOcc, m)) + tcSymbolUses + |> Seq.collect (fun r -> r.GetUsesOfSymbol symbol.Item) + |> Seq.distinctBy (fun symbolUse -> symbolUse.ItemOccurence, symbolUse.Range) + |> Seq.filter (fun symbolUse -> symbolUse.ItemOccurence <> ItemOccurence.RelatedText) + |> Seq.map (fun symbolUse -> FSharpSymbolUse(tcGlobals, symbolUse.DisplayEnv, symbol, symbolUse.ItemOccurence, symbolUse.Range)) |> Seq.toArray |> async.Return @@ -1866,11 +1867,11 @@ type FSharpCheckProjectResults(projectFileName:string, tcConfigOption, keepAssem member info.GetAllUsesOfAllSymbols() = let (tcGlobals, tcImports, thisCcu, _ccuSig, tcSymbolUses, _topAttribs, _tcAssemblyData, _ilAssemRef, _ad, _tcAssemblyExpr, _dependencyFiles) = getDetails() - [| for r in tcSymbolUses do - for (item,itemOcc,denv,m) in r.GetAllUsesOfSymbols() do - if itemOcc <> ItemOccurence.RelatedText then - let symbol = FSharpSymbol.Create(tcGlobals, thisCcu, tcImports, item) - yield FSharpSymbolUse(tcGlobals, denv, symbol, itemOcc, m) |] + [| for r in tcSymbolUses do + for symbolUse in r.AllUsesOfSymbols do + if symbolUse.ItemOccurence <> ItemOccurence.RelatedText then + let symbol = FSharpSymbol.Create(tcGlobals, thisCcu, tcImports, symbolUse.Item) + yield FSharpSymbolUse(tcGlobals, symbolUse.DisplayEnv, symbol, symbolUse.ItemOccurence, symbolUse.Range) |] |> async.Return member info.ProjectContext = @@ -2050,7 +2051,7 @@ type FSharpCheckFileResults(filename: string, errors: FSharpErrorInfo[], scopeOp threadSafeOp (fun () -> failwith "not available") (fun scope -> - // This operation is not asynchronous - GetReferencedAssemblies can be run on the calling thread + // This operation is not asynchronous - GetReferencedAssemblies can be run on the calling thread FSharpProjectContext(scope.ThisCcu, scope.GetReferencedAssemblies(), scope.AccessRights)) member info.DependencyFiles = dependencyFiles @@ -2059,19 +2060,19 @@ type FSharpCheckFileResults(filename: string, errors: FSharpErrorInfo[], scopeOp threadSafeOp (fun () -> [| |]) (fun scope -> - [| for (item,itemOcc,denv,m) in scope.ScopeSymbolUses.GetAllUsesOfSymbols() do - if itemOcc <> ItemOccurence.RelatedText then - let symbol = FSharpSymbol.Create(scope.TcGlobals, scope.ThisCcu, scope.TcImports, item) - yield FSharpSymbolUse(scope.TcGlobals, denv, symbol, itemOcc, m) |]) + [| for symbolUse in scope.ScopeSymbolUses.AllUsesOfSymbols do + if symbolUse.ItemOccurence <> ItemOccurence.RelatedText then + let symbol = FSharpSymbol.Create(scope.TcGlobals, scope.ThisCcu, scope.TcImports, symbolUse.Item) + yield FSharpSymbolUse(scope.TcGlobals, symbolUse.DisplayEnv, symbol, symbolUse.ItemOccurence, symbolUse.Range) |]) |> async.Return member info.GetUsesOfSymbolInFile(symbol:FSharpSymbol) = threadSafeOp (fun () -> [| |]) (fun scope -> - [| for (itemOcc,denv,m) in scope.ScopeSymbolUses.GetUsesOfSymbol(symbol.Item) |> Seq.distinctBy (fun (itemOcc,_denv,m) -> itemOcc, m) do - if itemOcc <> ItemOccurence.RelatedText then - yield FSharpSymbolUse(scope.TcGlobals, denv, symbol, itemOcc, m) |]) + [| for symbolUse in scope.ScopeSymbolUses.GetUsesOfSymbol(symbol.Item) |> Seq.distinctBy (fun symbolUse -> symbolUse.ItemOccurence, symbolUse.Range) do + if symbolUse.ItemOccurence <> ItemOccurence.RelatedText then + yield FSharpSymbolUse(scope.TcGlobals, symbolUse.DisplayEnv, symbol, symbolUse.ItemOccurence, symbolUse.Range) |]) |> async.Return member info.GetVisibleNamespacesAndModulesAtPoint(pos: pos) = From f1e781c2aaff7c0737f31e2c61e1411451385e63 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Wed, 7 Mar 2018 20:48:48 +0100 Subject: [PATCH 064/147] shortcut singleton list in append (#4445) --- src/fsharp/FSharp.Core/prim-types.fs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/fsharp/FSharp.Core/prim-types.fs b/src/fsharp/FSharp.Core/prim-types.fs index 28ece080e7..96b417a47d 100644 --- a/src/fsharp/FSharp.Core/prim-types.fs +++ b/src/fsharp/FSharp.Core/prim-types.fs @@ -3646,11 +3646,14 @@ namespace Microsoft.FSharp.Core | (h::t) -> match list2 with | [] -> list1 - | _ -> - let res = [h] - let lastCons = PrivateListHelpers.appendToFreshConsTail res t - PrivateListHelpers.setFreshConsTail lastCons list2 - res + | _ -> + match t with + | [] -> h :: list2 + | _ -> + let res = [h] + let lastCons = PrivateListHelpers.appendToFreshConsTail res t + PrivateListHelpers.setFreshConsTail lastCons list2 + res [] let incr cell = cell.contents <- cell.contents + 1 From 51dac00d62a7f6f6fb714f4cef6cb3912abf58df Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Wed, 7 Mar 2018 20:51:28 +0100 Subject: [PATCH 065/147] Couple of cleanups in ErrorLogger (#4433) --- src/fsharp/ErrorLogger.fs | 81 +++++++++++++++++++-------------------- 1 file changed, 40 insertions(+), 41 deletions(-) diff --git a/src/fsharp/ErrorLogger.fs b/src/fsharp/ErrorLogger.fs index e654fd67e4..fdce9b5522 100755 --- a/src/fsharp/ErrorLogger.fs +++ b/src/fsharp/ErrorLogger.fs @@ -2,11 +2,7 @@ module public Microsoft.FSharp.Compiler.ErrorLogger -open Internal.Utilities open Microsoft.FSharp.Compiler -open Microsoft.FSharp.Compiler.AbstractIL.Diagnostics -open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library -open Microsoft.FSharp.Compiler.Lib open Microsoft.FSharp.Compiler.Range open System @@ -109,23 +105,23 @@ exception ErrorWithSuggestions of (int * string) * range * string * Suggestions let inline protectAssemblyExploration dflt f = try f() - with - | UnresolvedPathReferenceNoRange _ -> dflt - | _ -> reraise() + with + | UnresolvedPathReferenceNoRange _ -> dflt + | _ -> reraise() let inline protectAssemblyExplorationF dflt f = try f() - with - | UnresolvedPathReferenceNoRange (asmName, path) -> dflt(asmName, path) - | _ -> reraise() + with + | UnresolvedPathReferenceNoRange (asmName, path) -> dflt(asmName, path) + | _ -> reraise() let inline protectAssemblyExplorationNoReraise dflt1 dflt2 f = try f() - with - | UnresolvedPathReferenceNoRange _ -> dflt1 - | _ -> dflt2 + with + | UnresolvedPathReferenceNoRange _ -> dflt1 + | _ -> dflt2 // Attach a range if this is a range dual exception. let rec AttachRange m (exn:exn) = @@ -150,20 +146,22 @@ type Exiter = let QuitProcessExiter = { new Exiter with - member x.Exit(n) = + member __.Exit(n) = try System.Environment.Exit(n) with _ -> () - failwithf "%s" <| FSComp.SR.elSysEnvExitDidntExit() } + FSComp.SR.elSysEnvExitDidntExit() + |> failwith } /// Closed enumeration of build phases. +[] type BuildPhase = | DefaultPhase | Compile | Parameter | Parse | TypeCheck | CodeGen - | Optimize | IlxGen | IlGen | Output + | Optimize | IlxGen | IlGen | Output | Interactive // An error seen during interactive execution /// Literal build phase subcategory strings. @@ -212,17 +210,17 @@ type PhasedDiagnostic = /// member pe.Subcategory() = match pe.Phase with - | DefaultPhase -> BuildPhaseSubcategory.DefaultPhase - | Compile -> BuildPhaseSubcategory.Compile - | Parameter -> BuildPhaseSubcategory.Parameter - | Parse -> BuildPhaseSubcategory.Parse - | TypeCheck -> BuildPhaseSubcategory.TypeCheck - | CodeGen -> BuildPhaseSubcategory.CodeGen - | Optimize -> BuildPhaseSubcategory.Optimize - | IlxGen -> BuildPhaseSubcategory.IlxGen - | IlGen -> BuildPhaseSubcategory.IlGen - | Output -> BuildPhaseSubcategory.Output - | Interactive -> BuildPhaseSubcategory.Interactive + | BuildPhase.DefaultPhase -> BuildPhaseSubcategory.DefaultPhase + | BuildPhase.Compile -> BuildPhaseSubcategory.Compile + | BuildPhase.Parameter -> BuildPhaseSubcategory.Parameter + | BuildPhase.Parse -> BuildPhaseSubcategory.Parse + | BuildPhase.TypeCheck -> BuildPhaseSubcategory.TypeCheck + | BuildPhase.CodeGen -> BuildPhaseSubcategory.CodeGen + | BuildPhase.Optimize -> BuildPhaseSubcategory.Optimize + | BuildPhase.IlxGen -> BuildPhaseSubcategory.IlxGen + | BuildPhase.IlGen -> BuildPhaseSubcategory.IlGen + | BuildPhase.Output -> BuildPhaseSubcategory.Output + | BuildPhase.Interactive -> BuildPhaseSubcategory.Interactive /// Return true if the textual phase given is from the compile part of the build process. /// This set needs to be equal to the set of subcategories that the language service can produce. @@ -256,7 +254,7 @@ type PhasedDiagnostic = member pe.IsPhaseInCompile() = let isPhaseInCompile = match pe.Phase with - | Compile | Parameter | Parse | TypeCheck -> true + | BuildPhase.Compile | BuildPhase.Parameter | BuildPhase.Parse | BuildPhase.TypeCheck -> true | _ -> false // Sanity check ensures that Phase matches Subcategory #if DEBUG @@ -274,7 +272,7 @@ type ErrorLogger(nameForDebugging:string) = // The 'Impl' factoring enables a developer to place a breakpoint at the non-Impl // code just below and get a breakpoint for all error logger implementations. abstract DiagnosticSink: phasedError: PhasedDiagnostic * isError: bool -> unit - member this.DebugDisplay() = sprintf "ErrorLogger(%s)" nameForDebugging + member __.DebugDisplay() = sprintf "ErrorLogger(%s)" nameForDebugging let DiscardErrorsLogger = { new ErrorLogger("DiscardErrorsLogger") with @@ -337,7 +335,7 @@ module ErrorLoggerExtensions = try let preserveStackTrace = typeof.GetMethod("InternalPreserveStackTrace", BindingFlags.Instance ||| BindingFlags.NonPublic) preserveStackTrace.Invoke(exn, null) |> ignore - with e-> + with _ -> // This is probably only the mono case. System.Diagnostics.Debug.Assert(false, "Could not preserve stack trace for watson exception.") () @@ -411,7 +409,7 @@ module ErrorLoggerExtensions = x.ErrorR (AttachRange m exn) // may raise exceptions, e.g. an fsi error sink raises StopProcessing. ReraiseIfWatsonable(exn) with - | ReportedError _ | WrappedError(ReportedError _, _) -> () + | ReportedError _ | WrappedError(ReportedError _, _) -> () member x.StopProcessingRecovery (exn:exn) (m:range) = // Do standard error recovery. @@ -421,10 +419,11 @@ module ErrorLoggerExtensions = match exn with | StopProcessing | WrappedError(StopProcessing, _) -> () // suppress, so skip error recovery. | _ -> - try x.ErrorRecovery exn m + try + x.ErrorRecovery exn m with - | StopProcessing | WrappedError(StopProcessing, _) -> () // catch, e.g. raised by DiagnosticSink. - | ReportedError _ | WrappedError(ReportedError _, _) -> () // catch, but not expected unless ErrorRecovery is changed. + | StopProcessing | WrappedError(StopProcessing, _) -> () // catch, e.g. raised by DiagnosticSink. + | ReportedError _ | WrappedError(ReportedError _, _) -> () // catch, but not expected unless ErrorRecovery is changed. member x.ErrorRecoveryNoRange (exn:exn) = x.ErrorRecovery exn range0 @@ -445,13 +444,13 @@ let PushErrorLoggerPhaseUntilUnwind(errorLoggerTransformer : ErrorLogger -> #Err let newInstalled = ref true let newIsInstalled() = if !newInstalled then () else (assert false; (); (*failwith "error logger used after unwind"*)) // REVIEW: ok to throw? let chkErrorLogger = { new ErrorLogger("PushErrorLoggerPhaseUntilUnwind") with - member x.DiagnosticSink(phasedError, isError) = newIsInstalled(); newErrorLogger.DiagnosticSink(phasedError, isError) - member x.ErrorCount = newIsInstalled(); newErrorLogger.ErrorCount } + member __.DiagnosticSink(phasedError, isError) = newIsInstalled(); newErrorLogger.DiagnosticSink(phasedError, isError) + member __.ErrorCount = newIsInstalled(); newErrorLogger.ErrorCount } CompileThreadStatic.ErrorLogger <- chkErrorLogger { new System.IDisposable with - member x.Dispose() = + member __.Dispose() = CompileThreadStatic.ErrorLogger <- oldErrorLogger newInstalled := false } @@ -461,13 +460,13 @@ let SetThreadErrorLoggerNoUnwind(errorLogger) = CompileThreadStatic.ErrorLog // Global functions are still used by parser and TAST ops. /// Raises an exception with error recovery and returns unit. -let errorR exn = CompileThreadStatic.ErrorLogger.ErrorR exn +let errorR exn = CompileThreadStatic.ErrorLogger.ErrorR exn /// Raises a warning with error recovery and returns unit. let warning exn = CompileThreadStatic.ErrorLogger.Warning exn /// Raises a special exception and returns 'T - can be caught later at an errorRecovery point. -let error exn = CompileThreadStatic.ErrorLogger.Error exn +let error exn = CompileThreadStatic.ErrorLogger.Error exn /// Simulates an error. For test purposes only. let simulateError (p : PhasedDiagnostic) = CompileThreadStatic.ErrorLogger.SimulateError p @@ -497,8 +496,8 @@ let suppressErrorReporting f = try let errorLogger = { new ErrorLogger("suppressErrorReporting") with - member x.DiagnosticSink(_phasedError, _isError) = () - member x.ErrorCount = 0 } + member __.DiagnosticSink(_phasedError, _isError) = () + member __.ErrorCount = 0 } SetThreadErrorLoggerNoUnwind(errorLogger) f() finally From 2e4392457d092254f23a1fdbf616573fb7314821 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Tue, 6 Mar 2018 16:10:37 -0800 Subject: [PATCH 066/147] ensure build outputs always go to `$(Configuration)\$(TargetDotnetProfile)\bin` --- FSharp.Directory.Build.targets | 31 +++++++++++++++++-- setup/fsharp-setup-build.proj | 2 +- vsintegration/Directory.Build.targets | 5 --- .../Templates.Directory.Build.targets | 8 ----- .../MockTypeProviders/Directory.Build.props | 3 ++ .../MockTypeProviders/Directory.Build.targets | 3 ++ 6 files changed, 35 insertions(+), 17 deletions(-) create mode 100644 vsintegration/tests/unittests/MockTypeProviders/Directory.Build.props create mode 100644 vsintegration/tests/unittests/MockTypeProviders/Directory.Build.targets diff --git a/FSharp.Directory.Build.targets b/FSharp.Directory.Build.targets index a79e8902bf..455bba2655 100644 --- a/FSharp.Directory.Build.targets +++ b/FSharp.Directory.Build.targets @@ -1,13 +1,38 @@ + en;$(XlfLanguages) coreclr net40 - $(RepoRoot)$(Configuration)\$(TargetDotnetProfile)\bin - $(RepoRoot)$(Configuration)\$(TargetDotnetProfile)\obj\$(MSBuildProjectName)\ - en;$(XlfLanguages) + $(MSBuildProjectDirectory)\$(OutputPath) + $(OutputPath) + $(RepoRoot)$(Configuration)\$(TargetDotnetProfile)\bin + $(RepoRoot)$(Configuration)\$(TargetDotnetProfile)\obj + + + + + + + + + + + + + + diff --git a/setup/fsharp-setup-build.proj b/setup/fsharp-setup-build.proj index dc917a6424..59e4780aa2 100644 --- a/setup/fsharp-setup-build.proj +++ b/setup/fsharp-setup-build.proj @@ -42,7 +42,7 @@ + Properties="Configuration=$(Configuration);IsLangPack=%(VsixProjects.IsLangPack);FSharpPackageVersion=$(FSharpPackageVersion);OutputPath=$(VsixBuildLocation);DisableOutputPathCopying=true;$(CustomProps)" /> diff --git a/vsintegration/Directory.Build.targets b/vsintegration/Directory.Build.targets index dc6955ffc2..528e41da3a 100644 --- a/vsintegration/Directory.Build.targets +++ b/vsintegration/Directory.Build.targets @@ -11,11 +11,6 @@ net462 - - - $(OutputPath)\ - - diff --git a/vsintegration/Templates.Directory.Build.targets b/vsintegration/Templates.Directory.Build.targets index 190f81e7c1..84513c489f 100644 --- a/vsintegration/Templates.Directory.Build.targets +++ b/vsintegration/Templates.Directory.Build.targets @@ -2,10 +2,6 @@ - - $(FSharpSourcesRoot)\..\$(Configuration)\$(TargetDotnetProfile)\bin\$(TemplateCategory)\$(AssemblyName) - - @@ -15,8 +11,4 @@ - - - - diff --git a/vsintegration/tests/unittests/MockTypeProviders/Directory.Build.props b/vsintegration/tests/unittests/MockTypeProviders/Directory.Build.props new file mode 100644 index 0000000000..bb5b23d29d --- /dev/null +++ b/vsintegration/tests/unittests/MockTypeProviders/Directory.Build.props @@ -0,0 +1,3 @@ + + + diff --git a/vsintegration/tests/unittests/MockTypeProviders/Directory.Build.targets b/vsintegration/tests/unittests/MockTypeProviders/Directory.Build.targets new file mode 100644 index 0000000000..bb5b23d29d --- /dev/null +++ b/vsintegration/tests/unittests/MockTypeProviders/Directory.Build.targets @@ -0,0 +1,3 @@ + + + From be1877cf1bdddddc4f903f00590bcf6c0736e34c Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Wed, 7 Mar 2018 13:37:19 -0800 Subject: [PATCH 067/147] use VS version as base for insertion packages --- setup/FSharp.Setup.props | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup/FSharp.Setup.props b/setup/FSharp.Setup.props index 713620cd55..f17a8c2d47 100644 --- a/setup/FSharp.Setup.props +++ b/setup/FSharp.Setup.props @@ -11,7 +11,8 @@ - 10.1 + + 15.7 $([System.DateTime]::Now.ToString(yyyyMMdd.0)) From f1a908812b1dd05700058a452a231f4191b22dcd Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Wed, 7 Mar 2018 14:21:45 -0800 Subject: [PATCH 068/147] remove the `Proto` configuration from VisualFSharp.sln --- VisualFSharp.sln | 226 +----------------- .../FSharp.PropertiesPages.vbproj | 3 + 2 files changed, 11 insertions(+), 218 deletions(-) diff --git a/VisualFSharp.sln b/VisualFSharp.sln index fbdf9695b3..2f4557c883 100644 --- a/VisualFSharp.sln +++ b/VisualFSharp.sln @@ -144,8 +144,6 @@ Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Debug|x86 = Debug|x86 - Proto|Any CPU = Proto|Any CPU - Proto|x86 = Proto|x86 Release|Any CPU = Release|Any CPU Release|x86 = Release|x86 EndGlobalSection @@ -154,10 +152,6 @@ Global {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|Any CPU.Build.0 = Debug|Any CPU {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|x86.ActiveCfg = Debug|Any CPU {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Debug|x86.Build.0 = Debug|Any CPU - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Proto|Any CPU.Build.0 = Proto|Any CPU - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Proto|x86.ActiveCfg = Proto|Any CPU - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Proto|x86.Build.0 = Proto|Any CPU {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|Any CPU.ActiveCfg = Release|Any CPU {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|Any CPU.Build.0 = Release|Any CPU {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3}.Release|x86.ActiveCfg = Release|Any CPU @@ -166,10 +160,6 @@ Global {991DCF75-C2EB-42B6-9A0D-AA1D2409D519}.Debug|Any CPU.Build.0 = Debug|Any CPU {991DCF75-C2EB-42B6-9A0D-AA1D2409D519}.Debug|x86.ActiveCfg = Debug|Any CPU {991DCF75-C2EB-42B6-9A0D-AA1D2409D519}.Debug|x86.Build.0 = Debug|Any CPU - {991DCF75-C2EB-42B6-9A0D-AA1D2409D519}.Proto|Any CPU.ActiveCfg = Release|Any CPU - {991DCF75-C2EB-42B6-9A0D-AA1D2409D519}.Proto|Any CPU.Build.0 = Release|Any CPU - {991DCF75-C2EB-42B6-9A0D-AA1D2409D519}.Proto|x86.ActiveCfg = Release|Any CPU - {991DCF75-C2EB-42B6-9A0D-AA1D2409D519}.Proto|x86.Build.0 = Release|Any CPU {991DCF75-C2EB-42B6-9A0D-AA1D2409D519}.Release|Any CPU.ActiveCfg = Release|Any CPU {991DCF75-C2EB-42B6-9A0D-AA1D2409D519}.Release|Any CPU.Build.0 = Release|Any CPU {991DCF75-C2EB-42B6-9A0D-AA1D2409D519}.Release|x86.ActiveCfg = Release|Any CPU @@ -178,10 +168,6 @@ Global {D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Debug|Any CPU.Build.0 = Debug|Any CPU {D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Debug|x86.ActiveCfg = Debug|Any CPU {D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Debug|x86.Build.0 = Debug|Any CPU - {D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Proto|Any CPU.Build.0 = Proto|Any CPU - {D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Proto|x86.ActiveCfg = Proto|Any CPU - {D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Proto|x86.Build.0 = Proto|Any CPU {D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Release|Any CPU.ActiveCfg = Release|Any CPU {D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Release|Any CPU.Build.0 = Release|Any CPU {D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06}.Release|x86.ActiveCfg = Release|Any CPU @@ -190,10 +176,6 @@ Global {DED3BBD7-53F4-428A-8C9F-27968E768605}.Debug|Any CPU.Build.0 = Debug|Any CPU {DED3BBD7-53F4-428A-8C9F-27968E768605}.Debug|x86.ActiveCfg = Debug|Any CPU {DED3BBD7-53F4-428A-8C9F-27968E768605}.Debug|x86.Build.0 = Debug|Any CPU - {DED3BBD7-53F4-428A-8C9F-27968E768605}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {DED3BBD7-53F4-428A-8C9F-27968E768605}.Proto|Any CPU.Build.0 = Proto|Any CPU - {DED3BBD7-53F4-428A-8C9F-27968E768605}.Proto|x86.ActiveCfg = Proto|Any CPU - {DED3BBD7-53F4-428A-8C9F-27968E768605}.Proto|x86.Build.0 = Proto|Any CPU {DED3BBD7-53F4-428A-8C9F-27968E768605}.Release|Any CPU.ActiveCfg = Release|Any CPU {DED3BBD7-53F4-428A-8C9F-27968E768605}.Release|Any CPU.Build.0 = Release|Any CPU {DED3BBD7-53F4-428A-8C9F-27968E768605}.Release|x86.ActiveCfg = Release|Any CPU @@ -202,10 +184,6 @@ Global {EE85AAB7-CDA0-4C4E-BDA0-A64CCC413E3F}.Debug|Any CPU.Build.0 = Debug|Any CPU {EE85AAB7-CDA0-4C4E-BDA0-A64CCC413E3F}.Debug|x86.ActiveCfg = Debug|Any CPU {EE85AAB7-CDA0-4C4E-BDA0-A64CCC413E3F}.Debug|x86.Build.0 = Debug|Any CPU - {EE85AAB7-CDA0-4C4E-BDA0-A64CCC413E3F}.Proto|Any CPU.ActiveCfg = Release|Any CPU - {EE85AAB7-CDA0-4C4E-BDA0-A64CCC413E3F}.Proto|Any CPU.Build.0 = Release|Any CPU - {EE85AAB7-CDA0-4C4E-BDA0-A64CCC413E3F}.Proto|x86.ActiveCfg = Release|Any CPU - {EE85AAB7-CDA0-4C4E-BDA0-A64CCC413E3F}.Proto|x86.Build.0 = Release|Any CPU {EE85AAB7-CDA0-4C4E-BDA0-A64CCC413E3F}.Release|Any CPU.ActiveCfg = Release|Any CPU {EE85AAB7-CDA0-4C4E-BDA0-A64CCC413E3F}.Release|Any CPU.Build.0 = Release|Any CPU {EE85AAB7-CDA0-4C4E-BDA0-A64CCC413E3F}.Release|x86.ActiveCfg = Release|Any CPU @@ -214,10 +192,6 @@ Global {1C5C163C-37EA-4A3C-8CCC-0D34B74BF8EF}.Debug|Any CPU.Build.0 = Debug|Any CPU {1C5C163C-37EA-4A3C-8CCC-0D34B74BF8EF}.Debug|x86.ActiveCfg = Debug|Any CPU {1C5C163C-37EA-4A3C-8CCC-0D34B74BF8EF}.Debug|x86.Build.0 = Debug|Any CPU - {1C5C163C-37EA-4A3C-8CCC-0D34B74BF8EF}.Proto|Any CPU.ActiveCfg = Release|Any CPU - {1C5C163C-37EA-4A3C-8CCC-0D34B74BF8EF}.Proto|Any CPU.Build.0 = Release|Any CPU - {1C5C163C-37EA-4A3C-8CCC-0D34B74BF8EF}.Proto|x86.ActiveCfg = Release|Any CPU - {1C5C163C-37EA-4A3C-8CCC-0D34B74BF8EF}.Proto|x86.Build.0 = Release|Any CPU {1C5C163C-37EA-4A3C-8CCC-0D34B74BF8EF}.Release|Any CPU.ActiveCfg = Release|Any CPU {1C5C163C-37EA-4A3C-8CCC-0D34B74BF8EF}.Release|Any CPU.Build.0 = Release|Any CPU {1C5C163C-37EA-4A3C-8CCC-0D34B74BF8EF}.Release|x86.ActiveCfg = Release|Any CPU @@ -226,10 +200,6 @@ Global {65E0E82A-EACE-4787-8994-888674C2FE87}.Debug|Any CPU.Build.0 = Debug|Any CPU {65E0E82A-EACE-4787-8994-888674C2FE87}.Debug|x86.ActiveCfg = Debug|Any CPU {65E0E82A-EACE-4787-8994-888674C2FE87}.Debug|x86.Build.0 = Debug|Any CPU - {65E0E82A-EACE-4787-8994-888674C2FE87}.Proto|Any CPU.ActiveCfg = Release|Any CPU - {65E0E82A-EACE-4787-8994-888674C2FE87}.Proto|Any CPU.Build.0 = Release|Any CPU - {65E0E82A-EACE-4787-8994-888674C2FE87}.Proto|x86.ActiveCfg = Release|Any CPU - {65E0E82A-EACE-4787-8994-888674C2FE87}.Proto|x86.Build.0 = Release|Any CPU {65E0E82A-EACE-4787-8994-888674C2FE87}.Release|Any CPU.ActiveCfg = Release|Any CPU {65E0E82A-EACE-4787-8994-888674C2FE87}.Release|Any CPU.Build.0 = Release|Any CPU {65E0E82A-EACE-4787-8994-888674C2FE87}.Release|x86.ActiveCfg = Release|Any CPU @@ -238,34 +208,22 @@ Global {B700E38B-F8C0-4E49-B5EC-DB7B7AC0C4E7}.Debug|Any CPU.Build.0 = Debug|Any CPU {B700E38B-F8C0-4E49-B5EC-DB7B7AC0C4E7}.Debug|x86.ActiveCfg = Debug|Any CPU {B700E38B-F8C0-4E49-B5EC-DB7B7AC0C4E7}.Debug|x86.Build.0 = Debug|Any CPU - {B700E38B-F8C0-4E49-B5EC-DB7B7AC0C4E7}.Proto|Any CPU.ActiveCfg = Release|Any CPU - {B700E38B-F8C0-4E49-B5EC-DB7B7AC0C4E7}.Proto|Any CPU.Build.0 = Release|Any CPU - {B700E38B-F8C0-4E49-B5EC-DB7B7AC0C4E7}.Proto|x86.ActiveCfg = Release|Any CPU - {B700E38B-F8C0-4E49-B5EC-DB7B7AC0C4E7}.Proto|x86.Build.0 = Release|Any CPU {B700E38B-F8C0-4E49-B5EC-DB7B7AC0C4E7}.Release|Any CPU.ActiveCfg = Release|Any CPU {B700E38B-F8C0-4E49-B5EC-DB7B7AC0C4E7}.Release|Any CPU.Build.0 = Release|Any CPU {B700E38B-F8C0-4E49-B5EC-DB7B7AC0C4E7}.Release|x86.ActiveCfg = Release|Any CPU {B700E38B-F8C0-4E49-B5EC-DB7B7AC0C4E7}.Release|x86.Build.0 = Release|Any CPU - {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Debug|Any CPU.ActiveCfg = Proto|Any CPU - {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Debug|Any CPU.Build.0 = Proto|Any CPU - {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Debug|x86.ActiveCfg = Proto|Any CPU - {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Debug|x86.Build.0 = Proto|Any CPU - {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Proto|Any CPU.Build.0 = Proto|Any CPU - {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Proto|x86.ActiveCfg = Proto|Any CPU - {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Proto|x86.Build.0 = Proto|Any CPU - {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Release|Any CPU.ActiveCfg = Proto|Any CPU - {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Release|Any CPU.Build.0 = Proto|Any CPU - {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Release|x86.ActiveCfg = Proto|Any CPU - {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Release|x86.Build.0 = Proto|Any CPU + {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Debug|x86.ActiveCfg = Debug|Any CPU + {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Debug|x86.Build.0 = Debug|Any CPU + {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Release|Any CPU.Build.0 = Release|Any CPU + {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Release|x86.ActiveCfg = Release|Any CPU + {FCFB214C-462E-42B3-91CA-FC557EFEE74F}.Release|x86.Build.0 = Release|Any CPU {6196B0F8-CAEA-4CF1-AF82-1B520F77FE44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6196B0F8-CAEA-4CF1-AF82-1B520F77FE44}.Debug|Any CPU.Build.0 = Debug|Any CPU {6196B0F8-CAEA-4CF1-AF82-1B520F77FE44}.Debug|x86.ActiveCfg = Debug|Any CPU {6196B0F8-CAEA-4CF1-AF82-1B520F77FE44}.Debug|x86.Build.0 = Debug|Any CPU - {6196B0F8-CAEA-4CF1-AF82-1B520F77FE44}.Proto|Any CPU.ActiveCfg = Release|Any CPU - {6196B0F8-CAEA-4CF1-AF82-1B520F77FE44}.Proto|Any CPU.Build.0 = Release|Any CPU - {6196B0F8-CAEA-4CF1-AF82-1B520F77FE44}.Proto|x86.ActiveCfg = Release|Any CPU - {6196B0F8-CAEA-4CF1-AF82-1B520F77FE44}.Proto|x86.Build.0 = Release|Any CPU {6196B0F8-CAEA-4CF1-AF82-1B520F77FE44}.Release|Any CPU.ActiveCfg = Release|Any CPU {6196B0F8-CAEA-4CF1-AF82-1B520F77FE44}.Release|Any CPU.Build.0 = Release|Any CPU {6196B0F8-CAEA-4CF1-AF82-1B520F77FE44}.Release|x86.ActiveCfg = Release|Any CPU @@ -274,10 +232,6 @@ Global {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Debug|Any CPU.Build.0 = Debug|Any CPU {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Debug|x86.ActiveCfg = Debug|Any CPU {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Debug|x86.Build.0 = Debug|Any CPU - {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Proto|Any CPU.ActiveCfg = Release|Any CPU - {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Proto|Any CPU.Build.0 = Release|Any CPU - {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Proto|x86.ActiveCfg = Release|Any CPU - {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Proto|x86.Build.0 = Release|Any CPU {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Release|Any CPU.ActiveCfg = Release|Any CPU {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Release|Any CPU.Build.0 = Release|Any CPU {FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}.Release|x86.ActiveCfg = Release|Any CPU @@ -286,10 +240,6 @@ Global {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Debug|Any CPU.Build.0 = Debug|Any CPU {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Debug|x86.ActiveCfg = Debug|Any CPU {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Debug|x86.Build.0 = Debug|Any CPU - {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Proto|Any CPU.ActiveCfg = Release|Any CPU - {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Proto|Any CPU.Build.0 = Release|Any CPU - {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Proto|x86.ActiveCfg = Release|Any CPU - {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Proto|x86.Build.0 = Release|Any CPU {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Release|Any CPU.ActiveCfg = Release|Any CPU {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Release|Any CPU.Build.0 = Release|Any CPU {EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}.Release|x86.ActiveCfg = Release|Any CPU @@ -298,10 +248,6 @@ Global {DA39AD38-4A58-47BF-9215-E49768295169}.Debug|Any CPU.Build.0 = Debug|Any CPU {DA39AD38-4A58-47BF-9215-E49768295169}.Debug|x86.ActiveCfg = Debug|Any CPU {DA39AD38-4A58-47BF-9215-E49768295169}.Debug|x86.Build.0 = Debug|Any CPU - {DA39AD38-4A58-47BF-9215-E49768295169}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {DA39AD38-4A58-47BF-9215-E49768295169}.Proto|Any CPU.Build.0 = Proto|Any CPU - {DA39AD38-4A58-47BF-9215-E49768295169}.Proto|x86.ActiveCfg = Proto|Any CPU - {DA39AD38-4A58-47BF-9215-E49768295169}.Proto|x86.Build.0 = Proto|Any CPU {DA39AD38-4A58-47BF-9215-E49768295169}.Release|Any CPU.ActiveCfg = Release|Any CPU {DA39AD38-4A58-47BF-9215-E49768295169}.Release|Any CPU.Build.0 = Release|Any CPU {DA39AD38-4A58-47BF-9215-E49768295169}.Release|x86.ActiveCfg = Release|Any CPU @@ -310,10 +256,6 @@ Global {8C2439BD-0E49-4929-A8B1-29CEE228191E}.Debug|Any CPU.Build.0 = Debug|Any CPU {8C2439BD-0E49-4929-A8B1-29CEE228191E}.Debug|x86.ActiveCfg = Debug|Any CPU {8C2439BD-0E49-4929-A8B1-29CEE228191E}.Debug|x86.Build.0 = Debug|Any CPU - {8C2439BD-0E49-4929-A8B1-29CEE228191E}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {8C2439BD-0E49-4929-A8B1-29CEE228191E}.Proto|Any CPU.Build.0 = Proto|Any CPU - {8C2439BD-0E49-4929-A8B1-29CEE228191E}.Proto|x86.ActiveCfg = Proto|Any CPU - {8C2439BD-0E49-4929-A8B1-29CEE228191E}.Proto|x86.Build.0 = Proto|Any CPU {8C2439BD-0E49-4929-A8B1-29CEE228191E}.Release|Any CPU.ActiveCfg = Release|Any CPU {8C2439BD-0E49-4929-A8B1-29CEE228191E}.Release|Any CPU.Build.0 = Release|Any CPU {8C2439BD-0E49-4929-A8B1-29CEE228191E}.Release|x86.ActiveCfg = Release|Any CPU @@ -322,10 +264,6 @@ Global {F47196DC-186D-4055-BAF2-658282A12F33}.Debug|Any CPU.Build.0 = Debug|Any CPU {F47196DC-186D-4055-BAF2-658282A12F33}.Debug|x86.ActiveCfg = Debug|Any CPU {F47196DC-186D-4055-BAF2-658282A12F33}.Debug|x86.Build.0 = Debug|Any CPU - {F47196DC-186D-4055-BAF2-658282A12F33}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {F47196DC-186D-4055-BAF2-658282A12F33}.Proto|Any CPU.Build.0 = Proto|Any CPU - {F47196DC-186D-4055-BAF2-658282A12F33}.Proto|x86.ActiveCfg = Proto|Any CPU - {F47196DC-186D-4055-BAF2-658282A12F33}.Proto|x86.Build.0 = Proto|Any CPU {F47196DC-186D-4055-BAF2-658282A12F33}.Release|Any CPU.ActiveCfg = Release|Any CPU {F47196DC-186D-4055-BAF2-658282A12F33}.Release|Any CPU.Build.0 = Release|Any CPU {F47196DC-186D-4055-BAF2-658282A12F33}.Release|x86.ActiveCfg = Release|Any CPU @@ -334,10 +272,6 @@ Global {D4C88934-5893-467E-A55C-A11ECD6479FE}.Debug|Any CPU.Build.0 = Debug|Any CPU {D4C88934-5893-467E-A55C-A11ECD6479FE}.Debug|x86.ActiveCfg = Debug|Any CPU {D4C88934-5893-467E-A55C-A11ECD6479FE}.Debug|x86.Build.0 = Debug|Any CPU - {D4C88934-5893-467E-A55C-A11ECD6479FE}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {D4C88934-5893-467E-A55C-A11ECD6479FE}.Proto|Any CPU.Build.0 = Proto|Any CPU - {D4C88934-5893-467E-A55C-A11ECD6479FE}.Proto|x86.ActiveCfg = Proto|Any CPU - {D4C88934-5893-467E-A55C-A11ECD6479FE}.Proto|x86.Build.0 = Proto|Any CPU {D4C88934-5893-467E-A55C-A11ECD6479FE}.Release|Any CPU.ActiveCfg = Release|Any CPU {D4C88934-5893-467E-A55C-A11ECD6479FE}.Release|Any CPU.Build.0 = Release|Any CPU {D4C88934-5893-467E-A55C-A11ECD6479FE}.Release|x86.ActiveCfg = Release|Any CPU @@ -346,10 +280,6 @@ Global {6AFF752D-E991-4A08-9ED2-5BF46B0E0F8B}.Debug|Any CPU.Build.0 = Debug|Any CPU {6AFF752D-E991-4A08-9ED2-5BF46B0E0F8B}.Debug|x86.ActiveCfg = Debug|Any CPU {6AFF752D-E991-4A08-9ED2-5BF46B0E0F8B}.Debug|x86.Build.0 = Debug|Any CPU - {6AFF752D-E991-4A08-9ED2-5BF46B0E0F8B}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {6AFF752D-E991-4A08-9ED2-5BF46B0E0F8B}.Proto|Any CPU.Build.0 = Proto|Any CPU - {6AFF752D-E991-4A08-9ED2-5BF46B0E0F8B}.Proto|x86.ActiveCfg = Proto|Any CPU - {6AFF752D-E991-4A08-9ED2-5BF46B0E0F8B}.Proto|x86.Build.0 = Proto|Any CPU {6AFF752D-E991-4A08-9ED2-5BF46B0E0F8B}.Release|Any CPU.ActiveCfg = Release|Any CPU {6AFF752D-E991-4A08-9ED2-5BF46B0E0F8B}.Release|Any CPU.Build.0 = Release|Any CPU {6AFF752D-E991-4A08-9ED2-5BF46B0E0F8B}.Release|x86.ActiveCfg = Release|Any CPU @@ -358,10 +288,6 @@ Global {0B9CDEAF-EE8F-45E0-A4E0-34A8ED6DD09E}.Debug|Any CPU.Build.0 = Debug|Any CPU {0B9CDEAF-EE8F-45E0-A4E0-34A8ED6DD09E}.Debug|x86.ActiveCfg = Debug|Any CPU {0B9CDEAF-EE8F-45E0-A4E0-34A8ED6DD09E}.Debug|x86.Build.0 = Debug|Any CPU - {0B9CDEAF-EE8F-45E0-A4E0-34A8ED6DD09E}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {0B9CDEAF-EE8F-45E0-A4E0-34A8ED6DD09E}.Proto|Any CPU.Build.0 = Proto|Any CPU - {0B9CDEAF-EE8F-45E0-A4E0-34A8ED6DD09E}.Proto|x86.ActiveCfg = Proto|Any CPU - {0B9CDEAF-EE8F-45E0-A4E0-34A8ED6DD09E}.Proto|x86.Build.0 = Proto|Any CPU {0B9CDEAF-EE8F-45E0-A4E0-34A8ED6DD09E}.Release|Any CPU.ActiveCfg = Release|Any CPU {0B9CDEAF-EE8F-45E0-A4E0-34A8ED6DD09E}.Release|Any CPU.Build.0 = Release|Any CPU {0B9CDEAF-EE8F-45E0-A4E0-34A8ED6DD09E}.Release|x86.ActiveCfg = Release|Any CPU @@ -370,10 +296,6 @@ Global {004982C6-93EA-4E70-B4F0-BE7D7219926A}.Debug|Any CPU.Build.0 = Debug|Any CPU {004982C6-93EA-4E70-B4F0-BE7D7219926A}.Debug|x86.ActiveCfg = Debug|Any CPU {004982C6-93EA-4E70-B4F0-BE7D7219926A}.Debug|x86.Build.0 = Debug|Any CPU - {004982C6-93EA-4E70-B4F0-BE7D7219926A}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {004982C6-93EA-4E70-B4F0-BE7D7219926A}.Proto|Any CPU.Build.0 = Proto|Any CPU - {004982C6-93EA-4E70-B4F0-BE7D7219926A}.Proto|x86.ActiveCfg = Proto|Any CPU - {004982C6-93EA-4E70-B4F0-BE7D7219926A}.Proto|x86.Build.0 = Proto|Any CPU {004982C6-93EA-4E70-B4F0-BE7D7219926A}.Release|Any CPU.ActiveCfg = Release|Any CPU {004982C6-93EA-4E70-B4F0-BE7D7219926A}.Release|Any CPU.Build.0 = Release|Any CPU {004982C6-93EA-4E70-B4F0-BE7D7219926A}.Release|x86.ActiveCfg = Release|Any CPU @@ -382,10 +304,6 @@ Global {243A81AC-A954-4601-833A-60EEEFB00FCD}.Debug|Any CPU.Build.0 = Debug|Any CPU {243A81AC-A954-4601-833A-60EEEFB00FCD}.Debug|x86.ActiveCfg = Debug|Any CPU {243A81AC-A954-4601-833A-60EEEFB00FCD}.Debug|x86.Build.0 = Debug|Any CPU - {243A81AC-A954-4601-833A-60EEEFB00FCD}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {243A81AC-A954-4601-833A-60EEEFB00FCD}.Proto|Any CPU.Build.0 = Proto|Any CPU - {243A81AC-A954-4601-833A-60EEEFB00FCD}.Proto|x86.ActiveCfg = Proto|Any CPU - {243A81AC-A954-4601-833A-60EEEFB00FCD}.Proto|x86.Build.0 = Proto|Any CPU {243A81AC-A954-4601-833A-60EEEFB00FCD}.Release|Any CPU.ActiveCfg = Release|Any CPU {243A81AC-A954-4601-833A-60EEEFB00FCD}.Release|Any CPU.Build.0 = Release|Any CPU {243A81AC-A954-4601-833A-60EEEFB00FCD}.Release|x86.ActiveCfg = Release|Any CPU @@ -394,10 +312,6 @@ Global {B4595EB6-053A-400E-AA1B-7727F1BC900F}.Debug|Any CPU.Build.0 = Debug|Any CPU {B4595EB6-053A-400E-AA1B-7727F1BC900F}.Debug|x86.ActiveCfg = Debug|Any CPU {B4595EB6-053A-400E-AA1B-7727F1BC900F}.Debug|x86.Build.0 = Debug|Any CPU - {B4595EB6-053A-400E-AA1B-7727F1BC900F}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {B4595EB6-053A-400E-AA1B-7727F1BC900F}.Proto|Any CPU.Build.0 = Proto|Any CPU - {B4595EB6-053A-400E-AA1B-7727F1BC900F}.Proto|x86.ActiveCfg = Proto|Any CPU - {B4595EB6-053A-400E-AA1B-7727F1BC900F}.Proto|x86.Build.0 = Proto|Any CPU {B4595EB6-053A-400E-AA1B-7727F1BC900F}.Release|Any CPU.ActiveCfg = Release|Any CPU {B4595EB6-053A-400E-AA1B-7727F1BC900F}.Release|Any CPU.Build.0 = Release|Any CPU {B4595EB6-053A-400E-AA1B-7727F1BC900F}.Release|x86.ActiveCfg = Release|Any CPU @@ -406,10 +320,6 @@ Global {A559D7E8-7EFD-473A-B618-A10B41AB523B}.Debug|Any CPU.Build.0 = Debug|Any CPU {A559D7E8-7EFD-473A-B618-A10B41AB523B}.Debug|x86.ActiveCfg = Debug|Any CPU {A559D7E8-7EFD-473A-B618-A10B41AB523B}.Debug|x86.Build.0 = Debug|Any CPU - {A559D7E8-7EFD-473A-B618-A10B41AB523B}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {A559D7E8-7EFD-473A-B618-A10B41AB523B}.Proto|Any CPU.Build.0 = Proto|Any CPU - {A559D7E8-7EFD-473A-B618-A10B41AB523B}.Proto|x86.ActiveCfg = Proto|Any CPU - {A559D7E8-7EFD-473A-B618-A10B41AB523B}.Proto|x86.Build.0 = Proto|Any CPU {A559D7E8-7EFD-473A-B618-A10B41AB523B}.Release|Any CPU.ActiveCfg = Release|Any CPU {A559D7E8-7EFD-473A-B618-A10B41AB523B}.Release|Any CPU.Build.0 = Release|Any CPU {A559D7E8-7EFD-473A-B618-A10B41AB523B}.Release|x86.ActiveCfg = Release|Any CPU @@ -418,10 +328,6 @@ Global {AC85EE6D-033C-45F9-B8BA-884BC22EC6D9}.Debug|Any CPU.Build.0 = Debug|Any CPU {AC85EE6D-033C-45F9-B8BA-884BC22EC6D9}.Debug|x86.ActiveCfg = Debug|Any CPU {AC85EE6D-033C-45F9-B8BA-884BC22EC6D9}.Debug|x86.Build.0 = Debug|Any CPU - {AC85EE6D-033C-45F9-B8BA-884BC22EC6D9}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {AC85EE6D-033C-45F9-B8BA-884BC22EC6D9}.Proto|Any CPU.Build.0 = Proto|Any CPU - {AC85EE6D-033C-45F9-B8BA-884BC22EC6D9}.Proto|x86.ActiveCfg = Proto|Any CPU - {AC85EE6D-033C-45F9-B8BA-884BC22EC6D9}.Proto|x86.Build.0 = Proto|Any CPU {AC85EE6D-033C-45F9-B8BA-884BC22EC6D9}.Release|Any CPU.ActiveCfg = Release|Any CPU {AC85EE6D-033C-45F9-B8BA-884BC22EC6D9}.Release|Any CPU.Build.0 = Release|Any CPU {AC85EE6D-033C-45F9-B8BA-884BC22EC6D9}.Release|x86.ActiveCfg = Release|Any CPU @@ -430,10 +336,6 @@ Global {956BBE41-ABD1-4DBA-9F3B-BA1C9821C98C}.Debug|Any CPU.Build.0 = Debug|Any CPU {956BBE41-ABD1-4DBA-9F3B-BA1C9821C98C}.Debug|x86.ActiveCfg = Debug|Any CPU {956BBE41-ABD1-4DBA-9F3B-BA1C9821C98C}.Debug|x86.Build.0 = Debug|Any CPU - {956BBE41-ABD1-4DBA-9F3B-BA1C9821C98C}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {956BBE41-ABD1-4DBA-9F3B-BA1C9821C98C}.Proto|Any CPU.Build.0 = Proto|Any CPU - {956BBE41-ABD1-4DBA-9F3B-BA1C9821C98C}.Proto|x86.ActiveCfg = Proto|Any CPU - {956BBE41-ABD1-4DBA-9F3B-BA1C9821C98C}.Proto|x86.Build.0 = Proto|Any CPU {956BBE41-ABD1-4DBA-9F3B-BA1C9821C98C}.Release|Any CPU.ActiveCfg = Release|Any CPU {956BBE41-ABD1-4DBA-9F3B-BA1C9821C98C}.Release|Any CPU.Build.0 = Release|Any CPU {956BBE41-ABD1-4DBA-9F3B-BA1C9821C98C}.Release|x86.ActiveCfg = Release|Any CPU @@ -442,10 +344,6 @@ Global {702A7979-BCF9-4C41-853E-3ADFC9897890}.Debug|Any CPU.Build.0 = Debug|Any CPU {702A7979-BCF9-4C41-853E-3ADFC9897890}.Debug|x86.ActiveCfg = Debug|Any CPU {702A7979-BCF9-4C41-853E-3ADFC9897890}.Debug|x86.Build.0 = Debug|Any CPU - {702A7979-BCF9-4C41-853E-3ADFC9897890}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {702A7979-BCF9-4C41-853E-3ADFC9897890}.Proto|Any CPU.Build.0 = Proto|Any CPU - {702A7979-BCF9-4C41-853E-3ADFC9897890}.Proto|x86.ActiveCfg = Proto|Any CPU - {702A7979-BCF9-4C41-853E-3ADFC9897890}.Proto|x86.Build.0 = Proto|Any CPU {702A7979-BCF9-4C41-853E-3ADFC9897890}.Release|Any CPU.ActiveCfg = Release|Any CPU {702A7979-BCF9-4C41-853E-3ADFC9897890}.Release|Any CPU.Build.0 = Release|Any CPU {702A7979-BCF9-4C41-853E-3ADFC9897890}.Release|x86.ActiveCfg = Release|Any CPU @@ -454,10 +352,6 @@ Global {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Debug|Any CPU.Build.0 = Debug|Any CPU {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Debug|x86.ActiveCfg = Debug|Any CPU {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Debug|x86.Build.0 = Debug|Any CPU - {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Proto|Any CPU.Build.0 = Proto|Any CPU - {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Proto|x86.ActiveCfg = Proto|Any CPU - {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Proto|x86.Build.0 = Proto|Any CPU {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Release|Any CPU.ActiveCfg = Release|Any CPU {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Release|Any CPU.Build.0 = Release|Any CPU {C94C257C-3C0A-4858-B5D8-D746498D1F08}.Release|x86.ActiveCfg = Release|Any CPU @@ -466,10 +360,6 @@ Global {649FA588-F02E-457C-9FCF-87E46407481E}.Debug|Any CPU.Build.0 = Debug|Any CPU {649FA588-F02E-457C-9FCF-87E46407481E}.Debug|x86.ActiveCfg = Debug|Any CPU {649FA588-F02E-457C-9FCF-87E46407481E}.Debug|x86.Build.0 = Debug|Any CPU - {649FA588-F02E-457C-9FCF-87E46407481E}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {649FA588-F02E-457C-9FCF-87E46407481E}.Proto|Any CPU.Build.0 = Proto|Any CPU - {649FA588-F02E-457C-9FCF-87E46407481E}.Proto|x86.ActiveCfg = Proto|Any CPU - {649FA588-F02E-457C-9FCF-87E46407481E}.Proto|x86.Build.0 = Proto|Any CPU {649FA588-F02E-457C-9FCF-87E46407481E}.Release|Any CPU.ActiveCfg = Release|Any CPU {649FA588-F02E-457C-9FCF-87E46407481E}.Release|Any CPU.Build.0 = Release|Any CPU {649FA588-F02E-457C-9FCF-87E46407481E}.Release|x86.ActiveCfg = Release|Any CPU @@ -478,10 +368,6 @@ Global {8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Debug|Any CPU.Build.0 = Debug|Any CPU {8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Debug|x86.ActiveCfg = Debug|Any CPU {8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Debug|x86.Build.0 = Debug|Any CPU - {8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Proto|Any CPU.Build.0 = Proto|Any CPU - {8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Proto|x86.ActiveCfg = Proto|Any CPU - {8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Proto|x86.Build.0 = Proto|Any CPU {8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Release|Any CPU.ActiveCfg = Release|Any CPU {8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Release|Any CPU.Build.0 = Release|Any CPU {8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Release|x86.ActiveCfg = Release|Any CPU @@ -490,10 +376,6 @@ Global {D0E98C0D-490B-4C61-9329-0862F6E87645}.Debug|Any CPU.Build.0 = Debug|Any CPU {D0E98C0D-490B-4C61-9329-0862F6E87645}.Debug|x86.ActiveCfg = Debug|Any CPU {D0E98C0D-490B-4C61-9329-0862F6E87645}.Debug|x86.Build.0 = Debug|Any CPU - {D0E98C0D-490B-4C61-9329-0862F6E87645}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {D0E98C0D-490B-4C61-9329-0862F6E87645}.Proto|Any CPU.Build.0 = Proto|Any CPU - {D0E98C0D-490B-4C61-9329-0862F6E87645}.Proto|x86.ActiveCfg = Proto|Any CPU - {D0E98C0D-490B-4C61-9329-0862F6E87645}.Proto|x86.Build.0 = Proto|Any CPU {D0E98C0D-490B-4C61-9329-0862F6E87645}.Release|Any CPU.ActiveCfg = Release|Any CPU {D0E98C0D-490B-4C61-9329-0862F6E87645}.Release|Any CPU.Build.0 = Release|Any CPU {D0E98C0D-490B-4C61-9329-0862F6E87645}.Release|x86.ActiveCfg = Release|Any CPU @@ -502,10 +384,6 @@ Global {C163E892-5BF7-4B59-AA99-B0E8079C67C4}.Debug|Any CPU.Build.0 = Debug|Any CPU {C163E892-5BF7-4B59-AA99-B0E8079C67C4}.Debug|x86.ActiveCfg = Debug|Any CPU {C163E892-5BF7-4B59-AA99-B0E8079C67C4}.Debug|x86.Build.0 = Debug|Any CPU - {C163E892-5BF7-4B59-AA99-B0E8079C67C4}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {C163E892-5BF7-4B59-AA99-B0E8079C67C4}.Proto|Any CPU.Build.0 = Proto|Any CPU - {C163E892-5BF7-4B59-AA99-B0E8079C67C4}.Proto|x86.ActiveCfg = Proto|Any CPU - {C163E892-5BF7-4B59-AA99-B0E8079C67C4}.Proto|x86.Build.0 = Proto|Any CPU {C163E892-5BF7-4B59-AA99-B0E8079C67C4}.Release|Any CPU.ActiveCfg = Release|Any CPU {C163E892-5BF7-4B59-AA99-B0E8079C67C4}.Release|Any CPU.Build.0 = Release|Any CPU {C163E892-5BF7-4B59-AA99-B0E8079C67C4}.Release|x86.ActiveCfg = Release|Any CPU @@ -514,10 +392,6 @@ Global {A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5}.Debug|Any CPU.Build.0 = Debug|Any CPU {A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5}.Debug|x86.ActiveCfg = Debug|Any CPU {A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5}.Debug|x86.Build.0 = Debug|Any CPU - {A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5}.Proto|Any CPU.Build.0 = Proto|Any CPU - {A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5}.Proto|x86.ActiveCfg = Proto|Any CPU - {A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5}.Proto|x86.Build.0 = Proto|Any CPU {A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5}.Release|Any CPU.ActiveCfg = Release|Any CPU {A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5}.Release|Any CPU.Build.0 = Release|Any CPU {A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5}.Release|x86.ActiveCfg = Release|Any CPU @@ -526,10 +400,6 @@ Global {88E2D422-6852-46E3-A740-83E391DC7973}.Debug|Any CPU.Build.0 = Debug|Any CPU {88E2D422-6852-46E3-A740-83E391DC7973}.Debug|x86.ActiveCfg = Debug|Any CPU {88E2D422-6852-46E3-A740-83E391DC7973}.Debug|x86.Build.0 = Debug|Any CPU - {88E2D422-6852-46E3-A740-83E391DC7973}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {88E2D422-6852-46E3-A740-83E391DC7973}.Proto|Any CPU.Build.0 = Proto|Any CPU - {88E2D422-6852-46E3-A740-83E391DC7973}.Proto|x86.ActiveCfg = Proto|Any CPU - {88E2D422-6852-46E3-A740-83E391DC7973}.Proto|x86.Build.0 = Proto|Any CPU {88E2D422-6852-46E3-A740-83E391DC7973}.Release|Any CPU.ActiveCfg = Release|Any CPU {88E2D422-6852-46E3-A740-83E391DC7973}.Release|Any CPU.Build.0 = Release|Any CPU {88E2D422-6852-46E3-A740-83E391DC7973}.Release|x86.ActiveCfg = Release|Any CPU @@ -538,10 +408,6 @@ Global {604F0DAA-2D33-48DD-B162-EDF0B672803D}.Debug|Any CPU.Build.0 = Debug|Any CPU {604F0DAA-2D33-48DD-B162-EDF0B672803D}.Debug|x86.ActiveCfg = Debug|Any CPU {604F0DAA-2D33-48DD-B162-EDF0B672803D}.Debug|x86.Build.0 = Debug|Any CPU - {604F0DAA-2D33-48DD-B162-EDF0B672803D}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {604F0DAA-2D33-48DD-B162-EDF0B672803D}.Proto|Any CPU.Build.0 = Proto|Any CPU - {604F0DAA-2D33-48DD-B162-EDF0B672803D}.Proto|x86.ActiveCfg = Proto|Any CPU - {604F0DAA-2D33-48DD-B162-EDF0B672803D}.Proto|x86.Build.0 = Proto|Any CPU {604F0DAA-2D33-48DD-B162-EDF0B672803D}.Release|Any CPU.ActiveCfg = Release|Any CPU {604F0DAA-2D33-48DD-B162-EDF0B672803D}.Release|Any CPU.Build.0 = Release|Any CPU {604F0DAA-2D33-48DD-B162-EDF0B672803D}.Release|x86.ActiveCfg = Release|Any CPU @@ -550,10 +416,6 @@ Global {01678CDA-A11F-4DEE-9344-2EDF91CF1AE7}.Debug|Any CPU.Build.0 = Debug|Any CPU {01678CDA-A11F-4DEE-9344-2EDF91CF1AE7}.Debug|x86.ActiveCfg = Debug|Any CPU {01678CDA-A11F-4DEE-9344-2EDF91CF1AE7}.Debug|x86.Build.0 = Debug|Any CPU - {01678CDA-A11F-4DEE-9344-2EDF91CF1AE7}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {01678CDA-A11F-4DEE-9344-2EDF91CF1AE7}.Proto|Any CPU.Build.0 = Proto|Any CPU - {01678CDA-A11F-4DEE-9344-2EDF91CF1AE7}.Proto|x86.ActiveCfg = Proto|Any CPU - {01678CDA-A11F-4DEE-9344-2EDF91CF1AE7}.Proto|x86.Build.0 = Proto|Any CPU {01678CDA-A11F-4DEE-9344-2EDF91CF1AE7}.Release|Any CPU.ActiveCfg = Release|Any CPU {01678CDA-A11F-4DEE-9344-2EDF91CF1AE7}.Release|Any CPU.Build.0 = Release|Any CPU {01678CDA-A11F-4DEE-9344-2EDF91CF1AE7}.Release|x86.ActiveCfg = Release|Any CPU @@ -562,10 +424,6 @@ Global {2FACEE44-48BD-40B5-A2EE-B54A0C9BB7C4}.Debug|Any CPU.Build.0 = Debug|Any CPU {2FACEE44-48BD-40B5-A2EE-B54A0C9BB7C4}.Debug|x86.ActiveCfg = Debug|Any CPU {2FACEE44-48BD-40B5-A2EE-B54A0C9BB7C4}.Debug|x86.Build.0 = Debug|Any CPU - {2FACEE44-48BD-40B5-A2EE-B54A0C9BB7C4}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {2FACEE44-48BD-40B5-A2EE-B54A0C9BB7C4}.Proto|Any CPU.Build.0 = Proto|Any CPU - {2FACEE44-48BD-40B5-A2EE-B54A0C9BB7C4}.Proto|x86.ActiveCfg = Proto|Any CPU - {2FACEE44-48BD-40B5-A2EE-B54A0C9BB7C4}.Proto|x86.Build.0 = Proto|Any CPU {2FACEE44-48BD-40B5-A2EE-B54A0C9BB7C4}.Release|Any CPU.ActiveCfg = Release|Any CPU {2FACEE44-48BD-40B5-A2EE-B54A0C9BB7C4}.Release|Any CPU.Build.0 = Release|Any CPU {2FACEE44-48BD-40B5-A2EE-B54A0C9BB7C4}.Release|x86.ActiveCfg = Release|Any CPU @@ -574,10 +432,6 @@ Global {6BA13AA4-C25F-480F-856B-8E8000299A72}.Debug|Any CPU.Build.0 = Debug|Any CPU {6BA13AA4-C25F-480F-856B-8E8000299A72}.Debug|x86.ActiveCfg = Debug|Any CPU {6BA13AA4-C25F-480F-856B-8E8000299A72}.Debug|x86.Build.0 = Debug|Any CPU - {6BA13AA4-C25F-480F-856B-8E8000299A72}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {6BA13AA4-C25F-480F-856B-8E8000299A72}.Proto|Any CPU.Build.0 = Proto|Any CPU - {6BA13AA4-C25F-480F-856B-8E8000299A72}.Proto|x86.ActiveCfg = Proto|Any CPU - {6BA13AA4-C25F-480F-856B-8E8000299A72}.Proto|x86.Build.0 = Proto|Any CPU {6BA13AA4-C25F-480F-856B-8E8000299A72}.Release|Any CPU.ActiveCfg = Release|Any CPU {6BA13AA4-C25F-480F-856B-8E8000299A72}.Release|Any CPU.Build.0 = Release|Any CPU {6BA13AA4-C25F-480F-856B-8E8000299A72}.Release|x86.ActiveCfg = Release|Any CPU @@ -586,10 +440,6 @@ Global {12AC2813-E895-4AAA-AE6C-94E21DA09F64}.Debug|Any CPU.Build.0 = Debug|Any CPU {12AC2813-E895-4AAA-AE6C-94E21DA09F64}.Debug|x86.ActiveCfg = Debug|Any CPU {12AC2813-E895-4AAA-AE6C-94E21DA09F64}.Debug|x86.Build.0 = Debug|Any CPU - {12AC2813-E895-4AAA-AE6C-94E21DA09F64}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {12AC2813-E895-4AAA-AE6C-94E21DA09F64}.Proto|Any CPU.Build.0 = Proto|Any CPU - {12AC2813-E895-4AAA-AE6C-94E21DA09F64}.Proto|x86.ActiveCfg = Proto|Any CPU - {12AC2813-E895-4AAA-AE6C-94E21DA09F64}.Proto|x86.Build.0 = Proto|Any CPU {12AC2813-E895-4AAA-AE6C-94E21DA09F64}.Release|Any CPU.ActiveCfg = Release|Any CPU {12AC2813-E895-4AAA-AE6C-94E21DA09F64}.Release|Any CPU.Build.0 = Release|Any CPU {12AC2813-E895-4AAA-AE6C-94E21DA09F64}.Release|x86.ActiveCfg = Release|Any CPU @@ -598,10 +448,6 @@ Global {A333B85A-DC23-49B6-9797-B89A7951E92D}.Debug|Any CPU.Build.0 = Debug|Any CPU {A333B85A-DC23-49B6-9797-B89A7951E92D}.Debug|x86.ActiveCfg = Debug|Any CPU {A333B85A-DC23-49B6-9797-B89A7951E92D}.Debug|x86.Build.0 = Debug|Any CPU - {A333B85A-DC23-49B6-9797-B89A7951E92D}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {A333B85A-DC23-49B6-9797-B89A7951E92D}.Proto|Any CPU.Build.0 = Proto|Any CPU - {A333B85A-DC23-49B6-9797-B89A7951E92D}.Proto|x86.ActiveCfg = Proto|Any CPU - {A333B85A-DC23-49B6-9797-B89A7951E92D}.Proto|x86.Build.0 = Proto|Any CPU {A333B85A-DC23-49B6-9797-B89A7951E92D}.Release|Any CPU.ActiveCfg = Release|Any CPU {A333B85A-DC23-49B6-9797-B89A7951E92D}.Release|Any CPU.Build.0 = Release|Any CPU {A333B85A-DC23-49B6-9797-B89A7951E92D}.Release|x86.ActiveCfg = Release|Any CPU @@ -610,10 +456,6 @@ Global {E3FDD4AC-46B6-4B9F-B672-317D1202CC50}.Debug|Any CPU.Build.0 = Debug|Any CPU {E3FDD4AC-46B6-4B9F-B672-317D1202CC50}.Debug|x86.ActiveCfg = Debug|Any CPU {E3FDD4AC-46B6-4B9F-B672-317D1202CC50}.Debug|x86.Build.0 = Debug|Any CPU - {E3FDD4AC-46B6-4B9F-B672-317D1202CC50}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {E3FDD4AC-46B6-4B9F-B672-317D1202CC50}.Proto|Any CPU.Build.0 = Proto|Any CPU - {E3FDD4AC-46B6-4B9F-B672-317D1202CC50}.Proto|x86.ActiveCfg = Proto|Any CPU - {E3FDD4AC-46B6-4B9F-B672-317D1202CC50}.Proto|x86.Build.0 = Proto|Any CPU {E3FDD4AC-46B6-4B9F-B672-317D1202CC50}.Release|Any CPU.ActiveCfg = Release|Any CPU {E3FDD4AC-46B6-4B9F-B672-317D1202CC50}.Release|Any CPU.Build.0 = Release|Any CPU {E3FDD4AC-46B6-4B9F-B672-317D1202CC50}.Release|x86.ActiveCfg = Release|Any CPU @@ -622,10 +464,6 @@ Global {D11FC318-8F5D-4C8C-9287-AB40A016D13C}.Debug|Any CPU.Build.0 = Debug|Any CPU {D11FC318-8F5D-4C8C-9287-AB40A016D13C}.Debug|x86.ActiveCfg = Debug|Any CPU {D11FC318-8F5D-4C8C-9287-AB40A016D13C}.Debug|x86.Build.0 = Debug|Any CPU - {D11FC318-8F5D-4C8C-9287-AB40A016D13C}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {D11FC318-8F5D-4C8C-9287-AB40A016D13C}.Proto|Any CPU.Build.0 = Proto|Any CPU - {D11FC318-8F5D-4C8C-9287-AB40A016D13C}.Proto|x86.ActiveCfg = Proto|Any CPU - {D11FC318-8F5D-4C8C-9287-AB40A016D13C}.Proto|x86.Build.0 = Proto|Any CPU {D11FC318-8F5D-4C8C-9287-AB40A016D13C}.Release|Any CPU.ActiveCfg = Release|Any CPU {D11FC318-8F5D-4C8C-9287-AB40A016D13C}.Release|Any CPU.Build.0 = Release|Any CPU {D11FC318-8F5D-4C8C-9287-AB40A016D13C}.Release|x86.ActiveCfg = Release|Any CPU @@ -634,10 +472,6 @@ Global {1FB1DD07-06AA-45B4-B5AC-20FF5BEE98B6}.Debug|Any CPU.Build.0 = Debug|Any CPU {1FB1DD07-06AA-45B4-B5AC-20FF5BEE98B6}.Debug|x86.ActiveCfg = Debug|Any CPU {1FB1DD07-06AA-45B4-B5AC-20FF5BEE98B6}.Debug|x86.Build.0 = Debug|Any CPU - {1FB1DD07-06AA-45B4-B5AC-20FF5BEE98B6}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {1FB1DD07-06AA-45B4-B5AC-20FF5BEE98B6}.Proto|Any CPU.Build.0 = Proto|Any CPU - {1FB1DD07-06AA-45B4-B5AC-20FF5BEE98B6}.Proto|x86.ActiveCfg = Proto|Any CPU - {1FB1DD07-06AA-45B4-B5AC-20FF5BEE98B6}.Proto|x86.Build.0 = Proto|Any CPU {1FB1DD07-06AA-45B4-B5AC-20FF5BEE98B6}.Release|Any CPU.ActiveCfg = Release|Any CPU {1FB1DD07-06AA-45B4-B5AC-20FF5BEE98B6}.Release|Any CPU.Build.0 = Release|Any CPU {1FB1DD07-06AA-45B4-B5AC-20FF5BEE98B6}.Release|x86.ActiveCfg = Release|Any CPU @@ -646,10 +480,6 @@ Global {59ADCE46-9740-4079-834D-9A03A3494EBC}.Debug|Any CPU.Build.0 = Debug|Any CPU {59ADCE46-9740-4079-834D-9A03A3494EBC}.Debug|x86.ActiveCfg = Debug|Any CPU {59ADCE46-9740-4079-834D-9A03A3494EBC}.Debug|x86.Build.0 = Debug|Any CPU - {59ADCE46-9740-4079-834D-9A03A3494EBC}.Proto|Any CPU.ActiveCfg = Release|Any CPU - {59ADCE46-9740-4079-834D-9A03A3494EBC}.Proto|Any CPU.Build.0 = Release|Any CPU - {59ADCE46-9740-4079-834D-9A03A3494EBC}.Proto|x86.ActiveCfg = Release|Any CPU - {59ADCE46-9740-4079-834D-9A03A3494EBC}.Proto|x86.Build.0 = Release|Any CPU {59ADCE46-9740-4079-834D-9A03A3494EBC}.Release|Any CPU.ActiveCfg = Release|Any CPU {59ADCE46-9740-4079-834D-9A03A3494EBC}.Release|Any CPU.Build.0 = Release|Any CPU {59ADCE46-9740-4079-834D-9A03A3494EBC}.Release|x86.ActiveCfg = Release|Any CPU @@ -658,10 +488,6 @@ Global {E6A45CDF-B408-420F-B475-74611BEFC52B}.Debug|Any CPU.Build.0 = Debug|Any CPU {E6A45CDF-B408-420F-B475-74611BEFC52B}.Debug|x86.ActiveCfg = Debug|Any CPU {E6A45CDF-B408-420F-B475-74611BEFC52B}.Debug|x86.Build.0 = Debug|Any CPU - {E6A45CDF-B408-420F-B475-74611BEFC52B}.Proto|Any CPU.ActiveCfg = Release|Any CPU - {E6A45CDF-B408-420F-B475-74611BEFC52B}.Proto|Any CPU.Build.0 = Release|Any CPU - {E6A45CDF-B408-420F-B475-74611BEFC52B}.Proto|x86.ActiveCfg = Release|Any CPU - {E6A45CDF-B408-420F-B475-74611BEFC52B}.Proto|x86.Build.0 = Release|Any CPU {E6A45CDF-B408-420F-B475-74611BEFC52B}.Release|Any CPU.ActiveCfg = Release|Any CPU {E6A45CDF-B408-420F-B475-74611BEFC52B}.Release|Any CPU.Build.0 = Release|Any CPU {E6A45CDF-B408-420F-B475-74611BEFC52B}.Release|x86.ActiveCfg = Release|Any CPU @@ -670,10 +496,6 @@ Global {4239EFEA-E746-446A-BF7A-51FCBAB13946}.Debug|Any CPU.Build.0 = Debug|Any CPU {4239EFEA-E746-446A-BF7A-51FCBAB13946}.Debug|x86.ActiveCfg = Debug|Any CPU {4239EFEA-E746-446A-BF7A-51FCBAB13946}.Debug|x86.Build.0 = Debug|Any CPU - {4239EFEA-E746-446A-BF7A-51FCBAB13946}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {4239EFEA-E746-446A-BF7A-51FCBAB13946}.Proto|Any CPU.Build.0 = Proto|Any CPU - {4239EFEA-E746-446A-BF7A-51FCBAB13946}.Proto|x86.ActiveCfg = Proto|Any CPU - {4239EFEA-E746-446A-BF7A-51FCBAB13946}.Proto|x86.Build.0 = Proto|Any CPU {4239EFEA-E746-446A-BF7A-51FCBAB13946}.Release|Any CPU.ActiveCfg = Release|Any CPU {4239EFEA-E746-446A-BF7A-51FCBAB13946}.Release|Any CPU.Build.0 = Release|Any CPU {4239EFEA-E746-446A-BF7A-51FCBAB13946}.Release|x86.ActiveCfg = Release|Any CPU @@ -682,10 +504,6 @@ Global {2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Debug|Any CPU.Build.0 = Debug|Any CPU {2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Debug|x86.ActiveCfg = Debug|Any CPU {2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Debug|x86.Build.0 = Debug|Any CPU - {2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Proto|Any CPU.Build.0 = Proto|Any CPU - {2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Proto|x86.ActiveCfg = Proto|Any CPU - {2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Proto|x86.Build.0 = Proto|Any CPU {2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Release|Any CPU.ActiveCfg = Release|Any CPU {2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Release|Any CPU.Build.0 = Release|Any CPU {2E60864A-E3FF-4BCC-810F-DC7C34E6B236}.Release|x86.ActiveCfg = Release|Any CPU @@ -694,10 +512,6 @@ Global {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Debug|Any CPU.Build.0 = Debug|Any CPU {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Debug|x86.ActiveCfg = Debug|Any CPU {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Debug|x86.Build.0 = Debug|Any CPU - {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Proto|Any CPU.ActiveCfg = Release|Any CPU - {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Proto|Any CPU.Build.0 = Release|Any CPU - {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Proto|x86.ActiveCfg = Release|Any CPU - {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Proto|x86.Build.0 = Release|Any CPU {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Release|Any CPU.ActiveCfg = Release|Any CPU {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Release|Any CPU.Build.0 = Release|Any CPU {E7FA3A71-51AF-4FCA-9C2F-7C853E515903}.Release|x86.ActiveCfg = Release|Any CPU @@ -706,10 +520,6 @@ Global {C4586A06-1402-48BC-8E35-A1B8642F895B}.Debug|Any CPU.Build.0 = Debug|Any CPU {C4586A06-1402-48BC-8E35-A1B8642F895B}.Debug|x86.ActiveCfg = Debug|Any CPU {C4586A06-1402-48BC-8E35-A1B8642F895B}.Debug|x86.Build.0 = Debug|Any CPU - {C4586A06-1402-48BC-8E35-A1B8642F895B}.Proto|Any CPU.ActiveCfg = Release|Any CPU - {C4586A06-1402-48BC-8E35-A1B8642F895B}.Proto|Any CPU.Build.0 = Release|Any CPU - {C4586A06-1402-48BC-8E35-A1B8642F895B}.Proto|x86.ActiveCfg = Release|Any CPU - {C4586A06-1402-48BC-8E35-A1B8642F895B}.Proto|x86.Build.0 = Release|Any CPU {C4586A06-1402-48BC-8E35-A1B8642F895B}.Release|Any CPU.ActiveCfg = Release|Any CPU {C4586A06-1402-48BC-8E35-A1B8642F895B}.Release|Any CPU.Build.0 = Release|Any CPU {C4586A06-1402-48BC-8E35-A1B8642F895B}.Release|x86.ActiveCfg = Release|Any CPU @@ -718,10 +528,6 @@ Global {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Debug|Any CPU.Build.0 = Debug|Any CPU {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Debug|x86.ActiveCfg = Debug|Any CPU {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Debug|x86.Build.0 = Debug|Any CPU - {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Proto|Any CPU.ActiveCfg = Release|Any CPU - {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Proto|Any CPU.Build.0 = Release|Any CPU - {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Proto|x86.ActiveCfg = Release|Any CPU - {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Proto|x86.Build.0 = Release|Any CPU {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Release|Any CPU.ActiveCfg = Release|Any CPU {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Release|Any CPU.Build.0 = Release|Any CPU {887630A3-4B1D-40EA-B8B3-2D842E9C40DB}.Release|x86.ActiveCfg = Release|Any CPU @@ -730,10 +536,6 @@ Global {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Debug|Any CPU.Build.0 = Debug|Any CPU {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Debug|x86.ActiveCfg = Debug|Any CPU {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Debug|x86.Build.0 = Debug|Any CPU - {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Proto|Any CPU.Build.0 = Proto|Any CPU - {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Proto|x86.ActiveCfg = Proto|Any CPU - {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Proto|x86.Build.0 = Proto|Any CPU {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Release|Any CPU.ActiveCfg = Release|Any CPU {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Release|Any CPU.Build.0 = Release|Any CPU {FF76BD3C-5E0A-4752-B6C3-044F6E15719B}.Release|x86.ActiveCfg = Release|Any CPU @@ -742,10 +544,6 @@ Global {0385564F-07B4-4264-AB8A-17C393E9140C}.Debug|Any CPU.Build.0 = Debug|Any CPU {0385564F-07B4-4264-AB8A-17C393E9140C}.Debug|x86.ActiveCfg = Debug|Any CPU {0385564F-07B4-4264-AB8A-17C393E9140C}.Debug|x86.Build.0 = Debug|Any CPU - {0385564F-07B4-4264-AB8A-17C393E9140C}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {0385564F-07B4-4264-AB8A-17C393E9140C}.Proto|Any CPU.Build.0 = Proto|Any CPU - {0385564F-07B4-4264-AB8A-17C393E9140C}.Proto|x86.ActiveCfg = Proto|Any CPU - {0385564F-07B4-4264-AB8A-17C393E9140C}.Proto|x86.Build.0 = Proto|Any CPU {0385564F-07B4-4264-AB8A-17C393E9140C}.Release|Any CPU.ActiveCfg = Release|Any CPU {0385564F-07B4-4264-AB8A-17C393E9140C}.Release|Any CPU.Build.0 = Release|Any CPU {0385564F-07B4-4264-AB8A-17C393E9140C}.Release|x86.ActiveCfg = Release|Any CPU @@ -754,10 +552,6 @@ Global {400FAB03-786E-40CC-85A8-04B0C2869B14}.Debug|Any CPU.Build.0 = Debug|Any CPU {400FAB03-786E-40CC-85A8-04B0C2869B14}.Debug|x86.ActiveCfg = Debug|Any CPU {400FAB03-786E-40CC-85A8-04B0C2869B14}.Debug|x86.Build.0 = Debug|Any CPU - {400FAB03-786E-40CC-85A8-04B0C2869B14}.Proto|Any CPU.ActiveCfg = Proto|Any CPU - {400FAB03-786E-40CC-85A8-04B0C2869B14}.Proto|Any CPU.Build.0 = Proto|Any CPU - {400FAB03-786E-40CC-85A8-04B0C2869B14}.Proto|x86.ActiveCfg = Proto|Any CPU - {400FAB03-786E-40CC-85A8-04B0C2869B14}.Proto|x86.Build.0 = Proto|Any CPU {400FAB03-786E-40CC-85A8-04B0C2869B14}.Release|Any CPU.ActiveCfg = Release|Any CPU {400FAB03-786E-40CC-85A8-04B0C2869B14}.Release|Any CPU.Build.0 = Release|Any CPU {400FAB03-786E-40CC-85A8-04B0C2869B14}.Release|x86.ActiveCfg = Release|Any CPU @@ -766,10 +560,6 @@ Global {B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Debug|Any CPU.Build.0 = Debug|Any CPU {B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Debug|x86.ActiveCfg = Debug|Any CPU {B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Debug|x86.Build.0 = Debug|Any CPU - {B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Proto|Any CPU.ActiveCfg = Debug|Any CPU - {B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Proto|Any CPU.Build.0 = Debug|Any CPU - {B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Proto|x86.ActiveCfg = Debug|Any CPU - {B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Proto|x86.Build.0 = Debug|Any CPU {B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Release|Any CPU.ActiveCfg = Release|Any CPU {B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Release|Any CPU.Build.0 = Release|Any CPU {B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Release|x86.ActiveCfg = Release|Any CPU diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj index 26ea4c3577..db88b5bff7 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj @@ -36,6 +36,9 @@ true + + + From f5e05e8195fa8b4b3b1cac7624ec5fd034da7e86 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Thu, 8 Mar 2018 11:03:29 -0800 Subject: [PATCH 069/147] add the commit hash to the description of shipping NuGet packages --- .../FSharp.Compiler.Template.nuget.props | 3 ++- .../FSharp.Compiler.Template.nuget.targets | 4 +--- .../FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec | 3 ++- src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec | 1 + src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.props b/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.props index ca04df941b..0fa6de691d 100644 --- a/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.props +++ b/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.props @@ -15,6 +15,7 @@ $(FSharpSourcesRoot)\..\$(Configuration)\coreclr\bin -rtm-$(BuildRevision.Trim())-0 $(FSPackageVersion)$(PreReleaseSuffix) - -prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(PackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)" -prop "diasymreaderversion=$(MicrosoftDiaSymReaderPackageVersion)" -prop "diasymreaderportablepdbversion=$(MicrosoftDiaSymReaderPortablePdbPackageVersion)" + + diff --git a/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.targets b/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.targets index d6715e4aa3..77715c6112 100644 --- a/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.targets +++ b/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.targets @@ -15,8 +15,6 @@ - - @@ -34,7 +32,7 @@ Outputs='$(FSharpSourcesRoot)\$(Configuration)\artifacts\$(PackageVersion)\"%(PackageNuspec.Filename)).nupkg'> - -prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(PackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)" -prop "diasymreaderversion=$(MicrosoftDiaSymReaderPackageVersion)" -prop "diasymreaderportablepdbversion=$(MicrosoftDiaSymReaderPortablePdbPackageVersion)" + -prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(PackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)" -prop "diasymreaderversion=$(MicrosoftDiaSymReaderPackageVersion)" -prop "diasymreaderportablepdbversion=$(MicrosoftDiaSymReaderPortablePdbPackageVersion)" -prop "githeadsha=$(GitHeadSha)" diff --git a/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec b/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec index 91a5f25302..b5276a7145 100644 --- a/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec +++ b/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec @@ -4,7 +4,8 @@ Microsoft.FSharp.Compiler .NET Core compatible version of the fsharp compiler fsc.exe. - Supported Platforms: - .NET Core (.netstandard1.6) + Supported Platforms: - .NET Core (.netstandard1.6). + Commit hash: $githeadsha$. en-US true diff --git a/src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec b/src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec index 4bdef1b8ed..9eed52354c 100644 --- a/src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec +++ b/src/fsharp/FSharp.Core.nuget/FSharp.Core.LatestNuget.nuspec @@ -11,6 +11,7 @@ .NET 4.5+ (net45) netstandard1.6 (netstandard1.6) netstandard2.0 (netstandard2.0) + Commit hash: $githeadsha$. en-US $version$ diff --git a/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj b/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj index f8dc68b0c9..d14d40aeda 100644 --- a/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj +++ b/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj @@ -61,7 +61,7 @@ $(FSharpCoreLatestTargetPackageVersion) $(FSharpCoreLatestTargetMajorVersion) - -prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(PackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)" + -prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(PackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)" -prop "githeadsha=$(GitHeadSha)" From 25ee34589eadc84536ade5ef5c42f7c5e7f410b5 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Thu, 8 Mar 2018 17:18:43 -0800 Subject: [PATCH 070/147] add the commit hash to the VS package --- .../Vsix/RegisterFsharpPackage.pkgdef | 1 - .../src/FSharp.Editor/Common/Constants.fs | 6 ++++- .../src/FSharp.Editor/FSharp.Editor.fsproj | 1 + .../LanguageService/LanguageService.fs | 2 ++ ...ovideFSharpVersionRegistrationAttribute.fs | 24 +++++++++++++++++++ 5 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 vsintegration/src/FSharp.Editor/LanguageService/ProvideFSharpVersionRegistrationAttribute.fs diff --git a/vsintegration/Vsix/RegisterFsharpPackage.pkgdef b/vsintegration/Vsix/RegisterFsharpPackage.pkgdef index a145c9b0e9..d7c59b2b38 100644 --- a/vsintegration/Vsix/RegisterFsharpPackage.pkgdef +++ b/vsintegration/Vsix/RegisterFsharpPackage.pkgdef @@ -16,7 +16,6 @@ "Package"="{91a04a73-4f2c-4e7c-ad38-c1a68e7da05c}" "ProductDetails"="#9002" "LogoID"="#400" -"UseVSProductID"="1" @="#9001" [$RootKey$\AD7Metrics\ExpressionEvaluator\{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}\{994B45C4-E6E9-11D2-903F-00C04FA302A1}] diff --git a/vsintegration/src/FSharp.Editor/Common/Constants.fs b/vsintegration/src/FSharp.Editor/Common/Constants.fs index be4f0b37ec..c311a7fefc 100644 --- a/vsintegration/src/FSharp.Editor/Common/Constants.fs +++ b/vsintegration/src/FSharp.Editor/Common/Constants.fs @@ -17,7 +17,11 @@ module internal FSharpConstants = [] /// "BC6DD5A5-D4D6-4dab-A00D-A51242DBAF1B" let languageServiceGuidString = "BC6DD5A5-D4D6-4dab-A00D-A51242DBAF1B" - + + [] + /// "91a04a73-4f2c-4e7c-ad38-c1a68e7da05c" + let projectPackageGuidString = "91a04a73-4f2c-4e7c-ad38-c1a68e7da05c" + [] /// "F#" let FSharpLanguageName = "F#" diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index 9a1e8e6cef..6d64030df3 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -42,6 +42,7 @@ + diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index 148961ae7d..0524abc5b9 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -23,6 +23,7 @@ open Microsoft.FSharp.Compiler.CompileOps open Microsoft.FSharp.Compiler.SourceCodeServices open Microsoft.VisualStudio open Microsoft.VisualStudio.Editor +open Microsoft.VisualStudio.FSharp.Editor open Microsoft.VisualStudio.FSharp.Editor.SiteProvider open Microsoft.VisualStudio.TextManager.Interop open Microsoft.VisualStudio.LanguageServices @@ -284,6 +285,7 @@ type [, "F#", null, "QuickInfo", "6009")>] [, "F#", null, "Code Fixes", "6010")>] [, "F#", null, "Performance", "6011")>] + [] [, strLanguageName = FSharpConstants.FSharpLanguageName, languageResourceID = 100, diff --git a/vsintegration/src/FSharp.Editor/LanguageService/ProvideFSharpVersionRegistrationAttribute.fs b/vsintegration/src/FSharp.Editor/LanguageService/ProvideFSharpVersionRegistrationAttribute.fs new file mode 100644 index 0000000000..4b6fa6ff05 --- /dev/null +++ b/vsintegration/src/FSharp.Editor/LanguageService/ProvideFSharpVersionRegistrationAttribute.fs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace Microsoft.VisualStudio.FSharp.Editor + +open System +open System.Diagnostics +open Microsoft.VisualStudio.Shell + +type internal ProvideFSharpVersionRegistrationAttribute(packageGuidString:string, productName:string) = + inherit RegistrationAttribute() + + let keyName = "InstalledProducts\\" + productName + + override this.Register(context:RegistrationAttribute.RegistrationContext) = + // Get the version of this build. This code is executed by CreatePkgDef.exe at build time and NOT at runtime. + let version = FileVersionInfo.GetVersionInfo(typeof.Assembly.Location) + use key = context.CreateKey(keyName) + key.SetValue("Package", Guid.Parse(packageGuidString).ToString("B")) + key.SetValue("PID", version.ProductVersion) + key.SetValue("UseInterface", false) + key.SetValue("UseVSProductID", false) + + override this.Unregister(context:RegistrationAttribute.RegistrationContext) = + context.RemoveKey(keyName) From da5d0f63cb0735acc70113bbc105ce48ad614fd9 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Fri, 9 Mar 2018 03:14:32 +0100 Subject: [PATCH 071/147] One lookup in nenv.eFieldLabels should be enough (#4469) --- src/fsharp/NameResolution.fs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/fsharp/NameResolution.fs b/src/fsharp/NameResolution.fs index fabb6e515b..65d3db9fbe 100644 --- a/src/fsharp/NameResolution.fs +++ b/src/fsharp/NameResolution.fs @@ -3169,16 +3169,16 @@ let private ResolveExprDotLongIdent (ncenv:NameResolver) m ad nenv typ lid findF if isAppTy ncenv.g typ then NoResultsOrUsefulErrors else - match lid with + match lid with // A unique record label access, e.g expr.field - | id::rest when nenv.eFieldLabels.ContainsKey(id.idText) -> - match nenv.eFieldLabels.[id.idText] with - | [] -> NoResultsOrUsefulErrors - | rfref :: _ -> + | id::rest -> + match Map.tryFind id.idText nenv.eFieldLabels with + | Some (rfref :: _) -> // NOTE (instantiationGenerator cleanup): we need to freshen here because we don't know the type. // But perhaps the caller should freshen?? let item = FreshenRecdFieldRef ncenv m rfref OneSuccess (ResolutionInfo.Empty,item,rest) + | _ -> NoResultsOrUsefulErrors | _ -> NoResultsOrUsefulErrors let search = dotFieldIdSearch From 792dbe58972c829eb5178ad755c3b11c7c13548b Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Fri, 9 Mar 2018 03:16:46 +0100 Subject: [PATCH 072/147] Shortcut NameResolution searches (#4444) --- src/fsharp/NameResolution.fs | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/src/fsharp/NameResolution.fs b/src/fsharp/NameResolution.fs index 65d3db9fbe..d59657805b 100644 --- a/src/fsharp/NameResolution.fs +++ b/src/fsharp/NameResolution.fs @@ -2688,6 +2688,7 @@ let rec ResolvePatternLongIdentPrim sink (ncenv:NameResolver) fullyQualified war let moduleSearch ad = ResolveLongIndentAsModuleOrNamespaceThen sink ResultCollectionSettings.AtMostOneResult ncenv.amap m fullyQualified nenv ad lid false (ResolvePatternLongIdentInModuleOrNamespace ncenv nenv numTyArgsOpt ad) + let tyconSearch ad = match lid with | tn :: rest when not (isNil rest) -> @@ -2697,15 +2698,33 @@ let rec ResolvePatternLongIdentPrim sink (ncenv:NameResolver) fullyQualified war ResolveLongIdentInTyconRefs ResultCollectionSettings.AtMostOneResult ncenv nenv LookupKind.Pattern 1 tn.idRange ad rest numTyArgsOpt tn.idRange tcrefs | _ -> NoResultsOrUsefulErrors - let resInfo,res,rest = - match AtMostOneResult m (tyconSearch ad +++ moduleSearch ad) with + + let resInfo,res,rest = + let tyconResult = tyconSearch ad + match tyconResult with + | Result (res :: _) -> res + | _ -> + + let moduleResult = moduleSearch ad + match moduleResult with + | Result (res :: _) -> res + | _ -> + + match AtMostOneResult m (tyconResult +++ moduleResult) with | Result _ as res -> ForceRaise res - | _ -> - ForceRaise (AtMostOneResult m (tyconSearch AccessibleFromSomeFSharpCode +++ moduleSearch AccessibleFromSomeFSharpCode)) + | _ -> + + let tyconResult = tyconSearch AccessibleFromSomeFSharpCode + match tyconResult with + | Result (res :: _) -> res + | _ -> + ForceRaise (AtMostOneResult m (tyconResult +++ moduleSearch AccessibleFromSomeFSharpCode)) + ResolutionInfo.SendEntityPathToSink(sink,ncenv,nenv,ItemOccurence.Use,ad,resInfo,ResultTyparChecker(fun () -> true)) - if not (isNil rest) then error(Error(FSComp.SR.nrIsNotConstructorOrLiteral(),(List.head rest).idRange)) - res + match rest with + | [] -> res + | element :: _ -> error(Error(FSComp.SR.nrIsNotConstructorOrLiteral(),element.idRange)) /// Resolve a long identifier when used in a pattern. From ed8393c8b0c172f0869862da8073a7eef2763440 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Fri, 9 Mar 2018 03:17:23 +0100 Subject: [PATCH 073/147] No need to decompile coreDisplayName all the time (#4443) --- src/fsharp/TypeChecker.fs | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index 3a1fa009c4..4d75c9af78 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -1405,32 +1405,34 @@ let ComputeAccessAndCompPath env declKindOpt m vis overrideVis actualParent = let cpath = if accessModPermitted then Some env.eCompPath else None vis, cpath -let CheckForAbnormalOperatorNames cenv (idRange:range) opName isMember = - if (idRange.EndColumn - idRange.StartColumn <= 5) && - not cenv.g.compilingFslib +let CheckForAbnormalOperatorNames cenv (idRange:range) coreDisplayName (memberInfoOpt: ValMemberInfo option) = + if (idRange.EndColumn - idRange.StartColumn <= 5) && + not cenv.g.compilingFslib then - match opName with + let opName = DecompileOpName coreDisplayName + let isMember = memberInfoOpt.IsSome + match opName with | PrettyNaming.Relational -> if isMember then - warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidMethodNameForRelationalOperator(opName, (CompileOpName opName)), idRange)) + warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidMethodNameForRelationalOperator(opName, coreDisplayName), idRange)) else - warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidOperatorDefinitionRelational(opName), idRange)) + warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidOperatorDefinitionRelational opName, idRange)) | PrettyNaming.Equality -> if isMember then - warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidMethodNameForEquality(opName, (CompileOpName opName)), idRange)) + warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidMethodNameForEquality(opName, coreDisplayName), idRange)) else - warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidOperatorDefinitionEquality(opName), idRange)) + warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidOperatorDefinitionEquality opName, idRange)) | PrettyNaming.Control -> if isMember then - warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidMemberName(opName, (CompileOpName opName)), idRange)) + warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidMemberName(opName, coreDisplayName), idRange)) else - warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidOperatorDefinition(opName), idRange)) + warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidOperatorDefinition opName, idRange)) | PrettyNaming.Indexer -> if not isMember then - error(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidIndexOperatorDefinition(opName), idRange)) + error(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidIndexOperatorDefinition opName, idRange)) | PrettyNaming.FixedTypes -> if isMember then - warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidMemberNameFixedTypes(opName), idRange)) + warning(StandardOperatorRedefinitionWarning(FSComp.SR.tcInvalidMemberNameFixedTypes opName, idRange)) | PrettyNaming.Other -> () let MakeAndPublishVal cenv env (altActualParent, inSig, declKind, vrec, (ValScheme(id, typeScheme, topValData, memberInfoOpt, isMutable, inlineFlag, baseOrThis, vis, compgen, isIncrClass, isTyFunc, hasDeclaredTypars)), attrs, doc, konst, isGeneratedEventVal) = @@ -1537,7 +1539,7 @@ let MakeAndPublishVal cenv env (altActualParent, inSig, declKind, vrec, (ValSche (hasDeclaredTypars || inSig), isGeneratedEventVal, konst, actualParent) - CheckForAbnormalOperatorNames cenv id.idRange (DecompileOpName vspec.CoreDisplayName) (Option.isSome memberInfoOpt) + CheckForAbnormalOperatorNames cenv id.idRange vspec.CoreDisplayName memberInfoOpt PublishValueDefn cenv env declKind vspec From e4fb0fc567bb72849bcd6327b6cdad648f0e7fa1 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Fri, 9 Mar 2018 14:18:31 +0100 Subject: [PATCH 074/147] small cleanups in MethodCalls.fs (#4435) --- src/fsharp/MethodCalls.fs | 43 +++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/src/fsharp/MethodCalls.fs b/src/fsharp/MethodCalls.fs index 31e2c960f3..46932d3ca7 100644 --- a/src/fsharp/MethodCalls.fs +++ b/src/fsharp/MethodCalls.fs @@ -530,22 +530,21 @@ let ComputeConstrainedCallInfo g amap m (objArgs,minfo:MethInfo) = /// Adjust the 'this' pointer before making a call /// Take the address of a struct, and coerce to an interface/base/constraint type if necessary let TakeObjAddrForMethodCall g amap (minfo:MethInfo) isMutable m objArgs f = - let ccallInfo = ComputeConstrainedCallInfo g amap m (objArgs,minfo) - let mustTakeAddress = - (minfo.IsStruct && not minfo.IsExtensionMember) // don't take the address of a struct when passing to an extension member - || - (match ccallInfo with - | Some _ -> true - | None -> false) + let ccallInfo = ComputeConstrainedCallInfo g amap m (objArgs,minfo) + let wrap,objArgs = match objArgs with - | [objArgExpr] -> + | [objArgExpr] -> + let hasCallInfo = ccallInfo.IsSome + let mustTakeAddress = + (minfo.IsStruct && not minfo.IsExtensionMember) // don't take the address of a struct when passing to an extension member + || hasCallInfo let objArgTy = tyOfExpr g objArgExpr - let wrap,objArgExpr' = mkExprAddrOfExpr g mustTakeAddress (Option.isSome ccallInfo) isMutable objArgExpr None m + let wrap,objArgExpr' = mkExprAddrOfExpr g mustTakeAddress hasCallInfo isMutable objArgExpr None m // Extension members and calls to class constraints may need a coercion for their object argument let objArgExpr' = - if Option.isNone ccallInfo && // minfo.IsExtensionMember && minfo.IsStruct && + if not hasCallInfo && // minfo.IsExtensionMember && minfo.IsStruct && not (TypeDefinitelySubsumesTypeNoCoercion 0 g amap m minfo.ApparentEnclosingType objArgTy) then mkCoerceExpr(objArgExpr',minfo.ApparentEnclosingType,m,objArgTy) else @@ -554,7 +553,7 @@ let TakeObjAddrForMethodCall g amap (minfo:MethInfo) isMutable m objArgs f = wrap,[objArgExpr'] | _ -> - (fun x -> x), objArgs + id, objArgs let e,ety = f ccallInfo objArgs wrap e,ety @@ -579,7 +578,7 @@ let BuildILMethInfoCall g amap m isProp (minfo:ILMethInfo) valUseFlags minst dir let ilMethRef = minfo.ILMethodRef let newobj = ctor && (match valUseFlags with NormalValUse -> true | _ -> false) let exprTy = if ctor then minfo.ApparentEnclosingType else minfo.GetFSharpReturnTy(amap, m, minst) - let retTy = (if not ctor && (ilMethRef.ReturnType = ILType.Void) then [] else [exprTy]) + let retTy = if not ctor && ilMethRef.ReturnType = ILType.Void then [] else [exprTy] let isDllImport = minfo.IsDllImport g Expr.Op(TOp.ILCall(useCallvirt,isProtected,valu,newobj,valUseFlags,isProp,isDllImport,ilMethRef,minfo.DeclaringTypeInst,minst,retTy),[],args,m), exprTy @@ -604,9 +603,7 @@ let BuildFSharpMethodApp g m (vref: ValRef) vexp vexprty (args: Exprs) = ((args,vexprty), arities) ||> List.mapFold (fun (args,fty) arity -> match arity,args with | (0|1),[] when typeEquiv g (domainOfFunTy g fty) g.unit_ty -> mkUnit g m, (args, rangeOfFunTy g fty) - | 0,(arg::argst)-> - - + | 0,(arg::argst) -> warning(InternalError(sprintf "Unexpected zero arity, args = %s" (Layout.showL (Layout.sepListL (Layout.rightL (Layout.TaggedTextOps.tagText ";")) (List.map exprL args))),m)); arg, (argst, rangeOfFunTy g fty) | 1,(arg :: argst) -> arg, (argst, rangeOfFunTy g fty) @@ -673,9 +670,8 @@ let TryImportProvidedMethodBaseAsLibraryIntrinsic (amap:Import.ImportMap, m:rang | _ -> match amap.g.knownFSharpCoreModules.TryGetValue(declaringEntity.LogicalName) with | true,modRef -> - match modRef.ModuleOrNamespaceType.AllValsByLogicalName |> Seq.tryPick (fun (KeyValue(_,v)) -> if v.CompiledName = methodName then Some v else None) with - | Some v -> Some (mkNestedValRef modRef v) - | None -> None + modRef.ModuleOrNamespaceType.AllValsByLogicalName + |> Seq.tryPick (fun (KeyValue(_,v)) -> if v.CompiledName = methodName then Some (mkNestedValRef modRef v) else None) | _ -> None else None @@ -693,13 +689,12 @@ let TryImportProvidedMethodBaseAsLibraryIntrinsic (amap:Import.ImportMap, m:rang // objArgs: the 'this' argument, if any // args: the arguments, if any let BuildMethodCall tcVal g amap isMutable m isProp minfo valUseFlags minst objArgs args = - let direct = IsBaseCall objArgs TakeObjAddrForMethodCall g amap minfo isMutable m objArgs (fun ccallInfo objArgs -> - let allArgs = (objArgs @ args) + let allArgs = objArgs @ args let valUseFlags = - if (direct && (match valUseFlags with NormalValUse -> true | _ -> false)) then + if direct && (match valUseFlags with NormalValUse -> true | _ -> false) then VSlotDirectCall else match ccallInfo with @@ -722,7 +717,7 @@ let BuildMethodCall tcVal g amap isMutable m isProp minfo valUseFlags minst objA // these calls are provided by the runtime and should not be called from the user code if isArrayTy g enclTy then let tpe = TypeProviderError(FSComp.SR.tcRuntimeSuppliedMethodCannotBeUsedInUserCode(minfo.DisplayName), providedMeth.TypeProviderDesignation, m) - error (tpe) + error tpe let valu = isStructTy g enclTy let isCtor = minfo.IsConstructor if minfo.IsClassConstructor then @@ -747,7 +742,7 @@ let BuildMethodCall tcVal g amap isMutable m isProp minfo valUseFlags minst objA elif isFunTy g enclTy then [ domainOfFunTy g enclTy; rangeOfFunTy g enclTy ] // provided expressions can call Invoke else minfo.DeclaringTypeInst let actualMethInst = minst - let retTy = (if not isCtor && (ilMethRef.ReturnType = ILType.Void) then [] else [exprTy]) + let retTy = if not isCtor && (ilMethRef.ReturnType = ILType.Void) then [] else [exprTy] let noTailCall = false let expr = Expr.Op(TOp.ILCall(useCallvirt,isProtected,valu,isNewObj,valUseFlags,isProp,noTailCall,ilMethRef,actualTypeInst,actualMethInst, retTy),[],allArgs,m) expr,exprTy @@ -1191,7 +1186,7 @@ module ProvidedMethodCalls = |> Array.map (fun pty -> eraseSystemType (amap,m,pty)) let paramVars = erasedParamTys - |> Array.mapi (fun i erasedParamTy -> erasedParamTy.PApply((fun ty -> ProvidedVar.Fresh("arg" + i.ToString(),ty)),m)) + |> Array.mapi (fun i erasedParamTy -> erasedParamTy.PApply((fun ty -> ProvidedVar.Fresh("arg" + i.ToString(),ty)),m)) // encode "this" as the first ParameterExpression, if applicable From bbf07fb68b0bc9b26bca0a5f74913cf172d14193 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Fri, 9 Mar 2018 14:22:29 +0100 Subject: [PATCH 075/147] List.isEmpty instead of iterating through the list to get the count (#4439) --- src/absil/ilprint.fs | 19 +++++++++---------- src/absil/ilread.fs | 2 +- src/absil/ilwrite.fs | 10 +++++----- src/fsharp/CompileOps.fs | 2 +- src/fsharp/IlxGen.fs | 8 ++++---- src/fsharp/LexFilter.fs | 2 +- src/fsharp/MethodOverrides.fs | 2 +- src/fsharp/NameResolution.fs | 14 +++++++------- src/fsharp/Optimizer.fs | 2 +- src/fsharp/TypeChecker.fs | 27 +++++++++++++-------------- src/fsharp/fsc.fs | 2 +- src/fsharp/fsi/fsi.fs | 2 +- src/fsharp/tast.fs | 2 +- 13 files changed, 46 insertions(+), 48 deletions(-) diff --git a/src/absil/ilprint.fs b/src/absil/ilprint.fs index 0344a4fbb5..abad68c977 100644 --- a/src/absil/ilprint.fs +++ b/src/absil/ilprint.fs @@ -213,11 +213,10 @@ and goutput_typ_with_shortened_class_syntax env os = function | typ2 -> goutput_typ env os typ2 and goutput_gactuals env os inst = - if inst.Length = 0 then () - else - output_string os "<"; + if not (List.isEmpty inst) then + output_string os "<" output_seq ", " (goutput_gactual env) os inst - output_string os ">"; + output_string os ">" and goutput_gactual env os ty = goutput_typ env os ty @@ -864,14 +863,14 @@ let goutput_superclass env os = function | Some typ -> output_string os "extends "; (goutput_typ_with_shortened_class_syntax env) os typ let goutput_superinterfaces env os imp = - if imp = [] then () else - output_string os "implements "; - output_seq "," (goutput_typ_with_shortened_class_syntax env) os imp + if not (List.isEmpty imp) then + output_string os "implements " + output_seq "," (goutput_typ_with_shortened_class_syntax env) os imp let goutput_implements env os (imp:ILTypes) = - if imp.Length = 0 then () else - output_string os "implements "; - output_seq "," (goutput_typ_with_shortened_class_syntax env) os imp + if not (List.isEmpty imp) then + output_string os "implements " + output_seq "," (goutput_typ_with_shortened_class_syntax env) os imp let the = function Some x -> x | None -> failwith "the" diff --git a/src/absil/ilread.fs b/src/absil/ilread.fs index c1e4ac3b9c..e89164a42a 100644 --- a/src/absil/ilread.fs +++ b/src/absil/ilread.fs @@ -1816,7 +1816,7 @@ and seekReadTypeDefOrRef ctxt numtypars boxity (ginst:ILTypes) (TaggedIndex(tag, | tag when tag = tdor_TypeDef -> seekReadTypeDefAsType ctxt boxity ginst idx | tag when tag = tdor_TypeRef -> seekReadTypeRefAsType ctxt boxity ginst idx | tag when tag = tdor_TypeSpec -> - if ginst.Length > 0 then dprintn ("type spec used as type constructor for a generic instantiation: ignoring instantiation") + if not (List.isEmpty ginst) then dprintn ("type spec used as type constructor for a generic instantiation: ignoring instantiation") readBlobHeapAsType ctxt numtypars (seekReadTypeSpecRow ctxt idx) | _ -> failwith "seekReadTypeDefOrRef ctxt" diff --git a/src/absil/ilwrite.fs b/src/absil/ilwrite.fs index 255a3e6193..e1af01dd56 100644 --- a/src/absil/ilwrite.fs +++ b/src/absil/ilwrite.fs @@ -1307,10 +1307,10 @@ and GetMethodDefOrRefAsUncodedToken (tag, idx) = getUncodedToken tab idx and GetMethodSpecInfoAsUncodedToken cenv env ((_, _, _, _, _, _, minst:ILGenericArgs) as minfo) = - if minst.Length > 0 then - getUncodedToken TableNames.MethodSpec (GetMethodSpecInfoAsMethodSpecIdx cenv env minfo) - else - GetMethodDefOrRefAsUncodedToken (GetMethodRefInfoAsMethodRefOrDef false cenv env (GetMethodRefInfoOfMethodSpecInfo minfo)) + if List.isEmpty minst then + GetMethodDefOrRefAsUncodedToken (GetMethodRefInfoAsMethodRefOrDef false cenv env (GetMethodRefInfoOfMethodSpecInfo minfo)) + else + getUncodedToken TableNames.MethodSpec (GetMethodSpecInfoAsMethodSpecIdx cenv env minfo) and GetMethodSpecAsUncodedToken cenv env mspec = GetMethodSpecInfoAsUncodedToken cenv env (InfoOfMethodSpec mspec) @@ -2475,7 +2475,7 @@ let GenReturnPass3 cenv (returnv: ILReturn) = let GetMethodDefSigAsBytes cenv env (mdef: ILMethodDef) = emitBytesViaBuffer (fun bb -> bb.EmitByte (callconvToByte mdef.GenericParams.Length mdef.CallingConv) - if mdef.GenericParams.Length > 0 then bb.EmitZ32 mdef.GenericParams.Length + if not (List.isEmpty mdef.GenericParams) then bb.EmitZ32 mdef.GenericParams.Length bb.EmitZ32 mdef.Parameters.Length EmitType cenv env bb mdef.Return.Type mdef.ParameterTypes |> List.iter (EmitType cenv env bb)) diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs index 7224d15740..069dba4859 100644 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -4287,7 +4287,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti // specified in the attributes |> List.distinctBy (fun s -> try Path.GetFileNameWithoutExtension(s) with _ -> s) - if designTimeAssemblyNames.Length > 0 then + if not (List.isEmpty designTimeAssemblyNames) then // Find the SystemRuntimeAssemblyVersion value to report in the TypeProviderConfig. let primaryAssemblyVersion = diff --git a/src/fsharp/IlxGen.fs b/src/fsharp/IlxGen.fs index edce05ea7b..704a92f760 100644 --- a/src/fsharp/IlxGen.fs +++ b/src/fsharp/IlxGen.fs @@ -5188,7 +5188,7 @@ and GenMethodForBinding let permissionSets = CreatePermissionSets cenv.g cenv.amap eenv securityAttributes - let secDecls = if securityAttributes.Length > 0 then (mkILSecurityDecls permissionSets) else (emptyILSecurityDecls) + let secDecls = if List.isEmpty securityAttributes then emptyILSecurityDecls else mkILSecurityDecls permissionSets // Do not push the attributes to the method for events and properties let ilAttrsCompilerGenerated = if v.IsCompilerGenerated then [ cenv.g.CompilerGeneratedAttribute ] else [] @@ -5207,7 +5207,7 @@ and GenMethodForBinding // Does the function have an explicit [] attribute? let isExplicitEntryPoint = HasFSharpAttribute cenv.g cenv.g.attrib_EntryPointAttribute attrs - let mdef = mdef.WithSecurity(securityAttributes.Length > 0).WithPInvoke(hasDllImport) + let mdef = mdef.WithSecurity(not (List.isEmpty securityAttributes)).WithPInvoke(hasDllImport) let mdef = mdef.WithPreserveSig(hasPreserveSigImplFlag || hasPreserveSigNamedArg).WithSynchronized(hasSynchronizedImplFlag).WithNoInlining(hasNoInliningFlag).WithAggressiveInlining(hasAggressiveInliningImplFlag) let mdef = { mdef with @@ -6238,7 +6238,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = not (HasFSharpAttribute cenv.g cenv.g.attrib_DebuggerTypeProxyAttribute tycon.Attribs)) let permissionSets = CreatePermissionSets cenv.g cenv.amap eenv securityAttrs - let secDecls = if securityAttrs.Length > 0 then (mkILSecurityDecls permissionSets) else (emptyILSecurityDecls) + let secDecls = if List.isEmpty securityAttrs then emptyILSecurityDecls else mkILSecurityDecls permissionSets let ilDebugDisplayAttributes = [ yield! GenAttrs cenv eenv debugDisplayAttrs @@ -6699,7 +6699,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = | _ -> failwith "??" - let tdef = tdef.WithHasSecurity(securityAttrs.Length > 0) + let tdef = tdef.WithHasSecurity(not (List.isEmpty securityAttrs)) let tdef = { tdef with SecurityDecls = secDecls } diff --git a/src/fsharp/LexFilter.fs b/src/fsharp/LexFilter.fs index 5b9deaf832..c933a847bb 100755 --- a/src/fsharp/LexFilter.fs +++ b/src/fsharp/LexFilter.fs @@ -444,7 +444,7 @@ type TokenTup = let (|TyparsCloseOp|_|) (txt:string) = let angles = txt |> Seq.takeWhile (fun c -> c = '>') |> Seq.toList let afterAngles = txt |> Seq.skipWhile (fun c -> c = '>') |> Seq.toList - if angles.Length = 0 then None else + if List.isEmpty angles then None else let afterOp = match (new System.String(Array.ofSeq afterAngles)) with diff --git a/src/fsharp/MethodOverrides.fs b/src/fsharp/MethodOverrides.fs index fdaab28249..2ba55b7f75 100644 --- a/src/fsharp/MethodOverrides.fs +++ b/src/fsharp/MethodOverrides.fs @@ -709,7 +709,7 @@ let GetAbstractMethInfosForSynMethodDecl(infoReader:InfoReader,ad,memberName:Ide GetIntrinsicMethInfosOfType infoReader (Some(memberName.idText), ad, AllowMultiIntfInstantiations.Yes) IgnoreOverrides bindm ty let dispatchSlots = minfos |> List.filter (fun minfo -> minfo.IsDispatchSlot) let topValSynArities = SynInfo.AritiesOfArgs valSynData - let topValSynArities = if topValSynArities.Length > 0 then topValSynArities.Tail else topValSynArities + let topValSynArities = if List.isEmpty topValSynArities then topValSynArities else topValSynArities.Tail let dispatchSlotsArityMatch = dispatchSlots |> List.filter (fun minfo -> minfo.NumArgs = topValSynArities) dispatchSlots,dispatchSlotsArityMatch diff --git a/src/fsharp/NameResolution.fs b/src/fsharp/NameResolution.fs index d59657805b..2715b65e27 100644 --- a/src/fsharp/NameResolution.fs +++ b/src/fsharp/NameResolution.fs @@ -568,7 +568,7 @@ let AddValRefToNameEnv nenv (vref:ValRef) = /// Add a set of active pattern result tags to the environment. let AddActivePatternResultTagsToNameEnv (apinfo: PrettyNaming.ActivePatternInfo) nenv ty m = - if apinfo.Names.Length = 0 then nenv else + if List.isEmpty apinfo.Names then nenv else let apresl = List.indexed apinfo.Names { nenv with eUnqualifiedItems = @@ -675,13 +675,13 @@ let private AddPartsOfTyconRefToNameEnv bulkAddMode ownDefinition (g:TcGlobals) | _ -> Item.UnqualifiedType [tcref])) else tab - if isILOrRequiredQualifiedAccess || ucrefs.Length = 0 then + if isILOrRequiredQualifiedAccess || List.isEmpty ucrefs then tab else AddUnionCases2 bulkAddMode tab ucrefs let ePatItems = - if isILOrRequiredQualifiedAccess || ucrefs.Length = 0 then + if isILOrRequiredQualifiedAccess || List.isEmpty ucrefs then nenv.ePatItems else AddUnionCases1 nenv.ePatItems ucrefs @@ -1718,14 +1718,14 @@ let CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities // no explicit type instantiation typeNameResInfo.StaticArgsInfo.HasNoStaticArgsInfo && // some type arguments required on all types (note sorted by typar count above) - tcref.Typars(m).Length > 0 && + not (List.isEmpty (tcref.Typars m)) && // plausible types have different arities (tcrefs |> Seq.distinctBy (fun (_,tcref) -> tcref.Typars(m).Length) |> Seq.length > 1) -> [ for (resInfo,tcref) in tcrefs do let resInfo = resInfo.AddWarning (fun _typarChecker -> errorR(Error(FSComp.SR.nrTypeInstantiationNeededToDisambiguateTypesWithSameName(tcref.DisplayName, tcref.DisplayNameWithStaticParametersAndUnderscoreTypars),m))) yield (resInfo,tcref) ] - | [(resInfo,tcref)] when typeNameResInfo.StaticArgsInfo.HasNoStaticArgsInfo && tcref.Typars(m).Length > 0 && typeNameResInfo.ResolutionFlag = ResolveTypeNamesToTypeRefs -> + | [(resInfo,tcref)] when typeNameResInfo.StaticArgsInfo.HasNoStaticArgsInfo && not (List.isEmpty (tcref.Typars m)) && typeNameResInfo.ResolutionFlag = ResolveTypeNamesToTypeRefs -> let resInfo = resInfo.AddWarning (fun (ResultTyparChecker typarChecker) -> if not (typarChecker()) then @@ -3235,9 +3235,9 @@ let NeedsWorkAfterResolution namedItem = | Item.CtorGroup(_,minfos) -> minfos.Length > 1 || minfos |> List.exists (fun minfo -> not (isNil minfo.FormalMethodInst)) | Item.Property(_,pinfos) -> pinfos.Length > 1 | Item.ImplicitOp(_, { contents = Some(TraitConstraintSln.FSMethSln(_, vref, _)) }) - | Item.Value vref | Item.CustomBuilder (_,vref) -> vref.Typars.Length > 0 + | Item.Value vref | Item.CustomBuilder (_,vref) -> not (List.isEmpty vref.Typars) | Item.CustomOperation (_,_,Some minfo) -> not (isNil minfo.FormalMethodInst) - | Item.ActivePatternCase apref -> apref.ActivePatternVal.Typars.Length > 0 + | Item.ActivePatternCase apref -> not (List.isEmpty apref.ActivePatternVal.Typars) | _ -> false /// Specifies additional work to do after an item has been processed further in type checking. diff --git a/src/fsharp/Optimizer.fs b/src/fsharp/Optimizer.fs index d107cd1a78..7ce763fede 100644 --- a/src/fsharp/Optimizer.fs +++ b/src/fsharp/Optimizer.fs @@ -2507,7 +2507,7 @@ and TryInlineApplication cenv env finfo (tyargs: TType list, args: Expr list, m) false else true)))) -> - let isBaseCall = args.Length > 0 && + let isBaseCall = not (List.isEmpty args) && match args.[0] with | Expr.Val(vref, _, _) when vref.BaseOrThisInfo = BaseVal -> true | _ -> false diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index 4d75c9af78..2117fdcd39 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -2812,7 +2812,7 @@ let TcVal checkAttributes cenv env tpenv (vref:ValRef) optInst optAfterResolutio // If we have got an explicit instantiation then use that | Some(vrefFlags, checkTys) -> let checkInst (tinst:TypeInst) = - if not v.IsMember && not v.PermitsExplicitTypeInstantiation && tinst.Length > 0 && v.Typars.Length > 0 then + if not v.IsMember && not v.PermitsExplicitTypeInstantiation && not (List.isEmpty tinst) && not (List.isEmpty v.Typars) then warning(Error(FSComp.SR.tcDoesNotAllowExplicitTypeArguments(v.DisplayName), m)) match vrec with | ValInRecScope false -> @@ -7495,13 +7495,13 @@ and TcComputationExpression cenv env overallTy mWhole interpExpr builderTy tpenv | StripApps(SingleIdent nm, [StripApps(SingleIdent nm2, args); arg2]) when PrettyNaming.IsInfixOperator nm.idText && expectedArgCountForCustomOperator nm2 > 0 && - args.Length > 0 -> + not (List.isEmpty args) -> let estimatedRangeOfIntendedLeftAndRightArguments = unionRanges (List.last args).Range arg2.Range errorR(Error(FSComp.SR.tcUnrecognizedQueryBinaryOperator(), estimatedRangeOfIntendedLeftAndRightArguments)) true | SynExpr.Tuple( (StripApps(SingleIdent nm2, args) :: _), _, m) when expectedArgCountForCustomOperator nm2 > 0 && - args.Length > 0 -> + not (List.isEmpty args) -> let estimatedRangeOfIntendedLeftAndRightArguments = unionRanges (List.last args).Range m.EndRange errorR(Error(FSComp.SR.tcUnrecognizedQueryBinaryOperator(), estimatedRangeOfIntendedLeftAndRightArguments)) true @@ -11254,7 +11254,7 @@ and AnalyzeAndMakeAndPublishRecursiveValue overridesOK isGeneratedEventVal cenv let prelimTyscheme = TypeScheme(enclosingDeclaredTypars@declaredTypars, ty) let partialValReprInfo = TranslateTopValSynInfo mBinding (TcAttributes cenv envinner) valSynInfo let topValInfo = UseSyntacticArity declKind prelimTyscheme partialValReprInfo - let hasDeclaredTypars = declaredTypars.Length > 0 + let hasDeclaredTypars = not (List.isEmpty declaredTypars) let prelimValScheme = ValScheme(bindingId, prelimTyscheme, topValInfo, memberInfoOpt, false, inlineFlag, NormalVal, vis, false, false, false, hasDeclaredTypars) // Check the literal r.h.s., if any @@ -13576,14 +13576,14 @@ module MutRecBindingChecking = let ad = env.eAccessRights let mvvs = ForceRaise (ResolveLongIndentAsModuleOrNamespace cenv.tcSink ResultCollectionSettings.AllResults cenv.amap m OpenQualified env.eNameResEnv ad p false) let modrefs = mvvs |> List.map p23 - if modrefs.Length > 0 && modrefs |> List.forall (fun modref -> modref.IsNamespace) then + if not (List.isEmpty modrefs) && modrefs |> List.forall (fun modref -> modref.IsNamespace) then errorR(Error(FSComp.SR.tcModuleAbbreviationForNamespace(fullDisplayTextOfModRef (List.head modrefs)), m)) let modrefs = modrefs |> List.filter (fun mvv -> not mvv.IsNamespace) + if List.isEmpty modrefs then env else modrefs |> List.iter (fun modref -> CheckEntityAttributes cenv.g modref m |> CommitOperationResult) - let env = (if modrefs.Length > 0 then AddModuleAbbreviationAndReport cenv.tcSink scopem id modrefs env else env) + let env = AddModuleAbbreviationAndReport cenv.tcSink scopem id modrefs env env - /// Update the contents accessible via the recursive namespace declaration, if any let TcMutRecDefns_UpdateNSContents mutRecNSInfo = match mutRecNSInfo with @@ -15130,10 +15130,10 @@ module EstablishTypeDefinitionCores = if allowed then if kind = explicitKind then warning(PossibleUnverifiableCode(m)) - elif thisTyconRef.Typars(m).Length > 0 then - errorR (Error(FSComp.SR.tcGenericTypesCannotHaveStructLayout(), m)) - else + elif List.isEmpty (thisTyconRef.Typars m) then errorR (Error(FSComp.SR.tcOnlyStructsCanHaveStructLayout(), m)) + else + errorR (Error(FSComp.SR.tcGenericTypesCannotHaveStructLayout(), m)) | None -> () let hiddenReprChecks(hasRepr) = @@ -16363,14 +16363,13 @@ let rec TcSignatureElementNonMutRec cenv parent typeNames endm (env: TcEnv) synS let modrefs = unfilteredModrefs |> List.filter (fun modref -> not modref.IsNamespace) - if unfilteredModrefs.Length > 0 && List.isEmpty modrefs then + if not (List.isEmpty unfilteredModrefs) && List.isEmpty modrefs then errorR(Error(FSComp.SR.tcModuleAbbreviationForNamespace(fullDisplayTextOfModRef (List.head unfilteredModrefs)), m)) + if List.isEmpty modrefs then return env else modrefs |> List.iter (fun modref -> CheckEntityAttributes cenv.g modref m |> CommitOperationResult) - let env = - if modrefs.Length > 0 then AddModuleAbbreviationAndReport cenv.tcSink scopem id modrefs env - else env + let env = AddModuleAbbreviationAndReport cenv.tcSink scopem id modrefs env return env | SynModuleSigDecl.HashDirective _ -> diff --git a/src/fsharp/fsc.fs b/src/fsharp/fsc.fs index 345071f35e..699b6c52ec 100644 --- a/src/fsharp/fsc.fs +++ b/src/fsharp/fsc.fs @@ -1966,7 +1966,7 @@ let main2b (tcImportsCapture,dynamicAssemblyCreator) (Args (ctok, tcConfig: TcCo // remove any security attributes from the top-level assembly attribute list let topAttrs = {topAttrs with assemblyAttrs=topAssemblyAttrs} let permissionSets = ilxGenerator.CreatePermissionSets securityAttrs - let secDecls = if securityAttrs.Length > 0 then mkILSecurityDecls permissionSets else emptyILSecurityDecls + let secDecls = if List.isEmpty securityAttrs then emptyILSecurityDecls else mkILSecurityDecls permissionSets let ilxMainModule = MainModuleBuilder.CreateMainModule (ctok, tcConfig, tcGlobals, tcImports, pdbfile, assemblyName, outfile, topAttrs, idata, optDataResources, codegenResults, assemVerFromAttrib, metadataVersion, secDecls) diff --git a/src/fsharp/fsi/fsi.fs b/src/fsharp/fsi/fsi.fs index 8f0fbc9c81..b0d55326c4 100644 --- a/src/fsharp/fsi/fsi.fs +++ b/src/fsharp/fsi/fsi.fs @@ -2029,7 +2029,7 @@ type internal FsiInteractionProcessor // When the last declaration has a shape of DoExp (i.e., non-binding), // transform it to a shape of "let it = ", so we can refer it. - let defsA = if defsA.Length <= 1 || defsB.Length > 0 then defsA else + let defsA = if defsA.Length <= 1 || not (List.isEmpty defsB) then defsA else match List.headAndTail (List.rev defsA) with | SynModuleDecl.DoExpr(_,exp,_), rest -> (rest |> List.rev) @ (fsiDynamicCompiler.BuildItBinding exp) | _ -> defsA diff --git a/src/fsharp/tast.fs b/src/fsharp/tast.fs index ea3c0e2de0..58a348c186 100755 --- a/src/fsharp/tast.fs +++ b/src/fsharp/tast.fs @@ -604,7 +604,7 @@ type Entity = | [] -> nm | tps -> let nm = DemangleGenericTypeName nm - if withUnderscoreTypars && tps.Length > 0 then + if withUnderscoreTypars && not (List.isEmpty tps) then nm + "<" + String.concat "," (Array.create tps.Length "_") + ">" else nm From 1a3f1e86d2328f98ef8fd0a990d4e895a4342786 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Fri, 9 Mar 2018 14:23:35 +0100 Subject: [PATCH 076/147] try to minimize intermediate NameRes environments (#4440) --- src/fsharp/TypeChecker.fs | 61 ++++++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index 2117fdcd39..65ab9aeb9b 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -388,11 +388,10 @@ let addInternalsAccessibility env (ccu:CcuThunk) = eAccessRights = computeAccessRights env.eAccessPath eInternalsVisibleCompPaths env.eFamilyType // update this computed field eInternalsVisibleCompPaths = compPath :: env.eInternalsVisibleCompPaths } -let ModifyNameResEnv f env = { env with eNameResEnv = f env.eNameResEnv } - let AddLocalValPrimitive (v:Val) env = - let env = ModifyNameResEnv (fun nenv -> AddValRefToNameEnv nenv (mkLocalValRef v)) env - { env with eUngeneralizableItems = addFreeItemOfTy v.Type env.eUngeneralizableItems } + { env with + eNameResEnv = AddValRefToNameEnv env.eNameResEnv (mkLocalValRef v) + eUngeneralizableItems = addFreeItemOfTy v.Type env.eUngeneralizableItems } let AddLocalValMap tcSink scopem (vals:Val NameMap) env = @@ -400,8 +399,9 @@ let AddLocalValMap tcSink scopem (vals:Val NameMap) env = if vals.IsEmpty then env else - let env = ModifyNameResEnv (AddValMapToNameEnv vals) env - { env with eUngeneralizableItems = NameMap.foldBackRange (typeOfVal >> addFreeItemOfTy) vals env.eUngeneralizableItems } + { env with + eNameResEnv = AddValMapToNameEnv vals env.eNameResEnv + eUngeneralizableItems = NameMap.foldBackRange (typeOfVal >> addFreeItemOfTy) vals env.eUngeneralizableItems } CallEnvSink tcSink (scopem, env.NameEnv, env.eAccessRights) env @@ -410,19 +410,21 @@ let AddLocalVals tcSink scopem (vals:Val list) env = if isNil vals then env else - let env = ModifyNameResEnv (AddValListToNameEnv vals) env - { env with eUngeneralizableItems = List.foldBack (typeOfVal >> addFreeItemOfTy) vals env.eUngeneralizableItems } + { env with + eNameResEnv = AddValListToNameEnv vals env.eNameResEnv + eUngeneralizableItems = List.foldBack (typeOfVal >> addFreeItemOfTy) vals env.eUngeneralizableItems } CallEnvSink tcSink (scopem, env.NameEnv, env.eAccessRights) env -let AddLocalVal tcSink scopem v env = - let env = ModifyNameResEnv (fun nenv -> AddValRefToNameEnv nenv (mkLocalValRef v)) env - let env = {env with eUngeneralizableItems = addFreeItemOfTy v.Type env.eUngeneralizableItems } +let AddLocalVal tcSink scopem v env = + let env = { env with + eNameResEnv = AddValRefToNameEnv env.eNameResEnv (mkLocalValRef v) + eUngeneralizableItems = addFreeItemOfTy v.Type env.eUngeneralizableItems } CallEnvSink tcSink (scopem, env.NameEnv, env.eAccessRights) env let AddLocalExnDefnAndReport tcSink scopem env (exnc:Tycon) = - let env = ModifyNameResEnv (fun nenv -> AddExceptionDeclsToNameEnv BulkAdd.No nenv (mkLocalEntityRef exnc)) env + let env = { env with eNameResEnv = AddExceptionDeclsToNameEnv BulkAdd.No env.eNameResEnv (mkLocalEntityRef exnc) } (* Also make VisualStudio think there is an identifier in scope at the range of the identifier text of its binding location *) CallEnvSink tcSink (exnc.Range, env.NameEnv, env.eAccessRights) CallEnvSink tcSink (scopem, env.NameEnv, env.eAccessRights) @@ -430,7 +432,7 @@ let AddLocalExnDefnAndReport tcSink scopem env (exnc:Tycon) = let AddLocalTyconRefs ownDefinition g amap m tcrefs env = if isNil tcrefs then env else - env |> ModifyNameResEnv (fun nenv -> AddTyconRefsToNameEnv BulkAdd.No ownDefinition g amap m false nenv tcrefs) + { env with eNameResEnv = AddTyconRefsToNameEnv BulkAdd.No ownDefinition g amap m false env.eNameResEnv tcrefs } let AddLocalTycons g amap m (tycons: Tycon list) env = if isNil tycons then env else @@ -448,14 +450,14 @@ let AddLocalTyconsAndReport tcSink scopem g amap m tycons env = let OpenModulesOrNamespaces tcSink g amap scopem root env mvvs openDeclaration = let env = if isNil mvvs then env else - ModifyNameResEnv (fun nenv -> AddModulesAndNamespacesContentsToNameEnv g amap env.eAccessRights scopem root nenv mvvs) env + { env with eNameResEnv = AddModulesAndNamespacesContentsToNameEnv g amap env.eAccessRights scopem root env.eNameResEnv mvvs } CallEnvSink tcSink (scopem, env.NameEnv, env.eAccessRights) CallOpenDeclarationSink tcSink openDeclaration env let AddRootModuleOrNamespaceRefs g amap m env modrefs = if isNil modrefs then env else - ModifyNameResEnv (fun nenv -> AddModuleOrNamespaceRefsToNameEnv g amap m true env.eAccessRights nenv modrefs) env + { env with eNameResEnv = AddModuleOrNamespaceRefsToNameEnv g amap m true env.eAccessRights env.eNameResEnv modrefs } let AddNonLocalCcu g amap scopem env assemblyName (ccu:CcuThunk, internalsVisibleToAttributes) = @@ -476,7 +478,7 @@ let AddNonLocalCcu g amap scopem env assemblyName (ccu:CcuThunk, internalsVisib let env = AddRootModuleOrNamespaceRefs g amap scopem env modrefs let env = if isNil tcrefs then env else - ModifyNameResEnv (fun nenv -> AddTyconRefsToNameEnv BulkAdd.Yes false g amap scopem true nenv tcrefs) env + { env with eNameResEnv = AddTyconRefsToNameEnv BulkAdd.Yes false g amap scopem true env.eNameResEnv tcrefs } //CallEnvSink tcSink (scopem, env.NameEnv, env.eAccessRights) env @@ -486,25 +488,26 @@ let AddLocalRootModuleOrNamespace tcSink g amap scopem env (mtyp:ModuleOrNamespa // Compute the top-rooted type definitions let tcrefs = mtyp.TypeAndExceptionDefinitions |> List.map mkLocalTyconRef let env = AddRootModuleOrNamespaceRefs g amap scopem env modrefs - let env = - if isNil tcrefs then env else - ModifyNameResEnv (fun nenv -> AddTyconRefsToNameEnv BulkAdd.No false g amap scopem true nenv tcrefs) env - let env = { env with eUngeneralizableItems = addFreeItemOfModuleTy mtyp env.eUngeneralizableItems } + let env = { env with + eNameResEnv = if isNil tcrefs then env.eNameResEnv else AddTyconRefsToNameEnv BulkAdd.No false g amap scopem true env.eNameResEnv tcrefs + eUngeneralizableItems = addFreeItemOfModuleTy mtyp env.eUngeneralizableItems } CallEnvSink tcSink (scopem, env.NameEnv, env.eAccessRights) env let AddModuleAbbreviationAndReport tcSink scopem id modrefs env = let env = if isNil modrefs then env else - ModifyNameResEnv (fun nenv -> AddModuleAbbrevToNameEnv id nenv modrefs) env + { env with eNameResEnv = AddModuleAbbrevToNameEnv id env.eNameResEnv modrefs } + CallEnvSink tcSink (scopem, env.NameEnv, env.eAccessRights) let item = Item.ModuleOrNamespaces modrefs CallNameResolutionSink tcSink (id.idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Use, env.DisplayEnv, env.eAccessRights) env let AddLocalSubModule g amap m env (modul:ModuleOrNamespace) = - let env = ModifyNameResEnv (fun nenv -> AddModuleOrNamespaceRefToNameEnv g amap m false env.eAccessRights nenv (mkLocalModRef modul)) env - let env = { env with eUngeneralizableItems = addFreeItemOfModuleTy modul.ModuleOrNamespaceType env.eUngeneralizableItems } + let env = { env with + eNameResEnv = AddModuleOrNamespaceRefToNameEnv g amap m false env.eAccessRights env.eNameResEnv (mkLocalModRef modul) + eUngeneralizableItems = addFreeItemOfModuleTy modul.ModuleOrNamespaceType env.eUngeneralizableItems } env let AddLocalSubModuleAndReport tcSink scopem g amap m env (modul:ModuleOrNamespace) = @@ -518,7 +521,7 @@ let RegisterDeclaredTypars typars env = let AddDeclaredTypars check typars env = if isNil typars then env else - let env = ModifyNameResEnv (fun nenv -> AddDeclaredTyparsToNameEnv check nenv typars) env + let env = { env with eNameResEnv = AddDeclaredTyparsToNameEnv check env.eNameResEnv typars } RegisterDeclaredTypars typars env /// Compilation environment for typechecking a single file in an assembly. Contains the @@ -7245,8 +7248,12 @@ and TcComputationExpression cenv env overallTy mWhole interpExpr builderTy tpenv /// for all custom operations. This adds them to the completion lists and prevents them being used as values inside /// the query. let env = - env |> ModifyNameResEnv (fun nenv -> (nenv, customOperationMethods) ||> Seq.fold (fun nenv (nm, _, _, _, _, _, _, _, methInfo) -> - AddFakeNameToNameEnv nm nenv (Item.CustomOperation (nm, (fun () -> customOpUsageText (ident (nm, mBuilderVal))), Some methInfo)))) + if List.isEmpty customOperationMethods then env else + { env with + eNameResEnv = + (env.eNameResEnv, customOperationMethods) + ||> Seq.fold (fun nenv (nm, _, _, _, _, _, _, _, methInfo) -> + AddFakeNameToNameEnv nm nenv (Item.CustomOperation (nm, (fun () -> customOpUsageText (ident (nm, mBuilderVal))), Some methInfo))) } // Environment is needed for completions CallEnvSink cenv.tcSink (comp.Range, env.NameEnv, ad) @@ -10411,7 +10418,7 @@ and TcNormalizedBinding declKind (cenv:cenv) env tpenv overallTy safeThisValOpt let item = Item.ActivePatternResult(apinfo, cenv.g.unit_ty, i, tagRange) CallNameResolutionSink cenv.tcSink (tagRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Binding, env.DisplayEnv, env.eAccessRights)) - ModifyNameResEnv (fun nenv -> AddActivePatternResultTagsToNameEnv apinfo nenv ty m) envinner + { envinner with eNameResEnv = AddActivePatternResultTagsToNameEnv apinfo envinner.eNameResEnv ty m } | None -> envinner From 47e74f585f845e888a6a100cee93538d9d4c6a2d Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Fri, 9 Mar 2018 13:47:42 -0800 Subject: [PATCH 077/147] Toggles for outlining and structured guidelines (#4227) * Toggles for outlining and structured guidelines * Cleanup * Don't remove outlining alongside block structure lines and better names * fix up rebase; --- .../src/FSharp.Editor/Common/Constants.fs | 7 +- .../src/FSharp.Editor/FSharp.Editor.resx | 3 + .../LanguageService/LanguageService.fs | 8 ++ .../FSharp.Editor/Options/EditorOptions.fs | 19 +++- .../Structure/BlockStructureService.fs | 101 +++++++++--------- .../FSharp.Editor/xlf/FSharp.Editor.cs.xlf | 5 + .../FSharp.Editor/xlf/FSharp.Editor.de.xlf | 5 + .../FSharp.Editor/xlf/FSharp.Editor.en.xlf | 5 + .../FSharp.Editor/xlf/FSharp.Editor.es.xlf | 5 + .../FSharp.Editor/xlf/FSharp.Editor.fr.xlf | 5 + .../FSharp.Editor/xlf/FSharp.Editor.it.xlf | 5 + .../FSharp.Editor/xlf/FSharp.Editor.ja.xlf | 5 + .../FSharp.Editor/xlf/FSharp.Editor.ko.xlf | 5 + .../FSharp.Editor/xlf/FSharp.Editor.pl.xlf | 5 + .../FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf | 5 + .../FSharp.Editor/xlf/FSharp.Editor.ru.xlf | 5 + .../FSharp.Editor/xlf/FSharp.Editor.tr.xlf | 5 + .../xlf/FSharp.Editor.zh-Hans.xlf | 5 + .../xlf/FSharp.Editor.zh-Hant.xlf | 5 + .../AdvancedOptionsControl.xaml | 30 ++++++ .../AdvancedOptionsControl.xaml.cs | 28 +++++ .../FSharp.UIResources.csproj | 4 +- .../FSharp.UIResources/Strings.Designer.cs | 36 +++++++ .../src/FSharp.UIResources/Strings.resx | 12 +++ .../src/FSharp.UIResources/xlf/Strings.cs.xlf | 20 ++++ .../src/FSharp.UIResources/xlf/Strings.de.xlf | 20 ++++ .../src/FSharp.UIResources/xlf/Strings.en.xlf | 20 ++++ .../src/FSharp.UIResources/xlf/Strings.es.xlf | 20 ++++ .../src/FSharp.UIResources/xlf/Strings.fr.xlf | 20 ++++ .../src/FSharp.UIResources/xlf/Strings.it.xlf | 20 ++++ .../src/FSharp.UIResources/xlf/Strings.ja.xlf | 20 ++++ .../src/FSharp.UIResources/xlf/Strings.ko.xlf | 20 ++++ .../src/FSharp.UIResources/xlf/Strings.pl.xlf | 20 ++++ .../FSharp.UIResources/xlf/Strings.pt-BR.xlf | 20 ++++ .../src/FSharp.UIResources/xlf/Strings.ru.xlf | 20 ++++ .../src/FSharp.UIResources/xlf/Strings.tr.xlf | 20 ++++ .../xlf/Strings.zh-Hans.xlf | 20 ++++ .../xlf/Strings.zh-Hant.xlf | 20 ++++ 38 files changed, 541 insertions(+), 57 deletions(-) create mode 100644 vsintegration/src/FSharp.UIResources/AdvancedOptionsControl.xaml create mode 100644 vsintegration/src/FSharp.UIResources/AdvancedOptionsControl.xaml.cs diff --git a/vsintegration/src/FSharp.Editor/Common/Constants.fs b/vsintegration/src/FSharp.Editor/Common/Constants.fs index c311a7fefc..ec876ff9d5 100644 --- a/vsintegration/src/FSharp.Editor/Common/Constants.fs +++ b/vsintegration/src/FSharp.Editor/Common/Constants.fs @@ -3,9 +3,6 @@ namespace Microsoft.VisualStudio.FSharp.Editor open System -open System.Configuration -open System.Diagnostics -open Microsoft.CodeAnalysis.Classification [] module internal FSharpConstants = @@ -49,7 +46,6 @@ module internal FSharpProviderConstants = /// "Session Capturing Quick Info Source Provider" let SessionCapturingProvider = "Session Capturing Quick Info Source Provider" - [] module internal Guids = @@ -73,4 +69,7 @@ module internal Guids = /// "8FDA964A-263D-4B4E-9560-29897535217C" let languageServicePerformanceOptionPageIdString = "8FDA964A-263D-4B4E-9560-29897535217C" + [] + let advancedSettingsPageIdSring = "9007718C-357A-4327-A193-AB3EC38D7EE8" + let blueHighContrastThemeId = Guid "{ce94d289-8481-498b-8ca9-9b6191a315b9}" diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.resx b/vsintegration/src/FSharp.Editor/FSharp.Editor.resx index 1414d45144..d812b3320d 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.resx +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.resx @@ -204,4 +204,7 @@ Rename '{0}' to '__' + + Advanced + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index 0524abc5b9..20bac47a9d 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -34,6 +34,7 @@ open Microsoft.VisualStudio.LanguageServices.ProjectSystem open Microsoft.VisualStudio.Shell open Microsoft.VisualStudio.Shell.Interop open Microsoft.VisualStudio.ComponentModelHost +open Microsoft.VisualStudio.Text.Outlining // Exposes FSharpChecker as MEF export [); Composition.Shared>] @@ -285,6 +286,7 @@ type [, "F#", null, "QuickInfo", "6009")>] [, "F#", null, "Code Fixes", "6010")>] [, "F#", null, "Performance", "6011")>] + [, "F#", null, "Advanced", "6012")>] [] [, strLanguageName = FSharpConstants.FSharpLanguageName, @@ -574,6 +576,12 @@ type let textViewAdapter = package.ComponentModel.GetService() + // Toggles outlining (or code folding) based on settings + let outliningManagerService = this.Package.ComponentModel.GetService() + let wpfTextView = this.EditorAdaptersFactoryService.GetWpfTextView(textView) + let outliningManager = outliningManagerService.GetOutliningManager(wpfTextView) + outliningManager.Enabled <- Settings.Advanced.IsOutliningEnabled + match textView.GetBuffer() with | (VSConstants.S_OK, textLines) -> let filename = VsTextLines.GetFilename textLines diff --git a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs index 387b808b71..8444a3c157 100644 --- a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs +++ b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs @@ -7,7 +7,6 @@ open Microsoft.VisualStudio.FSharp.UIResources open SettingsPersistence open OptionsUIHelpers - module DefaultTuning = let SemanticColorizationInitialDelay = 0 (* milliseconds *) let UnusedDeclarationsAnalyzerInitialDelay = 0 (* 1000 *) (* milliseconds *) @@ -42,6 +41,11 @@ type LanguageServicePerformanceOptions = { EnableInMemoryCrossProjectReferences: bool ProjectCheckCacheSize: int } +[] +type AdvancedOptions = + { IsBlockStructureEnabled: bool + IsOutliningEnabled: bool } + [)>] type internal Settings [](store: SettingsStore) = do // Initialize default settings @@ -67,12 +71,17 @@ type internal Settings [](store: SettingsStore) = { EnableInMemoryCrossProjectReferences = true ProjectCheckCacheSize = 200 } + store.RegisterDefault + { IsBlockStructureEnabled = true + IsOutliningEnabled = true } + interface ISettings static member IntelliSense : IntelliSenseOptions = getSettings() static member QuickInfo : QuickInfoOptions = getSettings() static member CodeFixes : CodeFixesOptions = getSettings() static member LanguageServicePerformance : LanguageServicePerformanceOptions = getSettings() + static member Advanced: AdvancedOptions = getSettings() module internal OptionsUI = @@ -106,4 +115,10 @@ module internal OptionsUI = type internal LanguageServicePerformanceOptionPage() = inherit AbstractOptionPage() override this.CreateView() = - upcast LanguageServicePerformanceOptionControl() \ No newline at end of file + upcast LanguageServicePerformanceOptionControl() + + [] + type internal AdvancedSettingsOptionPage() = + inherit AbstractOptionPage() + override __.CreateView() = + upcast AdvancedOptionsControl() \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/Structure/BlockStructureService.fs b/vsintegration/src/FSharp.Editor/Structure/BlockStructureService.fs index 865165665a..af5f570428 100644 --- a/vsintegration/src/FSharp.Editor/Structure/BlockStructureService.fs +++ b/vsintegration/src/FSharp.Editor/Structure/BlockStructureService.fs @@ -16,54 +16,57 @@ open Microsoft.FSharp.Compiler.SourceCodeServices open Microsoft.FSharp.Compiler.SourceCodeServices.Structure module internal BlockStructure = - let scopeToBlockType = function - | Scope.Open -> BlockTypes.Imports - | Scope.Namespace - | Scope.Module -> BlockTypes.Namespace - | Scope.Record - | Scope.Interface - | Scope.TypeExtension - | Scope.RecordDefn - | Scope.CompExpr - | Scope.ObjExpr - | Scope.UnionDefn - | Scope.Attribute - | Scope.Type -> BlockTypes.Type - | Scope.New - | Scope.RecordField - | Scope.Member -> BlockTypes.Member - | Scope.LetOrUse - | Scope.Match - | Scope.MatchClause - | Scope.EnumCase - | Scope.UnionCase - | Scope.MatchLambda - | Scope.ThenInIfThenElse - | Scope.ElseInIfThenElse - | Scope.TryWith - | Scope.TryInTryWith - | Scope.WithInTryWith - | Scope.TryFinally - | Scope.TryInTryFinally - | Scope.FinallyInTryFinally - | Scope.IfThenElse-> BlockTypes.Conditional - | Scope.Tuple - | Scope.ArrayOrList - | Scope.CompExprInternal - | Scope.Quote - | Scope.SpecialFunc - | Scope.Lambda - | Scope.LetOrUseBang - | Scope.Val - | Scope.YieldOrReturn - | Scope.YieldOrReturnBang - | Scope.TryWith -> BlockTypes.Expression - | Scope.Do -> BlockTypes.Statement - | Scope.While - | Scope.For -> BlockTypes.Loop - | Scope.HashDirective -> BlockTypes.PreprocessorRegion - | Scope.Comment - | Scope.XmlDocComment -> BlockTypes.Comment + let scopeToBlockType scope = + if not Settings.Advanced.IsBlockStructureEnabled then BlockTypes.Nonstructural + else + match scope with + | Scope.Open -> BlockTypes.Imports + | Scope.Namespace + | Scope.Module -> BlockTypes.Namespace + | Scope.Record + | Scope.Interface + | Scope.TypeExtension + | Scope.RecordDefn + | Scope.CompExpr + | Scope.ObjExpr + | Scope.UnionDefn + | Scope.Attribute + | Scope.Type -> BlockTypes.Type + | Scope.New + | Scope.RecordField + | Scope.Member -> BlockTypes.Member + | Scope.LetOrUse + | Scope.Match + | Scope.MatchClause + | Scope.EnumCase + | Scope.UnionCase + | Scope.MatchLambda + | Scope.ThenInIfThenElse + | Scope.ElseInIfThenElse + | Scope.TryWith + | Scope.TryInTryWith + | Scope.WithInTryWith + | Scope.TryFinally + | Scope.TryInTryFinally + | Scope.FinallyInTryFinally + | Scope.IfThenElse-> BlockTypes.Conditional + | Scope.Tuple + | Scope.ArrayOrList + | Scope.CompExprInternal + | Scope.Quote + | Scope.SpecialFunc + | Scope.Lambda + | Scope.LetOrUseBang + | Scope.Val + | Scope.YieldOrReturn + | Scope.YieldOrReturnBang + | Scope.TryWith -> BlockTypes.Expression + | Scope.Do -> BlockTypes.Statement + | Scope.While + | Scope.For -> BlockTypes.Loop + | Scope.HashDirective -> BlockTypes.PreprocessorRegion + | Scope.Comment + | Scope.XmlDocComment -> BlockTypes.Comment let isAutoCollapsible = function | Scope.New @@ -127,7 +130,7 @@ module internal BlockStructure = let hintSpan = RoslynHelpers.TryFSharpRangeToTextSpan(sourceText, scopeRange.Range) match textSpan,hintSpan with | Some textSpan, Some hintSpan -> - let line = sourceText.Lines.GetLineFromPosition textSpan.Start + let line = sourceText.Lines.GetLineFromPosition textSpan.Start let bannerText = match Option.ofNullable (line.Span.Intersection textSpan) with | Some span -> sourceText.GetSubText(span).ToString()+"..." diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf index 0ede4b2a9b..4dbb91dd9b 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf @@ -147,6 +147,11 @@ Přejmenujte {0} na __. + + Advanced + Advanced + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf index 17ff35108c..3ca7780738 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf @@ -147,6 +147,11 @@ "{0}" in "__" umbenennen + + Advanced + Advanced + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.en.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.en.xlf index 7697e44837..1b08ecb74b 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.en.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.en.xlf @@ -147,6 +147,11 @@ Rename '{0}' to '__' + + Advanced + Advanced + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf index ecdfcef71c..8525635235 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf @@ -147,6 +147,11 @@ Cambiar nombre de "{0}" por "__" + + Advanced + Advanced + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf index 69fad2ffa7..41681f342e 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf @@ -147,6 +147,11 @@ Renommer '{0}' en '__' + + Advanced + Advanced + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf index e64b7d154f..29050fd69f 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf @@ -147,6 +147,11 @@ Rinomina '{0}' in '__' + + Advanced + Advanced + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf index 483b00d09e..6c25156c90 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf @@ -147,6 +147,11 @@ '{0}' から '__' に名前を変更する + + Advanced + Advanced + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf index a37eda5d9b..bbcd41dd9c 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf @@ -147,6 +147,11 @@ '{0}'의 이름을 '__'로 바꾸기 + + Advanced + Advanced + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf index 073ec0b40f..b9ce76f219 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf @@ -147,6 +147,11 @@ Zmień nazwę z „{0}” na „__” + + Advanced + Advanced + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf index c960f62982..8647936b11 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf @@ -147,6 +147,11 @@ Renomear '{0}' para '__' + + Advanced + Advanced + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf index 2902161be1..b448661df8 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf @@ -147,6 +147,11 @@ Переименовать "{0}" в "__" + + Advanced + Advanced + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf index f35e52545c..dedf479929 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf @@ -147,6 +147,11 @@ '{0}' öğesini '__' olarak yeniden adlandırma + + Advanced + Advanced + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf index 83eb7bfb8c..a46a6866a4 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf @@ -147,6 +147,11 @@ 将“{0}”重命名为“__” + + Advanced + Advanced + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf index 4b772e2c82..e220491faa 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf @@ -147,6 +147,11 @@ 將 '{0}' 重新命名為 '__' + + Advanced + Advanced + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/AdvancedOptionsControl.xaml b/vsintegration/src/FSharp.UIResources/AdvancedOptionsControl.xaml new file mode 100644 index 0000000000..7126d6efb8 --- /dev/null +++ b/vsintegration/src/FSharp.UIResources/AdvancedOptionsControl.xaml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/vsintegration/src/FSharp.UIResources/AdvancedOptionsControl.xaml.cs b/vsintegration/src/FSharp.UIResources/AdvancedOptionsControl.xaml.cs new file mode 100644 index 0000000000..571e890521 --- /dev/null +++ b/vsintegration/src/FSharp.UIResources/AdvancedOptionsControl.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Microsoft.VisualStudio.FSharp.UIResources +{ + /// + /// Interaction logic for AdvancedOptionsControl.xaml + /// + public partial class AdvancedOptionsControl : UserControl + { + public AdvancedOptionsControl() + { + InitializeComponent(); + } + } +} diff --git a/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj b/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj index 3c59208883..c511d7e926 100644 --- a/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj +++ b/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj @@ -52,5 +52,5 @@ false - - + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/Strings.Designer.cs b/vsintegration/src/FSharp.UIResources/Strings.Designer.cs index 930363c3dd..75234c04d7 100644 --- a/vsintegration/src/FSharp.UIResources/Strings.Designer.cs +++ b/vsintegration/src/FSharp.UIResources/Strings.Designer.cs @@ -69,6 +69,15 @@ public static string Always_place_opens_at_top_level { } } + /// + /// Looks up a localized string similar to Block Structure Guides. + /// + public static string Block_Structure { + get { + return ResourceManager.GetString("Block_Structure", resourceCulture); + } + } + /// /// Looks up a localized string similar to Code Fixes. /// @@ -132,6 +141,15 @@ public static string Navigation_links { } } + /// + /// Looks up a localized string similar to Outlining. + /// + public static string Outlining { + get { + return ResourceManager.GetString("Outlining", resourceCulture); + } + } + /// /// Looks up a localized string similar to Project check cache size. /// @@ -168,6 +186,15 @@ public static string Show_completion_list_after_a_character_is_typed { } } + /// + /// Looks up a localized string similar to Show structure guidelines for F# code. + /// + public static string Show_guides { + get { + return ResourceManager.GetString("Show_guides", resourceCulture); + } + } + /// /// Looks up a localized string similar to S_how navigation links as. /// @@ -177,6 +204,15 @@ public static string Show_navigation_links_as { } } + /// + /// Looks up a localized string similar to Show outlining and collapsable nodes for F# code. + /// + public static string Show_Outlining { + get { + return ResourceManager.GetString("Show_Outlining", resourceCulture); + } + } + /// /// Looks up a localized string similar to Simplify names (remove unnecessary qualifiers). /// diff --git a/vsintegration/src/FSharp.UIResources/Strings.resx b/vsintegration/src/FSharp.UIResources/Strings.resx index 1e485e1734..ebe45bf732 100644 --- a/vsintegration/src/FSharp.UIResources/Strings.resx +++ b/vsintegration/src/FSharp.UIResources/Strings.resx @@ -168,4 +168,16 @@ Analyze and suggest fixes for unused values + + Block Structure Guides + + + Show structure guidelines for F# code + + + Outlining + + + Show outlining and collapsable nodes for F# code + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf index b5661fcf99..0ff8ba88f5 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf @@ -87,6 +87,26 @@ Analyzovat a navrhovat opravy pro nepoužité hodnoty + + Block Structure Guides + Block Structure Guides + + + + Show structure guidelines for F# code + Show structure guidelines for F# code + + + + Outlining + Outlining + + + + Show outlining and collapsable nodes for F# code + Show outlining and collapsable nodes for F# code + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf index 61b8644e76..a1a39ef28f 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf @@ -87,6 +87,26 @@ Korrekturen für nicht verwendete Werte analysieren und vorschlagen + + Block Structure Guides + Block Structure Guides + + + + Show structure guidelines for F# code + Show structure guidelines for F# code + + + + Outlining + Outlining + + + + Show outlining and collapsable nodes for F# code + Show outlining and collapsable nodes for F# code + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf index 8f182327ec..a9f0ba0ac1 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf @@ -87,6 +87,26 @@ Analyze and suggest fixes for unused values + + Block Structure Guides + Block Structure Guides + + + + Show structure guidelines for F# code + Show structure guidelines for F# code + + + + Outlining + Outlining + + + + Show outlining and collapsable nodes for F# code + Show outlining and collapsable nodes for F# code + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf index bbd423295e..2d1c825ffa 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf @@ -87,6 +87,26 @@ Analizar y sugerir correcciones para valores no utilizados + + Block Structure Guides + Block Structure Guides + + + + Show structure guidelines for F# code + Show structure guidelines for F# code + + + + Outlining + Outlining + + + + Show outlining and collapsable nodes for F# code + Show outlining and collapsable nodes for F# code + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf index 4a357f591c..ab96737ba5 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf @@ -87,6 +87,26 @@ Analyser et proposer des solutions pour les valeurs inutilisées + + Block Structure Guides + Block Structure Guides + + + + Show structure guidelines for F# code + Show structure guidelines for F# code + + + + Outlining + Outlining + + + + Show outlining and collapsable nodes for F# code + Show outlining and collapsable nodes for F# code + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf index 45dab1e9e7..76a71c8f91 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf @@ -87,6 +87,26 @@ Analizza e suggerisci correzioni per valori inutilizzati + + Block Structure Guides + Block Structure Guides + + + + Show structure guidelines for F# code + Show structure guidelines for F# code + + + + Outlining + Outlining + + + + Show outlining and collapsable nodes for F# code + Show outlining and collapsable nodes for F# code + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf index 4259f31f54..df5c9da7b3 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf @@ -87,6 +87,26 @@ 未使用の値を分析して修正を提案する + + Block Structure Guides + Block Structure Guides + + + + Show structure guidelines for F# code + Show structure guidelines for F# code + + + + Outlining + Outlining + + + + Show outlining and collapsable nodes for F# code + Show outlining and collapsable nodes for F# code + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf index 09880b8038..2dd3b97e0e 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf @@ -87,6 +87,26 @@ 사용되지 않는 값에 대해 수정 사항 분석 및 제안 + + Block Structure Guides + Block Structure Guides + + + + Show structure guidelines for F# code + Show structure guidelines for F# code + + + + Outlining + Outlining + + + + Show outlining and collapsable nodes for F# code + Show outlining and collapsable nodes for F# code + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf index 9789f982e9..44ceba824a 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf @@ -87,6 +87,26 @@ Analizuj nieużywane wartości i sugeruj dla nich poprawki + + Block Structure Guides + Block Structure Guides + + + + Show structure guidelines for F# code + Show structure guidelines for F# code + + + + Outlining + Outlining + + + + Show outlining and collapsable nodes for F# code + Show outlining and collapsable nodes for F# code + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf index 17c8963313..0b33aa390e 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf @@ -87,6 +87,26 @@ Analisar e sugerir correções de valores não usados + + Block Structure Guides + Block Structure Guides + + + + Show structure guidelines for F# code + Show structure guidelines for F# code + + + + Outlining + Outlining + + + + Show outlining and collapsable nodes for F# code + Show outlining and collapsable nodes for F# code + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf index af942d657d..3b63e1caa6 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf @@ -87,6 +87,26 @@ Проанализировать и предложить исправления для неиспользуемых значений + + Block Structure Guides + Block Structure Guides + + + + Show structure guidelines for F# code + Show structure guidelines for F# code + + + + Outlining + Outlining + + + + Show outlining and collapsable nodes for F# code + Show outlining and collapsable nodes for F# code + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf index 3edba18c3a..5eb169a55b 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf @@ -87,6 +87,26 @@ Kullanılmayan değerlere yönelik düzeltmeleri çözümle + + Block Structure Guides + Block Structure Guides + + + + Show structure guidelines for F# code + Show structure guidelines for F# code + + + + Outlining + Outlining + + + + Show outlining and collapsable nodes for F# code + Show outlining and collapsable nodes for F# code + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf index 29b9ae3f5f..1a47f8d75c 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf @@ -87,6 +87,26 @@ 分析未使用的值并建议相应的修补程序 + + Block Structure Guides + Block Structure Guides + + + + Show structure guidelines for F# code + Show structure guidelines for F# code + + + + Outlining + Outlining + + + + Show outlining and collapsable nodes for F# code + Show outlining and collapsable nodes for F# code + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf index 39042ef0d7..7fcb1a2d20 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf @@ -87,6 +87,26 @@ 分析未使用的值並建議修正 + + Block Structure Guides + Block Structure Guides + + + + Show structure guidelines for F# code + Show structure guidelines for F# code + + + + Outlining + Outlining + + + + Show outlining and collapsable nodes for F# code + Show outlining and collapsable nodes for F# code + + \ No newline at end of file From d49f3dda0a36513be725738114b70aa265c2cdfc Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 9 Mar 2018 21:53:23 +0000 Subject: [PATCH 078/147] fix cancellation for PostAndAsyncReply (#4477) * fix cancellation for PostAndAsyncReply * fix tests --- src/fsharp/FSharp.Core/control.fs | 146 +++++++++--------- .../Microsoft.FSharp.Control/Cancellation.fs | 2 + .../MailboxProcessorType.fs | 40 +++++ 3 files changed, 116 insertions(+), 72 deletions(-) diff --git a/src/fsharp/FSharp.Core/control.fs b/src/fsharp/FSharp.Core/control.fs index a42d43986c..6be535a316 100644 --- a/src/fsharp/FSharp.Core/control.fs +++ b/src/fsharp/FSharp.Core/control.fs @@ -329,21 +329,13 @@ namespace Microsoft.FSharp.Control - // Reify exceptional results as exceptions + /// Reify exceptional results as exceptions let commit res = match res with | Ok res -> res | Error edi -> edi.ThrowAny() | Canceled exn -> raise exn - // Reify exceptional results as exceptionsJIT 64 doesn't always take tailcalls correctly - - let commitWithPossibleTimeout res = - match res with - | None -> raise (System.TimeoutException()) - | Some res -> commit res - - //---------------------------------- // PRIMITIVE ASYNC INVOCATION @@ -713,11 +705,15 @@ namespace Microsoft.FSharp.Control [] type ResultCell<'T>() = let mutable result = None + // The continuations for the result let mutable savedConts : list> = [] + // The WaitHandle event for the result. Only created if needed, and set to null when disposed. let mutable resEvent = null + let mutable disposed = false + // All writers of result are protected by lock on syncRoot. let syncRoot = new Object() @@ -752,13 +748,11 @@ namespace Microsoft.FSharp.Control interface IDisposable with member x.Dispose() = x.Close() // ; System.GC.SuppressFinalize(x) - member x.GrabResult() = match result with | Some res -> res | None -> failwith "Unexpected no result" - /// Record the result in the ResultCell. member x.RegisterResult (res:'T, reuseThread) = let grabbedConts = @@ -795,7 +789,10 @@ namespace Microsoft.FSharp.Control member x.ResultAvailable = result.IsSome - member x.AwaitResult = + /// Await the result of a result cell, without a direct timeout or direct + /// cancellation. That is, the underlying computation must fill the result + /// if cancellation or timeout occurs. + member x.AwaitResult_NoDirectCancelOrTimeout = unprotectedPrimitive(fun args -> // Check if a result is available synchronously let resOpt = @@ -860,10 +857,10 @@ namespace Microsoft.FSharp.Control // If timeout is provided, we govern the async by our own CTS, to cancel // when execution times out. Otherwise, the user-supplied token governs the async. match timeout with - | None -> token,None - | Some _ -> - let subSource = new LinkedSubSource(token) - subSource.Token, Some subSource + | None -> token, None + | Some _ -> + let subSource = new LinkedSubSource(token) + subSource.Token, Some subSource use resultCell = new ResultCell>() queueAsync @@ -1252,7 +1249,8 @@ namespace Microsoft.FSharp.Control aux.econt edi ) - static member AwaitWaitHandle(waitHandle:WaitHandle,?millisecondsTimeout:int) = + /// Wait for a wait handle. Both timeout and cancellation are supported + static member AwaitWaitHandle(waitHandle: WaitHandle, ?millisecondsTimeout:int) = let millisecondsTimeout = defaultArg millisecondsTimeout Threading.Timeout.Infinite if millisecondsTimeout = 0 then async.Delay(fun () -> @@ -1312,61 +1310,61 @@ namespace Microsoft.FSharp.Control return! Async.AwaitWaitHandle(iar.AsyncWaitHandle, ?millisecondsTimeout=millisecondsTimeout) } - /// Await the result of a result cell without a timeout - static member ReifyResult(result:AsyncImplResult<'T>) : Async<'T> = + /// Bind the result of a result cell, calling the appropriate continuation. + static member BindResult(result: AsyncImplResult<'T>) : Async<'T> = unprotectedPrimitive(fun ({ aux = aux } as args) -> (match result with | Ok v -> args.cont v | Error exn -> aux.econt exn | Canceled exn -> aux.ccont exn) ) - /// Await the result of a result cell without a timeout - static member AwaitAndReifyResult(resultCell:ResultCell>) : Async<'T> = + /// Await and use the result of a result cell. The resulting async doesn't support cancellation + /// or timeout directly, rather the underlying computation must fill the result if cancellation + /// or timeout occurs. + static member AwaitAndBindResult_NoDirectCancelOrTimeout(resultCell: ResultCell>) : Async<'T> = async { - let! result = resultCell.AwaitResult - return! Async.ReifyResult(result) + let! result = resultCell.AwaitResult_NoDirectCancelOrTimeout + return! Async.BindResult(result) } - - - /// Await the result of a result cell without a timeout - /// - /// Always resyncs to the synchronization context if needed, by virtue of it being built - /// from primitives which resync. - static member AsyncWaitAsyncWithTimeout(innerCTS : CancellationTokenSource, resultCell:ResultCell>,millisecondsTimeout) : Async<'T> = + /// Await the result of a result cell belonging to a child computation. The resulting async supports timeout and if + /// it happens the child computation will be cancelled. The resulting async doesn't support cancellation + /// directly, rather the underlying computation must fill the result if cancellation occurs. + static member AwaitAndBindChildResult(innerCTS: CancellationTokenSource, resultCell: ResultCell>, millisecondsTimeout) : Async<'T> = match millisecondsTimeout with | None | Some -1 -> - resultCell |> Async.AwaitAndReifyResult + resultCell |> Async.AwaitAndBindResult_NoDirectCancelOrTimeout | Some 0 -> async { if resultCell.ResultAvailable then return commit (resultCell.GrabResult()) else - return commitWithPossibleTimeout None } + return raise (System.TimeoutException()) } | _ -> async { try if resultCell.ResultAvailable then return commit (resultCell.GrabResult()) else - let! ok = Async.AwaitWaitHandle (resultCell.GetWaitHandle(),?millisecondsTimeout=millisecondsTimeout) + let! ok = Async.AwaitWaitHandle (resultCell.GetWaitHandle(), ?millisecondsTimeout=millisecondsTimeout) if ok then - return commitWithPossibleTimeout (Some (resultCell.GrabResult())) + return commit (resultCell.GrabResult()) else // timed out // issue cancellation signal innerCTS.Cancel() // wait for computation to quiesce let! _ = Async.AwaitWaitHandle (resultCell.GetWaitHandle()) - return commitWithPossibleTimeout None + return raise (System.TimeoutException()) finally resultCell.Close() } - static member FromBeginEnd(beginAction,endAction,?cancelAction): Async<'T> = + static member FromBeginEnd(beginAction, endAction, ?cancelAction): Async<'T> = async { let! cancellationToken = getCancellationToken() let resultCell = new ResultCell<_>() let once = Once() let registration : CancellationTokenRegistration = + let onCancel (_:obj) = // Call the cancellation routine match cancelAction with @@ -1381,7 +1379,9 @@ namespace Microsoft.FSharp.Control // If we get an exception from a cooperative cancellation function // we assume the operation has already completed. try cancel() with _ -> () + cancellationToken.Register(Action(onCancel), null) + let callback = new System.AsyncCallback(fun iar -> if not iar.CompletedSynchronously then @@ -1405,15 +1405,15 @@ namespace Microsoft.FSharp.Control // ResultCell allows a race and throws away whichever comes last. resultCell.RegisterResult(res,reuseThread=true) |> unfake else ()) - - let (iar:IAsyncResult) = beginAction (callback,(null:obj)) if iar.CompletedSynchronously then registration.Dispose() return endAction iar else - return! Async.AwaitAndReifyResult(resultCell) } + // Note: ok to use "NoDirectCancel" here because cancellation has been registered above + // Note: ok to use "NoDirectTimeout" here because no timeout parameter to this method + return! Async.AwaitAndBindResult_NoDirectCancelOrTimeout(resultCell) } static member FromBeginEnd(arg,beginAction,endAction,?cancelAction): Async<'T> = @@ -1567,7 +1567,9 @@ namespace Microsoft.FSharp.Control event.AddHandler(del) // Return the async computation that allows us to await the result - return! Async.AwaitAndReifyResult(resultCell) } + // Note: ok to use "NoDirectCancel" here because cancellation has been registered above + // Note: ok to use "NoDirectTimeout" here because no timeout parameter to this method + return! Async.AwaitAndBindResult_NoDirectCancelOrTimeout(resultCell) } type Async with static member Ignore (computation: Async<'T>) = bindA computation (fun _ -> doneA) @@ -1597,7 +1599,7 @@ namespace Microsoft.FSharp.Control computation |> unfake - return Async.AsyncWaitAsyncWithTimeout(innerCTS, resultCell,millisecondsTimeout) } + return Async.AwaitAndBindChildResult(innerCTS, resultCell, millisecondsTimeout) } static member SwitchToContext syncContext = async { match syncContext with @@ -1681,10 +1683,6 @@ namespace Microsoft.FSharp.Control Async.FromBeginEnd (buffer,offset,count,stream.BeginWrite,stream.EndWrite) #endif - type System.Threading.WaitHandle with - member waitHandle.AsyncWaitOne(?millisecondsTimeout:int) = // only used internally, not a public API - Async.AwaitWaitHandle(waitHandle,?millisecondsTimeout=millisecondsTimeout) - type IObservable<'Args> with [] // give the extension member a 'nice', unmangled compiled name, unique within this module @@ -1715,7 +1713,7 @@ namespace Microsoft.FSharp.Control | :? System.Net.WebException as webExn when webExn.Status = System.Net.WebExceptionStatus.RequestCanceled && !canceled -> - Async.ReifyResult(AsyncImplResult.Canceled (OperationCanceledException webExn.Message)) + Async.BindResult(AsyncImplResult.Canceled (OperationCanceledException webExn.Message)) | _ -> edi.ThrowAny()) @@ -1791,7 +1789,10 @@ namespace Microsoft.FSharp.Control ) start a1 Choice1Of2 start a2 Choice2Of2 - let! result = c.AwaitResult + // Note: It is ok to use "NoDirectCancel" here because the started computations use the same + // cancellation token and will register a cancelled result if cancellation occurs. + // Note: It is ok to use "NoDirectTimeout" here because there is no specific timeout log to this routine. + let! result = c.AwaitResult_NoDirectCancelOrTimeout return! reify result } let timeout msec cancellationToken = @@ -1805,7 +1806,10 @@ namespace Microsoft.FSharp.Control exceptionContinuation=ignore, cancellationContinuation=ignore, cancellationToken = cancellationToken) - c.AwaitResult + // Note: It is ok to use "NoDirectCancel" here because the started computations use the same + // cancellation token and will register a cancelled result if cancellation occurs. + // Note: It is ok to use "NoDirectTimeout" here because the child compuation above looks after the timeout. + c.AwaitResult_NoDirectCancelOrTimeout [] [] @@ -1854,7 +1858,7 @@ namespace Microsoft.FSharp.Control failwith "multiple waiting reader continuations for mailbox") let waitOneWithCancellation(timeout) = - ensurePulse().AsyncWaitOne(millisecondsTimeout=timeout) + Async.AwaitWaitHandle(ensurePulse(), millisecondsTimeout=timeout) let waitOne(timeout) = if timeout < 0 && not cancellationSupported then @@ -2125,36 +2129,34 @@ namespace Microsoft.FSharp.Control let msg = buildMessage (new AsyncReplyChannel<_>(fun reply -> // Note the ResultCell may have been disposed if the operation // timed out. In this case RegisterResult drops the result on the floor. - resultCell.RegisterResult(reply,reuseThread=false) |> unfake)) + resultCell.RegisterResult(reply, reuseThread=false) |> unfake)) mailbox.Post(msg) match timeout with - | Threading.Timeout.Infinite -> - async { let! result = resultCell.AwaitResult - return Some(result) - } + | Threading.Timeout.Infinite when not cancellationSupported -> + async { let! result = resultCell.AwaitResult_NoDirectCancelOrTimeout + return Some result } - | _ -> - async { use _disposeCell = resultCell - let! ok = resultCell.GetWaitHandle().AsyncWaitOne(millisecondsTimeout=timeout) - let res = (if ok then Some(resultCell.GrabResult()) else None) - return res } + | _ -> + async { use _disposeCell = resultCell + let! ok = Async.AwaitWaitHandle(resultCell.GetWaitHandle(), millisecondsTimeout=timeout) + let res = (if ok then Some(resultCell.GrabResult()) else None) + return res } member x.PostAndAsyncReply(buildMessage, ?timeout:int) = let timeout = defaultArg timeout defaultTimeout match timeout with - | Threading.Timeout.Infinite -> - // Nothing to dispose, no wait handles used - let resultCell = new ResultCell<_>() - let msg = buildMessage (new AsyncReplyChannel<_>(fun reply -> resultCell.RegisterResult(reply,reuseThread=false) |> unfake)) - mailbox.Post(msg) - resultCell.AwaitResult - | _ -> - let asyncReply = x.PostAndTryAsyncReply(buildMessage,timeout=timeout) - async { let! res = asyncReply - match res with - | None -> return! raise (TimeoutException(SR.GetString(SR.mailboxProcessorPostAndAsyncReplyTimedOut))) - | Some res -> return res - } + | Threading.Timeout.Infinite when not cancellationSupported -> + // Nothing to dispose, no wait handles used + let resultCell = new ResultCell<_>() + let msg = buildMessage (new AsyncReplyChannel<_>(fun reply -> resultCell.RegisterResult(reply,reuseThread=false) |> unfake)) + mailbox.Post(msg) + resultCell.AwaitResult_NoDirectCancelOrTimeout + | _ -> + let asyncReply = x.PostAndTryAsyncReply(buildMessage,timeout=timeout) + async { let! res = asyncReply + match res with + | None -> return! raise (TimeoutException(SR.GetString(SR.mailboxProcessorPostAndAsyncReplyTimedOut))) + | Some res -> return res } member x.Receive(?timeout) = mailbox.Receive(timeout=defaultArg timeout defaultTimeout) member x.TryReceive(?timeout) = mailbox.TryReceive(timeout=defaultArg timeout defaultTimeout) diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/Cancellation.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/Cancellation.fs index 54720b29d7..47f241f246 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/Cancellation.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/Cancellation.fs @@ -306,3 +306,5 @@ type CancellationType() = Assert.IsFalse((r1a <> r1a')) Assert.IsTrue((r1a <> r1b)) Assert.IsTrue((r1a <> r2)) + + diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/MailboxProcessorType.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/MailboxProcessorType.fs index 74b0abaf29..de56a4b145 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/MailboxProcessorType.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control/MailboxProcessorType.fs @@ -292,3 +292,43 @@ type MailboxProcessorType() = test() + [] + member this.PostAndAsyncReply_Cancellation() = + + use cancel = new CancellationTokenSource(500) + let mutable gotGood = false + let mutable gotBad = false + + let goodAsync = async { + try + for i in Seq.initInfinite (fun i -> i) do + if i % 10000000 = 0 then + printfn "good async working..." + finally + printfn "good async exited - that's what we want" + gotGood <- true + } + + let badAsync (mbox:MailboxProcessor>) = async { + try + printfn "bad async working..." + let! result = mbox.PostAndAsyncReply id // <- got stuck in here forever + printfn "%d" result + finally + printfn "bad async exited - that's what we want" // <- we never got here + gotBad <- true + } + + let mbox = MailboxProcessor.Start(fun inbox -> async { + let! (reply : AsyncReplyChannel) = inbox.Receive() + do! Async.Sleep 1000000 + reply.Reply (200) + }, cancel.Token) + + [goodAsync; badAsync mbox] + |> Async.Parallel + |> Async.Ignore + |> fun x -> Async.Start(x, cancel.Token) + System.Threading.Thread.Sleep(1000) // cancellation after 500 + if not gotGood || not gotBad then + failwith "Exected both good and bad async's to be cancelled afteMailbox should not fail!" From f5992a7cd2519828f246bccccfc23bbbc3964ce1 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Thu, 8 Mar 2018 10:24:00 -0800 Subject: [PATCH 079/147] consolidate Newtonsoft.Json version to match what's shipped in VS --- build/targets/PackageVersions.props | 2 +- packages.config | 2 +- .../testenv/src/AssemblyVersionCheck/AssemblyVersionCheck.fsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/targets/PackageVersions.props b/build/targets/PackageVersions.props index 0ba3d7fcf2..889b7a8000 100644 --- a/build/targets/PackageVersions.props +++ b/build/targets/PackageVersions.props @@ -50,7 +50,7 @@ 1.0.30 8.0.0-alpha 1.0.1 - 10.0.2 + 9.0.1 3.5.0 0.2.0-beta-000081 diff --git a/packages.config b/packages.config index ed756fd43a..dc6205ef46 100644 --- a/packages.config +++ b/packages.config @@ -34,7 +34,7 @@ - + diff --git a/tests/fsharpqa/testenv/src/AssemblyVersionCheck/AssemblyVersionCheck.fsx b/tests/fsharpqa/testenv/src/AssemblyVersionCheck/AssemblyVersionCheck.fsx index 17621946c5..8554c7b46d 100644 --- a/tests/fsharpqa/testenv/src/AssemblyVersionCheck/AssemblyVersionCheck.fsx +++ b/tests/fsharpqa/testenv/src/AssemblyVersionCheck/AssemblyVersionCheck.fsx @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. // this was restored by packages.config in the root -#r @"..\..\..\..\..\packages\Newtonsoft.Json.8.0.1\lib\net45\Newtonsoft.Json.dll" +#r @"..\..\..\..\..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll" open System open System.Diagnostics From 3fb44a4bb3371c478e58254c490e841b305d1013 Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Fri, 9 Mar 2018 15:54:01 -0800 Subject: [PATCH 080/147] Remove dependency on FSharp.LanguageService from FSharp.ProjectSystem (#4385) * Remove dependency on FSharp.LanguageService from FSharp.ProjectSystem * Fix bad merge --- .../Project/UIThread.cs | 232 ++++++++++++++++++ .../ProjectSystem.fsproj | 1 - 2 files changed, 232 insertions(+), 1 deletion(-) create mode 100644 vsintegration/src/FSharp.ProjectSystem.Base/Project/UIThread.cs diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/UIThread.cs b/vsintegration/src/FSharp.ProjectSystem.Base/Project/UIThread.cs new file mode 100644 index 0000000000..1a0bb06e4e --- /dev/null +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/UIThread.cs @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +using System; +using System.Runtime.InteropServices; +using System.Xml; +using System.Collections; +using System.Collections.Generic; +using System.Threading; +using System.IO; +using System.Text; +using System.Drawing; +using System.Windows.Forms; +using System.Diagnostics; +using Microsoft.VisualStudio.Shell.Interop; +using Microsoft.VisualStudio.OLE.Interop; +using Microsoft.VisualStudio.TextManager.Interop; +using Microsoft.VisualStudio.Threading; +using Microsoft.VisualStudio.Shell; +using IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider; +using IServiceProvider = System.IServiceProvider; +using VsShell = Microsoft.VisualStudio.Shell.VsShellUtilities; +using System.Diagnostics.CodeAnalysis; + +namespace Microsoft.VisualStudio.FSharp.LanguageService +{ + internal static class UIThread + { + static SynchronizationContext ctxt; + static bool isUnitTestingMode = false; +#if DEBUG + static StackTrace captureStackTrace; // stack trace when ctxt was captured + static Thread uithread; +#endif + public static SynchronizationContext TheSynchronizationContext + { + get + { + Debug.Assert(ctxt != null, "Tried to get TheSynchronizationContext before it was captured"); + return ctxt; + } + } + + public static void InitUnitTestingMode() + { + Debug.Assert(ctxt == null, "Context has already been captured; too late to InitUnitTestingMode"); + isUnitTestingMode = true; + } + + [Conditional("DEBUG")] + public static void MustBeCalledFromUIThread() + { +#if DEBUG + Debug.Assert(uithread == System.Threading.Thread.CurrentThread || isUnitTestingMode, "This must be called from the GUI thread"); +#endif + } + public static void CaptureSynchronizationContext() + { + if (isUnitTestingMode) return; +#if DEBUG + uithread = System.Threading.Thread.CurrentThread; +#endif + + if (ctxt == null) + { +#if DEBUG + // This is a handy place to do this, since the product and all interesting unit tests + // must go through this code path. + AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(delegate (object sender, UnhandledExceptionEventArgs args) + { + if (args.IsTerminating) + { + string s = String.Format("An unhandled exception is about to terminate the process. Exception info:\n{0}", args.ExceptionObject.ToString()); + Debug.Assert(false, s); + } + }); + captureStackTrace = new StackTrace(true); +#endif + ctxt = new WindowsFormsSynchronizationContext(); + } + else + { +#if DEBUG + // Make sure we are always capturing the same thread. + Debug.Assert(uithread == Thread.CurrentThread); +#endif + } + } + private static readonly Queue ourUIQueue = new Queue(); + private static bool ourIsReentrancy; + + // Runs the action on UI thread. Prevents from reentracy. + public static void Run(Action action) + { + if (isUnitTestingMode) + { + action(); + return; + } + Debug.Assert(ctxt != null, "The SynchronizationContext must be captured before calling this method"); +#if DEBUG + StackTrace stackTrace = new StackTrace(true); +#endif + ctxt.Post(delegate (object ignore) + { + UIThread.MustBeCalledFromUIThread(); + ourUIQueue.Enqueue(action); + if (ourIsReentrancy) return; + ourIsReentrancy = true; + try + { + while (ourUIQueue.Count > 0) + { + try + { + var a = ourUIQueue.Dequeue(); + a(); + } +#if DEBUG + catch (Exception e) + { + // swallow, random exceptions should not kill process + Debug.Assert(false, string.Format("UIThread.Run caught and swallowed exception: {0}\n\noriginally invoked from stack:\n{1}", e.ToString(), stackTrace.ToString())); + } +#else + catch (Exception) { + // swallow, random exceptions should not kill process + } +#endif + + } + } + finally + { + ourIsReentrancy = false; + } + }, null); + + } + + /// + /// RunSync puts orignal exception stacktrace to Exception.Data by this key if action throws on UI thread + /// + /// WrappedStacktraceKey is a string to keep exception serializable. + public static readonly string WrappedStacktraceKey = "$$Microsoft.VisualStudio.Package.UIThread.WrappedStacktraceKey$$"; + + public static void RunSync(Action a) + { + if (isUnitTestingMode) + { + a(); + return; + } + Exception exn = null; + Debug.Assert(ctxt != null, "The SynchronizationContext must be captured before calling this method"); + // Send on UI thread will execute immediately. + ctxt.Send(ignore => + { + try + { + UIThread.MustBeCalledFromUIThread(); + a(); + } + catch (Exception e) + { + exn = e; + } + }, null + ); + if (exn != null) + { + // throw exception on calling thread, preserve stacktrace + if (!exn.Data.Contains(WrappedStacktraceKey)) exn.Data[WrappedStacktraceKey] = exn.StackTrace; + throw exn; + } + } + + /// + /// Local JoinableTaskContext + /// ensuring non-reentrancy. + /// + private static JoinableTaskContext jtc = null; + private static JoinableTaskFactory JTF + { + get + { + if (jtc == null) + { + JoinableTaskContext j = null; + if (VsTaskLibraryHelper.ServiceInstance == null) + { + j = new JoinableTaskContext(); + } + else + { + j = ThreadHelper.JoinableTaskContext; + } + Interlocked.CompareExchange(ref jtc, j, null); + } + + return jtc.Factory; + } + } + + /// + /// Performs a callback on the UI thread and blocks until it is done, using the VS mechanism for + /// ensuring non-reentrancy. + /// + [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] + internal static T DoOnUIThread(Func callback) + { + return JTF.Run(async delegate + { + await JTF.SwitchToMainThreadAsync(); + return callback(); + }); + } + + /// + /// Performs a callback on the UI thread and blocks until it is done, using the VS mechanism for + /// ensuring non-reentrancy. + /// + [SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] + internal static void DoOnUIThread(Action callback) + { + JTF.Run(async delegate + { + await JTF.SwitchToMainThreadAsync(); + callback(); + }); + } + } +} \ No newline at end of file diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj b/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj index ec2d565f29..e1395974b5 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj @@ -40,7 +40,6 @@ - From d7274c6c2aed7762c880a584de01a8b40c01208c Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Sat, 10 Mar 2018 14:12:26 +0100 Subject: [PATCH 081/147] Clean up illib (#4428) * clean option module in illib * Update NicePrint.fs * Update NicePrint.fs * Update NicePrint.fs * Update NicePrint.fs * Update NicePrint.fs --- src/absil/illib.fs | 61 +++++++-------------------------------- src/fsharp/NicePrint.fs | 16 +++++----- src/fsharp/TastOps.fs | 2 +- src/fsharp/TypeChecker.fs | 2 +- src/fsharp/ast.fs | 2 +- 5 files changed, 22 insertions(+), 61 deletions(-) diff --git a/src/absil/illib.fs b/src/absil/illib.fs index a19497e8c5..2e97b0ab88 100644 --- a/src/absil/illib.fs +++ b/src/absil/illib.fs @@ -37,14 +37,14 @@ let inline isSingleton l = let inline isNonNull x = not (isNull x) let inline nonNull msg x = if isNull x then failwith ("null: " ^ msg) else x -let (===) x y = LanguagePrimitives.PhysicalEquality x y +let inline (===) x y = LanguagePrimitives.PhysicalEquality x y //--------------------------------------------------------------------- // Library: ReportTime //--------------------------------------------------------------------- let reportTime = - let tFirst = ref None - let tPrev = ref None + let tFirst = ref None + let tPrev = ref None fun showTimes descr -> if showTimes then let t = System.Diagnostics.Process.GetCurrentProcess().UserProcessorTime.TotalSeconds @@ -237,36 +237,12 @@ module Option = let mapFold f s opt = match opt with | None -> None,s - | Some x -> let x',s' = f s x in Some x',s' - - let otherwise opt dflt = - match opt with - | None -> dflt - | Some x -> x - - let fold f z x = - match x with - | None -> z - | Some x -> f z x - - let attempt (f: unit -> 'T) = try Some (f()) with _ -> None - - - let orElseWith f opt = - match opt with - | None -> f() - | x -> x - - let orElse v opt = - match opt with - | None -> v - | x -> x - - let defaultValue v opt = - match opt with - | None -> v - | Some x -> x + | Some x -> + let x',s' = f s x + Some x',s' + let attempt (f: unit -> 'T) = try Some (f()) with _ -> None + module List = //let item n xs = List.nth xs n @@ -442,9 +418,6 @@ module List = | x::xs -> if i=n then f x::xs else x::mn (i+1) xs mn 0 xs - - let rec until p l = match l with [] -> [] | h::t -> if p h then [] else h :: until p t - let count pred xs = List.fold (fun n x -> if pred x then n+1 else n) 0 xs // WARNING: not tail-recursive @@ -521,23 +494,9 @@ module String = if s.Length = 0 then s else lowercase s.[0..0] + s.[ 1.. s.Length - 1 ] + let dropPrefix (s:string) (t:string) = s.[t.Length..s.Length - 1] - let tryDropPrefix (s:string) (t:string) = - if s.StartsWith t then - Some s.[t.Length..s.Length - 1] - else - None - - let tryDropSuffix (s:string) (t:string) = - if s.EndsWith t then - Some s.[0..s.Length - t.Length - 1] - else - None - - let hasPrefix s t = Option.isSome (tryDropPrefix s t) - let dropPrefix s t = match (tryDropPrefix s t) with Some(res) -> res | None -> failwith "dropPrefix" - - let dropSuffix s t = match (tryDropSuffix s t) with Some(res) -> res | None -> failwith "dropSuffix" + let dropSuffix (s:string) (t:string) = s.[0..s.Length - t.Length - 1] open System open System.IO diff --git a/src/fsharp/NicePrint.fs b/src/fsharp/NicePrint.fs index 519cca8f3f..d311665060 100755 --- a/src/fsharp/NicePrint.fs +++ b/src/fsharp/NicePrint.fs @@ -71,9 +71,10 @@ module internal PrintUtilities = tcref.DisplayName // has no static params else tcref.DisplayName+"<...>" // shorten - if isAttribute then - defaultArg (String.tryDropSuffix name "Attribute") name - else name + if isAttribute && name.EndsWith "Attribute" then + String.dropSuffix name "Attribute" + else + name let tyconTextL = tagEntityRefName tcref demangled |> mkNav tcref.DefinitionRange @@ -654,9 +655,10 @@ module private PrintTypes = | ILAttrib ilMethRef -> let trimmedName = let name = ilMethRef.DeclaringTypeRef.Name - match String.tryDropSuffix name "Attribute" with - | Some shortName -> shortName - | None -> name + if name.EndsWith "Attribute" then + String.dropSuffix name "Attribute" + else + name let tref = ilMethRef.DeclaringTypeRef let tref = ILTypeRef.Create(scope= tref.Scope, enclosing=tref.Enclosing, name=trimmedName) PrintIL.layoutILTypeRef denv tref ++ argsL @@ -1275,7 +1277,7 @@ module InfoMemberPrinting = let paramDatas = minfo.GetParamDatas(amap, m, minst) let layout = layout ^^ - if isNil (List.concat paramDatas) then + if List.forall isNil paramDatas then WordL.structUnit else sepListL WordL.arrow (List.map ((List.map (layoutParamData denv)) >> sepListL WordL.star) paramDatas) diff --git a/src/fsharp/TastOps.fs b/src/fsharp/TastOps.fs index 6500430ed2..a5f59868f5 100644 --- a/src/fsharp/TastOps.fs +++ b/src/fsharp/TastOps.fs @@ -1451,7 +1451,7 @@ let tryDestRefTupleTy g ty = type UncurriedArgInfos = (TType * ArgReprInfo) list type CurriedArgInfos = (TType * ArgReprInfo) list list -// A 'tau' type is one with its type paramaeters stripped off +// A 'tau' type is one with its type parameters stripped off let GetTopTauTypeInFSharpForm g (curriedArgInfos: ArgReprInfo list list) tau m = let nArgInfos = curriedArgInfos.Length let argtys, rty = stripFunTyN g nArgInfos tau diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index 65ab9aeb9b..6aa5ffa64a 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -5112,7 +5112,7 @@ and TcPatBindingName cenv env id ty isMemberThis vis1 topValData (inlineFlag, de // isLeftMost indicates we are processing the left-most path through a disjunctive or pattern. // For those binding locations, CallNameResolutionSink is called in MakeAndPublishValue, like all other bindings // For non-left-most paths, we register the name resolutions here - if not isLeftMost && not vspec.IsCompilerGenerated && not (String.hasPrefix vspec.LogicalName "_") then + if not isLeftMost && not vspec.IsCompilerGenerated && not (vspec.LogicalName.StartsWith "_") then let item = Item.Value(mkLocalValRef vspec) CallNameResolutionSink cenv.tcSink (id.idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Binding, env.DisplayEnv, env.eAccessRights) diff --git a/src/fsharp/ast.fs b/src/fsharp/ast.fs index 2444a699a8..1963b00ed3 100644 --- a/src/fsharp/ast.fs +++ b/src/fsharp/ast.fs @@ -100,7 +100,7 @@ type XmlDoc = | (lineA::rest) as lines -> let lineAT = lineA.TrimStart([|' '|]) if lineAT = "" then processLines rest - else if String.hasPrefix lineAT "<" then lines + else if lineAT.StartsWith "<" then lines else [""] @ (lines |> List.map (fun line -> Microsoft.FSharp.Core.XmlAdapters.escape(line))) @ [""] From 81aef70e578980693c08eb73d899fe84f07313c2 Mon Sep 17 00:00:00 2001 From: Avi Avni Date: Sun, 11 Mar 2018 13:50:20 +0200 Subject: [PATCH 082/147] add regression test --- tests/fsharp/regression/literal-value-bug-1/test.fs | 6 ++++++ tests/fsharp/tests.fs | 3 +++ 2 files changed, 9 insertions(+) create mode 100644 tests/fsharp/regression/literal-value-bug-1/test.fs diff --git a/tests/fsharp/regression/literal-value-bug-1/test.fs b/tests/fsharp/regression/literal-value-bug-1/test.fs new file mode 100644 index 0000000000..cca0b9e0e2 --- /dev/null +++ b/tests/fsharp/regression/literal-value-bug-1/test.fs @@ -0,0 +1,6 @@ +[] +let x = 7 + +[] +let main argv = + 0 \ No newline at end of file diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 3c2d9c2d79..5b5b7d2c3b 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -1456,6 +1456,9 @@ module ToolsTests = module RegressionTests = + + [] + let ``literal-value-bug-1-FSC_BASIC`` () = singleTestBuildAndRun "regression/literal-value-bug-1" FSC_BASIC [] let ``struct-tuple-bug-1-FSC_BASIC`` () = singleTestBuildAndRun "regression/struct-tuple-bug-1" FSC_BASIC From 9637b3785e9a4fd6f75af031dfbaadbbfdc551a4 Mon Sep 17 00:00:00 2001 From: Avi Avni Date: Sun, 11 Mar 2018 15:42:10 +0200 Subject: [PATCH 083/147] fix test --- tests/fsharp/tests.fs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 5b5b7d2c3b..60289acdd5 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -1458,7 +1458,12 @@ module ToolsTests = module RegressionTests = [] - let ``literal-value-bug-1-FSC_BASIC`` () = singleTestBuildAndRun "regression/literal-value-bug-1" FSC_BASIC + let ``literal-value-bug-1-FSC_BASIC`` () = + let cfg = testConfig "regression/literal-value-bug-1" + + fsc cfg "%s --optimize- -o:test.exe -g" cfg.fsc_flags ["test.fs"] + + peverify cfg "test.exe" [] let ``struct-tuple-bug-1-FSC_BASIC`` () = singleTestBuildAndRun "regression/struct-tuple-bug-1" FSC_BASIC From c2cb706a24a3c1caaede2c865a402635c32aacb3 Mon Sep 17 00:00:00 2001 From: Avi Avni Date: Sun, 11 Mar 2018 21:48:09 +0200 Subject: [PATCH 084/147] add il compare --- .../literal-value-bug-1/test.il.bsl | 76 +++++++++++++++++++ tests/fsharp/tests.fs | 12 +++ 2 files changed, 88 insertions(+) create mode 100644 tests/fsharp/regression/literal-value-bug-1/test.il.bsl diff --git a/tests/fsharp/regression/literal-value-bug-1/test.il.bsl b/tests/fsharp/regression/literal-value-bug-1/test.il.bsl new file mode 100644 index 0000000000..1aed785ba3 --- /dev/null +++ b/tests/fsharp/regression/literal-value-bug-1/test.il.bsl @@ -0,0 +1,76 @@ + +// Microsoft (R) .NET Framework IL Disassembler. Version 4.6.1055.0 +// Copyright (c) Microsoft Corporation. All rights reserved. + + + +// Metadata version: v4.0.30319 +.assembly extern mscorlib +{ + .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. + .ver 4:0:0:0 +} +.assembly extern FSharp.Core +{ + .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: + .ver 4:4:3:0 +} +.assembly test +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, + int32, + int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.mresource public FSharpSignatureData.test +{ + // Offset: 0x00000000 Length: 0x00000274 + // WARNING: managed resource file FSharpSignatureData.test created +} +.mresource public FSharpOptimizationData.test +{ + // Offset: 0x00000278 Length: 0x000000E6 + // WARNING: managed resource file FSharpOptimizationData.test created +} +.module test.exe +// MVID: {5AA585B2-D9C1-2E4E-A745-0383B285A55A} +.imagebase 0x00400000 +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 // WINDOWS_CUI +.corflags 0x00000001 // ILONLY +// Image base: 0x03930000 + + +// =============== CLASS MEMBERS DECLARATION =================== + +.class public abstract auto ansi sealed Test + extends [mscorlib]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .field public static literal int32 x = int32(0x00000007) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.LiteralAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public static int32 main(string[] argv) cil managed + { + .entrypoint + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.EntryPointAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 2 (0x2) + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: ret + } // end of method Test::main + +} // end of class Test + +.class private abstract auto ansi sealed ''.$Test + extends [mscorlib]System.Object +{ +} // end of class ''.$Test + + +// ============================================================= + +// *********** DISASSEMBLY COMPLETE *********************** +// WARNING: Created Win32 resource file test.il.res diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 60289acdd5..8aaea478a6 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -1465,6 +1465,18 @@ module RegressionTests = peverify cfg "test.exe" + ildasm cfg "/out=test.il" "test.exe" + + let outFile = "test.il" + let expectedFile = "test.il.bsl" + + let diff = diff true "regression/literal-value-bug-1/test.il.bsl" "regression/literal-value-bug-1/test.il" + + match diff with + | "" -> () + | _ -> + Assert.Fail (sprintf "'%s' and '%s' differ; %A" (getfullpath cfg outFile) (getfullpath cfg expectedFile) diff) + [] let ``struct-tuple-bug-1-FSC_BASIC`` () = singleTestBuildAndRun "regression/struct-tuple-bug-1" FSC_BASIC From 9ab5a6388fc22c7915af4f91bd1a334e179f76e6 Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Sun, 11 Mar 2018 17:43:47 -0700 Subject: [PATCH 085/147] Reflection tests --- .../regression/literal-value-bug-2/test.fs | 33 +++++++++++++++++++ tests/fsharp/tests.fs | 12 +++++-- 2 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 tests/fsharp/regression/literal-value-bug-2/test.fs diff --git a/tests/fsharp/regression/literal-value-bug-2/test.fs b/tests/fsharp/regression/literal-value-bug-2/test.fs new file mode 100644 index 0000000000..255018f058 --- /dev/null +++ b/tests/fsharp/regression/literal-value-bug-2/test.fs @@ -0,0 +1,33 @@ +open System +open System.Linq +open System.Reflection + +type thisAssembly (_dummy:System.Object) = class end + +module public MyLiteralFields = + [] + let public literalFieldX = 7 + +printfn "MyFields.literalFieldX = %d" MyLiteralFields.literalFieldX + +// Use dotnet reflection to verify that x is a Literal Constant +// This works on full desktop / coreclr and also fsi +let asm = thisAssembly(null).GetType().GetTypeInfo().Assembly +let typ = asm.GetTypes() |> Array.filter(fun t -> t.FullName.EndsWith("+MyLiteralFields")) |> Array.tryLast +let result = + match typ with + | Some typ -> + // Gets literalFieldX checks to see if it is marked "Literal" + let fieldInfo = typ.GetTypeInfo().DeclaredFields |> Seq.tryFind(fun fi -> fi.Name.StartsWith("literalFieldX")) + match fieldInfo with + | Some fieldInfo -> + if fieldInfo.IsLiteral = true then 0 else 2 + | None -> + printfn "Failed to find fieldliteralFieldX =" + 3 + | None -> + printfn "Failed to find module public MyLiteralFields =" + 1 +if result = 0 then printfn "Succeeded" else printfn "Failed: %d" result +exit result + diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 8aaea478a6..a14a60267c 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -1456,8 +1456,8 @@ module ToolsTests = module RegressionTests = - - [] + + //[] let ``literal-value-bug-1-FSC_BASIC`` () = let cfg = testConfig "regression/literal-value-bug-1" @@ -1477,7 +1477,13 @@ module RegressionTests = | _ -> Assert.Fail (sprintf "'%s' and '%s' differ; %A" (getfullpath cfg outFile) (getfullpath cfg expectedFile) diff) - [] + [] + let ``literal-value-bug-2-FSC_BASIC`` () = singleTestBuildAndRun "regression/literal-value-bug-2" FSC_BASIC + + [] + let ``literal-value-bug-2-FSI_BASIC`` () = singleTestBuildAndRun "regression/literal-value-bug-2" FSI_BASIC + + [] let ``struct-tuple-bug-1-FSC_BASIC`` () = singleTestBuildAndRun "regression/struct-tuple-bug-1" FSC_BASIC [] From f9c4666060537e8cccd36afeead2f0ca481c68f8 Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Mon, 12 Mar 2018 01:44:31 -0700 Subject: [PATCH 086/147] testing --- .../literal-value-bug-2/{test.fs => test.fsx} | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) rename tests/fsharp/regression/literal-value-bug-2/{test.fs => test.fsx} (87%) diff --git a/tests/fsharp/regression/literal-value-bug-2/test.fs b/tests/fsharp/regression/literal-value-bug-2/test.fsx similarity index 87% rename from tests/fsharp/regression/literal-value-bug-2/test.fs rename to tests/fsharp/regression/literal-value-bug-2/test.fsx index 255018f058..5087ef3888 100644 --- a/tests/fsharp/regression/literal-value-bug-2/test.fs +++ b/tests/fsharp/regression/literal-value-bug-2/test.fsx @@ -1,3 +1,5 @@ +module LiteralTestCase + open System open System.Linq open System.Reflection @@ -28,6 +30,10 @@ let result = | None -> printfn "Failed to find module public MyLiteralFields =" 1 -if result = 0 then printfn "Succeeded" else printfn "Failed: %d" result -exit result +if result = 0 then + System.IO.File.WriteAllText("test.ok","ok"); + printfn "Succeeded" +else + printfn "Failed: %d" result +exit result From 123785c90959d06b67a089a76fff48251e812cf6 Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Mon, 12 Mar 2018 02:49:49 -0700 Subject: [PATCH 087/147] twiddle --- tests/fsharp/regression/literal-value-bug-2/test.fsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/fsharp/regression/literal-value-bug-2/test.fsx b/tests/fsharp/regression/literal-value-bug-2/test.fsx index 5087ef3888..e529df8c86 100644 --- a/tests/fsharp/regression/literal-value-bug-2/test.fsx +++ b/tests/fsharp/regression/literal-value-bug-2/test.fsx @@ -1,5 +1,3 @@ -module LiteralTestCase - open System open System.Linq open System.Reflection From 7953479555ac41050b11d0b9a8ecdbd1716cd39f Mon Sep 17 00:00:00 2001 From: Avi Avni Date: Mon, 12 Mar 2018 15:00:51 +0200 Subject: [PATCH 088/147] il compare --- .../regression/literal-value-bug-1/test.il.bsl | 15 +++++++++------ tests/fsharp/tests.fs | 4 ++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/tests/fsharp/regression/literal-value-bug-1/test.il.bsl b/tests/fsharp/regression/literal-value-bug-1/test.il.bsl index 1aed785ba3..86655b9a6e 100644 --- a/tests/fsharp/regression/literal-value-bug-1/test.il.bsl +++ b/tests/fsharp/regression/literal-value-bug-1/test.il.bsl @@ -1,6 +1,5 @@ -// Microsoft (R) .NET Framework IL Disassembler. Version 4.6.1055.0 -// Copyright (c) Microsoft Corporation. All rights reserved. +// Microsoft (R) .NET Framework IL Disassembler. Version 4.5.22220.0 @@ -20,6 +19,10 @@ .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, int32, int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) + + // --- The following custom attribute is added automatically, do not uncomment ------- + // .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 01 01 00 00 00 00 ) + .hash algorithm 0x00008004 .ver 0:0:0:0 } @@ -30,17 +33,17 @@ } .mresource public FSharpOptimizationData.test { - // Offset: 0x00000278 Length: 0x000000E6 + // Offset: 0x00000278 Length: 0x0000006F // WARNING: managed resource file FSharpOptimizationData.test created } .module test.exe -// MVID: {5AA585B2-D9C1-2E4E-A745-0383B285A55A} + // MVID: {5AA663EB-D9C1-2E4E-A745-0383EB63A65A} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x03930000 +// Image base: 0x02BF0000 // =============== CLASS MEMBERS DECLARATION =================== @@ -73,4 +76,4 @@ // ============================================================= // *********** DISASSEMBLY COMPLETE *********************** -// WARNING: Created Win32 resource file test.il.res +// WARNING: Created Win32 resource file test.res diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index a14a60267c..375dfaefc6 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -1457,7 +1457,7 @@ module ToolsTests = module RegressionTests = - //[] + [] let ``literal-value-bug-1-FSC_BASIC`` () = let cfg = testConfig "regression/literal-value-bug-1" @@ -1470,7 +1470,7 @@ module RegressionTests = let outFile = "test.il" let expectedFile = "test.il.bsl" - let diff = diff true "regression/literal-value-bug-1/test.il.bsl" "regression/literal-value-bug-1/test.il" + let diff = fsdiff cfg outFile expectedFile match diff with | "" -> () From 4952f8467aa1f097b3f8eb69adfd7d7b67a83dc0 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Mon, 12 Mar 2018 14:41:14 +0100 Subject: [PATCH 089/147] Move basex1 and basey1 down (#4491) --- src/fsharp/FSharp.Core/prim-types.fs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fsharp/FSharp.Core/prim-types.fs b/src/fsharp/FSharp.Core/prim-types.fs index 96b417a47d..c86de74bda 100644 --- a/src/fsharp/FSharp.Core/prim-types.fs +++ b/src/fsharp/FSharp.Core/prim-types.fs @@ -961,11 +961,11 @@ namespace Microsoft.FSharp.Core let c = int64Order lenx1 leny1 if c <> 0 then c else let basex0 = int64 (x.GetLowerBound(0)) - let basex1 = int64 (x.GetLowerBound(1)) let basey0 = int64 (y.GetLowerBound(0)) - let basey1 = int64 (y.GetLowerBound(1)) let c = int64Order basex0 basey0 if c <> 0 then c else + let basex1 = int64 (x.GetLowerBound(1)) + let basey1 = int64 (y.GetLowerBound(1)) let c = int64Order basex1 basey1 if c <> 0 then c else let rec check0 i = From da13079e9f87bba4badf25f7db825af1c4e0f623 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Mon, 12 Mar 2018 17:37:49 +0000 Subject: [PATCH 090/147] Improve perf of unused opens analysis --- src/fsharp/NameResolution.fs | 23 +++ src/fsharp/NameResolution.fsi | 3 + src/fsharp/infos.fs | 16 +- src/fsharp/service/ServiceAnalysis.fs | 212 +++++++++++++++----------- src/fsharp/symbols/Symbols.fs | 10 +- src/fsharp/symbols/Symbols.fsi | 6 +- tests/service/ProjectAnalysisTests.fs | 139 +++++++++++++++++ 7 files changed, 316 insertions(+), 93 deletions(-) diff --git a/src/fsharp/NameResolution.fs b/src/fsharp/NameResolution.fs index 2715b65e27..f2a5e851e4 100644 --- a/src/fsharp/NameResolution.fs +++ b/src/fsharp/NameResolution.fs @@ -1330,12 +1330,18 @@ let (|ActivePatternCaseUse|_|) (item:Item) = | Item.ActivePatternResult(ap, _, idx,_) -> Some (ap.Range, ap.Range, idx) | _ -> None +let tyconRefDefnHash (_g: TcGlobals) (eref1:EntityRef) = + hash eref1.LogicalName + let tyconRefDefnEq g (eref1:EntityRef) (eref2: EntityRef) = tyconRefEq g eref1 eref2 // Signature items considered equal to implementation items || ((eref1.DefinitionRange = eref2.DefinitionRange || eref1.SigRange = eref2.SigRange) && (eref1.LogicalName = eref2.LogicalName)) +let valRefDefnHash (_g: TcGlobals) (vref1:ValRef)= + hash vref1.DisplayName + let valRefDefnEq g (vref1:ValRef) (vref2: ValRef) = valRefEq g vref1 vref2 // Signature items considered equal to implementation items @@ -1410,6 +1416,23 @@ let ItemsAreEffectivelyEqual g orig other = | _ -> false +/// Given the Item 'orig' - returns function 'other : Item -> bool', that will yield true if other and orig represents the same item and false - otherwise +let ItemsAreEffectivelyEqualHash (g: TcGlobals) orig = + match orig with + | EntityUse tcref -> tyconRefDefnHash g tcref + | Item.TypeVar (nm,_)-> hash nm + | ValUse vref -> valRefDefnHash g vref + | ActivePatternCaseUse (_, _, idx)-> hash idx + | MethodUse minfo -> minfo.ComputeHashCode() + | PropertyUse pinfo -> pinfo.ComputeHashCode() + | Item.ArgName (id,_, _) -> hash id.idText + | ILFieldUse ilfinfo -> ilfinfo.ComputeHashCode() + | UnionCaseUse ucase -> hash ucase.CaseName + | RecordFieldUse (name, _) -> hash name + | EventUse einfo -> einfo.ComputeHashCode() + | Item.ModuleOrNamespaces _ -> 100013 + | _ -> 389329 + [] type CapturedNameResolution(p:pos, i:Item, tpinst, io:ItemOccurence, de:DisplayEnv, nre:NameResolutionEnv, ad:AccessorDomain, m:range) = member this.Pos = p diff --git a/src/fsharp/NameResolution.fsi b/src/fsharp/NameResolution.fsi index 859009e364..9e63e72932 100755 --- a/src/fsharp/NameResolution.fsi +++ b/src/fsharp/NameResolution.fsi @@ -251,6 +251,9 @@ type internal ItemOccurence = /// Check for equality, up to signature matching val ItemsAreEffectivelyEqual : TcGlobals -> Item -> Item -> bool +/// Hash compatible with ItemsAreEffectivelyEqual +val ItemsAreEffectivelyEqualHash : TcGlobals -> Item -> int + [] type internal CapturedNameResolution = /// line and column diff --git a/src/fsharp/infos.fs b/src/fsharp/infos.fs index f117f36cca..ca5cb77813 100755 --- a/src/fsharp/infos.fs +++ b/src/fsharp/infos.fs @@ -1240,6 +1240,7 @@ type MethInfo = /// Tests whether two method infos have the same underlying definition. /// Used to merge operator overloads collected from left and right of an operator constraint. + /// Must be compatible with ItemsAreEffectivelyEqual relation. static member MethInfosUseIdenticalDefinitions x1 x2 = match x1,x2 with | ILMeth(_,x1,_), ILMeth(_,x2,_) -> (x1.RawMetadata === x2.RawMetadata) @@ -1250,8 +1251,7 @@ type MethInfo = #endif | _ -> false - /// Calculates a hash code of method info. Note: this is a very imperfect implementation, - /// but it works decently for comparing methods in the language service... + /// Calculates a hash code of method info. Must be compatible with ItemsAreEffectivelyEqual relation. member x.ComputeHashCode() = match x with | ILMeth(_,x1,_) -> hash x1.RawMetadata.Name @@ -1689,6 +1689,8 @@ type ILFieldInfo = | ProvidedField(amap,fi,m) -> Import.ImportProvidedType amap m (fi.PApply((fun fi -> fi.FieldType),m)) #endif + /// Tests whether two infos have the same underlying definition. + /// Must be compatible with ItemsAreEffectivelyEqual relation. static member ILFieldInfosUseIdenticalDefinitions x1 x2 = match x1,x2 with | ILFieldInfo(_, x1), ILFieldInfo(_, x2) -> (x1 === x2) @@ -1698,6 +1700,10 @@ type ILFieldInfo = #endif /// Get an (uninstantiated) reference to the field as an Abstract IL ILFieldRef member x.ILFieldRef = rescopeILFieldRef x.ScopeRef (mkILFieldRef(x.ILTypeRef,x.FieldName,x.ILFieldType)) + + /// Calculates a hash code of field info. Must be compatible with ItemsAreEffectivelyEqual relation. + member x.ComputeHashCode() = hash x.FieldName + override x.ToString() = x.FieldName @@ -2156,8 +2162,8 @@ type PropInfo = | FSProp _ -> failwith "no setter method" /// Test whether two property infos have the same underlying definition. - /// /// Uses the same techniques as 'MethInfosUseIdenticalDefinitions'. + /// Must be compatible with ItemsAreEffectivelyEqual relation. static member PropInfosUseIdenticalDefinitions x1 x2 = let optVrefEq g = function | Some(v1), Some(v2) -> valRefEq g v1 v2 @@ -2172,7 +2178,7 @@ type PropInfo = #endif | _ -> false - /// Calculates a hash code of property info (similar as previous) + /// Calculates a hash code of property info. Must be compatible with ItemsAreEffectivelyEqual relation. member pi.ComputeHashCode() = match pi with | ILProp ilpinfo -> hash ilpinfo.RawMetadata.Name @@ -2411,6 +2417,7 @@ type EventInfo = /// Test whether two event infos have the same underlying definition. + /// Must be compatible with ItemsAreEffectivelyEqual relation. static member EventInfosUseIdenticalDefintions x1 x2 = match x1, x2 with | FSEvent(g, pi1, vrefa1, vrefb1), FSEvent(_, pi2, vrefa2, vrefb2) -> @@ -2422,6 +2429,7 @@ type EventInfo = | _ -> false /// Calculates a hash code of event info (similar as previous) + /// Must be compatible with ItemsAreEffectivelyEqual relation. member ei.ComputeHashCode() = match ei with | ILEvent ileinfo -> hash ileinfo.RawMetadata.Name diff --git a/src/fsharp/service/ServiceAnalysis.fs b/src/fsharp/service/ServiceAnalysis.fs index d8b05a2d06..018e9f42c5 100644 --- a/src/fsharp/service/ServiceAnalysis.fs +++ b/src/fsharp/service/ServiceAnalysis.fs @@ -5,26 +5,31 @@ namespace Microsoft.FSharp.Compiler.SourceCodeServices open Microsoft.FSharp.Compiler open Microsoft.FSharp.Compiler.Ast open Microsoft.FSharp.Compiler.Range +open Microsoft.FSharp.Compiler.PrettyNaming +open System.Collections.Generic +open System.Runtime.CompilerServices module UnusedOpens = - open Microsoft.FSharp.Compiler.PrettyNaming - open System.Runtime.CompilerServices - type Module = - { Entity: FSharpEntity - IsNestedAutoOpen: bool } + let symbolHash = HashIdentity.FromFunctions (fun (x: FSharpSymbol) -> x.GetEffectivelySameAsHash()) (fun x y -> x.IsEffectivelySameAs(y)) - member this.ChildSymbols = - seq { for ent in this.Entity.NestedEntities do + /// Represents one namespace or module opened by an 'open' statement + type OpenedModule(entity: FSharpEntity, isNestedAutoOpen: bool) = + + /// Compute an indexed table of the set of symbols revealed by 'open', on-demand + let revealedSymbols : Lazy> = + lazy + let symbols = + [| for ent in entity.NestedEntities do yield ent :> FSharpSymbol if ent.IsFSharpRecord then for rf in ent.FSharpFields do - yield upcast rf + yield rf :> FSharpSymbol if ent.IsFSharpUnion && not (Symbol.hasAttribute ent.Attributes) then for unionCase in ent.UnionCases do - yield upcast unionCase + yield unionCase :> FSharpSymbol if Symbol.hasAttribute ent.Attributes then for fv in ent.MembersFunctionsAndValues do @@ -32,35 +37,45 @@ module UnusedOpens = // so we have to check Extension attribute instead. // (note: fv.IsExtensionMember has proper value for symbols returning by GetAllUsesOfAllSymbolsInFile though) if Symbol.hasAttribute fv.Attributes then - yield upcast fv + yield fv :> FSharpSymbol - for apCase in this.Entity.ActivePatternCases do - yield upcast apCase + for apCase in entity.ActivePatternCases do + yield apCase :> FSharpSymbol + + // The IsNamespace and IsFSharpModule cases are handled by looking at DeclaringEntity below + if not entity.IsNamespace && not entity.IsFSharpModule then + for fv in entity.MembersFunctionsAndValues do + yield fv :> FSharpSymbol |] + + HashSet<_>(symbols, symbolHash) - for fv in this.Entity.MembersFunctionsAndValues do - yield upcast fv - } |> Seq.cache + member __.Entity = entity + member __.IsNestedAutoOpen = isNestedAutoOpen + member __.RevealedSymbolsContains(symbol) = revealedSymbols.Force().Contains symbol - type ModuleGroup = - { Modules: Module list } + type OpenedModuleGroup = + { OpenedModules: OpenedModule list } static member Create (modul: FSharpEntity) = let rec getModuleAndItsAutoOpens (isNestedAutoOpen: bool) (modul: FSharpEntity) = - [ yield { Entity = modul; IsNestedAutoOpen = isNestedAutoOpen } + [ yield OpenedModule (modul, isNestedAutoOpen) for ent in modul.NestedEntities do if ent.IsFSharpModule && Symbol.hasAttribute ent.Attributes then yield! getModuleAndItsAutoOpens true ent ] - { Modules = getModuleAndItsAutoOpens false modul } + { OpenedModules = getModuleAndItsAutoOpens false modul } /// Represents single open statement. type OpenStatement = - { /// All modules which this open declaration effectively opens, _not_ including auto open ones. - Modules: ModuleGroup list - /// Range of open statement itself. + { /// All namespaces and modules which this open declaration effectively opens, including the AutoOpen ones + OpenedGroups: OpenedModuleGroup list + + /// The range of open statement itself Range: range - /// Scope on which this open declaration is applied. + + /// The scope on which this open declaration is applied AppliedScope: range } + /// Gets the open statements, their scopes and their resolutions let getOpenStatements (openDeclarations: FSharpOpenDeclaration list) : OpenStatement list = openDeclarations |> List.filter (fun x -> not x.IsOwnNamespace) @@ -70,90 +85,117 @@ module UnusedOpens = if firstId.idText = MangledGlobalName then None else - Some { Modules = openDecl.Modules |> List.map ModuleGroup.Create + Some { OpenedGroups = openDecl.Modules |> List.map OpenedModuleGroup.Create Range = range AppliedScope = openDecl.AppliedScope } | _ -> None) + /// Only consider symbol uses which are the first part of a long ident, i.e. with no qualifying identifiers let filterSymbolUses (getSourceLineStr: int -> string) (symbolUses: FSharpSymbolUse[]) : FSharpSymbolUse[] = symbolUses |> Array.filter (fun su -> match su.Symbol with | :? FSharpMemberOrFunctionOrValue as fv when fv.IsExtensionMember -> - // extension members should be taken into account even though they have a prefix (as they do most of the time) + // Extension members should be taken into account even though they have a prefix (as they do most of the time) true | _ -> - let partialName = QuickParse.GetPartialLongNameEx (getSourceLineStr su.RangeAlternate.StartLine, su.RangeAlternate.EndColumn - 1) - // for the rest of symbols we pick only those which are the first part of a long idend, because it's they which are - // conteined in opened namespaces / modules. For example, we pick `IO` from long ident `IO.File.OpenWrite` because + // For the rest of symbols we pick only those which are the first part of a long ident, because it's they which are + // contained in opened namespaces / modules. For example, we pick `IO` from long ident `IO.File.OpenWrite` because // it's `open System` which really brings it into scope. - partialName.QualifyingIdents = []) + let partialName = QuickParse.GetPartialLongNameEx (getSourceLineStr su.RangeAlternate.StartLine, su.RangeAlternate.EndColumn - 1) + List.isEmpty partialName.QualifyingIdents) + /// Split symbol uses into cases that are easy to handle (via DeclaringEntity) and those that don't have a good DeclaringEntity + let splitSymbolUses (symbolUses: FSharpSymbolUse[]) : FSharpSymbolUse[] * FSharpSymbolUse[] = + symbolUses |> Array.partition (fun symbolUse -> + let symbol = symbolUse.Symbol + match symbol with + | :? FSharpMemberOrFunctionOrValue as f -> + match f.DeclaringEntity with + | Some ent when ent.IsNamespace || ent.IsFSharpModule -> true + | _ -> false + | _ -> false) + + /// Represents intermediate tracking data used to track the modules which are known to have been used so far type UsedModule = { Module: FSharpEntity AppliedScope: range } - let getUnusedOpens (checkFileResults: FSharpCheckFileResults, getSourceLineStr: int -> string) : Async = - - let filterOpenStatements (openStatements: OpenStatement list) (symbolUses: FSharpSymbolUse[]) : OpenStatement list = - - let rec filterInner acc (openStatements: OpenStatement list) (usedModules: UsedModule list) = - - let getUsedModules (openStatement: OpenStatement) = - let notAlreadyUsedModuleGroups = - openStatement.Modules - |> List.choose (fun x -> - let notUsedModules = - x.Modules - |> List.filter (fun x -> - not (usedModules - |> List.exists (fun used -> - rangeContainsRange used.AppliedScope openStatement.AppliedScope && - used.Module.IsEffectivelySameAs x.Entity))) + /// Given an 'open' statement, find fresh modules/namespaces referred to by that statement where there is some use of a revealed symbol + /// in the scope of the 'open' is from that module. + /// + /// Performance will be roughly NumberOfOpenStatements x NumberOfSymbolUses + let getUsedModules (symbolUses1: FSharpSymbolUse[], symbolUses2: FSharpSymbolUse[]) (usedModules: UsedModule list) (openStatement: OpenStatement) = + + // Don't re-check modules whose symbols are already known to have been used + let openedGroupsToExamine = + openStatement.OpenedGroups |> List.choose (fun openedGroup -> + let openedEntitiesToExamine = + openedGroup.OpenedModules + |> List.filter (fun openedEntity -> + not (usedModules + |> List.exists (fun used -> + rangeContainsRange used.AppliedScope openStatement.AppliedScope && + used.Module.IsEffectivelySameAs openedEntity.Entity))) - match notUsedModules with - | [] -> None - | _ when notUsedModules |> List.exists (fun x -> not x.IsNestedAutoOpen) -> - Some { Modules = notUsedModules } - | _ -> None) - - match notAlreadyUsedModuleGroups with - | [] -> [] - | _ -> - let symbolUsesInScope = symbolUses |> Array.filter (fun symbolUse -> rangeContainsRange openStatement.AppliedScope symbolUse.RangeAlternate) - notAlreadyUsedModuleGroups - |> List.filter (fun modulGroup -> - modulGroup.Modules - |> List.exists (fun modul -> - symbolUsesInScope - |> Array.exists (fun symbolUse -> - let usedByEnclosingEntity = - match symbolUse.Symbol with - | :? FSharpMemberOrFunctionOrValue as f -> - match f.DeclaringEntity with - | Some ent when ent.IsNamespace || ent.IsFSharpModule -> - Some (ent.IsEffectivelySameAs modul.Entity) - | _ -> None - | _ -> None - match usedByEnclosingEntity with - | Some x -> x - | None -> modul.ChildSymbols |> Seq.exists (fun x -> x.IsEffectivelySameAs symbolUse.Symbol) - ))) - |> List.collect (fun mg -> - mg.Modules |> List.map (fun x -> { Module = x.Entity; AppliedScope = openStatement.AppliedScope })) + match openedEntitiesToExamine with + | [] -> None + | _ when openedEntitiesToExamine |> List.exists (fun x -> not x.IsNestedAutoOpen) -> Some { OpenedModules = openedEntitiesToExamine } + | _ -> None) + + // Find the opened groups that are used by some symbol use + let newlyUsedOpenedGroups = + openedGroupsToExamine |> List.filter (fun openedGroup -> + openedGroup.OpenedModules |> List.exists (fun openedEntity -> + + symbolUses1 |> Array.exists (fun symbolUse -> + rangeContainsRange openStatement.AppliedScope symbolUse.RangeAlternate && + match symbolUse.Symbol with + | :? FSharpMemberOrFunctionOrValue as f -> + match f.DeclaringEntity with + | Some ent when ent.IsNamespace || ent.IsFSharpModule -> ent.IsEffectivelySameAs openedEntity.Entity + | _ -> false + | _ -> false) || + + symbolUses2 |> Array.exists (fun symbolUse -> + rangeContainsRange openStatement.AppliedScope symbolUse.RangeAlternate && + openedEntity.RevealedSymbolsContains symbolUse.Symbol))) + + // Return them as interim used entities + newlyUsedOpenedGroups |> List.collect (fun openedGroup -> + openedGroup.OpenedModules |> List.map (fun x -> { Module = x.Entity; AppliedScope = openStatement.AppliedScope })) - match openStatements with - | os :: xs -> - match getUsedModules os with - | [] -> filterInner (os :: acc) xs usedModules - | um -> filterInner acc xs (um @ usedModules) - | [] -> List.rev acc - - filterInner [] openStatements [] + /// Incrementally filter out the open statements one by one. Filter those whose contents are referred to somewhere in the symbol uses. + /// Async to allow cancellation. + let rec filterOpenStatementsIncremental symbolUses (openStatements: OpenStatement list) (usedModules: UsedModule list) acc = + async { + match openStatements with + | openStatement :: rest -> + match getUsedModules symbolUses usedModules openStatement with + | [] -> + // The open statement has not been used, include it in the results + return! filterOpenStatementsIncremental symbolUses rest usedModules (openStatement :: acc) + | moreUsedModules -> + // The open statement has been used, add the modules which are already known to be used to the list of things we don't need to re-check + return! filterOpenStatementsIncremental symbolUses rest (moreUsedModules @ usedModules) acc + | [] -> return List.rev acc + } + + /// Filter out the open statements whose contents are referred to somewhere in the symbol uses. + /// Async to allow cancellation. + let filterOpenStatements symbolUses openStatements = + async { + let! results = filterOpenStatementsIncremental symbolUses openStatements [] [] + return results |> List.map (fun os -> os.Range) + } + /// Get the open statements whose contents are not referred to anywhere in the symbol uses. + /// Async to allow cancellation. + let getUnusedOpens (checkFileResults: FSharpCheckFileResults, getSourceLineStr: int -> string) : Async = async { let! symbolUses = checkFileResults.GetAllUsesOfAllSymbolsInFile() let symbolUses = filterSymbolUses getSourceLineStr symbolUses + let symbolUses = splitSymbolUses symbolUses let openStatements = getOpenStatements checkFileResults.OpenDeclarations - return filterOpenStatements openStatements symbolUses |> List.map (fun os -> os.Range) + return! filterOpenStatements symbolUses openStatements } \ No newline at end of file diff --git a/src/fsharp/symbols/Symbols.fs b/src/fsharp/symbols/Symbols.fs index 74aa51c9e2..e48f116b92 100644 --- a/src/fsharp/symbols/Symbols.fs +++ b/src/fsharp/symbols/Symbols.fs @@ -221,6 +221,8 @@ type FSharpSymbol(cenv:cenv, item: (unit -> Item), access: (FSharpSymbol -> CcuT override x.GetHashCode() = hash x.ImplementationLocation + member x.GetEffectivelySameAsHash() = ItemsAreEffectivelyEqualHash cenv.g x.Item + override x.ToString() = "symbol " + (try item().DisplayName with _ -> "?") @@ -367,7 +369,7 @@ and FSharpEntity(cenv:cenv, entity:EntityRef) = #if !NO_EXTENSIONTYPING | ProvidedTypeMetadata info -> info.IsClass #endif - | ILTypeMetadata (TILObjectReprData(_, _, td)) -> (td.IsClass) + | ILTypeMetadata (TILObjectReprData(_, _, td)) -> td.IsClass | FSharpOrArrayOrByrefOrTupleOrExnTypeMetadata -> entity.Deref.IsFSharpClassTycon member __.IsByRef = @@ -428,7 +430,6 @@ and FSharpEntity(cenv:cenv, entity:EntityRef) = member __.Accessibility = if isUnresolved() then FSharpAccessibility(taccessPublic) else - FSharpAccessibility(getApproxFSharpAccessibilityOfEntity entity) member __.RepresentationAccessibility = @@ -471,7 +472,9 @@ and FSharpEntity(cenv:cenv, entity:EntityRef) = not (isResolvedAndFSharp()) || entity.Deref.IsPrefixDisplay member x.IsNamespace = entity.IsNamespace + member x.MembersOrValues = x.MembersFunctionsAndValues + member x.MembersFunctionsAndValues = if isUnresolved() then makeReadOnlyCollection[] else protect <| fun () -> @@ -553,6 +556,7 @@ and FSharpEntity(cenv:cenv, entity:EntityRef) = |> makeReadOnlyCollection member x.RecordFields = x.FSharpFields + member x.FSharpFields = if isUnresolved() then makeReadOnlyCollection[] else @@ -599,7 +603,7 @@ and FSharpEntity(cenv:cenv, entity:EntityRef) = | [] -> [[path]] | _ -> paths |> List.map (fun x -> path :: x) - let walkParts (parts: (string * ModuleOrNamespaceKind) list) = //: string list list = + let walkParts (parts: (string * ModuleOrNamespaceKind) list) = let rec loop (currentPaths: string list list) parts = match parts with | [] -> currentPaths diff --git a/src/fsharp/symbols/Symbols.fsi b/src/fsharp/symbols/Symbols.fsi index 55c1a6fbb2..730c60e79e 100644 --- a/src/fsharp/symbols/Symbols.fsi +++ b/src/fsharp/symbols/Symbols.fsi @@ -86,7 +86,12 @@ type [] public FSharpSymbol = /// /// This is the relation used by GetUsesOfSymbol and GetUsesOfSymbolInFile. member IsEffectivelySameAs : other: FSharpSymbol -> bool + + /// A hash compatible with the IsEffectivelySameAs relation + member GetEffectivelySameAsHash : unit -> int + member IsExplicitlySuppressed : bool + static member GetAccessibility : FSharpSymbol -> FSharpAccessibility option /// Represents an assembly as seen by the F# language @@ -293,7 +298,6 @@ and [] public FSharpEntity = /// Get the cases of a union type member UnionCases : IList - /// Indicates if the type is a delegate with the given Invoke signature member FSharpDelegateSignature : FSharpDelegateSignature diff --git a/tests/service/ProjectAnalysisTests.fs b/tests/service/ProjectAnalysisTests.fs index 34822b99fe..9fbebfef69 100644 --- a/tests/service/ProjectAnalysisTests.fs +++ b/tests/service/ProjectAnalysisTests.fs @@ -5203,3 +5203,142 @@ let ``#4030, Incremental builder creation warnings`` (args, errorSeverities) = let _, checkResults = parseAndCheckFile fileName source options checkResults.Errors |> Array.map (fun e -> e.Severity = FSharpErrorSeverity.Error) |> shouldEqual errorSeverities + + +//------------------------------------------------------ + +[] +let ``Unused opens smoke test 1``() = + + let fileName1 = Path.ChangeExtension(Path.GetTempFileName(), ".fs") + let base2 = Path.GetTempFileName() + let dllName = Path.ChangeExtension(base2, ".dll") + let projFileName = Path.ChangeExtension(base2, ".fsproj") + let fileSource1 = """ +open System.Collections // unused +open System.Collections.Generic // used, should not appear +open FSharp.Control // unused +open FSharp.Data // unused +open System.Globalization // unused + +module SomeUnusedModule = + let f x = x + +module SomeUsedModuleContainingFunction = + let g x = x + +module SomeUsedModuleContainingActivePattern = + let (|ActivePattern|) x = x + +module SomeUsedModuleContainingExtensionMember = + type System.Int32 with member x.Q = 1 + +module SomeUsedModuleContainingUnion = + type Q = A | B + +open SomeUnusedModule +open SomeUsedModuleContainingFunction +open SomeUsedModuleContainingExtensionMember +open SomeUsedModuleContainingUnion + +type UseTheThings(i:int) = + member x.Value = Dictionary() // use something from System.Collections.Generic, as a constructor + member x.UseSomeUsedModuleContainingFunction() = g 3 + member x.UseSomeUsedModuleContainingActivePattern(ActivePattern g) = g + member x.UseSomeUsedModuleContainingExtensionMember() = (3).Q + member x.UseSomeUsedModuleContainingUnion() = A +""" + File.WriteAllText(fileName1, fileSource1) + + let fileNames = [fileName1] + let args = mkProjectCommandLineArgs (dllName, fileNames) + let keepAssemblyContentsChecker = FSharpChecker.Create(keepAssemblyContents=true) + let options = keepAssemblyContentsChecker.GetProjectOptionsFromCommandLineArgs (projFileName, args) + + let fileCheckResults = + keepAssemblyContentsChecker.ParseAndCheckFileInProject(fileName1, 0, fileSource1, options) |> Async.RunSynchronously + |> function + | _, FSharpCheckFileAnswer.Succeeded(res) -> res + | _ -> failwithf "Parsing aborted unexpectedly..." + //let symbolUses = fileCheckResults.GetAllUsesOfAllSymbolsInFile() |> Async.RunSynchronously |> Array.indexed + // Fragments used to check hash codes: + //(snd symbolUses.[42]).Symbol.IsEffectivelySameAs((snd symbolUses.[37]).Symbol) + //(snd symbolUses.[42]).Symbol.GetEffectivelySameAsHash() + //(snd symbolUses.[37]).Symbol.GetEffectivelySameAsHash() + let lines = File.ReadAllLines(fileName1) + let unusedOpens = UnusedOpens.getUnusedOpens (fileCheckResults, (fun i -> lines.[i-1])) |> Async.RunSynchronously + let unusedOpensData = [ for uo in unusedOpens -> tups uo, lines.[uo.StartLine-1] ] + let expected = + [(((2, 5), (2, 23)), "open System.Collections // unused"); + (((4, 5), (4, 19)), "open FSharp.Control // unused"); + (((5, 5), (5, 16)), "open FSharp.Data // unused"); + (((6, 5), (6, 25)), "open System.Globalization // unused"); + (((23, 5), (23, 21)), "open SomeUnusedModule")] + unusedOpensData |> shouldEqual expected + +[] +let ``Unused opens smoke test auto open``() = + + let fileName1 = Path.ChangeExtension(Path.GetTempFileName(), ".fs") + let base2 = Path.GetTempFileName() + let dllName = Path.ChangeExtension(base2, ".dll") + let projFileName = Path.ChangeExtension(base2, ".fsproj") + let fileSource1 = """ +open System.Collections // unused +open System.Collections.Generic // used, should not appear +open FSharp.Control // unused +open FSharp.Data // unused +open System.Globalization // unused + +[] +module Helpers = + module SomeUnusedModule = + let f x = x + + module SomeUsedModuleContainingFunction = + let g x = x + + module SomeUsedModuleContainingActivePattern = + let (|ActivePattern|) x = x + + module SomeUsedModuleContainingExtensionMember = + type System.Int32 with member x.Q = 1 + + module SomeUsedModuleContainingUnion = + type Q = A | B + +open SomeUnusedModule +open SomeUsedModuleContainingFunction +open SomeUsedModuleContainingExtensionMember +open SomeUsedModuleContainingUnion + +type UseTheThings(i:int) = + member x.Value = Dictionary() // use something from System.Collections.Generic, as a constructor + member x.UseSomeUsedModuleContainingFunction() = g 3 + member x.UseSomeUsedModuleContainingActivePattern(ActivePattern g) = g + member x.UseSomeUsedModuleContainingExtensionMember() = (3).Q + member x.UseSomeUsedModuleContainingUnion() = A +""" + File.WriteAllText(fileName1, fileSource1) + + let fileNames = [fileName1] + let args = mkProjectCommandLineArgs (dllName, fileNames) + let keepAssemblyContentsChecker = FSharpChecker.Create(keepAssemblyContents=true) + let options = keepAssemblyContentsChecker.GetProjectOptionsFromCommandLineArgs (projFileName, args) + + let fileCheckResults = + keepAssemblyContentsChecker.ParseAndCheckFileInProject(fileName1, 0, fileSource1, options) |> Async.RunSynchronously + |> function + | _, FSharpCheckFileAnswer.Succeeded(res) -> res + | _ -> failwithf "Parsing aborted unexpectedly..." + let lines = File.ReadAllLines(fileName1) + let unusedOpens = UnusedOpens.getUnusedOpens (fileCheckResults, (fun i -> lines.[i-1])) |> Async.RunSynchronously + let unusedOpensData = [ for uo in unusedOpens -> tups uo, lines.[uo.StartLine-1] ] + let expected = + [(((2, 5), (2, 23)), "open System.Collections // unused"); + (((4, 5), (4, 19)), "open FSharp.Control // unused"); + (((5, 5), (5, 16)), "open FSharp.Data // unused"); + (((6, 5), (6, 25)), "open System.Globalization // unused"); + (((25, 5), (25, 21)), "open SomeUnusedModule")] + unusedOpensData |> shouldEqual expected + From 2521f81c9d2c6bf03e02787810cbbe071341caa3 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Mon, 12 Mar 2018 18:50:05 +0100 Subject: [PATCH 091/147] Equality is 0 (#4493) * Create a test that shows broken comparison on float32 * fix comparison of float32 --- src/fsharp/FSharp.Core/prim-types.fs | 2 +- .../FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/fsharp/FSharp.Core/prim-types.fs b/src/fsharp/FSharp.Core/prim-types.fs index c86de74bda..6d01331267 100644 --- a/src/fsharp/FSharp.Core/prim-types.fs +++ b/src/fsharp/FSharp.Core/prim-types.fs @@ -4167,7 +4167,7 @@ namespace Microsoft.FSharp.Core else (# "ceq" e1 e1 : int #) when ^T : float32 = if (# "clt" e1 e2 : bool #) then (-1) elif (# "cgt" e1 e2 : bool #) then (1) - elif (# "ceq" e1 e2 : bool #) then (1) + elif (# "ceq" e1 e2 : bool #) then (0) elif (# "ceq" e2 e2 : bool #) then (-1) else (# "ceq" e1 e1 : int #) when ^T : char = if (# "clt.un" e1 e2 : bool #) then (-1) else (# "cgt.un" e1 e2 : int #) diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs index 78efc6a2ed..4f777facb3 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs @@ -816,3 +816,16 @@ type RangeTests() = if System.UIntPtr.Size >= 8 then RangeTestsHelpers.unsigned (System.UIntPtr System.UInt64.MinValue) (System.UIntPtr System.UInt64.MaxValue) +open NonStructuralComparison + + +[] +type NonStructuralComparisonTests() = + + [] + member __.CompareFloat32() = // https://github.com/Microsoft/visualfsharp/pull/4493 + + let x = 32 |> float32 + let y = 32 |> float32 + let comparison = compare x y + Assert.AreEqual(0, comparison) \ No newline at end of file From 09bb049d21bae5483c1dd364c2304cd385c09537 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Mon, 12 Mar 2018 18:32:56 +0000 Subject: [PATCH 092/147] improve tests, use the thing a bit --- src/fsharp/IlxGen.fs | 2 -- src/fsharp/IlxGen.fsi | 18 ++++++++++++++++++ tests/service/ProjectAnalysisTests.fs | 2 ++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/fsharp/IlxGen.fs b/src/fsharp/IlxGen.fs index 704a92f760..619dd978c0 100644 --- a/src/fsharp/IlxGen.fs +++ b/src/fsharp/IlxGen.fs @@ -17,7 +17,6 @@ open Microsoft.FSharp.Compiler.AbstractIL.Internal open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library open Microsoft.FSharp.Compiler.AbstractIL.Extensions.ILX open Microsoft.FSharp.Compiler.AbstractIL.Extensions.ILX.Types -open Microsoft.FSharp.Compiler.AbstractIL.Diagnostics open Microsoft.FSharp.Compiler.AbstractIL.Internal.BinaryConstants open Microsoft.FSharp.Compiler @@ -35,7 +34,6 @@ open Microsoft.FSharp.Compiler.Lib open Microsoft.FSharp.Compiler.TypeRelations open Microsoft.FSharp.Compiler.TypeChecker open Microsoft.FSharp.Compiler.Infos -open Microsoft.FSharp.Compiler.AbstractIL.Extensions.ILX.Types let IsNonErasedTypar (tp:Typar) = not tp.IsErased diff --git a/src/fsharp/IlxGen.fsi b/src/fsharp/IlxGen.fsi index f3db038698..f7a5071d14 100644 --- a/src/fsharp/IlxGen.fsi +++ b/src/fsharp/IlxGen.fsi @@ -18,21 +18,39 @@ type IlxGenBackend = [] type internal IlxGenOptions = { fragName : string + + /// Indicates if we are generating filter blocks generateFilterBlocks : bool + + /// Indicates if we should workaround old reflection emit bugs workAroundReflectionEmitBugs : bool + + /// Indicates if static array data should be emitted using static blobs emitConstantArraysUsingStaticDataBlobs : bool + /// If this is set, then the last module becomes the "main" module mainMethodInfo : Attribs option + + /// Indicates if local optimizations are active localOptimizationsAreOn : bool + + /// Indicates if we are generating debug symbols or not generateDebugSymbols : bool + + /// A flag to help test emit of debug information testFlagEmitFeeFeeAs100001 : bool + + /// Indicates which backend we are generating code for ilxBackend : IlxGenBackend + /// Indicates the code is being generated in FSI.EXE and is executed immediately after code generation /// This includes all interactively compiled code, including #load, definitions, and expressions isInteractive : bool + /// Indicates the code generated is an interactive 'it' expression. We generate a setter to allow clearing of the underlying /// storage, even though 'it' is not logically mutable isInteractiveItExpr : bool + /// Indicates that, whenever possible, use callvirt instead of call alwaysCallVirt : bool } diff --git a/tests/service/ProjectAnalysisTests.fs b/tests/service/ProjectAnalysisTests.fs index 9fbebfef69..d7eb1a801f 100644 --- a/tests/service/ProjectAnalysisTests.fs +++ b/tests/service/ProjectAnalysisTests.fs @@ -5239,6 +5239,7 @@ module SomeUsedModuleContainingUnion = open SomeUnusedModule open SomeUsedModuleContainingFunction open SomeUsedModuleContainingExtensionMember +open SomeUsedModuleContainingActivePattern open SomeUsedModuleContainingUnion type UseTheThings(i:int) = @@ -5310,6 +5311,7 @@ module Helpers = open SomeUnusedModule open SomeUsedModuleContainingFunction open SomeUsedModuleContainingExtensionMember +open SomeUsedModuleContainingActivePattern open SomeUsedModuleContainingUnion type UseTheThings(i:int) = From 017f06d44583309a5389e85048bc800ccad4119d Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Mon, 12 Mar 2018 12:22:30 -0700 Subject: [PATCH 093/147] consolidate VS package version generation --- setup/FSharp.Setup.props | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup/FSharp.Setup.props b/setup/FSharp.Setup.props index f17a8c2d47..7d9325d6d8 100644 --- a/setup/FSharp.Setup.props +++ b/setup/FSharp.Setup.props @@ -10,9 +10,11 @@ $(SetupRootFolder)\..\packages + + - - 15.7 + + $(VSAssemblyVersion.Split('.')[0]).$(VSAssemblyVersion.Split('.')[1]) $([System.DateTime]::Now.ToString(yyyyMMdd.0)) From ac42a1e0883b6a38b310a8d6dbc87047c78fefc8 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Mon, 12 Mar 2018 22:32:23 +0000 Subject: [PATCH 094/147] Update DEVGUIDE.md --- DEVGUIDE.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/DEVGUIDE.md b/DEVGUIDE.md index 12b263da28..2a17dc3806 100644 --- a/DEVGUIDE.md +++ b/DEVGUIDE.md @@ -15,7 +15,7 @@ Install - [.NET 4.6](https://www.microsoft.com/en-gb/download/details.aspx?id=48130) **NOTE on Windows:** -1. It is recommended to run the build.cmd and the qualifiers below on a command prompt with path set to have the location of MSBuild. If you have Visual Studio, we can also run using `Developer Command Prompt for Visual Studio 20xx` (depends on Visual Studio version). This developer command prompt is easier to use than normal command prompt, because it already has the correct path of Visual Studio and .NET's tooling set for us to use (including MSBuild). +1. It is recommended to run the build.cmd and the qualifiers be on a command prompt with path set to have the location of MSBuild. If you have Visual Studio, we can also run using `Developer Command Prompt for Visual Studio 20xx` (depends on Visual Studio version). This developer command prompt is easier to use than normal command prompt, because it already has the correct path of Visual Studio and .NET's tooling set for us to use (including MSBuild). 2. The running command prompt must be run under Administrator right (`Run as Administrator`). Before running the build scripts, ensure that you have cleaned up the visualfsharp repo by running this git command: @@ -213,6 +213,13 @@ For **Release**: - We use the proto compiler to compile the source for `FSharp.Core.dll` in this distribution. - We use the proto compiler to compile the source for `FSharp.Compiler.dll`, `fsc.exe`, `fsi.exe`, and other binaries found in this distribution. +#### Updating FSComp.fs + +If you change error messages you may need to update FSComp.fs in `src\buildfromsource\FSharp.Compiler.Private`. + +To do this, build the non-buildfromsource version of FSharp.Compiler.Private (src\fsharp\FSharp.Compiler.Private) then check its obj\ directory for `FSComp.fs` and manually copy that into the buildfromsource directory. + + #### Configuring proxy server If you are behind a proxy server, NuGet client tool must be configured to use it: From 73320bbef7c9f49e20543ba8ff540fbb3667d00a Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Mon, 12 Mar 2018 14:46:30 -0700 Subject: [PATCH 095/147] honor the environment variable $NUGET_PACKAGES for package restore --- FSharp.Directory.Build.props | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/FSharp.Directory.Build.props b/FSharp.Directory.Build.props index ecae832bc7..d23519791e 100644 --- a/FSharp.Directory.Build.props +++ b/FSharp.Directory.Build.props @@ -16,7 +16,12 @@ - $(UserProfile)\.nuget\packages\ + $(NUGET_PACKAGES) + $(UserProfile)\.nuget\packages\ + $(HOME)/.nuget/packages/ + + $(NuGetPackageRoot)\ + $(NuGetPackageRoot)/ From 414ab19337fd63cba0f01908eefbf578fffd7203 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Mon, 12 Mar 2018 16:16:37 -0700 Subject: [PATCH 096/147] don't try to include VSSDK targets if they haven't been restored yet --- vsintegration/Directory.Build.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vsintegration/Directory.Build.targets b/vsintegration/Directory.Build.targets index 528e41da3a..161dfe3bab 100644 --- a/vsintegration/Directory.Build.targets +++ b/vsintegration/Directory.Build.targets @@ -11,7 +11,7 @@ net462 - + From 1bc3938fad23e45c0da72ad48e69b581a9cba0ac Mon Sep 17 00:00:00 2001 From: Avi Avni Date: Tue, 13 Mar 2018 10:32:02 +0200 Subject: [PATCH 097/147] move test to fsharpqa --- tests/fsharp/tests.fs | 20 ----- .../EmittedIL/LiteralValue/LiteralValue.fs | 6 ++ .../LiteralValue/LiteralValue.il.bsl | 79 +++++++++++++++++++ .../CodeGen/EmittedIL/LiteralValue/env.lst | 9 +++ tests/fsharpqa/Source/test.lst | 1 + 5 files changed, 95 insertions(+), 20 deletions(-) create mode 100644 tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/LiteralValue.fs create mode 100644 tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/LiteralValue.il.bsl create mode 100644 tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/env.lst diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 375dfaefc6..886f61bb98 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -1457,26 +1457,6 @@ module ToolsTests = module RegressionTests = - [] - let ``literal-value-bug-1-FSC_BASIC`` () = - let cfg = testConfig "regression/literal-value-bug-1" - - fsc cfg "%s --optimize- -o:test.exe -g" cfg.fsc_flags ["test.fs"] - - peverify cfg "test.exe" - - ildasm cfg "/out=test.il" "test.exe" - - let outFile = "test.il" - let expectedFile = "test.il.bsl" - - let diff = fsdiff cfg outFile expectedFile - - match diff with - | "" -> () - | _ -> - Assert.Fail (sprintf "'%s' and '%s' differ; %A" (getfullpath cfg outFile) (getfullpath cfg expectedFile) diff) - [] let ``literal-value-bug-2-FSC_BASIC`` () = singleTestBuildAndRun "regression/literal-value-bug-2" FSC_BASIC diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/LiteralValue.fs b/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/LiteralValue.fs new file mode 100644 index 0000000000..cca0b9e0e2 --- /dev/null +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/LiteralValue.fs @@ -0,0 +1,6 @@ +[] +let x = 7 + +[] +let main argv = + 0 \ No newline at end of file diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/LiteralValue.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/LiteralValue.il.bsl new file mode 100644 index 0000000000..86655b9a6e --- /dev/null +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/LiteralValue.il.bsl @@ -0,0 +1,79 @@ + +// Microsoft (R) .NET Framework IL Disassembler. Version 4.5.22220.0 + + + +// Metadata version: v4.0.30319 +.assembly extern mscorlib +{ + .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. + .ver 4:0:0:0 +} +.assembly extern FSharp.Core +{ + .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: + .ver 4:4:3:0 +} +.assembly test +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, + int32, + int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) + + // --- The following custom attribute is added automatically, do not uncomment ------- + // .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 01 01 00 00 00 00 ) + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.mresource public FSharpSignatureData.test +{ + // Offset: 0x00000000 Length: 0x00000274 + // WARNING: managed resource file FSharpSignatureData.test created +} +.mresource public FSharpOptimizationData.test +{ + // Offset: 0x00000278 Length: 0x0000006F + // WARNING: managed resource file FSharpOptimizationData.test created +} +.module test.exe + // MVID: {5AA663EB-D9C1-2E4E-A745-0383EB63A65A} +.imagebase 0x00400000 +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 // WINDOWS_CUI +.corflags 0x00000001 // ILONLY +// Image base: 0x02BF0000 + + +// =============== CLASS MEMBERS DECLARATION =================== + +.class public abstract auto ansi sealed Test + extends [mscorlib]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .field public static literal int32 x = int32(0x00000007) + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.LiteralAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public static int32 main(string[] argv) cil managed + { + .entrypoint + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.EntryPointAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 2 (0x2) + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: ret + } // end of method Test::main + +} // end of class Test + +.class private abstract auto ansi sealed ''.$Test + extends [mscorlib]System.Object +{ +} // end of class ''.$Test + + +// ============================================================= + +// *********** DISASSEMBLY COMPLETE *********************** +// WARNING: Created Win32 resource file test.res diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/env.lst b/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/env.lst new file mode 100644 index 0000000000..9ca12d8cea --- /dev/null +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/env.lst @@ -0,0 +1,9 @@ + SOURCE=AsyncExpressionSteppingTest1.fs SCFLAGS="-a -g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd AsyncExpressionSteppingTest1.dll" # AsyncExpressionSteppingTest1.fs - + + SOURCE=AsyncExpressionSteppingTest2.fs SCFLAGS="-a -g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd AsyncExpressionSteppingTest2.dll" # AsyncExpressionSteppingTest2.fs - + + SOURCE=AsyncExpressionSteppingTest3.fs SCFLAGS="-a -g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd AsyncExpressionSteppingTest3.dll" # AsyncExpressionSteppingTest3.fs - + + SOURCE=AsyncExpressionSteppingTest4.fs SCFLAGS="-a -g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd AsyncExpressionSteppingTest4.dll" # AsyncExpressionSteppingTest4.fs - + SOURCE=AsyncExpressionSteppingTest5.fs SCFLAGS="-a -g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd AsyncExpressionSteppingTest5.dll" # AsyncExpressionSteppingTest5.fs - + SOURCE=AsyncExpressionSteppingTest6.fs SCFLAGS="-a -g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd AsyncExpressionSteppingTest6.dll" # AsyncExpressionSteppingTest6.fs - diff --git a/tests/fsharpqa/Source/test.lst b/tests/fsharpqa/Source/test.lst index d4301fedb9..c0c482eb69 100644 --- a/tests/fsharpqa/Source/test.lst +++ b/tests/fsharpqa/Source/test.lst @@ -14,6 +14,7 @@ CodeGen01,NoMT,CodeGen CodeGen\EmittedIL\DoNotBoxStruct CodeGen01,NoMT,CodeGen CodeGen\EmittedIL\GeneratedIterators CodeGen01,NoMT,CodeGen CodeGen\EmittedIL\InequalityComparison CodeGen01,NoMT,CodeGen CodeGen\EmittedIL\ListExpressionStepping +CodeGen01,NoMT,CodeGen CodeGen\EmittedIL\LiteralValue CodeGen01,NoMT,CodeGen CodeGen\EmittedIL\MethodImplAttribute CodeGen01,NoMT,CodeGen CodeGen\EmittedIL\Misc CodeGen01,NoMT,CodeGen CodeGen\EmittedIL\Mutation From 44af17a202939cfd7819c3334d41b5d8761c3e42 Mon Sep 17 00:00:00 2001 From: Avi Avni Date: Tue, 13 Mar 2018 10:36:00 +0200 Subject: [PATCH 098/147] fix env --- .../Source/CodeGen/EmittedIL/LiteralValue/env.lst | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/env.lst b/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/env.lst index 9ca12d8cea..084a161de6 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/env.lst +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/env.lst @@ -1,9 +1 @@ - SOURCE=AsyncExpressionSteppingTest1.fs SCFLAGS="-a -g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd AsyncExpressionSteppingTest1.dll" # AsyncExpressionSteppingTest1.fs - - - SOURCE=AsyncExpressionSteppingTest2.fs SCFLAGS="-a -g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd AsyncExpressionSteppingTest2.dll" # AsyncExpressionSteppingTest2.fs - - - SOURCE=AsyncExpressionSteppingTest3.fs SCFLAGS="-a -g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd AsyncExpressionSteppingTest3.dll" # AsyncExpressionSteppingTest3.fs - - - SOURCE=AsyncExpressionSteppingTest4.fs SCFLAGS="-a -g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd AsyncExpressionSteppingTest4.dll" # AsyncExpressionSteppingTest4.fs - - SOURCE=AsyncExpressionSteppingTest5.fs SCFLAGS="-a -g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd AsyncExpressionSteppingTest5.dll" # AsyncExpressionSteppingTest5.fs - - SOURCE=AsyncExpressionSteppingTest6.fs SCFLAGS="-a -g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd AsyncExpressionSteppingTest6.dll" # AsyncExpressionSteppingTest6.fs - + SOURCE=LiteralValue.fs SCFLAGS="-a -g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd LiteralValue.dll" # LiteralValue.fs - \ No newline at end of file From a4927e182d439e85e1efac43f206bb0c122ed59a Mon Sep 17 00:00:00 2001 From: John Wostenberg Date: Tue, 13 Mar 2018 06:55:56 -0500 Subject: [PATCH 099/147] Update DEVGUIDE.md (#4501) * Add documentation about XLF localization and updating resx * Clean up doc a little bit, and make some changes suggested by markdownlint * Grammar * Change wording * Fix formatting mistake * Fix another typo --- DEVGUIDE.md | 56 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/DEVGUIDE.md b/DEVGUIDE.md index 2a17dc3806..d15d0554cb 100644 --- a/DEVGUIDE.md +++ b/DEVGUIDE.md @@ -2,21 +2,23 @@ Follow the instructions below to build and develop the F# Compiler, Core Library and tools on Windows, macOS and Linux. -* [Developing the F# Compiler (Windows)](#developing-the-f-compiler-windows) -* [Developing the F# Compiler (Linux)](#developing-the-f-compiler-linux) -* [Developing the F# Compiler (macOS)](#developing-the-f-compiler-macos) -* [Developing the Visual F# IDE Tools (Windows Only)](#developing-the-visual-f-ide-tools-windows-only) -* [Notes and Resources](#notes) +- [Developing the F# Compiler (Windows)](#developing-the-f-compiler-windows) +- [Developing the F# Compiler (Linux)](#developing-the-f-compiler-linux) +- [Developing the F# Compiler (macOS)](#developing-the-f-compiler-macos) +- [Developing the Visual F# IDE Tools (Windows Only)](#developing-the-visual-f-ide-tools-windows-only) +- [Notes and Resources](#notes) -### Developing the F# Compiler (Windows) +### Developing the F# Compiler (Windows) Install - [.NET 4.6](https://www.microsoft.com/en-gb/download/details.aspx?id=48130) **NOTE on Windows:** -1. It is recommended to run the build.cmd and the qualifiers be on a command prompt with path set to have the location of MSBuild. If you have Visual Studio, we can also run using `Developer Command Prompt for Visual Studio 20xx` (depends on Visual Studio version). This developer command prompt is easier to use than normal command prompt, because it already has the correct path of Visual Studio and .NET's tooling set for us to use (including MSBuild). -2. The running command prompt must be run under Administrator right (`Run as Administrator`). + +1. It is recommended to run `build.cmd` in a command prompt with path set to have the location of MSBuild. If you have Visual Studio, we can run using `Developer Command Prompt for Visual Studio 20xx` (depends on Visual Studio version). This developer command prompt is easier to use than normal command prompt, because it already has the correct path of Visual Studio and .NET's tooling set for us to use (including MSBuild). + +2. The command prompt must have Administrator rights (`Run as Administrator`). Before running the build scripts, ensure that you have cleaned up the visualfsharp repo by running this git command: @@ -59,18 +61,18 @@ After you build the first time you can open and use this solution: or just build it directly: - msbuild FSharp.sln + msbuild FSharp.sln If you are just developing the core compiler and library then building ``FSharp.sln`` will be enough. -### Developing the F# Compiler (Linux) +### Developing the F# Compiler (Linux) For Linux/Mono, follow [these instructions](http://www.mono-project.com/docs/getting-started/install/linux/). Also you may need: sudo apt-get install mono-complete make git Then: - + make Then to replace your machine-wide installation: @@ -79,7 +81,7 @@ Then to replace your machine-wide installation: Full testing is not yet enabled on Linux. -### Developing the F# Compiler (macOS) +### Developing the F# Compiler (macOS) Install XCode command line tools (or homebrew equivalents) and Mono or Visual Studio for Mac. @@ -99,25 +101,25 @@ You can specify a custom installation path using the DESTDIR shell variable DESTDIR=/my/path/to/fsharp make install -### Developing the F# Compiler (Linux or macOS - .NET Core) +### Developing the F# Compiler (Linux or macOS - .NET Core) Install [the latest .NET SDK](https://www.microsoft.com/net/download/). Then use - src/buildfromsource.sh + src/buildfromsource.sh -Outputs are placed in +Outputs are placed in BuildFromSource/Debug/... BuildFromSource/Release/... -This uses an installed .NET SDK 2.0 to build the various duplicated project - -Testing the .NET Core version of the F# compiler on macOS and Linux is TBD. +This uses an installed .NET SDK 2.0 to build the various duplicated project +Testing the .NET Core version of the F# compiler on macOS and Linux is TBD. ### Developing the Visual F# IDE Tools (Windows Only) To build and test Visual F# IDE Tools, install these requirements: + - [Visual Studio 2017](https://www.visualstudio.com/downloads/) - Under the "Windows" workloads, select ".NET desktop development" - Select "F# desktop language support" under the optional components @@ -131,16 +133,16 @@ Steps to build: Use ``VisualFSharp.sln`` if you're building the Visual F# IDE Tools. -Note on Debug vs Release: ``Release`` Configuration has a degraded debugging experience, so if you want to test a change locally, it is recommended to do it in the ``Debug`` configuration. For more information see https://github.com/Microsoft/visualfsharp/issues/2771 and https://github.com/Microsoft/visualfsharp/pull/2773. +Note on Debug vs Release: ``Release`` Configuration has a degraded debugging experience, so if you want to test a change locally, it is recommended to do it in the ``Debug`` configuration. For more information see issues [#2771](https://github.com/Microsoft/visualfsharp/issues/2771) and [#2773](https://github.com/Microsoft/visualfsharp/pull/2773). -Note: if you face this error [#2351](https://github.com/Microsoft/visualfsharp/issues/2351): +Note ([#2351](https://github.com/Microsoft/visualfsharp/issues/2351)): if you face this error: -> error VSSDK1077: Unable to locate the extensions directory. "ExternalSettingsManager::GetScopePaths failed to initialize PkgDefManager for C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe". +> error VSSDK1077: Unable to locate the extensions directory. "ExternalSettingsManager::GetScopePaths failed to initialize PkgDefManager for C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe". Or hard crash on launch ("Unknown Error"), delete these folders: -* `%localappdata%\Microsoft\VisualStudio\15.0_(some number here)RoslynDev` -* `%localappdata%\Microsoft\VisualStudio\15.0_(some number here)` +- `%localappdata%\Microsoft\VisualStudio\15.0_(some number here)RoslynDev` +- `%localappdata%\Microsoft\VisualStudio\15.0_(some number here)` #### [Optional] Install the Visual F# IDE Tools (Windows Only) @@ -183,7 +185,7 @@ This gives a much tighter inner development loop than uninstalling/reinstalling #### [Optional] Clobber the F# SDK on the machine -**Note:** The step below will try to clobber the machine-wide installed F# SDK on your machine. This replaces the ``fsc.exe`` used by the standard install location or ``Microsoft.FSharp.Targets``. **Repairing Visual Studio 15 is currently the only way to revert this step.** +**Note:*- The step below will try to clobber the machine-wide installed F# SDK on your machine. This replaces the ``fsc.exe`` used by the standard install location or ``Microsoft.FSharp.Targets``. **Repairing Visual Studio 15 is currently the only way to revert this step.** For **Debug**: @@ -230,6 +232,12 @@ If you are behind a proxy server, NuGet client tool must be configured to use it Where you should set proper proxy address, user name and password. +#### When modifying, adding, or removing keywords or compiler messages + +If your changes involve modifying the list of language keywords in any way, (e.g. when implementing a new keyword), the XLF localization files need to be synced with the corresponding resx files. This can be done automatically by running `msbuild FSharp.Compiler.Private.fsproj /t:UpdateXlf` (located in [src\fsharp\FSharp.Compiler.Private](https://github.com/Microsoft/visualfsharp/tree/master/src/fsharp/FSharp.Compiler.Private)). This only works on Windows/.NETStandard framework, so changing this from any other platform requires editing and syncing all of the XLF files manually. + +After this, you must copy any differing `resx` files from the output directory into the corresponding subdirectory in [src\buildfromsource](https://github.com/Microsoft/visualfsharp/tree/master/src/fsharp/FSharp.Compiler.Private). This step will soon be eliminated (see issue [#3905](https://github.com/Microsoft/visualfsharp/issues/3905)). + #### Resources The primary technical guide to the core compiler code is [The F# Compiler Technical Guide](http://fsharp.github.io/2015/09/29/fsharp-compiler-guide.html). Please read and contribute to that guide. From 957234c8a711b04b364bd8102b6e2ff5a5dcd6bd Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 13 Mar 2018 11:56:26 +0000 Subject: [PATCH 100/147] Update DEVGUIDE.md --- DEVGUIDE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEVGUIDE.md b/DEVGUIDE.md index d15d0554cb..3518e22884 100644 --- a/DEVGUIDE.md +++ b/DEVGUIDE.md @@ -185,7 +185,7 @@ This gives a much tighter inner development loop than uninstalling/reinstalling #### [Optional] Clobber the F# SDK on the machine -**Note:*- The step below will try to clobber the machine-wide installed F# SDK on your machine. This replaces the ``fsc.exe`` used by the standard install location or ``Microsoft.FSharp.Targets``. **Repairing Visual Studio 15 is currently the only way to revert this step.** +**Note:** The step below will try to clobber the machine-wide installed F# SDK on your machine. This replaces the ``fsc.exe`` used by the standard install location or ``Microsoft.FSharp.Targets``. **Repairing Visual Studio 15 is currently the only way to revert this step.** For **Debug**: From efc247b92db45c6f411f5769835ba24027c4b5ca Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Tue, 13 Mar 2018 10:34:57 -0700 Subject: [PATCH 101/147] normalize VSIX package versions with VS insertion item package versions --- build/targets/AssemblyVersions.props | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/build/targets/AssemblyVersions.props b/build/targets/AssemblyVersions.props index e0524c1023..350c2f55f8 100644 --- a/build/targets/AssemblyVersions.props +++ b/build/targets/AssemblyVersions.props @@ -39,16 +39,14 @@ Then $(BuildTimeStamp_Date) = 161225 Then $(BuildTimeStamp_Number) = 01 Then $(BuildTimeStamp) = 16122501 - Then $(MicroBuildAssemblyVersion_WithoutRevision) = 15.4.1 - Then $(VsixPackageVersion) = 15.4.1.16122501 + Then $(VsixPackageVersion) = 15.4.20161225.1 Then $(NuGetPackageVersionSuffix) = 161225-01 --> $(BUILD_BUILDNUMBER.Split('.')[0].Substring(2)) $(BUILD_BUILDNUMBER.Split('.')[1].PadLeft(2, '0')) $(BuildTimeStamp_Date)$(BuildTimeStamp_Number) - $(MicroBuildAssemblyVersion.Substring(0, $(MicroBuildAssemblyVersion.LastIndexOf('.')))) - $(MicroBuildAssemblyVersion_WithoutRevision).$(BuildTimeStamp) + $(VSAssemblyVersion.Split('.')[0]).$(VSAssemblyVersion.Split('.')[1]).$(BUILD_BUILDNUMBER) $(BuildTimeStamp_Date)-$(BuildTimeStamp_Number) From 230bd0309b6d5c94a2cfb718e9e567e767c05d31 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Tue, 13 Mar 2018 12:23:53 -0700 Subject: [PATCH 102/147] remove VisualFSharpOpenSource package --- DEVGUIDE.md | 6 +- VisualFSharp.sln | 11 - build/config/AssemblySignToolData.json | 1 - build/targets/AssemblyVersions.props | 3 +- setup/fsharp-setup-build.proj | 3 - .../Properties/launchSettings.json | 2 +- .../VisualFSharpFull/VisualFSharpFull.csproj | 1 - .../Properties/launchSettings.json | 9 - .../Source.extension.vsixmanifest | 64 ----- .../VisualFSharpOpenSource.csproj | 219 ------------------ .../fsharp-vsintegration-vsix-build.proj | 1 - vsintegration/update-vsintegration.cmd | 6 +- 12 files changed, 9 insertions(+), 317 deletions(-) delete mode 100644 vsintegration/Vsix/VisualFSharpOpenSource/Properties/launchSettings.json delete mode 100644 vsintegration/Vsix/VisualFSharpOpenSource/Source.extension.vsixmanifest delete mode 100644 vsintegration/Vsix/VisualFSharpOpenSource/VisualFSharpOpenSource.csproj diff --git a/DEVGUIDE.md b/DEVGUIDE.md index 3518e22884..9fd9345265 100644 --- a/DEVGUIDE.md +++ b/DEVGUIDE.md @@ -156,18 +156,18 @@ components installed in that VS installation. You can revert this step by disab For **Debug**, uninstall then reinstall: VSIXInstaller.exe /u:"VisualFSharp" - VSIXInstaller.exe debug\net40\bin\VisualFSharpOpenSource.vsix + VSIXInstaller.exe debug\net40\bin\VisualFSharpFull.vsix For **Release**, uninstall then reinstall: VSIXInstaller.exe /u:"VisualFSharp" - VSIXInstaller.exe release\net40\bin\VisualFSharpOpenSource.vsix + VSIXInstaller.exe release\net40\bin\VisualFSharpFull.vsix Restart Visual Studio, it should now be running your freshly-built Visual F# IDE Tools with updated F# Interactive. #### [Optional] F5 testing of local changes -To test your changes locally _without_ overwriting your default installed Visual F# tools, set the `VisualFSharp\Vsix\VisualFSharpOpenSource` +To test your changes locally _without_ overwriting your default installed Visual F# tools, set the `VisualFSharp\Vsix\VisualFSharpFull` project as the startup project. When you hit F5 a new instance of Visual Studio will be started in the `RoslynDev` hive with your changes, but the root (default) hive will remain untouched. You can also start this hive automatically using diff --git a/VisualFSharp.sln b/VisualFSharp.sln index 2f4557c883..13d2abc2e3 100644 --- a/VisualFSharp.sln +++ b/VisualFSharp.sln @@ -116,8 +116,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Vsix", "Vsix", "{141F6C23-E EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VisualFSharpFull", "vsintegration\Vsix\VisualFSharpFull\VisualFSharpFull.csproj", "{59ADCE46-9740-4079-834D-9A03A3494EBC}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VisualFSharpOpenSource", "vsintegration\Vsix\VisualFSharpOpenSource\VisualFSharpOpenSource.csproj", "{E6A45CDF-B408-420F-B475-74611BEFC52B}" -EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "HostedCompilerServer", "tests\fsharpqa\testenv\src\HostedCompilerServer\HostedCompilerServer.fsproj", "{4239EFEA-E746-446A-BF7A-51FCBAB13946}" EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "ILComparer", "tests\fsharpqa\testenv\src\ILComparer\ILComparer.fsproj", "{2E60864A-E3FF-4BCC-810F-DC7C34E6B236}" @@ -484,14 +482,6 @@ Global {59ADCE46-9740-4079-834D-9A03A3494EBC}.Release|Any CPU.Build.0 = Release|Any CPU {59ADCE46-9740-4079-834D-9A03A3494EBC}.Release|x86.ActiveCfg = Release|Any CPU {59ADCE46-9740-4079-834D-9A03A3494EBC}.Release|x86.Build.0 = Release|Any CPU - {E6A45CDF-B408-420F-B475-74611BEFC52B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E6A45CDF-B408-420F-B475-74611BEFC52B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E6A45CDF-B408-420F-B475-74611BEFC52B}.Debug|x86.ActiveCfg = Debug|Any CPU - {E6A45CDF-B408-420F-B475-74611BEFC52B}.Debug|x86.Build.0 = Debug|Any CPU - {E6A45CDF-B408-420F-B475-74611BEFC52B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E6A45CDF-B408-420F-B475-74611BEFC52B}.Release|Any CPU.Build.0 = Release|Any CPU - {E6A45CDF-B408-420F-B475-74611BEFC52B}.Release|x86.ActiveCfg = Release|Any CPU - {E6A45CDF-B408-420F-B475-74611BEFC52B}.Release|x86.Build.0 = Release|Any CPU {4239EFEA-E746-446A-BF7A-51FCBAB13946}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4239EFEA-E746-446A-BF7A-51FCBAB13946}.Debug|Any CPU.Build.0 = Debug|Any CPU {4239EFEA-E746-446A-BF7A-51FCBAB13946}.Debug|x86.ActiveCfg = Debug|Any CPU @@ -616,7 +606,6 @@ Global {1FB1DD07-06AA-45B4-B5AC-20FF5BEE98B6} = {F6DAEE9A-8BE1-4C4A-BC83-09215517C7DA} {141F6C23-E1B1-4D89-9F10-F0B8AD58E71F} = {4C7B48D7-19AF-4AE7-9D1D-3BB289D5480D} {59ADCE46-9740-4079-834D-9A03A3494EBC} = {141F6C23-E1B1-4D89-9F10-F0B8AD58E71F} - {E6A45CDF-B408-420F-B475-74611BEFC52B} = {141F6C23-E1B1-4D89-9F10-F0B8AD58E71F} {4239EFEA-E746-446A-BF7A-51FCBAB13946} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} {2E60864A-E3FF-4BCC-810F-DC7C34E6B236} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} {D086C8C6-D00D-4C3B-9AB2-A4286C9F5922} = {4C7B48D7-19AF-4AE7-9D1D-3BB289D5480D} diff --git a/build/config/AssemblySignToolData.json b/build/config/AssemblySignToolData.json index 0348dab38f..a4cac39ae6 100644 --- a/build/config/AssemblySignToolData.json +++ b/build/config/AssemblySignToolData.json @@ -50,7 +50,6 @@ "values": [ "net40\\bin\\VisualFSharpFull.vsix", "net40\\bin\\VisualFSharpTemplate.vsix", - "net40\\bin\\VisualFSharpOpenSource.vsix", "insertion\\Microsoft.FSharp.Dependencies.vsix", "insertion\\Microsoft.FSharp.VSIX.Full.Resources.*.vsix" ] diff --git a/build/targets/AssemblyVersions.props b/build/targets/AssemblyVersions.props index 350c2f55f8..c8d0dd7316 100644 --- a/build/targets/AssemblyVersions.props +++ b/build/targets/AssemblyVersions.props @@ -46,7 +46,8 @@ $(BUILD_BUILDNUMBER.Split('.')[0].Substring(2)) $(BUILD_BUILDNUMBER.Split('.')[1].PadLeft(2, '0')) $(BuildTimeStamp_Date)$(BuildTimeStamp_Number) - $(VSAssemblyVersion.Split('.')[0]).$(VSAssemblyVersion.Split('.')[1]).$(BUILD_BUILDNUMBER) + $(VSAssemblyVersion.Split('.')[0]).$(VSAssemblyVersion.Split('.')[1]).$(BUILD_BUILDNUMBER) + 42.42.42.42 $(BuildTimeStamp_Date)-$(BuildTimeStamp_Number) diff --git a/setup/fsharp-setup-build.proj b/setup/fsharp-setup-build.proj index 59e4780aa2..94d23f51a9 100644 --- a/setup/fsharp-setup-build.proj +++ b/setup/fsharp-setup-build.proj @@ -16,9 +16,6 @@ ..\vsintegration\Vsix\VisualFSharpFull\VisualFSharpFull.csproj - - ..\vsintegration\Vsix\VisualFSharpOpenSource\VisualFSharpOpenSource.csproj - ..\vsintegration\Vsix\VisualFSharpTemplates\VisualFSharpTemplates.csproj diff --git a/vsintegration/Vsix/VisualFSharpFull/Properties/launchSettings.json b/vsintegration/Vsix/VisualFSharpFull/Properties/launchSettings.json index b25381cd71..18d884aa2e 100644 --- a/vsintegration/Vsix/VisualFSharpFull/Properties/launchSettings.json +++ b/vsintegration/Vsix/VisualFSharpFull/Properties/launchSettings.json @@ -1,6 +1,6 @@ { "profiles": { - "VisualFSharpOpenSource": { + "VisualFSharpFull": { "commandName": "Executable", "executablePath": "$(DevEnvDir)devenv.exe", "commandLineArgs": "/rootsuffix $(VSSDKTargetPlatformRegRootSuffix) /log" diff --git a/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj b/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj index 0c016377fc..3f1be89483 100644 --- a/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj +++ b/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj @@ -7,7 +7,6 @@ Library Microsoft\FSharp netcoreapp1.0 - false diff --git a/vsintegration/Vsix/VisualFSharpOpenSource/Properties/launchSettings.json b/vsintegration/Vsix/VisualFSharpOpenSource/Properties/launchSettings.json deleted file mode 100644 index b25381cd71..0000000000 --- a/vsintegration/Vsix/VisualFSharpOpenSource/Properties/launchSettings.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "profiles": { - "VisualFSharpOpenSource": { - "commandName": "Executable", - "executablePath": "$(DevEnvDir)devenv.exe", - "commandLineArgs": "/rootsuffix $(VSSDKTargetPlatformRegRootSuffix) /log" - } - } -} \ No newline at end of file diff --git a/vsintegration/Vsix/VisualFSharpOpenSource/Source.extension.vsixmanifest b/vsintegration/Vsix/VisualFSharpOpenSource/Source.extension.vsixmanifest deleted file mode 100644 index 86a241cedb..0000000000 --- a/vsintegration/Vsix/VisualFSharpOpenSource/Source.extension.vsixmanifest +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - Visual F# Tools - Deploy Visual F# Tools Binaries and Templates to Visual Studio - Microsoft.FSharp.VSIX.OpenSource.Core - https://docs.microsoft.com/en-us/dotnet/articles/fsharp/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vsintegration/Vsix/VisualFSharpOpenSource/VisualFSharpOpenSource.csproj b/vsintegration/Vsix/VisualFSharpOpenSource/VisualFSharpOpenSource.csproj deleted file mode 100644 index b349ae9ddc..0000000000 --- a/vsintegration/Vsix/VisualFSharpOpenSource/VisualFSharpOpenSource.csproj +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - net46 - Library - Microsoft\FSharp - netcoreapp1.0 - - - - - Designer - - - Always - true - RegisterFsharpPackage.pkgdef - - - PreserveNewest - License.txt - true - - - PreserveNewest - packages\System.ValueTuple.4.4.0.nupkg - true - - - - - - {649FA588-F02E-457C-9FCF-87E46407481E} - FSharp.Compiler.Interactive.Settings - BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3b - DebugSymbolsProjectOutputGroup%3b - True - - - {D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06} - FSharp.Compiler.Server.Shared - BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3b - DebugSymbolsProjectOutputGroup%3b - True - - - {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3} - FSharp.Compiler.Private - BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3b - DebugSymbolsProjectOutputGroup%3b - True - - - {DED3BBD7-53F4-428A-8C9F-27968E768605} - FSharp.Core - BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3b - DebugSymbolsProjectOutputGroup%3b - True - - - {8B3E283D-B5FE-4055-9D80-7E3A32F3967B} - FsiAnyCPU - BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3b - DebugSymbolsProjectOutputGroup%3b - True - - - {D0E98C0D-490B-4C61-9329-0862F6E87645} - Fsi - BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3b - DebugSymbolsProjectOutputGroup%3b - True - - - {65e0e82a-eace-4787-8994-888674c2fe87} - FSharp.Editor - BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3bPkgDefProjectOutputGroup%3b - DebugSymbolsProjectOutputGroup%3b - True - - - {c4586a06-1402-48bc-8e35-a1b8642f895b} - FSharp.UIResources - BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3b - DebugSymbolsProjectOutputGroup%3b - True - - - {1C5C163C-37EA-4A3C-8CCC-0D34B74BF8EF} - FSharp.LanguageService.Base - BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3bPkgDefProjectOutputGroup%3b - DebugSymbolsProjectOutputGroup%3b - True - - - {EE85AAB7-CDA0-4C4E-BDA0-A64CCC413E3F} - FSharp.LanguageService - BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3bPkgDefProjectOutputGroup%3b - DebugSymbolsProjectOutputGroup%3b - True - - - {B700E38B-F8C0-4E49-B5EC-DB7B7AC0C4E7} - ProjectSystem.Base - BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3bPkgDefProjectOutputGroup%3b - DebugSymbolsProjectOutputGroup%3b - True - - - {6196B0F8-CAEA-4CF1-AF82-1B520F77FE44} - ProjectSystem - BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3bPkgDefProjectOutputGroup%3b - DebugSymbolsProjectOutputGroup%3b - True - - - {FCFB214C-462E-42B3-91CA-FC557EFEE74F} - FSharp.PropertiesPages - BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3bPkgDefProjectOutputGroup%3b - DebugSymbolsProjectOutputGroup%3b - True - - - {991DCF75-C2EB-42B6-9A0D-AA1D2409D519} - FSharp.VS.FSI - BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3bPkgDefProjectOutputGroup%3b - DebugSymbolsProjectOutputGroup%3b - True - - - {6ba13aa4-c25f-480f-856b-8e8000299a72} - AppConfig - ItemTemplates - TemplateProjectOutputGroup%3b - false - True - - - {12ac2813-e895-4aaa-ae6c-94e21da09f64} - CodeFile - ItemTemplates - TemplateProjectOutputGroup%3b - false - True - - - {0385564F-07B4-4264-AB8A-17C393E9140C} - ResourceFile - ItemTemplates - TemplateProjectOutputGroup%3b - false - True - - - {a333b85a-dc23-49b6-9797-b89a7951e92d} - ScriptFile - ItemTemplates - TemplateProjectOutputGroup%3b - false - True - - - {e3fdd4ac-46b6-4b9f-b672-317d1202cc50} - SignatureFile - ItemTemplates - TemplateProjectOutputGroup%3b - false - True - - - {d11fc318-8f5d-4c8c-9287-ab40a016d13c} - TextFile - ItemTemplates - TemplateProjectOutputGroup%3b - false - True - - - {1fb1dd07-06aa-45b4-b5ac-20ff5bee98b6} - XMLFile - ItemTemplates - TemplateProjectOutputGroup%3b - false - True - - - {604f0daa-2d33-48dd-b162-edf0b672803d} - ConsoleProject - ProjectTemplates - TemplateProjectOutputGroup%3b - false - True - - - {01678cda-a11f-4dee-9344-2edf91cf1ae7} - LibraryProject - ProjectTemplates - TemplateProjectOutputGroup%3b - false - True - - - {2facee44-48bd-40b5-a2ee-b54a0c9bb7c4} - TutorialProject - ProjectTemplates - TemplateProjectOutputGroup%3b - false - True - - - - - - - - - diff --git a/vsintegration/fsharp-vsintegration-vsix-build.proj b/vsintegration/fsharp-vsintegration-vsix-build.proj index 8d3c826e8e..d7f6d10b43 100644 --- a/vsintegration/fsharp-vsintegration-vsix-build.proj +++ b/vsintegration/fsharp-vsintegration-vsix-build.proj @@ -7,7 +7,6 @@ - diff --git a/vsintegration/update-vsintegration.cmd b/vsintegration/update-vsintegration.cmd index 4961053c21..b300bbbad5 100644 --- a/vsintegration/update-vsintegration.cmd +++ b/vsintegration/update-vsintegration.cmd @@ -20,7 +20,7 @@ @rem * Installation of F# FSC compiler and FSI are done in the SHARED SDK directory. Henceforth @rem each installation of Visual Studio 2017 will use the updated FSC.exe and the commandline @rem FSI.exe. The in-product VS FSI plugin, syntax highlighting and IntelliSense must be -@rem installed through VSIXInstaller.exe debug\net40\bin\VisualFSharpOpenSource.vsix +@rem installed through VSIXInstaller.exe debug\net40\bin\VisualFSharpFull.vsix @rem @rem This procedure needs to be changed once F# supports multiple side-by-side installations @rem at which point everything will go through VSIXInstaller.exe @@ -117,12 +117,12 @@ echo. echo For Release builds: echo. echo ^> VSIXInstaller.exe /u:"VisualFSharp" -echo ^> VSIXInstaller.exe release\net40\bin\VisualFSharpOpenSource.vsix +echo ^> VSIXInstaller.exe release\net40\bin\VisualFSharpFull.vsix echo. echo For Debug builds: echo. echo ^> VSIXInstaller.exe /u:"VisualFSharp" -echo ^> VSIXInstaller.exe debug\net40\bin\VisualFSharpOpenSource.vsix +echo ^> VSIXInstaller.exe debug\net40\bin\VisualFSharpFull.vsix echo. exit /b 1 From c0de51dd8b7b86636548e0eb748ec633c88d8261 Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Sun, 11 Mar 2018 00:41:30 -0800 Subject: [PATCH 103/147] Fix Literal fields --- src/fsharp/IlxGen.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fsharp/IlxGen.fs b/src/fsharp/IlxGen.fs index 704a92f760..30fa6e835a 100644 --- a/src/fsharp/IlxGen.fs +++ b/src/fsharp/IlxGen.fs @@ -4742,7 +4742,7 @@ and GenBindingAfterSequencePoint cenv cgbuf eenv sp (TBind(vspec,rhsExpr,_)) sta let ilFieldDef = mkILStaticField (fspec.Name, fty, None, None, access) let ilFieldDef = match vref.LiteralValue with - | Some konst -> { ilFieldDef.WithHasDefault(true) with LiteralValue = Some(GenFieldInit m konst) } + | Some konst -> { (ilFieldDef.WithHasDefault(true)).WithLiteral(true) with LiteralValue = Some(GenFieldInit m konst) } | None -> ilFieldDef let ilFieldDef = From 406c9d6226bf6ec6858f3dcfe2e7bb4ec9528118 Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Tue, 13 Mar 2018 01:57:21 -0700 Subject: [PATCH 104/147] refactor --- src/absil/il.fs | 3 +-- src/absil/il.fsi | 3 +-- src/fsharp/IlxGen.fs | 9 ++++----- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/absil/il.fs b/src/absil/il.fs index 3316f156e6..03b462375f 100644 --- a/src/absil/il.fs +++ b/src/absil/il.fs @@ -1558,8 +1558,7 @@ type ILFieldDef = member x.WithStatic(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition FieldAttributes.Static } member x.WithSpecialName(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition (FieldAttributes.SpecialName ||| FieldAttributes.RTSpecialName) } member x.WithNotSerialized(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition FieldAttributes.NotSerialized } - member x.WithLiteral(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition FieldAttributes.Literal } - member x.WithHasDefault(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition FieldAttributes.HasDefault } + member x.WithLiteralDefaultValue(literal) = { x with LiteralValue = literal; Attributes = x.Attributes |> conditionalAdd literal.IsSome (FieldAttributes.Literal ||| FieldAttributes.HasDefault) } member x.WithHasFieldMarshal(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition FieldAttributes.HasFieldMarshal } diff --git a/src/absil/il.fsi b/src/absil/il.fsi index cb24a7180a..d7f2146e31 100644 --- a/src/absil/il.fsi +++ b/src/absil/il.fsi @@ -1138,8 +1138,7 @@ type ILFieldDef = member WithStatic: bool -> ILFieldDef member WithSpecialName: bool -> ILFieldDef member WithNotSerialized: bool -> ILFieldDef - member WithLiteral: bool -> ILFieldDef - member WithHasDefault: bool -> ILFieldDef + member WithLiteralDefaultValue: ILFieldInit option -> ILFieldDef member WithHasFieldMarshal: bool -> ILFieldDef /// Tables of fields. Logically equivalent to a list of fields but diff --git a/src/fsharp/IlxGen.fs b/src/fsharp/IlxGen.fs index 30fa6e835a..f2c6da249d 100644 --- a/src/fsharp/IlxGen.fs +++ b/src/fsharp/IlxGen.fs @@ -4742,7 +4742,7 @@ and GenBindingAfterSequencePoint cenv cgbuf eenv sp (TBind(vspec,rhsExpr,_)) sta let ilFieldDef = mkILStaticField (fspec.Name, fty, None, None, access) let ilFieldDef = match vref.LiteralValue with - | Some konst -> { (ilFieldDef.WithHasDefault(true)).WithLiteral(true) with LiteralValue = Some(GenFieldInit m konst) } + | Some konst -> ilFieldDef.WithLiteralDefaultValue( Some (GenFieldInit m konst) ) | None -> ilFieldDef let ilFieldDef = @@ -6347,8 +6347,8 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = { Name = ilFieldName Type = ilPropType Attributes = enum 0 - Data = None - LiteralValue = literalValue + Data = None + LiteralValue = None Offset = ilFieldOffset Marshal = ilFieldMarshal CustomAttrs = mkILCustomAttrs (GenAttrs cenv eenv fattribs @ extraAttribs) } @@ -6357,8 +6357,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = .WithStatic(isStatic) .WithSpecialName(ilFieldName="value__" && tycon.IsEnumTycon) .WithNotSerialized(ilNotSerialized) - .WithLiteral(fspec.LiteralValue.IsSome) - .WithHasDefault(literalValue.IsSome) + .WithLiteralDefaultValue(literalValue) .WithHasFieldMarshal(ilFieldMarshal.IsSome) yield fdef From ccd130a81139c19f83ad46f8d1ce026f6e545988 Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Tue, 13 Mar 2018 17:46:15 -0700 Subject: [PATCH 105/147] fix test --- .../LiteralValue/LiteralValue.il.bsl | 20 ++++++++++--------- .../CodeGen/EmittedIL/LiteralValue/env.lst | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/LiteralValue.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/LiteralValue.il.bsl index 86655b9a6e..32a104642e 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/LiteralValue.il.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/LiteralValue.il.bsl @@ -14,7 +14,7 @@ .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: .ver 4:4:3:0 } -.assembly test +.assembly LiteralValue { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, int32, @@ -26,17 +26,17 @@ .hash algorithm 0x00008004 .ver 0:0:0:0 } -.mresource public FSharpSignatureData.test +.mresource public FSharpSignatureData.LiteralValue { // Offset: 0x00000000 Length: 0x00000274 // WARNING: managed resource file FSharpSignatureData.test created } -.mresource public FSharpOptimizationData.test +.mresource public FSharpOptimizationData.LiteralValue { // Offset: 0x00000278 Length: 0x0000006F // WARNING: managed resource file FSharpOptimizationData.test created } -.module test.exe +.module LiteralValue.exe // MVID: {5AA663EB-D9C1-2E4E-A745-0383EB63A65A} .imagebase 0x00400000 .file alignment 0x00000200 @@ -48,7 +48,7 @@ // =============== CLASS MEMBERS DECLARATION =================== -.class public abstract auto ansi sealed Test +.class public abstract auto ansi sealed LiteralValue extends [mscorlib]System.Object { .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) @@ -61,16 +61,18 @@ .custom instance void [FSharp.Core]Microsoft.FSharp.Core.EntryPointAttribute::.ctor() = ( 01 00 00 00 ) // Code size 2 (0x2) .maxstack 8 + .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' + .line 6,6 : 5,6 'D:\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\LiteralValue\\LiteralValue.fs' IL_0000: ldc.i4.0 IL_0001: ret - } // end of method Test::main + } // end of method LiteralValue::main -} // end of class Test +} // end of class LiteralValue -.class private abstract auto ansi sealed ''.$Test +.class private abstract auto ansi sealed ''.$LiteralValue extends [mscorlib]System.Object { -} // end of class ''.$Test +} // end of class ''.$LiteralValue // ============================================================= diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/env.lst b/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/env.lst index 084a161de6..5566c4d1da 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/env.lst +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/env.lst @@ -1 +1 @@ - SOURCE=LiteralValue.fs SCFLAGS="-a -g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd LiteralValue.dll" # LiteralValue.fs - \ No newline at end of file + SOURCE=LiteralValue.fs SCFLAGS="-g --test:LiteralValue --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd LiteralValue.exe" # LiteralValue.fs - \ No newline at end of file From 4b131f85b8489fb3057543089c14736fc3594c70 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Wed, 14 Mar 2018 08:21:23 +0100 Subject: [PATCH 106/147] Use WithFieldMarshal --- src/absil/il.fs | 2 +- src/absil/il.fsi | 2 +- src/fsharp/IlxGen.fs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/absil/il.fs b/src/absil/il.fs index 03b462375f..2b172b3a12 100644 --- a/src/absil/il.fs +++ b/src/absil/il.fs @@ -1559,7 +1559,7 @@ type ILFieldDef = member x.WithSpecialName(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition (FieldAttributes.SpecialName ||| FieldAttributes.RTSpecialName) } member x.WithNotSerialized(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition FieldAttributes.NotSerialized } member x.WithLiteralDefaultValue(literal) = { x with LiteralValue = literal; Attributes = x.Attributes |> conditionalAdd literal.IsSome (FieldAttributes.Literal ||| FieldAttributes.HasDefault) } - member x.WithHasFieldMarshal(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition FieldAttributes.HasFieldMarshal } + member x.WithFieldMarshal(marshal) = { x with Marshal = marshal; Attributes = x.Attributes |> conditionalAdd marshal.IsSome FieldAttributes.HasFieldMarshal } // Index table by name. Keep a canonical list to make sure field order is not disturbed for binary manipulation. diff --git a/src/absil/il.fsi b/src/absil/il.fsi index d7f2146e31..d067c3c0ee 100644 --- a/src/absil/il.fsi +++ b/src/absil/il.fsi @@ -1139,7 +1139,7 @@ type ILFieldDef = member WithSpecialName: bool -> ILFieldDef member WithNotSerialized: bool -> ILFieldDef member WithLiteralDefaultValue: ILFieldInit option -> ILFieldDef - member WithHasFieldMarshal: bool -> ILFieldDef + member WithFieldMarshal: ILNativeType option -> ILFieldDef /// Tables of fields. Logically equivalent to a list of fields but /// the table is kept in a form optimized for looking up fields by diff --git a/src/fsharp/IlxGen.fs b/src/fsharp/IlxGen.fs index f2c6da249d..f22cb2c0ec 100644 --- a/src/fsharp/IlxGen.fs +++ b/src/fsharp/IlxGen.fs @@ -6350,7 +6350,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = Data = None LiteralValue = None Offset = ilFieldOffset - Marshal = ilFieldMarshal + Marshal = None CustomAttrs = mkILCustomAttrs (GenAttrs cenv eenv fattribs @ extraAttribs) } let fdef = fdef.WithAccess(access) @@ -6358,7 +6358,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = .WithSpecialName(ilFieldName="value__" && tycon.IsEnumTycon) .WithNotSerialized(ilNotSerialized) .WithLiteralDefaultValue(literalValue) - .WithHasFieldMarshal(ilFieldMarshal.IsSome) + .WithFieldMarshal(ilFieldMarshal) yield fdef if requiresExtraField then From 2d2104b1fce6ed0bae26695f28fb9913c9ff9bf5 Mon Sep 17 00:00:00 2001 From: Matthias Dittrich Date: Wed, 14 Mar 2018 19:01:17 +0100 Subject: [PATCH 107/147] Suggestion for Debugging the code-base (#4500) * suggest improvement * add try-with --- src/fsharp/range.fs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/fsharp/range.fs b/src/fsharp/range.fs index aed660be56..d1da4643be 100755 --- a/src/fsharp/range.fs +++ b/src/fsharp/range.fs @@ -140,7 +140,11 @@ let fileOfFileIndex n = fileIndexTable.IndexToFile(n) let mkPos l c = pos (l, c) [] +#if DEBUG +[ {DebugCode}")>] +#else [] +#endif type range(code:int64) = static member Zero = range(0L) new (fidx, bl, bc, el, ec) = @@ -163,6 +167,19 @@ type range(code:int64) = member m.StartRange = range (m.FileIndex, m.Start, m.Start) member m.EndRange = range (m.FileIndex, m.End, m.End) member r.FileName = fileOfFileIndex r.FileIndex +#if DEBUG + member r.DebugCode = + try + let endCol = r.EndColumn - 1 + let startCol = r.StartColumn - 1 + File.ReadAllLines(r.FileName) + |> Seq.skip (r.StartLine - 1) + |> Seq.take (r.EndLine - r.StartLine + 1) + |> String.concat "\n" + |> fun s -> s.Substring(startCol + 1, s.LastIndexOf("\n") + 1 - startCol + endCol) + with e -> + e.ToString() +#endif member r.MakeSynthetic() = range(code ||| isSyntheticMask) override r.ToString() = sprintf "%s (%d,%d--%d,%d) IsSynthetic=%b" r.FileName r.StartLine r.StartColumn r.EndLine r.EndColumn r.IsSynthetic member r.ToShortString() = sprintf "(%d,%d--%d,%d)" r.StartLine r.StartColumn r.EndLine r.EndColumn From f44878577fa9bbda41b85ad4454b3d54a4eec2e2 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 14 Mar 2018 18:07:20 +0000 Subject: [PATCH 108/147] filter more symbols --- src/fsharp/service/ServiceAnalysis.fs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/fsharp/service/ServiceAnalysis.fs b/src/fsharp/service/ServiceAnalysis.fs index 018e9f42c5..b34fce7997 100644 --- a/src/fsharp/service/ServiceAnalysis.fs +++ b/src/fsharp/service/ServiceAnalysis.fs @@ -98,6 +98,12 @@ module UnusedOpens = | :? FSharpMemberOrFunctionOrValue as fv when fv.IsExtensionMember -> // Extension members should be taken into account even though they have a prefix (as they do most of the time) true + | :? FSharpMemberOrFunctionOrValue as fv when not fv.IsModuleValueOrMember -> + // Local values can be ignored + false + | :? FSharpGenericParameter -> + // Generic parameters can be ignored, they never come into scope via 'open' + false | _ -> // For the rest of symbols we pick only those which are the first part of a long ident, because it's they which are // contained in opened namespaces / modules. For example, we pick `IO` from long ident `IO.File.OpenWrite` because From 6453d1b5b28649c010b2eb606ae7023c0ba372be Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Wed, 14 Mar 2018 19:39:44 +0100 Subject: [PATCH 109/147] Restructure NameResolution (#4471) --- src/fsharp/NameResolution.fs | 1491 +++++++++-------- src/fsharp/NameResolution.fsi | 4 +- src/fsharp/TypeChecker.fs | 53 +- src/fsharp/pars.fsy | 7 + .../E_GlobalQualifierAfterDot.fs | 6 + .../ErrorMessages/NameResolution/env.lst | 1 + 6 files changed, 798 insertions(+), 764 deletions(-) create mode 100644 tests/fsharpqa/Source/ErrorMessages/NameResolution/E_GlobalQualifierAfterDot.fs diff --git a/src/fsharp/NameResolution.fs b/src/fsharp/NameResolution.fs index 2715b65e27..d69ac29173 100644 --- a/src/fsharp/NameResolution.fs +++ b/src/fsharp/NameResolution.fs @@ -1751,17 +1751,14 @@ let CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities //------------------------------------------------------------------------- /// Perform name resolution for an identifier which must resolve to be a namespace or module. -let rec ResolveLongIndentAsModuleOrNamespace sink atMostOne amap m fullyQualified (nenv:NameResolutionEnv) ad (lid:Ident list) isOpenDecl = - match lid with - | [] -> NoResultsOrUsefulErrors - - | id :: rest when id.idText = MangledGlobalName -> - if isNil rest then +let rec ResolveLongIndentAsModuleOrNamespace sink atMostOne amap m first fullyQualified (nenv:NameResolutionEnv) ad (id:Ident) (rest:Ident list) isOpenDecl = + if first && id.idText = MangledGlobalName then + match rest with + | [] -> error (Error(FSComp.SR.nrGlobalUsedOnlyAsFirstName(), id.idRange)) - else - ResolveLongIndentAsModuleOrNamespace sink atMostOne amap m FullyQualified nenv ad rest isOpenDecl - - | id :: rest -> + | id2::rest2 -> + ResolveLongIndentAsModuleOrNamespace sink atMostOne amap m false FullyQualified nenv ad id2 rest2 isOpenDecl + else let moduleOrNamespaces = nenv.ModulesAndNamespaces fullyQualified let namespaceNotFound = lazy( let suggestModulesAndNamespaces() = @@ -1813,23 +1810,24 @@ let rec ResolveLongIndentAsModuleOrNamespace sink atMostOne amap m fullyQualifie modrefs |> CollectResults2 atMostOne (fun modref -> if IsEntityAccessible amap m ad modref then - notifyNameResolution modref id.idRange + notifyNameResolution modref id.idRange look 1 modref modref.ModuleOrNamespaceType rest else raze (namespaceNotFound.Force())) | None -> raze (namespaceNotFound.Force()) -let ResolveLongIndentAsModuleOrNamespaceThen sink atMostOne amap m fullyQualified (nenv:NameResolutionEnv) ad lid isOpenDecl f = - match lid with - | [] -> NoResultsOrUsefulErrors - | id :: rest -> - match ResolveLongIndentAsModuleOrNamespace sink ResultCollectionSettings.AllResults amap m fullyQualified nenv ad [id] isOpenDecl with - | Result modrefs -> - modrefs |> CollectResults2 atMostOne (fun (depth,modref,mty) -> - let resInfo = ResolutionInfo.Empty.AddEntity(id.idRange,modref) - f resInfo (depth+1) id.idRange modref mty rest) - | Exception err -> Exception err +let ResolveLongIndentAsModuleOrNamespaceThen sink atMostOne amap m fullyQualified (nenv:NameResolutionEnv) ad id rest isOpenDecl f = + match ResolveLongIndentAsModuleOrNamespace sink ResultCollectionSettings.AllResults amap m true fullyQualified nenv ad id [] isOpenDecl with + | Result modrefs -> + match rest with + | [] -> error(Error(FSComp.SR.nrUnexpectedEmptyLongId(),id.idRange)) + | id2::rest2 -> + modrefs + |> CollectResults2 atMostOne (fun (depth,modref,mty) -> + let resInfo = ResolutionInfo.Empty.AddEntity(id.idRange,modref) + f resInfo (depth+1) id.idRange modref mty id2 rest2) + | Exception err -> Exception err //------------------------------------------------------------------------- // Bind name used in "new Foo.Bar(...)" constructs @@ -2041,155 +2039,156 @@ let GetRecordLabelsForType g nenv typ = // REVIEW: this shows up on performance logs. Consider for example endless resolutions of "List.map" to // the empty set of results, or "x.Length" for a list or array type. This indicates it could be worth adding a cache here. -let rec ResolveLongIdentInTypePrim (ncenv:NameResolver) nenv lookupKind (resInfo:ResolutionInfo) depth m ad (lid:Ident list) findFlag (typeNameResInfo: TypeNameResolutionInfo) typ = +let rec ResolveLongIdentInTypePrim (ncenv:NameResolver) nenv lookupKind (resInfo:ResolutionInfo) depth m ad (id:Ident) (rest:Ident list) findFlag (typeNameResInfo: TypeNameResolutionInfo) typ = let g = ncenv.g - match lid with - | [] -> error(InternalError("ResolveLongIdentInTypePrim",m)) - | id :: rest -> - let m = unionRanges m id.idRange - let nm = id.idText // used to filter the searches of the tables - let optFilter = Some nm // used to filter the searches of the tables - let contentsSearchAccessible = - let unionCaseSearch = - match lookupKind with - | LookupKind.Expr | LookupKind.Pattern -> TryFindUnionCaseOfType g typ nm - | _ -> None - - // Lookup: datatype constructors take precedence - match unionCaseSearch with - | Some ucase -> - OneResult (success(resInfo,Item.UnionCase(ucase,false),rest)) - | None -> - let isLookUpExpr = lookupKind = LookupKind.Expr - match TryFindIntrinsicNamedItemOfType ncenv.InfoReader (nm,ad) findFlag m typ with - | Some (PropertyItem psets) when isLookUpExpr -> - let pinfos = psets |> ExcludeHiddenOfPropInfos g ncenv.amap m + let m = unionRanges m id.idRange + let nm = id.idText // used to filter the searches of the tables + let optFilter = Some nm // used to filter the searches of the tables + let contentsSearchAccessible = + let unionCaseSearch = + match lookupKind with + | LookupKind.Expr | LookupKind.Pattern -> TryFindUnionCaseOfType g typ nm + | _ -> None + + // Lookup: datatype constructors take precedence + match unionCaseSearch with + | Some ucase -> + OneResult (success(resInfo,Item.UnionCase(ucase,false),rest)) + | None -> + let isLookUpExpr = lookupKind = LookupKind.Expr + match TryFindIntrinsicNamedItemOfType ncenv.InfoReader (nm,ad) findFlag m typ with + | Some (PropertyItem psets) when isLookUpExpr -> + let pinfos = psets |> ExcludeHiddenOfPropInfos g ncenv.amap m - // fold the available extension members into the overload resolution - let extensionPropInfos = ExtensionPropInfosOfTypeInScope ncenv.InfoReader nenv (optFilter,ad) m typ + // fold the available extension members into the overload resolution + let extensionPropInfos = ExtensionPropInfosOfTypeInScope ncenv.InfoReader nenv (optFilter,ad) m typ - // make sure to keep the intrinsic pinfos before the extension pinfos in the list, - // since later on this logic is used when giving preference to intrinsic definitions - match DecodeFSharpEvent (pinfos@extensionPropInfos) ad g ncenv m with - | Some x -> success [resInfo, x, rest] - | None -> raze (UndefinedName (depth,FSComp.SR.undefinedNameFieldConstructorOrMember, id,NoSuggestions)) - | Some(MethodItem msets) when isLookUpExpr -> - let minfos = msets |> ExcludeHiddenOfMethInfos g ncenv.amap m + // make sure to keep the intrinsic pinfos before the extension pinfos in the list, + // since later on this logic is used when giving preference to intrinsic definitions + match DecodeFSharpEvent (pinfos@extensionPropInfos) ad g ncenv m with + | Some x -> success [resInfo, x, rest] + | None -> raze (UndefinedName (depth,FSComp.SR.undefinedNameFieldConstructorOrMember, id,NoSuggestions)) + | Some(MethodItem msets) when isLookUpExpr -> + let minfos = msets |> ExcludeHiddenOfMethInfos g ncenv.amap m - // fold the available extension members into the overload resolution - let extensionMethInfos = ExtensionMethInfosOfTypeInScope ncenv.InfoReader nenv optFilter m typ + // fold the available extension members into the overload resolution + let extensionMethInfos = ExtensionMethInfosOfTypeInScope ncenv.InfoReader nenv optFilter m typ - success [resInfo,Item.MakeMethGroup (nm,minfos@extensionMethInfos),rest] - | Some (ILFieldItem (finfo:: _)) when (match lookupKind with LookupKind.Expr | LookupKind.Pattern -> true | _ -> false) -> - success [resInfo,Item.ILField finfo,rest] + success [resInfo,Item.MakeMethGroup (nm,minfos@extensionMethInfos),rest] + | Some (ILFieldItem (finfo:: _)) when (match lookupKind with LookupKind.Expr | LookupKind.Pattern -> true | _ -> false) -> + success [resInfo,Item.ILField finfo,rest] - | Some (EventItem (einfo :: _)) when isLookUpExpr -> - success [resInfo,Item.Event einfo,rest] - | Some (RecdFieldItem (rfinfo)) when (match lookupKind with LookupKind.Expr | LookupKind.RecdField | LookupKind.Pattern -> true | _ -> false) -> - success [resInfo,Item.RecdField(rfinfo),rest] - | _ -> + | Some (EventItem (einfo :: _)) when isLookUpExpr -> + success [resInfo,Item.Event einfo,rest] + | Some (RecdFieldItem (rfinfo)) when (match lookupKind with LookupKind.Expr | LookupKind.RecdField | LookupKind.Pattern -> true | _ -> false) -> + success [resInfo,Item.RecdField(rfinfo),rest] + | _ -> - let pinfos = ExtensionPropInfosOfTypeInScope ncenv.InfoReader nenv (optFilter, ad) m typ - if not (isNil pinfos) && isLookUpExpr then OneResult(success (resInfo,Item.Property (nm,pinfos),rest)) else - let minfos = ExtensionMethInfosOfTypeInScope ncenv.InfoReader nenv optFilter m typ + let pinfos = ExtensionPropInfosOfTypeInScope ncenv.InfoReader nenv (optFilter, ad) m typ + if not (isNil pinfos) && isLookUpExpr then OneResult(success (resInfo,Item.Property (nm,pinfos),rest)) else + let minfos = ExtensionMethInfosOfTypeInScope ncenv.InfoReader nenv optFilter m typ - if not (isNil minfos) && isLookUpExpr then - success [resInfo,Item.MakeMethGroup (nm,minfos),rest] - elif isTyparTy g typ then raze (IndeterminateType(unionRanges m id.idRange)) - else NoResultsOrUsefulErrors + if not (isNil minfos) && isLookUpExpr then + success [resInfo,Item.MakeMethGroup (nm,minfos),rest] + elif isTyparTy g typ then raze (IndeterminateType(unionRanges m id.idRange)) + else NoResultsOrUsefulErrors - match contentsSearchAccessible with - | Result res when not (isNil res) -> contentsSearchAccessible - | Exception _ -> contentsSearchAccessible - | _ -> + match contentsSearchAccessible with + | Result res when not (isNil res) -> contentsSearchAccessible + | Exception _ -> contentsSearchAccessible + | _ -> - let nestedSearchAccessible = - let nestedTypes = GetNestedTypesOfType (ad, ncenv, Some nm, (if isNil rest then typeNameResInfo.StaticArgsInfo else TypeNameResolutionStaticArgsInfo.Indefinite), true, m) typ - if isNil rest then - if isNil nestedTypes then - NoResultsOrUsefulErrors - else - match typeNameResInfo.ResolutionFlag with - | ResolveTypeNamesToCtors -> - nestedTypes - |> CollectAtMostOneResult (ResolveObjectConstructorPrim ncenv nenv.eDisplayEnv resInfo m ad) - |> MapResults (fun (resInfo,item) -> (resInfo,item,[])) - | ResolveTypeNamesToTypeRefs -> - OneSuccess (resInfo,Item.Types (nm,nestedTypes),rest) + let nestedSearchAccessible = + match rest with + | [] -> + let nestedTypes = GetNestedTypesOfType (ad, ncenv, Some nm, typeNameResInfo.StaticArgsInfo, true, m) typ + if isNil nestedTypes then + NoResultsOrUsefulErrors else - ResolveLongIdentInNestedTypes ncenv nenv lookupKind resInfo (depth+1) id m ad rest findFlag typeNameResInfo nestedTypes - - match nestedSearchAccessible with - | Result res when not (isNil res) -> nestedSearchAccessible - | _ -> - let suggestMembers() = - let suggestions1 = - ExtensionPropInfosOfTypeInScope ncenv.InfoReader nenv (None, ad) m typ - |> List.map (fun p -> p.PropertyName) + match typeNameResInfo.ResolutionFlag with + | ResolveTypeNamesToCtors -> + nestedTypes + |> CollectAtMostOneResult (ResolveObjectConstructorPrim ncenv nenv.eDisplayEnv resInfo m ad) + |> MapResults (fun (resInfo,item) -> (resInfo,item,[])) + | ResolveTypeNamesToTypeRefs -> + OneSuccess (resInfo,Item.Types (nm,nestedTypes),rest) + | id2::rest2 -> + let nestedTypes = GetNestedTypesOfType (ad, ncenv, Some nm, TypeNameResolutionStaticArgsInfo.Indefinite, true, m) typ + ResolveLongIdentInNestedTypes ncenv nenv lookupKind resInfo (depth+1) id m ad id2 rest2 findFlag typeNameResInfo nestedTypes + + match nestedSearchAccessible with + | Result res when not (isNil res) -> nestedSearchAccessible + | _ -> + let suggestMembers() = + let suggestions1 = + ExtensionPropInfosOfTypeInScope ncenv.InfoReader nenv (None, ad) m typ + |> List.map (fun p -> p.PropertyName) - let suggestions2 = - ExtensionMethInfosOfTypeInScope ncenv.InfoReader nenv None m typ - |> List.map (fun m -> m.DisplayName) - - let suggestions3 = - GetIntrinsicPropInfosOfType ncenv.InfoReader (None, ad, AllowMultiIntfInstantiations.No) findFlag m typ - |> List.map (fun p -> p.PropertyName) - - let suggestions4 = - GetIntrinsicMethInfosOfType ncenv.InfoReader (None, ad, AllowMultiIntfInstantiations.No) findFlag m typ - |> List.filter (fun m -> not m.IsClassConstructor && not m.IsConstructor) - |> List.map (fun m -> m.DisplayName) - - let suggestions5 = GetRecordLabelsForType g nenv typ - - let suggestions6 = - match lookupKind with - | LookupKind.Expr | LookupKind.Pattern -> - if isAppTy g typ then - let tcref,_ = destAppTy g typ - tcref.UnionCasesArray - |> Array.map (fun uc -> uc.DisplayName) - else - [||] - | _ -> [||] + let suggestions2 = + ExtensionMethInfosOfTypeInScope ncenv.InfoReader nenv None m typ + |> List.map (fun m -> m.DisplayName) + + let suggestions3 = + GetIntrinsicPropInfosOfType ncenv.InfoReader (None, ad, AllowMultiIntfInstantiations.No) findFlag m typ + |> List.map (fun p -> p.PropertyName) + + let suggestions4 = + GetIntrinsicMethInfosOfType ncenv.InfoReader (None, ad, AllowMultiIntfInstantiations.No) findFlag m typ + |> List.filter (fun m -> not m.IsClassConstructor && not m.IsConstructor) + |> List.map (fun m -> m.DisplayName) + + let suggestions5 = GetRecordLabelsForType g nenv typ + + let suggestions6 = + match lookupKind with + | LookupKind.Expr | LookupKind.Pattern -> + if isAppTy g typ then + let tcref,_ = destAppTy g typ + tcref.UnionCasesArray + |> Array.map (fun uc -> uc.DisplayName) + else + [||] + | _ -> [||] - [ yield! suggestions1 - yield! suggestions2 - yield! suggestions3 - yield! suggestions4 - yield! suggestions5 - yield! suggestions6 ] - |> HashSet - - raze (UndefinedName (depth,FSComp.SR.undefinedNameFieldConstructorOrMember, id, suggestMembers)) + [ yield! suggestions1 + yield! suggestions2 + yield! suggestions3 + yield! suggestions4 + yield! suggestions5 + yield! suggestions6 ] + |> HashSet + + raze (UndefinedName (depth,FSComp.SR.undefinedNameFieldConstructorOrMember, id, suggestMembers)) -and ResolveLongIdentInNestedTypes (ncenv:NameResolver) nenv lookupKind resInfo depth id m ad lid findFlag typeNameResInfo typs = - typs |> CollectAtMostOneResult (fun typ -> +and ResolveLongIdentInNestedTypes (ncenv:NameResolver) nenv lookupKind resInfo depth id m ad (id2:Ident) (rest:Ident list) findFlag typeNameResInfo typs = + typs + |> CollectAtMostOneResult (fun typ -> let resInfo = if isAppTy ncenv.g typ then resInfo.AddEntity(id.idRange,tcrefOfAppTy ncenv.g typ) else resInfo - ResolveLongIdentInTypePrim ncenv nenv lookupKind resInfo depth m ad lid findFlag typeNameResInfo typ + ResolveLongIdentInTypePrim ncenv nenv lookupKind resInfo depth m ad id2 rest findFlag typeNameResInfo typ |> AtMostOneResult m) /// Resolve a long identifier using type-qualified name resolution. -let ResolveLongIdentInType sink ncenv nenv lookupKind m ad lid findFlag typeNameResInfo typ = - let resInfo,item,rest = - ResolveLongIdentInTypePrim (ncenv:NameResolver) nenv lookupKind ResolutionInfo.Empty 0 m ad lid findFlag typeNameResInfo typ +let ResolveLongIdentInType sink ncenv nenv lookupKind m ad id findFlag typeNameResInfo typ = + let resInfo,item,rest = + ResolveLongIdentInTypePrim (ncenv:NameResolver) nenv lookupKind ResolutionInfo.Empty 0 m ad id [] findFlag typeNameResInfo typ |> AtMostOneResult m |> ForceRaise + ResolutionInfo.SendEntityPathToSink (sink,ncenv,nenv,ItemOccurence.UseInType,ad,resInfo,ResultTyparChecker(fun () -> CheckAllTyparsInferrable ncenv.amap m item)) item,rest -let private ResolveLongIdentInTyconRef (ncenv:NameResolver) nenv lookupKind resInfo depth m ad lid typeNameResInfo tcref = +let private ResolveLongIdentInTyconRef (ncenv:NameResolver) nenv lookupKind resInfo depth m ad id rest typeNameResInfo tcref = #if !NO_EXTENSIONTYPING // No dotting through type generators to get to a member! CheckForDirectReferenceToGeneratedType (tcref, PermitDirectReferenceToGeneratedType.No, m) #endif let typ = FreshenTycon ncenv m tcref - typ |> ResolveLongIdentInTypePrim ncenv nenv lookupKind resInfo depth m ad lid IgnoreOverrides typeNameResInfo + typ |> ResolveLongIdentInTypePrim ncenv nenv lookupKind resInfo depth m ad id rest IgnoreOverrides typeNameResInfo -let private ResolveLongIdentInTyconRefs atMostOne (ncenv:NameResolver) nenv lookupKind depth m ad lid typeNameResInfo idRange tcrefs = +let private ResolveLongIdentInTyconRefs atMostOne (ncenv:NameResolver) nenv lookupKind depth m ad id rest typeNameResInfo idRange tcrefs = tcrefs |> CollectResults2 atMostOne (fun (resInfo:ResolutionInfo,tcref) -> let resInfo = resInfo.AddEntity(idRange,tcref) - tcref |> ResolveLongIdentInTyconRef ncenv nenv lookupKind resInfo depth m ad lid typeNameResInfo |> AtMostOneResult m) + tcref |> ResolveLongIdentInTyconRef ncenv nenv lookupKind resInfo depth m ad id rest typeNameResInfo |> AtMostOneResult m) //------------------------------------------------------------------------- // ResolveExprLongIdentInModuleOrNamespace @@ -2199,116 +2198,115 @@ let (|AccessibleEntityRef|_|) amap m ad (modref: ModuleOrNamespaceRef) mspec = let eref = modref.NestedTyconRef mspec if IsEntityAccessible amap m ad eref then Some eref else None -let rec ResolveExprLongIdentInModuleOrNamespace (ncenv:NameResolver) nenv (typeNameResInfo: TypeNameResolutionInfo) ad resInfo depth m modref (mty:ModuleOrNamespaceType) (lid :Ident list) = +let rec ResolveExprLongIdentInModuleOrNamespace (ncenv:NameResolver) nenv (typeNameResInfo: TypeNameResolutionInfo) ad resInfo depth m modref (mty:ModuleOrNamespaceType) (id:Ident) (rest :Ident list) = // resInfo records the modules or namespaces actually relevant to a resolution - match lid with - | [] -> raze(Error(FSComp.SR.nrUnexpectedEmptyLongId(),m)) - | id :: rest -> - let m = unionRanges m id.idRange - match mty.AllValsByLogicalName.TryFind(id.idText) with - | Some vspec when IsValAccessible ad (mkNestedValRef modref vspec) -> - success(resInfo,Item.Value (mkNestedValRef modref vspec),rest) - | _-> - match mty.ExceptionDefinitionsByDemangledName.TryFind(id.idText) with - | Some excon when IsTyconReprAccessible ncenv.amap m ad (modref.NestedTyconRef excon) -> - success (resInfo,Item.ExnCase (modref.NestedTyconRef excon),rest) + let m = unionRanges m id.idRange + match mty.AllValsByLogicalName.TryFind(id.idText) with + | Some vspec when IsValAccessible ad (mkNestedValRef modref vspec) -> + success(resInfo,Item.Value (mkNestedValRef modref vspec),rest) + | _-> + match mty.ExceptionDefinitionsByDemangledName.TryFind(id.idText) with + | Some excon when IsTyconReprAccessible ncenv.amap m ad (modref.NestedTyconRef excon) -> + success (resInfo,Item.ExnCase (modref.NestedTyconRef excon),rest) + | _ -> + // Something in a discriminated union without RequireQualifiedAccess attribute? + let unionSearch,hasRequireQualifiedAccessAttribute = + match TryFindTypeWithUnionCase modref id with + | Some tycon when IsTyconReprAccessible ncenv.amap m ad (modref.NestedTyconRef tycon) -> + let ucref = mkUnionCaseRef (modref.NestedTyconRef tycon) id.idText + let ucinfo = FreshenUnionCaseRef ncenv m ucref + let hasRequireQualifiedAccessAttribute = HasFSharpAttribute ncenv.g ncenv.g.attrib_RequireQualifiedAccessAttribute tycon.Attribs + success [resInfo,Item.UnionCase(ucinfo,hasRequireQualifiedAccessAttribute),rest],hasRequireQualifiedAccessAttribute + | _ -> NoResultsOrUsefulErrors,false + + match unionSearch with + | Result (res :: _) when not hasRequireQualifiedAccessAttribute -> success res | _ -> - // Something in a discriminated union without RequireQualifiedAccess attribute? - let unionSearch,hasRequireQualifiedAccessAttribute = - match TryFindTypeWithUnionCase modref id with - | Some tycon when IsTyconReprAccessible ncenv.amap m ad (modref.NestedTyconRef tycon) -> - let ucref = mkUnionCaseRef (modref.NestedTyconRef tycon) id.idText - let ucinfo = FreshenUnionCaseRef ncenv m ucref - let hasRequireQualifiedAccessAttribute = HasFSharpAttribute ncenv.g ncenv.g.attrib_RequireQualifiedAccessAttribute tycon.Attribs - success [resInfo,Item.UnionCase(ucinfo,hasRequireQualifiedAccessAttribute),rest],hasRequireQualifiedAccessAttribute - | _ -> NoResultsOrUsefulErrors,false - - match unionSearch with - | Result (res :: _) when not hasRequireQualifiedAccessAttribute -> success res - | _ -> - // Something in a type? - let tyconSearch = - let tcrefs = LookupTypeNameInEntityMaybeHaveArity (ncenv.amap, id.idRange, ad, id.idText, (if isNil rest then typeNameResInfo.StaticArgsInfo else TypeNameResolutionStaticArgsInfo.Indefinite), modref) - if isNil tcrefs then NoResultsOrUsefulErrors else - let tcrefs = tcrefs |> List.map (fun tcref -> (resInfo,tcref)) - if not (isNil rest) then - let tcrefs = CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities (tcrefs, TypeNameResolutionInfo (ResolveTypeNamesToTypeRefs,TypeNameResolutionStaticArgsInfo.Indefinite), PermitDirectReferenceToGeneratedType.No, unionRanges m id.idRange) - ResolveLongIdentInTyconRefs ResultCollectionSettings.AtMostOneResult ncenv nenv LookupKind.Expr (depth+1) m ad rest typeNameResInfo id.idRange tcrefs - // Check if we've got some explicit type arguments - else - let tcrefs = CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities (tcrefs, typeNameResInfo, PermitDirectReferenceToGeneratedType.No, unionRanges m id.idRange) - match typeNameResInfo.ResolutionFlag with - | ResolveTypeNamesToTypeRefs -> - success [ for (resInfo,tcref) in tcrefs do - let typ = FreshenTycon ncenv m tcref - let item = (resInfo,Item.Types(id.idText,[typ]),[]) - yield item ] - | ResolveTypeNamesToCtors -> - tcrefs - |> List.map (fun (resInfo, tcref) -> resInfo, FreshenTycon ncenv m tcref) - |> CollectAtMostOneResult (fun (resInfo,typ) -> ResolveObjectConstructorPrim ncenv nenv.eDisplayEnv resInfo id.idRange ad typ) - |> MapResults (fun (resInfo,item) -> (resInfo,item,[])) - - match tyconSearch with - | Result (res :: _) -> success res + // Something in a type? + let tyconSearch = + let tcrefs = LookupTypeNameInEntityMaybeHaveArity (ncenv.amap, id.idRange, ad, id.idText, (if isNil rest then typeNameResInfo.StaticArgsInfo else TypeNameResolutionStaticArgsInfo.Indefinite), modref) + if isNil tcrefs then NoResultsOrUsefulErrors else + let tcrefs = tcrefs |> List.map (fun tcref -> (resInfo,tcref)) + match rest with + | id2::rest2 -> + let tcrefs = CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities (tcrefs, TypeNameResolutionInfo (ResolveTypeNamesToTypeRefs,TypeNameResolutionStaticArgsInfo.Indefinite), PermitDirectReferenceToGeneratedType.No, unionRanges m id.idRange) + ResolveLongIdentInTyconRefs ResultCollectionSettings.AtMostOneResult ncenv nenv LookupKind.Expr (depth+1) m ad id2 rest2 typeNameResInfo id.idRange tcrefs + // Check if we've got some explicit type arguments | _ -> + let tcrefs = CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities (tcrefs, typeNameResInfo, PermitDirectReferenceToGeneratedType.No, unionRanges m id.idRange) + match typeNameResInfo.ResolutionFlag with + | ResolveTypeNamesToTypeRefs -> + success [ for (resInfo,tcref) in tcrefs do + let typ = FreshenTycon ncenv m tcref + let item = (resInfo,Item.Types(id.idText,[typ]),[]) + yield item ] + | ResolveTypeNamesToCtors -> + tcrefs + |> List.map (fun (resInfo, tcref) -> resInfo, FreshenTycon ncenv m tcref) + |> CollectAtMostOneResult (fun (resInfo,typ) -> ResolveObjectConstructorPrim ncenv nenv.eDisplayEnv resInfo id.idRange ad typ) + |> MapResults (fun (resInfo,item) -> (resInfo,item,[])) - // Something in a sub-namespace or sub-module - let moduleSearch = - if not (isNil rest) then - match mty.ModulesAndNamespacesByDemangledName.TryFind(id.idText) with - | Some(AccessibleEntityRef ncenv.amap m ad modref submodref) -> - let resInfo = resInfo.AddEntity(id.idRange,submodref) + match tyconSearch with + | Result (res :: _) -> success res + | _ -> - OneResult (ResolveExprLongIdentInModuleOrNamespace ncenv nenv typeNameResInfo ad resInfo (depth+1) m submodref submodref.ModuleOrNamespaceType rest) - | _ -> - NoResultsOrUsefulErrors - else + // Something in a sub-namespace or sub-module + let moduleSearch = + match rest with + | id2::rest2 -> + match mty.ModulesAndNamespacesByDemangledName.TryFind(id.idText) with + | Some(AccessibleEntityRef ncenv.amap m ad modref submodref) -> + let resInfo = resInfo.AddEntity(id.idRange,submodref) + + OneResult (ResolveExprLongIdentInModuleOrNamespace ncenv nenv typeNameResInfo ad resInfo (depth+1) m submodref submodref.ModuleOrNamespaceType id2 rest2) + | _ -> NoResultsOrUsefulErrors + | _ -> + NoResultsOrUsefulErrors + + match tyconSearch +++ moduleSearch +++ unionSearch with + | Result [] -> + let suggestPossibleTypesAndNames() = + let types = + modref.ModuleOrNamespaceType.AllEntities + |> Seq.filter (fun e -> IsEntityAccessible ncenv.amap m ad (modref.NestedTyconRef e)) + |> Seq.map (fun e -> e.DisplayName) - match tyconSearch +++ moduleSearch +++ unionSearch with - | Result [] -> - let suggestPossibleTypesAndNames() = - let types = - modref.ModuleOrNamespaceType.AllEntities - |> Seq.filter (fun e -> IsEntityAccessible ncenv.amap m ad (modref.NestedTyconRef e)) - |> Seq.map (fun e -> e.DisplayName) - - let submodules = - mty.ModulesAndNamespacesByDemangledName - |> Seq.filter (fun kv -> IsEntityAccessible ncenv.amap m ad (modref.NestedTyconRef kv.Value)) - |> Seq.map (fun e -> e.Value.DisplayName) + let submodules = + mty.ModulesAndNamespacesByDemangledName + |> Seq.filter (fun kv -> IsEntityAccessible ncenv.amap m ad (modref.NestedTyconRef kv.Value)) + |> Seq.map (fun e -> e.Value.DisplayName) - let unions = - modref.ModuleOrNamespaceType.AllEntities - |> Seq.collect (fun tycon -> - let hasRequireQualifiedAccessAttribute = HasFSharpAttribute ncenv.g ncenv.g.attrib_RequireQualifiedAccessAttribute tycon.Attribs - if hasRequireQualifiedAccessAttribute then - [||] - else - tycon.UnionCasesArray) - |> Seq.map (fun uc -> uc.DisplayName) - - let vals = - modref.ModuleOrNamespaceType.AllValsByLogicalName - |> Seq.filter (fun e -> IsValAccessible ad (mkNestedValRef modref e.Value)) - |> Seq.map (fun e -> e.Value.DisplayName) + let unions = + modref.ModuleOrNamespaceType.AllEntities + |> Seq.collect (fun tycon -> + let hasRequireQualifiedAccessAttribute = HasFSharpAttribute ncenv.g ncenv.g.attrib_RequireQualifiedAccessAttribute tycon.Attribs + if hasRequireQualifiedAccessAttribute then + [||] + else + tycon.UnionCasesArray) + |> Seq.map (fun uc -> uc.DisplayName) + + let vals = + modref.ModuleOrNamespaceType.AllValsByLogicalName + |> Seq.filter (fun e -> IsValAccessible ad (mkNestedValRef modref e.Value)) + |> Seq.map (fun e -> e.Value.DisplayName) - let exns = - modref.ModuleOrNamespaceType.ExceptionDefinitionsByDemangledName - |> Seq.filter (fun e -> IsTyconReprAccessible ncenv.amap m ad (modref.NestedTyconRef e.Value)) - |> Seq.map (fun e -> e.Value.DisplayName) + let exns = + modref.ModuleOrNamespaceType.ExceptionDefinitionsByDemangledName + |> Seq.filter (fun e -> IsTyconReprAccessible ncenv.amap m ad (modref.NestedTyconRef e.Value)) + |> Seq.map (fun e -> e.Value.DisplayName) - [ yield! types - yield! submodules - yield! unions - yield! vals - yield! exns ] - |> HashSet + [ yield! types + yield! submodules + yield! unions + yield! vals + yield! exns ] + |> HashSet - raze (UndefinedName(depth,FSComp.SR.undefinedNameValueConstructorNamespaceOrType,id,suggestPossibleTypesAndNames)) - | results -> AtMostOneResult id.idRange results + raze (UndefinedName(depth,FSComp.SR.undefinedNameValueConstructorNamespaceOrType,id,suggestPossibleTypesAndNames)) + | results -> AtMostOneResult id.idRange results /// An identifier has resolved to a type name in an expression (corresponding to one or more TyconRefs). /// Return either a set of constructors (later refined by overload resolution), or a set of TyconRefs. @@ -2328,328 +2326,328 @@ let ChooseTyconRefInExpr (ncenv:NameResolver, m, ad, nenv, id:Ident, typeNameRes /// Resolve F# "A.B.C" syntax in expressions /// Not all of the sequence will necessarily be swallowed, i.e. we return some identifiers /// that may represent further actions, e.g. further lookups. -let rec ResolveExprLongIdentPrim sink (ncenv:NameResolver) fullyQualified m ad nenv (typeNameResInfo:TypeNameResolutionInfo) lid isOpenDecl = +let rec ResolveExprLongIdentPrim sink (ncenv:NameResolver) first fullyQualified m ad nenv (typeNameResInfo:TypeNameResolutionInfo) (id:Ident) (rest:Ident list) isOpenDecl = let resInfo = ResolutionInfo.Empty - match lid with - | [] -> error (Error(FSComp.SR.nrInvalidExpression(textOfLid lid), m)) - - | [id] when id.idText = MangledGlobalName -> - error (Error(FSComp.SR.nrGlobalUsedOnlyAsFirstName(), id.idRange)) - - | [id;next] when id.idText = MangledGlobalName -> - ResolveExprLongIdentPrim sink ncenv fullyQualified m ad nenv typeNameResInfo [next] isOpenDecl - - | id :: lid when id.idText = MangledGlobalName -> - ResolveExprLongIdentPrim sink ncenv FullyQualified m ad nenv typeNameResInfo lid isOpenDecl - - | [id] when fullyQualified <> FullyQualified -> - let typeError = ref None - // Single identifier. Lookup the unqualified names in the environment - let envSearch = - match nenv.eUnqualifiedItems.TryFind(id.idText) with - - // The name is a type name and it has not been clobbered by some other name - | Some (Item.UnqualifiedType tcrefs) -> + if first && id.idText = MangledGlobalName then + match rest with + | [] -> + error (Error(FSComp.SR.nrGlobalUsedOnlyAsFirstName(), id.idRange)) + | [next] -> + ResolveExprLongIdentPrim sink ncenv false fullyQualified m ad nenv typeNameResInfo next [] isOpenDecl + | id2::rest2 -> + ResolveExprLongIdentPrim sink ncenv false FullyQualified m ad nenv typeNameResInfo id2 rest2 isOpenDecl + else + if isNil rest && fullyQualified <> FullyQualified then + let typeError = ref None + // Single identifier. Lookup the unqualified names in the environment + let envSearch = + match nenv.eUnqualifiedItems.TryFind(id.idText) with + + // The name is a type name and it has not been clobbered by some other name + | Some (Item.UnqualifiedType tcrefs) -> - // Do not use type names from the environment if an explicit type instantiation is - // given and the number of type parameters do not match - let tcrefs = - tcrefs |> List.filter (fun tcref -> - typeNameResInfo.StaticArgsInfo.HasNoStaticArgsInfo || - typeNameResInfo.StaticArgsInfo.NumStaticArgs = tcref.Typars(m).Length) + // Do not use type names from the environment if an explicit type instantiation is + // given and the number of type parameters do not match + let tcrefs = + tcrefs |> List.filter (fun tcref -> + typeNameResInfo.StaticArgsInfo.HasNoStaticArgsInfo || + typeNameResInfo.StaticArgsInfo.NumStaticArgs = tcref.Typars(m).Length) - let search = ChooseTyconRefInExpr (ncenv, m, ad, nenv, id, typeNameResInfo, resInfo, tcrefs) - match AtMostOneResult m search with - | Result _ as res -> - let resInfo,item,rest = ForceRaise res - ResolutionInfo.SendEntityPathToSink(sink,ncenv,nenv,ItemOccurence.Use,ad,resInfo,ResultTyparChecker(fun () -> CheckAllTyparsInferrable ncenv.amap m item)) - Some(item,rest) - | Exception e -> typeError := Some e; None - - | Some res -> - Some (FreshenUnqualifiedItem ncenv m res, []) - | None -> - None - - match envSearch with - | Some res -> res - | None -> - let innerSearch = - // Check if it's a type name, e.g. a constructor call or a type instantiation - let ctorSearch = - let tcrefs = LookupTypeNameInEnvMaybeHaveArity fullyQualified id.idText typeNameResInfo nenv - ChooseTyconRefInExpr (ncenv, m, ad, nenv, id, typeNameResInfo, resInfo, tcrefs) - - match ctorSearch with - | Result res when not (isNil res) -> ctorSearch - | _ -> - - let implicitOpSearch = - if IsMangledOpName id.idText then - success [(resInfo,Item.ImplicitOp(id, ref None),[])] - else - NoResultsOrUsefulErrors + let search = ChooseTyconRefInExpr (ncenv, m, ad, nenv, id, typeNameResInfo, resInfo, tcrefs) + match AtMostOneResult m search with + | Result _ as res -> + let resInfo,item,rest = ForceRaise res + ResolutionInfo.SendEntityPathToSink(sink,ncenv,nenv,ItemOccurence.Use,ad,resInfo,ResultTyparChecker(fun () -> CheckAllTyparsInferrable ncenv.amap m item)) + Some(item,rest) + | Exception e -> typeError := Some e; None + + | Some res -> + Some (FreshenUnqualifiedItem ncenv m res, []) + | None -> + None - ctorSearch +++ implicitOpSearch + match envSearch with + | Some res -> res + | None -> + let innerSearch = + // Check if it's a type name, e.g. a constructor call or a type instantiation + let ctorSearch = + let tcrefs = LookupTypeNameInEnvMaybeHaveArity fullyQualified id.idText typeNameResInfo nenv + ChooseTyconRefInExpr (ncenv, m, ad, nenv, id, typeNameResInfo, resInfo, tcrefs) + + match ctorSearch with + | Result res when not (isNil res) -> ctorSearch + | _ -> - let resInfo,item,rest = - match AtMostOneResult m innerSearch with - | Result _ as res -> ForceRaise res - | _ -> - let failingCase = - match !typeError with - | Some e -> raze e - | _ -> - let suggestNamesAndTypes() = - let suggestedNames = - nenv.eUnqualifiedItems - |> Seq.map (fun e -> e.Value.DisplayName) - - let suggestedTypes = - nenv.TyconsByDemangledNameAndArity fullyQualified - |> Seq.filter (fun e -> IsEntityAccessible ncenv.amap m ad e.Value) - |> Seq.map (fun e -> e.Value.DisplayName) - - let suggestedModulesAndNamespaces = - nenv.ModulesAndNamespaces fullyQualified - |> Seq.collect (fun kv -> kv.Value) - |> Seq.filter (fun modref -> IsEntityAccessible ncenv.amap m ad modref) - |> Seq.collect (fun e -> [e.DisplayName; e.DemangledModuleOrNamespaceName]) - - let unions = - // check if the user forgot to use qualified access - nenv.eTyconsByDemangledNameAndArity - |> Seq.choose (fun e -> - let hasRequireQualifiedAccessAttribute = HasFSharpAttribute ncenv.g ncenv.g.attrib_RequireQualifiedAccessAttribute e.Value.Attribs - if not hasRequireQualifiedAccessAttribute then - None - else - if e.Value.IsUnionTycon && e.Value.UnionCasesArray |> Array.exists (fun c -> c.DisplayName = id.idText) then - Some e.Value - else - None) - |> Seq.map (fun t -> t.DisplayName + "." + id.idText) + let implicitOpSearch = + if IsMangledOpName id.idText then + success [(resInfo,Item.ImplicitOp(id, ref None),[])] + else + NoResultsOrUsefulErrors + + ctorSearch +++ implicitOpSearch + + let resInfo,item,rest = + match AtMostOneResult m innerSearch with + | Result _ as res -> ForceRaise res + | _ -> + let failingCase = + match !typeError with + | Some e -> raze e + | _ -> + let suggestNamesAndTypes() = + let suggestedNames = + nenv.eUnqualifiedItems + |> Seq.map (fun e -> e.Value.DisplayName) + + let suggestedTypes = + nenv.TyconsByDemangledNameAndArity fullyQualified + |> Seq.filter (fun e -> IsEntityAccessible ncenv.amap m ad e.Value) + |> Seq.map (fun e -> e.Value.DisplayName) + + let suggestedModulesAndNamespaces = + nenv.ModulesAndNamespaces fullyQualified + |> Seq.collect (fun kv -> kv.Value) + |> Seq.filter (fun modref -> IsEntityAccessible ncenv.amap m ad modref) + |> Seq.collect (fun e -> [e.DisplayName; e.DemangledModuleOrNamespaceName]) + + let unions = + // check if the user forgot to use qualified access + nenv.eTyconsByDemangledNameAndArity + |> Seq.choose (fun e -> + let hasRequireQualifiedAccessAttribute = HasFSharpAttribute ncenv.g ncenv.g.attrib_RequireQualifiedAccessAttribute e.Value.Attribs + if not hasRequireQualifiedAccessAttribute then + None + else + if e.Value.IsUnionTycon && e.Value.UnionCasesArray |> Array.exists (fun c -> c.DisplayName = id.idText) then + Some e.Value + else + None) + |> Seq.map (fun t -> t.DisplayName + "." + id.idText) - [ yield! suggestedNames - yield! suggestedTypes - yield! suggestedModulesAndNamespaces - yield! unions ] - |> HashSet + [ yield! suggestedNames + yield! suggestedTypes + yield! suggestedModulesAndNamespaces + yield! unions ] + |> HashSet - raze (UndefinedName(0,FSComp.SR.undefinedNameValueOfConstructor,id,suggestNamesAndTypes)) - ForceRaise failingCase + raze (UndefinedName(0,FSComp.SR.undefinedNameValueOfConstructor,id,suggestNamesAndTypes)) + ForceRaise failingCase - ResolutionInfo.SendEntityPathToSink(sink,ncenv,nenv,ItemOccurence.Use,ad,resInfo,ResultTyparChecker(fun () -> CheckAllTyparsInferrable ncenv.amap m item)) - item,rest + ResolutionInfo.SendEntityPathToSink(sink,ncenv,nenv,ItemOccurence.Use,ad,resInfo,ResultTyparChecker(fun () -> CheckAllTyparsInferrable ncenv.amap m item)) + item,rest - // A compound identifier. - // It still might be a value in the environment, or something in an F# module, namespace, type, or nested type - | id :: rest -> - - let m = unionRanges m id.idRange - // Values in the environment take total priority, but constructors do NOT for compound lookups, e.g. if someone in some imported - // module has defined a constructor "String" (common enough) then "String.foo" doesn't give an error saying 'constructors have no members' - // Instead we go lookup the String module or type. - let ValIsInEnv nm = - match fullyQualified with - | FullyQualified -> false - | _ -> - match nenv.eUnqualifiedItems.TryFind(nm) with - | Some(Item.Value _) -> true - | _ -> false + // A compound identifier. + // It still might be a value in the environment, or something in an F# module, namespace, type, or nested type + else + let m = unionRanges m id.idRange + // Values in the environment take total priority, but constructors do NOT for compound lookups, e.g. if someone in some imported + // module has defined a constructor "String" (common enough) then "String.foo" doesn't give an error saying 'constructors have no members' + // Instead we go lookup the String module or type. + let ValIsInEnv nm = + match fullyQualified with + | FullyQualified -> false + | _ -> + match nenv.eUnqualifiedItems.TryFind(nm) with + | Some(Item.Value _) -> true + | _ -> false - if ValIsInEnv id.idText then - nenv.eUnqualifiedItems.[id.idText], rest - else - // Otherwise modules are searched first. REVIEW: modules and types should be searched together. - // For each module referenced by 'id', search the module as if it were an F# module and/or a .NET namespace. - let moduleSearch ad = - ResolveLongIndentAsModuleOrNamespaceThen sink ResultCollectionSettings.AtMostOneResult ncenv.amap m fullyQualified nenv ad lid isOpenDecl - (ResolveExprLongIdentInModuleOrNamespace ncenv nenv typeNameResInfo ad) - - // REVIEW: somewhat surprisingly, this shows up on performance traces, with tcrefs non-nil. - // This seems strange since we would expect in the vast majority of cases tcrefs is empty here. - let tyconSearch ad = - let tcrefs = LookupTypeNameInEnvNoArity fullyQualified id.idText nenv - if isNil tcrefs then NoResultsOrUsefulErrors else - let tcrefs = tcrefs |> List.map (fun tcref -> (resInfo,tcref)) - let tcrefs = CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities (tcrefs, TypeNameResolutionInfo.ResolveToTypeRefs (TypeNameResolutionStaticArgsInfo.Indefinite), PermitDirectReferenceToGeneratedType.No, unionRanges m id.idRange) - ResolveLongIdentInTyconRefs ResultCollectionSettings.AtMostOneResult ncenv nenv LookupKind.Expr 1 m ad rest typeNameResInfo id.idRange tcrefs - - let search = - let moduleSearch = moduleSearch ad + if ValIsInEnv id.idText then + nenv.eUnqualifiedItems.[id.idText], rest + else + // Otherwise modules are searched first. REVIEW: modules and types should be searched together. + // For each module referenced by 'id', search the module as if it were an F# module and/or a .NET namespace. + let moduleSearch ad = + ResolveLongIndentAsModuleOrNamespaceThen sink ResultCollectionSettings.AtMostOneResult ncenv.amap m fullyQualified nenv ad id rest isOpenDecl + (ResolveExprLongIdentInModuleOrNamespace ncenv nenv typeNameResInfo ad) + + // REVIEW: somewhat surprisingly, this shows up on performance traces, with tcrefs non-nil. + // This seems strange since we would expect in the vast majority of cases tcrefs is empty here. + let tyconSearch ad = + let tcrefs = LookupTypeNameInEnvNoArity fullyQualified id.idText nenv + if isNil tcrefs then NoResultsOrUsefulErrors else + match rest with + | id2::rest2 -> + let tcrefs = tcrefs |> List.map (fun tcref -> (resInfo,tcref)) + let tcrefs = CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities (tcrefs, TypeNameResolutionInfo.ResolveToTypeRefs (TypeNameResolutionStaticArgsInfo.Indefinite), PermitDirectReferenceToGeneratedType.No, unionRanges m id.idRange) + ResolveLongIdentInTyconRefs ResultCollectionSettings.AtMostOneResult ncenv nenv LookupKind.Expr 1 m ad id2 rest2 typeNameResInfo id.idRange tcrefs + | _ -> + NoResultsOrUsefulErrors + + let search = + let moduleSearch = moduleSearch ad - match moduleSearch with - | Result res when not (isNil res) -> moduleSearch - | _ -> - - let tyconSearch = tyconSearch ad - - match tyconSearch with - | Result res when not (isNil res) -> tyconSearch - | _ -> - - let envSearch = - match fullyQualified with - | FullyQualified -> - NoResultsOrUsefulErrors - | OpenQualified -> - match nenv.eUnqualifiedItems.TryFind id.idText with - | Some (Item.UnqualifiedType _) - | None -> NoResultsOrUsefulErrors - | Some res -> OneSuccess (resInfo,FreshenUnqualifiedItem ncenv m res,rest) - - moduleSearch +++ tyconSearch +++ envSearch - - let resInfo,item,rest = - match AtMostOneResult m search with - | Result _ as res -> ForceRaise res - | _ -> - let innerSearch = - let moduleSearch = moduleSearch AccessibleFromSomeFSharpCode + match moduleSearch with + | Result res when not (isNil res) -> moduleSearch + | _ -> + + let tyconSearch = tyconSearch ad + + match tyconSearch with + | Result res when not (isNil res) -> tyconSearch + | _ -> + + let envSearch = + match fullyQualified with + | FullyQualified -> + NoResultsOrUsefulErrors + | OpenQualified -> + match nenv.eUnqualifiedItems.TryFind id.idText with + | Some (Item.UnqualifiedType _) + | None -> NoResultsOrUsefulErrors + | Some res -> OneSuccess (resInfo,FreshenUnqualifiedItem ncenv m res,rest) + + moduleSearch +++ tyconSearch +++ envSearch + + let resInfo,item,rest = + match AtMostOneResult m search with + | Result _ as res -> ForceRaise res + | _ -> + let innerSearch = + let moduleSearch = moduleSearch AccessibleFromSomeFSharpCode - match moduleSearch with - | Result res when not (isNil res) -> moduleSearch - | _ -> + match moduleSearch with + | Result res when not (isNil res) -> moduleSearch + | _ -> - let tyconSearch = tyconSearch AccessibleFromSomeFSharpCode + let tyconSearch = tyconSearch AccessibleFromSomeFSharpCode - match tyconSearch with - | Result res when not (isNil res) -> tyconSearch - | _ -> + match tyconSearch with + | Result res when not (isNil res) -> tyconSearch + | _ -> - search +++ moduleSearch +++ tyconSearch + search +++ moduleSearch +++ tyconSearch - let suggestEverythingInScope() = - seq { yield! - nenv.ModulesAndNamespaces fullyQualified - |> Seq.collect (fun kv -> kv.Value) - |> Seq.filter (fun modref -> IsEntityAccessible ncenv.amap m ad modref) - |> Seq.collect (fun e -> [e.DisplayName; e.DemangledModuleOrNamespaceName]) + let suggestEverythingInScope() = + seq { yield! + nenv.ModulesAndNamespaces fullyQualified + |> Seq.collect (fun kv -> kv.Value) + |> Seq.filter (fun modref -> IsEntityAccessible ncenv.amap m ad modref) + |> Seq.collect (fun e -> [e.DisplayName; e.DemangledModuleOrNamespaceName]) - yield! - nenv.TyconsByDemangledNameAndArity fullyQualified - |> Seq.filter (fun e -> IsEntityAccessible ncenv.amap m ad e.Value) - |> Seq.map (fun e -> e.Value.DisplayName) - - yield! - nenv.eUnqualifiedItems - |> Seq.map (fun e -> e.Value.DisplayName) - } |> HashSet - - match innerSearch with - | Exception (UndefinedName(0,_,id1,suggestionsF)) when id.idRange = id1.idRange -> - let mergeSuggestions() = - let res = suggestEverythingInScope() - res.UnionWith(suggestionsF()) - res - - let failingCase = raze (UndefinedName(0,FSComp.SR.undefinedNameValueNamespaceTypeOrModule,id,mergeSuggestions)) - ForceRaise failingCase - | Exception err -> ForceRaise(Exception err) - | Result (res :: _) -> ForceRaise(Result res) - | Result [] -> - let failingCase = raze (UndefinedName(0,FSComp.SR.undefinedNameValueNamespaceTypeOrModule,id,suggestEverythingInScope)) - ForceRaise failingCase + yield! + nenv.TyconsByDemangledNameAndArity fullyQualified + |> Seq.filter (fun e -> IsEntityAccessible ncenv.amap m ad e.Value) + |> Seq.map (fun e -> e.Value.DisplayName) + + yield! + nenv.eUnqualifiedItems + |> Seq.map (fun e -> e.Value.DisplayName) + } |> HashSet + + match innerSearch with + | Exception (UndefinedName(0,_,id1,suggestionsF)) when id.idRange = id1.idRange -> + let mergeSuggestions() = + let res = suggestEverythingInScope() + res.UnionWith(suggestionsF()) + res + + let failingCase = raze (UndefinedName(0,FSComp.SR.undefinedNameValueNamespaceTypeOrModule,id,mergeSuggestions)) + ForceRaise failingCase + | Exception err -> ForceRaise(Exception err) + | Result (res :: _) -> ForceRaise(Result res) + | Result [] -> + let failingCase = raze (UndefinedName(0,FSComp.SR.undefinedNameValueNamespaceTypeOrModule,id,suggestEverythingInScope)) + ForceRaise failingCase - ResolutionInfo.SendEntityPathToSink(sink,ncenv,nenv,ItemOccurence.Use,ad,resInfo,ResultTyparChecker(fun () -> CheckAllTyparsInferrable ncenv.amap m item)) - item,rest + ResolutionInfo.SendEntityPathToSink(sink,ncenv,nenv,ItemOccurence.Use,ad,resInfo,ResultTyparChecker(fun () -> CheckAllTyparsInferrable ncenv.amap m item)) + item,rest let ResolveExprLongIdent sink (ncenv:NameResolver) m ad nenv typeNameResInfo lid = - ResolveExprLongIdentPrim sink ncenv OpenQualified m ad nenv typeNameResInfo lid false + match lid with + | [] -> error (Error(FSComp.SR.nrInvalidExpression(textOfLid lid), m)) + | id::rest -> ResolveExprLongIdentPrim sink ncenv true OpenQualified m ad nenv typeNameResInfo id rest false //------------------------------------------------------------------------- // Resolve F#/IL "." syntax in patterns //------------------------------------------------------------------------- -let rec ResolvePatternLongIdentInModuleOrNamespace (ncenv:NameResolver) nenv numTyArgsOpt ad resInfo depth m modref (mty:ModuleOrNamespaceType) (lid: Ident list) = - match lid with - | [] -> raze (InternalError("ResolvePatternLongIdentInModuleOrNamespace",m)) - | id :: rest -> - let m = unionRanges m id.idRange - match TryFindTypeWithUnionCase modref id with - | Some tycon when IsTyconReprAccessible ncenv.amap m ad (modref.NestedTyconRef tycon) -> - let tcref = modref.NestedTyconRef tycon - let ucref = mkUnionCaseRef tcref id.idText - let showDeprecated = HasFSharpAttribute ncenv.g ncenv.g.attrib_RequireQualifiedAccessAttribute tycon.Attribs - let ucinfo = FreshenUnionCaseRef ncenv m ucref - success (resInfo,Item.UnionCase(ucinfo,showDeprecated),rest) - | _ -> - match mty.ExceptionDefinitionsByDemangledName.TryFind(id.idText) with - | Some exnc when IsEntityAccessible ncenv.amap m ad (modref.NestedTyconRef exnc) -> - success (resInfo,Item.ExnCase (modref.NestedTyconRef exnc),rest) - | _ -> - // An active pattern constructor in a module - match (ActivePatternElemsOfModuleOrNamespace modref).TryFind(id.idText) with - | Some ( APElemRef(_,vref,_) as apref) when IsValAccessible ad vref -> - success (resInfo,Item.ActivePatternCase apref,rest) - | _ -> - match mty.AllValsByLogicalName.TryFind(id.idText) with - | Some vspec when IsValAccessible ad (mkNestedValRef modref vspec) -> - success(resInfo,Item.Value (mkNestedValRef modref vspec),rest) +let rec ResolvePatternLongIdentInModuleOrNamespace (ncenv:NameResolver) nenv numTyArgsOpt ad resInfo depth m modref (mty:ModuleOrNamespaceType) (id:Ident) (rest: Ident list) = + let m = unionRanges m id.idRange + match TryFindTypeWithUnionCase modref id with + | Some tycon when IsTyconReprAccessible ncenv.amap m ad (modref.NestedTyconRef tycon) -> + let tcref = modref.NestedTyconRef tycon + let ucref = mkUnionCaseRef tcref id.idText + let showDeprecated = HasFSharpAttribute ncenv.g ncenv.g.attrib_RequireQualifiedAccessAttribute tycon.Attribs + let ucinfo = FreshenUnionCaseRef ncenv m ucref + success (resInfo,Item.UnionCase(ucinfo,showDeprecated),rest) + | _ -> + match mty.ExceptionDefinitionsByDemangledName.TryFind(id.idText) with + | Some exnc when IsEntityAccessible ncenv.amap m ad (modref.NestedTyconRef exnc) -> + success (resInfo,Item.ExnCase (modref.NestedTyconRef exnc),rest) + | _ -> + // An active pattern constructor in a module + match (ActivePatternElemsOfModuleOrNamespace modref).TryFind(id.idText) with + | Some ( APElemRef(_,vref,_) as apref) when IsValAccessible ad vref -> + success (resInfo,Item.ActivePatternCase apref,rest) + | _ -> + match mty.AllValsByLogicalName.TryFind(id.idText) with + | Some vspec when IsValAccessible ad (mkNestedValRef modref vspec) -> + success(resInfo,Item.Value (mkNestedValRef modref vspec),rest) + | _ -> + let tcrefs = lazy ( + LookupTypeNameInEntityMaybeHaveArity (ncenv.amap, id.idRange, ad, id.idText, TypeNameResolutionStaticArgsInfo.Indefinite, modref) + |> List.map (fun tcref -> (resInfo,tcref))) + + // Something in a type? e.g. a literal field + let tyconSearch = + match rest with + | id2::rest2 -> + let tcrefs = tcrefs.Force() + ResolveLongIdentInTyconRefs ResultCollectionSettings.AtMostOneResult (ncenv:NameResolver) nenv LookupKind.Pattern (depth+1) m ad id2 rest2 numTyArgsOpt id.idRange tcrefs | _ -> - let tcrefs = lazy ( - LookupTypeNameInEntityMaybeHaveArity (ncenv.amap, id.idRange, ad, id.idText, TypeNameResolutionStaticArgsInfo.Indefinite, modref) - |> List.map (fun tcref -> (resInfo,tcref))) - - // Something in a type? e.g. a literal field - let tyconSearch = - match lid with - | _ :: rest when not (isNil rest) -> - let tcrefs = tcrefs.Force() - ResolveLongIdentInTyconRefs ResultCollectionSettings.AtMostOneResult (ncenv:NameResolver) nenv LookupKind.Pattern (depth+1) m ad rest numTyArgsOpt id.idRange tcrefs - | _ -> - NoResultsOrUsefulErrors + NoResultsOrUsefulErrors - match tyconSearch with - | Result (res :: _) -> success res - | _ -> - - // Constructor of a type? - let ctorSearch = - if isNil rest then - tcrefs.Force() - |> List.map (fun (resInfo,tcref) -> (resInfo,FreshenTycon ncenv m tcref)) - |> CollectAtMostOneResult (fun (resInfo,typ) -> ResolveObjectConstructorPrim ncenv nenv.eDisplayEnv resInfo id.idRange ad typ) - |> MapResults (fun (resInfo,item) -> (resInfo,item,[])) - else - NoResultsOrUsefulErrors + match tyconSearch with + | Result (res :: _) -> success res + | _ -> - match ctorSearch with - | Result (res :: _) -> success res - | _ -> + // Constructor of a type? + let ctorSearch = + if isNil rest then + tcrefs.Force() + |> List.map (fun (resInfo,tcref) -> (resInfo,FreshenTycon ncenv m tcref)) + |> CollectAtMostOneResult (fun (resInfo,typ) -> ResolveObjectConstructorPrim ncenv nenv.eDisplayEnv resInfo id.idRange ad typ) + |> MapResults (fun (resInfo,item) -> (resInfo,item,[])) + else + NoResultsOrUsefulErrors - // Something in a sub-namespace or sub-module or nested-type - let moduleSearch = - if not (isNil rest) then - match mty.ModulesAndNamespacesByDemangledName.TryFind(id.idText) with - | Some(AccessibleEntityRef ncenv.amap m ad modref submodref) -> - let resInfo = resInfo.AddEntity(id.idRange,submodref) - OneResult (ResolvePatternLongIdentInModuleOrNamespace ncenv nenv numTyArgsOpt ad resInfo (depth+1) m submodref submodref.ModuleOrNamespaceType rest) - | _ -> - NoResultsOrUsefulErrors - else NoResultsOrUsefulErrors + match ctorSearch with + | Result (res :: _) -> success res + | _ -> - match tyconSearch +++ ctorSearch +++ moduleSearch with - | Result [] -> - let suggestPossibleTypes() = - let submodules = - mty.ModulesAndNamespacesByDemangledName - |> Seq.filter (fun kv -> IsEntityAccessible ncenv.amap m ad (modref.NestedTyconRef kv.Value)) - |> Seq.collect (fun e -> [e.Value.DisplayName; e.Value.DemangledModuleOrNamespaceName]) + // Something in a sub-namespace or sub-module or nested-type + let moduleSearch = + match rest with + | id2::rest2 -> + match mty.ModulesAndNamespacesByDemangledName.TryFind(id.idText) with + | Some(AccessibleEntityRef ncenv.amap m ad modref submodref) -> + let resInfo = resInfo.AddEntity(id.idRange,submodref) + OneResult (ResolvePatternLongIdentInModuleOrNamespace ncenv nenv numTyArgsOpt ad resInfo (depth+1) m submodref submodref.ModuleOrNamespaceType id2 rest2) + | _ -> + NoResultsOrUsefulErrors + | [] -> NoResultsOrUsefulErrors + + match tyconSearch +++ ctorSearch +++ moduleSearch with + | Result [] -> + let suggestPossibleTypes() = + let submodules = + mty.ModulesAndNamespacesByDemangledName + |> Seq.filter (fun kv -> IsEntityAccessible ncenv.amap m ad (modref.NestedTyconRef kv.Value)) + |> Seq.collect (fun e -> [e.Value.DisplayName; e.Value.DemangledModuleOrNamespaceName]) - let suggestedTypes = - nenv.TyconsByDemangledNameAndArity FullyQualifiedFlag.OpenQualified - |> Seq.filter (fun e -> IsEntityAccessible ncenv.amap m ad e.Value) - |> Seq.map (fun e -> e.Value.DisplayName) + let suggestedTypes = + nenv.TyconsByDemangledNameAndArity FullyQualifiedFlag.OpenQualified + |> Seq.filter (fun e -> IsEntityAccessible ncenv.amap m ad e.Value) + |> Seq.map (fun e -> e.Value.DisplayName) - [ yield! submodules - yield! suggestedTypes ] - |> HashSet + [ yield! submodules + yield! suggestedTypes ] + |> HashSet - raze (UndefinedName(depth,FSComp.SR.undefinedNameConstructorModuleOrNamespace,id,suggestPossibleTypes)) - | results -> AtMostOneResult id.idRange results + raze (UndefinedName(depth,FSComp.SR.undefinedNameConstructorModuleOrNamespace,id,suggestPossibleTypes)) + | results -> AtMostOneResult id.idRange results /// Used to report a warning condition for the use of upper-case identifiers in patterns exception UpperCaseIdentifierInPattern of range @@ -2658,78 +2656,78 @@ exception UpperCaseIdentifierInPattern of range type WarnOnUpperFlag = WarnOnUpperCase | AllIdsOK // Long ID in a pattern -let rec ResolvePatternLongIdentPrim sink (ncenv:NameResolver) fullyQualified warnOnUpper newDef m ad nenv numTyArgsOpt (lid:Ident list) = - match lid with - - | [id] when id.idText = MangledGlobalName -> - error (Error(FSComp.SR.nrGlobalUsedOnlyAsFirstName(), id.idRange)) - - | id :: lid when id.idText = MangledGlobalName -> - ResolvePatternLongIdentPrim sink ncenv FullyQualified warnOnUpper newDef m ad nenv numTyArgsOpt lid - - // Single identifiers in patterns - | [id] when fullyQualified <> FullyQualified -> - // Single identifiers in patterns - bind to constructors and active patterns - // For the special case of - // let C = x - match nenv.ePatItems.TryFind(id.idText) with - | Some res when not newDef -> FreshenUnqualifiedItem ncenv m res - | _ -> - // Single identifiers in patterns - variable bindings - if not newDef && - (warnOnUpper = WarnOnUpperCase) && - id.idText.Length >= 3 && - System.Char.ToLowerInvariant id.idText.[0] <> id.idText.[0] then - warning(UpperCaseIdentifierInPattern(m)) - Item.NewDef id +let rec ResolvePatternLongIdentPrim sink (ncenv:NameResolver) fullyQualified warnOnUpper newDef m ad nenv numTyArgsOpt (id:Ident) (rest:Ident list) = + if id.idText = MangledGlobalName then + match rest with + | [] -> + error (Error(FSComp.SR.nrGlobalUsedOnlyAsFirstName(), id.idRange)) + | id2::rest2 -> + ResolvePatternLongIdentPrim sink ncenv FullyQualified warnOnUpper newDef m ad nenv numTyArgsOpt id2 rest2 + else + // Single identifiers in patterns + if isNil rest && fullyQualified <> FullyQualified then + // Single identifiers in patterns - bind to constructors and active patterns + // For the special case of + // let C = x + match nenv.ePatItems.TryFind(id.idText) with + | Some res when not newDef -> FreshenUnqualifiedItem ncenv m res + | _ -> + // Single identifiers in patterns - variable bindings + if not newDef && + (warnOnUpper = WarnOnUpperCase) && + id.idText.Length >= 3 && + System.Char.ToLowerInvariant id.idText.[0] <> id.idText.[0] then + warning(UpperCaseIdentifierInPattern(m)) + Item.NewDef id - // Long identifiers in patterns - | _ -> - let moduleSearch ad = - ResolveLongIndentAsModuleOrNamespaceThen sink ResultCollectionSettings.AtMostOneResult ncenv.amap m fullyQualified nenv ad lid false - (ResolvePatternLongIdentInModuleOrNamespace ncenv nenv numTyArgsOpt ad) - - let tyconSearch ad = - match lid with - | tn :: rest when not (isNil rest) -> - let tcrefs = LookupTypeNameInEnvNoArity fullyQualified tn.idText nenv - if isNil tcrefs then NoResultsOrUsefulErrors else - let tcrefs = tcrefs |> List.map (fun tcref -> (ResolutionInfo.Empty,tcref)) - ResolveLongIdentInTyconRefs ResultCollectionSettings.AtMostOneResult ncenv nenv LookupKind.Pattern 1 tn.idRange ad rest numTyArgsOpt tn.idRange tcrefs - | _ -> - NoResultsOrUsefulErrors + // Long identifiers in patterns + else + let moduleSearch ad = + ResolveLongIndentAsModuleOrNamespaceThen sink ResultCollectionSettings.AtMostOneResult ncenv.amap m fullyQualified nenv ad id rest false + (ResolvePatternLongIdentInModuleOrNamespace ncenv nenv numTyArgsOpt ad) + + let tyconSearch ad = + match rest with + | id2 :: rest2 -> + let tcrefs = LookupTypeNameInEnvNoArity fullyQualified id.idText nenv + if isNil tcrefs then NoResultsOrUsefulErrors else + let tcrefs = tcrefs |> List.map (fun tcref -> (ResolutionInfo.Empty,tcref)) + ResolveLongIdentInTyconRefs ResultCollectionSettings.AtMostOneResult ncenv nenv LookupKind.Pattern 1 id.idRange ad id2 rest2 numTyArgsOpt id.idRange tcrefs + | _ -> + NoResultsOrUsefulErrors - let resInfo,res,rest = - let tyconResult = tyconSearch ad - match tyconResult with - | Result (res :: _) -> res - | _ -> + let resInfo,res,rest = + let tyconResult = tyconSearch ad + match tyconResult with + | Result (res :: _) -> res + | _ -> - let moduleResult = moduleSearch ad - match moduleResult with - | Result (res :: _) -> res - | _ -> + let moduleResult = moduleSearch ad + match moduleResult with + | Result (res :: _) -> res + | _ -> - match AtMostOneResult m (tyconResult +++ moduleResult) with - | Result _ as res -> ForceRaise res - | _ -> + match AtMostOneResult m (tyconResult +++ moduleResult) with + | Result _ as res -> ForceRaise res + | _ -> - let tyconResult = tyconSearch AccessibleFromSomeFSharpCode - match tyconResult with - | Result (res :: _) -> res - | _ -> - ForceRaise (AtMostOneResult m (tyconResult +++ moduleSearch AccessibleFromSomeFSharpCode)) + let tyconResult = tyconSearch AccessibleFromSomeFSharpCode + match tyconResult with + | Result (res :: _) -> res + | _ -> + ForceRaise (AtMostOneResult m (tyconResult +++ moduleSearch AccessibleFromSomeFSharpCode)) - ResolutionInfo.SendEntityPathToSink(sink,ncenv,nenv,ItemOccurence.Use,ad,resInfo,ResultTyparChecker(fun () -> true)) + ResolutionInfo.SendEntityPathToSink(sink,ncenv,nenv,ItemOccurence.Use,ad,resInfo,ResultTyparChecker(fun () -> true)) - match rest with - | [] -> res - | element :: _ -> error(Error(FSComp.SR.nrIsNotConstructorOrLiteral(),element.idRange)) - + match rest with + | [] -> res + | element :: _ -> error(Error(FSComp.SR.nrIsNotConstructorOrLiteral(),element.idRange)) /// Resolve a long identifier when used in a pattern. let ResolvePatternLongIdent sink (ncenv:NameResolver) warnOnUpper newDef m ad nenv numTyArgsOpt (lid:Ident list) = - ResolvePatternLongIdentPrim sink ncenv OpenQualified warnOnUpper newDef m ad nenv numTyArgsOpt lid + match lid with + | [] -> error(Error(FSComp.SR.nrUnexpectedEmptyLongId(),m)) + | id::rest -> ResolvePatternLongIdentPrim sink ncenv OpenQualified warnOnUpper newDef m ad nenv numTyArgsOpt id rest //------------------------------------------------------------------------- // Resolve F#/IL "." syntax in types @@ -2749,11 +2747,10 @@ let ResolveNestedTypeThroughAbbreviation (ncenv:NameResolver) (tcref: TyconRef) tcref /// Resolve a long identifier representing a type name -let rec ResolveTypeLongIdentInTyconRefPrim (ncenv:NameResolver) (typeNameResInfo:TypeNameResolutionInfo) ad resInfo genOk depth m (tcref: TyconRef) (lid: Ident list) = +let rec ResolveTypeLongIdentInTyconRefPrim (ncenv:NameResolver) (typeNameResInfo:TypeNameResolutionInfo) ad resInfo genOk depth m (tcref: TyconRef) (id:Ident) (rest: Ident list) = let tcref = ResolveNestedTypeThroughAbbreviation ncenv tcref m - match lid with - | [] -> error(Error(FSComp.SR.nrUnexpectedEmptyLongId(),m)) - | [id] -> + match rest with + | [] -> #if !NO_EXTENSIONTYPING // No dotting through type generators to get to a nested type! CheckForDirectReferenceToGeneratedType (tcref, PermitDirectReferenceToGeneratedType.No, m) @@ -2771,7 +2768,7 @@ let rec ResolveTypeLongIdentInTyconRefPrim (ncenv:NameResolver) (typeNameResInfo |> HashSet raze (UndefinedName(depth,FSComp.SR.undefinedNameType,id,suggestTypes)) - | id::rest -> + | id2::rest2 -> #if !NO_EXTENSIONTYPING // No dotting through type generators to get to a nested type! CheckForDirectReferenceToGeneratedType (tcref, PermitDirectReferenceToGeneratedType.No, m) @@ -2784,7 +2781,7 @@ let rec ResolveTypeLongIdentInTyconRefPrim (ncenv:NameResolver) (typeNameResInfo let tcrefs = tcrefs |> List.map (fun tcref -> (resInfo,tcref)) let tcrefs = CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities (tcrefs, typeNameResInfo.DropStaticArgsInfo, genOk, m) match tcrefs with - | _ :: _ -> tcrefs |> CollectAtMostOneResult (fun (resInfo,tcref) -> ResolveTypeLongIdentInTyconRefPrim ncenv typeNameResInfo ad resInfo genOk (depth+1) m tcref rest) + | _ :: _ -> tcrefs |> CollectAtMostOneResult (fun (resInfo,tcref) -> ResolveTypeLongIdentInTyconRefPrim ncenv typeNameResInfo ad resInfo genOk (depth+1) m tcref id2 rest2) | [] -> let suggestTypes() = tcref.ModuleOrNamespaceType.TypesByDemangledNameAndArity id.idRange @@ -2797,7 +2794,12 @@ let rec ResolveTypeLongIdentInTyconRefPrim (ncenv:NameResolver) (typeNameResInfo /// Resolve a long identifier representing a type name and report the result let ResolveTypeLongIdentInTyconRef sink (ncenv:NameResolver) nenv typeNameResInfo ad m tcref (lid: Ident list) = - let resInfo,tcref = ForceRaise (ResolveTypeLongIdentInTyconRefPrim ncenv typeNameResInfo ad ResolutionInfo.Empty PermitDirectReferenceToGeneratedType.No 0 m tcref lid) + let resInfo,tcref = + match lid with + | [] -> + error(Error(FSComp.SR.nrUnexpectedEmptyLongId(),m)) + | id::rest -> + ForceRaise (ResolveTypeLongIdentInTyconRefPrim ncenv typeNameResInfo ad ResolutionInfo.Empty PermitDirectReferenceToGeneratedType.No 0 m tcref id rest) ResolutionInfo.SendEntityPathToSink(sink,ncenv,nenv,ItemOccurence.Use,ad,resInfo,ResultTyparChecker(fun () -> true)) let item = Item.Types(tcref.DisplayName,[FreshenTycon ncenv m tcref]) CallNameResolutionSink sink (rangeOfLid lid,nenv,item,item,emptyTyparInst,ItemOccurence.UseInType,nenv.eDisplayEnv,ad) @@ -2815,16 +2817,15 @@ let SuggestTypeLongIdentInModuleOrNamespace depth (modref:ModuleOrNamespaceRef) UndefinedName(depth,errorTextF,id,suggestPossibleTypes) /// Resolve a long identifier representing a type in a module or namespace -let rec private ResolveTypeLongIdentInModuleOrNamespace sink nenv (ncenv:NameResolver) (typeNameResInfo: TypeNameResolutionInfo) ad genOk (resInfo:ResolutionInfo) depth m modref _mty (lid: Ident list) = - match lid with - | [] -> error(Error(FSComp.SR.nrUnexpectedEmptyLongId(),m)) - | [id] -> +let rec private ResolveTypeLongIdentInModuleOrNamespace sink nenv (ncenv:NameResolver) (typeNameResInfo: TypeNameResolutionInfo) ad genOk (resInfo:ResolutionInfo) depth m modref _mty (id:Ident) (rest: Ident list) = + match rest with + | [] -> // On all paths except error reporting we have isSome(staticResInfo), hence get at most one result back let tcrefs = LookupTypeNameInEntityMaybeHaveArity (ncenv.amap, id.idRange, ad, id.idText, typeNameResInfo.StaticArgsInfo, modref) match tcrefs with | _ :: _ -> tcrefs |> CollectResults (fun tcref -> success(resInfo,tcref)) | [] -> raze (SuggestTypeLongIdentInModuleOrNamespace depth modref ncenv.amap ad m id) - | id::rest -> + | id2::rest2 -> let m = unionRanges m id.idRange let modulSearch = match modref.ModuleOrNamespaceType.ModulesAndNamespacesByDemangledName.TryFind(id.idText) with @@ -2832,7 +2833,7 @@ let rec private ResolveTypeLongIdentInModuleOrNamespace sink nenv (ncenv:NameRes let item = Item.ModuleOrNamespaces [submodref] CallNameResolutionSink sink (id.idRange, nenv, item, item, emptyTyparInst, ItemOccurence.Use, nenv.DisplayEnv, ad) let resInfo = resInfo.AddEntity(id.idRange,submodref) - ResolveTypeLongIdentInModuleOrNamespace sink nenv ncenv typeNameResInfo ad genOk resInfo (depth+1) m submodref submodref.ModuleOrNamespaceType rest + ResolveTypeLongIdentInModuleOrNamespace sink nenv ncenv typeNameResInfo ad genOk resInfo (depth+1) m submodref submodref.ModuleOrNamespaceType id2 rest2 | _ -> let suggestPossibleModules() = modref.ModuleOrNamespaceType.ModulesAndNamespacesByDemangledName @@ -2844,7 +2845,7 @@ let rec private ResolveTypeLongIdentInModuleOrNamespace sink nenv (ncenv:NameRes let tyconSearch = let tcrefs = LookupTypeNameInEntityMaybeHaveArity (ncenv.amap, id.idRange, ad, id.idText, TypeNameResolutionStaticArgsInfo.Indefinite, modref) match tcrefs with - | _ :: _ -> tcrefs |> CollectResults (fun tcref -> ResolveTypeLongIdentInTyconRefPrim ncenv typeNameResInfo ad resInfo genOk (depth+1) m tcref rest) + | _ :: _ -> tcrefs |> CollectResults (fun tcref -> ResolveTypeLongIdentInTyconRefPrim ncenv typeNameResInfo ad resInfo genOk (depth+1) m tcref id2 rest2) | [] -> let suggestTypes() = modref.ModuleOrNamespaceType.TypesByDemangledNameAndArity id.idRange @@ -2855,94 +2856,98 @@ let rec private ResolveTypeLongIdentInModuleOrNamespace sink nenv (ncenv:NameRes tyconSearch +++ modulSearch /// Resolve a long identifier representing a type -let rec ResolveTypeLongIdentPrim sink (ncenv:NameResolver) occurence fullyQualified m nenv ad (lid: Ident list) (staticResInfo: TypeNameResolutionStaticArgsInfo) genOk = +let rec ResolveTypeLongIdentPrim sink (ncenv:NameResolver) occurence first fullyQualified m nenv ad (id:Ident) (rest: Ident list) (staticResInfo: TypeNameResolutionStaticArgsInfo) genOk = let typeNameResInfo = TypeNameResolutionInfo.ResolveToTypeRefs staticResInfo - match lid with - | [] -> error(Error(FSComp.SR.nrUnexpectedEmptyLongId(),m)) - - | [id] when id.idText = MangledGlobalName -> - error (Error(FSComp.SR.nrGlobalUsedOnlyAsFirstName(), id.idRange)) - - | id :: lid when id.idText = MangledGlobalName -> - ResolveTypeLongIdentPrim sink ncenv occurence FullyQualified m nenv ad lid staticResInfo genOk - - | [id] -> - match LookupTypeNameInEnvHaveArity fullyQualified id.idText staticResInfo.NumStaticArgs nenv with - | Some res -> - let res = CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities ([(ResolutionInfo.Empty,res)], typeNameResInfo, genOk, unionRanges m id.idRange) - assert (res.Length = 1) - success res.Head - | None -> - // For Good Error Reporting! - let tcrefs = LookupTypeNameInEnvNoArity fullyQualified id.idText nenv - match tcrefs with - | tcref :: _tcrefs -> - // Note: This path is only for error reporting - //CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities tcref rest typeNameResInfo m - success(ResolutionInfo.Empty,tcref) - | [] -> - let suggestPossibleTypes() = - nenv.TyconsByDemangledNameAndArity(fullyQualified) - |> Seq.filter (fun kv -> IsEntityAccessible ncenv.amap m ad kv.Value) - |> Seq.collect (fun e -> - match occurence with - | ItemOccurence.UseInAttribute -> - [yield e.Value.DisplayName - yield e.Value.DemangledModuleOrNamespaceName - if e.Value.DisplayName.EndsWith "Attribute" then - yield e.Value.DisplayName.Replace("Attribute","")] - | _ -> [e.Value.DisplayName; e.Value.DemangledModuleOrNamespaceName]) - |> HashSet - - raze (UndefinedName(0,FSComp.SR.undefinedNameType,id,suggestPossibleTypes)) - - | id::rest -> - let m = unionRanges m id.idRange - let tyconSearch = - match fullyQualified with - | FullyQualified -> - NoResultsOrUsefulErrors - | OpenQualified -> - match LookupTypeNameInEnvHaveArity fullyQualified id.idText staticResInfo.NumStaticArgs nenv with - | Some tcref when IsEntityAccessible ncenv.amap m ad tcref -> - OneResult (ResolveTypeLongIdentInTyconRefPrim ncenv typeNameResInfo ad ResolutionInfo.Empty genOk 1 m tcref rest) - | _ -> + if first && id.idText = MangledGlobalName then + match rest with + | [] -> + error (Error(FSComp.SR.nrGlobalUsedOnlyAsFirstName(), id.idRange)) + | id2::rest2 -> + ResolveTypeLongIdentPrim sink ncenv occurence false FullyQualified m nenv ad id2 rest2 staticResInfo genOk + else + match rest with + | [] -> + match LookupTypeNameInEnvHaveArity fullyQualified id.idText staticResInfo.NumStaticArgs nenv with + | Some res -> + let res = CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities ([(ResolutionInfo.Empty,res)], typeNameResInfo, genOk, unionRanges m id.idRange) + assert (res.Length = 1) + success res.Head + | None -> + // For Good Error Reporting! + let tcrefs = LookupTypeNameInEnvNoArity fullyQualified id.idText nenv + match tcrefs with + | tcref :: _tcrefs -> + // Note: This path is only for error reporting + //CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities tcref rest typeNameResInfo m + success(ResolutionInfo.Empty,tcref) + | [] -> + let suggestPossibleTypes() = + nenv.TyconsByDemangledNameAndArity(fullyQualified) + |> Seq.filter (fun kv -> IsEntityAccessible ncenv.amap m ad kv.Value) + |> Seq.collect (fun e -> + match occurence with + | ItemOccurence.UseInAttribute -> + [yield e.Value.DisplayName + yield e.Value.DemangledModuleOrNamespaceName + if e.Value.DisplayName.EndsWith "Attribute" then + yield e.Value.DisplayName.Replace("Attribute","")] + | _ -> [e.Value.DisplayName; e.Value.DemangledModuleOrNamespaceName]) + |> HashSet + + raze (UndefinedName(0,FSComp.SR.undefinedNameType,id,suggestPossibleTypes)) + | id2::rest2 -> + let m2 = unionRanges m id.idRange + let tyconSearch = + match fullyQualified with + | FullyQualified -> NoResultsOrUsefulErrors + | OpenQualified -> + match LookupTypeNameInEnvHaveArity fullyQualified id.idText staticResInfo.NumStaticArgs nenv with + | Some tcref when IsEntityAccessible ncenv.amap m2 ad tcref -> + OneResult (ResolveTypeLongIdentInTyconRefPrim ncenv typeNameResInfo ad ResolutionInfo.Empty genOk 1 m2 tcref id2 rest2) + | _ -> + NoResultsOrUsefulErrors - let modulSearch = - ResolveLongIndentAsModuleOrNamespaceThen sink ResultCollectionSettings.AllResults ncenv.amap m fullyQualified nenv ad lid false - (ResolveTypeLongIdentInModuleOrNamespace sink nenv ncenv typeNameResInfo ad genOk) - |?> List.concat - - let modulSearchFailed() = - ResolveLongIndentAsModuleOrNamespaceThen sink ResultCollectionSettings.AllResults ncenv.amap m fullyQualified nenv AccessibleFromSomeFSharpCode lid false - (ResolveTypeLongIdentInModuleOrNamespace sink nenv ncenv typeNameResInfo.DropStaticArgsInfo AccessibleFromSomeFSharpCode genOk) - |?> List.concat - - let searchSoFar = tyconSearch +++ modulSearch - - match searchSoFar with - | Result results -> - // NOTE: we delay checking the CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities condition until right at the end after we've - // collected all possible resolutions of the type - let tcrefs = CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities (results, typeNameResInfo, genOk, rangeOfLid lid) - match tcrefs with - | (resInfo,tcref) :: _ -> - // We've already reported the ambiguity, possibly as an error. Now just take the first possible result. - success(resInfo,tcref) - | [] -> - // failing case - report nice ambiguity errors even in this case - AtMostOneResult m ((searchSoFar +++ modulSearchFailed()) |?> (fun tcrefs -> CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities (tcrefs, typeNameResInfo, genOk, rangeOfLid lid))) + let modulSearch = + ResolveLongIndentAsModuleOrNamespaceThen sink ResultCollectionSettings.AllResults ncenv.amap m2 fullyQualified nenv ad id rest false + (ResolveTypeLongIdentInModuleOrNamespace sink nenv ncenv typeNameResInfo ad genOk) + |?> List.concat + + let modulSearchFailed() = + ResolveLongIndentAsModuleOrNamespaceThen sink ResultCollectionSettings.AllResults ncenv.amap m2 fullyQualified nenv AccessibleFromSomeFSharpCode id rest false + (ResolveTypeLongIdentInModuleOrNamespace sink nenv ncenv typeNameResInfo.DropStaticArgsInfo AccessibleFromSomeFSharpCode genOk) + |?> List.concat + + let searchSoFar = tyconSearch +++ modulSearch + + match searchSoFar with + | Result results -> + // NOTE: we delay checking the CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities condition until right at the end after we've + // collected all possible resolutions of the type + let tcrefs = CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities (results, typeNameResInfo, genOk, m) + match tcrefs with + | (resInfo,tcref) :: _ -> + // We've already reported the ambiguity, possibly as an error. Now just take the first possible result. + success(resInfo,tcref) + | [] -> + // failing case - report nice ambiguity errors even in this case + AtMostOneResult m2 ((searchSoFar +++ modulSearchFailed()) |?> (fun tcrefs -> CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities (tcrefs, typeNameResInfo, genOk, m))) - | _ -> - // failing case - report nice ambiguity errors even in this case - AtMostOneResult m ((searchSoFar +++ modulSearchFailed()) |?> (fun tcrefs -> CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities (tcrefs, typeNameResInfo, genOk, rangeOfLid lid))) + | _ -> + // failing case - report nice ambiguity errors even in this case + AtMostOneResult m2 ((searchSoFar +++ modulSearchFailed()) |?> (fun tcrefs -> CheckForTypeLegitimacyAndMultipleGenericTypeAmbiguities (tcrefs, typeNameResInfo, genOk, m))) /// Resolve a long identifier representing a type and report it let ResolveTypeLongIdent sink (ncenv:NameResolver) occurence fullyQualified nenv ad (lid: Ident list) staticResInfo genOk = let m = rangeOfLid lid - let res = ResolveTypeLongIdentPrim sink ncenv occurence fullyQualified m nenv ad lid staticResInfo genOk + let res = + match lid with + | [] -> + error(Error(FSComp.SR.nrUnexpectedEmptyLongId(),m)) + | id::rest -> + ResolveTypeLongIdentPrim sink ncenv occurence true fullyQualified m nenv ad id rest staticResInfo genOk + // Register the result as a name resolution match res with | Result (resInfo,tcref) -> @@ -2957,55 +2962,52 @@ let ResolveTypeLongIdent sink (ncenv:NameResolver) occurence fullyQualified nenv //------------------------------------------------------------------------- /// Resolve a long identifier representing a record field in a module or namespace -let rec ResolveFieldInModuleOrNamespace (ncenv:NameResolver) nenv ad (resInfo:ResolutionInfo) depth m (modref: ModuleOrNamespaceRef) _mty (lid: Ident list) = +let rec ResolveFieldInModuleOrNamespace (ncenv:NameResolver) nenv ad (resInfo:ResolutionInfo) depth m (modref: ModuleOrNamespaceRef) _mty (id:Ident) (rest: Ident list) = let typeNameResInfo = TypeNameResolutionInfo.Default - match lid with - | id::rest -> - let m = unionRanges m id.idRange - // search for module-qualified names, e.g. { Microsoft.FSharp.Core.contents = 1 } - let modulScopedFieldNames = - match TryFindTypeWithRecdField modref id with - | Some tycon when IsEntityAccessible ncenv.amap m ad (modref.NestedTyconRef tycon) -> - let showDeprecated = HasFSharpAttribute ncenv.g ncenv.g.attrib_RequireQualifiedAccessAttribute tycon.Attribs - success [resInfo, FieldResolution(modref.RecdFieldRefInNestedTycon tycon id,showDeprecated), rest] - | _ -> raze (UndefinedName(depth,FSComp.SR.undefinedNameRecordLabelOrNamespace,id,NoSuggestions)) + let m = unionRanges m id.idRange + // search for module-qualified names, e.g. { Microsoft.FSharp.Core.contents = 1 } + let modulScopedFieldNames = + match TryFindTypeWithRecdField modref id with + | Some tycon when IsEntityAccessible ncenv.amap m ad (modref.NestedTyconRef tycon) -> + let showDeprecated = HasFSharpAttribute ncenv.g ncenv.g.attrib_RequireQualifiedAccessAttribute tycon.Attribs + success [resInfo, FieldResolution(modref.RecdFieldRefInNestedTycon tycon id,showDeprecated), rest] + | _ -> raze (UndefinedName(depth,FSComp.SR.undefinedNameRecordLabelOrNamespace,id,NoSuggestions)) - match modulScopedFieldNames with - | Result (res :: _) -> success res - | _ -> + match modulScopedFieldNames with + | Result (res :: _) -> success res + | _ -> - // search for type-qualified names, e.g. { Microsoft.FSharp.Core.Ref.contents = 1 } - let tyconSearch = - match lid with - | _tn:: rest when not (isNil rest) -> - let tcrefs = LookupTypeNameInEntityMaybeHaveArity (ncenv.amap, id.idRange, ad, id.idText, TypeNameResolutionStaticArgsInfo.Indefinite, modref) - if isNil tcrefs then NoResultsOrUsefulErrors else - let tcrefs = tcrefs |> List.map (fun tcref -> (ResolutionInfo.Empty,tcref)) - let tyconSearch = ResolveLongIdentInTyconRefs ResultCollectionSettings.AllResults ncenv nenv LookupKind.RecdField (depth+1) m ad rest typeNameResInfo id.idRange tcrefs - // choose only fields - let tyconSearch = tyconSearch |?> List.choose (function (resInfo,Item.RecdField(RecdFieldInfo(_,rfref)),rest) -> Some(resInfo,FieldResolution(rfref,false),rest) | _ -> None) - tyconSearch - | _ -> - NoResultsOrUsefulErrors + // search for type-qualified names, e.g. { Microsoft.FSharp.Core.Ref.contents = 1 } + let tyconSearch = + match rest with + | id2::rest2 -> + let tcrefs = LookupTypeNameInEntityMaybeHaveArity (ncenv.amap, id.idRange, ad, id.idText, TypeNameResolutionStaticArgsInfo.Indefinite, modref) + if isNil tcrefs then NoResultsOrUsefulErrors else + let tcrefs = tcrefs |> List.map (fun tcref -> (ResolutionInfo.Empty,tcref)) + let tyconSearch = ResolveLongIdentInTyconRefs ResultCollectionSettings.AllResults ncenv nenv LookupKind.RecdField (depth+1) m ad id2 rest2 typeNameResInfo id.idRange tcrefs + // choose only fields + let tyconSearch = tyconSearch |?> List.choose (function (resInfo,Item.RecdField(RecdFieldInfo(_,rfref)),rest) -> Some(resInfo,FieldResolution(rfref,false),rest) | _ -> None) + tyconSearch + | _ -> + NoResultsOrUsefulErrors - match tyconSearch with - | Result (res :: _) -> success res - | _ -> + match tyconSearch with + | Result (res :: _) -> success res + | _ -> - // search for names in nested modules, e.g. { Microsoft.FSharp.Core.contents = 1 } - let modulSearch = - if not (isNil rest) then - match modref.ModuleOrNamespaceType.ModulesAndNamespacesByDemangledName.TryFind(id.idText) with - | Some(AccessibleEntityRef ncenv.amap m ad modref submodref) -> - let resInfo = resInfo.AddEntity(id.idRange,submodref) - ResolveFieldInModuleOrNamespace ncenv nenv ad resInfo (depth+1) m submodref submodref.ModuleOrNamespaceType rest - |> OneResult - | _ -> raze (UndefinedName(depth,FSComp.SR.undefinedNameRecordLabelOrNamespace,id,NoSuggestions)) - else raze (UndefinedName(depth,FSComp.SR.undefinedNameRecordLabelOrNamespace,id,NoSuggestions)) + // search for names in nested modules, e.g. { Microsoft.FSharp.Core.contents = 1 } + let modulSearch = + match rest with + | id2::rest2 -> + match modref.ModuleOrNamespaceType.ModulesAndNamespacesByDemangledName.TryFind(id.idText) with + | Some(AccessibleEntityRef ncenv.amap m ad modref submodref) -> + let resInfo = resInfo.AddEntity(id.idRange,submodref) + ResolveFieldInModuleOrNamespace ncenv nenv ad resInfo (depth+1) m submodref submodref.ModuleOrNamespaceType id2 rest2 + |> OneResult + | _ -> raze (UndefinedName(depth,FSComp.SR.undefinedNameRecordLabelOrNamespace,id,NoSuggestions)) + | _ -> raze (UndefinedName(depth,FSComp.SR.undefinedNameRecordLabelOrNamespace,id,NoSuggestions)) - AtMostOneResult m (modulScopedFieldNames +++ tyconSearch +++ modulSearch) - | [] -> - error(InternalError("ResolveFieldInModuleOrNamespace",m)) + AtMostOneResult m (modulScopedFieldNames +++ tyconSearch +++ modulSearch) /// Suggest other labels of the same record let SuggestOtherLabelsOfSameRecordType g (nenv:NameResolutionEnv) typ (id:Ident) (allFields:Ident list) = @@ -3107,20 +3109,23 @@ let ResolveFieldPrim sink (ncenv:NameResolver) nenv ad typ (mp,id:Ident) allFiel let lid = (mp@[id]) let tyconSearch ad = match lid with - | tn:: (_ :: _ as rest) -> + | tn :: id2 :: rest2 -> let m = tn.idRange let tcrefs = LookupTypeNameInEnvNoArity OpenQualified tn.idText nenv if isNil tcrefs then NoResultsOrUsefulErrors else let tcrefs = tcrefs |> List.map (fun tcref -> (ResolutionInfo.Empty,tcref)) - let tyconSearch = ResolveLongIdentInTyconRefs ResultCollectionSettings.AllResults ncenv nenv LookupKind.RecdField 1 m ad rest typeNameResInfo tn.idRange tcrefs + let tyconSearch = ResolveLongIdentInTyconRefs ResultCollectionSettings.AllResults ncenv nenv LookupKind.RecdField 1 m ad id2 rest2 typeNameResInfo tn.idRange tcrefs // choose only fields let tyconSearch = tyconSearch |?> List.choose (function (resInfo,Item.RecdField(RecdFieldInfo(_,rfref)),rest) -> Some(resInfo,FieldResolution(rfref,false),rest) | _ -> None) tyconSearch | _ -> NoResultsOrUsefulErrors - let modulSearch ad = - ResolveLongIndentAsModuleOrNamespaceThen sink ResultCollectionSettings.AtMostOneResult ncenv.amap m OpenQualified nenv ad lid false - (ResolveFieldInModuleOrNamespace ncenv nenv ad) + let modulSearch ad = + match lid with + | [] -> NoResultsOrUsefulErrors + | id2::rest2 -> + ResolveLongIndentAsModuleOrNamespaceThen sink ResultCollectionSettings.AtMostOneResult ncenv.amap m OpenQualified nenv ad id2 rest2 false + (ResolveFieldInModuleOrNamespace ncenv nenv ad) let search = let moduleSearch1 = modulSearch ad @@ -3176,9 +3181,9 @@ let FreshenRecdFieldRef (ncenv:NameResolver) m (rfref:RecdFieldRef) = /// determine any valid members // // QUERY (instantiationGenerator cleanup): it would be really nice not to flow instantiationGenerator to here. -let private ResolveExprDotLongIdent (ncenv:NameResolver) m ad nenv typ lid findFlag = +let private ResolveExprDotLongIdent (ncenv:NameResolver) m ad nenv typ (id:Ident) rest findFlag = let typeNameResInfo = TypeNameResolutionInfo.Default - let adhoctDotSearchAccessible = AtMostOneResult m (ResolveLongIdentInTypePrim ncenv nenv LookupKind.Expr ResolutionInfo.Empty 1 m ad lid findFlag typeNameResInfo typ) + let adhoctDotSearchAccessible = AtMostOneResult m (ResolveLongIdentInTypePrim ncenv nenv LookupKind.Expr ResolutionInfo.Empty 1 m ad id rest findFlag typeNameResInfo typ) match adhoctDotSearchAccessible with | Exception _ -> // If the dot is not resolved by adhoc overloading then look for a record field @@ -3188,23 +3193,19 @@ let private ResolveExprDotLongIdent (ncenv:NameResolver) m ad nenv typ lid findF if isAppTy ncenv.g typ then NoResultsOrUsefulErrors else - match lid with - // A unique record label access, e.g expr.field - | id::rest -> - match Map.tryFind id.idText nenv.eFieldLabels with - | Some (rfref :: _) -> - // NOTE (instantiationGenerator cleanup): we need to freshen here because we don't know the type. - // But perhaps the caller should freshen?? - let item = FreshenRecdFieldRef ncenv m rfref - OneSuccess (ResolutionInfo.Empty,item,rest) - | _ -> NoResultsOrUsefulErrors - | _ -> NoResultsOrUsefulErrors + match nenv.eFieldLabels |> Map.tryFind id.idText with + | Some(rfref :: _) -> + // NOTE (instantiationGenerator cleanup): we need to freshen here because we don't know the type. + // But perhaps the caller should freshen?? + let item = FreshenRecdFieldRef ncenv m rfref + OneSuccess (ResolutionInfo.Empty,item,rest) + | _ -> NoResultsOrUsefulErrors let search = dotFieldIdSearch match AtMostOneResult m search with | Result _ as res -> ForceRaise res | _ -> - let adhocDotSearchAll = ResolveLongIdentInTypePrim ncenv nenv LookupKind.Expr ResolutionInfo.Empty 1 m AccessibleFromSomeFSharpCode lid findFlag typeNameResInfo typ + let adhocDotSearchAll = ResolveLongIdentInTypePrim ncenv nenv LookupKind.Expr ResolutionInfo.Empty 1 m AccessibleFromSomeFSharpCode id rest findFlag typeNameResInfo typ ForceRaise (AtMostOneResult m (search +++ adhocDotSearchAll)) | _ -> ForceRaise adhoctDotSearchAccessible @@ -3316,7 +3317,11 @@ let (|NonOverridable|_|) namedItem = /// Also called for 'GenericType.Bar' - for VS IntelliSense, we can filter out non-static members from method groups let ResolveExprDotLongIdentAndComputeRange (sink:TcResultsSink) (ncenv:NameResolver) wholem ad nenv typ lid findFlag thisIsActuallyATyAppNotAnExpr = let resolveExpr findFlag = - let resInfo,item,rest = ResolveExprDotLongIdent ncenv wholem ad nenv typ lid findFlag + let resInfo,item,rest = + match lid with + | id::rest -> + ResolveExprDotLongIdent ncenv wholem ad nenv typ id rest findFlag + | _ -> error(InternalError("ResolveExprDotLongIdentAndComputeRange",wholem)) let itemRange = ComputeItemRange wholem lid rest resInfo,item,rest,itemRange // "true" resolution diff --git a/src/fsharp/NameResolution.fsi b/src/fsharp/NameResolution.fsi index 859009e364..f8bec6f148 100755 --- a/src/fsharp/NameResolution.fsi +++ b/src/fsharp/NameResolution.fsi @@ -451,13 +451,13 @@ type ResultCollectionSettings = | AtMostOneResult /// Resolve a long identifier to a namespace or module. -val internal ResolveLongIndentAsModuleOrNamespace : TcResultsSink -> ResultCollectionSettings -> Import.ImportMap -> range -> FullyQualifiedFlag -> NameResolutionEnv -> AccessorDomain -> Ident list -> isOpenDecl: bool -> ResultOrException<(int * ModuleOrNamespaceRef * ModuleOrNamespaceType) list > +val internal ResolveLongIndentAsModuleOrNamespace : TcResultsSink -> ResultCollectionSettings -> Import.ImportMap -> range -> bool -> FullyQualifiedFlag -> NameResolutionEnv -> AccessorDomain -> Ident -> Ident list -> isOpenDecl: bool -> ResultOrException<(int * ModuleOrNamespaceRef * ModuleOrNamespaceType) list > /// Resolve a long identifier to an object constructor. val internal ResolveObjectConstructor : NameResolver -> DisplayEnv -> range -> AccessorDomain -> TType -> ResultOrException /// Resolve a long identifier using type-qualified name resolution. -val internal ResolveLongIdentInType : TcResultsSink -> NameResolver -> NameResolutionEnv -> LookupKind -> range -> AccessorDomain -> Ident list -> FindMemberFlag -> TypeNameResolutionInfo -> TType -> Item * Ident list +val internal ResolveLongIdentInType : TcResultsSink -> NameResolver -> NameResolutionEnv -> LookupKind -> range -> AccessorDomain -> Ident -> FindMemberFlag -> TypeNameResolutionInfo -> TType -> Item * Ident list /// Resolve a long identifier when used in a pattern. val internal ResolvePatternLongIdent : TcResultsSink -> NameResolver -> WarnOnUpperFlag -> bool -> range -> AccessorDomain -> NameResolutionEnv -> TypeNameResolutionInfo -> Ident list -> Item diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index 6aa5ffa64a..ba9cbe6992 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -697,13 +697,16 @@ let ImplicitlyOpenOwnNamespace tcSink g amap scopem enclosingNamespacePath env = | Some(_, rest) -> rest | None -> enclosingNamespacePath - let ad = env.eAccessRights - match ResolveLongIndentAsModuleOrNamespace tcSink ResultCollectionSettings.AllResults amap scopem OpenQualified env.eNameResEnv ad enclosingNamespacePathToOpen true with - | Result modrefs -> - let modrefs = List.map p23 modrefs - let openDecl = OpenDeclaration.Create (enclosingNamespacePathToOpen, modrefs, scopem, true) - OpenModulesOrNamespaces tcSink g amap scopem false env modrefs openDecl - | Exception _ -> env + match enclosingNamespacePathToOpen with + | id::rest -> + let ad = env.eAccessRights + match ResolveLongIndentAsModuleOrNamespace tcSink ResultCollectionSettings.AllResults amap scopem true OpenQualified env.eNameResEnv ad id rest true with + | Result modrefs -> + let modrefs = List.map p23 modrefs + let openDecl = OpenDeclaration.Create (enclosingNamespacePathToOpen, modrefs, scopem, true) + OpenModulesOrNamespaces tcSink g amap scopem false env modrefs openDecl + | Exception _ -> env + | _ -> env //------------------------------------------------------------------------- @@ -6805,7 +6808,7 @@ and TcConstExpr cenv overallTy env m tpenv c = let expr = let modName = "NumericLiteral" + suffix let ad = env.eAccessRights - match ResolveLongIndentAsModuleOrNamespace cenv.tcSink ResultCollectionSettings.AtMostOneResult cenv.amap m OpenQualified env.eNameResEnv ad [ident (modName, m)] false with + match ResolveLongIndentAsModuleOrNamespace cenv.tcSink ResultCollectionSettings.AtMostOneResult cenv.amap m true OpenQualified env.eNameResEnv ad (ident (modName, m)) [] false with | Result [] | Exception _ -> error(Error(FSComp.SR.tcNumericLiteralRequiresModule(modName), m)) | Result ((_, mref, _) :: _) -> @@ -10632,13 +10635,13 @@ and TcAttribute canFail cenv (env: TcEnv) attrTgt (synAttr: SynAttribute) = attributeAssignedNamedItems |> List.map (fun (CallerNamedArg(id, CallerArg(argtyv, m, isOpt, callerArgExpr))) -> if isOpt then error(Error(FSComp.SR.tcOptionalArgumentsCannotBeUsedInCustomAttribute(), m)) let m = callerArgExpr.Range - let setterItem, _ = ResolveLongIdentInType cenv.tcSink cenv.nameResolver env.NameEnv LookupKind.Expr m ad [id] IgnoreOverrides TypeNameResolutionInfo.Default ty + let setterItem, _ = ResolveLongIdentInType cenv.tcSink cenv.nameResolver env.NameEnv LookupKind.Expr m ad id IgnoreOverrides TypeNameResolutionInfo.Default ty let nm, isProp, argty = match setterItem with | Item.Property (_, [pinfo]) -> if not pinfo.HasSetter then errorR(Error(FSComp.SR.tcPropertyCannotBeSet0(), m)) - id.idText, true, pinfo.GetPropertyType(cenv.amap, m) + id.idText, true, pinfo.GetPropertyType(cenv.amap, m) | Item.ILField finfo -> CheckILFieldInfoAccessible cenv.g cenv.amap m ad finfo CheckILFieldAttributes cenv.g finfo m @@ -12081,10 +12084,13 @@ let TcTyconMemberSpecs cenv env containerInfo declKind tpenv (augSpfn: SynMember let TcModuleOrNamespaceLidAndPermitAutoResolve tcSink env amap (longId : Ident list) = let ad = env.eAccessRights - let m = longId |> List.map (fun id -> id.idRange) |> List.reduce unionRanges - match ResolveLongIndentAsModuleOrNamespace tcSink ResultCollectionSettings.AllResults amap m OpenQualified env.eNameResEnv ad longId true with - | Result res -> Result res - | Exception err -> raze err + match longId with + | [] -> Result [] + | id::rest -> + let m = longId |> List.map (fun id -> id.idRange) |> List.reduce unionRanges + match ResolveLongIndentAsModuleOrNamespace tcSink ResultCollectionSettings.AllResults amap m true OpenQualified env.eNameResEnv ad id rest true with + | Result res -> Result res + | Exception err -> raze err let TcOpenDecl tcSink (g:TcGlobals) amap m scopem env (longId : Ident list) = let modrefs = ForceRaise (TcModuleOrNamespaceLidAndPermitAutoResolve tcSink env amap longId) @@ -13581,12 +13587,17 @@ module MutRecBindingChecking = /// Check a "module X = A.B.C" module abbreviation declaration let TcModuleAbbrevDecl (cenv:cenv) scopem env (id, p, m) = let ad = env.eAccessRights - let mvvs = ForceRaise (ResolveLongIndentAsModuleOrNamespace cenv.tcSink ResultCollectionSettings.AllResults cenv.amap m OpenQualified env.eNameResEnv ad p false) - let modrefs = mvvs |> List.map p23 - if not (List.isEmpty modrefs) && modrefs |> List.forall (fun modref -> modref.IsNamespace) then + let resolved = + match p with + | [] -> Result [] + | id::rest -> ResolveLongIndentAsModuleOrNamespace cenv.tcSink ResultCollectionSettings.AllResults cenv.amap m true OpenQualified env.eNameResEnv ad id rest false + let mvvs = ForceRaise resolved + if isNil mvvs then env else + let modrefs = mvvs |> List.map p23 + if not (isNil modrefs) && modrefs |> List.forall (fun modref -> modref.IsNamespace) then errorR(Error(FSComp.SR.tcModuleAbbreviationForNamespace(fullDisplayTextOfModRef (List.head modrefs)), m)) let modrefs = modrefs |> List.filter (fun mvv -> not mvv.IsNamespace) - if List.isEmpty modrefs then env else + if isNil modrefs then env else modrefs |> List.iter (fun modref -> CheckEntityAttributes cenv.g modref m |> CommitOperationResult) let env = AddModuleAbbreviationAndReport cenv.tcSink scopem id modrefs env env @@ -16364,7 +16375,11 @@ let rec TcSignatureElementNonMutRec cenv parent typeNames endm (env: TcEnv) synS | SynModuleSigDecl.ModuleAbbrev (id, p, m) -> let ad = env.eAccessRights - let mvvs = ForceRaise (ResolveLongIndentAsModuleOrNamespace cenv.tcSink ResultCollectionSettings.AllResults cenv.amap m OpenQualified env.eNameResEnv ad p false) + let resolved = + match p with + | [] -> Result [] + | id::rest -> ResolveLongIndentAsModuleOrNamespace cenv.tcSink ResultCollectionSettings.AllResults cenv.amap m true OpenQualified env.eNameResEnv ad id rest false + let mvvs = ForceRaise resolved let scopem = unionRanges m endm let unfilteredModrefs = mvvs |> List.map p23 diff --git a/src/fsharp/pars.fsy b/src/fsharp/pars.fsy index c36b188641..267b5d566f 100644 --- a/src/fsharp/pars.fsy +++ b/src/fsharp/pars.fsy @@ -3631,6 +3631,13 @@ atomicExprQualification: | identOrOp { let idm = rhs parseState 1 (fun e lhsm dotm -> mkSynDot dotm lhsm e $1) } + + | GLOBAL + { (fun e lhsm dotm -> + reportParseErrorAt (rhs parseState 3) (FSComp.SR.nrGlobalUsedOnlyAsFirstName()) + let fixedLhsm = mkRange lhsm.FileName lhsm.Start dotm.End // previous lhsm is wrong after 'recover' + mkSynDotMissing dotm fixedLhsm e) } + | /* empty */ { (fun e lhsm dotm -> reportParseErrorAt dotm (FSComp.SR.parsMissingQualificationAfterDot()) diff --git a/tests/fsharpqa/Source/ErrorMessages/NameResolution/E_GlobalQualifierAfterDot.fs b/tests/fsharpqa/Source/ErrorMessages/NameResolution/E_GlobalQualifierAfterDot.fs new file mode 100644 index 0000000000..b369ffad37 --- /dev/null +++ b/tests/fsharpqa/Source/ErrorMessages/NameResolution/E_GlobalQualifierAfterDot.fs @@ -0,0 +1,6 @@ +// #ErrorMessages #NameResolution +//'global' may only be used as the first name in a qualified path + +let x = global.System.String.Empty.global.System.String.Empty + +exit 0 diff --git a/tests/fsharpqa/Source/ErrorMessages/NameResolution/env.lst b/tests/fsharpqa/Source/ErrorMessages/NameResolution/env.lst index 435fb96c42..42209ddd28 100644 --- a/tests/fsharpqa/Source/ErrorMessages/NameResolution/env.lst +++ b/tests/fsharpqa/Source/ErrorMessages/NameResolution/env.lst @@ -1,2 +1,3 @@ SOURCE=E_RecordFieldProposal.fs # E_RecordFieldProposal + SOURCE=E_GlobalQualifierAfterDot.fs # E_GlobalQualifierAfterDot SOURCE=E_FieldNotInRecord.fs # E_FieldNotInRecord \ No newline at end of file From 9639b2e8123ddc5900d04a4fa1f444b5491a9ac5 Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Wed, 14 Mar 2018 11:59:28 -0700 Subject: [PATCH 110/147] Remove reference to FSharp.LanguageService.Base from FSharp.ProjectSystem.Base (#4518) --- .../FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj index f4a34ebf7e..a7090620e5 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj @@ -36,7 +36,6 @@ - From 6d50665dcf148b5b52bf3bc36084b3cf458b322a Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Wed, 14 Mar 2018 16:10:18 -0700 Subject: [PATCH 111/147] Enable Net Sdk to write project properties (#4430) * Enable net sdk project properties to be set in assembly info * Add back removed file * correct version * typo --- mono/config.make | 6 ++++ .../component-groups/Compiler_Redist.wxs | 6 ++++ .../Microsoft.FSharp.Dependencies/Files.swr | 1 + ...osoft.FSharp.Overrides.NetSdk.Shim.targets | 5 +++ .../FSharp.Build/FSharp.Build.fsproj | 5 +++ .../FSharp.Build-proto.fsproj | 3 ++ src/fsharp/FSharp.Build/FSharp.Build.fsproj | 1 + .../Microsoft.FSharp.Overrides.NetSdk.targets | 36 +++++++++++++++++++ .../Microsoft.FSharp.Compiler.nuspec | 6 ++-- .../Testing.FSharp.Compiler.nuspec | 3 +- vsintegration/update-vsintegration.cmd | 1 + 11 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 setup/resources/Microsoft.FSharp.Overrides.NetSdk.Shim.targets create mode 100644 src/fsharp/FSharp.Build/Microsoft.FSharp.Overrides.NetSdk.targets diff --git a/mono/config.make b/mono/config.make index c0efba5f1c..f7002c1119 100644 --- a/mono/config.make +++ b/mono/config.make @@ -211,6 +211,12 @@ install-sdk-lib: $(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v12.0/FSharp/; \ $(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v14.0/FSharp/; \ $(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v15.0/FSharp/; \ + \ + $(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.Overrides.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v/FSharp/; \ + $(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.Overrides.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v11.0/FSharp/; \ + $(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.Overrides.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v12.0/FSharp/; \ + $(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.Overrides.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v14.0/FSharp/; \ + $(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.Overrides.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v15.0/FSharp/; \ fi @if test x-$(outsuffix) = x-net40; then \ if test -e $(outdir)$(NAME).dll; then \ diff --git a/setup/FSharp.SDK/component-groups/Compiler_Redist.wxs b/setup/FSharp.SDK/component-groups/Compiler_Redist.wxs index 356e355b0b..b05b7d9d0d 100644 --- a/setup/FSharp.SDK/component-groups/Compiler_Redist.wxs +++ b/setup/FSharp.SDK/component-groups/Compiler_Redist.wxs @@ -17,6 +17,7 @@ + @@ -126,6 +127,10 @@ + + + + @@ -140,6 +145,7 @@ + diff --git a/setup/Swix/Microsoft.FSharp.Dependencies/Files.swr b/setup/Swix/Microsoft.FSharp.Dependencies/Files.swr index 9dd3250060..346d1be98e 100644 --- a/setup/Swix/Microsoft.FSharp.Dependencies/Files.swr +++ b/setup/Swix/Microsoft.FSharp.Dependencies/Files.swr @@ -7,6 +7,7 @@ folder "InstallDir:MSBuild\Microsoft\VisualStudio\v15.0\FSharp" file "Microsoft.FSharp.Targets" source="$(BinariesFolder)\setup\resources\Microsoft.FSharp.Shim.targets" file "Microsoft.Portable.FSharp.Targets" source="$(BinariesFolder)\setup\resources\Microsoft.Portable.FSharp.Shim.targets" file "Microsoft.FSharp.NetSdk.targets" source="$(BinariesFolder)\setup\resources\Microsoft.FSharp.NetSdk.Shim.targets" + file "Microsoft.FSharp.NetSdk.Overrides.targets" source="$(BinariesFolder)\setup\resources\Microsoft.FSharp.Overrides.NetSdk.Shim.targets" file "Microsoft.FSharp.NetSdk.props" source="$(BinariesFolder)\setup\resources\Microsoft.FSharp.NetSdk.Shim.props" folder "InstallDir:Common7\IDE\PublicAssemblies" diff --git a/setup/resources/Microsoft.FSharp.Overrides.NetSdk.Shim.targets b/setup/resources/Microsoft.FSharp.Overrides.NetSdk.Shim.targets new file mode 100644 index 0000000000..76fb5cd811 --- /dev/null +++ b/setup/resources/Microsoft.FSharp.Overrides.NetSdk.Shim.targets @@ -0,0 +1,5 @@ + + + + + diff --git a/src/buildfromsource/FSharp.Build/FSharp.Build.fsproj b/src/buildfromsource/FSharp.Build/FSharp.Build.fsproj index f49ecb7338..05d080ccfa 100644 --- a/src/buildfromsource/FSharp.Build/FSharp.Build.fsproj +++ b/src/buildfromsource/FSharp.Build/FSharp.Build.fsproj @@ -46,6 +46,11 @@ {BuildSuffix} + + Microsoft.FSharp.Overrides.NetSdk.targets + {BuildSuffix} + + diff --git a/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj b/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj index c003080b9e..fa539c3c2b 100644 --- a/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj +++ b/src/fsharp/FSharp.Build-proto/FSharp.Build-proto.fsproj @@ -51,6 +51,9 @@ Microsoft.FSharp.NetSdk.targets + + Microsoft.FSharp.Overrides.NetSdk.targets + diff --git a/src/fsharp/FSharp.Build/FSharp.Build.fsproj b/src/fsharp/FSharp.Build/FSharp.Build.fsproj index dbc4313c4f..fa3c700663 100644 --- a/src/fsharp/FSharp.Build/FSharp.Build.fsproj +++ b/src/fsharp/FSharp.Build/FSharp.Build.fsproj @@ -37,6 +37,7 @@ + diff --git a/src/fsharp/FSharp.Build/Microsoft.FSharp.Overrides.NetSdk.targets b/src/fsharp/FSharp.Build/Microsoft.FSharp.Overrides.NetSdk.targets new file mode 100644 index 0000000000..ce837dbf21 --- /dev/null +++ b/src/fsharp/FSharp.Build/Microsoft.FSharp.Overrides.NetSdk.targets @@ -0,0 +1,36 @@ + + + + + + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + + + + + + + + + + + + + diff --git a/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec b/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec index b5276a7145..c70df6f21e 100644 --- a/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec +++ b/src/fsharp/FSharp.Compiler.nuget/Microsoft.FSharp.Compiler.nuspec @@ -42,8 +42,9 @@ - + + @@ -64,8 +65,9 @@ - + + diff --git a/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec b/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec index 91c9447518..f34a02e644 100644 --- a/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec +++ b/src/fsharp/FSharp.Compiler.nuget/Testing.FSharp.Compiler.nuspec @@ -55,8 +55,9 @@ - + + diff --git a/vsintegration/update-vsintegration.cmd b/vsintegration/update-vsintegration.cmd index b300bbbad5..7ae78630c3 100644 --- a/vsintegration/update-vsintegration.cmd +++ b/vsintegration/update-vsintegration.cmd @@ -226,6 +226,7 @@ if "!BIN_AVAILABLE!" == "true" ( CALL :backupAndOrCopy Microsoft.Portable.FSharp.Targets "%COMPILERSDKPATH%" CALL :backupAndOrCopy Microsoft.FSharp.NetSdk.props "%COMPILERSDKPATH%" CALL :backupAndOrCopy Microsoft.FSharp.NetSdk.targets "%COMPILERSDKPATH%" + CALL :backupAndOrCopy Microsoft.FSharp.Overrides.NetSdk.targets "%COMPILERSDKPATH%" rem Special casing for SupportedRuntimes.xml, it has a different source directory, it's always there set SOURCEDIR="%TOPDIR%\vsintegration\src\SupportedRuntimes" From ed152d7ba8c5d776581c7745a5217944dfb5fdfa Mon Sep 17 00:00:00 2001 From: Avi Avni Date: Thu, 15 Mar 2018 01:11:32 +0200 Subject: [PATCH 112/147] Reduce memory footprint for Entity type (#4429) * add entity_compiled_name, entity_other_range to EntityOptionalData * add entity_kind to EntityOptionalData * add entity_xmldoc, entity_xmldocsig to EntityOptionalData * add entity_tycon_abbrev to EntityOptionalData * add entity_tycon_repr_accessibility, entity_accessiblity to EntityOptionalData * add entity_exn_info to EntityOptionalData * remove XmlDocSif from TastPickle * fix unit check * add namespace check for unit --- src/fsharp/TastOps.fs | 48 ++-- src/fsharp/TastPickle.fs | 33 +-- src/fsharp/TypeChecker.fs | 12 +- .../service/ServiceInterfaceStubGenerator.fs | 5 +- src/fsharp/tast.fs | 263 ++++++++++-------- 5 files changed, 202 insertions(+), 159 deletions(-) diff --git a/src/fsharp/TastOps.fs b/src/fsharp/TastOps.fs index a5f59868f5..31f0b9790d 100644 --- a/src/fsharp/TastOps.fs +++ b/src/fsharp/TastOps.fs @@ -5030,14 +5030,19 @@ and copyAndRemapAndBindTyconsAndVals g compgen tmenv tycons vs = (tycons, tycons') ||> List.iter2 (fun tcd tcd' -> let tps', tmenvinner2 = tmenvCopyRemapAndBindTypars (remapAttribs g tmenvinner) tmenvinner (tcd.entity_typars.Force(tcd.entity_range)) - tcd'.entity_typars <- LazyWithContext.NotLazy tps'; - tcd'.entity_attribs <- tcd.entity_attribs |> remapAttribs g tmenvinner2; - tcd'.entity_tycon_repr <- tcd.entity_tycon_repr |> remapTyconRepr g tmenvinner2; - tcd'.entity_tycon_abbrev <- tcd.entity_tycon_abbrev |> Option.map (remapType tmenvinner2) ; - tcd'.entity_tycon_tcaug <- tcd.entity_tycon_tcaug |> remapTyconAug tmenvinner2 ; + tcd'.entity_typars <- LazyWithContext.NotLazy tps' + tcd'.entity_attribs <- tcd.entity_attribs |> remapAttribs g tmenvinner2 + tcd'.entity_tycon_repr <- tcd.entity_tycon_repr |> remapTyconRepr g tmenvinner2 + let typeAbbrevR = tcd.TypeAbbrev |> Option.map (remapType tmenvinner2) + tcd'.entity_tycon_tcaug <- tcd.entity_tycon_tcaug |> remapTyconAug tmenvinner2 tcd'.entity_modul_contents <- MaybeLazy.Strict (tcd.entity_modul_contents.Value - |> mapImmediateValsAndTycons lookupTycon lookupVal); - tcd'.entity_exn_info <- tcd.entity_exn_info |> remapTyconExnInfo g tmenvinner2) ; + |> mapImmediateValsAndTycons lookupTycon lookupVal) + let exnInfoR = tcd.ExceptionInfo |> remapTyconExnInfo g tmenvinner2 + match tcd'.entity_opt_data with + | Some optData -> tcd'.entity_opt_data <- Some { optData with entity_tycon_abbrev = typeAbbrevR; entity_exn_info = exnInfoR } + | _ -> + tcd'.SetTypeAbbrev typeAbbrevR + tcd'.SetExceptionInfo exnInfoR) tycons', vs', tmenvinner @@ -7773,17 +7778,26 @@ let MakeExportRemapping viewedCcu (mspec:ModuleOrNamespace) = let rec remapEntityDataToNonLocal g tmenv (d: Entity) = let tps', tmenvinner = tmenvCopyRemapAndBindTypars (remapAttribs g tmenv) tmenv (d.entity_typars.Force(d.entity_range)) - + let typarsR = LazyWithContext.NotLazy tps' + let attribsR = d.entity_attribs |> remapAttribs g tmenvinner + let tyconReprR = d.entity_tycon_repr |> remapTyconRepr g tmenvinner + let tyconAbbrevR = d.TypeAbbrev |> Option.map (remapType tmenvinner) + let tyconTcaugR = d.entity_tycon_tcaug |> remapTyconAug tmenvinner + let modulContentsR = + MaybeLazy.Strict (d.entity_modul_contents.Value + |> mapImmediateValsAndTycons (remapTyconToNonLocal g tmenv) (remapValToNonLocal g tmenv)) + let exnInfoR = d.ExceptionInfo |> remapTyconExnInfo g tmenvinner { d with - entity_typars = LazyWithContext.NotLazy tps'; - entity_attribs = d.entity_attribs |> remapAttribs g tmenvinner; - entity_tycon_repr = d.entity_tycon_repr |> remapTyconRepr g tmenvinner; - entity_tycon_abbrev = d.entity_tycon_abbrev |> Option.map (remapType tmenvinner) ; - entity_tycon_tcaug = d.entity_tycon_tcaug |> remapTyconAug tmenvinner ; - entity_modul_contents = - MaybeLazy.Strict (d.entity_modul_contents.Value - |> mapImmediateValsAndTycons (remapTyconToNonLocal g tmenv) (remapValToNonLocal g tmenv)); - entity_exn_info = d.entity_exn_info |> remapTyconExnInfo g tmenvinner} + entity_typars = typarsR + entity_attribs = attribsR + entity_tycon_repr = tyconReprR + entity_tycon_tcaug = tyconTcaugR + entity_modul_contents = modulContentsR + entity_opt_data = + match d.entity_opt_data with + | Some dd -> + Some { dd with entity_tycon_abbrev = tyconAbbrevR; entity_exn_info = exnInfoR } + | _ -> None } and remapTyconToNonLocal g tmenv x = x |> NewModifiedTycon (remapEntityDataToNonLocal g tmenv) diff --git a/src/fsharp/TastPickle.fs b/src/fsharp/TastPickle.fs index 1726db2607..118c14d33b 100755 --- a/src/fsharp/TastPickle.fs +++ b/src/fsharp/TastPickle.fs @@ -1706,23 +1706,23 @@ and p_rfield_table x st = and p_entity_spec_data (x:Entity) st = p_typar_specs (x.entity_typars.Force(x.entity_range)) st p_string x.entity_logical_name st - p_option p_string x.entity_compiled_name st + p_option p_string x.EntityCompiledName st p_range x.entity_range st p_option p_pubpath x.entity_pubpath st - p_access x.entity_accessiblity st - p_access x.entity_tycon_repr_accessibility st + p_access x.Accessibility st + p_access x.TypeReprAccessibility st p_attribs x.entity_attribs st let flagBit = p_tycon_repr x.entity_tycon_repr st - p_option p_typ x.entity_tycon_abbrev st + p_option p_typ x.TypeAbbrev st p_tcaug x.entity_tycon_tcaug st - p_string x.entity_xmldocsig st - p_kind x.entity_kind st + p_string System.String.Empty st + p_kind x.TypeOrMeasureKind st p_int64 (x.entity_flags.PickledBits ||| (if flagBit then EntityFlags.ReservedBitForPickleFormatTyconReprFlag else 0L)) st p_option p_cpath x.entity_cpath st p_maybe_lazy p_modul_typ x.entity_modul_contents st - p_exnc_repr x.entity_exn_info st + p_exnc_repr x.ExceptionInfo st if st.oInMem then - p_used_space1 (p_xmldoc x.entity_xmldoc) st + p_used_space1 (p_xmldoc x.XmlDoc) st else p_space 1 () st @@ -1959,7 +1959,7 @@ and u_recdfield_spec st = and u_rfield_table st = MakeRecdFieldsTable (u_list u_recdfield_spec st) and u_entity_spec_data st : Entity = - let x1,x2a,x2b,x2c,x3,(x4a,x4b),x6,x7f,x8,x9,x10,x10b,x11,x12,x13,x14,x15 = + let x1,x2a,x2b,x2c,x3,(x4a,x4b),x6,x7f,x8,x9,_x10,x10b,x11,x12,x13,x14,x15 = u_tup17 u_typar_specs u_string @@ -1986,25 +1986,20 @@ and u_entity_spec_data st : Entity = { entity_typars=LazyWithContext.NotLazy x1 entity_stamp=newStamp() entity_logical_name=x2a - entity_compiled_name=x2b entity_range=x2c - entity_other_range=None entity_pubpath=x3 - entity_accessiblity=x4a - entity_tycon_repr_accessibility=x4b entity_attribs=x6 entity_tycon_repr=x7 - entity_tycon_abbrev=x8 entity_tycon_tcaug=x9 - entity_xmldoc= defaultArg x15 XmlDoc.Empty - entity_xmldocsig=x10 - entity_kind=x10b entity_flags=EntityFlags(x11) entity_cpath=x12 entity_modul_contents=MaybeLazy.Lazy x13 - entity_exn_info=x14 entity_il_repr_cache=newCache() - } + entity_opt_data= + match x2b, x10b, x15, x8, x4a, x4b, x14 with + | None, TyparKind.Type, None, None, TAccess [], TAccess [], TExnNone -> None + | _ -> Some { Entity.EmptyEntityOptData with entity_compiled_name = x2b; entity_kind = x10b; entity_xmldoc= defaultArg x15 XmlDoc.Empty; entity_xmldocsig = System.String.Empty; entity_tycon_abbrev = x8; entity_accessiblity = x4a; entity_tycon_repr_accessibility = x4b; entity_exn_info = x14 } + } and u_tcaug st = let a1,a2,a3,b2,c,d,e,g,_space = diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index ba9cbe6992..eb3e39783a 100755 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -14358,7 +14358,7 @@ module TcExceptionDeclarations = | None -> TExnFresh (MakeRecdFieldsTable args') - exnc.entity_exn_info <- repr + exnc.SetExceptionInfo repr let item = Item.ExnCase(mkLocalTyconRef exnc) CallNameResolutionSink cenv.tcSink (id.idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Binding, env.DisplayEnv, env.eAccessRights) @@ -14665,10 +14665,10 @@ module EstablishTypeDefinitionCores = tycon.SetIsStructRecordOrUnion isStructRecordOrUnionType // Set the compiled name, if any - tycon.entity_compiled_name <- TryFindFSharpStringAttribute cenv.g cenv.g.attrib_CompiledNameAttribute attrs + tycon.SetCompiledName (TryFindFSharpStringAttribute cenv.g cenv.g.attrib_CompiledNameAttribute attrs) if hasMeasureAttr then - tycon.entity_kind <- TyparKind.Measure + tycon.SetTypeOrMeasureKind TyparKind.Measure if not (isNil typars) then error(Error(FSComp.SR.tcMeasureDefinitionsCannotHaveTypeParameters(), m)) let repr = @@ -14990,7 +14990,7 @@ module EstablishTypeDefinitionCores = errorR(Deprecated(FSComp.SR.tcTypeAbbreviationHasTypeParametersMissingOnType(), tycon.Range)) if firstPass then - tycon.entity_tycon_abbrev <- Some ty + tycon.SetTypeAbbrev (Some ty) | _ -> () @@ -15507,7 +15507,7 @@ module EstablishTypeDefinitionCores = graph.IterateCycles (fun path -> let tycon = path.Head // The thing is cyclic. Set the abbreviation and representation to be "None" to stop later VS crashes - tycon.entity_tycon_abbrev <- None + tycon.SetTypeAbbrev None tycon.entity_tycon_repr <- TNoRepr errorR(Error(FSComp.SR.tcTypeDefinitionIsCyclic(), tycon.Range))) @@ -15642,7 +15642,7 @@ module EstablishTypeDefinitionCores = graph.IterateCycles (fun path -> let tycon = path.Head // The thing is cyclic. Set the abbreviation and representation to be "None" to stop later VS crashes - tycon.entity_tycon_abbrev <- None + tycon.SetTypeAbbrev None tycon.entity_tycon_repr <- TNoRepr errorR(Error(FSComp.SR.tcTypeDefinitionIsCyclicThroughInheritance(), tycon.Range))) diff --git a/src/fsharp/service/ServiceInterfaceStubGenerator.fs b/src/fsharp/service/ServiceInterfaceStubGenerator.fs index 04b09ec157..7532449dc9 100644 --- a/src/fsharp/service/ServiceInterfaceStubGenerator.fs +++ b/src/fsharp/service/ServiceInterfaceStubGenerator.fs @@ -213,7 +213,7 @@ module internal InterfaceStubGenerator = let nm = match arg.Name with | None -> - if arg.Type.HasTypeDefinition && arg.Type.TypeDefinition.XmlDocSig = "T:Microsoft.FSharp.Core.unit" then "()" + if arg.Type.HasTypeDefinition && arg.Type.TypeDefinition.CompiledName = "unit" && arg.Type.TypeDefinition.Namespace = Some "Microsoft.FSharp.Core" then "()" else sprintf "arg%d" (namesWithIndices |> Map.toSeq |> Seq.map snd |> Seq.sumBy Set.count |> max 1) | Some x -> x @@ -302,7 +302,8 @@ module internal InterfaceStubGenerator = let args, namesWithIndices = match argInfos with | [[x]] when v.IsPropertyGetterMethod && x.Name.IsNone - && x.Type.TypeDefinition.XmlDocSig = "T:Microsoft.FSharp.Core.unit" -> + && x.Type.TypeDefinition.CompiledName = "unit" + && x.Type.TypeDefinition.Namespace = Some "Microsoft.FSharp.Core" -> "", Map.ofList [ctx.ObjectIdent, Set.empty] | _ -> formatArgsUsage ctx verboseMode v argInfos diff --git a/src/fsharp/tast.fs b/src/fsharp/tast.fs index 58a348c186..dce289d26d 100755 --- a/src/fsharp/tast.fs +++ b/src/fsharp/tast.fs @@ -485,15 +485,51 @@ let ComputeDefinitionLocationOfProvidedItem (p : Tainted<#IProvidedCustomAttribu #endif -/// Represents a type definition, exception definition, module definition or namespace definition. -[] -type Entity = - { /// The declared type parameters of the type - // MUTABILITY; used only during creation and remapping of tycons - mutable entity_typars: LazyWithContext +type EntityOptionalData = + { + /// The name of the type, possibly with `n mangling + // MUTABILITY; used only when establishing tycons. + mutable entity_compiled_name: string option + + // MUTABILITY: the signature is adjusted when it is checked + /// If this field is populated, this is the implementation range for an item in a signature, otherwise it is + /// the signature range for an item in an implementation + mutable entity_other_range: (range * bool) option // MUTABILITY; used only when establishing tycons. mutable entity_kind : TyparKind + + /// The declared documentation for the type or module + // MUTABILITY: only for unpickle linkage + mutable entity_xmldoc : XmlDoc + + /// The XML document signature for this entity + mutable entity_xmldocsig : string + + /// If non-None, indicates the type is an abbreviation for another type. + // + // MUTABILITY; used only during creation and remapping of tycons + mutable entity_tycon_abbrev: TType option + + /// The declared accessibility of the representation, not taking signatures into account + mutable entity_tycon_repr_accessibility: Accessibility + + /// Indicates how visible is the entity is. + // MUTABILITY: only for unpickle linkage + mutable entity_accessiblity: Accessibility + + /// Field used when the 'tycon' is really an exception definition + // + // MUTABILITY; used only during creation and remapping of tycons + mutable entity_exn_info: ExceptionInfo + } + +and /// Represents a type definition, exception definition, module definition or namespace definition. + [] + Entity = + { /// The declared type parameters of the type + // MUTABILITY; used only during creation and remapping of tycons + mutable entity_typars: LazyWithContext mutable entity_flags : EntityFlags @@ -505,21 +541,9 @@ type Entity = // MUTABILITY: only for unpickle linkage mutable entity_logical_name: string - /// The name of the type, possibly with `n mangling - // MUTABILITY; used only when establishing tycons. - mutable entity_compiled_name: string option - /// The declaration location for the type constructor mutable entity_range: range - // MUTABILITY: the signature is adjusted when it is checked - /// If this field is populated, this is the implementation range for an item in a signature, otherwise it is - /// the signature range for an item in an implementation - mutable entity_other_range: (range * bool) option - - /// The declared accessibility of the representation, not taking signatures into account - mutable entity_tycon_repr_accessibility: Accessibility - /// The declared attributes for the type // MUTABILITY; used during creation and remapping of tycons // MUTABILITY; used when propagating signature attributes into the implementation. @@ -529,43 +553,22 @@ type Entity = // // MUTABILITY; used only during creation and remapping of tycons mutable entity_tycon_repr: TyconRepresentation - - /// If non-None, indicates the type is an abbreviation for another type. - // - // MUTABILITY; used only during creation and remapping of tycons - mutable entity_tycon_abbrev: TType option /// The methods and properties of the type // // MUTABILITY; used only during creation and remapping of tycons mutable entity_tycon_tcaug: TyconAugmentation - /// Field used when the 'tycon' is really an exception definition - // - // MUTABILITY; used only during creation and remapping of tycons - mutable entity_exn_info: ExceptionInfo - /// This field is used when the 'tycon' is really a module definition. It holds statically nested type definitions and nested modules // // MUTABILITY: only used during creation and remapping of tycons and // when compiling fslib to fixup compiler forward references to internal items mutable entity_modul_contents: MaybeLazy - /// The declared documentation for the type or module - // MUTABILITY: only for unpickle linkage - mutable entity_xmldoc : XmlDoc - - /// The XML document signature for this entity - mutable entity_xmldocsig : string - /// The stable path to the type, e.g. Microsoft.FSharp.Core.FSharpFunc`2 // REVIEW: it looks like entity_cpath subsumes this // MUTABILITY: only for unpickle linkage mutable entity_pubpath : PublicPath option - - /// Indicates how visible is the entity is. - // MUTABILITY: only for unpickle linkage - mutable entity_accessiblity: Accessibility /// The stable path to the type, e.g. Microsoft.FSharp.Core.FSharpFunc`2 // MUTABILITY: only for unpickle linkage @@ -574,12 +577,30 @@ type Entity = /// Used during codegen to hold the ILX representation indicating how to access the type // MUTABILITY: only for unpickle linkage and caching mutable entity_il_repr_cache : CompiledTypeRepr cache + + mutable entity_opt_data : EntityOptionalData option } + + static member EmptyEntityOptData = { entity_compiled_name = None; entity_other_range = None; entity_kind = TyparKind.Type; entity_xmldoc = XmlDoc.Empty; entity_xmldocsig = ""; entity_tycon_abbrev = None; entity_tycon_repr_accessibility = TAccess []; entity_accessiblity = TAccess []; entity_exn_info = TExnNone } + /// The name of the namespace, module or type, possibly with mangling, e.g. List`1, List or FailureException member x.LogicalName = x.entity_logical_name /// The compiled name of the namespace, module or type, e.g. FSharpList`1, ListModule or FailureException - member x.CompiledName = match x.entity_compiled_name with None -> x.LogicalName | Some s -> s + member x.CompiledName = + match x.entity_opt_data with + | Some { entity_compiled_name = Some s } -> s + | _ -> x.LogicalName + + member x.EntityCompiledName = + match x.entity_opt_data with + | Some optData -> optData.entity_compiled_name + | _ -> None + + member x.SetCompiledName(name) = + match x.entity_opt_data with + | Some optData -> optData.entity_compiled_name <- name + | _ -> x.entity_opt_data <- Some { Entity.EmptyEntityOptData with entity_compiled_name = name } /// The display name of the namespace, module or type, e.g. List instead of List`1, and no static parameters member x.DisplayName = x.GetDisplayName(false, false) @@ -638,16 +659,19 @@ type Entity = /// The range in the implementation, adjusted for an item in a signature member x.DefinitionRange = - match x.entity_other_range with - | Some (r, true) -> r + match x.entity_opt_data with + | Some { entity_other_range = Some (r, true) } -> r | _ -> x.Range member x.SigRange = - match x.entity_other_range with - | Some (r, false) -> r + match x.entity_opt_data with + | Some { entity_other_range = Some (r, false) } -> r | _ -> x.Range - member x.SetOtherRange m = x.entity_other_range <- Some m + member x.SetOtherRange m = + match x.entity_opt_data with + | Some optData -> optData.entity_other_range <- Some m + | _ -> x.entity_opt_data <- Some { Entity.EmptyEntityOptData with entity_other_range = Some m } /// A unique stamp for this module, namespace or type definition within the context of this compilation. /// Note that because of signatures, there are situations where in a single compilation the "same" @@ -668,13 +692,21 @@ type Entity = | TProvidedTypeExtensionPoint info -> XmlDoc (info.ProvidedType.PUntaintNoFailure(fun st -> (st :> IProvidedCustomAttributeProvider).GetXmlDocAttributes(info.ProvidedType.TypeProvider.PUntaintNoFailure(id)))) | _ -> #endif - x.entity_xmldoc + match x.entity_opt_data with + | Some optData -> optData.entity_xmldoc + | _ -> XmlDoc.Empty /// The XML documentation sig-string of the entity, if any, to use to lookup an .xml doc file. This also acts /// as a cache for this sig-string computation. member x.XmlDocSig - with get() = x.entity_xmldocsig - and set v = x.entity_xmldocsig <- v + with get() = + match x.entity_opt_data with + | Some optData -> optData.entity_xmldocsig + | _ -> "" + and set v = + match x.entity_opt_data with + | Some optData -> optData.entity_xmldocsig <- v + | _ -> x.entity_opt_data <- Some { Entity.EmptyEntityOptData with entity_xmldocsig = v } /// The logical contents of the entity when it is a module or namespace fragment. member x.ModuleOrNamespaceType = x.entity_modul_contents.Force() @@ -683,7 +715,15 @@ type Entity = member x.TypeContents = x.entity_tycon_tcaug /// The kind of the type definition - is it a measure definition or a type definition? - member x.TypeOrMeasureKind = x.entity_kind + member x.TypeOrMeasureKind = + match x.entity_opt_data with + | Some optData -> optData.entity_kind + | _ -> TyparKind.Type + + member x.SetTypeOrMeasureKind kind = + match x.entity_opt_data with + | Some optData -> optData.entity_kind <- kind + | _ -> x.entity_opt_data <- Some { Entity.EmptyEntityOptData with entity_kind = kind } /// The identifier at the point of declaration of the type definition. member x.Id = ident(x.LogicalName, x.Range) @@ -692,7 +732,15 @@ type Entity = member x.TypeReprInfo = x.entity_tycon_repr /// The information about the r.h.s. of an F# exception definition, if any. - member x.ExceptionInfo = x.entity_exn_info + member x.ExceptionInfo = + match x.entity_opt_data with + | Some optData -> optData.entity_exn_info + | _ -> TExnNone + + member x.SetExceptionInfo exn_info = + match x.entity_opt_data with + | Some optData -> optData.entity_exn_info <- exn_info + | _ -> x.entity_opt_data <- Some { Entity.EmptyEntityOptData with entity_exn_info = exn_info } /// Indicates if the entity represents an F# exception declaration. member x.IsExceptionDecl = match x.ExceptionInfo with TExnNone -> false | _ -> true @@ -710,13 +758,24 @@ type Entity = member x.TyparsNoRange = x.Typars x.Range /// Get the type abbreviated by this type definition, if it is an F# type abbreviation definition - member x.TypeAbbrev = x.entity_tycon_abbrev + member x.TypeAbbrev = + match x.entity_opt_data with + | Some optData -> optData.entity_tycon_abbrev + | _ -> None + + member x.SetTypeAbbrev tycon_abbrev = + match x.entity_opt_data with + | Some optData -> optData.entity_tycon_abbrev <- tycon_abbrev + | _ -> x.entity_opt_data <- Some { Entity.EmptyEntityOptData with entity_tycon_abbrev = tycon_abbrev } /// Indicates if this entity is an F# type abbreviation definition member x.IsTypeAbbrev = x.TypeAbbrev.IsSome /// Get the value representing the accessibility of the r.h.s. of an F# type definition. - member x.TypeReprAccessibility = x.entity_tycon_repr_accessibility + member x.TypeReprAccessibility = + match x.entity_opt_data with + | Some optData -> optData.entity_tycon_repr_accessibility + | _ -> TAccess [] /// Get the cache of the compiled ILTypeRef representation of this module or type. member x.CompiledReprCache = x.entity_il_repr_cache @@ -725,7 +784,10 @@ type Entity = member x.PublicPath = x.entity_pubpath /// Get the value representing the accessibility of an F# type definition or module. - member x.Accessibility = x.entity_accessiblity + member x.Accessibility = + match x.entity_opt_data with + | Some optData -> optData.entity_accessiblity + | _ -> TAccess [] /// Indicates the type prefers the "tycon" syntax for display etc. member x.IsPrefixDisplay = x.entity_flags.IsPrefixDisplay @@ -849,26 +911,18 @@ type Entity = /// Create a new entity with empty, unlinked data. Only used during unpickling of F# metadata. static member NewUnlinked() : Entity = { entity_typars = Unchecked.defaultof<_> - entity_kind = Unchecked.defaultof<_> entity_flags = Unchecked.defaultof<_> entity_stamp = Unchecked.defaultof<_> entity_logical_name = Unchecked.defaultof<_> - entity_compiled_name = Unchecked.defaultof<_> entity_range = Unchecked.defaultof<_> - entity_other_range = Unchecked.defaultof<_> - entity_tycon_repr_accessibility = Unchecked.defaultof<_> entity_attribs = Unchecked.defaultof<_> entity_tycon_repr= Unchecked.defaultof<_> - entity_tycon_abbrev= Unchecked.defaultof<_> entity_tycon_tcaug= Unchecked.defaultof<_> - entity_exn_info= Unchecked.defaultof<_> entity_modul_contents= Unchecked.defaultof<_> - entity_xmldoc = Unchecked.defaultof<_> - entity_xmldocsig = Unchecked.defaultof<_> entity_pubpath = Unchecked.defaultof<_> - entity_accessiblity= Unchecked.defaultof<_> entity_cpath = Unchecked.defaultof<_> - entity_il_repr_cache = Unchecked.defaultof<_> } + entity_il_repr_cache = Unchecked.defaultof<_> + entity_opt_data = Unchecked.defaultof<_>} /// Create a new entity with the given backing data. Only used during unpickling of F# metadata. static member New _reason (data: Entity) : Entity = data @@ -876,26 +930,21 @@ type Entity = /// Link an entity based on empty, unlinked data to the given data. Only used during unpickling of F# metadata. member x.Link (tg: EntityData) = x.entity_typars <- tg.entity_typars - x.entity_kind <- tg.entity_kind x.entity_flags <- tg.entity_flags x.entity_stamp <- tg.entity_stamp x.entity_logical_name <- tg.entity_logical_name - x.entity_compiled_name <- tg.entity_compiled_name x.entity_range <- tg.entity_range - x.entity_other_range <- tg.entity_other_range - x.entity_tycon_repr_accessibility <- tg.entity_tycon_repr_accessibility x.entity_attribs <- tg.entity_attribs x.entity_tycon_repr <- tg.entity_tycon_repr - x.entity_tycon_abbrev <- tg.entity_tycon_abbrev x.entity_tycon_tcaug <- tg.entity_tycon_tcaug - x.entity_exn_info <- tg.entity_exn_info x.entity_modul_contents <- tg.entity_modul_contents - x.entity_xmldoc <- tg.entity_xmldoc - x.entity_xmldocsig <- tg.entity_xmldocsig x.entity_pubpath <- tg.entity_pubpath - x.entity_accessiblity <- tg.entity_accessiblity x.entity_cpath <- tg.entity_cpath x.entity_il_repr_cache <- tg.entity_il_repr_cache + match tg.entity_opt_data with + | Some tg -> + x.entity_opt_data <- Some { entity_compiled_name = tg.entity_compiled_name; entity_other_range = tg.entity_other_range; entity_kind = tg.entity_kind; entity_xmldoc = tg.entity_xmldoc; entity_xmldocsig = tg.entity_xmldocsig; entity_tycon_abbrev = tg.entity_tycon_abbrev; entity_tycon_repr_accessibility = tg.entity_tycon_repr_accessibility; entity_accessiblity = tg.entity_accessiblity; entity_exn_info = tg.entity_exn_info } + | None -> () /// Indicates if the entity is linked to backing data. Only used during unpickling of F# metadata. @@ -1809,26 +1858,21 @@ and Construct = Tycon.New "tycon" { entity_stamp=stamp entity_logical_name=name - entity_compiled_name=None - entity_kind=kind entity_range=m - entity_other_range=None entity_flags=EntityFlags(usesPrefixDisplay=false, isModuleOrNamespace=false,preEstablishedHasDefaultCtor=false, hasSelfReferentialCtor=false, isStructRecordOrUnionType=false) entity_attribs=[] // fetched on demand via est.fs API entity_typars= LazyWithContext.NotLazy [] - entity_tycon_abbrev = None entity_tycon_repr = repr - entity_tycon_repr_accessibility = TAccess([]) - entity_exn_info=TExnNone entity_tycon_tcaug=TyconAugmentation.Create() entity_modul_contents = MaybeLazy.Lazy (lazy new ModuleOrNamespaceType(Namespace, QueueList.ofList [], QueueList.ofList [])) // Generated types get internal accessibility - entity_accessiblity= access - entity_xmldoc = XmlDoc [||] // fetched on demand via est.fs API - entity_xmldocsig="" entity_pubpath = Some pubpath entity_cpath = Some cpath - entity_il_repr_cache = newCache() } + entity_il_repr_cache = newCache() + entity_opt_data = + match kind, access with + | TyparKind.Type, TAccess [] -> None + | _ -> Some { Entity.EmptyEntityOptData with entity_kind = kind; entity_accessiblity = access } } #endif static member NewModuleOrNamespace cpath access (id:Ident) xml attribs mtype = @@ -1836,26 +1880,21 @@ and Construct = // Put the module suffix on if needed Tycon.New "mspec" { entity_logical_name=id.idText - entity_compiled_name=None entity_range = id.idRange - entity_other_range = None entity_stamp=stamp - entity_kind=TyparKind.Type entity_modul_contents = mtype entity_flags=EntityFlags(usesPrefixDisplay=false, isModuleOrNamespace=true, preEstablishedHasDefaultCtor=false, hasSelfReferentialCtor=false,isStructRecordOrUnionType=false) entity_typars=LazyWithContext.NotLazy [] - entity_tycon_abbrev = None entity_tycon_repr = TNoRepr - entity_tycon_repr_accessibility = access - entity_exn_info=TExnNone entity_tycon_tcaug=TyconAugmentation.Create() entity_pubpath=cpath |> Option.map (fun (cp:CompilationPath) -> cp.NestedPublicPath id) entity_cpath=cpath - entity_accessiblity=access entity_attribs=attribs - entity_xmldoc=xml - entity_xmldocsig="" - entity_il_repr_cache = newCache() } + entity_il_repr_cache = newCache() + entity_opt_data = + match xml, access with + | XmlDoc [||], TAccess [] -> None + | _ -> Some { Entity.EmptyEntityOptData with entity_xmldoc = xml; entity_tycon_repr_accessibility = access; entity_accessiblity = access } } and Accessibility = /// Indicates the construct can only be accessed from any code in the given type constructor, module or assembly. [] indicates global scope. @@ -2227,7 +2266,7 @@ and [] mutable val_opt_data : ValOptionalData option } - static member EmptyValOptData = { val_compiled_name = None; val_other_range = None; val_const = None; val_defn = None; val_repr_info = None; val_access = TAccess []; val_xmldoc = XmlDoc [||]; val_member_info = None; val_declaring_entity = ParentNone; val_xmldocsig = String.Empty; val_attribs = [] } + static member EmptyValOptData = { val_compiled_name = None; val_other_range = None; val_const = None; val_defn = None; val_repr_info = None; val_access = TAccess []; val_xmldoc = XmlDoc.Empty; val_member_info = None; val_declaring_entity = ParentNone; val_xmldocsig = String.Empty; val_attribs = [] } /// Range of the definition (implementation) of the value, used by Visual Studio member x.DefinitionRange = @@ -4938,25 +4977,20 @@ let NewExn cpath (id:Ident) access repr attribs doc = Tycon.New "exnc" { entity_stamp=newStamp() entity_attribs=attribs - entity_kind=TyparKind.Type entity_logical_name=id.idText - entity_compiled_name=None entity_range=id.idRange - entity_other_range=None - entity_exn_info= repr entity_tycon_tcaug=TyconAugmentation.Create() - entity_xmldoc=doc - entity_xmldocsig="" entity_pubpath=cpath |> Option.map (fun (cp:CompilationPath) -> cp.NestedPublicPath id) - entity_accessiblity=access - entity_tycon_repr_accessibility=access entity_modul_contents = MaybeLazy.Strict (NewEmptyModuleOrNamespaceType ModuleOrType) entity_cpath= cpath entity_typars=LazyWithContext.NotLazy [] - entity_tycon_abbrev = None entity_tycon_repr = TNoRepr entity_flags=EntityFlags(usesPrefixDisplay=false, isModuleOrNamespace=false, preEstablishedHasDefaultCtor=false, hasSelfReferentialCtor=false, isStructRecordOrUnionType=false) - entity_il_repr_cache= newCache() } + entity_il_repr_cache= newCache() + entity_opt_data = + match doc, access, repr with + | XmlDoc [||], TAccess [], TExnNone -> None + | _ -> Some { Entity.EmptyEntityOptData with entity_xmldoc = doc; entity_accessiblity = access; entity_tycon_repr_accessibility = access; entity_exn_info = repr } } /// Create a new TAST RecdField node for an F# class, struct or record field let NewRecdField stat konst id nameGenerated ty isMutable isVolatile pattribs fattribs docOption access secret = @@ -4981,25 +5015,20 @@ let NewTycon (cpath, nm, m, access, reprAccess, kind, typars, docOption, usesPre Tycon.New "tycon" { entity_stamp=stamp entity_logical_name=nm - entity_compiled_name=None - entity_kind=kind entity_range=m - entity_other_range=None entity_flags=EntityFlags(usesPrefixDisplay=usesPrefixDisplay, isModuleOrNamespace=false,preEstablishedHasDefaultCtor=preEstablishedHasDefaultCtor, hasSelfReferentialCtor=hasSelfReferentialCtor, isStructRecordOrUnionType=false) entity_attribs=[] // fixed up after entity_typars=typars - entity_tycon_abbrev = None entity_tycon_repr = TNoRepr - entity_tycon_repr_accessibility = reprAccess - entity_exn_info=TExnNone entity_tycon_tcaug=TyconAugmentation.Create() entity_modul_contents = mtyp - entity_accessiblity=access - entity_xmldoc = docOption - entity_xmldocsig="" entity_pubpath=cpath |> Option.map (fun (cp:CompilationPath) -> cp.NestedPublicPath (mkSynId m nm)) entity_cpath = cpath - entity_il_repr_cache = newCache() } + entity_il_repr_cache = newCache() + entity_opt_data = + match kind, docOption, reprAccess, access with + | TyparKind.Type, XmlDoc [||], TAccess [], TAccess [] -> None + | _ -> Some { Entity.EmptyEntityOptData with entity_kind = kind; entity_xmldoc = docOption; entity_tycon_repr_accessibility = reprAccess; entity_accessiblity=access } } let NewILTycon nlpath (nm,m) tps (scoref:ILScopeRef, enc, tdef:ILTypeDef) mtyp = @@ -5115,10 +5144,14 @@ let CombineCcuContentFragments m l = match entity1.IsModuleOrNamespace, entity2.IsModuleOrNamespace with | true,true -> entity1 |> NewModifiedTycon (fun data1 -> + let xml = XmlDoc.Merge entity1.XmlDoc entity2.XmlDoc { data1 with - entity_xmldoc = XmlDoc.Merge entity1.XmlDoc entity2.XmlDoc entity_attribs = entity1.Attribs @ entity2.Attribs - entity_modul_contents = MaybeLazy.Lazy (lazy (CombineModuleOrNamespaceTypes (path@[entity2.DemangledModuleOrNamespaceName]) entity2.Range entity1.ModuleOrNamespaceType entity2.ModuleOrNamespaceType)) }) + entity_modul_contents = MaybeLazy.Lazy (lazy (CombineModuleOrNamespaceTypes (path@[entity2.DemangledModuleOrNamespaceName]) entity2.Range entity1.ModuleOrNamespaceType entity2.ModuleOrNamespaceType)) + entity_opt_data = + match data1.entity_opt_data with + | Some optData -> Some { optData with entity_xmldoc = xml } + | _ -> Some { Entity.EmptyEntityOptData with entity_xmldoc = xml } }) | false,false -> error(Error(FSComp.SR.tastDuplicateTypeDefinitionInAssembly(entity2.LogicalName, textOfPath path),entity2.Range)) | _,_ -> From ff61ee5e69d9efa9bb278b75c5e319c6989f864c Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Wed, 14 Mar 2018 16:17:02 -0700 Subject: [PATCH 113/147] product Windows-style PDBs from SDK projects (#4521) --- FSharp.Directory.Build.props | 1 + 1 file changed, 1 insertion(+) diff --git a/FSharp.Directory.Build.props b/FSharp.Directory.Build.props index d23519791e..92682e7e50 100644 --- a/FSharp.Directory.Build.props +++ b/FSharp.Directory.Build.props @@ -46,6 +46,7 @@ + full fs false true From 221224e6d20bd835c2b9e01e0a52bf45e740a8d0 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Wed, 14 Mar 2018 17:13:39 -0700 Subject: [PATCH 114/147] always emit the local scope's start offset --- src/absil/ilwritepdb.fs | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/src/absil/ilwritepdb.fs b/src/absil/ilwritepdb.fs index f8baa3aea4..760ac9e428 100644 --- a/src/absil/ilwritepdb.fs +++ b/src/absil/ilwritepdb.fs @@ -423,22 +423,15 @@ let generatePortablePdb (embedAllSource:bool) (embedSourceList:string list) (sou list.ToArray() |> Array.sortWith scopeSorter collectScopes scope |> Seq.iter(fun s -> - if s.Children.Length = 0 then - metadata.AddLocalScope(MetadataTokens.MethodDefinitionHandle(minfo.MethToken), - Unchecked.defaultof, - nextHandle lastLocalVariableHandle, - Unchecked.defaultof, - 0, s.EndOffset - s.StartOffset ) |>ignore - else - metadata.AddLocalScope(MetadataTokens.MethodDefinitionHandle(minfo.MethToken), - Unchecked.defaultof, - nextHandle lastLocalVariableHandle, - Unchecked.defaultof, - s.StartOffset, s.EndOffset - s.StartOffset) |>ignore - - for localVariable in s.Locals do - lastLocalVariableHandle <- metadata.AddLocalVariable(LocalVariableAttributes.None, localVariable.Index, metadata.GetOrAddString(localVariable.Name)) - ) + metadata.AddLocalScope(MetadataTokens.MethodDefinitionHandle(minfo.MethToken), + Unchecked.defaultof, + nextHandle lastLocalVariableHandle, + Unchecked.defaultof, + s.StartOffset, s.EndOffset - s.StartOffset ) |>ignore + + for localVariable in s.Locals do + lastLocalVariableHandle <- metadata.AddLocalVariable(LocalVariableAttributes.None, localVariable.Index, metadata.GetOrAddString(localVariable.Name)) + ) match minfo.RootScope with | None -> () From db7758f78c218d8a21c84851619dca350531a045 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Wed, 14 Mar 2018 15:10:52 -0700 Subject: [PATCH 115/147] build portable PDBs from SDK projects and convert to Windows PDBs after build --- FSharp.Directory.Build.props | 2 +- FSharp.Directory.Build.targets | 1 + NuGet.Config | 1 + build/targets/ConvertPortablePdbs.targets | 20 ++++++++++++++++++++ build/targets/PackageVersions.props | 1 + 5 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 build/targets/ConvertPortablePdbs.targets diff --git a/FSharp.Directory.Build.props b/FSharp.Directory.Build.props index 92682e7e50..ea31420601 100644 --- a/FSharp.Directory.Build.props +++ b/FSharp.Directory.Build.props @@ -46,7 +46,7 @@ - full + portable fs false true diff --git a/FSharp.Directory.Build.targets b/FSharp.Directory.Build.targets index 455bba2655..923863bb20 100644 --- a/FSharp.Directory.Build.targets +++ b/FSharp.Directory.Build.targets @@ -34,6 +34,7 @@ + diff --git a/NuGet.Config b/NuGet.Config index b362163ba9..d7b373fc4c 100644 --- a/NuGet.Config +++ b/NuGet.Config @@ -17,6 +17,7 @@ + diff --git a/build/targets/ConvertPortablePdbs.targets b/build/targets/ConvertPortablePdbs.targets new file mode 100644 index 0000000000..0965566db0 --- /dev/null +++ b/build/targets/ConvertPortablePdbs.targets @@ -0,0 +1,20 @@ + + + + + + + + + $(FinalOutputPath)\ConvertedPdbs + $(NuGetPackageRoot)Microsoft.DiaSymReader.Pdb2Pdb\$(MicrosoftDiaSymReaderPdb2PdbPackageVersion)\tools\Pdb2Pdb.exe + "$(TargetPath)" /out "$(ConvertedPdbsDirectory)\$(TargetName).pdb" /verbose /srcsvrvar SRC_INDEX=public + + + + + + + diff --git a/build/targets/PackageVersions.props b/build/targets/PackageVersions.props index 889b7a8000..b984806983 100644 --- a/build/targets/PackageVersions.props +++ b/build/targets/PackageVersions.props @@ -48,6 +48,7 @@ 1.0.30 + 1.1.0-roslyn-62714-01 8.0.0-alpha 1.0.1 9.0.1 From 77a9e0a50cb0bbd130d7be7ad80477300ea342ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbyn=C4=9Bk=20Sailer?= Date: Thu, 15 Mar 2018 18:55:22 +0100 Subject: [PATCH 116/147] LOC CHECKIN | visualfsharp master | 20180315 (#4535) --- vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf | 2 +- vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf | 2 +- vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf | 2 +- vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf | 2 +- vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf | 2 +- vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf | 2 +- vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf | 2 +- vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf | 2 +- .../src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf | 2 +- vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf | 2 +- vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf | 2 +- .../src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf | 2 +- .../src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf | 2 +- vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf | 8 ++++---- vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf | 8 ++++---- vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf | 8 ++++---- vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf | 8 ++++---- vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf | 8 ++++---- vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf | 8 ++++---- vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf | 8 ++++---- vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf | 8 ++++---- .../src/FSharp.UIResources/xlf/Strings.pt-BR.xlf | 8 ++++---- vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf | 8 ++++---- vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf | 8 ++++---- .../src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf | 8 ++++---- .../src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf | 8 ++++---- 26 files changed, 65 insertions(+), 65 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf index 4dbb91dd9b..00a7f05797 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.cs.xlf @@ -149,7 +149,7 @@ Advanced - Advanced + Upřesnit diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf index 3ca7780738..da1e2d3398 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.de.xlf @@ -149,7 +149,7 @@ Advanced - Advanced + Erweitert diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf index 8525635235..e9661c0489 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.es.xlf @@ -149,7 +149,7 @@ Advanced - Advanced + Avanzadas diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf index 41681f342e..2e41f543d2 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.fr.xlf @@ -149,7 +149,7 @@ Advanced - Advanced + Avancé diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf index 29050fd69f..1becd43e91 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.it.xlf @@ -149,7 +149,7 @@ Advanced - Advanced + Avanzate diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf index 6c25156c90..1ea4b48b1f 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ja.xlf @@ -149,7 +149,7 @@ Advanced - Advanced + 詳細 diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf index bbcd41dd9c..5c3177f7d9 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ko.xlf @@ -149,7 +149,7 @@ Advanced - Advanced + 고급 diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf index b9ce76f219..50c16a27f0 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pl.xlf @@ -149,7 +149,7 @@ Advanced - Advanced + Zaawansowane diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf index 8647936b11..e4362c8c3f 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.pt-BR.xlf @@ -149,7 +149,7 @@ Advanced - Advanced + Avançado diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf index b448661df8..a31ffb183b 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.ru.xlf @@ -149,7 +149,7 @@ Advanced - Advanced + Дополнительно diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf index dedf479929..dee92da98a 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.tr.xlf @@ -149,7 +149,7 @@ Advanced - Advanced + Gelişmiş diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf index a46a6866a4..3936d51f0d 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hans.xlf @@ -149,7 +149,7 @@ Advanced - Advanced + 高级 diff --git a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf index e220491faa..4a8801714b 100644 --- a/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf +++ b/vsintegration/src/FSharp.Editor/xlf/FSharp.Editor.zh-Hant.xlf @@ -149,7 +149,7 @@ Advanced - Advanced + 進階 diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf index 0ff8ba88f5..a396705910 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf @@ -89,22 +89,22 @@ Block Structure Guides - Block Structure Guides + Vodítka pro strukturu bloku Show structure guidelines for F# code - Show structure guidelines for F# code + Zobrazí pokyny pro strukturu kódu F#. Outlining - Outlining + Sbalení Show outlining and collapsable nodes for F# code - Show outlining and collapsable nodes for F# code + Zobrazí osnovu a sbalitelné uzly kódu F#. diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf index a1a39ef28f..218468a4f8 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf @@ -89,22 +89,22 @@ Block Structure Guides - Block Structure Guides + Führungslinien für Blockstruktur Show structure guidelines for F# code - Show structure guidelines for F# code + Strukturführungslinien für F#-Code anzeigen Outlining - Outlining + Gliederung Show outlining and collapsable nodes for F# code - Show outlining and collapsable nodes for F# code + Gliederung und ausblendbare Knoten für F#-Code anzeigen diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf index 2d1c825ffa..88318f4804 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf @@ -89,22 +89,22 @@ Block Structure Guides - Block Structure Guides + Guías de estructura de bloque Show structure guidelines for F# code - Show structure guidelines for F# code + Mostrar las guías de la estructura del código F# Outlining - Outlining + Esquematización Show outlining and collapsable nodes for F# code - Show outlining and collapsable nodes for F# code + Mostrar los nodos de esquematización y contraíbles del código F# diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf index ab96737ba5..2df7e8e711 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf @@ -89,22 +89,22 @@ Block Structure Guides - Block Structure Guides + Repères de structure de bloc Show structure guidelines for F# code - Show structure guidelines for F# code + Afficher les directives de structure pour le code F# Outlining - Outlining + Mode plan Show outlining and collapsable nodes for F# code - Show outlining and collapsable nodes for F# code + Afficher le mode plan et les nœuds réductibles pour le code F# diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf index 76a71c8f91..aea7e8a335 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf @@ -89,22 +89,22 @@ Block Structure Guides - Block Structure Guides + Guide per strutture a blocchi Show structure guidelines for F# code - Show structure guidelines for F# code + Mostra le linee guida della struttura per il codice F# Outlining - Outlining + Struttura Show outlining and collapsable nodes for F# code - Show outlining and collapsable nodes for F# code + Mostra i nodi struttura e comprimibili per il codice F# diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf index df5c9da7b3..fe3dad874a 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf @@ -89,22 +89,22 @@ Block Structure Guides - Block Structure Guides + ブロック構造のガイド Show structure guidelines for F# code - Show structure guidelines for F# code + F# コードの構造のガイドラインを表示する Outlining - Outlining + アウトライン Show outlining and collapsable nodes for F# code - Show outlining and collapsable nodes for F# code + F# コードのアウトラインおよび折りたたみ可能なノードを表示する diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf index 2dd3b97e0e..310eeffa71 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf @@ -89,22 +89,22 @@ Block Structure Guides - Block Structure Guides + 블록 구조 가이드 Show structure guidelines for F# code - Show structure guidelines for F# code + F# 코드에 대한 구조체 지침 표시 Outlining - Outlining + 개요 Show outlining and collapsable nodes for F# code - Show outlining and collapsable nodes for F# code + F# 코드에 대한 개요 및 축소 가능한 노드 표시 diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf index 44ceba824a..1ff43eb0bd 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf @@ -89,22 +89,22 @@ Block Structure Guides - Block Structure Guides + Prowadnice struktury blokowej Show structure guidelines for F# code - Show structure guidelines for F# code + Pokaż wskazówki dotyczące struktury dla kodu języka F# Outlining - Outlining + Konspekt Show outlining and collapsable nodes for F# code - Show outlining and collapsable nodes for F# code + Pokaż konspekt i węzły z możliwością zwijania dla kodu języka F# diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf index 0b33aa390e..44da05912b 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf @@ -89,22 +89,22 @@ Block Structure Guides - Block Structure Guides + Guias de Estrutura de Bloco Show structure guidelines for F# code - Show structure guidelines for F# code + Mostrar as diretrizes de estrutura para o código F# Outlining - Outlining + Estrutura de Tópicos Show outlining and collapsable nodes for F# code - Show outlining and collapsable nodes for F# code + Mostrar os nós de estrutura de tópicos e recolhíveis para o código F# diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf index 3b63e1caa6..c5141e2e97 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf @@ -89,22 +89,22 @@ Block Structure Guides - Block Structure Guides + Направляющие для структуры блоков Show structure guidelines for F# code - Show structure guidelines for F# code + Показать рекомендации по структуре для кода F# Outlining - Outlining + Структура Show outlining and collapsable nodes for F# code - Show outlining and collapsable nodes for F# code + Показать структурирование и сворачиваемые узлы для кода F# diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf index 5eb169a55b..5198b19f72 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf @@ -89,22 +89,22 @@ Block Structure Guides - Block Structure Guides + Blok Yapısı Kılavuzları Show structure guidelines for F# code - Show structure guidelines for F# code + F# kodu için yapı yönergelerini göster Outlining - Outlining + Ana Hat Show outlining and collapsable nodes for F# code - Show outlining and collapsable nodes for F# code + F# kodu için ana hattı ve daraltılabilir düğümleri göster diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf index 1a47f8d75c..2d251aa037 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf @@ -89,22 +89,22 @@ Block Structure Guides - Block Structure Guides + 块结构指南 Show structure guidelines for F# code - Show structure guidelines for F# code + 显示 F# 代码的结构指南 Outlining - Outlining + 大纲 Show outlining and collapsable nodes for F# code - Show outlining and collapsable nodes for F# code + 显示 F# 代码的大纲和可折叠节点 diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf index 7fcb1a2d20..be901b794c 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf @@ -89,22 +89,22 @@ Block Structure Guides - Block Structure Guides + 區塊結構輔助線 Show structure guidelines for F# code - Show structure guidelines for F# code + 顯示 F# 程式碼的結構方針 Outlining - Outlining + 大綱 Show outlining and collapsable nodes for F# code - Show outlining and collapsable nodes for F# code + 顯示 F# 程式碼的大綱與可折疊的節點 From 351a4813507a23dc8c89f1b95a8573dd9b8cf8be Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Thu, 15 Mar 2018 11:09:49 -0700 Subject: [PATCH 117/147] Only set oulining if there is an outlining manager (#4520) --- .../src/FSharp.Editor/LanguageService/LanguageService.fs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index 20bac47a9d..5b6ccb784e 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -580,7 +580,8 @@ type let outliningManagerService = this.Package.ComponentModel.GetService() let wpfTextView = this.EditorAdaptersFactoryService.GetWpfTextView(textView) let outliningManager = outliningManagerService.GetOutliningManager(wpfTextView) - outliningManager.Enabled <- Settings.Advanced.IsOutliningEnabled + if not (isNull outliningManager) then + outliningManager.Enabled <- Settings.Advanced.IsOutliningEnabled match textView.GetBuffer() with | (VSConstants.S_OK, textLines) -> From 8f8cbd64a4cd778164afc0de7552b0ad93757ce0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Victor=20Peter=20Rouven=20M=C3=BCller?= Date: Thu, 15 Mar 2018 20:35:38 +0100 Subject: [PATCH 118/147] Code Lens and Line Lens (#3608) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Found a workaround for the heavy code lens bug. Merged master into the branch. Signed-off-by: realvictorprm * Fixes a deadlock due to context changes + started removing mutex. This is from yesterday! Review is NOT applied yet! Signed-off-by: realvictorprm * Small fixes, applied a part of the reviews The UI is still buggy. This is very annoying. @saul I should report the bug you read about in my comments. . . Signed-off-by: realvictorprm * Fixed CodeLens layout updates. Added possibility to enforce a re-layout of the visible code lens for the next layout-changed call. Applied suggestions from the reviews (could be that I missed one or two). Small cleanup. Small documentation additions. More checks. Removed some debug code. Added some debug code, most only appears if exceptions are thrown. The caching is still a small bit broken. At least I found out it's only a bit broken. Signed-off-by: realvictorprm * Fixing removal of Code Lens. Reuse of elements still needs to be finished. I started it months ago but didn't finish it. Signed-off-by: realvictorprm * Fixing fatal UI logic. Finally activated code for using cache results (so fixed a bug which included that code lens could be lost for us). Small cleanup to reduce confusion and decreased chance of introducing bugs due to this. Changing TaggerProvider to a more appropriate one. Discovered bugs in the visitor logic. * Added Line-Lens Added Options page to disable Code-Lens and to switch between Code-Lens and Line-Lens More caching fixes. Minimal UI fixes Signed-off-by: realvictorprm * Fixed caching completely. Also fixed with this UI issues. Big cleanup. Now it's ready for another round of reviews! Signed-off-by: realvictorprm * Added prefix option Signed-off-by: realvictorprm * Fixing bug reported by Vasily Fixing cache bug. Fixing ui-offset bug. Fixing multi-view bug. Fixing build. Fixing signature bug reported by @saul Signed-off-by: realvictorprm * Fixing KeyNotFoundException. Signed-off-by: realvictorprm * Another UI fix. Code Lens are now hidden as soon as their line isn't visible anymore due to inserting new lines. Signed-off-by: realvictorprm * Applied some review comments. Heavy performance improvements, now layouting isn't done every time due to that Visual Studio just transforms everything together (it's not viewport relative anymore, it's owner controlled but still in the wpf-text-view-coordinate-system)! The UI should now be fine in my opinion. It wasn't able for me to find a better workaround as just subtracting one pixel from the top position of the adornments. Signed-off-by: realvictorprm * Another round of small cleanup. Signed-off-by: realvictorprm * Another UI layout fix. Now weird code lens anymore :P Signed-off-by: realvictorprm * Fixing merge * start working on color option * use darker gray à la normal CodeLens * Bind only from XAML. Fixes issue where "prefix" option was not saved * Undo unintended whitespace change * Should be part of previous commit * start working on color option * use darker gray à la normal CodeLens * Undo unintended whitespace change * Should be part of previous commit * fix value names * Applied review + small workaround for a bug. Merry Christmas! Signed-off-by: realvictorprm * Removed old files * trying to fix CI Signed-off-by: realvictorprm * First fix for member and constructor signatures! Signed-off-by: realvictorprm --- src/fsharp/NicePrint.fs | 1 + src/fsharp/service/service.fs | 11 + src/fsharp/service/service.fsi | 3 + src/fsharp/symbols/Symbols.fs | 23 +- src/fsharp/symbols/Symbols.fsi | 6 + .../AbstractCodeLensDisplayService.fs | 273 +++++++++++++ .../CodeLens/CodeLensGeneralTagger.fs | 153 +++++++ .../CodeLens/CodeLensProvider.fs | 109 +++++ .../CodeLens/FSharpCodeLensService.fs | 385 ++++++++++++++++++ .../CodeLens/LineLensDisplayService.fs | 67 +++ .../src/FSharp.Editor/Common/Constants.fs | 4 + .../src/FSharp.Editor/Common/RoslynHelpers.fs | 11 + .../src/FSharp.Editor/FSharp.Editor.fsproj | 5 + .../LanguageService/LanguageService.fs | 1 + .../FSharp.Editor/Options/EditorOptions.fs | 22 +- .../src/FSharp.Editor/Options/UIHelpers.fs | 2 +- .../CodeLensOptionControl.xaml | 45 ++ .../CodeLensOptionControl.xaml.cs | 28 ++ .../FSharp.UIResources.csproj | 2 +- .../FSharp.UIResources/Strings.Designer.cs | 45 ++ .../src/FSharp.UIResources/Strings.resx | 16 +- .../src/FSharp.UIResources/xlf/Strings.cs.xlf | 25 ++ .../src/FSharp.UIResources/xlf/Strings.de.xlf | 25 ++ .../src/FSharp.UIResources/xlf/Strings.en.xlf | 25 ++ .../src/FSharp.UIResources/xlf/Strings.es.xlf | 25 ++ .../src/FSharp.UIResources/xlf/Strings.fr.xlf | 25 ++ .../src/FSharp.UIResources/xlf/Strings.it.xlf | 25 ++ .../src/FSharp.UIResources/xlf/Strings.ja.xlf | 25 ++ .../src/FSharp.UIResources/xlf/Strings.ko.xlf | 25 ++ .../src/FSharp.UIResources/xlf/Strings.pl.xlf | 25 ++ .../FSharp.UIResources/xlf/Strings.pt-BR.xlf | 25 ++ .../src/FSharp.UIResources/xlf/Strings.ru.xlf | 25 ++ .../src/FSharp.UIResources/xlf/Strings.tr.xlf | 25 ++ .../xlf/Strings.zh-Hans.xlf | 25 ++ .../xlf/Strings.zh-Hant.xlf | 25 ++ 35 files changed, 1556 insertions(+), 6 deletions(-) create mode 100644 vsintegration/src/FSharp.Editor/CodeLens/AbstractCodeLensDisplayService.fs create mode 100644 vsintegration/src/FSharp.Editor/CodeLens/CodeLensGeneralTagger.fs create mode 100644 vsintegration/src/FSharp.Editor/CodeLens/CodeLensProvider.fs create mode 100644 vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs create mode 100644 vsintegration/src/FSharp.Editor/CodeLens/LineLensDisplayService.fs create mode 100644 vsintegration/src/FSharp.UIResources/CodeLensOptionControl.xaml create mode 100644 vsintegration/src/FSharp.UIResources/CodeLensOptionControl.xaml.cs diff --git a/src/fsharp/NicePrint.fs b/src/fsharp/NicePrint.fs index d311665060..195c373f73 100755 --- a/src/fsharp/NicePrint.fs +++ b/src/fsharp/NicePrint.fs @@ -1970,6 +1970,7 @@ let isGeneratedExceptionField pos f = TastDefinitionPrinting.isGeneratedExce let stringOfTyparConstraint denv tpc = stringOfTyparConstraints denv [tpc] let stringOfTy denv x = x |> PrintTypes.layoutType denv |> showL let prettyLayoutOfType denv x = x |> PrintTypes.prettyLayoutOfType denv +let prettyLayoutOfTypeNoCx denv x = x |> PrintTypes.prettyLayoutOfTypeNoConstraints denv let prettyStringOfTy denv x = x |> PrintTypes.prettyLayoutOfType denv |> showL let prettyStringOfTyNoCx denv x = x |> PrintTypes.prettyLayoutOfTypeNoConstraints denv |> showL let stringOfRecdField denv x = x |> TastDefinitionPrinting.layoutRecdField false denv |> showL diff --git a/src/fsharp/service/service.fs b/src/fsharp/service/service.fs index 38e95e816d..3ed5f832a0 100644 --- a/src/fsharp/service/service.fs +++ b/src/fsharp/service/service.fs @@ -908,6 +908,9 @@ type TypeCheckInfo match item with | Item.Types _ | Item.ModuleOrNamespaces _ -> true | _ -> false + + /// Find the most precise display context for the given line and column. + member __.GetBestDisplayEnvForPos cursorPos = GetBestEnvForPos cursorPos member __.GetVisibleNamespacesAndModulesAtPosition(cursorPos: pos) : ModuleOrNamespaceRef list = let (nenv, ad), m = GetBestEnvForPos cursorPos @@ -1982,6 +1985,7 @@ type FSharpCheckFileResults(filename: string, errors: FSharpErrorInfo[], scopeOp | _ -> async.Return dflt + member info.GetToolTipText(line, colAtEndOfNames, lineStr, names, tokenTag, userOpName) = info.GetStructuredToolTipText(line, colAtEndOfNames, lineStr, names, tokenTag, ?userOpName=userOpName) |> Tooltips.Map Tooltips.ToFSharpToolTipText @@ -2093,6 +2097,13 @@ type FSharpCheckFileResults(filename: string, errors: FSharpErrorInfo[], scopeOp RequireCompilationThread ctok scope.IsRelativeNameResolvableFromSymbol(pos, plid, symbol)) + member info.GetDisplayEnvForPos(pos: pos) : Async = + let userOpName = "CodeLens" + reactorOp userOpName "GetDisplayContextAtPos" None (fun ctok scope -> + DoesNotRequireCompilerThreadTokenAndCouldPossiblyBeMadeConcurrent ctok + let (nenv, _), _ = scope.GetBestDisplayEnvForPos pos + Some nenv.DisplayEnv) + member info.ImplementationFiles = if not keepAssemblyContents then invalidOp "The 'keepAssemblyContents' flag must be set to true on the FSharpChecker in order to access the checked contents of assemblies" scopeOptX diff --git a/src/fsharp/service/service.fsi b/src/fsharp/service/service.fsi index 82a1a563ea..df75679414 100755 --- a/src/fsharp/service/service.fsi +++ b/src/fsharp/service/service.fsi @@ -242,6 +242,9 @@ type public FSharpCheckFileResults = member internal GetVisibleNamespacesAndModulesAtPoint : pos -> Async + /// Find the most precise display environment for the given line and column. + member internal GetDisplayEnvForPos : pos : pos -> Async + /// Determines if a long ident is resolvable at a specific point. /// An optional string used for tracing compiler operations associated with this request. member internal IsRelativeNameResolvable: cursorPos : pos * plid : string list * item: Item * ?userOpName: string -> Async diff --git a/src/fsharp/symbols/Symbols.fs b/src/fsharp/symbols/Symbols.fs index 74aa51c9e2..944c4d8b69 100644 --- a/src/fsharp/symbols/Symbols.fs +++ b/src/fsharp/symbols/Symbols.fs @@ -1844,6 +1844,23 @@ and FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) = prefix + x.LogicalName with _ -> "??" + member x.FormatLayout (denv:FSharpDisplayContext) = + match x.IsMember, d with + | true, V v -> + NicePrint.prettyLayoutOfValOrMemberNoInst { (denv.Contents cenv.g) with showMemberContainers=true } v.Deref + | _,_ -> + checkIsResolved() + let ty = + match d with + | E e -> e.GetDelegateType(cenv.amap, range0) + | P p -> p.GetPropertyType(cenv.amap, range0) + | M m | C m -> + let rty = m.GetFSharpReturnTy(cenv.amap, range0, m.FormalMethodInst) + let argtysl = m.GetParamTypes(cenv.amap, range0, m.FormalMethodInst) + mkIteratedFunTy (List.map (mkRefTupledTy cenv.g) argtysl) rty + | V v -> v.TauType + NicePrint.prettyLayoutOfTypeNoCx (denv.Contents cenv.g) ty + and FSharpType(cenv, typ:TType) = @@ -1989,7 +2006,11 @@ and FSharpType(cenv, typ:TType) = member x.Format(denv: FSharpDisplayContext) = protect <| fun () -> - NicePrint.prettyStringOfTyNoCx (denv.Contents cenv.g) typ + NicePrint.prettyStringOfTyNoCx (denv.Contents cenv.g) typ + + member x.FormatLayout(denv: FSharpDisplayContext) = + protect <| fun () -> + NicePrint.prettyLayoutOfTypeNoCx (denv.Contents cenv.g) typ override x.ToString() = protect <| fun () -> diff --git a/src/fsharp/symbols/Symbols.fsi b/src/fsharp/symbols/Symbols.fsi index 55c1a6fbb2..34b3e15610 100644 --- a/src/fsharp/symbols/Symbols.fsi +++ b/src/fsharp/symbols/Symbols.fsi @@ -819,6 +819,9 @@ and [] public FSharpMemberOrFunctionOrValue = /// Indicates if this is a constructor. member IsConstructor : bool + + /// Format the type using the rules of the given display context + member FormatLayout : context: FSharpDisplayContext -> Layout /// A subtype of FSharpSymbol that represents a parameter @@ -931,6 +934,9 @@ and [] public FSharpType = /// Format the type using the rules of the given display context member Format : context: FSharpDisplayContext -> string + /// Format the type using the rules of the given display context + member FormatLayout : context: FSharpDisplayContext -> Layout + /// Instantiate generic type parameters in a type member Instantiate : (FSharpGenericParameter * FSharpType) list -> FSharpType diff --git a/vsintegration/src/FSharp.Editor/CodeLens/AbstractCodeLensDisplayService.fs b/vsintegration/src/FSharp.Editor/CodeLens/AbstractCodeLensDisplayService.fs new file mode 100644 index 0000000000..df364bb876 --- /dev/null +++ b/vsintegration/src/FSharp.Editor/CodeLens/AbstractCodeLensDisplayService.fs @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace rec Microsoft.VisualStudio.FSharp.Editor + +open System +open System.Windows.Controls +open Microsoft.VisualStudio.Text +open Microsoft.VisualStudio.Text.Editor +open Microsoft.VisualStudio.Text.Formatting +open System.Threading +open System.Windows +open System.Collections.Generic + +open Microsoft.VisualStudio.FSharp.Editor.Logging + +[] +type CodeLensDisplayService (view : IWpfTextView, buffer : ITextBuffer, layerName) as self = + + // Add buffer changed event handler + do ( + buffer.Changed.Add self.handleBufferChanged + view.LayoutChanged.Add self.handleLayoutChanged + ) + + /// + /// Enqueing an unit signals to the tagger that all visible line lens must be layouted again, + /// to respect single line changes. + /// + member val RelayoutRequested : Queue<_> = Queue() with get + + member val WpfView = view + + member val TextBuffer = buffer + + /// Saves the ui context to switch context for ui related work. + member val uiContext = SynchronizationContext.Current + + // Tracks the created ui elements per TrackingSpan + member val uiElements = Dictionary<_,Grid>() + + member val trackingSpanUiParent = HashSet() + + member val uiElementNeighbour = Dictionary() + + /// Caches the current used trackingSpans per line. One line can contain multiple trackingSpans + member val trackingSpans = Dictionary>() + /// Text view for accessing the adornment layer. + member val view: IWpfTextView = view + /// The code lens layer for adding and removing adornments. + member val codeLensLayer = view.GetAdornmentLayer layerName + /// Tracks the recent first + last visible line numbers for adornment layout logic. + member val recentFirstVsblLineNmbr = 0 with get, set + + member val recentLastVsblLineNmbr = 0 with get, set + /// Tracks the adornments on the layer. + member val addedAdornments = HashSet() + /// Cancellation token source for the layout changed event. Needed to abort previous async-work. + member val layoutChangedCts = new CancellationTokenSource() with get, set + + /// Tracks the last used buffer snapshot, should be preferred used in combination with mutex. + member val currentBufferSnapshot = null with get, set + + /// Helper method which returns the start line number of a tracking span + member __.getTrackingSpanStartLine (snapshot:ITextSnapshot) (trackingSpan:ITrackingSpan) = + snapshot.GetLineNumberFromPosition(trackingSpan.GetStartPoint(snapshot).Position) + + /// Helper method which returns the start line number of a tracking span + member __.tryGetTSpanStartLine (snapshot:ITextSnapshot) (trackingSpan:ITrackingSpan) = + let pos = trackingSpan.GetStartPoint(snapshot).Position + if snapshot.Length - 1 < pos then None + else pos |> snapshot.GetLineNumberFromPosition |> Some + + member self.updateTrackingSpansFast (snapshot:ITextSnapshot) lineNumber = + if lineNumber |> self.trackingSpans.ContainsKey then + let currentTrackingSpans = self.trackingSpans.[lineNumber] |> ResizeArray // We need a copy because we modify the list. + for trackingSpan in currentTrackingSpans do + let newLineOption = self.tryGetTSpanStartLine snapshot trackingSpan + match newLineOption with + | None -> () + | Some newLine -> + if newLine <> lineNumber then + // We're on a new line and need to check whether we're currently in another grid + // (because somehow there were multiple trackingSpans per line). + if self.trackingSpanUiParent.Contains trackingSpan then + self.trackingSpanUiParent.Remove trackingSpan |> ignore + self.uiElementNeighbour.Remove self.uiElements.[trackingSpan] |> ignore + // remove our entry in the line cache dictionary + self.trackingSpans.[lineNumber].Remove(trackingSpan) |> ignore + // if the cache entry for the old line is now empty remove it completely + if self.trackingSpans.[lineNumber].Count = 0 then + self.trackingSpans.Remove lineNumber |> ignore + // now re-register our tracking span in the cache dict. + // Check whether the new line has no existing entry to add a fresh one. + // If there is already one we put our grid into the grid of the first entry of the line. + if newLine |> self.trackingSpans.ContainsKey |> not then + self.trackingSpans.[newLine] <- ResizeArray() + else + let neighbour = + self.uiElements.[self.trackingSpans.[newLine] |> Seq.last] // This fails if a tracking span has no ui element! + self.uiElementNeighbour.[self.uiElements.[trackingSpan]] <- neighbour + self.trackingSpanUiParent.Add trackingSpan |> ignore + // And finally add us to the cache again. + self.trackingSpans.[newLine].Add(trackingSpan) + // Be sure that the uiElement of the trackingSpan is visible if the new line is in the visible line space. + if newLine < self.recentFirstVsblLineNmbr || newLine > self.recentLastVsblLineNmbr then + if self.uiElements.ContainsKey trackingSpan then + let mutable element = self.uiElements.[trackingSpan] + element.Visibility <- Visibility.Hidden + + member __.createDefaultStackPanel () = + let grid = Grid(Visibility = Visibility.Hidden) + Canvas.SetLeft(grid, 0.) + Canvas.SetTop(grid, 0.) + grid + + /// Helper methods which invokes every action which is needed for new trackingSpans + member self.addTrackingSpan (trackingSpan:ITrackingSpan)= + let snapshot = buffer.CurrentSnapshot + let startLineNumber = snapshot.GetLineNumberFromPosition(trackingSpan.GetStartPoint(snapshot).Position) + let uiElement = + if self.uiElements.ContainsKey trackingSpan then + logErrorf "Added a tracking span twice, this is not allowed and will result in invalid values! %A" (trackingSpan.GetText snapshot) + self.uiElements.[trackingSpan] + else + let defaultStackPanel = self.createDefaultStackPanel() + self.uiElements.[trackingSpan] <- defaultStackPanel + defaultStackPanel + if self.trackingSpans.ContainsKey startLineNumber then + self.trackingSpans.[startLineNumber].Add trackingSpan + let neighbour = + self.uiElements.[self.trackingSpans.[startLineNumber] |> Seq.last] // This fails if a tracking span has no ui element! + self.uiElementNeighbour.[uiElement] <- neighbour + self.trackingSpanUiParent.Add trackingSpan |> ignore + else + self.trackingSpans.[startLineNumber] <- ResizeArray() + self.trackingSpans.[startLineNumber].Add trackingSpan + uiElement + + + member self.handleBufferChanged(e:TextContentChangedEventArgs) = + try + let oldSnapshot = e.Before + let snapshot = e.After + self.currentBufferSnapshot <- snapshot + for line in oldSnapshot.Lines do + let lineNumber = line.LineNumber + self.updateTrackingSpansFast snapshot lineNumber + let firstLine = view.TextViewLines.FirstVisibleLine + view.DisplayTextLineContainingBufferPosition (firstLine.Start, 0., ViewRelativePosition.Top) + self.RelayoutRequested.Enqueue(()) + with e -> logErrorf "Error in line lens provider: %A" e + + /// Public non-thread-safe method to add line lens for a given tracking span. + /// Returns an UIElement which can be used to add Ui elements and to remove the line lens later. + + member self.AddCodeLens (trackingSpan:ITrackingSpan) = + if trackingSpan.TextBuffer <> buffer then failwith "TrackingSpan text buffer does not equal with CodeLens text buffer" + let Grid = self.addTrackingSpan trackingSpan + self.RelayoutRequested.Enqueue(()) + Grid :> UIElement + + /// Public non-thread-safe method to remove line lens for a given tracking span. + member self.RemoveCodeLens (trackingSpan:ITrackingSpan) = + if self.uiElements.ContainsKey trackingSpan then + let Grid = self.uiElements.[trackingSpan] + Grid.Children.Clear() + self.uiElements.Remove trackingSpan |> ignore + try + self.codeLensLayer.RemoveAdornment(Grid) + with e -> + logExceptionWithContext(e, "Removing line lens") + else + logWarningf "No ui element is attached to this tracking span!" + let lineNumber = + (trackingSpan.GetStartPoint self.currentBufferSnapshot).Position + |> self.currentBufferSnapshot.GetLineNumberFromPosition + if self.trackingSpans.ContainsKey lineNumber then + if self.trackingSpans.[lineNumber].Remove trackingSpan |> not then + logWarningf "No tracking span is accociated with this line number %d!" lineNumber + if self.trackingSpans.[lineNumber].Count = 0 then + self.trackingSpans.Remove lineNumber |> ignore + else + logWarningf "No tracking span is accociated with this line number %d!" lineNumber + + abstract member AddUiElementToCodeLens : ITrackingSpan * UIElement -> unit + default self.AddUiElementToCodeLens (trackingSpan:ITrackingSpan, uiElement:UIElement) = + let Grid = self.uiElements.[trackingSpan] + Grid.Children.Add uiElement |> ignore + + abstract member AddUiElementToCodeLensOnce : ITrackingSpan * UIElement -> unit + default self.AddUiElementToCodeLensOnce (trackingSpan:ITrackingSpan, uiElement:UIElement)= + let Grid = self.uiElements.[trackingSpan] + if uiElement |> Grid.Children.Contains |> not then + self.AddUiElementToCodeLens (trackingSpan, uiElement) + + abstract member RemoveUiElementFromCodeLens : ITrackingSpan * UIElement -> unit + default self.RemoveUiElementFromCodeLens (trackingSpan:ITrackingSpan, uiElement:UIElement) = + let Grid = self.uiElements.[trackingSpan] + Grid.Children.Remove(uiElement) |> ignore + + member self.handleLayoutChanged (e:TextViewLayoutChangedEventArgs) = + try + let buffer = e.NewSnapshot + let recentVisibleLineNumbers = Set [self.recentFirstVsblLineNmbr .. self.recentLastVsblLineNmbr] + let firstVisibleLineNumber, lastVisibleLineNumber = + let first, last = + view.TextViewLines.FirstVisibleLine, + view.TextViewLines.LastVisibleLine + buffer.GetLineNumberFromPosition(first.Start.Position), + buffer.GetLineNumberFromPosition(last.Start.Position) + let visibleLineNumbers = Set [firstVisibleLineNumber .. lastVisibleLineNumber] + let nonVisibleLineNumbers = Set.difference recentVisibleLineNumbers visibleLineNumbers + let newVisibleLineNumbers = Set.difference visibleLineNumbers recentVisibleLineNumbers + + let applyFuncOnLineStackPanels (line:IWpfTextViewLine) (func:Grid -> unit) = + let lineNumber = line.Snapshot.GetLineNumberFromPosition(line.Start.Position) + if (self.trackingSpans.ContainsKey lineNumber) && (self.trackingSpans.[lineNumber]) |> (Seq.isEmpty >> not) then + for trackingSpan in self.trackingSpans.[lineNumber] do + let success, ui = self.uiElements.TryGetValue trackingSpan + if success then + func ui + + if nonVisibleLineNumbers.Count > 0 || newVisibleLineNumbers.Count > 0 then + for lineNumber in nonVisibleLineNumbers do + if lineNumber > 0 && lineNumber < buffer.LineCount then + try + let line = + (buffer.GetLineFromLineNumber lineNumber).Start + |> view.GetTextViewLineContainingBufferPosition + applyFuncOnLineStackPanels line (fun ui -> + ui.Visibility <- Visibility.Hidden + ) + with e -> logErrorf "Error in non visible lines iteration %A" e + for lineNumber in newVisibleLineNumbers do + try + let line = + (buffer.GetLineFromLineNumber lineNumber).Start + |> view.GetTextViewLineContainingBufferPosition + applyFuncOnLineStackPanels line (fun ui -> + ui.Visibility <- Visibility.Visible + self.layoutUIElementOnLine view line ui + ) + with e -> logErrorf "Error in new visible lines iteration %A" e + if not e.VerticalTranslation && e.NewViewState.ViewportHeight <> e.OldViewState.ViewportHeight then + self.RelayoutRequested.Enqueue() // Unfortunately zooming requires a relayout too, to ensure that no weird layout happens due to unkown reasons. + if self.RelayoutRequested.Count > 0 then + self.RelayoutRequested.Dequeue() |> ignore + for lineNumber in visibleLineNumbers do + let line = + (buffer.GetLineFromLineNumber lineNumber).Start + |> view.GetTextViewLineContainingBufferPosition + applyFuncOnLineStackPanels line (fun ui -> + ui.Visibility <- Visibility.Visible + self.layoutUIElementOnLine view line ui + ) + // Save the new first and last visible lines for tracking + self.recentFirstVsblLineNmbr <- firstVisibleLineNumber + self.recentLastVsblLineNmbr <- lastVisibleLineNumber + // We can cancel existing stuff because the algorithm supports abortion without any data loss + self.layoutChangedCts.Cancel() + self.layoutChangedCts.Dispose() + self.layoutChangedCts <- new CancellationTokenSource() + + self.asyncCustomLayoutOperation visibleLineNumbers buffer + |> RoslynHelpers.StartAsyncSafe self.layoutChangedCts.Token + with e -> logExceptionWithContext (e, "Layout changed") + + abstract layoutUIElementOnLine : IWpfTextView -> ITextViewLine -> Grid -> unit + + abstract asyncCustomLayoutOperation : int Set -> ITextSnapshot -> unit Async + + + diff --git a/vsintegration/src/FSharp.Editor/CodeLens/CodeLensGeneralTagger.fs b/vsintegration/src/FSharp.Editor/CodeLens/CodeLensGeneralTagger.fs new file mode 100644 index 0000000000..3d3a2a61f5 --- /dev/null +++ b/vsintegration/src/FSharp.Editor/CodeLens/CodeLensGeneralTagger.fs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace rec Microsoft.VisualStudio.FSharp.Editor + +open System +open System.Windows.Controls +open Microsoft.VisualStudio.Text +open Microsoft.VisualStudio.Text.Editor +open Microsoft.VisualStudio.Text.Formatting +open System.Windows +open System.Collections.Generic +open Microsoft.VisualStudio.Text.Tagging + +open Microsoft.VisualStudio.FSharp.Editor.Logging + +type CodeLensGeneralTag(width, topSpace, baseline, textHeight, bottomSpace, affinity, tag:obj, providerTag:obj) = + inherit SpaceNegotiatingAdornmentTag(width, topSpace, baseline, textHeight, bottomSpace, affinity, tag, providerTag) + +/// Class which provides support for general code lens +/// Use the methods AddCodeLens and RemoveCodeLens +type CodeLensGeneralTagger (view, buffer) as self = + inherit CodeLensDisplayService(view, buffer, "CodeLens") + + /// The tags changed event to notify if the data for the tags has changed. + let tagsChangedEvent = new Event,SnapshotSpanEventArgs>() + + /// Layouts all stack panels on the line + override self.layoutUIElementOnLine (view:IWpfTextView) (line:ITextViewLine) (ui:Grid) = + let left, top = + match self.uiElementNeighbour.TryGetValue ui with + | true, parent -> + let left = Canvas.GetLeft parent + let top = Canvas.GetTop parent + let width = parent.ActualWidth + logInfof "Width of parent: %.4f" width + left + width, top + | _ -> + try + // Get the real offset so that the code lens are placed respectively to their content + let offset = + [0..line.Length - 1] |> Seq.tryFind (fun i -> not (Char.IsWhiteSpace (line.Start.Add(i).GetChar()))) + |> Option.defaultValue 0 + + let realStart = line.Start.Add(offset) + let g = view.TextViewLines.GetCharacterBounds(realStart) + // WORKAROUND VS BUG, left cannot be zero if the offset is creater than zero! + // Calling the method twice fixes this bug and ensures that all values are correct. + // Okay not really :( Must be replaced later with an own calculation depending on editor font settings! + if 7 * offset > int g.Left then + logErrorf "Incorrect return from geometry measure" + Canvas.GetLeft ui, g.Top + else + g.Left, g.Top + with e -> + logExceptionWithContext (e, "Error in layout ui element on line") + Canvas.GetLeft ui, Canvas.GetTop ui + Canvas.SetLeft(ui, left) + Canvas.SetTop(ui, top) + + override self.asyncCustomLayoutOperation _ _ = + asyncMaybe { + // Suspend 16 ms, instantly applying the layout to the adornment elements isn't needed + // and would consume too much performance + do! Async.Sleep(16) |> liftAsync // Skip at least one frames + do! Async.SwitchToContext self.uiContext |> liftAsync + let layer = self.codeLensLayer + + do! Async.Sleep(495) |> liftAsync + + // WORKAROUND FOR VS BUG + // The layout changed event may not provide us all real changed lines so + // we take care of this on our own. + let visibleSpan = + let first, last = + view.TextViewLines.FirstVisibleLine, + view.TextViewLines.LastVisibleLine + SnapshotSpan(first.Start, last.End) + let customVisibleLines = view.TextViewLines.GetTextViewLinesIntersectingSpan visibleSpan + let isLineVisible (line:ITextViewLine) = line.IsValid + let linesToProcess = customVisibleLines |> Seq.filter isLineVisible + + for line in linesToProcess do + try + match line.GetAdornmentTags self |> Seq.tryHead with + | Some (:? seq as stackPanels) -> + for stackPanel in stackPanels do + if stackPanel |> self.addedAdornments.Contains |> not then + layer.AddAdornment(AdornmentPositioningBehavior.OwnerControlled, Nullable(), + self, stackPanel, AdornmentRemovedCallback(fun _ _ -> ())) |> ignore + self.addedAdornments.Add stackPanel |> ignore + | _ -> () + with e -> logExceptionWithContext (e, "LayoutChanged, processing new visible lines") + } |> Async.Ignore + + override self.AddUiElementToCodeLens (trackingSpan:ITrackingSpan, uiElement:UIElement)= + base.AddUiElementToCodeLens (trackingSpan, uiElement) // We do the same as the base call execpt that we need to notify that the tag needs to be refreshed. + tagsChangedEvent.Trigger(self, SnapshotSpanEventArgs(trackingSpan.GetSpan(buffer.CurrentSnapshot))) + + override self.RemoveUiElementFromCodeLens (trackingSpan:ITrackingSpan, uiElement:UIElement) = + base.RemoveUiElementFromCodeLens (trackingSpan, uiElement) + tagsChangedEvent.Trigger(self, SnapshotSpanEventArgs(trackingSpan.GetSpan(buffer.CurrentSnapshot))) // Need to refresh the tag. + + interface ITagger with + [] + override __.TagsChanged = tagsChangedEvent.Publish + + /// Returns the tags which reserve the correct space for adornments + /// Notice, it's asumed that the data in the collection is valid. + override __.GetTags spans = + try + seq { + for span in spans do + let snapshot = span.Snapshot + let lineNumber = + try + snapshot.GetLineNumberFromPosition(span.Start.Position) + with e -> logExceptionWithContext (e, "line number tagging"); 0 + if self.trackingSpans.ContainsKey(lineNumber) && self.trackingSpans.[lineNumber] |> Seq.isEmpty |> not then + + let tagSpan = snapshot.GetLineFromLineNumber(lineNumber).Extent + let stackPanels = + self.trackingSpans.[lineNumber] + |> Seq.map (fun trackingSpan -> + let success, res = self.uiElements.TryGetValue trackingSpan + if success then res else null + ) + |> Seq.filter (isNull >> not) + let span = + try + tagSpan.TranslateTo(span.Snapshot, SpanTrackingMode.EdgeExclusive) + with e -> logExceptionWithContext (e, "tag span translation"); tagSpan + let sizes = + try + stackPanels |> Seq.map (fun ui -> + ui.Measure(Size(10000., 10000.)) + ui.DesiredSize ) + with e -> logExceptionWithContext (e, "internal tagging"); Seq.empty + let height = + try + sizes + |> Seq.map (fun size -> size.Height) + |> Seq.sortDescending + |> Seq.tryHead + |> Option.defaultValue 0. + with e -> logExceptionWithContext (e, "height tagging"); 0. + + yield TagSpan(span, CodeLensGeneralTag(0., height, 0., 0., 0., PositionAffinity.Predecessor, stackPanels, self)) :> ITagSpan + } + with e -> + logErrorf "Error in code lens get tags %A" e + Seq.empty + + diff --git a/vsintegration/src/FSharp.Editor/CodeLens/CodeLensProvider.fs b/vsintegration/src/FSharp.Editor/CodeLens/CodeLensProvider.fs new file mode 100644 index 0000000000..b5092b32cd --- /dev/null +++ b/vsintegration/src/FSharp.Editor/CodeLens/CodeLensProvider.fs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace rec Microsoft.VisualStudio.FSharp.Editor + + +open System +open Microsoft.VisualStudio.Text +open Microsoft.VisualStudio.Text.Editor +open System.ComponentModel.Composition +open Microsoft.VisualStudio.Utilities +open Microsoft.CodeAnalysis +open Microsoft.VisualStudio.Shell +open Microsoft.VisualStudio +open Microsoft.VisualStudio.LanguageServices +open System.Collections.Generic +open Microsoft.CodeAnalysis.Editor.Shared.Utilities +open Microsoft.VisualStudio.Text.Tagging +open Microsoft.VisualStudio.Text.Classification +open Microsoft.VisualStudio.ComponentModelHost +open System.Threading +open Microsoft.VisualStudio.FSharp.Editor.Logging + +[)>] +[)>] +[)>] +[] +[] +type internal CodeLensProvider + [] + ( + textDocumentFactory: ITextDocumentFactoryService, + checkerProvider: FSharpCheckerProvider, + projectInfoManager: FSharpProjectOptionsManager, + typeMap : ClassificationTypeMap Lazy, + gotoDefinitionService: FSharpGoToDefinitionService + ) = + + let lineLensProvider = ResizeArray() + let taggers = ResizeArray() + let componentModel = Package.GetGlobalService(typeof) :?> ComponentModelHost.IComponentModel + let workspace = componentModel.GetService() + + /// Returns an provider for the textView if already one has been created. Else create one. + let addCodeLensProviderOnce wpfView buffer = + let res = taggers |> Seq.tryFind(fun (view, _) -> view = wpfView) + match res with + | Some (_, (tagger, _)) -> tagger + | None -> + let documentId = + lazy ( + match textDocumentFactory.TryGetTextDocument(buffer) with + | true, textDocument -> + Seq.tryHead (workspace.CurrentSolution.GetDocumentIdsWithFilePath(textDocument.FilePath)) + | _ -> None + |> Option.get + ) + + let tagger = CodeLensGeneralTagger(wpfView, buffer) + let service = FSharpCodeLensService(workspace, documentId, buffer, checkerProvider.Checker, projectInfoManager, componentModel.GetService(), typeMap, gotoDefinitionService, tagger) + let provider = (wpfView, (tagger, service)) + wpfView.Closed.Add (fun _ -> taggers.Remove provider |> ignore) + taggers.Add((wpfView, (tagger, service))) + tagger + + /// Returns an provider for the textView if already one has been created. Else create one. + let addLineLensProviderOnce wpfView buffer = + let res = lineLensProvider |> Seq.tryFind(fun (view, _) -> view = wpfView) + match res with + | None -> + let documentId = + lazy ( + match textDocumentFactory.TryGetTextDocument(buffer) with + | true, textDocument -> + Seq.tryHead (workspace.CurrentSolution.GetDocumentIdsWithFilePath(textDocument.FilePath)) + | _ -> None + |> Option.get + ) + let service = FSharpCodeLensService(workspace, documentId, buffer, checkerProvider.Checker, projectInfoManager, componentModel.GetService(), typeMap, gotoDefinitionService, LineLensDisplayService(wpfView, buffer)) + let provider = (wpfView, service) + wpfView.Closed.Add (fun _ -> lineLensProvider.Remove provider |> ignore) + lineLensProvider.Add(provider) + | _ -> () + + [); Name("CodeLens"); + Order(Before = PredefinedAdornmentLayers.Text); + TextViewRole(PredefinedTextViewRoles.Document)>] + member val CodeLensAdornmentLayerDefinition : AdornmentLayerDefinition = null with get, set + + [); Name("LineLens"); + Order(Before = PredefinedAdornmentLayers.Text); + TextViewRole(PredefinedTextViewRoles.Document)>] + member val LineLensAdornmentLayerDefinition : AdornmentLayerDefinition = null with get, set + + interface IViewTaggerProvider with + override __.CreateTagger(view, buffer) = + if Settings.CodeLens.Enabled && not Settings.CodeLens.ReplaceWithLineLens then + let wpfView = + match view with + | :? IWpfTextView as view -> view + | _ -> failwith "error" + + box(addCodeLensProviderOnce wpfView buffer) :?> _ + else + null + + interface IWpfTextViewCreationListener with + override __.TextViewCreated view = + if Settings.CodeLens.Enabled && Settings.CodeLens.ReplaceWithLineLens then + addLineLensProviderOnce view (view.TextBuffer) |> ignore diff --git a/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs b/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs new file mode 100644 index 0000000000..79e2d0045f --- /dev/null +++ b/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs @@ -0,0 +1,385 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace rec Microsoft.VisualStudio.FSharp.Editor + + +open System +open System.Windows.Controls +open System.Windows.Media +open Microsoft.VisualStudio.Text +open Microsoft.VisualStudio.Text.Formatting +open Microsoft.CodeAnalysis +open System.Threading +open Microsoft.FSharp.Compiler.SourceCodeServices +open System.Windows +open System.Collections.Generic +open Microsoft.FSharp.Compiler.Range +open Microsoft.FSharp.Compiler +open Microsoft.FSharp.Compiler.Ast +open Microsoft.CodeAnalysis.Editor.Shared.Extensions +open Microsoft.CodeAnalysis.Editor.Shared.Utilities +open Microsoft.CodeAnalysis.Classification +open Internal.Utilities.StructuredFormat +open System.Windows.Media.Animation + +open Microsoft.VisualStudio.FSharp.Editor.Logging +open Microsoft.VisualStudio.Text.Classification + +type internal CodeLens(taggedText, computed, fullTypeSignature, uiElement) = + member val TaggedText: Async<(ResizeArray * QuickInfoNavigation) option> = taggedText + member val Computed: bool = computed with get, set + member val FullTypeSignature: string = fullTypeSignature + member val UiElement: UIElement = uiElement with get, set + +type internal FSharpCodeLensService + ( + workspace: Workspace, + documentId: Lazy, + buffer: ITextBuffer, + checker: FSharpChecker, + projectInfoManager: FSharpProjectOptionsManager, + classificationFormatMapService: IClassificationFormatMapService, + typeMap: Lazy, + gotoDefinitionService: FSharpGoToDefinitionService, + codeLens : CodeLensDisplayService + ) as self = + + let lineLens = codeLens + + let visit pos parseTree = + AstTraversal.Traverse(pos, parseTree, { new AstTraversal.AstVisitorBase<_>() with + member __.VisitExpr(_path, traverseSynExpr, defaultTraverse, expr) = + defaultTraverse(expr) + + override __.VisitInheritSynMemberDefn (_, _, _, _, range) = Some range + + override __.VisitTypeAbbrev( _, range) = Some range + + override __.VisitLetOrUse(binding, range) = Some range + + override __.VisitBinding (fn, binding) = + Some binding.RangeOfBindingAndRhs + }) + + let formatMap = lazy classificationFormatMapService.GetClassificationFormatMap "tooltip" + + let mutable lastResults = Dictionary() + let mutable firstTimeChecked = false + let mutable bufferChangedCts = new CancellationTokenSource() + let uiContext = SynchronizationContext.Current + + let layoutTagToFormatting (layoutTag: LayoutTag) = + layoutTag + |> RoslynHelpers.roslynTag + |> ClassificationTags.GetClassificationTypeName + |> typeMap.Value.GetClassificationType + |> formatMap.Value.GetTextProperties + + let createTextBox (lens:CodeLens) = + async { + do! Async.SwitchToContext uiContext + let! res = lens.TaggedText + match res with + | Some (taggedText, navigation) -> + logInfof "Tagged text %A" taggedText + let textBlock = new TextBlock(Background = Brushes.AliceBlue, Opacity = 0.0, TextTrimming = TextTrimming.None) + DependencyObjectExtensions.SetDefaultTextProperties(textBlock, formatMap.Value) + + let prefix = Documents.Run Settings.CodeLens.Prefix + prefix.Foreground <- SolidColorBrush(Color.FromRgb(153uy, 153uy, 153uy)) + textBlock.Inlines.Add prefix + + for text in taggedText do + + let coloredProperties = layoutTagToFormatting text.Tag + let actualProperties = + if Settings.CodeLens.UseColors + then + // If color is gray (R=G=B), change to correct gray color. + // Otherwise, use the provided color. + match coloredProperties.ForegroundBrush with + | :? SolidColorBrush as b -> + let c = b.Color + if c.R = c.G && c.R = c.B + then coloredProperties.SetForeground(Color.FromRgb(153uy, 153uy, 153uy)) + else coloredProperties + | _ -> coloredProperties + else + coloredProperties.SetForeground(Color.FromRgb(153uy, 153uy, 153uy)) + + let run = Documents.Run text.Text + DependencyObjectExtensions.SetTextProperties (run, actualProperties) + + let inl = + match text with + | :? Layout.NavigableTaggedText as nav when navigation.IsTargetValid nav.Range -> + let h = Documents.Hyperlink(run, ToolTip = nav.Range.FileName) + h.Click.Add (fun _ -> + navigation.NavigateTo nav.Range) + h :> Documents.Inline + | _ -> run :> _ + DependencyObjectExtensions.SetTextProperties (inl, actualProperties) + textBlock.Inlines.Add inl + + + textBlock.Measure(Size(Double.PositiveInfinity, Double.PositiveInfinity)) + lens.Computed <- true + lens.UiElement <- textBlock + return true + | _ -> + return false + } + + let StartAsyncSafe cancellationToken context computation = + let computation = + async { + try + return! computation + with e -> + logExceptionWithContext(e, context) + return Unchecked.defaultof<_> + } + Async.Start (computation, cancellationToken) + + let executeCodeLenseAsync () = + asyncMaybe { + do! Async.Sleep 800 |> liftAsync + logInfof "Rechecking code due to buffer edit!" + let! document = workspace.CurrentSolution.GetDocument(documentId.Value) |> Option.ofObj + let! _, options = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document) + let! _, parsedInput, checkFileResults = checker.ParseAndCheckDocument(document, options, true, "LineLens") + logInfof "Getting uses of all symbols!" + let! symbolUses = checkFileResults.GetAllUsesOfAllSymbolsInFile() |> liftAsync + let textSnapshot = buffer.CurrentSnapshot + logInfof "Updating due to buffer edit!" + + // Clear existing data and cache flags + // The results which are left. + let oldResults = Dictionary(lastResults) + + let newResults = Dictionary() + // Symbols which cache wasn't found yet + let unattachedSymbols = ResizeArray() + // Tags which are new or need to be updated due to changes. + let tagsToUpdate = Dictionary() + let codeLensToAdd = ResizeArray() + + let useResults (displayContext: FSharpDisplayContext, func: FSharpMemberOrFunctionOrValue, realPosition: range) = + async { + try + let textSnapshot = buffer.CurrentSnapshot + let lineNumber = Line.toZ func.DeclarationLocation.StartLine + if (lineNumber >= 0 || lineNumber < textSnapshot.LineCount) then + match func.FullTypeSafe with + | Some ty -> + let! displayEnv = checkFileResults.GetDisplayEnvForPos func.DeclarationLocation.Start + + let displayContext = + match displayEnv with + | Some denv -> FSharpDisplayContext(fun _ -> denv) + | None -> displayContext + + let typeLayout = func.FormatLayout displayContext + let taggedText = ResizeArray() + + Layout.renderL (Layout.taggedTextListR taggedText.Add) typeLayout |> ignore + let navigation = QuickInfoNavigation(gotoDefinitionService, document, realPosition) + // Because the data is available notify that this line should be updated, displaying the results + return Some (taggedText, navigation) + | None -> + logWarningf "Couldn't acquire CodeLens data for function %A" func + return None + else return None + with e -> + logErrorf "Error in lazy line lens computation. %A" e + return None + } + + let inline setNewResultsAndWarnIfOverriden fullDeclarationText value = + if newResults.ContainsKey fullDeclarationText then + logWarningf "New results already contains: %A" fullDeclarationText + newResults.[fullDeclarationText] <- value + + for symbolUse in symbolUses do + if symbolUse.IsFromDefinition then + match symbolUse.Symbol with + | :? FSharpMemberOrFunctionOrValue as func when func.IsModuleValueOrMember || func.IsProperty -> + let funcID = func.FullName + let fullDeclarationText = funcID // (textSnapshot.GetText declarationSpan).Replace(func.CompiledName, funcID) + let fullTypeSignature = func.FullType.ToString() + // Try to re-use the last results + if lastResults.ContainsKey fullDeclarationText then + // Make sure that the results are usable + let inline setNewResultsAndWarnIfOverridenLocal value = setNewResultsAndWarnIfOverriden fullDeclarationText value + let lastTrackingSpan, codeLens as lastResult = lastResults.[fullDeclarationText] + if codeLens.FullTypeSignature = fullTypeSignature then + setNewResultsAndWarnIfOverridenLocal lastResult + oldResults.Remove fullDeclarationText |> ignore + else + let declarationLine, range = + match visit func.DeclarationLocation.Start parsedInput with + | Some range -> range.StartLine - 1, range + | _ -> func.DeclarationLocation.StartLine - 1, func.DeclarationLocation + // Track the old element for removal + let declarationSpan = + let line = textSnapshot.GetLineFromLineNumber declarationLine + let offset = line.GetText() |> Seq.findIndex (Char.IsWhiteSpace >> not) + SnapshotSpan(line.Start.Add offset, line.End).Span + let newTrackingSpan = + textSnapshot.CreateTrackingSpan(declarationSpan, SpanTrackingMode.EdgeExclusive) + // Push back the new results + let res = + CodeLens( Async.cache (useResults (symbolUse.DisplayContext, func, range)), + false, + fullTypeSignature, + null) + // The old results aren't computed at all, because the line might have changed create new results + tagsToUpdate.[lastTrackingSpan] <- (newTrackingSpan, fullDeclarationText, res) + setNewResultsAndWarnIfOverridenLocal (newTrackingSpan, res) + + oldResults.Remove fullDeclarationText |> ignore + else + // The symbol might be completely new or has slightly changed. + // We need to track this and iterate over the left entries to ensure that there isn't anything + unattachedSymbols.Add((symbolUse, func, fullDeclarationText, fullTypeSignature)) + | _ -> () + + // In best case this works quite `covfefe` fine because often enough we change only a small part of the file and not the complete. + for unattachedSymbol in unattachedSymbols do + let symbolUse, func, fullDeclarationText, fullTypeSignature = unattachedSymbol + let declarationLine, range = + match visit func.DeclarationLocation.Start parsedInput with + | Some range -> range.StartLine - 1, range + | _ -> func.DeclarationLocation.StartLine - 1, func.DeclarationLocation + + let test (v:KeyValuePair<_, _>) = + let _, (codeLens:CodeLens) = v.Value + codeLens.FullTypeSignature = fullTypeSignature + match oldResults |> Seq.tryFind test with + | Some res -> + let (trackingSpan : ITrackingSpan), (codeLens : CodeLens) = res.Value + let declarationSpan = + let line = textSnapshot.GetLineFromLineNumber declarationLine + let offset = line.GetText() |> Seq.findIndex (Char.IsWhiteSpace >> not) + SnapshotSpan(line.Start.Add offset, line.End).Span + let newTrackingSpan = + textSnapshot.CreateTrackingSpan(declarationSpan, SpanTrackingMode.EdgeExclusive) + if codeLens.Computed && (isNull codeLens.UiElement |> not) then + newResults.[fullDeclarationText] <- (newTrackingSpan, codeLens) + tagsToUpdate.[trackingSpan] <- (newTrackingSpan, fullDeclarationText, codeLens) + else + let res = + CodeLens( + Async.cache (useResults (symbolUse.DisplayContext, func, range)), + false, + fullTypeSignature, + null) + // The tag might be still valid but it hasn't been computed yet so create fresh results + tagsToUpdate.[trackingSpan] <- (newTrackingSpan, fullDeclarationText, res) + newResults.[fullDeclarationText] <- (newTrackingSpan, res) + let key = res.Key + oldResults.Remove key |> ignore // no need to check this entry again + | None -> + // This function hasn't got any cache and so it's completely new. + // So create completely new results + // And finally add a tag for this. + let res = + CodeLens( + Async.cache (useResults (symbolUse.DisplayContext, func, range)), + false, + fullTypeSignature, + null) + try + let declarationSpan = + let line = textSnapshot.GetLineFromLineNumber declarationLine + let offset = line.GetText() |> Seq.findIndex (Char.IsWhiteSpace >> not) + SnapshotSpan(line.Start.Add offset, line.End).Span + let trackingSpan = + textSnapshot.CreateTrackingSpan(declarationSpan, SpanTrackingMode.EdgeExclusive) + codeLensToAdd.Add (trackingSpan, res) + newResults.[fullDeclarationText] <- (trackingSpan, res) + with e -> logExceptionWithContext (e, "Line Lens tracking tag span creation") + () + lastResults <- newResults + do! Async.SwitchToContext uiContext |> liftAsync + let createCodeLensUIElement (codeLens:CodeLens) trackingSpan _ = + if codeLens.Computed |> not then + async { + let! res = createTextBox codeLens + if res then + do! Async.SwitchToContext uiContext + logInfof "Adding ui element for %A" (codeLens.TaggedText) + let uiElement = codeLens.UiElement + let animation = + DoubleAnimation( + To = Nullable 0.8, + Duration = (TimeSpan.FromMilliseconds 800. |> Duration.op_Implicit), + EasingFunction = QuadraticEase() + ) + let sb = Storyboard() + Storyboard.SetTarget(sb, uiElement) + Storyboard.SetTargetProperty(sb, PropertyPath Control.OpacityProperty) + sb.Children.Add animation + lineLens.AddUiElementToCodeLensOnce (trackingSpan, uiElement) + lineLens.RelayoutRequested.Enqueue () + sb.Begin() + else + logWarningf "Couldn't retrieve code lens information for %A" codeLens.FullTypeSignature + // logInfo "Adding text box!" + } |> StartAsyncSafe CancellationToken.None "UIElement creation" + + for value in tagsToUpdate do + let trackingSpan, (newTrackingSpan, _, codeLens) = value.Key, value.Value + // logInfof "Adding ui element for %A" (codeLens.TaggedText) + lineLens.RemoveCodeLens trackingSpan |> ignore + let Grid = lineLens.AddCodeLens newTrackingSpan + // logInfof "Trackingspan %A is being added." trackingSpan + if codeLens.Computed && (isNull codeLens.UiElement |> not) then + let uiElement = codeLens.UiElement + lineLens.AddUiElementToCodeLensOnce (newTrackingSpan, uiElement) + else + Grid.IsVisibleChanged + |> Event.filter (fun eventArgs -> eventArgs.NewValue :?> bool) + |> Event.add (createCodeLensUIElement codeLens newTrackingSpan) + + for value in codeLensToAdd do + let trackingSpan, codeLens = value + let Grid = lineLens.AddCodeLens trackingSpan + logInfof "Trackingspan %A is being added." trackingSpan + + Grid.IsVisibleChanged + |> Event.filter (fun eventArgs -> eventArgs.NewValue :?> bool) + |> Event.add (createCodeLensUIElement codeLens trackingSpan) + + for oldResult in oldResults do + let trackingSpan, _ = oldResult.Value + // logInfof "removing trackingSpan %A" trackingSpan + lineLens.RemoveCodeLens trackingSpan |> ignore + + logInfof "Finished updating line lens." + + if not firstTimeChecked then + firstTimeChecked <- true + } |> Async.Ignore + + do + begin + buffer.Changed.AddHandler(fun _ e -> (self.BufferChanged e)) + async { + let mutable numberOfFails = 0 + while not firstTimeChecked && numberOfFails < 10 do + try + do! executeCodeLenseAsync() + do! Async.Sleep(1000) + with + | e -> logErrorf "Line Lens startup failed with: %A" e + numberOfFails <- numberOfFails + 1 + } |> Async.Start + end + + member __.BufferChanged ___ = + bufferChangedCts.Cancel() // Stop all ongoing async workflow. + bufferChangedCts.Dispose() + bufferChangedCts <- new CancellationTokenSource() + executeCodeLenseAsync () |> Async.Ignore |> RoslynHelpers.StartAsyncSafe bufferChangedCts.Token + diff --git a/vsintegration/src/FSharp.Editor/CodeLens/LineLensDisplayService.fs b/vsintegration/src/FSharp.Editor/CodeLens/LineLensDisplayService.fs new file mode 100644 index 0000000000..be49b79d03 --- /dev/null +++ b/vsintegration/src/FSharp.Editor/CodeLens/LineLensDisplayService.fs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace rec Microsoft.VisualStudio.FSharp.Editor + + +open System +open System.Windows.Controls +open Microsoft.VisualStudio.Text +open Microsoft.VisualStudio.Text.Editor +open Microsoft.VisualStudio.Text.Formatting +open System.Windows +open System.Collections.Generic + +open Microsoft.VisualStudio.FSharp.Editor.Logging + +type internal LineLensDisplayService (view, buffer) = + inherit CodeLensDisplayService(view, buffer, "LineLens") + + /// Layouts all stack panels on the line + override self.layoutUIElementOnLine _ (line:ITextViewLine) (ui:Grid) = + let left, top = + match self.uiElementNeighbour.TryGetValue ui with + | true, parent -> + let left = Canvas.GetLeft parent + let top = Canvas.GetTop parent + let width = parent.ActualWidth + left + width, top + | _ -> + try + let bounds = line.GetCharacterBounds(line.Start) + line.TextRight + 5.0, bounds.Top - 1. + with e -> + logExceptionWithContext (e, "Error in layout ui element on line") + Canvas.GetLeft ui, Canvas.GetTop ui + Canvas.SetLeft(ui, left) + Canvas.SetTop(ui, top) + + override self.asyncCustomLayoutOperation visibleLineNumbers buffer = + asyncMaybe { + // Suspend 5 ms, instantly applying the layout to the adornment elements isn't needed + // and would consume too much performance + do! Async.Sleep(5) |> liftAsync // Skip at least one frames + do! Async.SwitchToContext self.uiContext |> liftAsync + let layer = self.codeLensLayer + do! Async.Sleep(495) |> liftAsync + try + for visibleLineNumber in visibleLineNumbers do + if self.trackingSpans.ContainsKey visibleLineNumber then + self.trackingSpans.[visibleLineNumber] + |> Seq.map (fun trackingSpan -> + let success, res = self.uiElements.TryGetValue trackingSpan + if success then + res + else null + ) + |> Seq.filter (fun ui -> not(isNull ui) && not(self.addedAdornments.Contains ui)) + |> Seq.iter(fun grid -> + layer.AddAdornment(AdornmentPositioningBehavior.OwnerControlled, Nullable(), + self, grid, AdornmentRemovedCallback(fun _ _ -> self.addedAdornments.Remove grid |> ignore)) |> ignore + self.addedAdornments.Add grid |> ignore + let line = + let l = buffer.GetLineFromLineNumber visibleLineNumber + view.GetTextViewLineContainingBufferPosition l.Start + self.layoutUIElementOnLine view line grid + ) + with e -> logExceptionWithContext (e, "LayoutChanged, processing new visible lines") + } |> Async.Ignore \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/Common/Constants.fs b/vsintegration/src/FSharp.Editor/Common/Constants.fs index ec876ff9d5..bc9b33b50c 100644 --- a/vsintegration/src/FSharp.Editor/Common/Constants.fs +++ b/vsintegration/src/FSharp.Editor/Common/Constants.fs @@ -64,6 +64,10 @@ module internal Guids = [] /// "9A66EB6A-DE52-4169-BC26-36FBD4312FD7" let codeFixesOptionPageIdString = "9A66EB6A-DE52-4169-BC26-36FBD4312FD7" + + [] + /// "00BE7FD9-8145-4A2E-A1BF-3BAF0F4F47DD" + let codeLensOptionPageIdString = "00BE7FD9-8145-4A2E-A1BF-3BAF0F4F47DD" [] /// "8FDA964A-263D-4B4E-9560-29897535217C" diff --git a/vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs b/vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs index feb1e89e57..880d14362c 100644 --- a/vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs +++ b/vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs @@ -159,6 +159,17 @@ module internal RoslynHelpers = let linePositionSpan = LinePositionSpan(LinePosition(Line.toZ r.StartLine, r.StartColumn), LinePosition(Line.toZ r.EndLine, r.EndColumn)) let textSpan = sourceText.Lines.GetTextSpan linePositionSpan Location.Create(filePath, textSpan, linePositionSpan) + + let StartAsyncSafe cancellationToken computation = + let computation = + async { + try + return! computation + with e -> + Assert.Exception(e) + return Unchecked.defaultof<_> + } + Async.Start (computation, cancellationToken) module internal OpenDeclarationHelper = diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index 6d64030df3..eb2fb6ac56 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -90,6 +90,11 @@ + + + + + diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index 5b6ccb784e..7bb4a6435e 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -286,6 +286,7 @@ type [, "F#", null, "QuickInfo", "6009")>] [, "F#", null, "Code Fixes", "6010")>] [, "F#", null, "Performance", "6011")>] + [, "F#", null, "Code Lens", "6012")>] [, "F#", null, "Advanced", "6012")>] [] [, diff --git a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs index 8444a3c157..c157908fba 100644 --- a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs +++ b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs @@ -42,10 +42,15 @@ type LanguageServicePerformanceOptions = ProjectCheckCacheSize: int } [] +type CodeLensOptions = + { Enabled : bool + ReplaceWithLineLens: bool + UseColors: bool + Prefix : string } + type AdvancedOptions = { IsBlockStructureEnabled: bool IsOutliningEnabled: bool } - [)>] type internal Settings [](store: SettingsStore) = do // Initialize default settings @@ -75,12 +80,19 @@ type internal Settings [](store: SettingsStore) = { IsBlockStructureEnabled = true IsOutliningEnabled = true } + store.RegisterDefault + { Enabled = true + UseColors = false + ReplaceWithLineLens = true + Prefix = "// " } + interface ISettings static member IntelliSense : IntelliSenseOptions = getSettings() static member QuickInfo : QuickInfoOptions = getSettings() static member CodeFixes : CodeFixesOptions = getSettings() static member LanguageServicePerformance : LanguageServicePerformanceOptions = getSettings() + static member CodeLens : CodeLensOptions = getSettings() static member Advanced: AdvancedOptions = getSettings() module internal OptionsUI = @@ -116,9 +128,15 @@ module internal OptionsUI = inherit AbstractOptionPage() override this.CreateView() = upcast LanguageServicePerformanceOptionControl() + + [] + type internal CodeLensOptionPage() = + inherit AbstractOptionPage() + override this.CreateView() = + upcast CodeLensOptionControl() [] type internal AdvancedSettingsOptionPage() = inherit AbstractOptionPage() override __.CreateView() = - upcast AdvancedOptionsControl() \ No newline at end of file + upcast AdvancedOptionsControl() diff --git a/vsintegration/src/FSharp.Editor/Options/UIHelpers.fs b/vsintegration/src/FSharp.Editor/Options/UIHelpers.fs index 2fb2fe303f..122fb5c51d 100644 --- a/vsintegration/src/FSharp.Editor/Options/UIHelpers.fs +++ b/vsintegration/src/FSharp.Editor/Options/UIHelpers.fs @@ -64,7 +64,7 @@ module internal OptionsUIHelpers = let bindCheckBox (checkBox: CheckBox) (path: string) = checkBox.SetBinding(CheckBox.IsCheckedProperty, path) |> ignore - + // some helpers to create option views in code instead of XAML let ( *** ) (control : #IAddChild) (children: UIElement list) = children |> List.iter control.AddChild diff --git a/vsintegration/src/FSharp.UIResources/CodeLensOptionControl.xaml b/vsintegration/src/FSharp.UIResources/CodeLensOptionControl.xaml new file mode 100644 index 0000000000..955c105c7f --- /dev/null +++ b/vsintegration/src/FSharp.UIResources/CodeLensOptionControl.xaml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vsintegration/src/FSharp.UIResources/CodeLensOptionControl.xaml.cs b/vsintegration/src/FSharp.UIResources/CodeLensOptionControl.xaml.cs new file mode 100644 index 0000000000..ad1a0ecf1a --- /dev/null +++ b/vsintegration/src/FSharp.UIResources/CodeLensOptionControl.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Microsoft.VisualStudio.FSharp.UIResources +{ + /// + /// Interaction logic for CodeLensOptionPage.xaml + /// + internal partial class CodeLensOptionControl : UserControl + { + public CodeLensOptionControl() + { + InitializeComponent(); + } + } +} diff --git a/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj b/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj index c511d7e926..8419aff801 100644 --- a/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj +++ b/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj @@ -46,7 +46,7 @@ $(VS150COMNTOOLS)\..\..\MSBuild\$(VisualStudioVersion)\Bin $(VSMSBuildBinDir)\Microsoft.CSharp.targets - + false diff --git a/vsintegration/src/FSharp.UIResources/Strings.Designer.cs b/vsintegration/src/FSharp.UIResources/Strings.Designer.cs index 75234c04d7..9ca24307b1 100644 --- a/vsintegration/src/FSharp.UIResources/Strings.Designer.cs +++ b/vsintegration/src/FSharp.UIResources/Strings.Designer.cs @@ -87,6 +87,51 @@ public static string Code_Fixes { } } + /// + /// Looks up a localized string similar to CodeLens. + /// + public static string CodeLens { + get { + return ResourceManager.GetString("CodeLens", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Annotation prefix. + /// + public static string CodeLens_Prefix { + get { + return ResourceManager.GetString("CodeLens_Prefix", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show annotations to the right instead of above the line. + /// + public static string CodeLens_Replace_LineLens { + get { + return ResourceManager.GetString("CodeLens_Replace_LineLens", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show type signature annotations in the editor. + /// + public static string CodeLens_Switch { + get { + return ResourceManager.GetString("CodeLens_Switch", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Use colors in annotations. + /// + public static string CodeLens_UseColors { + get { + return ResourceManager.GetString("CodeLens_UseColors", resourceCulture); + } + } + /// /// Looks up a localized string similar to Completion Lists. /// diff --git a/vsintegration/src/FSharp.UIResources/Strings.resx b/vsintegration/src/FSharp.UIResources/Strings.resx index ebe45bf732..721e028dba 100644 --- a/vsintegration/src/FSharp.UIResources/Strings.resx +++ b/vsintegration/src/FSharp.UIResources/Strings.resx @@ -53,7 +53,6 @@ value : The object must be serialized with : System.Runtime.Serialization.Formatters.Soap.SoapFormatter : and then encoded with base64 encoding. - mimetype: application/x-microsoft.net.object.bytearray.base64 value : The object must be serialized into a byte array : using a System.ComponentModel.TypeConverter @@ -180,4 +179,19 @@ Show outlining and collapsable nodes for F# code + + CodeLens + + + Show annotations to the right instead of above the line + + + Show type signature annotations in the editor + + + Annotation prefix + + + Use colors in annotations + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf index a396705910..23594aa2a0 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf @@ -107,6 +107,31 @@ Zobrazí osnovu a sbalitelné uzly kódu F#. + + CodeLens + CodeLens + + + + Show annotations to the right instead of above the line + Show annotations to the right instead of above the line + + + + Show type signature annotations in the editor + Show type signature annotations in the editor + + + + Annotation prefix + Annotation prefix + + + + Use colors in annotations + Use colors in annotations + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf index 218468a4f8..4a06b1b6f9 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf @@ -107,6 +107,31 @@ Gliederung und ausblendbare Knoten für F#-Code anzeigen + + CodeLens + CodeLens + + + + Show annotations to the right instead of above the line + Show annotations to the right instead of above the line + + + + Show type signature annotations in the editor + Show type signature annotations in the editor + + + + Annotation prefix + Annotation prefix + + + + Use colors in annotations + Use colors in annotations + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf index a9f0ba0ac1..58e0be7f3e 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf @@ -107,6 +107,31 @@ Show outlining and collapsable nodes for F# code + + CodeLens + CodeLens + + + + Show annotations to the right instead of above the line + Show annotations to the right instead of above the line + + + + Show type signature annotations in the editor + Show type signature annotations in the editor + + + + Annotation prefix + Annotation prefix + + + + Use colors in annotations + Use colors in annotations + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf index 88318f4804..e2c4d5b911 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf @@ -107,6 +107,31 @@ Mostrar los nodos de esquematización y contraíbles del código F# + + CodeLens + CodeLens + + + + Show annotations to the right instead of above the line + Show annotations to the right instead of above the line + + + + Show type signature annotations in the editor + Show type signature annotations in the editor + + + + Annotation prefix + Annotation prefix + + + + Use colors in annotations + Use colors in annotations + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf index 2df7e8e711..791db1628f 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf @@ -107,6 +107,31 @@ Afficher le mode plan et les nœuds réductibles pour le code F# + + CodeLens + CodeLens + + + + Show annotations to the right instead of above the line + Show annotations to the right instead of above the line + + + + Show type signature annotations in the editor + Show type signature annotations in the editor + + + + Annotation prefix + Annotation prefix + + + + Use colors in annotations + Use colors in annotations + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf index aea7e8a335..7ec6526107 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf @@ -107,6 +107,31 @@ Mostra i nodi struttura e comprimibili per il codice F# + + CodeLens + CodeLens + + + + Show annotations to the right instead of above the line + Show annotations to the right instead of above the line + + + + Show type signature annotations in the editor + Show type signature annotations in the editor + + + + Annotation prefix + Annotation prefix + + + + Use colors in annotations + Use colors in annotations + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf index fe3dad874a..983570100b 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf @@ -107,6 +107,31 @@ F# コードのアウトラインおよび折りたたみ可能なノードを表示する + + CodeLens + CodeLens + + + + Show annotations to the right instead of above the line + Show annotations to the right instead of above the line + + + + Show type signature annotations in the editor + Show type signature annotations in the editor + + + + Annotation prefix + Annotation prefix + + + + Use colors in annotations + Use colors in annotations + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf index 310eeffa71..37fe273ced 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf @@ -107,6 +107,31 @@ F# 코드에 대한 개요 및 축소 가능한 노드 표시 + + CodeLens + CodeLens + + + + Show annotations to the right instead of above the line + Show annotations to the right instead of above the line + + + + Show type signature annotations in the editor + Show type signature annotations in the editor + + + + Annotation prefix + Annotation prefix + + + + Use colors in annotations + Use colors in annotations + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf index 1ff43eb0bd..fb7bcd1d16 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf @@ -107,6 +107,31 @@ Pokaż konspekt i węzły z możliwością zwijania dla kodu języka F# + + CodeLens + CodeLens + + + + Show annotations to the right instead of above the line + Show annotations to the right instead of above the line + + + + Show type signature annotations in the editor + Show type signature annotations in the editor + + + + Annotation prefix + Annotation prefix + + + + Use colors in annotations + Use colors in annotations + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf index 44da05912b..e4cd1e6d2e 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf @@ -107,6 +107,31 @@ Mostrar os nós de estrutura de tópicos e recolhíveis para o código F# + + CodeLens + CodeLens + + + + Show annotations to the right instead of above the line + Show annotations to the right instead of above the line + + + + Show type signature annotations in the editor + Show type signature annotations in the editor + + + + Annotation prefix + Annotation prefix + + + + Use colors in annotations + Use colors in annotations + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf index c5141e2e97..f8a7046f4c 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf @@ -107,6 +107,31 @@ Показать структурирование и сворачиваемые узлы для кода F# + + CodeLens + CodeLens + + + + Show annotations to the right instead of above the line + Show annotations to the right instead of above the line + + + + Show type signature annotations in the editor + Show type signature annotations in the editor + + + + Annotation prefix + Annotation prefix + + + + Use colors in annotations + Use colors in annotations + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf index 5198b19f72..da4b3b409d 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf @@ -107,6 +107,31 @@ F# kodu için ana hattı ve daraltılabilir düğümleri göster + + CodeLens + CodeLens + + + + Show annotations to the right instead of above the line + Show annotations to the right instead of above the line + + + + Show type signature annotations in the editor + Show type signature annotations in the editor + + + + Annotation prefix + Annotation prefix + + + + Use colors in annotations + Use colors in annotations + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf index 2d251aa037..0ac1cccdf3 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf @@ -107,6 +107,31 @@ 显示 F# 代码的大纲和可折叠节点 + + CodeLens + CodeLens + + + + Show annotations to the right instead of above the line + Show annotations to the right instead of above the line + + + + Show type signature annotations in the editor + Show type signature annotations in the editor + + + + Annotation prefix + Annotation prefix + + + + Use colors in annotations + Use colors in annotations + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf index be901b794c..bf7a84dec5 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf @@ -107,6 +107,31 @@ 顯示 F# 程式碼的大綱與可折疊的節點 + + CodeLens + CodeLens + + + + Show annotations to the right instead of above the line + Show annotations to the right instead of above the line + + + + Show type signature annotations in the editor + Show type signature annotations in the editor + + + + Annotation prefix + Annotation prefix + + + + Use colors in annotations + Use colors in annotations + + \ No newline at end of file From e212e664db6d75bbf29b148797f58a346c13954c Mon Sep 17 00:00:00 2001 From: Don Syme Date: Thu, 15 Mar 2018 19:53:40 +0000 Subject: [PATCH 119/147] remove old file (#4539) --- .../DummyProviderForLanguageServiceTesting.fsproj | 1 - .../MockTypeProviders/EmptyAssembly/EmptyAssembly.fsproj | 1 - vsintegration/vsintegration.targets | 7 ------- 3 files changed, 9 deletions(-) delete mode 100644 vsintegration/vsintegration.targets diff --git a/vsintegration/tests/unittests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj b/vsintegration/tests/unittests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj index 6b201cb419..5d5f306848 100644 --- a/vsintegration/tests/unittests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj +++ b/vsintegration/tests/unittests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj @@ -38,5 +38,4 @@ - \ No newline at end of file diff --git a/vsintegration/tests/unittests/MockTypeProviders/EmptyAssembly/EmptyAssembly.fsproj b/vsintegration/tests/unittests/MockTypeProviders/EmptyAssembly/EmptyAssembly.fsproj index 439e8d6aa3..6d4faa3992 100644 --- a/vsintegration/tests/unittests/MockTypeProviders/EmptyAssembly/EmptyAssembly.fsproj +++ b/vsintegration/tests/unittests/MockTypeProviders/EmptyAssembly/EmptyAssembly.fsproj @@ -35,5 +35,4 @@ - \ No newline at end of file diff --git a/vsintegration/vsintegration.targets b/vsintegration/vsintegration.targets deleted file mode 100644 index 1e5448c5e6..0000000000 --- a/vsintegration/vsintegration.targets +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - From 02474f2218159aa033b5e16f116f77515c9da821 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Thu, 15 Mar 2018 20:01:25 +0000 Subject: [PATCH 120/147] fix project file (#4540) --- .../FSharp.Compiler.Unittests.fsproj | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.Unittests.fsproj b/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.Unittests.fsproj index 4bd20fd6b2..5357d4ffad 100644 --- a/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.Unittests.fsproj +++ b/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.Unittests.fsproj @@ -60,10 +60,9 @@ FSharp.Compiler.Private {2e4d67b4-522d-4cf7-97e4-ba940f0b18f3} - + + {DED3BBD7-53F4-428A-8C9F-27968E768605} FSharp.Core - {ded3bbd7-53f4-428a-8c9f-27968e768605} - True From 4dce3d167f744ffd40da6d62313b1e7c454e1d0f Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Thu, 15 Mar 2018 13:26:52 -0700 Subject: [PATCH 121/147] remove comment (#4538) --- .../src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs b/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs index 79e2d0045f..9be718fed9 100644 --- a/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs +++ b/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs @@ -205,7 +205,7 @@ type internal FSharpCodeLensService match symbolUse.Symbol with | :? FSharpMemberOrFunctionOrValue as func when func.IsModuleValueOrMember || func.IsProperty -> let funcID = func.FullName - let fullDeclarationText = funcID // (textSnapshot.GetText declarationSpan).Replace(func.CompiledName, funcID) + let fullDeclarationText = funcID let fullTypeSignature = func.FullType.ToString() // Try to re-use the last results if lastResults.ContainsKey fullDeclarationText then From 4c2a023af5e5780ceef31a14847df7fef9d386ac Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Thu, 15 Mar 2018 15:39:36 -0700 Subject: [PATCH 122/147] fix building in VS with PDB conversions --- FSharp.Directory.Build.props | 3 +-- build.cmd | 2 +- .../FSharp.PropertiesPages.vbproj | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/FSharp.Directory.Build.props b/FSharp.Directory.Build.props index ea31420601..5f8cb923c5 100644 --- a/FSharp.Directory.Build.props +++ b/FSharp.Directory.Build.props @@ -17,8 +17,7 @@ $(NUGET_PACKAGES) - $(UserProfile)\.nuget\packages\ - $(HOME)/.nuget/packages/ + $(MSBuildThisFileDirectory)packages $(NuGetPackageRoot)\ $(NuGetPackageRoot)/ diff --git a/build.cmd b/build.cmd index 277cee2fb0..061d614063 100644 --- a/build.cmd +++ b/build.cmd @@ -653,7 +653,7 @@ if "%NEEDS_DOTNET_CLI_TOOLS%" == "1" ( set _dotnetcliexe=%~dp0Tools\dotnetcli\dotnet.exe set _dotnet20exe=%~dp0Tools\dotnet20\dotnet.exe -set NUGET_PACKAGES=%~dp0Packages +set NUGET_PACKAGES=%~dp0packages set path=%~dp0Tools\dotnet20\;%path% echo ----------- Done with package restore, starting dependency uptake check ------------- diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj index db88b5bff7..e3a0ab62a7 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj @@ -34,6 +34,7 @@ true true true + true From c87da6028ed16604b4a7853462f9e6cbaae73263 Mon Sep 17 00:00:00 2001 From: Lukas Rieger <0x53A@users.noreply.github.com> Date: Thu, 15 Mar 2018 23:47:44 +0100 Subject: [PATCH 123/147] Use C# code instead of manually modified DLL. (#4514) * Use C# code instead of manually modified DLL. * set /langversion:latest * pre-fill CSC_PIPE with Microsoft.Net.Compilers * upgrade Microsoft.Net.Compilers 2.4 => 2.7 --- build.cmd | 1 + tests/fsharp/packages.config | 2 +- tests/fsharp/test-framework.fs | 2 +- .../fsharpqa/Source/Import/AccessibilityTests.cs | 6 ++---- .../Source/Import/AccessibilityTests.dll | Bin 4608 -> 0 bytes tests/fsharpqa/Source/Import/env.lst | 10 +++++----- 6 files changed, 10 insertions(+), 11 deletions(-) delete mode 100644 tests/fsharpqa/Source/Import/AccessibilityTests.dll diff --git a/build.cmd b/build.cmd index 277cee2fb0..7ae0c12403 100644 --- a/build.cmd +++ b/build.cmd @@ -938,6 +938,7 @@ set HOSTED_COMPILER=1 if "%TEST_NET40_FSHARPQA_SUITE%" == "1" ( + set CSC_PIPE=%~dp0packages\Microsoft.Net.Compilers.2.7.0\tools\csc.exe set FSC=!FSCBINPATH!\fsc.exe set FSCOREDLLPATH=!FSCBinPath!\FSharp.Core.dll set PATH=!FSCBINPATH!;!PATH! diff --git a/tests/fsharp/packages.config b/tests/fsharp/packages.config index 4715cb922c..1d5c24f97f 100644 --- a/tests/fsharp/packages.config +++ b/tests/fsharp/packages.config @@ -1,6 +1,6 @@  - + diff --git a/tests/fsharp/test-framework.fs b/tests/fsharp/test-framework.fs index e356652dc2..279a98f12b 100644 --- a/tests/fsharp/test-framework.fs +++ b/tests/fsharp/test-framework.fs @@ -155,7 +155,7 @@ let config configurationName envVars = let fsi_flags = "-r:System.Core.dll --nowarn:20 --define:INTERACTIVE --maxerrors:1 --abortonerror" let Is64BitOperatingSystem = WindowsPlatform.Is64BitOperatingSystem envVars let architectureMoniker = if Is64BitOperatingSystem then "x64" else "x86" - let CSC = requireFile (packagesDir ++ "Microsoft.Net.Compilers.2.4.0" ++ "tools" ++ "csc.exe") + let CSC = requireFile (packagesDir ++ "Microsoft.Net.Compilers.2.7.0" ++ "tools" ++ "csc.exe") let ILDASM = requireFile (packagesDir ++ ("runtime.win-" + architectureMoniker + ".Microsoft.NETCore.ILDAsm.2.0.3") ++ "runtimes" ++ ("win-" + architectureMoniker) ++ "native" ++ "ildasm.exe") let coreclrdll = requireFile (packagesDir ++ ("runtime.win-" + architectureMoniker + ".Microsoft.NETCore.Runtime.CoreCLR.2.0.3") ++ "runtimes" ++ ("win-" + architectureMoniker) ++ "native" ++ "coreclr.dll") let PEVERIFY = requireFile (SCRIPT_ROOT ++ ".." ++ "fsharpqa" ++ "testenv" ++ "src" ++ "PEVerify" ++ "bin" ++ configurationName ++ "net46" ++ "PEVerify.exe") diff --git a/tests/fsharpqa/Source/Import/AccessibilityTests.cs b/tests/fsharpqa/Source/Import/AccessibilityTests.cs index e3df6a9fb7..1a8ac727bc 100644 --- a/tests/fsharpqa/Source/Import/AccessibilityTests.cs +++ b/tests/fsharpqa/Source/Import/AccessibilityTests.cs @@ -10,9 +10,7 @@ public class Accessibility private int Private { get; set; } protected int Protected { get; set; } internal int Internal { get; set; } - // Note: accessibility was modified using dnspy - public int FamOrAssembly { get; set; } - // Note: accessibility was modified using dnspy - public int FamAndAssembly { get; set; } + protected internal int FamOrAssembly { get; set; } + private protected int FamAndAssembly { get; set; } } diff --git a/tests/fsharpqa/Source/Import/AccessibilityTests.dll b/tests/fsharpqa/Source/Import/AccessibilityTests.dll deleted file mode 100644 index 0e01f245a7d15069221ccb8c6cc4561078833f20..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4608 zcmeHKPiz!r6#vcacDpT

U5LmVrWOMAw=&Q6qtEDV3T+8(ND0VmrGXm(kgoW@cJi zL{m^n3?7W}z`+DP7%v(<7$qhe^y0yoc+jH>2X7v{7)^{3fA7s~w_8wyHw|C;e)Hb% z{rTSa=9``2@MEtc10c(J^(t_QR~bdczlUX-H*EW413ql|diy0~^y}@DC)~)I3xi5% zSFN(``$24#94nmnE!Ve(#wM(4FzXcB+FEy}smBijqecc>9v^wMw%Qf!*uKu_1zO4E z61LF8tHoL51U9N{CUpxT_3KzBl9!P|@g;GUfAwps3dQm5Zs52GMc|t>PSlk#1FT$VS%`M7mfA9WS7xnr7%D zxpd#WrlSZ9*5ulCqx6+SYBSM<%NDSy88C$W7o*F3mZ8}@cbJ*yR3O1p5<&$MJa7r2 z0ts#^AygpIR3lU%!DEnkq(TpCY{i`zoOpQ9NUN2-FZ36B3w^zP_dX!SXE8(E%w@Wt z2Nrq#nKg7z#G&g~BJuE;PukS|(6NyrUQbiMAo`#elz5fF5aal*ZyGJ4{I;tPok@R0 zr%jJ&TY6<#xPw#r$5eVhM3yO-TywY|`)U8xxXsMrK2z|R>6#rl&4f9eSLPkXFUaTc zJy9}j7SKEf>)uYeDbY8I@mVhEH6FF5*^<5<9S4`NvRHpMex5YDQ%{MPZgzK9iy_Z>s#3uJV@3 zmlZ!xQGBkb3`1(L6pM;8ipz>7cMZI4+)jK~@k7PW6u(sbjwpT^PLn88&P0|dPjoZo z9MR-#p`0h0oa-pJ5=~Ay59^89WiHe(eqaH7C|8DodlGq|Ty~FHJg892I6g z4|@*>v-6&_4-IxyqjC^>ZV6+hr=4<)iKQrZs@OX|U-I1YzGtSV2kr7Rd?<%q$D1V| zx(jyfT+a~1OyJC3YZ~!mC-iOaTFbCq9SaAd$f=gRrR$mp{Mo;>SDbh{sS{CMT(G@) z2Wm@dO^m6W@M)>3rKX9kR;!v;6tOhas^&%}^;uPL&1p4ND91sFwCc2(7!PYDtgP6W zo7(Cm4YyElF%AUPIoGpeH}H=-p1r72G!XL#wKN|)>3uC6o%dt6>J$=pC!BD?1()Xq zsX=&#CWogUJ>-<;D;2xsIdv{MDTN`|uJ}O|yX6Rp8xIT58gte*6HU21kDfCb)T3(! zJmmOJ$OAQ7Hziq|a4-x`MvZG;W15H=i|YG(9^PtSIP}KZTRJvv%^gMl<5N#eZRx-A zvYE?gEabD6VTfR4dXUe{qb8$Ee)T8K&f}pycO>u+E|#4+Y2f4uS=ne}Q2VX)ZkA^q zl4C=MfemYJ25vFX)_A*+l?aXB#rT!+`|cGHUGjdn>iTM__U>QJ0n-P9aLDrx+peEH zwvMAuws>9L#awH?DjK72YX9X9$Tx+4V=OoBLQXKy3%=?aMsn!n+wqYi5Sw*lZ1z)` z!UU#?2XU0r2*z-P`Ur8DvW!o&Km8%^_O)YwO31rsRa#|-hz7IT2${!)2ZuR*JcU5* zJN1ng%(1kF1R3Tv zA7|cxRn4>Zm}@n5p}v3V1^8_&JsaRoB6?Q2OOF*>{}{*6o8v}1U?u-Y>An9(18@5O HA3E?S>u)os diff --git a/tests/fsharpqa/Source/Import/env.lst b/tests/fsharpqa/Source/Import/env.lst index 792c23a3ac..7e9100030a 100644 --- a/tests/fsharpqa/Source/Import/env.lst +++ b/tests/fsharpqa/Source/Import/env.lst @@ -83,11 +83,11 @@ NOMONO SOURCE=reference2.fsx SCFLAGS="--nologo -r:reference1.dll" PRECMD="\$FSC_ ### ### F# can consume FamOrAssembly and FamAndAssembly in combination with IVT ### - SOURCE=FamAndAssembly.fs SCFLAGS="-a -r:AccessibilityTests.dll" # FamAndAssembly.fs + SOURCE=FamAndAssembly.fs SCFLAGS="-a -r:AccessibilityTests.dll" PRECMD="\$CSC_PIPE /debug /target:library /langversion:latest AccessibilityTests.cs" # FamAndAssembly.fs ### See issue https://github.com/Microsoft/visualfsharp/issues/2496 - ### SOURCE=FamOrAssembly.fs SCFLAGS="-a -r:AccessibilityTests.dll" # FamOrAssembly.fs - SOURCE=FamAndAssembly_NoIVT.fs SCFLAGS="-a -r:AccessibilityTests.dll" # FamAndAssembly_NoIVT.fs - ### SOURCE=FamOrAssembly_NoIVT.fs SCFLAGS="-a -r:AccessibilityTests.dll" # FamOrAssembly_NoIVT.fs + ### SOURCE=FamOrAssembly.fs SCFLAGS="-a -r:AccessibilityTests.dll" PRECMD="\$CSC_PIPE /debug /target:library /langversion:latest AccessibilityTests.cs" # FamOrAssembly.fs + SOURCE=FamAndAssembly_NoIVT.fs SCFLAGS="-a -r:AccessibilityTests.dll" PRECMD="\$CSC_PIPE /debug /target:library /langversion:latest AccessibilityTests.cs" # FamAndAssembly_NoIVT.fs + ### SOURCE=FamOrAssembly_NoIVT.fs SCFLAGS="-a -r:AccessibilityTests.dll" PRECMD="\$CSC_PIPE /debug /target:library /langversion:latest AccessibilityTests.cs" # FamOrAssembly_NoIVT.fs ### ### Iterate over BCL collections @@ -100,4 +100,4 @@ NOMONO SOURCE=reference2.fsx SCFLAGS="--nologo -r:reference1.dll" PRECMD="\$FSC_ SOURCE=ReferenceExe01.fsx PRECMD="\$FSC_PIPE ReferenceExe.fs" # ReferenceExe01.fsx - SOURCE=LineDirectiveFromCSharp.fs PRECMD="\$CSC_PIPE /t:library LineDirectiveLib.cs" SCFLAGS="-r:LineDirectiveLib.dll" # LineDirectiveFromCSharp.fs \ No newline at end of file + SOURCE=LineDirectiveFromCSharp.fs PRECMD="\$CSC_PIPE /t:library LineDirectiveLib.cs" SCFLAGS="-r:LineDirectiveLib.dll" # LineDirectiveFromCSharp.fs From c769fecb99ba347c4fb0d4af3b2a5e9e6717f37f Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Thu, 15 Mar 2018 16:44:01 -0700 Subject: [PATCH 124/147] Revert code lens .... it's being stabilized in the branch 15.8 (#4547) * Revert "remove comment (#4538)" This reverts commit 4dce3d167f744ffd40da6d62313b1e7c454e1d0f. * Revert "Code Lens and Line Lens (#3608)" This reverts commit 8f8cbd64a4cd778164afc0de7552b0ad93757ce0. --- src/fsharp/NicePrint.fs | 1 - src/fsharp/service/service.fs | 11 - src/fsharp/service/service.fsi | 3 - src/fsharp/symbols/Symbols.fs | 23 +- src/fsharp/symbols/Symbols.fsi | 6 - .../AbstractCodeLensDisplayService.fs | 273 ------------- .../CodeLens/CodeLensGeneralTagger.fs | 153 ------- .../CodeLens/CodeLensProvider.fs | 109 ----- .../CodeLens/FSharpCodeLensService.fs | 385 ------------------ .../CodeLens/LineLensDisplayService.fs | 67 --- .../src/FSharp.Editor/Common/Constants.fs | 4 - .../src/FSharp.Editor/Common/RoslynHelpers.fs | 11 - .../src/FSharp.Editor/FSharp.Editor.fsproj | 5 - .../LanguageService/LanguageService.fs | 1 - .../FSharp.Editor/Options/EditorOptions.fs | 22 +- .../src/FSharp.Editor/Options/UIHelpers.fs | 2 +- .../CodeLensOptionControl.xaml | 45 -- .../CodeLensOptionControl.xaml.cs | 28 -- .../FSharp.UIResources.csproj | 2 +- .../FSharp.UIResources/Strings.Designer.cs | 45 -- .../src/FSharp.UIResources/Strings.resx | 16 +- .../src/FSharp.UIResources/xlf/Strings.cs.xlf | 25 -- .../src/FSharp.UIResources/xlf/Strings.de.xlf | 25 -- .../src/FSharp.UIResources/xlf/Strings.en.xlf | 25 -- .../src/FSharp.UIResources/xlf/Strings.es.xlf | 25 -- .../src/FSharp.UIResources/xlf/Strings.fr.xlf | 25 -- .../src/FSharp.UIResources/xlf/Strings.it.xlf | 25 -- .../src/FSharp.UIResources/xlf/Strings.ja.xlf | 25 -- .../src/FSharp.UIResources/xlf/Strings.ko.xlf | 25 -- .../src/FSharp.UIResources/xlf/Strings.pl.xlf | 25 -- .../FSharp.UIResources/xlf/Strings.pt-BR.xlf | 25 -- .../src/FSharp.UIResources/xlf/Strings.ru.xlf | 25 -- .../src/FSharp.UIResources/xlf/Strings.tr.xlf | 25 -- .../xlf/Strings.zh-Hans.xlf | 25 -- .../xlf/Strings.zh-Hant.xlf | 25 -- 35 files changed, 6 insertions(+), 1556 deletions(-) delete mode 100644 vsintegration/src/FSharp.Editor/CodeLens/AbstractCodeLensDisplayService.fs delete mode 100644 vsintegration/src/FSharp.Editor/CodeLens/CodeLensGeneralTagger.fs delete mode 100644 vsintegration/src/FSharp.Editor/CodeLens/CodeLensProvider.fs delete mode 100644 vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs delete mode 100644 vsintegration/src/FSharp.Editor/CodeLens/LineLensDisplayService.fs delete mode 100644 vsintegration/src/FSharp.UIResources/CodeLensOptionControl.xaml delete mode 100644 vsintegration/src/FSharp.UIResources/CodeLensOptionControl.xaml.cs diff --git a/src/fsharp/NicePrint.fs b/src/fsharp/NicePrint.fs index 195c373f73..d311665060 100755 --- a/src/fsharp/NicePrint.fs +++ b/src/fsharp/NicePrint.fs @@ -1970,7 +1970,6 @@ let isGeneratedExceptionField pos f = TastDefinitionPrinting.isGeneratedExce let stringOfTyparConstraint denv tpc = stringOfTyparConstraints denv [tpc] let stringOfTy denv x = x |> PrintTypes.layoutType denv |> showL let prettyLayoutOfType denv x = x |> PrintTypes.prettyLayoutOfType denv -let prettyLayoutOfTypeNoCx denv x = x |> PrintTypes.prettyLayoutOfTypeNoConstraints denv let prettyStringOfTy denv x = x |> PrintTypes.prettyLayoutOfType denv |> showL let prettyStringOfTyNoCx denv x = x |> PrintTypes.prettyLayoutOfTypeNoConstraints denv |> showL let stringOfRecdField denv x = x |> TastDefinitionPrinting.layoutRecdField false denv |> showL diff --git a/src/fsharp/service/service.fs b/src/fsharp/service/service.fs index 3ed5f832a0..38e95e816d 100644 --- a/src/fsharp/service/service.fs +++ b/src/fsharp/service/service.fs @@ -908,9 +908,6 @@ type TypeCheckInfo match item with | Item.Types _ | Item.ModuleOrNamespaces _ -> true | _ -> false - - /// Find the most precise display context for the given line and column. - member __.GetBestDisplayEnvForPos cursorPos = GetBestEnvForPos cursorPos member __.GetVisibleNamespacesAndModulesAtPosition(cursorPos: pos) : ModuleOrNamespaceRef list = let (nenv, ad), m = GetBestEnvForPos cursorPos @@ -1985,7 +1982,6 @@ type FSharpCheckFileResults(filename: string, errors: FSharpErrorInfo[], scopeOp | _ -> async.Return dflt - member info.GetToolTipText(line, colAtEndOfNames, lineStr, names, tokenTag, userOpName) = info.GetStructuredToolTipText(line, colAtEndOfNames, lineStr, names, tokenTag, ?userOpName=userOpName) |> Tooltips.Map Tooltips.ToFSharpToolTipText @@ -2097,13 +2093,6 @@ type FSharpCheckFileResults(filename: string, errors: FSharpErrorInfo[], scopeOp RequireCompilationThread ctok scope.IsRelativeNameResolvableFromSymbol(pos, plid, symbol)) - member info.GetDisplayEnvForPos(pos: pos) : Async = - let userOpName = "CodeLens" - reactorOp userOpName "GetDisplayContextAtPos" None (fun ctok scope -> - DoesNotRequireCompilerThreadTokenAndCouldPossiblyBeMadeConcurrent ctok - let (nenv, _), _ = scope.GetBestDisplayEnvForPos pos - Some nenv.DisplayEnv) - member info.ImplementationFiles = if not keepAssemblyContents then invalidOp "The 'keepAssemblyContents' flag must be set to true on the FSharpChecker in order to access the checked contents of assemblies" scopeOptX diff --git a/src/fsharp/service/service.fsi b/src/fsharp/service/service.fsi index df75679414..82a1a563ea 100755 --- a/src/fsharp/service/service.fsi +++ b/src/fsharp/service/service.fsi @@ -242,9 +242,6 @@ type public FSharpCheckFileResults = member internal GetVisibleNamespacesAndModulesAtPoint : pos -> Async - /// Find the most precise display environment for the given line and column. - member internal GetDisplayEnvForPos : pos : pos -> Async - /// Determines if a long ident is resolvable at a specific point. /// An optional string used for tracing compiler operations associated with this request. member internal IsRelativeNameResolvable: cursorPos : pos * plid : string list * item: Item * ?userOpName: string -> Async diff --git a/src/fsharp/symbols/Symbols.fs b/src/fsharp/symbols/Symbols.fs index 944c4d8b69..74aa51c9e2 100644 --- a/src/fsharp/symbols/Symbols.fs +++ b/src/fsharp/symbols/Symbols.fs @@ -1844,23 +1844,6 @@ and FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) = prefix + x.LogicalName with _ -> "??" - member x.FormatLayout (denv:FSharpDisplayContext) = - match x.IsMember, d with - | true, V v -> - NicePrint.prettyLayoutOfValOrMemberNoInst { (denv.Contents cenv.g) with showMemberContainers=true } v.Deref - | _,_ -> - checkIsResolved() - let ty = - match d with - | E e -> e.GetDelegateType(cenv.amap, range0) - | P p -> p.GetPropertyType(cenv.amap, range0) - | M m | C m -> - let rty = m.GetFSharpReturnTy(cenv.amap, range0, m.FormalMethodInst) - let argtysl = m.GetParamTypes(cenv.amap, range0, m.FormalMethodInst) - mkIteratedFunTy (List.map (mkRefTupledTy cenv.g) argtysl) rty - | V v -> v.TauType - NicePrint.prettyLayoutOfTypeNoCx (denv.Contents cenv.g) ty - and FSharpType(cenv, typ:TType) = @@ -2006,11 +1989,7 @@ and FSharpType(cenv, typ:TType) = member x.Format(denv: FSharpDisplayContext) = protect <| fun () -> - NicePrint.prettyStringOfTyNoCx (denv.Contents cenv.g) typ - - member x.FormatLayout(denv: FSharpDisplayContext) = - protect <| fun () -> - NicePrint.prettyLayoutOfTypeNoCx (denv.Contents cenv.g) typ + NicePrint.prettyStringOfTyNoCx (denv.Contents cenv.g) typ override x.ToString() = protect <| fun () -> diff --git a/src/fsharp/symbols/Symbols.fsi b/src/fsharp/symbols/Symbols.fsi index 34b3e15610..55c1a6fbb2 100644 --- a/src/fsharp/symbols/Symbols.fsi +++ b/src/fsharp/symbols/Symbols.fsi @@ -819,9 +819,6 @@ and [] public FSharpMemberOrFunctionOrValue = /// Indicates if this is a constructor. member IsConstructor : bool - - /// Format the type using the rules of the given display context - member FormatLayout : context: FSharpDisplayContext -> Layout /// A subtype of FSharpSymbol that represents a parameter @@ -934,9 +931,6 @@ and [] public FSharpType = /// Format the type using the rules of the given display context member Format : context: FSharpDisplayContext -> string - /// Format the type using the rules of the given display context - member FormatLayout : context: FSharpDisplayContext -> Layout - /// Instantiate generic type parameters in a type member Instantiate : (FSharpGenericParameter * FSharpType) list -> FSharpType diff --git a/vsintegration/src/FSharp.Editor/CodeLens/AbstractCodeLensDisplayService.fs b/vsintegration/src/FSharp.Editor/CodeLens/AbstractCodeLensDisplayService.fs deleted file mode 100644 index df364bb876..0000000000 --- a/vsintegration/src/FSharp.Editor/CodeLens/AbstractCodeLensDisplayService.fs +++ /dev/null @@ -1,273 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -namespace rec Microsoft.VisualStudio.FSharp.Editor - -open System -open System.Windows.Controls -open Microsoft.VisualStudio.Text -open Microsoft.VisualStudio.Text.Editor -open Microsoft.VisualStudio.Text.Formatting -open System.Threading -open System.Windows -open System.Collections.Generic - -open Microsoft.VisualStudio.FSharp.Editor.Logging - -[] -type CodeLensDisplayService (view : IWpfTextView, buffer : ITextBuffer, layerName) as self = - - // Add buffer changed event handler - do ( - buffer.Changed.Add self.handleBufferChanged - view.LayoutChanged.Add self.handleLayoutChanged - ) - - ///

- /// Enqueing an unit signals to the tagger that all visible line lens must be layouted again, - /// to respect single line changes. - /// - member val RelayoutRequested : Queue<_> = Queue() with get - - member val WpfView = view - - member val TextBuffer = buffer - - /// Saves the ui context to switch context for ui related work. - member val uiContext = SynchronizationContext.Current - - // Tracks the created ui elements per TrackingSpan - member val uiElements = Dictionary<_,Grid>() - - member val trackingSpanUiParent = HashSet() - - member val uiElementNeighbour = Dictionary() - - /// Caches the current used trackingSpans per line. One line can contain multiple trackingSpans - member val trackingSpans = Dictionary>() - /// Text view for accessing the adornment layer. - member val view: IWpfTextView = view - /// The code lens layer for adding and removing adornments. - member val codeLensLayer = view.GetAdornmentLayer layerName - /// Tracks the recent first + last visible line numbers for adornment layout logic. - member val recentFirstVsblLineNmbr = 0 with get, set - - member val recentLastVsblLineNmbr = 0 with get, set - /// Tracks the adornments on the layer. - member val addedAdornments = HashSet() - /// Cancellation token source for the layout changed event. Needed to abort previous async-work. - member val layoutChangedCts = new CancellationTokenSource() with get, set - - /// Tracks the last used buffer snapshot, should be preferred used in combination with mutex. - member val currentBufferSnapshot = null with get, set - - /// Helper method which returns the start line number of a tracking span - member __.getTrackingSpanStartLine (snapshot:ITextSnapshot) (trackingSpan:ITrackingSpan) = - snapshot.GetLineNumberFromPosition(trackingSpan.GetStartPoint(snapshot).Position) - - /// Helper method which returns the start line number of a tracking span - member __.tryGetTSpanStartLine (snapshot:ITextSnapshot) (trackingSpan:ITrackingSpan) = - let pos = trackingSpan.GetStartPoint(snapshot).Position - if snapshot.Length - 1 < pos then None - else pos |> snapshot.GetLineNumberFromPosition |> Some - - member self.updateTrackingSpansFast (snapshot:ITextSnapshot) lineNumber = - if lineNumber |> self.trackingSpans.ContainsKey then - let currentTrackingSpans = self.trackingSpans.[lineNumber] |> ResizeArray // We need a copy because we modify the list. - for trackingSpan in currentTrackingSpans do - let newLineOption = self.tryGetTSpanStartLine snapshot trackingSpan - match newLineOption with - | None -> () - | Some newLine -> - if newLine <> lineNumber then - // We're on a new line and need to check whether we're currently in another grid - // (because somehow there were multiple trackingSpans per line). - if self.trackingSpanUiParent.Contains trackingSpan then - self.trackingSpanUiParent.Remove trackingSpan |> ignore - self.uiElementNeighbour.Remove self.uiElements.[trackingSpan] |> ignore - // remove our entry in the line cache dictionary - self.trackingSpans.[lineNumber].Remove(trackingSpan) |> ignore - // if the cache entry for the old line is now empty remove it completely - if self.trackingSpans.[lineNumber].Count = 0 then - self.trackingSpans.Remove lineNumber |> ignore - // now re-register our tracking span in the cache dict. - // Check whether the new line has no existing entry to add a fresh one. - // If there is already one we put our grid into the grid of the first entry of the line. - if newLine |> self.trackingSpans.ContainsKey |> not then - self.trackingSpans.[newLine] <- ResizeArray() - else - let neighbour = - self.uiElements.[self.trackingSpans.[newLine] |> Seq.last] // This fails if a tracking span has no ui element! - self.uiElementNeighbour.[self.uiElements.[trackingSpan]] <- neighbour - self.trackingSpanUiParent.Add trackingSpan |> ignore - // And finally add us to the cache again. - self.trackingSpans.[newLine].Add(trackingSpan) - // Be sure that the uiElement of the trackingSpan is visible if the new line is in the visible line space. - if newLine < self.recentFirstVsblLineNmbr || newLine > self.recentLastVsblLineNmbr then - if self.uiElements.ContainsKey trackingSpan then - let mutable element = self.uiElements.[trackingSpan] - element.Visibility <- Visibility.Hidden - - member __.createDefaultStackPanel () = - let grid = Grid(Visibility = Visibility.Hidden) - Canvas.SetLeft(grid, 0.) - Canvas.SetTop(grid, 0.) - grid - - /// Helper methods which invokes every action which is needed for new trackingSpans - member self.addTrackingSpan (trackingSpan:ITrackingSpan)= - let snapshot = buffer.CurrentSnapshot - let startLineNumber = snapshot.GetLineNumberFromPosition(trackingSpan.GetStartPoint(snapshot).Position) - let uiElement = - if self.uiElements.ContainsKey trackingSpan then - logErrorf "Added a tracking span twice, this is not allowed and will result in invalid values! %A" (trackingSpan.GetText snapshot) - self.uiElements.[trackingSpan] - else - let defaultStackPanel = self.createDefaultStackPanel() - self.uiElements.[trackingSpan] <- defaultStackPanel - defaultStackPanel - if self.trackingSpans.ContainsKey startLineNumber then - self.trackingSpans.[startLineNumber].Add trackingSpan - let neighbour = - self.uiElements.[self.trackingSpans.[startLineNumber] |> Seq.last] // This fails if a tracking span has no ui element! - self.uiElementNeighbour.[uiElement] <- neighbour - self.trackingSpanUiParent.Add trackingSpan |> ignore - else - self.trackingSpans.[startLineNumber] <- ResizeArray() - self.trackingSpans.[startLineNumber].Add trackingSpan - uiElement - - - member self.handleBufferChanged(e:TextContentChangedEventArgs) = - try - let oldSnapshot = e.Before - let snapshot = e.After - self.currentBufferSnapshot <- snapshot - for line in oldSnapshot.Lines do - let lineNumber = line.LineNumber - self.updateTrackingSpansFast snapshot lineNumber - let firstLine = view.TextViewLines.FirstVisibleLine - view.DisplayTextLineContainingBufferPosition (firstLine.Start, 0., ViewRelativePosition.Top) - self.RelayoutRequested.Enqueue(()) - with e -> logErrorf "Error in line lens provider: %A" e - - /// Public non-thread-safe method to add line lens for a given tracking span. - /// Returns an UIElement which can be used to add Ui elements and to remove the line lens later. - - member self.AddCodeLens (trackingSpan:ITrackingSpan) = - if trackingSpan.TextBuffer <> buffer then failwith "TrackingSpan text buffer does not equal with CodeLens text buffer" - let Grid = self.addTrackingSpan trackingSpan - self.RelayoutRequested.Enqueue(()) - Grid :> UIElement - - /// Public non-thread-safe method to remove line lens for a given tracking span. - member self.RemoveCodeLens (trackingSpan:ITrackingSpan) = - if self.uiElements.ContainsKey trackingSpan then - let Grid = self.uiElements.[trackingSpan] - Grid.Children.Clear() - self.uiElements.Remove trackingSpan |> ignore - try - self.codeLensLayer.RemoveAdornment(Grid) - with e -> - logExceptionWithContext(e, "Removing line lens") - else - logWarningf "No ui element is attached to this tracking span!" - let lineNumber = - (trackingSpan.GetStartPoint self.currentBufferSnapshot).Position - |> self.currentBufferSnapshot.GetLineNumberFromPosition - if self.trackingSpans.ContainsKey lineNumber then - if self.trackingSpans.[lineNumber].Remove trackingSpan |> not then - logWarningf "No tracking span is accociated with this line number %d!" lineNumber - if self.trackingSpans.[lineNumber].Count = 0 then - self.trackingSpans.Remove lineNumber |> ignore - else - logWarningf "No tracking span is accociated with this line number %d!" lineNumber - - abstract member AddUiElementToCodeLens : ITrackingSpan * UIElement -> unit - default self.AddUiElementToCodeLens (trackingSpan:ITrackingSpan, uiElement:UIElement) = - let Grid = self.uiElements.[trackingSpan] - Grid.Children.Add uiElement |> ignore - - abstract member AddUiElementToCodeLensOnce : ITrackingSpan * UIElement -> unit - default self.AddUiElementToCodeLensOnce (trackingSpan:ITrackingSpan, uiElement:UIElement)= - let Grid = self.uiElements.[trackingSpan] - if uiElement |> Grid.Children.Contains |> not then - self.AddUiElementToCodeLens (trackingSpan, uiElement) - - abstract member RemoveUiElementFromCodeLens : ITrackingSpan * UIElement -> unit - default self.RemoveUiElementFromCodeLens (trackingSpan:ITrackingSpan, uiElement:UIElement) = - let Grid = self.uiElements.[trackingSpan] - Grid.Children.Remove(uiElement) |> ignore - - member self.handleLayoutChanged (e:TextViewLayoutChangedEventArgs) = - try - let buffer = e.NewSnapshot - let recentVisibleLineNumbers = Set [self.recentFirstVsblLineNmbr .. self.recentLastVsblLineNmbr] - let firstVisibleLineNumber, lastVisibleLineNumber = - let first, last = - view.TextViewLines.FirstVisibleLine, - view.TextViewLines.LastVisibleLine - buffer.GetLineNumberFromPosition(first.Start.Position), - buffer.GetLineNumberFromPosition(last.Start.Position) - let visibleLineNumbers = Set [firstVisibleLineNumber .. lastVisibleLineNumber] - let nonVisibleLineNumbers = Set.difference recentVisibleLineNumbers visibleLineNumbers - let newVisibleLineNumbers = Set.difference visibleLineNumbers recentVisibleLineNumbers - - let applyFuncOnLineStackPanels (line:IWpfTextViewLine) (func:Grid -> unit) = - let lineNumber = line.Snapshot.GetLineNumberFromPosition(line.Start.Position) - if (self.trackingSpans.ContainsKey lineNumber) && (self.trackingSpans.[lineNumber]) |> (Seq.isEmpty >> not) then - for trackingSpan in self.trackingSpans.[lineNumber] do - let success, ui = self.uiElements.TryGetValue trackingSpan - if success then - func ui - - if nonVisibleLineNumbers.Count > 0 || newVisibleLineNumbers.Count > 0 then - for lineNumber in nonVisibleLineNumbers do - if lineNumber > 0 && lineNumber < buffer.LineCount then - try - let line = - (buffer.GetLineFromLineNumber lineNumber).Start - |> view.GetTextViewLineContainingBufferPosition - applyFuncOnLineStackPanels line (fun ui -> - ui.Visibility <- Visibility.Hidden - ) - with e -> logErrorf "Error in non visible lines iteration %A" e - for lineNumber in newVisibleLineNumbers do - try - let line = - (buffer.GetLineFromLineNumber lineNumber).Start - |> view.GetTextViewLineContainingBufferPosition - applyFuncOnLineStackPanels line (fun ui -> - ui.Visibility <- Visibility.Visible - self.layoutUIElementOnLine view line ui - ) - with e -> logErrorf "Error in new visible lines iteration %A" e - if not e.VerticalTranslation && e.NewViewState.ViewportHeight <> e.OldViewState.ViewportHeight then - self.RelayoutRequested.Enqueue() // Unfortunately zooming requires a relayout too, to ensure that no weird layout happens due to unkown reasons. - if self.RelayoutRequested.Count > 0 then - self.RelayoutRequested.Dequeue() |> ignore - for lineNumber in visibleLineNumbers do - let line = - (buffer.GetLineFromLineNumber lineNumber).Start - |> view.GetTextViewLineContainingBufferPosition - applyFuncOnLineStackPanels line (fun ui -> - ui.Visibility <- Visibility.Visible - self.layoutUIElementOnLine view line ui - ) - // Save the new first and last visible lines for tracking - self.recentFirstVsblLineNmbr <- firstVisibleLineNumber - self.recentLastVsblLineNmbr <- lastVisibleLineNumber - // We can cancel existing stuff because the algorithm supports abortion without any data loss - self.layoutChangedCts.Cancel() - self.layoutChangedCts.Dispose() - self.layoutChangedCts <- new CancellationTokenSource() - - self.asyncCustomLayoutOperation visibleLineNumbers buffer - |> RoslynHelpers.StartAsyncSafe self.layoutChangedCts.Token - with e -> logExceptionWithContext (e, "Layout changed") - - abstract layoutUIElementOnLine : IWpfTextView -> ITextViewLine -> Grid -> unit - - abstract asyncCustomLayoutOperation : int Set -> ITextSnapshot -> unit Async - - - diff --git a/vsintegration/src/FSharp.Editor/CodeLens/CodeLensGeneralTagger.fs b/vsintegration/src/FSharp.Editor/CodeLens/CodeLensGeneralTagger.fs deleted file mode 100644 index 3d3a2a61f5..0000000000 --- a/vsintegration/src/FSharp.Editor/CodeLens/CodeLensGeneralTagger.fs +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -namespace rec Microsoft.VisualStudio.FSharp.Editor - -open System -open System.Windows.Controls -open Microsoft.VisualStudio.Text -open Microsoft.VisualStudio.Text.Editor -open Microsoft.VisualStudio.Text.Formatting -open System.Windows -open System.Collections.Generic -open Microsoft.VisualStudio.Text.Tagging - -open Microsoft.VisualStudio.FSharp.Editor.Logging - -type CodeLensGeneralTag(width, topSpace, baseline, textHeight, bottomSpace, affinity, tag:obj, providerTag:obj) = - inherit SpaceNegotiatingAdornmentTag(width, topSpace, baseline, textHeight, bottomSpace, affinity, tag, providerTag) - -/// Class which provides support for general code lens -/// Use the methods AddCodeLens and RemoveCodeLens -type CodeLensGeneralTagger (view, buffer) as self = - inherit CodeLensDisplayService(view, buffer, "CodeLens") - - /// The tags changed event to notify if the data for the tags has changed. - let tagsChangedEvent = new Event,SnapshotSpanEventArgs>() - - /// Layouts all stack panels on the line - override self.layoutUIElementOnLine (view:IWpfTextView) (line:ITextViewLine) (ui:Grid) = - let left, top = - match self.uiElementNeighbour.TryGetValue ui with - | true, parent -> - let left = Canvas.GetLeft parent - let top = Canvas.GetTop parent - let width = parent.ActualWidth - logInfof "Width of parent: %.4f" width - left + width, top - | _ -> - try - // Get the real offset so that the code lens are placed respectively to their content - let offset = - [0..line.Length - 1] |> Seq.tryFind (fun i -> not (Char.IsWhiteSpace (line.Start.Add(i).GetChar()))) - |> Option.defaultValue 0 - - let realStart = line.Start.Add(offset) - let g = view.TextViewLines.GetCharacterBounds(realStart) - // WORKAROUND VS BUG, left cannot be zero if the offset is creater than zero! - // Calling the method twice fixes this bug and ensures that all values are correct. - // Okay not really :( Must be replaced later with an own calculation depending on editor font settings! - if 7 * offset > int g.Left then - logErrorf "Incorrect return from geometry measure" - Canvas.GetLeft ui, g.Top - else - g.Left, g.Top - with e -> - logExceptionWithContext (e, "Error in layout ui element on line") - Canvas.GetLeft ui, Canvas.GetTop ui - Canvas.SetLeft(ui, left) - Canvas.SetTop(ui, top) - - override self.asyncCustomLayoutOperation _ _ = - asyncMaybe { - // Suspend 16 ms, instantly applying the layout to the adornment elements isn't needed - // and would consume too much performance - do! Async.Sleep(16) |> liftAsync // Skip at least one frames - do! Async.SwitchToContext self.uiContext |> liftAsync - let layer = self.codeLensLayer - - do! Async.Sleep(495) |> liftAsync - - // WORKAROUND FOR VS BUG - // The layout changed event may not provide us all real changed lines so - // we take care of this on our own. - let visibleSpan = - let first, last = - view.TextViewLines.FirstVisibleLine, - view.TextViewLines.LastVisibleLine - SnapshotSpan(first.Start, last.End) - let customVisibleLines = view.TextViewLines.GetTextViewLinesIntersectingSpan visibleSpan - let isLineVisible (line:ITextViewLine) = line.IsValid - let linesToProcess = customVisibleLines |> Seq.filter isLineVisible - - for line in linesToProcess do - try - match line.GetAdornmentTags self |> Seq.tryHead with - | Some (:? seq as stackPanels) -> - for stackPanel in stackPanels do - if stackPanel |> self.addedAdornments.Contains |> not then - layer.AddAdornment(AdornmentPositioningBehavior.OwnerControlled, Nullable(), - self, stackPanel, AdornmentRemovedCallback(fun _ _ -> ())) |> ignore - self.addedAdornments.Add stackPanel |> ignore - | _ -> () - with e -> logExceptionWithContext (e, "LayoutChanged, processing new visible lines") - } |> Async.Ignore - - override self.AddUiElementToCodeLens (trackingSpan:ITrackingSpan, uiElement:UIElement)= - base.AddUiElementToCodeLens (trackingSpan, uiElement) // We do the same as the base call execpt that we need to notify that the tag needs to be refreshed. - tagsChangedEvent.Trigger(self, SnapshotSpanEventArgs(trackingSpan.GetSpan(buffer.CurrentSnapshot))) - - override self.RemoveUiElementFromCodeLens (trackingSpan:ITrackingSpan, uiElement:UIElement) = - base.RemoveUiElementFromCodeLens (trackingSpan, uiElement) - tagsChangedEvent.Trigger(self, SnapshotSpanEventArgs(trackingSpan.GetSpan(buffer.CurrentSnapshot))) // Need to refresh the tag. - - interface ITagger with - [] - override __.TagsChanged = tagsChangedEvent.Publish - - /// Returns the tags which reserve the correct space for adornments - /// Notice, it's asumed that the data in the collection is valid. - override __.GetTags spans = - try - seq { - for span in spans do - let snapshot = span.Snapshot - let lineNumber = - try - snapshot.GetLineNumberFromPosition(span.Start.Position) - with e -> logExceptionWithContext (e, "line number tagging"); 0 - if self.trackingSpans.ContainsKey(lineNumber) && self.trackingSpans.[lineNumber] |> Seq.isEmpty |> not then - - let tagSpan = snapshot.GetLineFromLineNumber(lineNumber).Extent - let stackPanels = - self.trackingSpans.[lineNumber] - |> Seq.map (fun trackingSpan -> - let success, res = self.uiElements.TryGetValue trackingSpan - if success then res else null - ) - |> Seq.filter (isNull >> not) - let span = - try - tagSpan.TranslateTo(span.Snapshot, SpanTrackingMode.EdgeExclusive) - with e -> logExceptionWithContext (e, "tag span translation"); tagSpan - let sizes = - try - stackPanels |> Seq.map (fun ui -> - ui.Measure(Size(10000., 10000.)) - ui.DesiredSize ) - with e -> logExceptionWithContext (e, "internal tagging"); Seq.empty - let height = - try - sizes - |> Seq.map (fun size -> size.Height) - |> Seq.sortDescending - |> Seq.tryHead - |> Option.defaultValue 0. - with e -> logExceptionWithContext (e, "height tagging"); 0. - - yield TagSpan(span, CodeLensGeneralTag(0., height, 0., 0., 0., PositionAffinity.Predecessor, stackPanels, self)) :> ITagSpan - } - with e -> - logErrorf "Error in code lens get tags %A" e - Seq.empty - - diff --git a/vsintegration/src/FSharp.Editor/CodeLens/CodeLensProvider.fs b/vsintegration/src/FSharp.Editor/CodeLens/CodeLensProvider.fs deleted file mode 100644 index b5092b32cd..0000000000 --- a/vsintegration/src/FSharp.Editor/CodeLens/CodeLensProvider.fs +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -namespace rec Microsoft.VisualStudio.FSharp.Editor - - -open System -open Microsoft.VisualStudio.Text -open Microsoft.VisualStudio.Text.Editor -open System.ComponentModel.Composition -open Microsoft.VisualStudio.Utilities -open Microsoft.CodeAnalysis -open Microsoft.VisualStudio.Shell -open Microsoft.VisualStudio -open Microsoft.VisualStudio.LanguageServices -open System.Collections.Generic -open Microsoft.CodeAnalysis.Editor.Shared.Utilities -open Microsoft.VisualStudio.Text.Tagging -open Microsoft.VisualStudio.Text.Classification -open Microsoft.VisualStudio.ComponentModelHost -open System.Threading -open Microsoft.VisualStudio.FSharp.Editor.Logging - -[)>] -[)>] -[)>] -[] -[] -type internal CodeLensProvider - [] - ( - textDocumentFactory: ITextDocumentFactoryService, - checkerProvider: FSharpCheckerProvider, - projectInfoManager: FSharpProjectOptionsManager, - typeMap : ClassificationTypeMap Lazy, - gotoDefinitionService: FSharpGoToDefinitionService - ) = - - let lineLensProvider = ResizeArray() - let taggers = ResizeArray() - let componentModel = Package.GetGlobalService(typeof) :?> ComponentModelHost.IComponentModel - let workspace = componentModel.GetService() - - /// Returns an provider for the textView if already one has been created. Else create one. - let addCodeLensProviderOnce wpfView buffer = - let res = taggers |> Seq.tryFind(fun (view, _) -> view = wpfView) - match res with - | Some (_, (tagger, _)) -> tagger - | None -> - let documentId = - lazy ( - match textDocumentFactory.TryGetTextDocument(buffer) with - | true, textDocument -> - Seq.tryHead (workspace.CurrentSolution.GetDocumentIdsWithFilePath(textDocument.FilePath)) - | _ -> None - |> Option.get - ) - - let tagger = CodeLensGeneralTagger(wpfView, buffer) - let service = FSharpCodeLensService(workspace, documentId, buffer, checkerProvider.Checker, projectInfoManager, componentModel.GetService(), typeMap, gotoDefinitionService, tagger) - let provider = (wpfView, (tagger, service)) - wpfView.Closed.Add (fun _ -> taggers.Remove provider |> ignore) - taggers.Add((wpfView, (tagger, service))) - tagger - - /// Returns an provider for the textView if already one has been created. Else create one. - let addLineLensProviderOnce wpfView buffer = - let res = lineLensProvider |> Seq.tryFind(fun (view, _) -> view = wpfView) - match res with - | None -> - let documentId = - lazy ( - match textDocumentFactory.TryGetTextDocument(buffer) with - | true, textDocument -> - Seq.tryHead (workspace.CurrentSolution.GetDocumentIdsWithFilePath(textDocument.FilePath)) - | _ -> None - |> Option.get - ) - let service = FSharpCodeLensService(workspace, documentId, buffer, checkerProvider.Checker, projectInfoManager, componentModel.GetService(), typeMap, gotoDefinitionService, LineLensDisplayService(wpfView, buffer)) - let provider = (wpfView, service) - wpfView.Closed.Add (fun _ -> lineLensProvider.Remove provider |> ignore) - lineLensProvider.Add(provider) - | _ -> () - - [); Name("CodeLens"); - Order(Before = PredefinedAdornmentLayers.Text); - TextViewRole(PredefinedTextViewRoles.Document)>] - member val CodeLensAdornmentLayerDefinition : AdornmentLayerDefinition = null with get, set - - [); Name("LineLens"); - Order(Before = PredefinedAdornmentLayers.Text); - TextViewRole(PredefinedTextViewRoles.Document)>] - member val LineLensAdornmentLayerDefinition : AdornmentLayerDefinition = null with get, set - - interface IViewTaggerProvider with - override __.CreateTagger(view, buffer) = - if Settings.CodeLens.Enabled && not Settings.CodeLens.ReplaceWithLineLens then - let wpfView = - match view with - | :? IWpfTextView as view -> view - | _ -> failwith "error" - - box(addCodeLensProviderOnce wpfView buffer) :?> _ - else - null - - interface IWpfTextViewCreationListener with - override __.TextViewCreated view = - if Settings.CodeLens.Enabled && Settings.CodeLens.ReplaceWithLineLens then - addLineLensProviderOnce view (view.TextBuffer) |> ignore diff --git a/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs b/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs deleted file mode 100644 index 9be718fed9..0000000000 --- a/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs +++ /dev/null @@ -1,385 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -namespace rec Microsoft.VisualStudio.FSharp.Editor - - -open System -open System.Windows.Controls -open System.Windows.Media -open Microsoft.VisualStudio.Text -open Microsoft.VisualStudio.Text.Formatting -open Microsoft.CodeAnalysis -open System.Threading -open Microsoft.FSharp.Compiler.SourceCodeServices -open System.Windows -open System.Collections.Generic -open Microsoft.FSharp.Compiler.Range -open Microsoft.FSharp.Compiler -open Microsoft.FSharp.Compiler.Ast -open Microsoft.CodeAnalysis.Editor.Shared.Extensions -open Microsoft.CodeAnalysis.Editor.Shared.Utilities -open Microsoft.CodeAnalysis.Classification -open Internal.Utilities.StructuredFormat -open System.Windows.Media.Animation - -open Microsoft.VisualStudio.FSharp.Editor.Logging -open Microsoft.VisualStudio.Text.Classification - -type internal CodeLens(taggedText, computed, fullTypeSignature, uiElement) = - member val TaggedText: Async<(ResizeArray * QuickInfoNavigation) option> = taggedText - member val Computed: bool = computed with get, set - member val FullTypeSignature: string = fullTypeSignature - member val UiElement: UIElement = uiElement with get, set - -type internal FSharpCodeLensService - ( - workspace: Workspace, - documentId: Lazy, - buffer: ITextBuffer, - checker: FSharpChecker, - projectInfoManager: FSharpProjectOptionsManager, - classificationFormatMapService: IClassificationFormatMapService, - typeMap: Lazy, - gotoDefinitionService: FSharpGoToDefinitionService, - codeLens : CodeLensDisplayService - ) as self = - - let lineLens = codeLens - - let visit pos parseTree = - AstTraversal.Traverse(pos, parseTree, { new AstTraversal.AstVisitorBase<_>() with - member __.VisitExpr(_path, traverseSynExpr, defaultTraverse, expr) = - defaultTraverse(expr) - - override __.VisitInheritSynMemberDefn (_, _, _, _, range) = Some range - - override __.VisitTypeAbbrev( _, range) = Some range - - override __.VisitLetOrUse(binding, range) = Some range - - override __.VisitBinding (fn, binding) = - Some binding.RangeOfBindingAndRhs - }) - - let formatMap = lazy classificationFormatMapService.GetClassificationFormatMap "tooltip" - - let mutable lastResults = Dictionary() - let mutable firstTimeChecked = false - let mutable bufferChangedCts = new CancellationTokenSource() - let uiContext = SynchronizationContext.Current - - let layoutTagToFormatting (layoutTag: LayoutTag) = - layoutTag - |> RoslynHelpers.roslynTag - |> ClassificationTags.GetClassificationTypeName - |> typeMap.Value.GetClassificationType - |> formatMap.Value.GetTextProperties - - let createTextBox (lens:CodeLens) = - async { - do! Async.SwitchToContext uiContext - let! res = lens.TaggedText - match res with - | Some (taggedText, navigation) -> - logInfof "Tagged text %A" taggedText - let textBlock = new TextBlock(Background = Brushes.AliceBlue, Opacity = 0.0, TextTrimming = TextTrimming.None) - DependencyObjectExtensions.SetDefaultTextProperties(textBlock, formatMap.Value) - - let prefix = Documents.Run Settings.CodeLens.Prefix - prefix.Foreground <- SolidColorBrush(Color.FromRgb(153uy, 153uy, 153uy)) - textBlock.Inlines.Add prefix - - for text in taggedText do - - let coloredProperties = layoutTagToFormatting text.Tag - let actualProperties = - if Settings.CodeLens.UseColors - then - // If color is gray (R=G=B), change to correct gray color. - // Otherwise, use the provided color. - match coloredProperties.ForegroundBrush with - | :? SolidColorBrush as b -> - let c = b.Color - if c.R = c.G && c.R = c.B - then coloredProperties.SetForeground(Color.FromRgb(153uy, 153uy, 153uy)) - else coloredProperties - | _ -> coloredProperties - else - coloredProperties.SetForeground(Color.FromRgb(153uy, 153uy, 153uy)) - - let run = Documents.Run text.Text - DependencyObjectExtensions.SetTextProperties (run, actualProperties) - - let inl = - match text with - | :? Layout.NavigableTaggedText as nav when navigation.IsTargetValid nav.Range -> - let h = Documents.Hyperlink(run, ToolTip = nav.Range.FileName) - h.Click.Add (fun _ -> - navigation.NavigateTo nav.Range) - h :> Documents.Inline - | _ -> run :> _ - DependencyObjectExtensions.SetTextProperties (inl, actualProperties) - textBlock.Inlines.Add inl - - - textBlock.Measure(Size(Double.PositiveInfinity, Double.PositiveInfinity)) - lens.Computed <- true - lens.UiElement <- textBlock - return true - | _ -> - return false - } - - let StartAsyncSafe cancellationToken context computation = - let computation = - async { - try - return! computation - with e -> - logExceptionWithContext(e, context) - return Unchecked.defaultof<_> - } - Async.Start (computation, cancellationToken) - - let executeCodeLenseAsync () = - asyncMaybe { - do! Async.Sleep 800 |> liftAsync - logInfof "Rechecking code due to buffer edit!" - let! document = workspace.CurrentSolution.GetDocument(documentId.Value) |> Option.ofObj - let! _, options = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document) - let! _, parsedInput, checkFileResults = checker.ParseAndCheckDocument(document, options, true, "LineLens") - logInfof "Getting uses of all symbols!" - let! symbolUses = checkFileResults.GetAllUsesOfAllSymbolsInFile() |> liftAsync - let textSnapshot = buffer.CurrentSnapshot - logInfof "Updating due to buffer edit!" - - // Clear existing data and cache flags - // The results which are left. - let oldResults = Dictionary(lastResults) - - let newResults = Dictionary() - // Symbols which cache wasn't found yet - let unattachedSymbols = ResizeArray() - // Tags which are new or need to be updated due to changes. - let tagsToUpdate = Dictionary() - let codeLensToAdd = ResizeArray() - - let useResults (displayContext: FSharpDisplayContext, func: FSharpMemberOrFunctionOrValue, realPosition: range) = - async { - try - let textSnapshot = buffer.CurrentSnapshot - let lineNumber = Line.toZ func.DeclarationLocation.StartLine - if (lineNumber >= 0 || lineNumber < textSnapshot.LineCount) then - match func.FullTypeSafe with - | Some ty -> - let! displayEnv = checkFileResults.GetDisplayEnvForPos func.DeclarationLocation.Start - - let displayContext = - match displayEnv with - | Some denv -> FSharpDisplayContext(fun _ -> denv) - | None -> displayContext - - let typeLayout = func.FormatLayout displayContext - let taggedText = ResizeArray() - - Layout.renderL (Layout.taggedTextListR taggedText.Add) typeLayout |> ignore - let navigation = QuickInfoNavigation(gotoDefinitionService, document, realPosition) - // Because the data is available notify that this line should be updated, displaying the results - return Some (taggedText, navigation) - | None -> - logWarningf "Couldn't acquire CodeLens data for function %A" func - return None - else return None - with e -> - logErrorf "Error in lazy line lens computation. %A" e - return None - } - - let inline setNewResultsAndWarnIfOverriden fullDeclarationText value = - if newResults.ContainsKey fullDeclarationText then - logWarningf "New results already contains: %A" fullDeclarationText - newResults.[fullDeclarationText] <- value - - for symbolUse in symbolUses do - if symbolUse.IsFromDefinition then - match symbolUse.Symbol with - | :? FSharpMemberOrFunctionOrValue as func when func.IsModuleValueOrMember || func.IsProperty -> - let funcID = func.FullName - let fullDeclarationText = funcID - let fullTypeSignature = func.FullType.ToString() - // Try to re-use the last results - if lastResults.ContainsKey fullDeclarationText then - // Make sure that the results are usable - let inline setNewResultsAndWarnIfOverridenLocal value = setNewResultsAndWarnIfOverriden fullDeclarationText value - let lastTrackingSpan, codeLens as lastResult = lastResults.[fullDeclarationText] - if codeLens.FullTypeSignature = fullTypeSignature then - setNewResultsAndWarnIfOverridenLocal lastResult - oldResults.Remove fullDeclarationText |> ignore - else - let declarationLine, range = - match visit func.DeclarationLocation.Start parsedInput with - | Some range -> range.StartLine - 1, range - | _ -> func.DeclarationLocation.StartLine - 1, func.DeclarationLocation - // Track the old element for removal - let declarationSpan = - let line = textSnapshot.GetLineFromLineNumber declarationLine - let offset = line.GetText() |> Seq.findIndex (Char.IsWhiteSpace >> not) - SnapshotSpan(line.Start.Add offset, line.End).Span - let newTrackingSpan = - textSnapshot.CreateTrackingSpan(declarationSpan, SpanTrackingMode.EdgeExclusive) - // Push back the new results - let res = - CodeLens( Async.cache (useResults (symbolUse.DisplayContext, func, range)), - false, - fullTypeSignature, - null) - // The old results aren't computed at all, because the line might have changed create new results - tagsToUpdate.[lastTrackingSpan] <- (newTrackingSpan, fullDeclarationText, res) - setNewResultsAndWarnIfOverridenLocal (newTrackingSpan, res) - - oldResults.Remove fullDeclarationText |> ignore - else - // The symbol might be completely new or has slightly changed. - // We need to track this and iterate over the left entries to ensure that there isn't anything - unattachedSymbols.Add((symbolUse, func, fullDeclarationText, fullTypeSignature)) - | _ -> () - - // In best case this works quite `covfefe` fine because often enough we change only a small part of the file and not the complete. - for unattachedSymbol in unattachedSymbols do - let symbolUse, func, fullDeclarationText, fullTypeSignature = unattachedSymbol - let declarationLine, range = - match visit func.DeclarationLocation.Start parsedInput with - | Some range -> range.StartLine - 1, range - | _ -> func.DeclarationLocation.StartLine - 1, func.DeclarationLocation - - let test (v:KeyValuePair<_, _>) = - let _, (codeLens:CodeLens) = v.Value - codeLens.FullTypeSignature = fullTypeSignature - match oldResults |> Seq.tryFind test with - | Some res -> - let (trackingSpan : ITrackingSpan), (codeLens : CodeLens) = res.Value - let declarationSpan = - let line = textSnapshot.GetLineFromLineNumber declarationLine - let offset = line.GetText() |> Seq.findIndex (Char.IsWhiteSpace >> not) - SnapshotSpan(line.Start.Add offset, line.End).Span - let newTrackingSpan = - textSnapshot.CreateTrackingSpan(declarationSpan, SpanTrackingMode.EdgeExclusive) - if codeLens.Computed && (isNull codeLens.UiElement |> not) then - newResults.[fullDeclarationText] <- (newTrackingSpan, codeLens) - tagsToUpdate.[trackingSpan] <- (newTrackingSpan, fullDeclarationText, codeLens) - else - let res = - CodeLens( - Async.cache (useResults (symbolUse.DisplayContext, func, range)), - false, - fullTypeSignature, - null) - // The tag might be still valid but it hasn't been computed yet so create fresh results - tagsToUpdate.[trackingSpan] <- (newTrackingSpan, fullDeclarationText, res) - newResults.[fullDeclarationText] <- (newTrackingSpan, res) - let key = res.Key - oldResults.Remove key |> ignore // no need to check this entry again - | None -> - // This function hasn't got any cache and so it's completely new. - // So create completely new results - // And finally add a tag for this. - let res = - CodeLens( - Async.cache (useResults (symbolUse.DisplayContext, func, range)), - false, - fullTypeSignature, - null) - try - let declarationSpan = - let line = textSnapshot.GetLineFromLineNumber declarationLine - let offset = line.GetText() |> Seq.findIndex (Char.IsWhiteSpace >> not) - SnapshotSpan(line.Start.Add offset, line.End).Span - let trackingSpan = - textSnapshot.CreateTrackingSpan(declarationSpan, SpanTrackingMode.EdgeExclusive) - codeLensToAdd.Add (trackingSpan, res) - newResults.[fullDeclarationText] <- (trackingSpan, res) - with e -> logExceptionWithContext (e, "Line Lens tracking tag span creation") - () - lastResults <- newResults - do! Async.SwitchToContext uiContext |> liftAsync - let createCodeLensUIElement (codeLens:CodeLens) trackingSpan _ = - if codeLens.Computed |> not then - async { - let! res = createTextBox codeLens - if res then - do! Async.SwitchToContext uiContext - logInfof "Adding ui element for %A" (codeLens.TaggedText) - let uiElement = codeLens.UiElement - let animation = - DoubleAnimation( - To = Nullable 0.8, - Duration = (TimeSpan.FromMilliseconds 800. |> Duration.op_Implicit), - EasingFunction = QuadraticEase() - ) - let sb = Storyboard() - Storyboard.SetTarget(sb, uiElement) - Storyboard.SetTargetProperty(sb, PropertyPath Control.OpacityProperty) - sb.Children.Add animation - lineLens.AddUiElementToCodeLensOnce (trackingSpan, uiElement) - lineLens.RelayoutRequested.Enqueue () - sb.Begin() - else - logWarningf "Couldn't retrieve code lens information for %A" codeLens.FullTypeSignature - // logInfo "Adding text box!" - } |> StartAsyncSafe CancellationToken.None "UIElement creation" - - for value in tagsToUpdate do - let trackingSpan, (newTrackingSpan, _, codeLens) = value.Key, value.Value - // logInfof "Adding ui element for %A" (codeLens.TaggedText) - lineLens.RemoveCodeLens trackingSpan |> ignore - let Grid = lineLens.AddCodeLens newTrackingSpan - // logInfof "Trackingspan %A is being added." trackingSpan - if codeLens.Computed && (isNull codeLens.UiElement |> not) then - let uiElement = codeLens.UiElement - lineLens.AddUiElementToCodeLensOnce (newTrackingSpan, uiElement) - else - Grid.IsVisibleChanged - |> Event.filter (fun eventArgs -> eventArgs.NewValue :?> bool) - |> Event.add (createCodeLensUIElement codeLens newTrackingSpan) - - for value in codeLensToAdd do - let trackingSpan, codeLens = value - let Grid = lineLens.AddCodeLens trackingSpan - logInfof "Trackingspan %A is being added." trackingSpan - - Grid.IsVisibleChanged - |> Event.filter (fun eventArgs -> eventArgs.NewValue :?> bool) - |> Event.add (createCodeLensUIElement codeLens trackingSpan) - - for oldResult in oldResults do - let trackingSpan, _ = oldResult.Value - // logInfof "removing trackingSpan %A" trackingSpan - lineLens.RemoveCodeLens trackingSpan |> ignore - - logInfof "Finished updating line lens." - - if not firstTimeChecked then - firstTimeChecked <- true - } |> Async.Ignore - - do - begin - buffer.Changed.AddHandler(fun _ e -> (self.BufferChanged e)) - async { - let mutable numberOfFails = 0 - while not firstTimeChecked && numberOfFails < 10 do - try - do! executeCodeLenseAsync() - do! Async.Sleep(1000) - with - | e -> logErrorf "Line Lens startup failed with: %A" e - numberOfFails <- numberOfFails + 1 - } |> Async.Start - end - - member __.BufferChanged ___ = - bufferChangedCts.Cancel() // Stop all ongoing async workflow. - bufferChangedCts.Dispose() - bufferChangedCts <- new CancellationTokenSource() - executeCodeLenseAsync () |> Async.Ignore |> RoslynHelpers.StartAsyncSafe bufferChangedCts.Token - diff --git a/vsintegration/src/FSharp.Editor/CodeLens/LineLensDisplayService.fs b/vsintegration/src/FSharp.Editor/CodeLens/LineLensDisplayService.fs deleted file mode 100644 index be49b79d03..0000000000 --- a/vsintegration/src/FSharp.Editor/CodeLens/LineLensDisplayService.fs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -namespace rec Microsoft.VisualStudio.FSharp.Editor - - -open System -open System.Windows.Controls -open Microsoft.VisualStudio.Text -open Microsoft.VisualStudio.Text.Editor -open Microsoft.VisualStudio.Text.Formatting -open System.Windows -open System.Collections.Generic - -open Microsoft.VisualStudio.FSharp.Editor.Logging - -type internal LineLensDisplayService (view, buffer) = - inherit CodeLensDisplayService(view, buffer, "LineLens") - - /// Layouts all stack panels on the line - override self.layoutUIElementOnLine _ (line:ITextViewLine) (ui:Grid) = - let left, top = - match self.uiElementNeighbour.TryGetValue ui with - | true, parent -> - let left = Canvas.GetLeft parent - let top = Canvas.GetTop parent - let width = parent.ActualWidth - left + width, top - | _ -> - try - let bounds = line.GetCharacterBounds(line.Start) - line.TextRight + 5.0, bounds.Top - 1. - with e -> - logExceptionWithContext (e, "Error in layout ui element on line") - Canvas.GetLeft ui, Canvas.GetTop ui - Canvas.SetLeft(ui, left) - Canvas.SetTop(ui, top) - - override self.asyncCustomLayoutOperation visibleLineNumbers buffer = - asyncMaybe { - // Suspend 5 ms, instantly applying the layout to the adornment elements isn't needed - // and would consume too much performance - do! Async.Sleep(5) |> liftAsync // Skip at least one frames - do! Async.SwitchToContext self.uiContext |> liftAsync - let layer = self.codeLensLayer - do! Async.Sleep(495) |> liftAsync - try - for visibleLineNumber in visibleLineNumbers do - if self.trackingSpans.ContainsKey visibleLineNumber then - self.trackingSpans.[visibleLineNumber] - |> Seq.map (fun trackingSpan -> - let success, res = self.uiElements.TryGetValue trackingSpan - if success then - res - else null - ) - |> Seq.filter (fun ui -> not(isNull ui) && not(self.addedAdornments.Contains ui)) - |> Seq.iter(fun grid -> - layer.AddAdornment(AdornmentPositioningBehavior.OwnerControlled, Nullable(), - self, grid, AdornmentRemovedCallback(fun _ _ -> self.addedAdornments.Remove grid |> ignore)) |> ignore - self.addedAdornments.Add grid |> ignore - let line = - let l = buffer.GetLineFromLineNumber visibleLineNumber - view.GetTextViewLineContainingBufferPosition l.Start - self.layoutUIElementOnLine view line grid - ) - with e -> logExceptionWithContext (e, "LayoutChanged, processing new visible lines") - } |> Async.Ignore \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/Common/Constants.fs b/vsintegration/src/FSharp.Editor/Common/Constants.fs index bc9b33b50c..ec876ff9d5 100644 --- a/vsintegration/src/FSharp.Editor/Common/Constants.fs +++ b/vsintegration/src/FSharp.Editor/Common/Constants.fs @@ -64,10 +64,6 @@ module internal Guids = [] /// "9A66EB6A-DE52-4169-BC26-36FBD4312FD7" let codeFixesOptionPageIdString = "9A66EB6A-DE52-4169-BC26-36FBD4312FD7" - - [] - /// "00BE7FD9-8145-4A2E-A1BF-3BAF0F4F47DD" - let codeLensOptionPageIdString = "00BE7FD9-8145-4A2E-A1BF-3BAF0F4F47DD" [] /// "8FDA964A-263D-4B4E-9560-29897535217C" diff --git a/vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs b/vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs index 880d14362c..feb1e89e57 100644 --- a/vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs +++ b/vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs @@ -159,17 +159,6 @@ module internal RoslynHelpers = let linePositionSpan = LinePositionSpan(LinePosition(Line.toZ r.StartLine, r.StartColumn), LinePosition(Line.toZ r.EndLine, r.EndColumn)) let textSpan = sourceText.Lines.GetTextSpan linePositionSpan Location.Create(filePath, textSpan, linePositionSpan) - - let StartAsyncSafe cancellationToken computation = - let computation = - async { - try - return! computation - with e -> - Assert.Exception(e) - return Unchecked.defaultof<_> - } - Async.Start (computation, cancellationToken) module internal OpenDeclarationHelper = diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index eb2fb6ac56..6d64030df3 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -90,11 +90,6 @@ - - - - - diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index 7bb4a6435e..5b6ccb784e 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -286,7 +286,6 @@ type [, "F#", null, "QuickInfo", "6009")>] [, "F#", null, "Code Fixes", "6010")>] [, "F#", null, "Performance", "6011")>] - [, "F#", null, "Code Lens", "6012")>] [, "F#", null, "Advanced", "6012")>] [] [, diff --git a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs index c157908fba..8444a3c157 100644 --- a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs +++ b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs @@ -42,15 +42,10 @@ type LanguageServicePerformanceOptions = ProjectCheckCacheSize: int } [] -type CodeLensOptions = - { Enabled : bool - ReplaceWithLineLens: bool - UseColors: bool - Prefix : string } - type AdvancedOptions = { IsBlockStructureEnabled: bool IsOutliningEnabled: bool } + [)>] type internal Settings [](store: SettingsStore) = do // Initialize default settings @@ -80,19 +75,12 @@ type internal Settings [](store: SettingsStore) = { IsBlockStructureEnabled = true IsOutliningEnabled = true } - store.RegisterDefault - { Enabled = true - UseColors = false - ReplaceWithLineLens = true - Prefix = "// " } - interface ISettings static member IntelliSense : IntelliSenseOptions = getSettings() static member QuickInfo : QuickInfoOptions = getSettings() static member CodeFixes : CodeFixesOptions = getSettings() static member LanguageServicePerformance : LanguageServicePerformanceOptions = getSettings() - static member CodeLens : CodeLensOptions = getSettings() static member Advanced: AdvancedOptions = getSettings() module internal OptionsUI = @@ -128,15 +116,9 @@ module internal OptionsUI = inherit AbstractOptionPage() override this.CreateView() = upcast LanguageServicePerformanceOptionControl() - - [] - type internal CodeLensOptionPage() = - inherit AbstractOptionPage() - override this.CreateView() = - upcast CodeLensOptionControl() [] type internal AdvancedSettingsOptionPage() = inherit AbstractOptionPage() override __.CreateView() = - upcast AdvancedOptionsControl() + upcast AdvancedOptionsControl() \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/Options/UIHelpers.fs b/vsintegration/src/FSharp.Editor/Options/UIHelpers.fs index 122fb5c51d..2fb2fe303f 100644 --- a/vsintegration/src/FSharp.Editor/Options/UIHelpers.fs +++ b/vsintegration/src/FSharp.Editor/Options/UIHelpers.fs @@ -64,7 +64,7 @@ module internal OptionsUIHelpers = let bindCheckBox (checkBox: CheckBox) (path: string) = checkBox.SetBinding(CheckBox.IsCheckedProperty, path) |> ignore - + // some helpers to create option views in code instead of XAML let ( *** ) (control : #IAddChild) (children: UIElement list) = children |> List.iter control.AddChild diff --git a/vsintegration/src/FSharp.UIResources/CodeLensOptionControl.xaml b/vsintegration/src/FSharp.UIResources/CodeLensOptionControl.xaml deleted file mode 100644 index 955c105c7f..0000000000 --- a/vsintegration/src/FSharp.UIResources/CodeLensOptionControl.xaml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vsintegration/src/FSharp.UIResources/CodeLensOptionControl.xaml.cs b/vsintegration/src/FSharp.UIResources/CodeLensOptionControl.xaml.cs deleted file mode 100644 index ad1a0ecf1a..0000000000 --- a/vsintegration/src/FSharp.UIResources/CodeLensOptionControl.xaml.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; - -namespace Microsoft.VisualStudio.FSharp.UIResources -{ - /// - /// Interaction logic for CodeLensOptionPage.xaml - /// - internal partial class CodeLensOptionControl : UserControl - { - public CodeLensOptionControl() - { - InitializeComponent(); - } - } -} diff --git a/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj b/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj index 8419aff801..c511d7e926 100644 --- a/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj +++ b/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj @@ -46,7 +46,7 @@ $(VS150COMNTOOLS)\..\..\MSBuild\$(VisualStudioVersion)\Bin $(VSMSBuildBinDir)\Microsoft.CSharp.targets
- + false diff --git a/vsintegration/src/FSharp.UIResources/Strings.Designer.cs b/vsintegration/src/FSharp.UIResources/Strings.Designer.cs index 9ca24307b1..75234c04d7 100644 --- a/vsintegration/src/FSharp.UIResources/Strings.Designer.cs +++ b/vsintegration/src/FSharp.UIResources/Strings.Designer.cs @@ -87,51 +87,6 @@ public static string Code_Fixes { } } - /// - /// Looks up a localized string similar to CodeLens. - /// - public static string CodeLens { - get { - return ResourceManager.GetString("CodeLens", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Annotation prefix. - /// - public static string CodeLens_Prefix { - get { - return ResourceManager.GetString("CodeLens_Prefix", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Show annotations to the right instead of above the line. - /// - public static string CodeLens_Replace_LineLens { - get { - return ResourceManager.GetString("CodeLens_Replace_LineLens", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Show type signature annotations in the editor. - /// - public static string CodeLens_Switch { - get { - return ResourceManager.GetString("CodeLens_Switch", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Use colors in annotations. - /// - public static string CodeLens_UseColors { - get { - return ResourceManager.GetString("CodeLens_UseColors", resourceCulture); - } - } - /// /// Looks up a localized string similar to Completion Lists. /// diff --git a/vsintegration/src/FSharp.UIResources/Strings.resx b/vsintegration/src/FSharp.UIResources/Strings.resx index 721e028dba..ebe45bf732 100644 --- a/vsintegration/src/FSharp.UIResources/Strings.resx +++ b/vsintegration/src/FSharp.UIResources/Strings.resx @@ -53,6 +53,7 @@ value : The object must be serialized with : System.Runtime.Serialization.Formatters.Soap.SoapFormatter : and then encoded with base64 encoding. + mimetype: application/x-microsoft.net.object.bytearray.base64 value : The object must be serialized into a byte array : using a System.ComponentModel.TypeConverter @@ -179,19 +180,4 @@ Show outlining and collapsable nodes for F# code - - CodeLens - - - Show annotations to the right instead of above the line - - - Show type signature annotations in the editor - - - Annotation prefix - - - Use colors in annotations - \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf index 23594aa2a0..a396705910 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf @@ -107,31 +107,6 @@ Zobrazí osnovu a sbalitelné uzly kódu F#. - - CodeLens - CodeLens - - - - Show annotations to the right instead of above the line - Show annotations to the right instead of above the line - - - - Show type signature annotations in the editor - Show type signature annotations in the editor - - - - Annotation prefix - Annotation prefix - - - - Use colors in annotations - Use colors in annotations - - \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf index 4a06b1b6f9..218468a4f8 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf @@ -107,31 +107,6 @@ Gliederung und ausblendbare Knoten für F#-Code anzeigen - - CodeLens - CodeLens - - - - Show annotations to the right instead of above the line - Show annotations to the right instead of above the line - - - - Show type signature annotations in the editor - Show type signature annotations in the editor - - - - Annotation prefix - Annotation prefix - - - - Use colors in annotations - Use colors in annotations - - \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf index 58e0be7f3e..a9f0ba0ac1 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.en.xlf @@ -107,31 +107,6 @@ Show outlining and collapsable nodes for F# code - - CodeLens - CodeLens - - - - Show annotations to the right instead of above the line - Show annotations to the right instead of above the line - - - - Show type signature annotations in the editor - Show type signature annotations in the editor - - - - Annotation prefix - Annotation prefix - - - - Use colors in annotations - Use colors in annotations - - \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf index e2c4d5b911..88318f4804 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf @@ -107,31 +107,6 @@ Mostrar los nodos de esquematización y contraíbles del código F# - - CodeLens - CodeLens - - - - Show annotations to the right instead of above the line - Show annotations to the right instead of above the line - - - - Show type signature annotations in the editor - Show type signature annotations in the editor - - - - Annotation prefix - Annotation prefix - - - - Use colors in annotations - Use colors in annotations - - \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf index 791db1628f..2df7e8e711 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf @@ -107,31 +107,6 @@ Afficher le mode plan et les nœuds réductibles pour le code F# - - CodeLens - CodeLens - - - - Show annotations to the right instead of above the line - Show annotations to the right instead of above the line - - - - Show type signature annotations in the editor - Show type signature annotations in the editor - - - - Annotation prefix - Annotation prefix - - - - Use colors in annotations - Use colors in annotations - - \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf index 7ec6526107..aea7e8a335 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf @@ -107,31 +107,6 @@ Mostra i nodi struttura e comprimibili per il codice F# - - CodeLens - CodeLens - - - - Show annotations to the right instead of above the line - Show annotations to the right instead of above the line - - - - Show type signature annotations in the editor - Show type signature annotations in the editor - - - - Annotation prefix - Annotation prefix - - - - Use colors in annotations - Use colors in annotations - - \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf index 983570100b..fe3dad874a 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf @@ -107,31 +107,6 @@ F# コードのアウトラインおよび折りたたみ可能なノードを表示する - - CodeLens - CodeLens - - - - Show annotations to the right instead of above the line - Show annotations to the right instead of above the line - - - - Show type signature annotations in the editor - Show type signature annotations in the editor - - - - Annotation prefix - Annotation prefix - - - - Use colors in annotations - Use colors in annotations - - \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf index 37fe273ced..310eeffa71 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf @@ -107,31 +107,6 @@ F# 코드에 대한 개요 및 축소 가능한 노드 표시 - - CodeLens - CodeLens - - - - Show annotations to the right instead of above the line - Show annotations to the right instead of above the line - - - - Show type signature annotations in the editor - Show type signature annotations in the editor - - - - Annotation prefix - Annotation prefix - - - - Use colors in annotations - Use colors in annotations - - \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf index fb7bcd1d16..1ff43eb0bd 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf @@ -107,31 +107,6 @@ Pokaż konspekt i węzły z możliwością zwijania dla kodu języka F# - - CodeLens - CodeLens - - - - Show annotations to the right instead of above the line - Show annotations to the right instead of above the line - - - - Show type signature annotations in the editor - Show type signature annotations in the editor - - - - Annotation prefix - Annotation prefix - - - - Use colors in annotations - Use colors in annotations - - \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf index e4cd1e6d2e..44da05912b 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf @@ -107,31 +107,6 @@ Mostrar os nós de estrutura de tópicos e recolhíveis para o código F# - - CodeLens - CodeLens - - - - Show annotations to the right instead of above the line - Show annotations to the right instead of above the line - - - - Show type signature annotations in the editor - Show type signature annotations in the editor - - - - Annotation prefix - Annotation prefix - - - - Use colors in annotations - Use colors in annotations - - \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf index f8a7046f4c..c5141e2e97 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf @@ -107,31 +107,6 @@ Показать структурирование и сворачиваемые узлы для кода F# - - CodeLens - CodeLens - - - - Show annotations to the right instead of above the line - Show annotations to the right instead of above the line - - - - Show type signature annotations in the editor - Show type signature annotations in the editor - - - - Annotation prefix - Annotation prefix - - - - Use colors in annotations - Use colors in annotations - - \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf index da4b3b409d..5198b19f72 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf @@ -107,31 +107,6 @@ F# kodu için ana hattı ve daraltılabilir düğümleri göster - - CodeLens - CodeLens - - - - Show annotations to the right instead of above the line - Show annotations to the right instead of above the line - - - - Show type signature annotations in the editor - Show type signature annotations in the editor - - - - Annotation prefix - Annotation prefix - - - - Use colors in annotations - Use colors in annotations - - \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf index 0ac1cccdf3..2d251aa037 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf @@ -107,31 +107,6 @@ 显示 F# 代码的大纲和可折叠节点 - - CodeLens - CodeLens - - - - Show annotations to the right instead of above the line - Show annotations to the right instead of above the line - - - - Show type signature annotations in the editor - Show type signature annotations in the editor - - - - Annotation prefix - Annotation prefix - - - - Use colors in annotations - Use colors in annotations - - \ No newline at end of file diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf index bf7a84dec5..be901b794c 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf @@ -107,31 +107,6 @@ 顯示 F# 程式碼的大綱與可折疊的節點 - - CodeLens - CodeLens - - - - Show annotations to the right instead of above the line - Show annotations to the right instead of above the line - - - - Show type signature annotations in the editor - Show type signature annotations in the editor - - - - Annotation prefix - Annotation prefix - - - - Use colors in annotations - Use colors in annotations - - \ No newline at end of file From faaf2f3c220b80d7003246a7e2d5ced5b9541b54 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Thu, 15 Mar 2018 19:04:45 -0700 Subject: [PATCH 125/147] cleanup some build warnings (#4549) --- .../src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj | 1 + vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj | 1 + 2 files changed, 2 insertions(+) diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj b/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj index e1395974b5..04a52ef381 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj @@ -23,6 +23,7 @@ false + Menus.ctmenu true diff --git a/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj b/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj index c511d7e926..a6c9a18f0b 100644 --- a/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj +++ b/vsintegration/src/FSharp.UIResources/FSharp.UIResources.csproj @@ -7,6 +7,7 @@ Library false Microsoft.VisualStudio.FSharp.UIResources + $(NoWarn);1591 From 80c48d3d34ae7cee073109b3492400699304a84d Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Thu, 15 Mar 2018 19:05:28 -0700 Subject: [PATCH 126/147] add new nightly package publishing feed and update an older one (#4552) --- setup/publish-assets.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup/publish-assets.ps1 b/setup/publish-assets.ps1 index d008243353..4232cef6e4 100644 --- a/setup/publish-assets.ps1 +++ b/setup/publish-assets.ps1 @@ -30,9 +30,12 @@ try { "master" { $requestUrl = "https://dotnet.myget.org/F/fsharp/vsix/upload" } - "dev15.6" { + "dev15.7" { $requestUrl = "https://dotnet.myget.org/F/fsharp-preview/vsix/upload" } + "dev15.8" { + $requestUrl = "https://dotnet.myget.org/F/fsharp-dev15-8-preview/vsix/upload" + } default { Write-Host "Branch [$branchName] is not supported for publishing." exit 0 # non-fatal From 95348d0aafd168064d4c2282c59d62ac95bbebdf Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 16 Mar 2018 13:14:44 +0000 Subject: [PATCH 127/147] update perf scripts to include COMPUTERNAME (#4561) --- tests/scripts/compiler-perf-results.txt | 250 ++++++++++++------------ tests/scripts/compiler-perf.fsx | 5 +- 2 files changed, 130 insertions(+), 125 deletions(-) diff --git a/tests/scripts/compiler-perf-results.txt b/tests/scripts/compiler-perf-results.txt index ee00b0994f..ef7f6e901d 100644 --- a/tests/scripts/compiler-perf-results.txt +++ b/tests/scripts/compiler-perf-results.txt @@ -1,133 +1,137 @@ -url ref sha base build startup-to-parseonly parseonly-to-check check-to-nooptimize check-to-optimize nooptimize-to-debug -https://github.com/Microsoft/visualfsharp master 0247247d480340c27ce7f7de9b2fbc3b7c598b03 0247247d480340c27ce7f7de9b2fbc3b7c598b03 208.37 10.80 30.96 46.90 64.63 52.79 -https://github.com/Microsoft/visualfsharp master 0247247d480340c27ce7f7de9b2fbc3b7c598b03 0247247d480340c27ce7f7de9b2fbc3b7c598b03 205.30 10.95 31.27 47.89 63.56 51.45 -https://github.com/Microsoft/visualfsharp master 0247247d480340c27ce7f7de9b2fbc3b7c598b03 0247247d480340c27ce7f7de9b2fbc3b7c598b03 207.75 11.09 30.23 50.55 64.30 50.56 -https://github.com/Microsoft/visualfsharp master 0247247d480340c27ce7f7de9b2fbc3b7c598b03 0247247d480340c27ce7f7de9b2fbc3b7c598b03 206.02 11.31 32.09 47.31 63.09 51.53 -https://github.com/Microsoft/visualfsharp master 1ce06f8a8e44e81e1b51ce1a4743514afda5848a 1ce06f8a8e44e81e1b51ce1a4743514afda5848a 207.13 11.30 30.84 47.05 62.64 51.97 -https://github.com/Microsoft/visualfsharp master 1ce06f8a8e44e81e1b51ce1a4743514afda5848a 1ce06f8a8e44e81e1b51ce1a4743514afda5848a 207.67 10.91 31.11 47.59 61.90 52.41 -https://github.com/Microsoft/visualfsharp master 1ce06f8a8e44e81e1b51ce1a4743514afda5848a 1ce06f8a8e44e81e1b51ce1a4743514afda5848a 213.58 11.23 32.03 47.61 62.34 51.25 -https://github.com/Microsoft/visualfsharp master 536cfeb1cc3d74cd29ccd760715caac2cd2826e6 536cfeb1cc3d74cd29ccd760715caac2cd2826e6 202.52 11.59 31.16 48.09 61.13 51.83 -https://github.com/Microsoft/visualfsharp master 983330c28ef5c06edbfd46b061c651f61fb851e1 983330c28ef5c06edbfd46b061c651f61fb851e1 197.77 11.27 32.00 45.83 63.09 52.52 -https://github.com/Microsoft/visualfsharp master 4a275618b8976c5100c2054e07c3e153a70d00bf 4a275618b8976c5100c2054e07c3e153a70d00bf 201.81 11.58 30.85 46.67 56.16 46.84 -https://github.com/Microsoft/visualfsharp master c37ef6e30eae8d8eead61027166a0b723590048f c37ef6e30eae8d8eead61027166a0b723590048f 195.60 11.52 30.96 46.07 62.75 52.24 -https://github.com/Microsoft/visualfsharp master 3bf3960d9790a6de73884b420cad4397ae066d77 3bf3960d9790a6de73884b420cad4397ae066d77 186.14 10.78 28.31 44.61 60.20 53.55 -https://github.com/Microsoft/visualfsharp master c37ef6e30eae8d8eead61027166a0b723590048f c37ef6e30eae8d8eead61027166a0b723590048f 195.60 11.52 30.96 46.07 62.75 52.24 -https://github.com/Microsoft/visualfsharp master c37ef6e30eae8d8eead61027166a0b723590048f c37ef6e30eae8d8eead61027166a0b723590048f 194.06 12.02 38.93 57.16 61.63 50.16 -https://github.com/Microsoft/visualfsharp master c37ef6e30eae8d8eead61027166a0b723590048f c37ef6e30eae8d8eead61027166a0b723590048f 193.89 11.25 30.64 45.71 62.94 52.00 -https://github.com/Microsoft/visualfsharp master 293b1152c5a25db63951924aa8353c7c7611a641 293b1152c5a25db63951924aa8353c7c7611a641 188.58 10.48 29.12 45.25 60.34 54.20 -https://github.com/Microsoft/visualfsharp master d89e5a522899a8580cb78e364b7040a06b28b4bb d89e5a522899a8580cb78e364b7040a06b28b4bb 201.95 10.98 31.34 44.94 57.63 50.41 -https://github.com/Microsoft/visualfsharp master 527d6dea6244100dc4bd19c47fe80a28a96a0c2b 527d6dea6244100dc4bd19c47fe80a28a96a0c2b 206.55 10.79 28.26 44.08 58.52 51.85 -https://github.com/Microsoft/visualfsharp master 66123c8c162c058c4cf63c6e5ade2b7fabc88bce 66123c8c162c058c4cf63c6e5ade2b7fabc88bce 202.39 10.12 30.98 45.96 61.91 51.16 -https://github.com/Microsoft/visualfsharp master 66123c8c162c058c4cf63c6e5ade2b7fabc88bce 66123c8c162c058c4cf63c6e5ade2b7fabc88bce 207.60 10.31 30.51 46.54 62.74 51.05 -https://github.com/Microsoft/visualfsharp master b24e92b5dd375b5209a47db9af9d490a78e6f884 b24e92b5dd375b5209a47db9af9d490a78e6f884 197.87 10.79 31.22 47.19 58.72 49.52 -https://github.com/Microsoft/visualfsharp master 427318deda16d340e9e61db6af220fee6e81bb78 427318deda16d340e9e61db6af220fee6e81bb78 200.47 10.86 30.96 46.20 62.34 47.18 -https://github.com/Microsoft/visualfsharp master 427318deda16d340e9e61db6af220fee6e81bb78 427318deda16d340e9e61db6af220fee6e81bb78 197.59 9.95 31.31 46.62 53.79 46.24 -https://github.com/Microsoft/visualfsharp master 221dd7eecf53a5392e7717afd7f243caee27f1f9 221dd7eecf53a5392e7717afd7f243caee27f1f9 220.11 10.94 30.32 46.88 64.71 51.84 -https://github.com/Microsoft/visualfsharp master 3f155eba7d5b8d32fc1ad88c49d61fbaf7391cd4 3f155eba7d5b8d32fc1ad88c49d61fbaf7391cd4 195.60 10.58 26.79 42.48 57.12 53.29 -https://github.com/Microsoft/visualfsharp master ba63403cb5898596c5e875a14ce22b33ef618c01 ba63403cb5898596c5e875a14ce22b33ef618c01 204.45 9.93 29.26 45.39 61.16 52.88 -https://github.com/Microsoft/visualfsharp master ba63403cb5898596c5e875a14ce22b33ef618c01 ba63403cb5898596c5e875a14ce22b33ef618c01 204.30 10.03 28.81 44.55 59.84 51.96 -https://github.com/Microsoft/visualfsharp master 458e6c29d7e059a5a8a7b4cd7858c7d633fb5906 458e6c29d7e059a5a8a7b4cd7858c7d633fb5906 214.16 9.94 29.36 45.31 59.53 51.99 -https://github.com/Microsoft/visualfsharp master 7e1fd6ac330f86597f3167e8067cfd805a89eec9 7e1fd6ac330f86597f3167e8067cfd805a89eec9 196.59 10.74 27.06 44.82 57.91 51.39 +url ref sha base computer build startup-to-parseonly parseonly-to-check check-to-nooptimize check-to-optimize nooptimize-to-debug +https://github.com/Microsoft/visualfsharp master 0247247d480340c27ce7f7de9b2fbc3b7c598b03 0247247d480340c27ce7f7de9b2fbc3b7c598b03 MSRC-DON-OFFICE 208.37 10.80 30.96 46.90 64.63 52.79 +https://github.com/Microsoft/visualfsharp master 0247247d480340c27ce7f7de9b2fbc3b7c598b03 0247247d480340c27ce7f7de9b2fbc3b7c598b03 MSRC-DON-OFFICE 205.30 10.95 31.27 47.89 63.56 51.45 +https://github.com/Microsoft/visualfsharp master 0247247d480340c27ce7f7de9b2fbc3b7c598b03 0247247d480340c27ce7f7de9b2fbc3b7c598b03 MSRC-DON-OFFICE 207.75 11.09 30.23 50.55 64.30 50.56 +https://github.com/Microsoft/visualfsharp master 0247247d480340c27ce7f7de9b2fbc3b7c598b03 0247247d480340c27ce7f7de9b2fbc3b7c598b03 MSRC-DON-OFFICE 206.02 11.31 32.09 47.31 63.09 51.53 +https://github.com/Microsoft/visualfsharp master 1ce06f8a8e44e81e1b51ce1a4743514afda5848a 1ce06f8a8e44e81e1b51ce1a4743514afda5848a MSRC-DON-OFFICE 207.13 11.30 30.84 47.05 62.64 51.97 +https://github.com/Microsoft/visualfsharp master 1ce06f8a8e44e81e1b51ce1a4743514afda5848a 1ce06f8a8e44e81e1b51ce1a4743514afda5848a MSRC-DON-OFFICE 207.67 10.91 31.11 47.59 61.90 52.41 +https://github.com/Microsoft/visualfsharp master 1ce06f8a8e44e81e1b51ce1a4743514afda5848a 1ce06f8a8e44e81e1b51ce1a4743514afda5848a MSRC-DON-OFFICE 213.58 11.23 32.03 47.61 62.34 51.25 +https://github.com/Microsoft/visualfsharp master 536cfeb1cc3d74cd29ccd760715caac2cd2826e6 536cfeb1cc3d74cd29ccd760715caac2cd2826e6 MSRC-DON-OFFICE 202.52 11.59 31.16 48.09 61.13 51.83 +https://github.com/Microsoft/visualfsharp master 983330c28ef5c06edbfd46b061c651f61fb851e1 983330c28ef5c06edbfd46b061c651f61fb851e1 MSRC-DON-OFFICE 197.77 11.27 32.00 45.83 63.09 52.52 +https://github.com/Microsoft/visualfsharp master 4a275618b8976c5100c2054e07c3e153a70d00bf 4a275618b8976c5100c2054e07c3e153a70d00bf MSRC-DON-OFFICE 201.81 11.58 30.85 46.67 56.16 46.84 +https://github.com/Microsoft/visualfsharp master c37ef6e30eae8d8eead61027166a0b723590048f c37ef6e30eae8d8eead61027166a0b723590048f MSRC-DON-OFFICE 195.60 11.52 30.96 46.07 62.75 52.24 +https://github.com/Microsoft/visualfsharp master 3bf3960d9790a6de73884b420cad4397ae066d77 3bf3960d9790a6de73884b420cad4397ae066d77 MSRC-DON-OFFICE 186.14 10.78 28.31 44.61 60.20 53.55 +https://github.com/Microsoft/visualfsharp master c37ef6e30eae8d8eead61027166a0b723590048f c37ef6e30eae8d8eead61027166a0b723590048f MSRC-DON-OFFICE 195.60 11.52 30.96 46.07 62.75 52.24 +https://github.com/Microsoft/visualfsharp master c37ef6e30eae8d8eead61027166a0b723590048f c37ef6e30eae8d8eead61027166a0b723590048f MSRC-DON-OFFICE 194.06 12.02 38.93 57.16 61.63 50.16 +https://github.com/Microsoft/visualfsharp master c37ef6e30eae8d8eead61027166a0b723590048f c37ef6e30eae8d8eead61027166a0b723590048f MSRC-DON-OFFICE 193.89 11.25 30.64 45.71 62.94 52.00 +https://github.com/Microsoft/visualfsharp master 293b1152c5a25db63951924aa8353c7c7611a641 293b1152c5a25db63951924aa8353c7c7611a641 MSRC-DON-OFFICE 188.58 10.48 29.12 45.25 60.34 54.20 +https://github.com/Microsoft/visualfsharp master d89e5a522899a8580cb78e364b7040a06b28b4bb d89e5a522899a8580cb78e364b7040a06b28b4bb MSRC-DON-OFFICE 201.95 10.98 31.34 44.94 57.63 50.41 +https://github.com/Microsoft/visualfsharp master 527d6dea6244100dc4bd19c47fe80a28a96a0c2b 527d6dea6244100dc4bd19c47fe80a28a96a0c2b MSRC-DON-OFFICE 206.55 10.79 28.26 44.08 58.52 51.85 +https://github.com/Microsoft/visualfsharp master 66123c8c162c058c4cf63c6e5ade2b7fabc88bce 66123c8c162c058c4cf63c6e5ade2b7fabc88bce MSRC-DON-OFFICE 202.39 10.12 30.98 45.96 61.91 51.16 +https://github.com/Microsoft/visualfsharp master 66123c8c162c058c4cf63c6e5ade2b7fabc88bce 66123c8c162c058c4cf63c6e5ade2b7fabc88bce MSRC-DON-OFFICE 207.60 10.31 30.51 46.54 62.74 51.05 +https://github.com/Microsoft/visualfsharp master b24e92b5dd375b5209a47db9af9d490a78e6f884 b24e92b5dd375b5209a47db9af9d490a78e6f884 MSRC-DON-OFFICE 197.87 10.79 31.22 47.19 58.72 49.52 +https://github.com/Microsoft/visualfsharp master 427318deda16d340e9e61db6af220fee6e81bb78 427318deda16d340e9e61db6af220fee6e81bb78 MSRC-DON-OFFICE 200.47 10.86 30.96 46.20 62.34 47.18 +https://github.com/Microsoft/visualfsharp master 427318deda16d340e9e61db6af220fee6e81bb78 427318deda16d340e9e61db6af220fee6e81bb78 MSRC-DON-OFFICE 197.59 9.95 31.31 46.62 53.79 46.24 +https://github.com/Microsoft/visualfsharp master 221dd7eecf53a5392e7717afd7f243caee27f1f9 221dd7eecf53a5392e7717afd7f243caee27f1f9 MSRC-DON-OFFICE 220.11 10.94 30.32 46.88 64.71 51.84 +https://github.com/Microsoft/visualfsharp master 3f155eba7d5b8d32fc1ad88c49d61fbaf7391cd4 3f155eba7d5b8d32fc1ad88c49d61fbaf7391cd4 MSRC-DON-OFFICE 195.60 10.58 26.79 42.48 57.12 53.29 +https://github.com/Microsoft/visualfsharp master ba63403cb5898596c5e875a14ce22b33ef618c01 ba63403cb5898596c5e875a14ce22b33ef618c01 MSRC-DON-OFFICE 204.45 9.93 29.26 45.39 61.16 52.88 +https://github.com/Microsoft/visualfsharp master ba63403cb5898596c5e875a14ce22b33ef618c01 ba63403cb5898596c5e875a14ce22b33ef618c01 MSRC-DON-OFFICE 204.30 10.03 28.81 44.55 59.84 51.96 +https://github.com/Microsoft/visualfsharp master 458e6c29d7e059a5a8a7b4cd7858c7d633fb5906 458e6c29d7e059a5a8a7b4cd7858c7d633fb5906 MSRC-DON-OFFICE 214.16 9.94 29.36 45.31 59.53 51.99 +https://github.com/Microsoft/visualfsharp master 7e1fd6ac330f86597f3167e8067cfd805a89eec9 7e1fd6ac330f86597f3167e8067cfd805a89eec9 MSRC-DON-OFFICE 196.59 10.74 27.06 44.82 57.91 51.39 -https://github.com/forki/visualfsharp.git foreach_optimization d0ab5fec77482e1280578f47e3257cf660d7f1b2 0247247d480340c27ce7f7de9b2fbc3b7c598b03 206.56 11.02 30.55 47.72 62.52 52.96 -https://github.com/forki/visualfsharp.git foreach_optimization d0ab5fec77482e1280578f47e3257cf660d7f1b2 0247247d480340c27ce7f7de9b2fbc3b7c598b03 206.41 10.72 31.05 48.59 61.88 53.13 -https://github.com/forki/visualfsharp.git foreach_optimization d0ab5fec77482e1280578f47e3257cf660d7f1b2 0247247d480340c27ce7f7de9b2fbc3b7c598b03 207.31 10.91 31.03 46.78 62.39 52.11 -https://github.com/forki/visualfsharp.git foreach_optimization d0ab5fec77482e1280578f47e3257cf660d7f1b2 0247247d480340c27ce7f7de9b2fbc3b7c598b03 211.23 11.36 31.42 47.38 63.22 53.54 +https://github.com/forki/visualfsharp.git foreach_optimization d0ab5fec77482e1280578f47e3257cf660d7f1b2 0247247d480340c27ce7f7de9b2fbc3b7c598b03 MSRC-DON-OFFICE 206.56 11.02 30.55 47.72 62.52 52.96 +https://github.com/forki/visualfsharp.git foreach_optimization d0ab5fec77482e1280578f47e3257cf660d7f1b2 0247247d480340c27ce7f7de9b2fbc3b7c598b03 MSRC-DON-OFFICE 206.41 10.72 31.05 48.59 61.88 53.13 +https://github.com/forki/visualfsharp.git foreach_optimization d0ab5fec77482e1280578f47e3257cf660d7f1b2 0247247d480340c27ce7f7de9b2fbc3b7c598b03 MSRC-DON-OFFICE 207.31 10.91 31.03 46.78 62.39 52.11 +https://github.com/forki/visualfsharp.git foreach_optimization d0ab5fec77482e1280578f47e3257cf660d7f1b2 0247247d480340c27ce7f7de9b2fbc3b7c598b03 MSRC-DON-OFFICE 211.23 11.36 31.42 47.38 63.22 53.54 -https://github.com/dsyme/visualfsharp.git no-casts 53d633d6dba0d8f5fcd80f47f588d21cd7a2cff9 0247247d480340c27ce7f7de9b2fbc3b7c598b03 211.45 11.14 30.25 45.66 61.73 53.84 -https://github.com/dsyme/visualfsharp.git no-casts 53d633d6dba0d8f5fcd80f47f588d21cd7a2cff9 0247247d480340c27ce7f7de9b2fbc3b7c598b03 207.08 10.69 31.23 46.47 61.97 52.14 -https://github.com/dsyme/visualfsharp.git no-casts 53d633d6dba0d8f5fcd80f47f588d21cd7a2cff9 0247247d480340c27ce7f7de9b2fbc3b7c598b03 208.58 11.25 31.70 47.69 63.06 52.61 -https://github.com/dsyme/visualfsharp.git no-casts 53d633d6dba0d8f5fcd80f47f588d21cd7a2cff9 1ce06f8a8e44e81e1b51ce1a4743514afda5848a 209.92 10.83 30.59 46.45 63.41 55.14 -https://github.com/dsyme/visualfsharp.git no-casts 53d633d6dba0d8f5fcd80f47f588d21cd7a2cff9 1ce06f8a8e44e81e1b51ce1a4743514afda5848a 230.10 11.06 29.59 46.61 64.58 54.09 -https://github.com/dsyme/visualfsharp.git no-casts 53d633d6dba0d8f5fcd80f47f588d21cd7a2cff9 1ce06f8a8e44e81e1b51ce1a4743514afda5848a 221.48 12.05 31.19 47.31 62.44 54.08 -https://github.com/dsyme/visualfsharp.git no-casts 7ec10ce97d4a4cba14bb79f3cd5a4d98c2bf9092 cea1aac316803cd0960f845ec12b0cbc70ac953d 194.05 11.47 30.27 45.52 61.96 51.79 -https://github.com/dsyme/visualfsharp.git no-casts 7ec10ce97d4a4cba14bb79f3cd5a4d98c2bf9092 8e66ecae1c2102094224ead3c2ba9532e65130cd 184.22 11.36 28.08 45.95 59.77 51.44 -https://github.com/dsyme/visualfsharp.git no-casts 7ec10ce97d4a4cba14bb79f3cd5a4d98c2bf9092 293b1152c5a25db63951924aa8353c7c7611a641 207.46 10.70 30.10 44.94 60.09 54.05 -https://github.com/dsyme/visualfsharp.git no-casts 7ec10ce97d4a4cba14bb79f3cd5a4d98c2bf9092 d89e5a522899a8580cb78e364b7040a06b28b4bb 193.85 11.75 31.06 43.97 56.86 49.26 -https://github.com/dsyme/visualfsharp.git no-casts 7ec10ce97d4a4cba14bb79f3cd5a4d98c2bf9092 527d6dea6244100dc4bd19c47fe80a28a96a0c2b 201.73 11.01 30.63 47.52 63.03 50.82 -https://github.com/dsyme/visualfsharp.git no-casts 7ec10ce97d4a4cba14bb79f3cd5a4d98c2bf9092 66123c8c162c058c4cf63c6e5ade2b7fabc88bce 199.77 11.81 30.33 46.05 61.21 53.09 -https://github.com/dsyme/visualfsharp.git no-casts 7ec10ce97d4a4cba14bb79f3cd5a4d98c2bf9092 66123c8c162c058c4cf63c6e5ade2b7fabc88bce 196.27 11.02 30.84 46.55 61.35 51.09 -https://github.com/dsyme/visualfsharp.git no-casts d601bb842ef7a73c9b0ee0b1b4ab51fb39c72cd5 221dd7eecf53a5392e7717afd7f243caee27f1f9 201.95 10.61 30.46 45.63 65.04 52.19 -https://github.com/dsyme/visualfsharp.git no-casts d1726cec77db15dd057af9b914db6c4b8a4d9c10 221dd7eecf53a5392e7717afd7f243caee27f1f9 216.13 11.42 29.90 46.97 62.86 52.34 +https://github.com/dsyme/visualfsharp.git no-casts 53d633d6dba0d8f5fcd80f47f588d21cd7a2cff9 0247247d480340c27ce7f7de9b2fbc3b7c598b03 MSRC-DON-OFFICE 211.45 11.14 30.25 45.66 61.73 53.84 +https://github.com/dsyme/visualfsharp.git no-casts 53d633d6dba0d8f5fcd80f47f588d21cd7a2cff9 0247247d480340c27ce7f7de9b2fbc3b7c598b03 MSRC-DON-OFFICE 207.08 10.69 31.23 46.47 61.97 52.14 +https://github.com/dsyme/visualfsharp.git no-casts 53d633d6dba0d8f5fcd80f47f588d21cd7a2cff9 0247247d480340c27ce7f7de9b2fbc3b7c598b03 MSRC-DON-OFFICE 208.58 11.25 31.70 47.69 63.06 52.61 +https://github.com/dsyme/visualfsharp.git no-casts 53d633d6dba0d8f5fcd80f47f588d21cd7a2cff9 1ce06f8a8e44e81e1b51ce1a4743514afda5848a MSRC-DON-OFFICE 209.92 10.83 30.59 46.45 63.41 55.14 +https://github.com/dsyme/visualfsharp.git no-casts 53d633d6dba0d8f5fcd80f47f588d21cd7a2cff9 1ce06f8a8e44e81e1b51ce1a4743514afda5848a MSRC-DON-OFFICE 230.10 11.06 29.59 46.61 64.58 54.09 +https://github.com/dsyme/visualfsharp.git no-casts 53d633d6dba0d8f5fcd80f47f588d21cd7a2cff9 1ce06f8a8e44e81e1b51ce1a4743514afda5848a MSRC-DON-OFFICE 221.48 12.05 31.19 47.31 62.44 54.08 +https://github.com/dsyme/visualfsharp.git no-casts 7ec10ce97d4a4cba14bb79f3cd5a4d98c2bf9092 cea1aac316803cd0960f845ec12b0cbc70ac953d MSRC-DON-OFFICE 194.05 11.47 30.27 45.52 61.96 51.79 +https://github.com/dsyme/visualfsharp.git no-casts 7ec10ce97d4a4cba14bb79f3cd5a4d98c2bf9092 8e66ecae1c2102094224ead3c2ba9532e65130cd MSRC-DON-OFFICE 184.22 11.36 28.08 45.95 59.77 51.44 +https://github.com/dsyme/visualfsharp.git no-casts 7ec10ce97d4a4cba14bb79f3cd5a4d98c2bf9092 293b1152c5a25db63951924aa8353c7c7611a641 MSRC-DON-OFFICE 207.46 10.70 30.10 44.94 60.09 54.05 +https://github.com/dsyme/visualfsharp.git no-casts 7ec10ce97d4a4cba14bb79f3cd5a4d98c2bf9092 d89e5a522899a8580cb78e364b7040a06b28b4bb MSRC-DON-OFFICE 193.85 11.75 31.06 43.97 56.86 49.26 +https://github.com/dsyme/visualfsharp.git no-casts 7ec10ce97d4a4cba14bb79f3cd5a4d98c2bf9092 527d6dea6244100dc4bd19c47fe80a28a96a0c2b MSRC-DON-OFFICE 201.73 11.01 30.63 47.52 63.03 50.82 +https://github.com/dsyme/visualfsharp.git no-casts 7ec10ce97d4a4cba14bb79f3cd5a4d98c2bf9092 66123c8c162c058c4cf63c6e5ade2b7fabc88bce MSRC-DON-OFFICE 199.77 11.81 30.33 46.05 61.21 53.09 +https://github.com/dsyme/visualfsharp.git no-casts 7ec10ce97d4a4cba14bb79f3cd5a4d98c2bf9092 66123c8c162c058c4cf63c6e5ade2b7fabc88bce MSRC-DON-OFFICE 196.27 11.02 30.84 46.55 61.35 51.09 +https://github.com/dsyme/visualfsharp.git no-casts d601bb842ef7a73c9b0ee0b1b4ab51fb39c72cd5 221dd7eecf53a5392e7717afd7f243caee27f1f9 MSRC-DON-OFFICE 201.95 10.61 30.46 45.63 65.04 52.19 +https://github.com/dsyme/visualfsharp.git no-casts d1726cec77db15dd057af9b914db6c4b8a4d9c10 221dd7eecf53a5392e7717afd7f243caee27f1f9 MSRC-DON-OFFICE 216.13 11.42 29.90 46.97 62.86 52.34 -https://github.com/neoeinstein/visualfsharp.git parallel-file-parsing bc2f0098ee51dcfc9419eb8fa4e86b275cb4d7c4 536cfeb1cc3d74cd29ccd760715caac2cd2826e6 215.41 12.00 31.41 47.30 63.73 51.89 -https://github.com/neoeinstein/visualfsharp.git parallel-file-parsing bc2f0098ee51dcfc9419eb8fa4e86b275cb4d7c4 983330c28ef5c06edbfd46b061c651f61fb851e1 203.39 12.73 30.36 46.97 63.55 53.19 -https://github.com/neoeinstein/visualfsharp.git parallel-file-parsing bc2f0098ee51dcfc9419eb8fa4e86b275cb4d7c4 4a275618b8976c5100c2054e07c3e153a70d00bf 214.69 16.57 26.18 47.37 54.83 61.20 +https://github.com/neoeinstein/visualfsharp.git parallel-file-parsing bc2f0098ee51dcfc9419eb8fa4e86b275cb4d7c4 536cfeb1cc3d74cd29ccd760715caac2cd2826e6 MSRC-DON-OFFICE 215.41 12.00 31.41 47.30 63.73 51.89 +https://github.com/neoeinstein/visualfsharp.git parallel-file-parsing bc2f0098ee51dcfc9419eb8fa4e86b275cb4d7c4 983330c28ef5c06edbfd46b061c651f61fb851e1 MSRC-DON-OFFICE 203.39 12.73 30.36 46.97 63.55 53.19 +https://github.com/neoeinstein/visualfsharp.git parallel-file-parsing bc2f0098ee51dcfc9419eb8fa4e86b275cb4d7c4 4a275618b8976c5100c2054e07c3e153a70d00bf MSRC-DON-OFFICE 214.69 16.57 26.18 47.37 54.83 61.20 -https://github.com/liboz/visualfsharp.git working 38e74ec89ada4bdd277be989a8aecfd855d1aaff c37ef6e30eae8d8eead61027166a0b723590048f 219.25 11.65 30.25 46.35 62.73 52.59 -https://github.com/liboz/visualfsharp.git working 38e74ec89ada4bdd277be989a8aecfd855d1aaff c37ef6e30eae8d8eead61027166a0b723590048f 195.32 11.41 30.41 46.89 60.97 50.02 -https://github.com/liboz/visualfsharp.git working 38e74ec89ada4bdd277be989a8aecfd855d1aaff c37ef6e30eae8d8eead61027166a0b723590048f 193.49 11.31 30.61 46.24 62.02 50.87 -https://github.com/liboz/visualfsharp.git working 606d58f01825aafab754607b19fbd29403022d9b cea1aac316803cd0960f845ec12b0cbc70ac953d 195.37 11.59 30.06 46.59 61.82 48.11 -https://github.com/liboz/visualfsharp.git working 606d58f01825aafab754607b19fbd29403022d9b 3bf3960d9790a6de73884b420cad4397ae066d77 184.57 10.92 27.58 46.78 62.34 52.24 +https://github.com/liboz/visualfsharp.git working 38e74ec89ada4bdd277be989a8aecfd855d1aaff c37ef6e30eae8d8eead61027166a0b723590048f MSRC-DON-OFFICE 219.25 11.65 30.25 46.35 62.73 52.59 +https://github.com/liboz/visualfsharp.git working 38e74ec89ada4bdd277be989a8aecfd855d1aaff c37ef6e30eae8d8eead61027166a0b723590048f MSRC-DON-OFFICE 195.32 11.41 30.41 46.89 60.97 50.02 +https://github.com/liboz/visualfsharp.git working 38e74ec89ada4bdd277be989a8aecfd855d1aaff c37ef6e30eae8d8eead61027166a0b723590048f MSRC-DON-OFFICE 193.49 11.31 30.61 46.24 62.02 50.87 +https://github.com/liboz/visualfsharp.git working 606d58f01825aafab754607b19fbd29403022d9b cea1aac316803cd0960f845ec12b0cbc70ac953d MSRC-DON-OFFICE 195.37 11.59 30.06 46.59 61.82 48.11 +https://github.com/liboz/visualfsharp.git working 606d58f01825aafab754607b19fbd29403022d9b 3bf3960d9790a6de73884b420cad4397ae066d77 MSRC-DON-OFFICE 184.57 10.92 27.58 46.78 62.34 52.24 -https://github.com/dsyme/visualfsharp.git mem-tast-1 a9994d9eb684dc1ac546111a16037efbc5c3f8f8 cea1aac316803cd0960f845ec12b0cbc70ac953d 197.24 11.93 30.06 45.70 61.70 53.41 -https://github.com/dsyme/visualfsharp.git mem-tast-1 27769a591b52c1f80c698c108b557db453a4b33c 8e66ecae1c2102094224ead3c2ba9532e65130cd 198.55 11.56 29.98 43.02 57.52 51.49 -https://github.com/dsyme/visualfsharp.git mem-tast-1 63447a2f8b65c4b98aaa133b49831d251e876bf3 293b1152c5a25db63951924aa8353c7c7611a641 196.83 11.87 28.59 46.48 60.59 52.52 -https://github.com/dsyme/visualfsharp.git mem-tast-1 63447a2f8b65c4b98aaa133b49831d251e876bf3 293b1152c5a25db63951924aa8353c7c7611a641 181.29 10.24 28.13 43.65 59.46 50.85 -https://github.com/dsyme/visualfsharp.git mem-tast-1 63447a2f8b65c4b98aaa133b49831d251e876bf3 d89e5a522899a8580cb78e364b7040a06b28b4bb 197.60 11.28 30.32 51.79 59.21 43.63 +https://github.com/dsyme/visualfsharp.git mem-tast-1 a9994d9eb684dc1ac546111a16037efbc5c3f8f8 cea1aac316803cd0960f845ec12b0cbc70ac953d MSRC-DON-OFFICE 197.24 11.93 30.06 45.70 61.70 53.41 +https://github.com/dsyme/visualfsharp.git mem-tast-1 27769a591b52c1f80c698c108b557db453a4b33c 8e66ecae1c2102094224ead3c2ba9532e65130cd MSRC-DON-OFFICE 198.55 11.56 29.98 43.02 57.52 51.49 +https://github.com/dsyme/visualfsharp.git mem-tast-1 63447a2f8b65c4b98aaa133b49831d251e876bf3 293b1152c5a25db63951924aa8353c7c7611a641 MSRC-DON-OFFICE 196.83 11.87 28.59 46.48 60.59 52.52 +https://github.com/dsyme/visualfsharp.git mem-tast-1 63447a2f8b65c4b98aaa133b49831d251e876bf3 293b1152c5a25db63951924aa8353c7c7611a641 MSRC-DON-OFFICE 181.29 10.24 28.13 43.65 59.46 50.85 +https://github.com/dsyme/visualfsharp.git mem-tast-1 63447a2f8b65c4b98aaa133b49831d251e876bf3 d89e5a522899a8580cb78e364b7040a06b28b4bb MSRC-DON-OFFICE 197.60 11.28 30.32 51.79 59.21 43.63 -https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 ea46408f0746d6336687d58dc81e2db72a4f95be cea1aac316803cd0960f845ec12b0cbc70ac953d 193.84 11.65 26.99 43.98 61.65 51.19 -https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 ea46408f0746d6336687d58dc81e2db72a4f95be 3bf3960d9790a6de73884b420cad4397ae066d77 199.09 10.95 28.09 46.41 59.53 51.14 -https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 ea46408f0746d6336687d58dc81e2db72a4f95be 8e66ecae1c2102094224ead3c2ba9532e65130cd 186.44 10.89 28.50 46.31 60.13 51.94 -https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 ea46408f0746d6336687d58dc81e2db72a4f95be 293b1152c5a25db63951924aa8353c7c7611a641 204.50 10.79 30.87 48.00 63.22 50.75 -https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 ea46408f0746d6336687d58dc81e2db72a4f95be 293b1152c5a25db63951924aa8353c7c7611a641 179.26 10.12 27.98 44.44 58.51 50.01 -https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 ea46408f0746d6336687d58dc81e2db72a4f95be d89e5a522899a8580cb78e364b7040a06b28b4bb 194.70 11.64 30.06 44.72 58.42 51.20 -https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 ea46408f0746d6336687d58dc81e2db72a4f95be 527d6dea6244100dc4bd19c47fe80a28a96a0c2b 205.10 11.53 31.19 46.54 62.37 52.67 -https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 ea46408f0746d6336687d58dc81e2db72a4f95be 66123c8c162c058c4cf63c6e5ade2b7fabc88bce 204.54 11.28 30.69 45.41 62.94 53.22 -https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 ea46408f0746d6336687d58dc81e2db72a4f95be 66123c8c162c058c4cf63c6e5ade2b7fabc88bce 205.31 11.53 30.61 46.97 63.69 52.26 -https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 03e493140a8de463d5d1c16c92eae2f0a8b8dd24 b24e92b5dd375b5209a47db9af9d490a78e6f884 196.88 9.06 31.42 50.07 55.77 44.75 -https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 03e493140a8de463d5d1c16c92eae2f0a8b8dd24 427318deda16d340e9e61db6af220fee6e81bb78 183.55 9.94 27.67 44.11 66.64 51.50 -https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 03e493140a8de463d5d1c16c92eae2f0a8b8dd24 221dd7eecf53a5392e7717afd7f243caee27f1f9 189.33 10.29 27.83 44.03 62.10 51.21 -https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 0eb3de2961d80cce04e216614eb560ce12b6d459 221dd7eecf53a5392e7717afd7f243caee27f1f9 208.20 10.94 29.02 48.10 66.45 51.62 -https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 0eb3de2961d80cce04e216614eb560ce12b6d459 d2e4570c47de0dbfb85223971ab8f1a7740182c7 208.80 10.93 30.30 47.50 63.10 51.35 -https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 0eb3de2961d80cce04e216614eb560ce12b6d459 3f155eba7d5b8d32fc1ad88c49d61fbaf7391cd4 193.15 10.64 27.54 43.72 57.38 54.59 -https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 0eb3de2961d80cce04e216614eb560ce12b6d459 ba63403cb5898596c5e875a14ce22b33ef618c01 200.28 10.38 30.20 46.68 61.81 51.27 -https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 0eb3de2961d80cce04e216614eb560ce12b6d459 ba63403cb5898596c5e875a14ce22b33ef618c01 199.32 10.31 28.82 44.69 61.67 53.39 -https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 0eb3de2961d80cce04e216614eb560ce12b6d459 458e6c29d7e059a5a8a7b4cd7858c7d633fb5906 203.14 10.25 29.59 44.58 61.31 51.87 +https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 ea46408f0746d6336687d58dc81e2db72a4f95be cea1aac316803cd0960f845ec12b0cbc70ac953d MSRC-DON-OFFICE 193.84 11.65 26.99 43.98 61.65 51.19 +https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 ea46408f0746d6336687d58dc81e2db72a4f95be 3bf3960d9790a6de73884b420cad4397ae066d77 MSRC-DON-OFFICE 199.09 10.95 28.09 46.41 59.53 51.14 +https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 ea46408f0746d6336687d58dc81e2db72a4f95be 8e66ecae1c2102094224ead3c2ba9532e65130cd MSRC-DON-OFFICE 186.44 10.89 28.50 46.31 60.13 51.94 +https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 ea46408f0746d6336687d58dc81e2db72a4f95be 293b1152c5a25db63951924aa8353c7c7611a641 MSRC-DON-OFFICE 204.50 10.79 30.87 48.00 63.22 50.75 +https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 ea46408f0746d6336687d58dc81e2db72a4f95be 293b1152c5a25db63951924aa8353c7c7611a641 MSRC-DON-OFFICE 179.26 10.12 27.98 44.44 58.51 50.01 +https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 ea46408f0746d6336687d58dc81e2db72a4f95be d89e5a522899a8580cb78e364b7040a06b28b4bb MSRC-DON-OFFICE 194.70 11.64 30.06 44.72 58.42 51.20 +https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 ea46408f0746d6336687d58dc81e2db72a4f95be 527d6dea6244100dc4bd19c47fe80a28a96a0c2b MSRC-DON-OFFICE 205.10 11.53 31.19 46.54 62.37 52.67 +https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 ea46408f0746d6336687d58dc81e2db72a4f95be 66123c8c162c058c4cf63c6e5ade2b7fabc88bce MSRC-DON-OFFICE 204.54 11.28 30.69 45.41 62.94 53.22 +https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 ea46408f0746d6336687d58dc81e2db72a4f95be 66123c8c162c058c4cf63c6e5ade2b7fabc88bce MSRC-DON-OFFICE 205.31 11.53 30.61 46.97 63.69 52.26 +https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 03e493140a8de463d5d1c16c92eae2f0a8b8dd24 b24e92b5dd375b5209a47db9af9d490a78e6f884 MSRC-DON-OFFICE 196.88 9.06 31.42 50.07 55.77 44.75 +https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 03e493140a8de463d5d1c16c92eae2f0a8b8dd24 427318deda16d340e9e61db6af220fee6e81bb78 MSRC-DON-OFFICE 183.55 9.94 27.67 44.11 66.64 51.50 +https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 03e493140a8de463d5d1c16c92eae2f0a8b8dd24 221dd7eecf53a5392e7717afd7f243caee27f1f9 MSRC-DON-OFFICE 189.33 10.29 27.83 44.03 62.10 51.21 +https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 0eb3de2961d80cce04e216614eb560ce12b6d459 221dd7eecf53a5392e7717afd7f243caee27f1f9 MSRC-DON-OFFICE 208.20 10.94 29.02 48.10 66.45 51.62 +https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 0eb3de2961d80cce04e216614eb560ce12b6d459 d2e4570c47de0dbfb85223971ab8f1a7740182c7 MSRC-DON-OFFICE 208.80 10.93 30.30 47.50 63.10 51.35 +https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 0eb3de2961d80cce04e216614eb560ce12b6d459 3f155eba7d5b8d32fc1ad88c49d61fbaf7391cd4 MSRC-DON-OFFICE 193.15 10.64 27.54 43.72 57.38 54.59 +https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 0eb3de2961d80cce04e216614eb560ce12b6d459 ba63403cb5898596c5e875a14ce22b33ef618c01 MSRC-DON-OFFICE 200.28 10.38 30.20 46.68 61.81 51.27 +https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 0eb3de2961d80cce04e216614eb560ce12b6d459 ba63403cb5898596c5e875a14ce22b33ef618c01 MSRC-DON-OFFICE 199.32 10.31 28.82 44.69 61.67 53.39 +https://github.com/dsyme/visualfsharp.git mem-tp-fix-1 0eb3de2961d80cce04e216614eb560ce12b6d459 458e6c29d7e059a5a8a7b4cd7858c7d633fb5906 MSRC-DON-OFFICE 203.14 10.25 29.59 44.58 61.31 51.87 -https://github.com/jack-pappas/visualfsharp.git issue-1094 e79502a429047b568664a5c6227aa0751758a4f6 527d6dea6244100dc4bd19c47fe80a28a96a0c2b 217.49 11.51 31.13 50.57 55.69 49.46 -https://github.com/jack-pappas/visualfsharp.git issue-1094 48355a3b7367925b138e069feef44aa96b3405fe b24e92b5dd375b5209a47db9af9d490a78e6f884 191.69 10.65 29.66 42.99 58.57 52.73 -https://github.com/jack-pappas/visualfsharp.git issue-1094 9a61d0b54e3d8da653cc52fe20ce4eff9dd6c770 66123c8c162c058c4cf63c6e5ade2b7fabc88bce 204.35 11.52 30.91 46.97 62.70 52.65 -https://github.com/jack-pappas/visualfsharp.git issue-1094 9a61d0b54e3d8da653cc52fe20ce4eff9dd6c770 66123c8c162c058c4cf63c6e5ade2b7fabc88bce 216.32 11.93 30.70 46.55 61.94 51.40 -https://github.com/jack-pappas/visualfsharp.git issue-1094 48355a3b7367925b138e069feef44aa96b3405fe 427318deda16d340e9e61db6af220fee6e81bb78 191.18 10.69 29.18 43.92 57.18 52.36 -https://github.com/jack-pappas/visualfsharp.git issue-1094 10c60c53d869e03be86b7815837cf6fd73c3095b 221dd7eecf53a5392e7717afd7f243caee27f1f9 190.71 11.49 27.04 44.84 60.02 51.68 -https://github.com/jack-pappas/visualfsharp.git issue-1094 10c60c53d869e03be86b7815837cf6fd73c3095b 221dd7eecf53a5392e7717afd7f243caee27f1f9 205.25 11.72 30.10 47.13 62.38 52.00 -https://github.com/jack-pappas/visualfsharp.git issue-1094 10c60c53d869e03be86b7815837cf6fd73c3095b d2e4570c47de0dbfb85223971ab8f1a7740182c7 205.08 12.01 30.39 46.96 62.60 53.26 -https://github.com/jack-pappas/visualfsharp.git issue-1094 48355a3b7367925b138e069feef44aa96b3405fe 427318deda16d340e9e61db6af220fee6e81bb78 208.73 11.61 31.79 48.23 64.07 52.25 -https://github.com/jack-pappas/visualfsharp.git issue-1094 10c60c53d869e03be86b7815837cf6fd73c3095b 3f155eba7d5b8d32fc1ad88c49d61fbaf7391cd4 190.86 11.45 27.40 45.16 58.90 50.42 -https://github.com/jack-pappas/visualfsharp.git issue-1094 10c60c53d869e03be86b7815837cf6fd73c3095b ba63403cb5898596c5e875a14ce22b33ef618c01 195.12 11.73 30.09 46.20 63.30 52.68 -https://github.com/jack-pappas/visualfsharp.git issue-1094 10c60c53d869e03be86b7815837cf6fd73c3095b ba63403cb5898596c5e875a14ce22b33ef618c01 196.84 10.77 29.41 45.52 61.43 50.24 -https://github.com/jack-pappas/visualfsharp.git issue-1094 10c60c53d869e03be86b7815837cf6fd73c3095b 7e1fd6ac330f86597f3167e8067cfd805a89eec9 182.38 10.84 28.61 43.33 57.21 50.94 -https://github.com/jack-pappas/visualfsharp.git issue-1094 10c60c53d869e03be86b7815837cf6fd73c3095b 458e6c29d7e059a5a8a7b4cd7858c7d633fb5906 197.96 11.05 30.04 46.38 60.32 50.93 +https://github.com/jack-pappas/visualfsharp.git issue-1094 e79502a429047b568664a5c6227aa0751758a4f6 527d6dea6244100dc4bd19c47fe80a28a96a0c2b MSRC-DON-OFFICE 217.49 11.51 31.13 50.57 55.69 49.46 +https://github.com/jack-pappas/visualfsharp.git issue-1094 48355a3b7367925b138e069feef44aa96b3405fe b24e92b5dd375b5209a47db9af9d490a78e6f884 MSRC-DON-OFFICE 191.69 10.65 29.66 42.99 58.57 52.73 +https://github.com/jack-pappas/visualfsharp.git issue-1094 9a61d0b54e3d8da653cc52fe20ce4eff9dd6c770 66123c8c162c058c4cf63c6e5ade2b7fabc88bce MSRC-DON-OFFICE 204.35 11.52 30.91 46.97 62.70 52.65 +https://github.com/jack-pappas/visualfsharp.git issue-1094 9a61d0b54e3d8da653cc52fe20ce4eff9dd6c770 66123c8c162c058c4cf63c6e5ade2b7fabc88bce MSRC-DON-OFFICE 216.32 11.93 30.70 46.55 61.94 51.40 +https://github.com/jack-pappas/visualfsharp.git issue-1094 48355a3b7367925b138e069feef44aa96b3405fe 427318deda16d340e9e61db6af220fee6e81bb78 MSRC-DON-OFFICE 191.18 10.69 29.18 43.92 57.18 52.36 +https://github.com/jack-pappas/visualfsharp.git issue-1094 10c60c53d869e03be86b7815837cf6fd73c3095b 221dd7eecf53a5392e7717afd7f243caee27f1f9 MSRC-DON-OFFICE 190.71 11.49 27.04 44.84 60.02 51.68 +https://github.com/jack-pappas/visualfsharp.git issue-1094 10c60c53d869e03be86b7815837cf6fd73c3095b 221dd7eecf53a5392e7717afd7f243caee27f1f9 MSRC-DON-OFFICE 205.25 11.72 30.10 47.13 62.38 52.00 +https://github.com/jack-pappas/visualfsharp.git issue-1094 10c60c53d869e03be86b7815837cf6fd73c3095b d2e4570c47de0dbfb85223971ab8f1a7740182c7 MSRC-DON-OFFICE 205.08 12.01 30.39 46.96 62.60 53.26 +https://github.com/jack-pappas/visualfsharp.git issue-1094 48355a3b7367925b138e069feef44aa96b3405fe 427318deda16d340e9e61db6af220fee6e81bb78 MSRC-DON-OFFICE 208.73 11.61 31.79 48.23 64.07 52.25 +https://github.com/jack-pappas/visualfsharp.git issue-1094 10c60c53d869e03be86b7815837cf6fd73c3095b 3f155eba7d5b8d32fc1ad88c49d61fbaf7391cd4 MSRC-DON-OFFICE 190.86 11.45 27.40 45.16 58.90 50.42 +https://github.com/jack-pappas/visualfsharp.git issue-1094 10c60c53d869e03be86b7815837cf6fd73c3095b ba63403cb5898596c5e875a14ce22b33ef618c01 MSRC-DON-OFFICE 195.12 11.73 30.09 46.20 63.30 52.68 +https://github.com/jack-pappas/visualfsharp.git issue-1094 10c60c53d869e03be86b7815837cf6fd73c3095b ba63403cb5898596c5e875a14ce22b33ef618c01 MSRC-DON-OFFICE 196.84 10.77 29.41 45.52 61.43 50.24 +https://github.com/jack-pappas/visualfsharp.git issue-1094 10c60c53d869e03be86b7815837cf6fd73c3095b 7e1fd6ac330f86597f3167e8067cfd805a89eec9 MSRC-DON-OFFICE 182.38 10.84 28.61 43.33 57.21 50.94 +https://github.com/jack-pappas/visualfsharp.git issue-1094 10c60c53d869e03be86b7815837cf6fd73c3095b 458e6c29d7e059a5a8a7b4cd7858c7d633fb5906 MSRC-DON-OFFICE 197.96 11.05 30.04 46.38 60.32 50.93 -https://github.com/manofstick/visualfsharp.git manofstick-iseq-part2 5726129105103640130e31d6002179144a346939 b24e92b5dd375b5209a47db9af9d490a78e6f884 181.97 10.27 27.58 44.91 59.12 51.85 -https://github.com/manofstick/visualfsharp.git manofstick-iseq-part2 5726129105103640130e31d6002179144a346939 427318deda16d340e9e61db6af220fee6e81bb78 189.10 11.17 32.16 46.88 54.04 50.18 -https://github.com/manofstick/visualfsharp.git manofstick-iseq-part2 5726129105103640130e31d6002179144a346939 427318deda16d340e9e61db6af220fee6e81bb78 187.33 10.09 28.29 43.48 58.53 53.13 -https://github.com/manofstick/visualfsharp.git manofstick-iseq-part2 9870c563f51de79555f7a647113dee7c61e97224 221dd7eecf53a5392e7717afd7f243caee27f1f9 196.06 10.53 27.46 45.72 60.19 52.01 -https://github.com/manofstick/visualfsharp.git manofstick-iseq-part2 9870c563f51de79555f7a647113dee7c61e97224 221dd7eecf53a5392e7717afd7f243caee27f1f9 211.52 11.37 29.61 48.90 63.70 52.61 -https://github.com/manofstick/visualfsharp.git manofstick-iseq-part2 9870c563f51de79555f7a647113dee7c61e97224 d2e4570c47de0dbfb85223971ab8f1a7740182c7 214.22 11.51 29.77 48.95 64.34 54.97 -https://github.com/manofstick/visualfsharp.git manofstick-iseq-part2 857a22c1ff8fdd86b5d3a71a00fad5a6cb33b32c 3f155eba7d5b8d32fc1ad88c49d61fbaf7391cd4 197.82 10.43 27.49 44.48 56.70 52.25 -https://github.com/manofstick/visualfsharp.git manofstick-iseq-part2 8c1c679a1194633660e49b0a5f4c659dfc9f8b15 ba63403cb5898596c5e875a14ce22b33ef618c01 206.24 10.74 28.97 47.73 62.99 50.59 -https://github.com/manofstick/visualfsharp.git manofstick-iseq-part2 8c1c679a1194633660e49b0a5f4c659dfc9f8b15 ba63403cb5898596c5e875a14ce22b33ef618c01 206.59 10.71 28.87 45.20 59.40 51.25 -https://github.com/manofstick/visualfsharp.git manofstick-iseq-part2 8c1c679a1194633660e49b0a5f4c659dfc9f8b15 458e6c29d7e059a5a8a7b4cd7858c7d633fb5906 211.05 10.31 28.60 46.20 60.55 51.38 -https://github.com/manofstick/visualfsharp.git manofstick-iseq-part2 8c1c679a1194633660e49b0a5f4c659dfc9f8b15 7e1fd6ac330f86597f3167e8067cfd805a89eec9 193.79 11.38 26.78 43.73 59.95 51.52 +https://github.com/manofstick/visualfsharp.git manofstick-iseq-part2 5726129105103640130e31d6002179144a346939 b24e92b5dd375b5209a47db9af9d490a78e6f884 MSRC-DON-OFFICE 181.97 10.27 27.58 44.91 59.12 51.85 +https://github.com/manofstick/visualfsharp.git manofstick-iseq-part2 5726129105103640130e31d6002179144a346939 427318deda16d340e9e61db6af220fee6e81bb78 MSRC-DON-OFFICE 189.10 11.17 32.16 46.88 54.04 50.18 +https://github.com/manofstick/visualfsharp.git manofstick-iseq-part2 5726129105103640130e31d6002179144a346939 427318deda16d340e9e61db6af220fee6e81bb78 MSRC-DON-OFFICE 187.33 10.09 28.29 43.48 58.53 53.13 +https://github.com/manofstick/visualfsharp.git manofstick-iseq-part2 9870c563f51de79555f7a647113dee7c61e97224 221dd7eecf53a5392e7717afd7f243caee27f1f9 MSRC-DON-OFFICE 196.06 10.53 27.46 45.72 60.19 52.01 +https://github.com/manofstick/visualfsharp.git manofstick-iseq-part2 9870c563f51de79555f7a647113dee7c61e97224 221dd7eecf53a5392e7717afd7f243caee27f1f9 MSRC-DON-OFFICE 211.52 11.37 29.61 48.90 63.70 52.61 +https://github.com/manofstick/visualfsharp.git manofstick-iseq-part2 9870c563f51de79555f7a647113dee7c61e97224 d2e4570c47de0dbfb85223971ab8f1a7740182c7 MSRC-DON-OFFICE 214.22 11.51 29.77 48.95 64.34 54.97 +https://github.com/manofstick/visualfsharp.git manofstick-iseq-part2 857a22c1ff8fdd86b5d3a71a00fad5a6cb33b32c 3f155eba7d5b8d32fc1ad88c49d61fbaf7391cd4 MSRC-DON-OFFICE 197.82 10.43 27.49 44.48 56.70 52.25 +https://github.com/manofstick/visualfsharp.git manofstick-iseq-part2 8c1c679a1194633660e49b0a5f4c659dfc9f8b15 ba63403cb5898596c5e875a14ce22b33ef618c01 MSRC-DON-OFFICE 206.24 10.74 28.97 47.73 62.99 50.59 +https://github.com/manofstick/visualfsharp.git manofstick-iseq-part2 8c1c679a1194633660e49b0a5f4c659dfc9f8b15 ba63403cb5898596c5e875a14ce22b33ef618c01 MSRC-DON-OFFICE 206.59 10.71 28.87 45.20 59.40 51.25 +https://github.com/manofstick/visualfsharp.git manofstick-iseq-part2 8c1c679a1194633660e49b0a5f4c659dfc9f8b15 458e6c29d7e059a5a8a7b4cd7858c7d633fb5906 MSRC-DON-OFFICE 211.05 10.31 28.60 46.20 60.55 51.38 +https://github.com/manofstick/visualfsharp.git manofstick-iseq-part2 8c1c679a1194633660e49b0a5f4c659dfc9f8b15 7e1fd6ac330f86597f3167e8067cfd805a89eec9 MSRC-DON-OFFICE 193.79 11.38 26.78 43.73 59.95 51.52 -https://github.com/dsyme/visualfsharp.git acv1 bfea9e06a9cc36f12a0818313ff30bc0569b3083 b24e92b5dd375b5209a47db9af9d490a78e6f884 201.75 10.75 28.57 42.86 56.34 52.50 -https://github.com/dsyme/visualfsharp.git acv1 bfea9e06a9cc36f12a0818313ff30bc0569b3083 427318deda16d340e9e61db6af220fee6e81bb78 195.71 10.90 31.71 45.70 54.00 49.29 -https://github.com/dsyme/visualfsharp.git acv1 bfea9e06a9cc36f12a0818313ff30bc0569b3083 221dd7eecf53a5392e7717afd7f243caee27f1f9 187.94 10.41 27.10 45.64 59.54 50.11 -https://github.com/dsyme/visualfsharp.git acv1 e37c1a96f3a3069ef37fb4325eeb09385e419cb6 221dd7eecf53a5392e7717afd7f243caee27f1f9 208.41 11.27 29.50 46.96 63.70 53.26 -https://github.com/dsyme/visualfsharp.git acv1 e37c1a96f3a3069ef37fb4325eeb09385e419cb6 d2e4570c47de0dbfb85223971ab8f1a7740182c7 221.65 11.26 30.01 47.00 62.40 51.17 -https://github.com/dsyme/visualfsharp.git acv1 e37c1a96f3a3069ef37fb4325eeb09385e419cb6 3f155eba7d5b8d32fc1ad88c49d61fbaf7391cd4 201.02 10.69 27.09 43.86 58.77 52.16 -https://github.com/dsyme/visualfsharp.git acv1 e37c1a96f3a3069ef37fb4325eeb09385e419cb6 ba63403cb5898596c5e875a14ce22b33ef618c01 196.14 10.69 29.19 46.88 62.15 51.86 -https://github.com/dsyme/visualfsharp.git acv1 e37c1a96f3a3069ef37fb4325eeb09385e419cb6 ba63403cb5898596c5e875a14ce22b33ef618c01 200.59 10.45 30.36 46.08 63.29 52.91 -https://github.com/dsyme/visualfsharp.git acv1 e37c1a96f3a3069ef37fb4325eeb09385e419cb6 ba63403cb5898596c5e875a14ce22b33ef618c01 197.20 11.72 44.46 36.39 48.72 63.65 -https://github.com/dsyme/visualfsharp.git acv1 e37c1a96f3a3069ef37fb4325eeb09385e419cb6 458e6c29d7e059a5a8a7b4cd7858c7d633fb5906 195.34 10.00 29.05 44.33 62.73 53.00 -https://github.com/dsyme/visualfsharp.git acv1 e37c1a96f3a3069ef37fb4325eeb09385e419cb6 7e1fd6ac330f86597f3167e8067cfd805a89eec9 228.81 10.68 33.93 47.92 52.76 41.37 +https://github.com/dsyme/visualfsharp.git acv1 bfea9e06a9cc36f12a0818313ff30bc0569b3083 b24e92b5dd375b5209a47db9af9d490a78e6f884 MSRC-DON-OFFICE 201.75 10.75 28.57 42.86 56.34 52.50 +https://github.com/dsyme/visualfsharp.git acv1 bfea9e06a9cc36f12a0818313ff30bc0569b3083 427318deda16d340e9e61db6af220fee6e81bb78 MSRC-DON-OFFICE 195.71 10.90 31.71 45.70 54.00 49.29 +https://github.com/dsyme/visualfsharp.git acv1 bfea9e06a9cc36f12a0818313ff30bc0569b3083 221dd7eecf53a5392e7717afd7f243caee27f1f9 MSRC-DON-OFFICE 187.94 10.41 27.10 45.64 59.54 50.11 +https://github.com/dsyme/visualfsharp.git acv1 e37c1a96f3a3069ef37fb4325eeb09385e419cb6 221dd7eecf53a5392e7717afd7f243caee27f1f9 MSRC-DON-OFFICE 208.41 11.27 29.50 46.96 63.70 53.26 +https://github.com/dsyme/visualfsharp.git acv1 e37c1a96f3a3069ef37fb4325eeb09385e419cb6 d2e4570c47de0dbfb85223971ab8f1a7740182c7 MSRC-DON-OFFICE 221.65 11.26 30.01 47.00 62.40 51.17 +https://github.com/dsyme/visualfsharp.git acv1 e37c1a96f3a3069ef37fb4325eeb09385e419cb6 3f155eba7d5b8d32fc1ad88c49d61fbaf7391cd4 MSRC-DON-OFFICE 201.02 10.69 27.09 43.86 58.77 52.16 +https://github.com/dsyme/visualfsharp.git acv1 e37c1a96f3a3069ef37fb4325eeb09385e419cb6 ba63403cb5898596c5e875a14ce22b33ef618c01 MSRC-DON-OFFICE 196.14 10.69 29.19 46.88 62.15 51.86 +https://github.com/dsyme/visualfsharp.git acv1 e37c1a96f3a3069ef37fb4325eeb09385e419cb6 ba63403cb5898596c5e875a14ce22b33ef618c01 MSRC-DON-OFFICE 200.59 10.45 30.36 46.08 63.29 52.91 +https://github.com/dsyme/visualfsharp.git acv1 e37c1a96f3a3069ef37fb4325eeb09385e419cb6 ba63403cb5898596c5e875a14ce22b33ef618c01 MSRC-DON-OFFICE 197.20 11.72 44.46 36.39 48.72 63.65 +https://github.com/dsyme/visualfsharp.git acv1 e37c1a96f3a3069ef37fb4325eeb09385e419cb6 458e6c29d7e059a5a8a7b4cd7858c7d633fb5906 MSRC-DON-OFFICE 195.34 10.00 29.05 44.33 62.73 53.00 +https://github.com/dsyme/visualfsharp.git acv1 e37c1a96f3a3069ef37fb4325eeb09385e419cb6 7e1fd6ac330f86597f3167e8067cfd805a89eec9 MSRC-DON-OFFICE 228.81 10.68 33.93 47.92 52.76 41.37 -https://github.com/manofstick/visualfsharp.git all-your-collections-are-belong-to-us f82aac764e8c52fafe1044618292aa3524b9fe2f 221dd7eecf53a5392e7717afd7f243caee27f1f9 226.24 11.66 35.81 49.91 66.98 52.55 -https://github.com/manofstick/visualfsharp.git all-your-collections-are-belong-to-us f82aac764e8c52fafe1044618292aa3524b9fe2f 221dd7eecf53a5392e7717afd7f243caee27f1f9 218.95 11.35 38.69 53.11 74.24 53.67 -https://github.com/manofstick/visualfsharp.git all-your-collections-are-belong-to-us 91367119340ee70de8a45f4b09e2381546c13e06 3f155eba7d5b8d32fc1ad88c49d61fbaf7391cd4 227.22 11.72 33.99 58.92 59.92 37.84 -https://github.com/manofstick/visualfsharp.git all-your-collections-are-belong-to-us 87dafbc17b494c438b6db9e59e064736bd8a44e2 ba63403cb5898596c5e875a14ce22b33ef618c01 223.44 11.53 31.85 49.08 66.13 52.75 -https://github.com/manofstick/visualfsharp.git all-your-collections-are-belong-to-us 87dafbc17b494c438b6db9e59e064736bd8a44e2 ba63403cb5898596c5e875a14ce22b33ef618c01 221.58 11.19 31.91 48.23 66.05 52.99 -https://github.com/manofstick/visualfsharp.git all-your-collections-are-belong-to-us 87dafbc17b494c438b6db9e59e064736bd8a44e2 458e6c29d7e059a5a8a7b4cd7858c7d633fb5906 224.75 11.20 31.09 46.96 63.08 53.08 -https://github.com/manofstick/visualfsharp.git all-your-collections-are-belong-to-us 87dafbc17b494c438b6db9e59e064736bd8a44e2 7e1fd6ac330f86597f3167e8067cfd805a89eec9 235.48 10.83 33.47 47.17 65.56 52.50 +https://github.com/manofstick/visualfsharp.git all-your-collections-are-belong-to-us f82aac764e8c52fafe1044618292aa3524b9fe2f 221dd7eecf53a5392e7717afd7f243caee27f1f9 MSRC-DON-OFFICE 226.24 11.66 35.81 49.91 66.98 52.55 +https://github.com/manofstick/visualfsharp.git all-your-collections-are-belong-to-us f82aac764e8c52fafe1044618292aa3524b9fe2f 221dd7eecf53a5392e7717afd7f243caee27f1f9 MSRC-DON-OFFICE 218.95 11.35 38.69 53.11 74.24 53.67 +https://github.com/manofstick/visualfsharp.git all-your-collections-are-belong-to-us 91367119340ee70de8a45f4b09e2381546c13e06 3f155eba7d5b8d32fc1ad88c49d61fbaf7391cd4 MSRC-DON-OFFICE 227.22 11.72 33.99 58.92 59.92 37.84 +https://github.com/manofstick/visualfsharp.git all-your-collections-are-belong-to-us 87dafbc17b494c438b6db9e59e064736bd8a44e2 ba63403cb5898596c5e875a14ce22b33ef618c01 MSRC-DON-OFFICE 223.44 11.53 31.85 49.08 66.13 52.75 +https://github.com/manofstick/visualfsharp.git all-your-collections-are-belong-to-us 87dafbc17b494c438b6db9e59e064736bd8a44e2 ba63403cb5898596c5e875a14ce22b33ef618c01 MSRC-DON-OFFICE 221.58 11.19 31.91 48.23 66.05 52.99 +https://github.com/manofstick/visualfsharp.git all-your-collections-are-belong-to-us 87dafbc17b494c438b6db9e59e064736bd8a44e2 458e6c29d7e059a5a8a7b4cd7858c7d633fb5906 MSRC-DON-OFFICE 224.75 11.20 31.09 46.96 63.08 53.08 +https://github.com/manofstick/visualfsharp.git all-your-collections-are-belong-to-us 87dafbc17b494c438b6db9e59e064736bd8a44e2 7e1fd6ac330f86597f3167e8067cfd805a89eec9 MSRC-DON-OFFICE 235.48 10.83 33.47 47.17 65.56 52.50 + +https://github.com/dsyme/visualfsharp.git weak1 58bd2bec78f01e57fecff604146a3cc55eec4966 221224e6d20bd835c2b9e01e0a52bf45e740a8d0 MSRC-3617253 260.05 10.97 30.78 47.15 58.04 59.77 +https://github.com/dsyme/visualfsharp.git range1 e49ac8a2f21223e60d0d9597e52ea9e5f8705963 221224e6d20bd835c2b9e01e0a52bf45e740a8d0 MSRC-3617253 275.83 12.79 32.57 53.38 61.94 58.03 +https://github.com/Microsoft/visualfsharp master 221224e6d20bd835c2b9e01e0a52bf45e740a8d0 221224e6d20bd835c2b9e01e0a52bf45e740a8d0 MSRC-3617253 273.00 12.46 32.80 51.38 60.93 58.66 \ No newline at end of file diff --git a/tests/scripts/compiler-perf.fsx b/tests/scripts/compiler-perf.fsx index 6858d8ffe7..04b2770371 100644 --- a/tests/scripts/compiler-perf.fsx +++ b/tests/scripts/compiler-perf.fsx @@ -122,8 +122,9 @@ let build(cloneUrl,sha:string,baseSha,ref,prNumber) = let timesHeaderText, timesText = runScenario "bigfiles" let logFile = "compiler-perf-results.txt" - let logHeader = sprintf "url ref sha base build %s" timesHeaderText - let logLine = sprintf "%s %-28s %s %s %0.2f %s" cloneUrl ref sha baseSha buildTime.TotalSeconds timesText + let logHeader = sprintf "url ref sha base computer build %s" timesHeaderText + let computer = System.Environment.GetEnvironmentVariable("COMPUTERNAME") + let logLine = sprintf "%s %-28s %s %s %s %0.2f %s" cloneUrl ref sha baseSha computer buildTime.TotalSeconds timesText let existing = if File.Exists logFile then File.ReadAllLines(logFile) else [| logHeader |] printfn "writing results %s" logLine From 178fc3175104af0057ae4dd88c7aee9dd72e10a4 Mon Sep 17 00:00:00 2001 From: Matthias Dittrich Date: Sat, 17 Mar 2018 08:03:20 +0100 Subject: [PATCH 128/147] forward warnings when searching for a method overload (#4481) * forward warnings when searching for a method overload, fixes #3752 * add a new test for the bug * simplify test by using a `typecheck/sigs` tests * Update according to test * update test --- src/fsharp/ConstraintSolver.fs | 16 +++++++++------- tests/fsharp/tests.fs | 3 +++ tests/fsharp/typecheck/sigs/neg_issue_3752.bsl | 2 ++ tests/fsharp/typecheck/sigs/neg_issue_3752.fs | 4 ++++ 4 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 tests/fsharp/typecheck/sigs/neg_issue_3752.bsl create mode 100644 tests/fsharp/typecheck/sigs/neg_issue_3752.fs diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index b1b690c6a8..8b1cea8c9f 100644 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -359,7 +359,7 @@ let FilterEachThenUndo f meths = trace.Undo() match CheckNoErrorsAndGetWarnings res with | None -> None - | Some warns -> Some (calledMeth, warns.Length, trace)) + | Some warns -> Some (calledMeth, warns, trace)) let ShowAccessDomain ad = match ad with @@ -2194,8 +2194,8 @@ and ResolveOverloading (ArgsEquivInsideUndo csenv cx.IsSome) reqdRetTyOpt calledMeth) with - | [(calledMeth, _, _)] -> - Some calledMeth, CompleteD, NoTrace // Can't re-play the trace since ArgsEquivInsideUndo was used + | [(calledMeth, warns, _)] -> + Some calledMeth, OkResult (warns, ()), NoTrace // Can't re-play the trace since ArgsEquivInsideUndo was used | _ -> // Now determine the applicable methods. @@ -2255,8 +2255,8 @@ and ResolveOverloading None, ErrorD (failOverloading (FSComp.SR.csNoOverloadsFound methodName) errors), NoTrace - | [(calledMeth, _, t)] -> - Some calledMeth, CompleteD, WithTrace t + | [(calledMeth, warns, t)] -> + Some calledMeth, OkResult (warns, ()), WithTrace t | applicableMeths -> @@ -2292,7 +2292,9 @@ and ResolveOverloading if c <> 0 then c else 0 - let better (candidate:CalledMeth<_>, candidateWarnCount, _) (other:CalledMeth<_>, otherWarnCount, _) = + let better (candidate:CalledMeth<_>, candidateWarnings, _) (other:CalledMeth<_>, otherwarnings, _) = + let candidateWarnCount = List.length candidateWarnings + let otherWarnCount = List.length otherwarnings // Prefer methods that don't give "this code is less generic" warnings // Note: Relies on 'compare' respecting true > false let c = compare (candidateWarnCount = 0) (otherWarnCount = 0) @@ -2383,7 +2385,7 @@ and ResolveOverloading else None) match bestMethods with - | [(calledMeth, _, t)] -> Some calledMeth, CompleteD, WithTrace t + | [(calledMeth, warns, t)] -> Some calledMeth, OkResult (warns, ()), WithTrace t | bestMethods -> let methodNames = let methods = diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index 886f61bb98..ef09425a21 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -2168,6 +2168,9 @@ module TypecheckTests = [] let ``type check neg101`` () = singleNegTest (testConfig "typecheck/sigs") "neg101" + [] + let ``type check neg_issue_3752`` () = singleNegTest (testConfig "typecheck/sigs") "neg_issue_3752" + [] let ``type check neg_byref_1`` () = singleNegTest (testConfig "typecheck/sigs") "neg_byref_1" diff --git a/tests/fsharp/typecheck/sigs/neg_issue_3752.bsl b/tests/fsharp/typecheck/sigs/neg_issue_3752.bsl new file mode 100644 index 0000000000..2f18f739a0 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg_issue_3752.bsl @@ -0,0 +1,2 @@ + +neg_issue_3752.fs(4,19,4,46): typecheck error FS0064: This construct causes code to be less generic than indicated by the type annotations. The type variable 'a has been constrained to be type 'string'. diff --git a/tests/fsharp/typecheck/sigs/neg_issue_3752.fs b/tests/fsharp/typecheck/sigs/neg_issue_3752.fs new file mode 100644 index 0000000000..27d70b9490 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg_issue_3752.fs @@ -0,0 +1,4 @@ +module Test +let memoizeBy (getKey : 'a -> string) (f: 'a -> 'b) : 'a -> 'b = + let cache = System.Collections.Concurrent.ConcurrentDictionary() + fun (x: 'a) -> cache.GetOrAdd(getKey x, f) From 4df997507226caa272f2c7d4fbdc52eb71c8ead2 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Mon, 19 Mar 2018 14:39:21 +0000 Subject: [PATCH 129/147] Fixes to help make VisualFSharp.sln more usable (#4555) * fixes for VisualFSharp.sln usage * fixes for VisualFSharp.sln usage * Update FSharpEmbedResourceText.fs * move MockTypeProviders * rename vsintegration/tests/unittests --> vsintegration/VisualFSharp.UnitTests * rename again * fix paths --- VisualFSharp.sln | 26 ++++++++--------- build-everything.proj | 7 +++++ .../FSharp.Build/FSharpEmbedResourceText.fs | 14 ++++++---- tests/scripts/compiler-perf-results.txt | 2 +- .../fsharp-vsintegration-unittests-build.proj | 28 +++++++++---------- .../src/FSharp.Editor/FSharp.Editor.fsproj | 3 +- .../FSharp.LanguageService.Base.csproj | 3 +- .../FSharp.LanguageService.fsproj | 3 +- .../Project/ProjectSystem.Base.csproj | 3 +- .../ProjectSystem.fsproj | 3 +- .../FSharp.PropertiesPages.vbproj | 1 + .../src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj | 3 +- .../ArtificalEventInfo.cs | 0 .../ArtificialConstructorInfo.cs | 0 .../ArtificialMethodInfo.cs | 0 .../ArtificialParamInfo.cs | 0 .../ArtificialPropertyInfo.cs | 0 .../ArtificialType.cs | 0 .../DefinitionLocationAttribute.csproj | 2 +- .../TypeProviderInCSharp.cs | 0 .../ArtificalEventInfo.cs | 0 .../ArtificialConstructorInfo.cs | 0 .../ArtificialMethodInfo.cs | 0 .../ArtificialParamInfo.cs | 0 .../ArtificialPropertyInfo.cs | 0 .../ArtificialType.cs | 0 ...onLocationAttributeFileDoesnotExist.csproj | 2 +- .../TypeProviderInCSharp.cs | 0 .../ArtificalEventInfo.cs | 0 .../ArtificialConstructorInfo.cs | 0 .../ArtificialMethodInfo.cs | 0 .../ArtificialParamInfo.cs | 0 .../ArtificialPropertyInfo.cs | 0 .../ArtificialType.cs | 0 ...onLocationAttributeLineDoesnotExist.csproj | 2 +- .../TypeProviderInCSharp.cs | 0 .../ArtificalEventInfo.cs | 0 .../ArtificialConstructorInfo.cs | 0 .../ArtificialMethodInfo.cs | 0 .../ArtificialParamInfo.cs | 0 .../ArtificialPropertyInfo.cs | 0 .../ArtificialType.cs | 0 ...LocationAttributeWithSpaceInTheType.csproj | 2 +- .../TypeProviderInCSharp.cs | 0 .../MockTypeProviders/Directory.Build.props | 0 .../MockTypeProviders/Directory.Build.targets | 0 .../DummyProviderForLanguageServiceTesting.fs | 0 ...myProviderForLanguageServiceTesting.fsproj | 2 +- .../FSData.txt | 0 .../ProvidedTypes.fs | 0 .../ProvidedTypes.fsi | 0 .../ArtificalEventInfo.cs | 0 .../ArtificialConstructorInfo.cs | 0 .../ArtificialMethodInfo.cs | 0 .../ArtificialParamInfo.cs | 0 .../ArtificialPropertyInfo.cs | 0 .../ArtificialType.cs | 0 .../EditorHideMethodsAttribute.csproj | 2 +- .../TypeProviderInCSharp.cs | 0 .../EmptyAssembly/EmptyAssembly.fs | 0 .../EmptyAssembly/EmptyAssembly.fsproj | 2 +- .../MockTypeProviders/Helpers.cs | 0 .../ArtificalEventInfo.cs | 0 .../ArtificialConstructorInfo.cs | 0 .../ArtificialMethodInfo.cs | 0 .../ArtificialParamInfo.cs | 0 .../ArtificialPropertyInfo.cs | 0 .../ArtificialType.cs | 0 .../TypeProviderInCSharp.cs | 0 .../XmlDocAttributeWithAdequateComment.csproj | 2 +- .../ArtificalEventInfo.cs | 0 .../ArtificialConstructorInfo.cs | 0 .../ArtificialMethodInfo.cs | 0 .../ArtificialParamInfo.cs | 0 .../ArtificialPropertyInfo.cs | 0 .../ArtificialType.cs | 0 .../TypeProviderInCSharp.cs | 0 .../XmlDocAttributeWithEmptyComment.csproj | 2 +- .../ArtificalEventInfo.cs | 0 .../ArtificialConstructorInfo.cs | 0 .../ArtificialMethodInfo.cs | 0 .../ArtificialParamInfo.cs | 0 .../ArtificialPropertyInfo.cs | 0 .../ArtificialType.cs | 0 .../TypeProviderInCSharp.cs | 0 ...XmlDocAttributeWithLocalizedComment.csproj | 2 +- .../ArtificalEventInfo.cs | 0 .../ArtificialConstructorInfo.cs | 0 .../ArtificialMethodInfo.cs | 0 .../ArtificialParamInfo.cs | 0 .../ArtificialPropertyInfo.cs | 0 .../ArtificialType.cs | 0 .../TypeProviderInCSharp.cs | 0 .../XmlDocAttributeWithLongComment.csproj | 2 +- .../ArtificalEventInfo.cs | 0 .../ArtificialConstructorInfo.cs | 0 .../ArtificialMethodInfo.cs | 0 .../ArtificialParamInfo.cs | 0 .../ArtificialPropertyInfo.cs | 0 .../ArtificialType.cs | 0 .../TypeProviderInCSharp.cs | 0 .../XmlDocAttributeWithNullComment.csproj | 2 +- .../tests/Salsa/VisualFSharp.Salsa.fsproj | 1 + .../BraceMatchingServiceTests.fs | 0 .../BreakpointResolutionService.fs | 0 .../ColorizationServiceTests.fs | 0 .../CompletionProviderTests.fs | 2 +- .../DocumentDiagnosticAnalyzerTests.fs | 0 .../DocumentHighlightsServiceTests.fs | 2 +- .../EditorFormattingServiceTests.fs | 0 .../GoToDefinitionServiceTests.fs | 2 +- .../HelpContextServiceTests.fs | 0 .../IndentationServiceTests.fs | 0 .../LanguageDebugInfoServiceTests.fs | 0 .../Tests.LanguageService.Completion.fs | 0 .../Tests.LanguageService.ErrorList.fs | 0 .../Tests.LanguageService.ErrorRecovery.fs | 0 .../Tests.LanguageService.General.fs | 0 .../Tests.LanguageService.GotoDefinition.fs | 0 .../Tests.LanguageService.IncrementalBuild.fs | 0 .../Tests.LanguageService.NavigationBar.fs | 0 .../Tests.LanguageService.ParameterInfo.fs | 0 .../Tests.LanguageService.QuickInfo.fs | 0 .../Tests.LanguageService.QuickParse.fs | 0 .../Tests.LanguageService.Script.fs | 0 .../Tests.LanguageService.TimeStamp.fs | 0 .../Tests.ProjectSystem.Configs.fs | 0 .../Tests.ProjectSystem.Miscellaneous.fs | 0 .../Tests.ProjectSystem.MultiTargeting.fs | 0 .../Tests.ProjectSystem.Project.fs | 0 .../Tests.ProjectSystem.ProjectItems.fs | 0 .../Tests.ProjectSystem.References.fs | 0 .../Tests.ProjectSystem.RoundTrip.fs | 0 .../Tests.ProjectSystem.UpToDate.fs | 0 .../ProjectDiagnosticAnalyzerTests.fs | 0 .../QuickInfoProviderTests.fs | 2 +- .../Resources/TestTypeProvider.Negative1.fsx | 0 .../Resources/TestTypeProvider.Positive1.fsx | 0 .../SignatureHelpProviderTests.fs | 2 +- .../TestLib.LanguageService.fs | 0 .../TestLib.ProjectSystem.fs | 0 .../{unittests => UnitTests}/TestLib.Salsa.fs | 0 .../{unittests => UnitTests}/TestLib.Utils.fs | 0 .../{unittests => UnitTests}/Tests.Build.fs | 0 .../Tests.InternalCollections.fs | 0 .../Tests.Powerpack.fs | 0 .../Tests.TaskReporter.fs | 0 .../{unittests => UnitTests}/Tests.Watson.fs | 0 .../Tests.XmlDocComments.fs | 0 .../UnusedOpensTests.fs | 0 .../VisualFSharp.UnitTests.dll.config | 0 .../VisualFSharp.UnitTests.fsproj | 1 + .../UnitTests}/app.runsettings | 0 153 files changed, 75 insertions(+), 57 deletions(-) rename vsintegration/tests/{unittests => }/MockTypeProviders/DefinitionLocationAttribute/ArtificalEventInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DefinitionLocationAttribute/ArtificialConstructorInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DefinitionLocationAttribute/ArtificialMethodInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DefinitionLocationAttribute/ArtificialParamInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DefinitionLocationAttribute/ArtificialPropertyInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DefinitionLocationAttribute/ArtificialType.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DefinitionLocationAttribute/DefinitionLocationAttribute.csproj (95%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DefinitionLocationAttribute/TypeProviderInCSharp.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificalEventInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialConstructorInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialMethodInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialParamInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialPropertyInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialType.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/DefinitionLocationAttributeFileDoesnotExist.csproj (95%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/TypeProviderInCSharp.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificalEventInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialConstructorInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialMethodInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialParamInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialPropertyInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialType.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/DefinitionLocationAttributeLineDoesnotExist.csproj (95%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/TypeProviderInCSharp.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificalEventInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialConstructorInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialMethodInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialParamInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialPropertyInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialType.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/DefinitionLocationAttributeWithSpaceInTheType.csproj (95%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/TypeProviderInCSharp.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/Directory.Build.props (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/Directory.Build.targets (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj (95%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DummyProviderForLanguageServiceTesting/FSData.txt (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DummyProviderForLanguageServiceTesting/ProvidedTypes.fs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/DummyProviderForLanguageServiceTesting/ProvidedTypes.fsi (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/EditorHideMethodsAttribute/ArtificalEventInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/EditorHideMethodsAttribute/ArtificialConstructorInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/EditorHideMethodsAttribute/ArtificialMethodInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/EditorHideMethodsAttribute/ArtificialParamInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/EditorHideMethodsAttribute/ArtificialPropertyInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/EditorHideMethodsAttribute/ArtificialType.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/EditorHideMethodsAttribute/EditorHideMethodsAttribute.csproj (95%) rename vsintegration/tests/{unittests => }/MockTypeProviders/EditorHideMethodsAttribute/TypeProviderInCSharp.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/EmptyAssembly/EmptyAssembly.fs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/EmptyAssembly/EmptyAssembly.fsproj (95%) rename vsintegration/tests/{unittests => }/MockTypeProviders/Helpers.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificalEventInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialConstructorInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialMethodInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialParamInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialPropertyInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialType.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithAdequateComment/TypeProviderInCSharp.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithAdequateComment/XmlDocAttributeWithAdequateComment.csproj (95%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificalEventInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialConstructorInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialMethodInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialParamInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialPropertyInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialType.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithEmptyComment/TypeProviderInCSharp.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithEmptyComment/XmlDocAttributeWithEmptyComment.csproj (95%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificalEventInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialConstructorInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialMethodInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialParamInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialPropertyInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialType.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithLocalizedComment/TypeProviderInCSharp.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithLocalizedComment/XmlDocAttributeWithLocalizedComment.csproj (95%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificalEventInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialConstructorInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialMethodInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialParamInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialPropertyInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialType.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithLongComment/TypeProviderInCSharp.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithLongComment/XmlDocAttributeWithLongComment.csproj (95%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificalEventInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialConstructorInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialMethodInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialParamInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialPropertyInfo.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialType.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithNullComment/TypeProviderInCSharp.cs (100%) rename vsintegration/tests/{unittests => }/MockTypeProviders/XmlDocAttributeWithNullComment/XmlDocAttributeWithNullComment.csproj (95%) rename vsintegration/tests/{unittests => UnitTests}/BraceMatchingServiceTests.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/BreakpointResolutionService.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/ColorizationServiceTests.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/CompletionProviderTests.fs (99%) rename vsintegration/tests/{unittests => UnitTests}/DocumentDiagnosticAnalyzerTests.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/DocumentHighlightsServiceTests.fs (98%) rename vsintegration/tests/{unittests => UnitTests}/EditorFormattingServiceTests.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/GoToDefinitionServiceTests.fs (98%) rename vsintegration/tests/{unittests => UnitTests}/HelpContextServiceTests.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/IndentationServiceTests.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/LanguageDebugInfoServiceTests.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/LegacyLanguageService/Tests.LanguageService.Completion.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/LegacyLanguageService/Tests.LanguageService.ErrorList.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/LegacyLanguageService/Tests.LanguageService.ErrorRecovery.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/LegacyLanguageService/Tests.LanguageService.General.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/LegacyLanguageService/Tests.LanguageService.GotoDefinition.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/LegacyLanguageService/Tests.LanguageService.IncrementalBuild.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/LegacyLanguageService/Tests.LanguageService.NavigationBar.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/LegacyLanguageService/Tests.LanguageService.ParameterInfo.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/LegacyLanguageService/Tests.LanguageService.QuickInfo.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/LegacyLanguageService/Tests.LanguageService.QuickParse.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/LegacyLanguageService/Tests.LanguageService.Script.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/LegacyLanguageService/Tests.LanguageService.TimeStamp.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/LegacyProjectSystem/Tests.ProjectSystem.Configs.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/LegacyProjectSystem/Tests.ProjectSystem.Miscellaneous.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/LegacyProjectSystem/Tests.ProjectSystem.MultiTargeting.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/LegacyProjectSystem/Tests.ProjectSystem.Project.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/LegacyProjectSystem/Tests.ProjectSystem.ProjectItems.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/LegacyProjectSystem/Tests.ProjectSystem.References.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/LegacyProjectSystem/Tests.ProjectSystem.RoundTrip.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/LegacyProjectSystem/Tests.ProjectSystem.UpToDate.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/ProjectDiagnosticAnalyzerTests.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/QuickInfoProviderTests.fs (99%) rename vsintegration/tests/{unittests => UnitTests}/Resources/TestTypeProvider.Negative1.fsx (100%) rename vsintegration/tests/{unittests => UnitTests}/Resources/TestTypeProvider.Positive1.fsx (100%) rename vsintegration/tests/{unittests => UnitTests}/SignatureHelpProviderTests.fs (99%) rename vsintegration/tests/{unittests => UnitTests}/TestLib.LanguageService.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/TestLib.ProjectSystem.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/TestLib.Salsa.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/TestLib.Utils.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/Tests.Build.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/Tests.InternalCollections.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/Tests.Powerpack.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/Tests.TaskReporter.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/Tests.Watson.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/Tests.XmlDocComments.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/UnusedOpensTests.fs (100%) rename vsintegration/tests/{unittests => UnitTests}/VisualFSharp.UnitTests.dll.config (100%) rename vsintegration/tests/{unittests => UnitTests}/VisualFSharp.UnitTests.fsproj (99%) rename vsintegration/{src/unittests => tests/UnitTests}/app.runsettings (100%) diff --git a/VisualFSharp.sln b/VisualFSharp.sln index 13d2abc2e3..3d3a37ecdf 100644 --- a/VisualFSharp.sln +++ b/VisualFSharp.sln @@ -32,31 +32,31 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{CFE3259A EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "VisualFSharp.Salsa", "vsintegration\tests\Salsa\VisualFSharp.Salsa.fsproj", "{FBD4B354-DC6E-4032-8EC7-C81D8DFB1AF7}" EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "VisualFSharp.UnitTests", "vsintegration\tests\unittests\VisualFSharp.UnitTests.fsproj", "{EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}" +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "VisualFSharp.UnitTests", "vsintegration\tests\UnitTests\VisualFSharp.UnitTests.fsproj", "{EE85AAB7-CDA0-4C4E-BDA0-A64DDDD13E3F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DefinitionLocationAttribute", "vsintegration\tests\unittests\MockTypeProviders\DefinitionLocationAttribute\DefinitionLocationAttribute.csproj", "{DA39AD38-4A58-47BF-9215-E49768295169}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DefinitionLocationAttribute", "vsintegration\tests\MockTypeProviders\DefinitionLocationAttribute\DefinitionLocationAttribute.csproj", "{DA39AD38-4A58-47BF-9215-E49768295169}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DefinitionLocationAttributeFileDoesnotExist", "vsintegration\tests\unittests\MockTypeProviders\DefinitionLocationAttributeFileDoesnotExist\DefinitionLocationAttributeFileDoesnotExist.csproj", "{8C2439BD-0E49-4929-A8B1-29CEE228191E}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DefinitionLocationAttributeFileDoesnotExist", "vsintegration\tests\MockTypeProviders\DefinitionLocationAttributeFileDoesnotExist\DefinitionLocationAttributeFileDoesnotExist.csproj", "{8C2439BD-0E49-4929-A8B1-29CEE228191E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DefinitionLocationAttributeLineDoesnotExist", "vsintegration\tests\unittests\MockTypeProviders\DefinitionLocationAttributeLineDoesnotExist\DefinitionLocationAttributeLineDoesnotExist.csproj", "{F47196DC-186D-4055-BAF2-658282A12F33}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DefinitionLocationAttributeLineDoesnotExist", "vsintegration\tests\MockTypeProviders\DefinitionLocationAttributeLineDoesnotExist\DefinitionLocationAttributeLineDoesnotExist.csproj", "{F47196DC-186D-4055-BAF2-658282A12F33}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DefinitionLocationAttributeWithSpaceInTheType", "vsintegration\tests\unittests\MockTypeProviders\DefinitionLocationAttributeWithSpaceInTheType\DefinitionLocationAttributeWithSpaceInTheType.csproj", "{D4C88934-5893-467E-A55C-A11ECD6479FE}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DefinitionLocationAttributeWithSpaceInTheType", "vsintegration\tests\MockTypeProviders\DefinitionLocationAttributeWithSpaceInTheType\DefinitionLocationAttributeWithSpaceInTheType.csproj", "{D4C88934-5893-467E-A55C-A11ECD6479FE}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "DummyProviderForLanguageServiceTesting", "vsintegration\tests\unittests\MockTypeProviders\DummyProviderForLanguageServiceTesting\DummyProviderForLanguageServiceTesting.fsproj", "{6AFF752D-E991-4A08-9ED2-5BF46B0E0F8B}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "DummyProviderForLanguageServiceTesting", "vsintegration\tests\MockTypeProviders\DummyProviderForLanguageServiceTesting\DummyProviderForLanguageServiceTesting.fsproj", "{6AFF752D-E991-4A08-9ED2-5BF46B0E0F8B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EditorHideMethodsAttribute", "vsintegration\tests\unittests\MockTypeProviders\EditorHideMethodsAttribute\EditorHideMethodsAttribute.csproj", "{0B9CDEAF-EE8F-45E0-A4E0-34A8ED6DD09E}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EditorHideMethodsAttribute", "vsintegration\tests\MockTypeProviders\EditorHideMethodsAttribute\EditorHideMethodsAttribute.csproj", "{0B9CDEAF-EE8F-45E0-A4E0-34A8ED6DD09E}" EndProject -Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "EmptyAssembly", "vsintegration\tests\unittests\MockTypeProviders\EmptyAssembly\EmptyAssembly.fsproj", "{004982C6-93EA-4E70-B4F0-BE7D7219926A}" +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "EmptyAssembly", "vsintegration\tests\MockTypeProviders\EmptyAssembly\EmptyAssembly.fsproj", "{004982C6-93EA-4E70-B4F0-BE7D7219926A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlDocAttributeWithAdequateComment", "vsintegration\tests\unittests\MockTypeProviders\XmlDocAttributeWithAdequateComment\XmlDocAttributeWithAdequateComment.csproj", "{243A81AC-A954-4601-833A-60EEEFB00FCD}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlDocAttributeWithAdequateComment", "vsintegration\tests\MockTypeProviders\XmlDocAttributeWithAdequateComment\XmlDocAttributeWithAdequateComment.csproj", "{243A81AC-A954-4601-833A-60EEEFB00FCD}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlDocAttributeWithEmptyComment", "vsintegration\tests\unittests\MockTypeProviders\XmlDocAttributeWithEmptyComment\XmlDocAttributeWithEmptyComment.csproj", "{B4595EB6-053A-400E-AA1B-7727F1BC900F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlDocAttributeWithEmptyComment", "vsintegration\tests\MockTypeProviders\XmlDocAttributeWithEmptyComment\XmlDocAttributeWithEmptyComment.csproj", "{B4595EB6-053A-400E-AA1B-7727F1BC900F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlDocAttributeWithLocalizedComment", "vsintegration\tests\unittests\MockTypeProviders\XmlDocAttributeWithLocalizedComment\XmlDocAttributeWithLocalizedComment.csproj", "{A559D7E8-7EFD-473A-B618-A10B41AB523B}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlDocAttributeWithLocalizedComment", "vsintegration\tests\MockTypeProviders\XmlDocAttributeWithLocalizedComment\XmlDocAttributeWithLocalizedComment.csproj", "{A559D7E8-7EFD-473A-B618-A10B41AB523B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlDocAttributeWithLongComment", "vsintegration\tests\unittests\MockTypeProviders\XmlDocAttributeWithLongComment\XmlDocAttributeWithLongComment.csproj", "{AC85EE6D-033C-45F9-B8BA-884BC22EC6D9}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlDocAttributeWithLongComment", "vsintegration\tests\MockTypeProviders\XmlDocAttributeWithLongComment\XmlDocAttributeWithLongComment.csproj", "{AC85EE6D-033C-45F9-B8BA-884BC22EC6D9}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlDocAttributeWithNullComment", "vsintegration\tests\unittests\MockTypeProviders\XmlDocAttributeWithNullComment\XmlDocAttributeWithNullComment.csproj", "{956BBE41-ABD1-4DBA-9F3B-BA1C9821C98C}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XmlDocAttributeWithNullComment", "vsintegration\tests\MockTypeProviders\XmlDocAttributeWithNullComment\XmlDocAttributeWithNullComment.csproj", "{956BBE41-ABD1-4DBA-9F3B-BA1C9821C98C}" EndProject Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Build", "src\fsharp\FSharp.Build\FSharp.Build.fsproj", "{702A7979-BCF9-4C41-853E-3ADFC9897890}" EndProject diff --git a/build-everything.proj b/build-everything.proj index 4dc7d128a4..34b2eb335d 100644 --- a/build-everything.proj +++ b/build-everything.proj @@ -34,6 +34,7 @@ + true true @@ -103,9 +104,15 @@ + + + + + + true diff --git a/src/fsharp/FSharp.Build/FSharpEmbedResourceText.fs b/src/fsharp/FSharp.Build/FSharpEmbedResourceText.fs index e5c77a365e..8be55fda90 100644 --- a/src/fsharp/FSharp.Build/FSharpEmbedResourceText.fs +++ b/src/fsharp/FSharp.Build/FSharpEmbedResourceText.fs @@ -348,14 +348,16 @@ open Printf let outFilename = Path.Combine(_outputPath, justfilename + ".fs") let outXmlFilename = Path.Combine(_outputPath, justfilename + ".resx") - if File.Exists(outFilename) && - File.Exists(outXmlFilename) && - File.Exists(filename) && - File.GetLastWriteTimeUtc(filename) <= File.GetLastWriteTimeUtc(outFilename) && - File.GetLastWriteTimeUtc(filename) <= File.GetLastWriteTimeUtc(outXmlFilename) then - printMessage (sprintf "Skipping generation of %s and %s since up-to-date" outFilename outXmlFilename) + let condition1 = File.Exists(outFilename) + let condition2 = condition1 && File.Exists(outXmlFilename) + let condition3 = condition2 && File.Exists(filename) + let condition4 = condition3 && (File.GetLastWriteTimeUtc(filename) <= File.GetLastWriteTimeUtc(outFilename)) + let condition5 = condition4 && (File.GetLastWriteTimeUtc(filename) <= File.GetLastWriteTimeUtc(outXmlFilename) ) + if condition5 then + printMessage (sprintf "Skipping generation of %s and %s from %s since up-to-date" outFilename outXmlFilename filename) Some (filename, outFilename, outXmlFilename) else + printMessage (sprintf "Generating %s and %s from %s, because condition %d is false, see FSharpEmbedResourceText.fs in the F# source" outFilename outXmlFilename filename (if not condition1 then 1 elif not condition2 then 2 elif not condition3 then 3 elif not condition4 then 4 else 5) ) printMessage (sprintf "Reading %s" filename) let lines = File.ReadAllLines(filename) diff --git a/tests/scripts/compiler-perf-results.txt b/tests/scripts/compiler-perf-results.txt index ef7f6e901d..e5d28e9dca 100644 --- a/tests/scripts/compiler-perf-results.txt +++ b/tests/scripts/compiler-perf-results.txt @@ -134,4 +134,4 @@ https://github.com/manofstick/visualfsharp.git all-your-collections-are-belong-t https://github.com/dsyme/visualfsharp.git weak1 58bd2bec78f01e57fecff604146a3cc55eec4966 221224e6d20bd835c2b9e01e0a52bf45e740a8d0 MSRC-3617253 260.05 10.97 30.78 47.15 58.04 59.77 https://github.com/dsyme/visualfsharp.git range1 e49ac8a2f21223e60d0d9597e52ea9e5f8705963 221224e6d20bd835c2b9e01e0a52bf45e740a8d0 MSRC-3617253 275.83 12.79 32.57 53.38 61.94 58.03 -https://github.com/Microsoft/visualfsharp master 221224e6d20bd835c2b9e01e0a52bf45e740a8d0 221224e6d20bd835c2b9e01e0a52bf45e740a8d0 MSRC-3617253 273.00 12.46 32.80 51.38 60.93 58.66 \ No newline at end of file +https://github.com/Microsoft/visualfsharp master 221224e6d20bd835c2b9e01e0a52bf45e740a8d0 221224e6d20bd835c2b9e01e0a52bf45e740a8d0 MSRC-3617253 273.00 12.46 32.80 51.38 60.93 58.66 diff --git a/vsintegration/fsharp-vsintegration-unittests-build.proj b/vsintegration/fsharp-vsintegration-unittests-build.proj index ece2c1eb69..f461ddc9e9 100644 --- a/vsintegration/fsharp-vsintegration-unittests-build.proj +++ b/vsintegration/fsharp-vsintegration-unittests-build.proj @@ -6,26 +6,26 @@ - + - - - - - - - - - - - - + + + + + + + + + + + + - + diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index 6d64030df3..a03ba5b93f 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -11,6 +11,7 @@ true $(OtherFlags) --warnon:1182 --subsystemversion:6.00 true + false @@ -20,7 +21,7 @@ - + true Microsoft.VisualStudio.FSharp.Editor.SR diff --git a/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj b/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj index e0b895f300..636c1ff171 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj +++ b/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj @@ -11,6 +11,7 @@ $(NoWarn);1570;1574;1587;1591;3001,3002,3003 true true + false @@ -23,7 +24,7 @@ - + ResXCodeGenerator Microsoft.VisualStudio.Package.LanguageService.cs Microsoft.VisualStudio.Package.LanguageServiceResources diff --git a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj index f381f6e61e..3e5a4c453d 100644 --- a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj +++ b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj @@ -11,6 +11,7 @@ true $(OtherFlags) --warnon:1182 --subsystemversion:6.00 true + false @@ -28,7 +29,7 @@ - + true Microsoft.VisualStudio.FSharp.LanguageService.Strings diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj index a7090620e5..f2e30ac08a 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj @@ -14,6 +14,7 @@ Microsoft.VisualStudio.FSharp.ProjectSystem true true + false @@ -24,7 +25,7 @@ - + Microsoft.VisualStudio.Package.Project.resources Designer diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj b/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj index 04a52ef381..fd61a4063f 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj @@ -12,6 +12,7 @@ true $(OtherFlags) --warnon:1182 --subsystemversion:6.00 true + false @@ -25,7 +26,7 @@ false Menus.ctmenu - + true Microsoft.VisualStudio.FSharp.ProjectSystem.FSharpSR true diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj index e3a0ab62a7..75b445bc6b 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj @@ -35,6 +35,7 @@ true true true + false diff --git a/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj index 1c4144a929..03ff7cd35a 100644 --- a/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj +++ b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj @@ -11,6 +11,7 @@ true $(OtherFlags) --subsystemversion:6.00 true + false @@ -35,7 +36,7 @@ - + true Microsoft.VisualStudio.FSharp.Interactive.SRProperties true diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificalEventInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/ArtificalEventInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificalEventInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialConstructorInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/ArtificialConstructorInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialConstructorInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialMethodInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/ArtificialMethodInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialMethodInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/ArtificialParamInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialParamInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/ArtificialParamInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialParamInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialPropertyInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/ArtificialPropertyInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialPropertyInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialType.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/ArtificialType.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/ArtificialType.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/DefinitionLocationAttribute.csproj b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/DefinitionLocationAttribute.csproj similarity index 95% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/DefinitionLocationAttribute.csproj rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/DefinitionLocationAttribute.csproj index 798c014807..0b2fc8a750 100644 --- a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/DefinitionLocationAttribute.csproj +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/DefinitionLocationAttribute.csproj @@ -2,7 +2,7 @@ - $(MSBuildProjectDirectory)\..\..\..\..\..\src + $(MSBuildProjectDirectory)\..\..\..\..\src CSharp diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/TypeProviderInCSharp.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttribute/TypeProviderInCSharp.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttribute/TypeProviderInCSharp.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificalEventInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificalEventInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificalEventInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialConstructorInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialConstructorInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialConstructorInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialMethodInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialMethodInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialMethodInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialParamInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialParamInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialParamInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialParamInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialPropertyInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialPropertyInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialPropertyInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialType.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialType.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/ArtificialType.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/DefinitionLocationAttributeFileDoesnotExist.csproj b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/DefinitionLocationAttributeFileDoesnotExist.csproj similarity index 95% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/DefinitionLocationAttributeFileDoesnotExist.csproj rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/DefinitionLocationAttributeFileDoesnotExist.csproj index b66f8de6f0..cf8838f72c 100644 --- a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/DefinitionLocationAttributeFileDoesnotExist.csproj +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/DefinitionLocationAttributeFileDoesnotExist.csproj @@ -2,7 +2,7 @@ - $(MSBuildProjectDirectory)\..\..\..\..\..\src + $(MSBuildProjectDirectory)\..\..\..\..\src CSharp diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/TypeProviderInCSharp.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/TypeProviderInCSharp.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeFileDoesnotExist/TypeProviderInCSharp.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificalEventInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificalEventInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificalEventInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialConstructorInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialConstructorInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialConstructorInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialMethodInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialMethodInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialMethodInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialParamInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialParamInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialParamInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialParamInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialPropertyInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialPropertyInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialPropertyInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialType.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialType.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/ArtificialType.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/DefinitionLocationAttributeLineDoesnotExist.csproj b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/DefinitionLocationAttributeLineDoesnotExist.csproj similarity index 95% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/DefinitionLocationAttributeLineDoesnotExist.csproj rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/DefinitionLocationAttributeLineDoesnotExist.csproj index 9895bd74f4..c4c480ee52 100644 --- a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/DefinitionLocationAttributeLineDoesnotExist.csproj +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/DefinitionLocationAttributeLineDoesnotExist.csproj @@ -2,7 +2,7 @@ - $(MSBuildProjectDirectory)\..\..\..\..\..\src + $(MSBuildProjectDirectory)\..\..\..\..\src CSharp diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/TypeProviderInCSharp.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/TypeProviderInCSharp.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeLineDoesnotExist/TypeProviderInCSharp.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificalEventInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificalEventInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificalEventInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialConstructorInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialConstructorInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialConstructorInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialMethodInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialMethodInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialMethodInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialParamInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialParamInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialParamInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialParamInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialPropertyInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialPropertyInfo.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialPropertyInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialType.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialType.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/ArtificialType.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/DefinitionLocationAttributeWithSpaceInTheType.csproj b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/DefinitionLocationAttributeWithSpaceInTheType.csproj similarity index 95% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/DefinitionLocationAttributeWithSpaceInTheType.csproj rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/DefinitionLocationAttributeWithSpaceInTheType.csproj index 73c48bd105..a02e9e3bfa 100644 --- a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/DefinitionLocationAttributeWithSpaceInTheType.csproj +++ b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/DefinitionLocationAttributeWithSpaceInTheType.csproj @@ -2,7 +2,7 @@ - $(MSBuildProjectDirectory)\..\..\..\..\..\src + $(MSBuildProjectDirectory)\..\..\..\..\src CSharp diff --git a/vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/TypeProviderInCSharp.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/TypeProviderInCSharp.cs rename to vsintegration/tests/MockTypeProviders/DefinitionLocationAttributeWithSpaceInTheType/TypeProviderInCSharp.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/Directory.Build.props b/vsintegration/tests/MockTypeProviders/Directory.Build.props similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/Directory.Build.props rename to vsintegration/tests/MockTypeProviders/Directory.Build.props diff --git a/vsintegration/tests/unittests/MockTypeProviders/Directory.Build.targets b/vsintegration/tests/MockTypeProviders/Directory.Build.targets similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/Directory.Build.targets rename to vsintegration/tests/MockTypeProviders/Directory.Build.targets diff --git a/vsintegration/tests/unittests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fs b/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fs rename to vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj b/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj similarity index 95% rename from vsintegration/tests/unittests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj rename to vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj index 5d5f306848..05c38f1a8a 100644 --- a/vsintegration/tests/unittests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj +++ b/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/DummyProviderForLanguageServiceTesting.fsproj @@ -2,7 +2,7 @@ - $(MSBuildProjectDirectory)\..\..\..\..\..\src + $(MSBuildProjectDirectory)\..\..\..\..\src FSharp true diff --git a/vsintegration/tests/unittests/MockTypeProviders/DummyProviderForLanguageServiceTesting/FSData.txt b/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/FSData.txt similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DummyProviderForLanguageServiceTesting/FSData.txt rename to vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/FSData.txt diff --git a/vsintegration/tests/unittests/MockTypeProviders/DummyProviderForLanguageServiceTesting/ProvidedTypes.fs b/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/ProvidedTypes.fs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DummyProviderForLanguageServiceTesting/ProvidedTypes.fs rename to vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/ProvidedTypes.fs diff --git a/vsintegration/tests/unittests/MockTypeProviders/DummyProviderForLanguageServiceTesting/ProvidedTypes.fsi b/vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/ProvidedTypes.fsi similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/DummyProviderForLanguageServiceTesting/ProvidedTypes.fsi rename to vsintegration/tests/MockTypeProviders/DummyProviderForLanguageServiceTesting/ProvidedTypes.fsi diff --git a/vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificalEventInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/ArtificalEventInfo.cs rename to vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificalEventInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialConstructorInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialConstructorInfo.cs rename to vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialConstructorInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialMethodInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialMethodInfo.cs rename to vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialMethodInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialParamInfo.cs b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialParamInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialParamInfo.cs rename to vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialParamInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialPropertyInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialPropertyInfo.cs rename to vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialPropertyInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialType.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialType.cs rename to vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/ArtificialType.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/EditorHideMethodsAttribute.csproj b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/EditorHideMethodsAttribute.csproj similarity index 95% rename from vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/EditorHideMethodsAttribute.csproj rename to vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/EditorHideMethodsAttribute.csproj index 899401d6b2..66baa3dfe1 100644 --- a/vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/EditorHideMethodsAttribute.csproj +++ b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/EditorHideMethodsAttribute.csproj @@ -2,7 +2,7 @@ - $(MSBuildProjectDirectory)\..\..\..\..\..\src + $(MSBuildProjectDirectory)\..\..\..\..\src CSharp diff --git a/vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/TypeProviderInCSharp.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/EditorHideMethodsAttribute/TypeProviderInCSharp.cs rename to vsintegration/tests/MockTypeProviders/EditorHideMethodsAttribute/TypeProviderInCSharp.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/EmptyAssembly/EmptyAssembly.fs b/vsintegration/tests/MockTypeProviders/EmptyAssembly/EmptyAssembly.fs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/EmptyAssembly/EmptyAssembly.fs rename to vsintegration/tests/MockTypeProviders/EmptyAssembly/EmptyAssembly.fs diff --git a/vsintegration/tests/unittests/MockTypeProviders/EmptyAssembly/EmptyAssembly.fsproj b/vsintegration/tests/MockTypeProviders/EmptyAssembly/EmptyAssembly.fsproj similarity index 95% rename from vsintegration/tests/unittests/MockTypeProviders/EmptyAssembly/EmptyAssembly.fsproj rename to vsintegration/tests/MockTypeProviders/EmptyAssembly/EmptyAssembly.fsproj index 6d4faa3992..be555283db 100644 --- a/vsintegration/tests/unittests/MockTypeProviders/EmptyAssembly/EmptyAssembly.fsproj +++ b/vsintegration/tests/MockTypeProviders/EmptyAssembly/EmptyAssembly.fsproj @@ -2,7 +2,7 @@ - $(MSBuildProjectDirectory)\..\..\..\..\..\src + $(MSBuildProjectDirectory)\..\..\..\..\src FSharp diff --git a/vsintegration/tests/unittests/MockTypeProviders/Helpers.cs b/vsintegration/tests/MockTypeProviders/Helpers.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/Helpers.cs rename to vsintegration/tests/MockTypeProviders/Helpers.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificalEventInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificalEventInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificalEventInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialConstructorInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialConstructorInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialConstructorInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialMethodInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialMethodInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialMethodInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialParamInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialParamInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialParamInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialParamInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialPropertyInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialPropertyInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialPropertyInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialType.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialType.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/ArtificialType.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/TypeProviderInCSharp.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/TypeProviderInCSharp.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/TypeProviderInCSharp.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/XmlDocAttributeWithAdequateComment.csproj b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/XmlDocAttributeWithAdequateComment.csproj similarity index 95% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/XmlDocAttributeWithAdequateComment.csproj rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/XmlDocAttributeWithAdequateComment.csproj index 762839f1b6..865547fb51 100644 --- a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithAdequateComment/XmlDocAttributeWithAdequateComment.csproj +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithAdequateComment/XmlDocAttributeWithAdequateComment.csproj @@ -2,7 +2,7 @@ - $(MSBuildProjectDirectory)\..\..\..\..\..\src + $(MSBuildProjectDirectory)\..\..\..\..\src CSharp diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificalEventInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificalEventInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificalEventInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialConstructorInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialConstructorInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialConstructorInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialMethodInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialMethodInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialMethodInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialParamInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialParamInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialParamInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialParamInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialPropertyInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialPropertyInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialPropertyInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialType.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialType.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/ArtificialType.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/TypeProviderInCSharp.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/TypeProviderInCSharp.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/TypeProviderInCSharp.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/XmlDocAttributeWithEmptyComment.csproj b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/XmlDocAttributeWithEmptyComment.csproj similarity index 95% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/XmlDocAttributeWithEmptyComment.csproj rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/XmlDocAttributeWithEmptyComment.csproj index 8cb46c9898..6c71fe6001 100644 --- a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithEmptyComment/XmlDocAttributeWithEmptyComment.csproj +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithEmptyComment/XmlDocAttributeWithEmptyComment.csproj @@ -2,7 +2,7 @@ - $(MSBuildProjectDirectory)\..\..\..\..\..\src + $(MSBuildProjectDirectory)\..\..\..\..\src CSharp diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificalEventInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificalEventInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificalEventInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialConstructorInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialConstructorInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialConstructorInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialMethodInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialMethodInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialMethodInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialParamInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialParamInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialParamInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialParamInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialPropertyInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialPropertyInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialPropertyInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialType.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialType.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/ArtificialType.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/TypeProviderInCSharp.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/TypeProviderInCSharp.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/TypeProviderInCSharp.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/XmlDocAttributeWithLocalizedComment.csproj b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/XmlDocAttributeWithLocalizedComment.csproj similarity index 95% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/XmlDocAttributeWithLocalizedComment.csproj rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/XmlDocAttributeWithLocalizedComment.csproj index a28c3ea6dd..694fcd781e 100644 --- a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/XmlDocAttributeWithLocalizedComment.csproj +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLocalizedComment/XmlDocAttributeWithLocalizedComment.csproj @@ -2,7 +2,7 @@ - $(MSBuildProjectDirectory)\..\..\..\..\..\src + $(MSBuildProjectDirectory)\..\..\..\..\src CSharp diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificalEventInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificalEventInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificalEventInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialConstructorInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialConstructorInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialConstructorInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialMethodInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialMethodInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialMethodInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialParamInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialParamInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialParamInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialParamInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialPropertyInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialPropertyInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialPropertyInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialType.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialType.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/ArtificialType.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/TypeProviderInCSharp.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/TypeProviderInCSharp.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/TypeProviderInCSharp.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/XmlDocAttributeWithLongComment.csproj b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/XmlDocAttributeWithLongComment.csproj similarity index 95% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/XmlDocAttributeWithLongComment.csproj rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/XmlDocAttributeWithLongComment.csproj index ae2742811c..90f90e8798 100644 --- a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithLongComment/XmlDocAttributeWithLongComment.csproj +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithLongComment/XmlDocAttributeWithLongComment.csproj @@ -2,7 +2,7 @@ - $(MSBuildProjectDirectory)\..\..\..\..\..\src + $(MSBuildProjectDirectory)\..\..\..\..\src CSharp diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificalEventInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificalEventInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificalEventInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificalEventInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialConstructorInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialConstructorInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialConstructorInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialConstructorInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialMethodInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialMethodInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialMethodInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialMethodInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialParamInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialParamInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialParamInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialParamInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialPropertyInfo.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialPropertyInfo.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialPropertyInfo.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialPropertyInfo.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialType.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialType.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialType.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/ArtificialType.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/TypeProviderInCSharp.cs b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/TypeProviderInCSharp.cs similarity index 100% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/TypeProviderInCSharp.cs rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/TypeProviderInCSharp.cs diff --git a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/XmlDocAttributeWithNullComment.csproj b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/XmlDocAttributeWithNullComment.csproj similarity index 95% rename from vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/XmlDocAttributeWithNullComment.csproj rename to vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/XmlDocAttributeWithNullComment.csproj index 680fa119ac..525153bff6 100644 --- a/vsintegration/tests/unittests/MockTypeProviders/XmlDocAttributeWithNullComment/XmlDocAttributeWithNullComment.csproj +++ b/vsintegration/tests/MockTypeProviders/XmlDocAttributeWithNullComment/XmlDocAttributeWithNullComment.csproj @@ -2,7 +2,7 @@ - $(MSBuildProjectDirectory)\..\..\..\..\..\src + $(MSBuildProjectDirectory)\..\..\..\..\src CSharp diff --git a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj index be362a884c..9b938e3b8c 100644 --- a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj +++ b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj @@ -8,6 +8,7 @@ $(NoWarn);45;47;52;58;75 true true + false diff --git a/vsintegration/tests/unittests/BraceMatchingServiceTests.fs b/vsintegration/tests/UnitTests/BraceMatchingServiceTests.fs similarity index 100% rename from vsintegration/tests/unittests/BraceMatchingServiceTests.fs rename to vsintegration/tests/UnitTests/BraceMatchingServiceTests.fs diff --git a/vsintegration/tests/unittests/BreakpointResolutionService.fs b/vsintegration/tests/UnitTests/BreakpointResolutionService.fs similarity index 100% rename from vsintegration/tests/unittests/BreakpointResolutionService.fs rename to vsintegration/tests/UnitTests/BreakpointResolutionService.fs diff --git a/vsintegration/tests/unittests/ColorizationServiceTests.fs b/vsintegration/tests/UnitTests/ColorizationServiceTests.fs similarity index 100% rename from vsintegration/tests/unittests/ColorizationServiceTests.fs rename to vsintegration/tests/UnitTests/ColorizationServiceTests.fs diff --git a/vsintegration/tests/unittests/CompletionProviderTests.fs b/vsintegration/tests/UnitTests/CompletionProviderTests.fs similarity index 99% rename from vsintegration/tests/unittests/CompletionProviderTests.fs rename to vsintegration/tests/UnitTests/CompletionProviderTests.fs index 718e34b5ba..4eec07695f 100644 --- a/vsintegration/tests/unittests/CompletionProviderTests.fs +++ b/vsintegration/tests/UnitTests/CompletionProviderTests.fs @@ -11,7 +11,7 @@ // and capturing large amounts of structured output. (* cd Debug\net40\bin - .\fsc.exe --define:EXE -r:.\Microsoft.Build.Utilities.Core.dll -o VisualFSharp.UnitTests.exe -g --optimize- -r .\FSharp.Compiler.Private.dll -r .\FSharp.Editor.dll -r nunit.framework.dll ..\..\..\tests\service\FsUnit.fs ..\..\..\tests\service\Common.fs /delaysign /keyfile:..\..\..\src\fsharp\msft.pubkey ..\..\..\vsintegration\tests\unittests\CompletionProviderTests.fs + .\fsc.exe --define:EXE -r:.\Microsoft.Build.Utilities.Core.dll -o VisualFSharp.UnitTests.exe -g --optimize- -r .\FSharp.Compiler.Private.dll -r .\FSharp.Editor.dll -r nunit.framework.dll ..\..\..\tests\service\FsUnit.fs ..\..\..\tests\service\Common.fs /delaysign /keyfile:..\..\..\src\fsharp\msft.pubkey ..\..\..\vsintegration\tests\UnitTests\CompletionProviderTests.fs .\VisualFSharp.UnitTests.exe *) // Technique 3: diff --git a/vsintegration/tests/unittests/DocumentDiagnosticAnalyzerTests.fs b/vsintegration/tests/UnitTests/DocumentDiagnosticAnalyzerTests.fs similarity index 100% rename from vsintegration/tests/unittests/DocumentDiagnosticAnalyzerTests.fs rename to vsintegration/tests/UnitTests/DocumentDiagnosticAnalyzerTests.fs diff --git a/vsintegration/tests/unittests/DocumentHighlightsServiceTests.fs b/vsintegration/tests/UnitTests/DocumentHighlightsServiceTests.fs similarity index 98% rename from vsintegration/tests/unittests/DocumentHighlightsServiceTests.fs rename to vsintegration/tests/UnitTests/DocumentHighlightsServiceTests.fs index 49bacadf32..9568c64e67 100644 --- a/vsintegration/tests/unittests/DocumentHighlightsServiceTests.fs +++ b/vsintegration/tests/UnitTests/DocumentHighlightsServiceTests.fs @@ -11,7 +11,7 @@ // and capturing large amounts of structured output. (* cd Debug\net40\bin - .\fsc.exe --define:EXE -r:.\Microsoft.Build.Utilities.Core.dll -o VisualFSharp.UnitTests.exe -g --optimize- -r .\FSharp.Compiler.Private.dll -r .\FSharp.Editor.dll -r nunit.framework.dll ..\..\..\tests\service\FsUnit.fs ..\..\..\tests\service\Common.fs /delaysign /keyfile:..\..\..\src\fsharp\msft.pubkey ..\..\..\vsintegration\tests\unittests\CompletionProviderTests.fs + .\fsc.exe --define:EXE -r:.\Microsoft.Build.Utilities.Core.dll -o VisualFSharp.UnitTests.exe -g --optimize- -r .\FSharp.Compiler.Private.dll -r .\FSharp.Editor.dll -r nunit.framework.dll ..\..\..\tests\service\FsUnit.fs ..\..\..\tests\service\Common.fs /delaysign /keyfile:..\..\..\src\fsharp\msft.pubkey ..\..\..\vsintegration\tests\UnitTests\CompletionProviderTests.fs .\VisualFSharp.UnitTests.exe *) // Technique 3: diff --git a/vsintegration/tests/unittests/EditorFormattingServiceTests.fs b/vsintegration/tests/UnitTests/EditorFormattingServiceTests.fs similarity index 100% rename from vsintegration/tests/unittests/EditorFormattingServiceTests.fs rename to vsintegration/tests/UnitTests/EditorFormattingServiceTests.fs diff --git a/vsintegration/tests/unittests/GoToDefinitionServiceTests.fs b/vsintegration/tests/UnitTests/GoToDefinitionServiceTests.fs similarity index 98% rename from vsintegration/tests/unittests/GoToDefinitionServiceTests.fs rename to vsintegration/tests/UnitTests/GoToDefinitionServiceTests.fs index 02d2e39b48..ba67994aa0 100644 --- a/vsintegration/tests/unittests/GoToDefinitionServiceTests.fs +++ b/vsintegration/tests/UnitTests/GoToDefinitionServiceTests.fs @@ -12,7 +12,7 @@ // and capturing large amounts of structured output. (* cd Debug\net40\bin - .\fsc.exe --define:EXE -r:.\Microsoft.Build.Utilities.Core.dll -o VisualFSharp.UnitTests.exe -g --optimize- -r .\FSharp.Compiler.Private.dll -r .\FSharp.Editor.dll -r nunit.framework.dll ..\..\..\tests\service\FsUnit.fs ..\..\..\tests\service\Common.fs /delaysign /keyfile:..\..\..\src\fsharp\msft.pubkey ..\..\..\vsintegration\tests\unittests\GoToDefinitionServiceTests.fs + .\fsc.exe --define:EXE -r:.\Microsoft.Build.Utilities.Core.dll -o VisualFSharp.UnitTests.exe -g --optimize- -r .\FSharp.Compiler.Private.dll -r .\FSharp.Editor.dll -r nunit.framework.dll ..\..\..\tests\service\FsUnit.fs ..\..\..\tests\service\Common.fs /delaysign /keyfile:..\..\..\src\fsharp\msft.pubkey ..\..\..\vsintegration\tests\UnitTests\GoToDefinitionServiceTests.fs .\VisualFSharp.UnitTests.exe *) // Technique 3: diff --git a/vsintegration/tests/unittests/HelpContextServiceTests.fs b/vsintegration/tests/UnitTests/HelpContextServiceTests.fs similarity index 100% rename from vsintegration/tests/unittests/HelpContextServiceTests.fs rename to vsintegration/tests/UnitTests/HelpContextServiceTests.fs diff --git a/vsintegration/tests/unittests/IndentationServiceTests.fs b/vsintegration/tests/UnitTests/IndentationServiceTests.fs similarity index 100% rename from vsintegration/tests/unittests/IndentationServiceTests.fs rename to vsintegration/tests/UnitTests/IndentationServiceTests.fs diff --git a/vsintegration/tests/unittests/LanguageDebugInfoServiceTests.fs b/vsintegration/tests/UnitTests/LanguageDebugInfoServiceTests.fs similarity index 100% rename from vsintegration/tests/unittests/LanguageDebugInfoServiceTests.fs rename to vsintegration/tests/UnitTests/LanguageDebugInfoServiceTests.fs diff --git a/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.Completion.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Completion.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.Completion.fs rename to vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Completion.fs diff --git a/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs rename to vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorList.fs diff --git a/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.ErrorRecovery.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorRecovery.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.ErrorRecovery.fs rename to vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ErrorRecovery.fs diff --git a/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.General.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.General.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.General.fs rename to vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.General.fs diff --git a/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.GotoDefinition.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.GotoDefinition.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.GotoDefinition.fs rename to vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.GotoDefinition.fs diff --git a/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.IncrementalBuild.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.IncrementalBuild.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.IncrementalBuild.fs rename to vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.IncrementalBuild.fs diff --git a/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.NavigationBar.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.NavigationBar.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.NavigationBar.fs rename to vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.NavigationBar.fs diff --git a/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.ParameterInfo.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ParameterInfo.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.ParameterInfo.fs rename to vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.ParameterInfo.fs diff --git a/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.QuickInfo.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.QuickInfo.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.QuickInfo.fs rename to vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.QuickInfo.fs diff --git a/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.QuickParse.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.QuickParse.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.QuickParse.fs rename to vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.QuickParse.fs diff --git a/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.Script.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.Script.fs rename to vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.Script.fs diff --git a/vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.TimeStamp.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.TimeStamp.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyLanguageService/Tests.LanguageService.TimeStamp.fs rename to vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.TimeStamp.fs diff --git a/vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.Configs.fs b/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.Configs.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.Configs.fs rename to vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.Configs.fs diff --git a/vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.Miscellaneous.fs b/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.Miscellaneous.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.Miscellaneous.fs rename to vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.Miscellaneous.fs diff --git a/vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.MultiTargeting.fs b/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.MultiTargeting.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.MultiTargeting.fs rename to vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.MultiTargeting.fs diff --git a/vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.Project.fs b/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.Project.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.Project.fs rename to vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.Project.fs diff --git a/vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.ProjectItems.fs b/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.ProjectItems.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.ProjectItems.fs rename to vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.ProjectItems.fs diff --git a/vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.References.fs b/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.References.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.References.fs rename to vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.References.fs diff --git a/vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.RoundTrip.fs b/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.RoundTrip.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.RoundTrip.fs rename to vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.RoundTrip.fs diff --git a/vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.UpToDate.fs b/vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.UpToDate.fs similarity index 100% rename from vsintegration/tests/unittests/LegacyProjectSystem/Tests.ProjectSystem.UpToDate.fs rename to vsintegration/tests/UnitTests/LegacyProjectSystem/Tests.ProjectSystem.UpToDate.fs diff --git a/vsintegration/tests/unittests/ProjectDiagnosticAnalyzerTests.fs b/vsintegration/tests/UnitTests/ProjectDiagnosticAnalyzerTests.fs similarity index 100% rename from vsintegration/tests/unittests/ProjectDiagnosticAnalyzerTests.fs rename to vsintegration/tests/UnitTests/ProjectDiagnosticAnalyzerTests.fs diff --git a/vsintegration/tests/unittests/QuickInfoProviderTests.fs b/vsintegration/tests/UnitTests/QuickInfoProviderTests.fs similarity index 99% rename from vsintegration/tests/unittests/QuickInfoProviderTests.fs rename to vsintegration/tests/UnitTests/QuickInfoProviderTests.fs index 2487604ce2..f7879bb17e 100644 --- a/vsintegration/tests/unittests/QuickInfoProviderTests.fs +++ b/vsintegration/tests/UnitTests/QuickInfoProviderTests.fs @@ -11,7 +11,7 @@ // and capturing large amounts of structured output. (* cd Debug\net40\bin - .\fsc.exe --define:EXE -r:.\Microsoft.Build.Utilities.Core.dll -o VisualFSharp.UnitTests.exe -g --optimize- -r .\FSharp.Compiler.Private.dll -r .\FSharp.Editor.dll -r nunit.framework.dll ..\..\..\tests\service\FsUnit.fs ..\..\..\tests\service\Common.fs /delaysign /keyfile:..\..\..\src\fsharp\msft.pubkey ..\..\..\vsintegration\tests\unittests\CompletionProviderTests.fs + .\fsc.exe --define:EXE -r:.\Microsoft.Build.Utilities.Core.dll -o VisualFSharp.UnitTests.exe -g --optimize- -r .\FSharp.Compiler.Private.dll -r .\FSharp.Editor.dll -r nunit.framework.dll ..\..\..\tests\service\FsUnit.fs ..\..\..\tests\service\Common.fs /delaysign /keyfile:..\..\..\src\fsharp\msft.pubkey ..\..\..\vsintegration\tests\UnitTests\CompletionProviderTests.fs .\VisualFSharp.UnitTests.exe *) // Technique 3: diff --git a/vsintegration/tests/unittests/Resources/TestTypeProvider.Negative1.fsx b/vsintegration/tests/UnitTests/Resources/TestTypeProvider.Negative1.fsx similarity index 100% rename from vsintegration/tests/unittests/Resources/TestTypeProvider.Negative1.fsx rename to vsintegration/tests/UnitTests/Resources/TestTypeProvider.Negative1.fsx diff --git a/vsintegration/tests/unittests/Resources/TestTypeProvider.Positive1.fsx b/vsintegration/tests/UnitTests/Resources/TestTypeProvider.Positive1.fsx similarity index 100% rename from vsintegration/tests/unittests/Resources/TestTypeProvider.Positive1.fsx rename to vsintegration/tests/UnitTests/Resources/TestTypeProvider.Positive1.fsx diff --git a/vsintegration/tests/unittests/SignatureHelpProviderTests.fs b/vsintegration/tests/UnitTests/SignatureHelpProviderTests.fs similarity index 99% rename from vsintegration/tests/unittests/SignatureHelpProviderTests.fs rename to vsintegration/tests/UnitTests/SignatureHelpProviderTests.fs index 089f31e5b3..661dcd1458 100644 --- a/vsintegration/tests/unittests/SignatureHelpProviderTests.fs +++ b/vsintegration/tests/UnitTests/SignatureHelpProviderTests.fs @@ -12,7 +12,7 @@ // and capturing large amounts of structured output. (* cd Debug\net40\bin - .\fsc.exe --define:EXE -r:.\Microsoft.Build.Utilities.Core.dll -o VisualFSharp.UnitTests.exe -g --optimize- -r .\FSharp.Compiler.Private.dll -r .\FSharp.Editor.dll -r nunit.framework.dll ..\..\..\tests\service\FsUnit.fs ..\..\..\tests\service\Common.fs /delaysign /keyfile:..\..\..\src\fsharp\msft.pubkey ..\..\..\vsintegration\tests\unittests\SignatureHelpProviderTests.fs + .\fsc.exe --define:EXE -r:.\Microsoft.Build.Utilities.Core.dll -o VisualFSharp.UnitTests.exe -g --optimize- -r .\FSharp.Compiler.Private.dll -r .\FSharp.Editor.dll -r nunit.framework.dll ..\..\..\tests\service\FsUnit.fs ..\..\..\tests\service\Common.fs /delaysign /keyfile:..\..\..\src\fsharp\msft.pubkey ..\..\..\vsintegration\tests\UnitTests\SignatureHelpProviderTests.fs .\VisualFSharp.UnitTests.exe *) // Technique 3: diff --git a/vsintegration/tests/unittests/TestLib.LanguageService.fs b/vsintegration/tests/UnitTests/TestLib.LanguageService.fs similarity index 100% rename from vsintegration/tests/unittests/TestLib.LanguageService.fs rename to vsintegration/tests/UnitTests/TestLib.LanguageService.fs diff --git a/vsintegration/tests/unittests/TestLib.ProjectSystem.fs b/vsintegration/tests/UnitTests/TestLib.ProjectSystem.fs similarity index 100% rename from vsintegration/tests/unittests/TestLib.ProjectSystem.fs rename to vsintegration/tests/UnitTests/TestLib.ProjectSystem.fs diff --git a/vsintegration/tests/unittests/TestLib.Salsa.fs b/vsintegration/tests/UnitTests/TestLib.Salsa.fs similarity index 100% rename from vsintegration/tests/unittests/TestLib.Salsa.fs rename to vsintegration/tests/UnitTests/TestLib.Salsa.fs diff --git a/vsintegration/tests/unittests/TestLib.Utils.fs b/vsintegration/tests/UnitTests/TestLib.Utils.fs similarity index 100% rename from vsintegration/tests/unittests/TestLib.Utils.fs rename to vsintegration/tests/UnitTests/TestLib.Utils.fs diff --git a/vsintegration/tests/unittests/Tests.Build.fs b/vsintegration/tests/UnitTests/Tests.Build.fs similarity index 100% rename from vsintegration/tests/unittests/Tests.Build.fs rename to vsintegration/tests/UnitTests/Tests.Build.fs diff --git a/vsintegration/tests/unittests/Tests.InternalCollections.fs b/vsintegration/tests/UnitTests/Tests.InternalCollections.fs similarity index 100% rename from vsintegration/tests/unittests/Tests.InternalCollections.fs rename to vsintegration/tests/UnitTests/Tests.InternalCollections.fs diff --git a/vsintegration/tests/unittests/Tests.Powerpack.fs b/vsintegration/tests/UnitTests/Tests.Powerpack.fs similarity index 100% rename from vsintegration/tests/unittests/Tests.Powerpack.fs rename to vsintegration/tests/UnitTests/Tests.Powerpack.fs diff --git a/vsintegration/tests/unittests/Tests.TaskReporter.fs b/vsintegration/tests/UnitTests/Tests.TaskReporter.fs similarity index 100% rename from vsintegration/tests/unittests/Tests.TaskReporter.fs rename to vsintegration/tests/UnitTests/Tests.TaskReporter.fs diff --git a/vsintegration/tests/unittests/Tests.Watson.fs b/vsintegration/tests/UnitTests/Tests.Watson.fs similarity index 100% rename from vsintegration/tests/unittests/Tests.Watson.fs rename to vsintegration/tests/UnitTests/Tests.Watson.fs diff --git a/vsintegration/tests/unittests/Tests.XmlDocComments.fs b/vsintegration/tests/UnitTests/Tests.XmlDocComments.fs similarity index 100% rename from vsintegration/tests/unittests/Tests.XmlDocComments.fs rename to vsintegration/tests/UnitTests/Tests.XmlDocComments.fs diff --git a/vsintegration/tests/unittests/UnusedOpensTests.fs b/vsintegration/tests/UnitTests/UnusedOpensTests.fs similarity index 100% rename from vsintegration/tests/unittests/UnusedOpensTests.fs rename to vsintegration/tests/UnitTests/UnusedOpensTests.fs diff --git a/vsintegration/tests/unittests/VisualFSharp.UnitTests.dll.config b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.dll.config similarity index 100% rename from vsintegration/tests/unittests/VisualFSharp.UnitTests.dll.config rename to vsintegration/tests/UnitTests/VisualFSharp.UnitTests.dll.config diff --git a/vsintegration/tests/unittests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj similarity index 99% rename from vsintegration/tests/unittests/VisualFSharp.UnitTests.fsproj rename to vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj index 22ca25f498..1ff54bf76b 100644 --- a/vsintegration/tests/unittests/VisualFSharp.UnitTests.fsproj +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj @@ -9,6 +9,7 @@ NO_PROJECTCRACKER;$(DefineConstants) true true + false diff --git a/vsintegration/src/unittests/app.runsettings b/vsintegration/tests/UnitTests/app.runsettings similarity index 100% rename from vsintegration/src/unittests/app.runsettings rename to vsintegration/tests/UnitTests/app.runsettings From 2ad2627f4939f57d66dc8c50627ce2bfe378db44 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Wed, 21 Mar 2018 09:30:08 -0700 Subject: [PATCH 130/147] Update dev build to include old and new system.valuetuple (#4589) --- build.cmd | 2 ++ packages.config | 1 + vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/build.cmd b/build.cmd index 6eed22f433..2a86730556 100644 --- a/build.cmd +++ b/build.cmd @@ -211,6 +211,7 @@ if /i "%ARG%" == "microbuild" ( set BUILD_VS=1 set BUILD_SETUP=%FSC_BUILD_SETUP% set BUILD_NUGET=1 + set BUILD_MICROBUILD=1 set TEST_NET40_COMPILERUNIT_SUITE=1 set TEST_NET40_COREUNIT_SUITE=1 @@ -478,6 +479,7 @@ echo BUILD_SETUP=%BUILD_SETUP% echo BUILD_NUGET=%BUILD_NUGET% echo BUILD_CONFIG=%BUILD_CONFIG% echo BUILD_PUBLICSIGN=%BUILD_PUBLICSIGN% +echo BUILD_MICROBUILD=%BUILD_MICROBUILD% echo. echo PB_SKIPTESTS=%PB_SKIPTESTS% echo PB_RESTORESOURCE=%PB_RESTORESOURCE% diff --git a/packages.config b/packages.config index dc6205ef46..778332d800 100644 --- a/packages.config +++ b/packages.config @@ -19,6 +19,7 @@ + diff --git a/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj b/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj index 3f1be89483..fe82fb0a48 100644 --- a/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj +++ b/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj @@ -23,6 +23,11 @@ License.txt true + + PreserveNewest + packages\System.ValueTuple.4.3.1.nupkg + true + PreserveNewest packages\System.ValueTuple.4.4.0.nupkg From c86fbdc0d1cce26993687c5efebad594646908ce Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 21 Mar 2018 19:04:49 +0000 Subject: [PATCH 131/147] textual cleanup (#4593) --- src/absil/il.fsi | 306 +++++++++++++++++++++++------------------------ 1 file changed, 153 insertions(+), 153 deletions(-) diff --git a/src/absil/il.fsi b/src/absil/il.fsi index d067c3c0ee..514725a3bd 100644 --- a/src/absil/il.fsi +++ b/src/absil/il.fsi @@ -103,14 +103,14 @@ type ILVersionInfo = uint16 * uint16 * uint16 * uint16 type ILAssemblyRef = static member Create : name: string * hash: byte[] option * publicKey: PublicKey option * retargetable: bool * version: ILVersionInfo option * locale: string option -> ILAssemblyRef static member FromAssemblyName : System.Reflection.AssemblyName -> ILAssemblyRef - member Name: string; + member Name: string /// The fully qualified name of the assembly reference, e.g. mscorlib, Version=1.0.3705 etc. - member QualifiedName: string; - member Hash: byte[] option; - member PublicKey: PublicKey option; + member QualifiedName: string + member Hash: byte[] option + member PublicKey: PublicKey option /// CLI says this indicates if the assembly can be retargeted (at runtime) to be from a different publisher. - member Retargetable: bool; - member Version: ILVersionInfo option; + member Retargetable: bool + member Version: ILVersionInfo option member Locale: string option interface System.IComparable @@ -352,8 +352,8 @@ and and [] ILCallingSignature = - { CallingConv: ILCallingConv; - ArgTypes: ILTypes; + { CallingConv: ILCallingConv + ArgTypes: ILTypes ReturnType: ILType } /// Actual generic parameters are always types. @@ -387,8 +387,8 @@ type ILMethodRef = [] type ILFieldRef = - { DeclaringTypeRef: ILTypeRef; - Name: string; + { DeclaringTypeRef: ILTypeRef + Name: string Type: ILType } /// The information at the callsite of a method @@ -421,7 +421,7 @@ type ILMethodSpec = /// Field specs. The data given for a ldfld, stfld etc. instruction. [] type ILFieldSpec = - { FieldRef: ILFieldRef; + { FieldRef: ILFieldRef DeclaringType: ILType } member DeclaringTypeRef: ILTypeRef member Name: string @@ -655,7 +655,7 @@ type ILExceptionClause = [] type ILExceptionSpec = - { Range: (ILCodeLabel * ILCodeLabel); + { Range: (ILCodeLabel * ILCodeLabel) Clause: ILExceptionClause } /// Indicates that a particular local variable has a particular source @@ -663,8 +663,8 @@ type ILExceptionSpec = /// variable numbering, which is global over the whole method. [] type ILLocalDebugMapping = - { LocalIndex: int; - LocalName: string; } + { LocalIndex: int + LocalName: string } [] type ILLocalDebugInfo = @@ -792,8 +792,8 @@ type ILNativeType = /// Local variables [] type ILLocal = - { Type: ILType; - IsPinned: bool; + { Type: ILType + IsPinned: bool DebugInfo: (string * int * int) option } type ILLocals = list @@ -801,13 +801,13 @@ type ILLocals = list /// IL method bodies [] type ILMethodBody = - { IsZeroInit: bool; + { IsZeroInit: bool /// strictly speaking should be a uint16 - MaxStack: int32; - NoInlining: bool; - AggressiveInlining: bool; - Locals: ILLocals; - Code: ILCode; + MaxStack: int32 + NoInlining: bool + AggressiveInlining: bool + Locals: ILLocals + Code: ILCode SourceMarker: ILSourceMarker option } /// Member Access @@ -848,7 +848,7 @@ type ILAttributeNamedArg = string * ILType * bool * ILAttribElem /// Custom attributes. See 'decodeILAttribData' for a helper to parse the byte[] /// to ILAttribElem's as best as possible. type ILAttribute = - { Method: ILMethodSpec; + { Method: ILMethodSpec Data: byte[] Elements: ILAttribElem list} @@ -861,14 +861,14 @@ type ILAttributes = [] type ILParameter = - { Name: string option; - Type: ILType; - Default: ILFieldInit option; + { Name: string option + Type: ILType + Default: ILFieldInit option /// Marshalling map for parameters. COM Interop only. - Marshal: ILNativeType option; - IsIn: bool; - IsOut: bool; - IsOptional: bool; + Marshal: ILNativeType option + IsIn: bool + IsOut: bool + IsOptional: bool CustomAttrs: ILAttributes } type ILParameters = list @@ -878,8 +878,8 @@ val typesOfILParams : ILParameters -> ILType list /// Method return values. [] type ILReturn = - { Marshal: ILNativeType option; - Type: ILType; + { Marshal: ILNativeType option + Type: ILType CustomAttrs: ILAttributes } /// Security ILPermissions @@ -945,13 +945,13 @@ type PInvokeThrowOnUnmappableChar = [] type PInvokeMethod = - { Where: ILModuleRef; - Name: string; - CallingConv: PInvokeCallingConvention; - CharEncoding: PInvokeCharEncoding; - NoMangle: bool; - LastError: bool; - ThrowOnUnmappableChar: PInvokeThrowOnUnmappableChar; + { Where: ILModuleRef + Name: string + CallingConv: PInvokeCallingConvention + CharEncoding: PInvokeCharEncoding + NoMangle: bool + LastError: bool + ThrowOnUnmappableChar: PInvokeThrowOnUnmappableChar CharBestFit: PInvokeCharBestFit } @@ -968,10 +968,10 @@ type ILOverridesSpec = // REVIEW: fold this into ILMethodDef. type ILMethodVirtualInfo = - { IsFinal: bool; - IsNewSlot: bool; - IsCheckAccessOnOverride: bool; - IsAbstract: bool; } + { IsFinal: bool + IsNewSlot: bool + IsCheckAccessOnOverride: bool + IsAbstract: bool } [] type MethodKind = @@ -999,18 +999,18 @@ type MethodCodeKind = /// Generic parameters. Formal generic parameter declarations /// may include the bounds, if any, on the generic parameter. type ILGenericParameterDef = - { Name: string; + { Name: string /// At most one is the parent type, the others are interface types. - Constraints: ILTypes; + Constraints: ILTypes /// Variance of type parameters, only applicable to generic parameters for generic interfaces and delegates. - Variance: ILGenericVariance; + Variance: ILGenericVariance /// Indicates the type argument must be a reference type. - HasReferenceTypeConstraint: bool; - CustomAttrs : ILAttributes; + HasReferenceTypeConstraint: bool + CustomAttrs : ILAttributes /// Indicates the type argument must be a value type, but not Nullable. - HasNotNullableValueTypeConstraint: bool; + HasNotNullableValueTypeConstraint: bool /// Indicates the type argument must have a public nullary constructor. - HasDefaultConstructorConstraint: bool; } + HasDefaultConstructorConstraint: bool } type ILGenericParameterDefs = ILGenericParameterDef list @@ -1028,19 +1028,19 @@ type ILLazyMethodBody = [] type ILMethodDef = - { Name: string; - Attributes: MethodAttributes; - ImplAttributes: MethodImplAttributes; - CallingConv: ILCallingConv; - Parameters: ILParameters; - Return: ILReturn; - mdBody: ILLazyMethodBody; - SecurityDecls: ILPermissions; - IsEntryPoint:bool; - GenericParams: ILGenericParameterDefs; - CustomAttrs: ILAttributes; } + { Name: string + Attributes: MethodAttributes + ImplAttributes: MethodImplAttributes + CallingConv: ILCallingConv + Parameters: ILParameters + Return: ILReturn + mdBody: ILLazyMethodBody + SecurityDecls: ILPermissions + IsEntryPoint:bool + GenericParams: ILGenericParameterDefs + CustomAttrs: ILAttributes } - member ParameterTypes: ILTypes; + member ParameterTypes: ILTypes member IsIL : bool member Code : ILCode option member Locals : ILLocals @@ -1118,15 +1118,15 @@ type ILMethodDefs = /// Field definitions. [] type ILFieldDef = - { Name: string; - Type: ILType; - Attributes: FieldAttributes; - Data: byte[] option; - LiteralValue: ILFieldInit option; + { Name: string + Type: ILType + Attributes: FieldAttributes + Data: byte[] option + LiteralValue: ILFieldInit option /// The explicit offset in bytes when explicit layout is used. - Offset: int32 option; - Marshal: ILNativeType option; - CustomAttrs: ILAttributes; } + Offset: int32 option + Marshal: ILNativeType option + CustomAttrs: ILAttributes } member IsStatic: bool member IsSpecialName: bool member IsLiteral: bool @@ -1152,14 +1152,14 @@ type ILFieldDefs = /// Event definitions. [] type ILEventDef = - { Type: ILType option; - Name: string; + { Type: ILType option + Name: string Attributes: EventAttributes - AddMethod: ILMethodRef; - RemoveMethod: ILMethodRef; - FireMethod: ILMethodRef option; - OtherMethods: ILMethodRef list; - CustomAttrs: ILAttributes; } + AddMethod: ILMethodRef + RemoveMethod: ILMethodRef + FireMethod: ILMethodRef option + OtherMethods: ILMethodRef list + CustomAttrs: ILAttributes } member IsSpecialName : bool member IsRTSpecialName : bool @@ -1172,15 +1172,15 @@ type ILEventDefs = /// Property definitions. [] type ILPropertyDef = - { Name: string; - Attributes: PropertyAttributes; - SetMethod: ILMethodRef option; - GetMethod: ILMethodRef option; - CallingConv: ILThisConvention; - Type: ILType; - Init: ILFieldInit option; - Args: ILTypes; - CustomAttrs: ILAttributes; } + { Name: string + Attributes: PropertyAttributes + SetMethod: ILMethodRef option + GetMethod: ILMethodRef option + CallingConv: ILThisConvention + Type: ILType + Init: ILFieldInit option + Args: ILTypes + CustomAttrs: ILAttributes } member IsSpecialName : bool member IsRTSpecialName : bool @@ -1197,7 +1197,7 @@ type ILPropertyDefs = /// is used to implement method [pms] for the purposes of this class /// and its subclasses. type ILMethodImplDef = - { Overrides: ILOverridesSpec; + { Overrides: ILOverridesSpec OverrideBy: ILMethodSpec } [] @@ -1212,7 +1212,7 @@ type ILTypeDefLayout = | Explicit of ILTypeDefLayoutInfo and ILTypeDefLayoutInfo = - { Size: int32 option; + { Size: int32 option Pack: uint16 option } /// Indicate the initialization semantics of a type. @@ -1288,26 +1288,26 @@ type ILTypeDefs = /// have a very specific form. and [] ILTypeDef = - { Name: string; - Attributes: TypeAttributes; - GenericParams: ILGenericParameterDefs; - Layout: ILTypeDefLayout; - NestedTypes: ILTypeDefs; - Implements: ILTypes; - Extends: ILType option; - Methods: ILMethodDefs; - SecurityDecls: ILPermissions; - Fields: ILFieldDefs; - MethodImpls: ILMethodImplDefs; - Events: ILEventDefs; - Properties: ILPropertyDefs; - CustomAttrs: ILAttributes; } - member IsClass: bool; - member IsStruct: bool; - member IsInterface: bool; - member IsEnum: bool; - member IsDelegate: bool; - member IsStructOrEnum : bool + { Name: string + Attributes: TypeAttributes + GenericParams: ILGenericParameterDefs + Layout: ILTypeDefLayout + NestedTypes: ILTypeDefs + Implements: ILTypes + Extends: ILType option + Methods: ILMethodDefs + SecurityDecls: ILPermissions + Fields: ILFieldDefs + MethodImpls: ILMethodImplDefs + Events: ILEventDefs + Properties: ILPropertyDefs + CustomAttrs: ILAttributes } + member IsClass: bool + member IsStruct: bool + member IsInterface: bool + member IsEnum: bool + member IsDelegate: bool + member IsStructOrEnum: bool member Access: ILTypeDefAccess member IsAbstract: bool member IsSealed: bool @@ -1318,7 +1318,7 @@ and [] /// Some classes are marked "HasSecurity" even if there are no permissions attached, /// e.g. if they use SuppressUnmanagedCodeSecurityAttribute member HasSecurity: bool - member Encoding: ILDefaultPInvokeEncoding; + member Encoding: ILDefaultPInvokeEncoding member WithAccess: ILTypeDefAccess -> ILTypeDef member WithNestedAccess: ILMemberAccess -> ILTypeDef member WithSealed: bool -> ILTypeDef @@ -1365,19 +1365,19 @@ type ILNestedExportedTypes = /// these are only found in the "Nested" field of ILExportedTypeOrForwarder objects // REVIEW: fold this into ILExportedTypeOrForwarder. There's not much value in keeping these distinct and ILNestedExportedType = - { Name: string; - Access: ILMemberAccess; - Nested: ILNestedExportedTypes; + { Name: string + Access: ILMemberAccess + Nested: ILNestedExportedTypes CustomAttrs: ILAttributes } /// these are only found in the ILExportedTypesAndForwarders table in the manifest [] type ILExportedTypeOrForwarder = - { ScopeRef: ILScopeRef; + { ScopeRef: ILScopeRef /// [Namespace.]Name - Name: string; + Name: string Attributes: TypeAttributes - Nested: ILNestedExportedTypes; + Nested: ILNestedExportedTypes CustomAttrs: ILAttributes } member Access: ILTypeDefAccess member IsForwarder: bool @@ -1403,9 +1403,9 @@ type ILResourceLocation = /// - in an external file in this assembly (offset given in the ILResourceLocation field). /// - as a resources in another assembly of the same name. type ILResource = - { Name: string; - Location: ILResourceLocation; - Access: ILResourceAccess; + { Name: string + Location: ILResourceLocation + Access: ILResourceAccess CustomAttrs: ILAttributes } /// Read the bytes from a resource local to an assembly member Bytes : byte[] @@ -1427,33 +1427,33 @@ type ILAssemblyLongevity = /// The main module of an assembly is a module plus some manifest information. type ILAssemblyManifest = - { Name: string; + { Name: string /// This is the ID of the algorithm used for the hashes of auxiliary /// files in the assembly. These hashes are stored in the /// ILModuleRef.Hash fields of this assembly. These are not /// cryptographic hashes: they are simple file hashes. The algorithm /// is normally 0x00008004 indicating the SHA1 hash algorithm. - AuxModuleHashAlgorithm: int32; - SecurityDecls: ILPermissions; + AuxModuleHashAlgorithm: int32 + SecurityDecls: ILPermissions /// This is the public key used to sign this /// assembly (the signature itself is stored elsewhere: see the /// binary format, and may not have been written if delay signing /// is used). (member Name, member PublicKey) forms the full /// public name of the assembly. - PublicKey: byte[] option; - Version: ILVersionInfo option; - Locale: string option; - CustomAttrs: ILAttributes; - AssemblyLongevity: ILAssemblyLongevity; - DisableJitOptimizations: bool; - JitTracking: bool; - IgnoreSymbolStoreSequencePoints: bool; - Retargetable: bool; + PublicKey: byte[] option + Version: ILVersionInfo option + Locale: string option + CustomAttrs: ILAttributes + AssemblyLongevity: ILAssemblyLongevity + DisableJitOptimizations: bool + JitTracking: bool + IgnoreSymbolStoreSequencePoints: bool + Retargetable: bool /// Records the types implemented by this assembly in auxiliary /// modules. - ExportedTypes: ILExportedTypesAndForwarders; + ExportedTypes: ILExportedTypesAndForwarders /// Records whether the entrypoint resides in another module. - EntrypointElsewhere: ILModuleRef option; + EntrypointElsewhere: ILModuleRef option } /// One module in the "current" assembly, either a main-module or @@ -1462,27 +1462,27 @@ type ILAssemblyManifest = /// An assembly is built by joining together a "main" module plus /// several auxiliary modules. type ILModuleDef = - { Manifest: ILAssemblyManifest option; - CustomAttrs: ILAttributes; - Name: string; - TypeDefs: ILTypeDefs; + { Manifest: ILAssemblyManifest option + CustomAttrs: ILAttributes + Name: string + TypeDefs: ILTypeDefs SubsystemVersion : int * int UseHighEntropyVA : bool - SubSystemFlags: int32; - IsDLL: bool; - IsILOnly: bool; - Platform: ILPlatform option; - StackReserveSize: int32 option; - Is32Bit: bool; - Is32BitPreferred: bool; - Is64Bit: bool; - VirtualAlignment: int32; - PhysicalAlignment: int32; - ImageBase: int32; - MetadataVersion: string; - Resources: ILResources; + SubSystemFlags: int32 + IsDLL: bool + IsILOnly: bool + Platform: ILPlatform option + StackReserveSize: int32 option + Is32Bit: bool + Is32BitPreferred: bool + Is64Bit: bool + VirtualAlignment: int32 + PhysicalAlignment: int32 + ImageBase: int32 + MetadataVersion: string + Resources: ILResources /// e.g. win86 resources, as the exact contents of a .res or .obj file. - NativeResources: Lazy list; } + NativeResources: Lazy list } member ManifestOfAssembly: ILAssemblyManifest member HasManifest : bool @@ -1943,7 +1943,7 @@ val compareILVersions: ILVersionInfo -> ILVersionInfo -> int /// Decompose a type definition according to its kind. type ILEnumInfo = - { enumValues: (string * ILFieldInit) list; + { enumValues: (string * ILFieldInit) list enumType: ILType } val getTyOfILEnumInfo: ILEnumInfo -> ILType @@ -1973,8 +1973,8 @@ type ILPropertyRef = val runningOnMono: bool type ILReferences = - { AssemblyReferences: ILAssemblyRef list; - ModuleReferences: ILModuleRef list; } + { AssemblyReferences: ILAssemblyRef list + ModuleReferences: ILModuleRef list } /// Find the full set of assemblies referenced by a module. val computeILRefs: ILModuleDef -> ILReferences From 639583a94c98746595d369ee64a60d09a2833f1a Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Wed, 21 Mar 2018 12:24:56 -0700 Subject: [PATCH 132/147] don't allow < or > in .nuspec files (#4592) --- .../FSharp.Compiler.Template.nuget.targets | 5 ++++- src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.targets b/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.targets index 77715c6112..d4a0997e59 100644 --- a/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.targets +++ b/src/fsharp/FSharp.Compiler.nuget/FSharp.Compiler.Template.nuget.targets @@ -32,7 +32,10 @@ Outputs='$(FSharpSourcesRoot)\$(Configuration)\artifacts\$(PackageVersion)\"%(PackageNuspec.Filename)).nupkg'> - -prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(PackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)" -prop "diasymreaderversion=$(MicrosoftDiaSymReaderPackageVersion)" -prop "diasymreaderportablepdbversion=$(MicrosoftDiaSymReaderPortablePdbPackageVersion)" -prop "githeadsha=$(GitHeadSha)" + + $(GitHeadSha) + [developer build] + -prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(PackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)" -prop "diasymreaderversion=$(MicrosoftDiaSymReaderPackageVersion)" -prop "diasymreaderportablepdbversion=$(MicrosoftDiaSymReaderPortablePdbPackageVersion)" -prop "githeadsha=$(NormalizedGitHeadSha)" diff --git a/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj b/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj index d14d40aeda..4440f4ab72 100644 --- a/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj +++ b/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.proj @@ -61,7 +61,10 @@ $(FSharpCoreLatestTargetPackageVersion) $(FSharpCoreLatestTargetMajorVersion) - -prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(PackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)" -prop "githeadsha=$(GitHeadSha)" + + $(GitHeadSha) + [developer build] + -prop "licenseUrl=$(PackageLicenceUrl)" -prop "version=$(PackageVersion)" -prop "authors=$(PackageAuthors)" -prop "projectUrl=$(PackageProjectUrl)" -prop "tags=$(PackageTags)" -prop "githeadsha=$(NormalizedGitHeadSha)" From 08bfa00c669a878ad05e746f3c1f213b976f31c5 Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Wed, 21 Mar 2018 16:02:05 -0700 Subject: [PATCH 133/147] Nightlies need this too --- vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj b/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj index fe82fb0a48..f4b6f6aed9 100644 --- a/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj +++ b/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj @@ -23,7 +23,7 @@ License.txt true - + PreserveNewest packages\System.ValueTuple.4.3.1.nupkg true From 2c6e3b6d7fc1c28916ce02e2dd26131848b1f183 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 21 Mar 2018 23:11:33 +0000 Subject: [PATCH 134/147] hide representations in Abstract IL --- src/absil/il.fs | 770 +++++++++++++++++++++------------------ src/absil/il.fsi | 407 ++++++++++----------- src/absil/ilmorph.fs | 72 ++-- src/absil/ilprint.fs | 70 ++-- src/absil/ilread.fs | 161 ++++---- src/absil/ilreflect.fs | 64 ++-- src/absil/ilwrite.fs | 20 +- src/absil/ilx.fs | 2 +- src/fsharp/IlxGen.fs | 361 +++++++++--------- src/fsharp/IlxGen.fsi | 2 +- src/fsharp/NicePrint.fs | 18 +- src/fsharp/TcGlobals.fs | 10 +- src/fsharp/fsc.fs | 25 +- src/fsharp/infos.fs | 10 +- src/ilx/EraseClosures.fs | 97 ++--- src/ilx/EraseUnions.fs | 143 ++++---- 16 files changed, 1149 insertions(+), 1083 deletions(-) diff --git a/src/absil/il.fs b/src/absil/il.fs index 2b172b3a12..5d07cb5b5c 100644 --- a/src/absil/il.fs +++ b/src/absil/il.fs @@ -1233,14 +1233,14 @@ type | DemandChoice [] -type ILPermission = - | PermissionSet of ILSecurityAction * byte[] +type ILSecurityDecl = + | ILSecurityDecl of ILSecurityAction * byte[] [] -type ILPermissions = - | SecurityDecls of ILPermission list - | SecurityDeclsLazy of Lazy - member x.AsList = match x with SecurityDecls m -> m | SecurityDeclsLazy m -> m.Force() +type ILSecurityDecls = + | ILSecurityDecls of ILSecurityDecl list + | ILSecurityDeclsLazy of Lazy + member x.AsList = match x with ILSecurityDecls m -> m | ILSecurityDeclsLazy m -> m.Force() [] type PInvokeCharBestFit = @@ -1347,13 +1347,13 @@ type ILGenericVariance = | ContraVariant type ILGenericParameterDef = - { Name: string; - Constraints: ILTypes; - Variance: ILGenericVariance; - HasReferenceTypeConstraint: bool; - CustomAttrs : ILAttributes; - HasNotNullableValueTypeConstraint: bool; - HasDefaultConstructorConstraint: bool; } + { Name: string + Constraints: ILTypes + Variance: ILGenericVariance + HasReferenceTypeConstraint: bool + CustomAttrs : ILAttributes + HasNotNullableValueTypeConstraint: bool + HasDefaultConstructorConstraint: bool } override x.ToString() = x.Name @@ -1381,28 +1381,45 @@ let convertMemberAccess (ilMemberAccess:ILMemberAccess) = let inline conditionalAdd condition flagToAdd source = if condition then source ||| flagToAdd else source &&& ~~~flagToAdd [] -type ILMethodDef = - { Name: string; - Attributes: MethodAttributes; - ImplAttributes: MethodImplAttributes; - CallingConv: ILCallingConv; - Parameters: ILParameters; - Return: ILReturn; - mdBody: ILLazyMethodBody; - SecurityDecls: ILPermissions; - IsEntryPoint:bool; - GenericParams: ILGenericParameterDefs; - CustomAttrs: ILAttributes; } +type ILMethodDef (name: string, attributes: MethodAttributes, implAttributes: MethodImplAttributes, callingConv: ILCallingConv, parameters: ILParameters, ret: ILReturn, body: ILLazyMethodBody, securityDecls: ILSecurityDecls, isEntryPoint:bool, genericParams: ILGenericParameterDefs, customAttrs: ILAttributes) = + + member __.Name = name + member __.Attributes = attributes + member __.ImplAttributes = implAttributes + member __.CallingConv = callingConv + member __.Parameters = parameters + member __.Return = ret + member __.Body = body + member __.SecurityDecls = securityDecls + member __.IsEntryPoint = isEntryPoint + member __.GenericParams = genericParams + member __.CustomAttrs = customAttrs + + member x.With (?name: string, ?attributes: MethodAttributes, ?implAttributes: MethodImplAttributes, ?callingConv: ILCallingConv, ?parameters: ILParameters, ?ret: ILReturn, ?body: ILLazyMethodBody, ?securityDecls: ILSecurityDecls, ?isEntryPoint:bool, ?genericParams: ILGenericParameterDefs, ?customAttrs: ILAttributes) = + ILMethodDef (name = defaultArg name x.Name, + attributes = defaultArg attributes x.Attributes, + implAttributes = defaultArg implAttributes x.ImplAttributes, + callingConv = defaultArg callingConv x.CallingConv, + parameters = defaultArg parameters x.Parameters, + ret = defaultArg ret x.Return, + body = defaultArg body x.Body, + securityDecls = defaultArg securityDecls x.SecurityDecls, + isEntryPoint = defaultArg isEntryPoint x.IsEntryPoint, + genericParams = defaultArg genericParams x.GenericParams, + customAttrs = defaultArg customAttrs x.CustomAttrs) + member x.ParameterTypes = typesOfILParams x.Parameters - // Whidbey feature: SafeHandle finalizer must be run + member md.Code = - match md.mdBody.Contents with + match md.Body.Contents with | MethodBody.IL il-> Some il.Code | _ -> None - member x.IsIL = match x.mdBody.Contents with | MethodBody.IL _ -> true | _ -> false - member x.Locals = match x.mdBody.Contents with | MethodBody.IL il -> il.Locals | _ -> [] - member x.MethodBody = match x.mdBody.Contents with MethodBody.IL il -> il | _ -> failwith "not IL" + member x.IsIL = match x.Body.Contents with | MethodBody.IL _ -> true | _ -> false + + member x.Locals = match x.Body.Contents with | MethodBody.IL il -> il.Locals | _ -> [] + + member x.MethodBody = match x.Body.Contents with MethodBody.IL il -> il | _ -> failwith "not IL" member x.SourceMarker = x.MethodBody.SourceMarker member x.MaxStack = x.MethodBody.MaxStack @@ -1436,24 +1453,23 @@ type ILMethodDef = member x.IsAggressiveInline= x.ImplAttributes &&& MethodImplAttributes.AggressiveInlining <> enum 0 member x.IsMustRun = x.ImplAttributes &&& MethodImplAttributes.NoOptimization <> enum 0 - member x.WithSpecialName = { x with Attributes = x.Attributes ||| MethodAttributes.SpecialName } + member x.WithSpecialName = x.With(attributes = (x.Attributes ||| MethodAttributes.SpecialName)) member x.WithHideBySig() = - { x with - Attributes = + x.With(attributes = ( if x.IsVirtual then x.Attributes &&& ~~~MethodAttributes.CheckAccessOnOverride ||| MethodAttributes.HideBySig - else failwith "WithHideBySig" } - member x.WithHideBySig(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition MethodAttributes.HideBySig} - member x.WithFinal(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition MethodAttributes.Final} - member x.WithAbstract(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition MethodAttributes.Abstract} - member x.WithAccess(access) = { x with Attributes = x.Attributes &&& ~~~MethodAttributes.MemberAccessMask ||| convertMemberAccess access } - member x.WithNewSlot = { x with Attributes = x.Attributes ||| MethodAttributes.NewSlot } - member x.WithSecurity(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition MethodAttributes.HasSecurity} - member x.WithPInvoke(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition MethodAttributes.PinvokeImpl} - member x.WithPreserveSig(condition) = { x with ImplAttributes = x.ImplAttributes |> conditionalAdd condition MethodImplAttributes.PreserveSig} - member x.WithSynchronized(condition) = { x with ImplAttributes = x.ImplAttributes |> conditionalAdd condition MethodImplAttributes.Synchronized} - member x.WithNoInlining(condition) = { x with ImplAttributes = x.ImplAttributes |> conditionalAdd condition MethodImplAttributes.NoInlining} - member x.WithAggressiveInlining(condition) = { x with ImplAttributes = x.ImplAttributes |> conditionalAdd condition MethodImplAttributes.AggressiveInlining} - member x.WithRuntime(condition) = { x with ImplAttributes = x.ImplAttributes |> conditionalAdd condition MethodImplAttributes.Runtime} + else failwith "WithHideBySig")) + member x.WithHideBySig(condition) = x.With(attributes = (x.Attributes |> conditionalAdd condition MethodAttributes.HideBySig)) + member x.WithFinal(condition) = x.With(attributes = (x.Attributes |> conditionalAdd condition MethodAttributes.Final)) + member x.WithAbstract(condition) = x.With(attributes = (x.Attributes |> conditionalAdd condition MethodAttributes.Abstract)) + member x.WithAccess(access) = x.With(attributes = (x.Attributes &&& ~~~MethodAttributes.MemberAccessMask ||| convertMemberAccess access)) + member x.WithNewSlot = x.With(attributes = (x.Attributes ||| MethodAttributes.NewSlot)) + member x.WithSecurity(condition) = x.With(attributes = (x.Attributes |> conditionalAdd condition MethodAttributes.HasSecurity)) + member x.WithPInvoke(condition) = x.With(attributes = (x.Attributes |> conditionalAdd condition MethodAttributes.PinvokeImpl)) + member x.WithPreserveSig(condition) = x.With(implAttributes = (x.ImplAttributes |> conditionalAdd condition MethodImplAttributes.PreserveSig)) + member x.WithSynchronized(condition) = x.With(implAttributes = (x.ImplAttributes |> conditionalAdd condition MethodImplAttributes.Synchronized)) + member x.WithNoInlining(condition) = x.With(implAttributes = (x.ImplAttributes |> conditionalAdd condition MethodImplAttributes.NoInlining)) + member x.WithAggressiveInlining(condition) = x.With(implAttributes = (x.ImplAttributes |> conditionalAdd condition MethodImplAttributes.AggressiveInlining)) + member x.WithRuntime(condition) = x.With(implAttributes = (x.ImplAttributes |> conditionalAdd condition MethodImplAttributes.Runtime)) /// Index table by name and arity. type MethodDefMap = Map @@ -1486,15 +1502,25 @@ type ILMethodDefs(f : (unit -> ILMethodDef[])) = member x.FindByNameAndArity (nm,arity) = x.FindByName nm |> List.filter (fun x -> List.length x.Parameters = arity) [] -type ILEventDef = - { Type: ILType option; - Name: string; - Attributes: EventAttributes - AddMethod: ILMethodRef; - RemoveMethod: ILMethodRef; - FireMethod: ILMethodRef option; - OtherMethods: ILMethodRef list; - CustomAttrs: ILAttributes; } +type ILEventDef(eventType: ILType option, name: string, attributes: EventAttributes, addMethod: ILMethodRef, removeMethod: ILMethodRef, fireMethod: ILMethodRef option, otherMethods: ILMethodRef list, customAttrs: ILAttributes) = + + member x.EventType = eventType + member x.Name = name + member x.Attributes = attributes + member x.AddMethod = addMethod + member x.RemoveMethod = removeMethod + member x.FireMethod = fireMethod + member x.OtherMethods = otherMethods + member x.CustomAttrs = customAttrs + member x.With(?eventType, ?name, ?attributes, ?addMethod, ?removeMethod, ?fireMethod, ?otherMethods, ?customAttrs) = + ILEventDef(eventType= defaultArg eventType x.EventType, + name= defaultArg name x.Name, + attributes= defaultArg attributes x.Attributes, + addMethod=defaultArg addMethod x.AddMethod, + removeMethod=defaultArg removeMethod x.RemoveMethod, + fireMethod= defaultArg fireMethod x.FireMethod, + otherMethods= defaultArg otherMethods x.OtherMethods, + customAttrs=defaultArg customAttrs x.CustomAttrs) member x.IsSpecialName = (x.Attributes &&& EventAttributes.SpecialName) <> enum<_>(0) member x.IsRTSpecialName = (x.Attributes &&& EventAttributes.RTSpecialName) <> enum<_>(0) override x.ToString() = "event " + x.Name @@ -1502,21 +1528,32 @@ type ILEventDef = (* Index table by name. *) [] type ILEventDefs = - | Events of LazyOrderedMultiMap - member x.AsList = let (Events t) = x in t.Entries() - member x.LookupByName s = let (Events t) = x in t.[s] + | ILEvents of LazyOrderedMultiMap + member x.AsList = let (ILEvents t) = x in t.Entries() + member x.LookupByName s = let (ILEvents t) = x in t.[s] [] -type ILPropertyDef = - { Name: string; - Attributes: PropertyAttributes; - SetMethod: ILMethodRef option; - GetMethod: ILMethodRef option; - CallingConv: ILThisConvention; - Type: ILType; - Init: ILFieldInit option; - Args: ILTypes; - CustomAttrs: ILAttributes; } +type ILPropertyDef(name: string, attributes: PropertyAttributes, setMethod: ILMethodRef option, getMethod: ILMethodRef option, callingConv: ILThisConvention, propertyType: ILType, init: ILFieldInit option, args: ILTypes, customAttrs: ILAttributes) = + member x.Name = name + member x.Attributes = attributes + member x.GetMethod = getMethod + member x.SetMethod = setMethod + member x.CallingConv = callingConv + member x.PropertyType = propertyType + member x.Init = init + member x.Args = args + member x.CustomAttrs = customAttrs + member x.With(?name, ?attributes, ?setMethod, ?getMethod, ?callingConv, ?propertyType, ?init, ?args, ?customAttrs) = + ILPropertyDef(name=defaultArg name x.Name, + attributes=defaultArg attributes x.Attributes, + setMethod=defaultArg setMethod x.SetMethod, + getMethod=defaultArg getMethod x.GetMethod, + callingConv=defaultArg callingConv x.CallingConv, + propertyType=defaultArg propertyType x.PropertyType, + init=defaultArg init x.Init, + args=defaultArg args x.Args, + customAttrs=defaultArg customAttrs x.CustomAttrs) + member x.IsSpecialName = (x.Attributes &&& PropertyAttributes.SpecialName) <> enum<_>(0) member x.IsRTSpecialName = (x.Attributes &&& PropertyAttributes.RTSpecialName) <> enum<_>(0) override x.ToString() = "property " + x.Name @@ -1524,9 +1561,9 @@ type ILPropertyDef = // Index table by name. [] type ILPropertyDefs = - | Properties of LazyOrderedMultiMap - member x.AsList = let (Properties t) = x in t.Entries() - member x.LookupByName s = let (Properties t) = x in t.[s] + | ILProperties of LazyOrderedMultiMap + member x.AsList = let (ILProperties t) = x in t.Entries() + member x.LookupByName s = let (ILProperties t) = x in t.[s] let convertFieldAccess (ilMemberAccess:ILMemberAccess) = match ilMemberAccess with @@ -1538,35 +1575,46 @@ let convertFieldAccess (ilMemberAccess:ILMemberAccess) = | ILMemberAccess.Public -> FieldAttributes.Public [] -type ILFieldDef = - { Name: string; - Type: ILType; - Attributes: FieldAttributes; - Data: byte[] option; - LiteralValue: ILFieldInit option; - Offset: int32 option; - Marshal: ILNativeType option; - CustomAttrs: ILAttributes; } +type ILFieldDef(name: string, fieldType: ILType, attributes: FieldAttributes, data: byte[] option, literalValue: ILFieldInit option, offset: int32 option, marshal: ILNativeType option, customAttrs: ILAttributes) = + + member __.Name=name + member __.FieldType = fieldType + member __.Attributes=attributes + member __.Data=data + member __.LiteralValue=literalValue + member __.Offset=offset + member __.Marshal=marshal + member __.CustomAttrs=customAttrs + + member x.With(?name: string, ?fieldType: ILType, ?attributes: FieldAttributes, ?data: byte[] option, ?literalValue: ILFieldInit option, ?offset: int32 option, ?marshal: ILNativeType option, ?customAttrs: ILAttributes) = + ILFieldDef(name=defaultArg name x.Name, + fieldType=defaultArg fieldType x.FieldType, + attributes=defaultArg attributes x.Attributes, + data=defaultArg data x.Data, + literalValue=defaultArg literalValue x.LiteralValue, + offset=defaultArg offset x.Offset, + marshal=defaultArg marshal x.Marshal, + customAttrs=defaultArg customAttrs x.CustomAttrs) member x.IsStatic = x.Attributes &&& FieldAttributes.Static <> enum 0 member x.IsSpecialName = x.Attributes &&& FieldAttributes.SpecialName <> enum 0 member x.IsLiteral = x.Attributes &&& FieldAttributes.Literal <> enum 0 member x.NotSerialized = x.Attributes &&& FieldAttributes.NotSerialized <> enum 0 member x.IsInitOnly = x.Attributes &&& FieldAttributes.InitOnly <> enum 0 member x.Access = memberAccessOfFlags (int x.Attributes) - member x.WithAccess(access) = { x with Attributes = x.Attributes &&& ~~~FieldAttributes.FieldAccessMask ||| convertFieldAccess access } - member x.WithInitOnly(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition FieldAttributes.InitOnly } - member x.WithStatic(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition FieldAttributes.Static } - member x.WithSpecialName(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition (FieldAttributes.SpecialName ||| FieldAttributes.RTSpecialName) } - member x.WithNotSerialized(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition FieldAttributes.NotSerialized } - member x.WithLiteralDefaultValue(literal) = { x with LiteralValue = literal; Attributes = x.Attributes |> conditionalAdd literal.IsSome (FieldAttributes.Literal ||| FieldAttributes.HasDefault) } - member x.WithFieldMarshal(marshal) = { x with Marshal = marshal; Attributes = x.Attributes |> conditionalAdd marshal.IsSome FieldAttributes.HasFieldMarshal } + member x.WithAccess(access) = x.With(attributes = (x.Attributes &&& ~~~FieldAttributes.FieldAccessMask ||| convertFieldAccess access)) + member x.WithInitOnly(condition) = x.With(attributes = (x.Attributes |> conditionalAdd condition FieldAttributes.InitOnly)) + member x.WithStatic(condition) = x.With(attributes = (x.Attributes |> conditionalAdd condition FieldAttributes.Static)) + member x.WithSpecialName(condition) = x.With(attributes = (x.Attributes |> conditionalAdd condition (FieldAttributes.SpecialName ||| FieldAttributes.RTSpecialName))) + member x.WithNotSerialized(condition) = x.With(attributes = (x.Attributes |> conditionalAdd condition FieldAttributes.NotSerialized)) + member x.WithLiteralDefaultValue(literal) = x.With(literalValue = literal, attributes = (x.Attributes |> conditionalAdd literal.IsSome (FieldAttributes.Literal ||| FieldAttributes.HasDefault))) + member x.WithFieldMarshal(marshal) = x.With(marshal = marshal, attributes = (x.Attributes |> conditionalAdd marshal.IsSome FieldAttributes.HasFieldMarshal)) // Index table by name. Keep a canonical list to make sure field order is not disturbed for binary manipulation. type ILFieldDefs = - | Fields of LazyOrderedMultiMap - member x.AsList = let (Fields t) = x in t.Entries() - member x.LookupByName s = let (Fields t) = x in t.[s] + | ILFields of LazyOrderedMultiMap + member x.AsList = let (ILFields t) = x in t.Entries() + member x.LookupByName s = let (ILFields t) = x in t.[s] type ILMethodImplDef = { Overrides: ILOverridesSpec; @@ -1574,8 +1622,8 @@ type ILMethodImplDef = // Index table by name and arity. type ILMethodImplDefs = - | MethodImpls of Lazy - member x.AsList = let (MethodImpls ltab) = x in Map.foldBack (fun _x y r -> y@r) (ltab.Force()) [] + | ILMethodImpls of Lazy + member x.AsList = let (ILMethodImpls ltab) = x in Map.foldBack (fun _x y r -> y@r) (ltab.Force()) [] and MethodImplsMap = Map @@ -1693,21 +1741,39 @@ let convertInitSemantics (init:ILTypeInit) = | ILTypeInit.OnAny -> enum 0 [] -type ILTypeDef = - { Name: string; - Attributes: TypeAttributes; - GenericParams: ILGenericParameterDefs; (* class is generic *) - Layout: ILTypeDefLayout; - NestedTypes: ILTypeDefs; - Implements: ILTypes; - Extends: ILType option; - Methods: ILMethodDefs; - SecurityDecls: ILPermissions; - Fields: ILFieldDefs; - MethodImpls: ILMethodImplDefs; - Events: ILEventDefs; - Properties: ILPropertyDefs; - CustomAttrs: ILAttributes; } +type ILTypeDef(name: string, attributes: TypeAttributes, layout: ILTypeDefLayout, implements: ILTypes, genericParams: ILGenericParameterDefs, + extends: ILType option, methods: ILMethodDefs, nestedTypes: ILTypeDefs, fields: ILFieldDefs, methodImpls: ILMethodImplDefs, + events: ILEventDefs, properties: ILPropertyDefs, customAttrs: ILAttributes, securityDecls: ILSecurityDecls) = + + member __.Name = name + member __.Attributes = attributes + member __.GenericParams = genericParams + member __.Layout = layout + member __.NestedTypes = nestedTypes + member __.Implements = implements + member __.Extends = extends + member __.Methods = methods + member __.SecurityDecls = securityDecls + member __.Fields = fields + member __.MethodImpls = methodImpls + member __.Events = events + member __.Properties = properties + member __.CustomAttrs = customAttrs + member x.With(?name, ?attributes, ?layout, ?implements, ?genericParams, ?extends, ?methods, ?nestedTypes, ?fields, ?methodImpls, ?events, ?properties, ?customAttrs, ?securityDecls) = + ILTypeDef(name=defaultArg name x.Name, + attributes=defaultArg attributes x.Attributes, + layout=defaultArg layout x.Layout, + genericParams = defaultArg genericParams x.GenericParams, + nestedTypes = defaultArg nestedTypes x.NestedTypes, + implements = defaultArg implements x.Implements, + extends = defaultArg extends x.Extends, + methods = defaultArg methods x.Methods, + securityDecls = defaultArg securityDecls x.SecurityDecls, + fields = defaultArg fields x.Fields, + methodImpls = defaultArg methodImpls x.MethodImpls, + events = defaultArg events x.Events, + properties = defaultArg properties x.Properties, + customAttrs = defaultArg customAttrs x.CustomAttrs) member x.IsClass = (typeKindOfFlags x.Name x.Methods x.Fields x.Extends (int x.Attributes)) = ILTypeDefKind.Class member x.IsStruct = (typeKindOfFlags x.Name x.Methods x.Fields x.Extends (int x.Attributes)) = ILTypeDefKind.ValueType member x.IsInterface = (typeKindOfFlags x.Name x.Methods x.Fields x.Extends (int x.Attributes)) = ILTypeDefKind.Interface @@ -1722,18 +1788,18 @@ type ILTypeDef = member x.HasSecurity = x.Attributes &&& TypeAttributes.HasSecurity <> enum 0 member x.Encoding = typeEncodingOfFlags (int x.Attributes) member x.IsStructOrEnum = x.IsStruct || x.IsEnum - member x.WithAccess(access) = { x with Attributes = x.Attributes &&& ~~~TypeAttributes.VisibilityMask ||| convertTypeAccessFlags access } - member x.WithNestedAccess(access) = { x with Attributes = x.Attributes &&& ~~~TypeAttributes.VisibilityMask ||| convertToNestedTypeAccess access } - member x.WithSealed(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition TypeAttributes.Sealed } - member x.WithSerializable(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition TypeAttributes.Serializable } - member x.WithAbstract(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition TypeAttributes.Abstract } - member x.WithImport(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition TypeAttributes.Import } - member x.WithHasSecurity(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition TypeAttributes.HasSecurity } - member x.WithLayout(layout) = { x with Attributes = x.Attributes ||| convertLayout layout; Layout = layout } - member x.WithKind(kind) = { x with Attributes = x.Attributes ||| convertTypeKind kind; Extends = match kind with ILTypeDefKind.Interface -> None | _ -> x.Extends } - member x.WithEncoding(encoding) = { x with Attributes = x.Attributes &&& ~~~TypeAttributes.StringFormatMask ||| convertEncoding encoding } - member x.WithSpecialName(condition) = { x with Attributes = x.Attributes |> conditionalAdd condition TypeAttributes.SpecialName} - member x.WithInitSemantics(init) = { x with Attributes = x.Attributes ||| convertInitSemantics init } + member x.WithAccess(access) = x.With(attributes=(x.Attributes &&& ~~~TypeAttributes.VisibilityMask ||| convertTypeAccessFlags access)) + member x.WithNestedAccess(access) = x.With(attributes=(x.Attributes &&& ~~~TypeAttributes.VisibilityMask ||| convertToNestedTypeAccess access)) + member x.WithSealed(condition) = x.With(attributes=(x.Attributes |> conditionalAdd condition TypeAttributes.Sealed)) + member x.WithSerializable(condition) = x.With(attributes=(x.Attributes |> conditionalAdd condition TypeAttributes.Serializable)) + member x.WithAbstract(condition) = x.With(attributes=(x.Attributes |> conditionalAdd condition TypeAttributes.Abstract)) + member x.WithImport(condition) = x.With(attributes=(x.Attributes |> conditionalAdd condition TypeAttributes.Import)) + member x.WithHasSecurity(condition) = x.With(attributes=(x.Attributes |> conditionalAdd condition TypeAttributes.HasSecurity)) + member x.WithLayout(layout) = x.With(attributes=(x.Attributes ||| convertLayout layout), layout = layout) + member x.WithKind(kind) = x.With(attributes=(x.Attributes ||| convertTypeKind kind), extends = match kind with ILTypeDefKind.Interface -> None | _ -> x.Extends) + member x.WithEncoding(encoding) = x.With(attributes=(x.Attributes &&& ~~~TypeAttributes.StringFormatMask ||| convertEncoding encoding)) + member x.WithSpecialName(condition) = x.With(attributes=(x.Attributes |> conditionalAdd condition TypeAttributes.SpecialName)) + member x.WithInitSemantics(init) = x.With(attributes=(x.Attributes ||| convertInitSemantics init)) and [] ILTypeDefs(f : unit -> (string list * string * ILAttributes * Lazy)[]) = @@ -1826,48 +1892,48 @@ type ILAssemblyLongevity = type ILAssemblyManifest = - { Name: string; - AuxModuleHashAlgorithm: int32; - SecurityDecls: ILPermissions; - PublicKey: byte[] option; - Version: ILVersionInfo option; - Locale: Locale option; - CustomAttrs: ILAttributes; - - AssemblyLongevity: ILAssemblyLongevity; - DisableJitOptimizations: bool; - JitTracking: bool; - IgnoreSymbolStoreSequencePoints: bool; - Retargetable: bool; + { Name: string + AuxModuleHashAlgorithm: int32 + SecurityDecls: ILSecurityDecls + PublicKey: byte[] option + Version: ILVersionInfo option + Locale: Locale option + CustomAttrs: ILAttributes + + AssemblyLongevity: ILAssemblyLongevity + DisableJitOptimizations: bool + JitTracking: bool + IgnoreSymbolStoreSequencePoints: bool + Retargetable: bool /// Records the types implemented by other modules. - ExportedTypes: ILExportedTypesAndForwarders; + ExportedTypes: ILExportedTypesAndForwarders /// Records whether the entrypoint resides in another module. - EntrypointElsewhere: ILModuleRef option; + EntrypointElsewhere: ILModuleRef option } type ILModuleDef = - { Manifest: ILAssemblyManifest option; - CustomAttrs: ILAttributes; - Name: string; - TypeDefs: ILTypeDefs; + { Manifest: ILAssemblyManifest option + CustomAttrs: ILAttributes + Name: string + TypeDefs: ILTypeDefs SubsystemVersion : int * int UseHighEntropyVA : bool (* Random bits of relatively uninteresting data *) - SubSystemFlags: int32; - IsDLL: bool; - IsILOnly: bool; - Platform: ILPlatform option; - StackReserveSize: int32 option; - Is32Bit: bool; - Is32BitPreferred: bool; - Is64Bit: bool; - VirtualAlignment: int32; - PhysicalAlignment: int32; - ImageBase: int32; - MetadataVersion: string; - Resources: ILResources; - NativeResources: list>; (* e.g. win32 resources *) + SubSystemFlags: int32 + IsDLL: bool + IsILOnly: bool + Platform: ILPlatform option + StackReserveSize: int32 option + Is32Bit: bool + Is32BitPreferred: bool + Is64Bit: bool + VirtualAlignment: int32 + PhysicalAlignment: int32 + ImageBase: int32 + MetadataVersion: string + Resources: ILResources + NativeResources: list> (* e.g. win32 resources *) } member x.ManifestOfAssembly = match x.Manifest with @@ -1956,16 +2022,16 @@ let isTypeNameForGlobalFunctions d = (d = typeNameForGlobalFunctions) let mkILMethRef (tref,callconv,nm,gparams,args,rty) = - { mrefParent=tref; - mrefCallconv=callconv; - mrefGenericArity=gparams; - mrefName=nm; - mrefArgs=args; + { mrefParent=tref + mrefCallconv=callconv + mrefGenericArity=gparams + mrefName=nm + mrefArgs=args mrefReturn=rty} let mkILMethSpecForMethRefInTy (mref,typ,minst) = - { mspecMethodRef=mref; - mspecDeclaringType=typ; + { mspecMethodRef=mref + mspecDeclaringType=typ mspecMethodInst=minst } let mkILMethSpec (mref, vc, tinst, minst) = mkILMethSpecForMethRefInTy (mref,mkILNamedTy vc mref.DeclaringTypeRef tinst, minst) @@ -2051,9 +2117,9 @@ let nonBranchingInstrsToCode instrs : ILCode = // // -------------------------------------------------------------------- -let emptyILSecurityDecls = ILPermissions.SecurityDecls [] -let mkILSecurityDecls l = match l with [] -> emptyILSecurityDecls | _ -> ILPermissions.SecurityDecls l -let mkILLazySecurityDecls l = ILPermissions.SecurityDeclsLazy l +let emptyILSecurityDecls = ILSecurityDecls.ILSecurityDecls [] +let mkILSecurityDecls l = match l with [] -> emptyILSecurityDecls | _ -> ILSecurityDecls.ILSecurityDecls l +let mkILLazySecurityDecls l = ILSecurityDecls.ILSecurityDeclsLazy l let mkILTyvarTy tv = ILType.TypeVar tv @@ -2451,17 +2517,17 @@ let mkILVoidReturn = mkILReturn ILType.Void let mkILCtor (access,args,impl) = - { Name=".ctor"; - Attributes=convertMemberAccess access ||| MethodAttributes.SpecialName ||| MethodAttributes.RTSpecialName; - ImplAttributes=MethodImplAttributes.Managed - CallingConv=ILCallingConv.Instance; - Parameters = args - Return= mkILVoidReturn; - mdBody= mkMethBodyAux impl; - SecurityDecls=emptyILSecurityDecls; - IsEntryPoint=false; - GenericParams=mkILEmptyGenericParams; - CustomAttrs = emptyILCustomAttrs; } + ILMethodDef(name=".ctor", + attributes=(convertMemberAccess access ||| MethodAttributes.SpecialName ||| MethodAttributes.RTSpecialName), + implAttributes=MethodImplAttributes.Managed, + callingConv=ILCallingConv.Instance, + parameters = args, + ret= mkILVoidReturn, + body= mkMethBodyAux impl, + securityDecls=emptyILSecurityDecls, + isEntryPoint=false, + genericParams=mkILEmptyGenericParams, + customAttrs = emptyILCustomAttrs) // -------------------------------------------------------------------- // Do-nothing ctor, just pass on to monomorphic superclass @@ -2490,33 +2556,33 @@ let mkILNonGenericEmptyCtor tag superTy = // -------------------------------------------------------------------- let mkILStaticMethod (genparams,nm,access,args,ret,impl) = - { GenericParams=genparams; - Name=nm; - Attributes=convertMemberAccess access ||| MethodAttributes.Static; - ImplAttributes=MethodImplAttributes.Managed - CallingConv = ILCallingConv.Static; - Parameters = args - Return= ret; - SecurityDecls=emptyILSecurityDecls; - IsEntryPoint=false; - CustomAttrs = emptyILCustomAttrs; - mdBody= mkMethBodyAux impl; } + ILMethodDef(genericParams=genparams, + name=nm, + attributes=(convertMemberAccess access ||| MethodAttributes.Static), + implAttributes=MethodImplAttributes.Managed, + callingConv = ILCallingConv.Static, + parameters = args, + ret= ret, + securityDecls=emptyILSecurityDecls, + isEntryPoint=false, + customAttrs = emptyILCustomAttrs, + body= mkMethBodyAux impl) let mkILNonGenericStaticMethod (nm,access,args,ret,impl) = mkILStaticMethod (mkILEmptyGenericParams,nm,access,args,ret,impl) let mkILClassCtor impl = - { Name=".cctor"; - Attributes=MethodAttributes.Private ||| MethodAttributes.Static ||| MethodAttributes.SpecialName ||| MethodAttributes.RTSpecialName; - ImplAttributes=MethodImplAttributes.Managed - CallingConv=ILCallingConv.Static; - GenericParams=mkILEmptyGenericParams; - Parameters = [] - Return=mkILVoidReturn; - IsEntryPoint=false; - SecurityDecls=emptyILSecurityDecls; - CustomAttrs = emptyILCustomAttrs; - mdBody= mkMethBodyAux impl; } + ILMethodDef(name=".cctor", + attributes=(MethodAttributes.Private ||| MethodAttributes.Static ||| MethodAttributes.SpecialName ||| MethodAttributes.RTSpecialName), + implAttributes=MethodImplAttributes.Managed, + callingConv=ILCallingConv.Static, + genericParams=mkILEmptyGenericParams, + parameters = [], + ret=mkILVoidReturn, + isEntryPoint=false, + securityDecls=emptyILSecurityDecls, + customAttrs = emptyILCustomAttrs, + body= mkMethBodyAux impl) // -------------------------------------------------------------------- // Make a virtual method, where the overriding is simply the default @@ -2527,36 +2593,36 @@ let mk_ospec (typ:ILType,callconv,nm,genparams,formal_args,formal_ret) = OverridesSpec (mkILMethRef (typ.TypeRef, callconv, nm, genparams, formal_args,formal_ret), typ) let mkILGenericVirtualMethod (nm,access,genparams,actual_args,actual_ret,impl) = - { Name=nm; - Attributes= - convertMemberAccess access ||| - MethodAttributes.CheckAccessOnOverride ||| - (match impl with MethodBody.Abstract -> MethodAttributes.Abstract ||| MethodAttributes.Virtual | _ -> MethodAttributes.Virtual); - ImplAttributes=MethodImplAttributes.Managed - GenericParams=genparams; - CallingConv=ILCallingConv.Instance; - Parameters=actual_args; - Return=actual_ret; - IsEntryPoint=false; - SecurityDecls=emptyILSecurityDecls; - CustomAttrs = emptyILCustomAttrs; - mdBody= mkMethBodyAux impl; } + ILMethodDef(name=nm, + attributes= + (convertMemberAccess access ||| + MethodAttributes.CheckAccessOnOverride ||| + (match impl with MethodBody.Abstract -> MethodAttributes.Abstract ||| MethodAttributes.Virtual | _ -> MethodAttributes.Virtual)), + implAttributes=MethodImplAttributes.Managed, + genericParams=genparams, + callingConv=ILCallingConv.Instance, + parameters=actual_args, + ret=actual_ret, + isEntryPoint=false, + securityDecls=emptyILSecurityDecls, + customAttrs = emptyILCustomAttrs, + body= mkMethBodyAux impl) let mkILNonGenericVirtualMethod (nm,access,args,ret,impl) = - mkILGenericVirtualMethod (nm,access,mkILEmptyGenericParams,args,ret,impl) + mkILGenericVirtualMethod (nm,access,mkILEmptyGenericParams,args,ret,impl) let mkILGenericNonVirtualMethod (nm,access,genparams, actual_args,actual_ret, impl) = - { Name=nm; - Attributes=convertMemberAccess access ||| MethodAttributes.HideBySig; // see Bug343136: missing HideBySig attribute makes it problematic for C# to consume F# method overloads. - ImplAttributes=MethodImplAttributes.Managed - GenericParams=genparams; - CallingConv=ILCallingConv.Instance; - Parameters=actual_args; - Return=actual_ret; - IsEntryPoint=false; - SecurityDecls=emptyILSecurityDecls; - CustomAttrs = emptyILCustomAttrs; - mdBody= mkMethBodyAux impl; } + ILMethodDef(name=nm, + attributes=(convertMemberAccess access ||| MethodAttributes.HideBySig), + implAttributes=MethodImplAttributes.Managed, + genericParams=genparams, + callingConv=ILCallingConv.Instance, + parameters=actual_args, + ret=actual_ret, + isEntryPoint=false, + securityDecls=emptyILSecurityDecls, + customAttrs = emptyILCustomAttrs, + body= mkMethBodyAux impl) let mkILNonGenericInstanceMethod (nm,access,args,ret,impl) = mkILGenericNonVirtualMethod (nm,access,mkILEmptyGenericParams,args,ret,impl) @@ -2570,13 +2636,13 @@ let mkILNonGenericInstanceMethod (nm,access,args,ret,impl) = let ilmbody_code2code f (il: ILMethodBody) = {il with Code = f il.Code} -let mdef_code2code f md = +let mdef_code2code f (md: ILMethodDef) = let il = - match md.mdBody.Contents with + match md.Body.Contents with | MethodBody.IL il-> il | _ -> failwith "mdef_code2code - method not IL" let b = MethodBody.IL (ilmbody_code2code f il) - {md with mdBody= mkMethBodyAux b } + md.With(body= mkMethBodyAux b) let prependInstrsToCode (instrs: ILInstr list) (c2: ILCode) = let instrs = Array.ofList instrs @@ -2602,7 +2668,7 @@ let prependInstrsToMethod new_code md = mdef_code2code (prependInstrsToCode new_code) md // Creates cctor if needed -let cdef_cctorCode2CodeOrCreate tag f cd = +let cdef_cctorCode2CodeOrCreate tag f (cd: ILTypeDef) = let mdefs = cd.Methods let cctor = match mdefs.FindByName ".cctor" with @@ -2611,7 +2677,7 @@ let cdef_cctorCode2CodeOrCreate tag f cd = | _ -> failwith "bad method table: more than one .cctor found" let methods = ILMethodDefs (fun () -> [| yield f cctor; for md in mdefs do if md.Name <> ".cctor" then yield md |]) - {cd with Methods = methods} + cd.With(methods = methods) let code_of_mdef (md:ILMethodDef) = @@ -2622,10 +2688,10 @@ let code_of_mdef (md:ILMethodDef) = let mkRefToILMethod (tref, md: ILMethodDef) = mkILMethRef (tref, md.CallingConv, md.Name, md.GenericParams.Length, md.ParameterTypes, md.Return.Type) -let mkRefToILField (tref,fdef:ILFieldDef) = mkILFieldRef (tref, fdef.Name, fdef.Type) +let mkRefToILField (tref,fdef:ILFieldDef) = mkILFieldRef (tref, fdef.Name, fdef.FieldType) let mkRefForILMethod scope (tdefs,tdef) mdef = mkRefToILMethod (mkRefForNestedILTypeDef scope (tdefs,tdef), mdef) -let mkRefForILField scope (tdefs,tdef) (fdef:ILFieldDef) = mkILFieldRef (mkRefForNestedILTypeDef scope (tdefs,tdef), fdef.Name, fdef.Type) +let mkRefForILField scope (tdefs,tdef) (fdef:ILFieldDef) = mkILFieldRef (mkRefForNestedILTypeDef scope (tdefs,tdef), fdef.Name, fdef.FieldType) (* Creates cctor if needed *) @@ -2634,18 +2700,19 @@ let prependInstrsToClassCtor instrs tag cd = let mkILField (isStatic,nm,ty,(init:ILFieldInit option),(at: byte [] option),access,isLiteral) = - { Name=nm; - Type=ty; - Attributes=convertFieldAccess access ||| - (if isStatic then FieldAttributes.Static else enum 0) ||| - (if isLiteral then FieldAttributes.Literal else enum 0) ||| - (if init.IsSome then FieldAttributes.HasDefault else enum 0) ||| - (if at.IsSome then FieldAttributes.HasFieldRVA else enum 0) - LiteralValue = init; - Data=at; - Offset=None; - Marshal=None; - CustomAttrs=emptyILCustomAttrs } + ILFieldDef(name=nm, + fieldType=ty, + attributes= + (convertFieldAccess access ||| + (if isStatic then FieldAttributes.Static else enum 0) ||| + (if isLiteral then FieldAttributes.Literal else enum 0) ||| + (if init.IsSome then FieldAttributes.HasDefault else enum 0) ||| + (if at.IsSome then FieldAttributes.HasFieldRVA else enum 0)), + literalValue = init, + data=at, + offset=None, + marshal=None, + customAttrs=emptyILCustomAttrs) let mkILInstanceField (nm,ty,init,access) = mkILField (false,nm,ty,init,None,access,false) let mkILStaticField (nm,ty,init,at,access) = mkILField (true,nm,ty,init,at,access,false) @@ -2665,15 +2732,15 @@ type ILLocalsAllocator(numPrealloc:int) = member tmps.Close() = ResizeArray.toList newLocals -let mkILFieldsLazy l = Fields (LazyOrderedMultiMap((fun (f:ILFieldDef) -> f.Name),l)) +let mkILFieldsLazy l = ILFields (LazyOrderedMultiMap((fun (f:ILFieldDef) -> f.Name),l)) let mkILFields l = mkILFieldsLazy (notlazy l) let emptyILFields = mkILFields [] -let mkILEventsLazy l = Events (LazyOrderedMultiMap((fun (e: ILEventDef) -> e.Name),l)) +let mkILEventsLazy l = ILEvents (LazyOrderedMultiMap((fun (e: ILEventDef) -> e.Name),l)) let mkILEvents l = mkILEventsLazy (notlazy l) let emptyILEvents = mkILEvents [] -let mkILPropertiesLazy l = Properties (LazyOrderedMultiMap((fun (p: ILPropertyDef) -> p.Name),l) ) +let mkILPropertiesLazy l = ILProperties (LazyOrderedMultiMap((fun (p: ILPropertyDef) -> p.Name),l) ) let mkILProperties l = mkILPropertiesLazy (notlazy l) let emptyILProperties = mkILProperties [] @@ -2705,8 +2772,8 @@ let addMethodImplToTable y tab = let prev = Map.tryFindMulti key tab Map.add key (y::prev) tab -let mkILMethodImpls l = MethodImpls (notlazy (List.foldBack addMethodImplToTable l Map.empty)) -let mkILMethodImplsLazy l = MethodImpls (lazy (List.foldBack addMethodImplToTable (Lazy.force l) Map.empty)) +let mkILMethodImpls l = ILMethodImpls (notlazy (List.foldBack addMethodImplToTable l Map.empty)) +let mkILMethodImplsLazy l = ILMethodImpls (lazy (List.foldBack addMethodImplToTable (Lazy.force l) Map.empty)) let emptyILMethodImpls = mkILMethodImpls [] @@ -2750,37 +2817,36 @@ let mkILStorageCtor(tag,preblock,typ,flds,access) = mkILStorageCtorWithParamName let mkILGenericClass (nm, access, genparams, extends, impl, methods, fields, nestedTypes, props, events, attrs, init) = - { Name=nm; - Attributes=convertTypeAccessFlags access ||| TypeAttributes.AutoLayout ||| TypeAttributes.Class ||| (match init with | ILTypeInit.BeforeField -> TypeAttributes.BeforeFieldInit | _ -> enum 0) ||| TypeAttributes.AnsiClass; - GenericParams= genparams; - Implements = impl; - Layout=ILTypeDefLayout.Auto; - Extends = Some extends; - Methods= methods; - Fields= fields; - NestedTypes=nestedTypes; - CustomAttrs=attrs; - MethodImpls=emptyILMethodImpls; - Properties=props; - Events=events; - SecurityDecls=emptyILSecurityDecls; -} + ILTypeDef(name=nm, + attributes=(convertTypeAccessFlags access ||| TypeAttributes.AutoLayout ||| TypeAttributes.Class ||| (match init with | ILTypeInit.BeforeField -> TypeAttributes.BeforeFieldInit | _ -> enum 0) ||| TypeAttributes.AnsiClass), + genericParams= genparams, + implements = impl, + layout=ILTypeDefLayout.Auto, + extends = Some extends, + methods= methods , + fields= fields, + nestedTypes=nestedTypes, + customAttrs=attrs, + methodImpls=emptyILMethodImpls, + properties=props, + events=events, + securityDecls=emptyILSecurityDecls) let mkRawDataValueTypeDef (iltyp_ValueType: ILType) (nm,size,pack) = - { Name = nm; - GenericParams= []; - Attributes = TypeAttributes.NotPublic ||| TypeAttributes.Sealed ||| TypeAttributes.ExplicitLayout ||| TypeAttributes.BeforeFieldInit ||| TypeAttributes.AnsiClass; - Implements = [] - Extends = Some iltyp_ValueType; - Layout=ILTypeDefLayout.Explicit { Size=Some size; Pack=Some pack }; - Methods= emptyILMethods; - Fields= emptyILFields; - NestedTypes=emptyILTypeDefs; - CustomAttrs=emptyILCustomAttrs; - MethodImpls=emptyILMethodImpls; - Properties=emptyILProperties; - Events=emptyILEvents; - SecurityDecls=emptyILSecurityDecls; } + ILTypeDef(name = nm, + genericParams= [], + attributes = (TypeAttributes.NotPublic ||| TypeAttributes.Sealed ||| TypeAttributes.ExplicitLayout ||| TypeAttributes.BeforeFieldInit ||| TypeAttributes.AnsiClass), + implements = [], + extends = Some iltyp_ValueType, + layout=ILTypeDefLayout.Explicit { Size=Some size; Pack=Some pack }, + methods= emptyILMethods, + fields= emptyILFields, + nestedTypes=emptyILTypeDefs, + customAttrs=emptyILCustomAttrs, + methodImpls=emptyILMethodImpls, + properties=emptyILProperties, + events=emptyILEvents, + securityDecls=emptyILSecurityDecls) let mkILSimpleClass (ilg: ILGlobals) (nm, access, methods, fields, nestedTypes, props, events, attrs, init) = @@ -2795,41 +2861,41 @@ let destTypeDefsWithGlobalFunctionsFirst ilg (tdefs: ILTypeDefs) = top2@nontop let mkILSimpleModule assname modname dll subsystemVersion useHighEntropyVA tdefs hashalg locale flags exportedTypes metadataVersion = - { Manifest= - Some { Name=assname; - AuxModuleHashAlgorithm= match hashalg with | Some(alg) -> alg | _ -> 0x8004; // SHA1 - SecurityDecls=emptyILSecurityDecls; - PublicKey= None; - Version= None; - Locale=locale - CustomAttrs=emptyILCustomAttrs; - AssemblyLongevity=ILAssemblyLongevity.Unspecified; - DisableJitOptimizations = 0 <> (flags &&& 0x4000); - JitTracking = (0 <> (flags &&& 0x8000)); // always turn these on - IgnoreSymbolStoreSequencePoints = (0 <> (flags &&& 0x2000)); - Retargetable = (0 <> (flags &&& 0x100)); - ExportedTypes=exportedTypes; - EntrypointElsewhere=None - }; - CustomAttrs=emptyILCustomAttrs; - Name=modname; - NativeResources=[]; - TypeDefs=tdefs; + let manifest = + { Name=assname + AuxModuleHashAlgorithm= match hashalg with | Some(alg) -> alg | _ -> 0x8004 // SHA1 + SecurityDecls=emptyILSecurityDecls + PublicKey= None + Version= None + Locale=locale + CustomAttrs=emptyILCustomAttrs + AssemblyLongevity=ILAssemblyLongevity.Unspecified + DisableJitOptimizations = 0 <> (flags &&& 0x4000) + JitTracking = (0 <> (flags &&& 0x8000)) // always turn these on + IgnoreSymbolStoreSequencePoints = (0 <> (flags &&& 0x2000)) + Retargetable = (0 <> (flags &&& 0x100)) + ExportedTypes=exportedTypes + EntrypointElsewhere=None } + { Manifest= Some manifest + CustomAttrs=emptyILCustomAttrs + Name=modname + NativeResources=[] + TypeDefs=tdefs SubsystemVersion = subsystemVersion UseHighEntropyVA = useHighEntropyVA - SubSystemFlags=defaultSubSystem; - IsDLL=dll; - IsILOnly=true; - Platform=None; - StackReserveSize=None; - Is32Bit=false; - Is32BitPreferred=false; - Is64Bit=false; - PhysicalAlignment=defaultPhysAlignment; - VirtualAlignment=defaultVirtAlignment; - ImageBase=defaultImageBase; - MetadataVersion=metadataVersion; - Resources=mkILResources []; + SubSystemFlags=defaultSubSystem + IsDLL=dll + IsILOnly=true + Platform=None + StackReserveSize=None + Is32Bit=false + Is32BitPreferred=false + Is64Bit=false + PhysicalAlignment=defaultPhysAlignment + VirtualAlignment=defaultVirtAlignment + ImageBase=defaultImageBase + MetadataVersion=metadataVersion + Resources=mkILResources [] } @@ -2882,7 +2948,7 @@ let getTyOfILEnumInfo info = info.enumType let computeILEnumInfo (mdName,mdFields: ILFieldDefs) = match (List.partition (fun (fd:ILFieldDef) -> fd.IsStatic) mdFields.AsList) with | staticFields,[vfd] -> - { enumType = vfd.Type; + { enumType = vfd.FieldType; enumValues = staticFields |> List.map (fun fd -> (fd.Name, match fd.LiteralValue with Some i -> i | None -> failwith ("info_of_enum_tdef: badly formed enum "+mdName+": static field does not have an default value"))) } | _,[] -> failwith ("info_of_enum_tdef: badly formed enum "+mdName+": no non-static field found") | _,_ -> failwith ("info_of_enum_tdef: badly formed enum "+mdName+": more than one non-static field found") @@ -3210,7 +3276,7 @@ let MscorlibScopeRef = ILScopeRef.Assembly (ILAssemblyRef.Create("mscorlib", Non let EcmaMscorlibILGlobals = mkILGlobals MscorlibScopeRef -// PermissionSet is a 'blob' having the following format: +// ILSecurityDecl is a 'blob' having the following format: // - A byte containing a period (.). // - A compressed int32 containing the number of attributes encoded in the blob. // - An array of attributes each containing the following: @@ -3231,7 +3297,7 @@ let mkPermissionSet (ilg: ILGlobals) (action,attributes: list<(ILTypeRef * (stri yield! z_unsigned_int bytes.Length; yield! bytes |] - ILPermission.PermissionSet(action,bytes) + ILSecurityDecl.ILSecurityDecl(action,bytes) // Parse an IL type signature argument within a custom attribute blob @@ -3618,11 +3684,11 @@ and refs_of_mbody s x = | MethodBody.PInvoke (attr) -> refs_of_modref s attr.Where | _ -> () -and refs_of_mdef s md = - List.iter (refs_of_param s) md.Parameters; - refs_of_return s md.Return; - refs_of_mbody s md.mdBody.Contents; - refs_of_custom_attrs s md.CustomAttrs; +and refs_of_mdef s (md: ILMethodDef) = + List.iter (refs_of_param s) md.Parameters + refs_of_return s md.Return + refs_of_mbody s md.Body.Contents + refs_of_custom_attrs s md.CustomAttrs refs_of_genparams s md.GenericParams and refs_of_param s p = refs_of_typ s p.Type @@ -3630,26 +3696,26 @@ and refs_of_return s (rt:ILReturn) = refs_of_typ s rt.Type and refs_of_mdefs s x = Seq.iter (refs_of_mdef s) x and refs_of_event_def s (ed: ILEventDef) = - Option.iter (refs_of_typ s) ed.Type ; - refs_of_mref s ed.AddMethod ; - refs_of_mref s ed.RemoveMethod; - Option.iter (refs_of_mref s) ed.FireMethod ; - List.iter (refs_of_mref s) ed.OtherMethods ; - refs_of_custom_attrs s ed.CustomAttrs + Option.iter (refs_of_typ s) ed.EventType + refs_of_mref s ed.AddMethod + refs_of_mref s ed.RemoveMethod + Option.iter (refs_of_mref s) ed.FireMethod + List.iter (refs_of_mref s) ed.OtherMethods + refs_of_custom_attrs s ed.CustomAttrs and refs_of_events s (x: ILEventDefs) = List.iter (refs_of_event_def s) x.AsList -and refs_of_property_def s pd = - Option.iter (refs_of_mref s) pd.SetMethod ; - Option.iter (refs_of_mref s) pd.GetMethod ; - refs_of_typ s pd.Type ; - refs_of_typs s pd.Args ; - refs_of_custom_attrs s pd.CustomAttrs +and refs_of_property_def s (pd: ILPropertyDef) = + Option.iter (refs_of_mref s) pd.SetMethod + Option.iter (refs_of_mref s) pd.GetMethod + refs_of_typ s pd.PropertyType + refs_of_typs s pd.Args + refs_of_custom_attrs s pd.CustomAttrs and refs_of_properties s (x: ILPropertyDefs) = List.iter (refs_of_property_def s) x.AsList -and refs_of_fdef s fd = - refs_of_typ s fd.Type; +and refs_of_fdef s (fd: ILFieldDef) = + refs_of_typ s fd.FieldType refs_of_custom_attrs s fd.CustomAttrs and refs_of_fields s fields = List.iter (refs_of_fdef s) fields @@ -3657,22 +3723,22 @@ and refs_of_fields s fields = List.iter (refs_of_fdef s) fields and refs_of_method_impls s mimpls = List.iter (refs_of_method_impl s) mimpls and refs_of_method_impl s m = - refs_of_ospec s m.Overrides; + refs_of_ospec s m.Overrides refs_of_mspec s m.OverrideBy and refs_of_tdef_kind _s _k = () and refs_of_tdef s (td : ILTypeDef) = - refs_of_types s td.NestedTypes; - refs_of_genparams s td.GenericParams; - refs_of_typs s td.Implements; - Option.iter (refs_of_typ s) td.Extends; - refs_of_mdefs s td.Methods; - refs_of_fields s td.Fields.AsList; - refs_of_method_impls s td.MethodImpls.AsList; - refs_of_events s td.Events; - refs_of_tdef_kind s td; - refs_of_custom_attrs s td.CustomAttrs; + refs_of_types s td.NestedTypes + refs_of_genparams s td.GenericParams + refs_of_typs s td.Implements + Option.iter (refs_of_typ s) td.Extends + refs_of_mdefs s td.Methods + refs_of_fields s td.Fields.AsList + refs_of_method_impls s td.MethodImpls.AsList + refs_of_events s td.Events + refs_of_tdef_kind s td + refs_of_custom_attrs s td.CustomAttrs refs_of_properties s td.Properties and refs_of_string _s _ = () @@ -3690,18 +3756,18 @@ and refs_of_resource_where s x = | ILResourceLocation.Assembly aref -> refs_of_assref s aref and refs_of_resource s x = - refs_of_resource_where s x.Location; + refs_of_resource_where s x.Location refs_of_custom_attrs s x.CustomAttrs and refs_of_resources s (tab: ILResources) = List.iter (refs_of_resource s) tab.AsList and refs_of_modul s m = - refs_of_types s m.TypeDefs; - refs_of_resources s m.Resources; + refs_of_types s m.TypeDefs + refs_of_resources s m.Resources Option.iter (refs_of_manifest s) m.Manifest and refs_of_manifest s m = - refs_of_custom_attrs s m.CustomAttrs; + refs_of_custom_attrs s m.CustomAttrs refs_of_exported_types s m.ExportedTypes let computeILRefs modul = @@ -3709,7 +3775,7 @@ let computeILRefs modul = { refsA = HashSet<_>(HashIdentity.Structural) refsM = HashSet<_>(HashIdentity.Structural) } - refs_of_modul s modul; + refs_of_modul s modul { AssemblyReferences = Seq.fold (fun acc x -> x::acc) [] s.refsA ModuleReferences = Seq.fold (fun acc x -> x::acc) [] s.refsM } @@ -3730,19 +3796,19 @@ let parseILVersion (vstr : string) = failwith "Invalid version format" else // set the build number to the number of days since Jan 1, 2000 - versionComponents.[2] <- defaultBuild.ToString() ; + versionComponents.[2] <- defaultBuild.ToString() // Set the revision number to number of seconds today / 2 - vstr <- System.String.Join(".",versionComponents) + "." + defaultRevision.ToString() ; + vstr <- System.String.Join(".",versionComponents) + "." + defaultRevision.ToString() elif versionComponents.Length > 3 && versionComponents.[3] = "*" then // Set the revision number to number of seconds today / 2 - versionComponents.[3] <- defaultRevision.ToString() ; - vstr <- System.String.Join(".",versionComponents) ; + versionComponents.[3] <- defaultRevision.ToString() + vstr <- System.String.Join(".",versionComponents) let version = System.Version(vstr) let zero32 n = if n < 0 then 0us else uint16(n) // since the minor revision will be -1 if none is specified, we need to truncate to 0 to not break existing code let minorRevision = if version.Revision = -1 then 0us else uint16(version.MinorRevision) - (zero32 version.Major, zero32 version.Minor, zero32 version.Build, minorRevision);; + (zero32 version.Major, zero32 version.Minor, zero32 version.Build, minorRevision) let compareILVersions (a1,a2,a3,a4) ((b1,b2,b3,b4) : ILVersionInfo) = @@ -3782,7 +3848,7 @@ and unscopeILTypes i = and unscopeILCallSig csig = mkILCallSig (csig.CallingConv,unscopeILTypes csig.ArgTypes,unscopeILType csig.ReturnType) -let resolveILMethodRefWithRescope r td (mref:ILMethodRef) = +let resolveILMethodRefWithRescope r (td: ILTypeDef) (mref:ILMethodRef) = let args = mref.ArgTypes let nargs = args.Length let nm = mref.Name @@ -3815,7 +3881,7 @@ let ungenericizeTypeName n = (let m = String.rindex n sym let res = ref (m < n.Length - 1) for i = m + 1 to n.Length - 1 do - res := !res && n.[i] >= '0' && n.[i] <= '9'; + res := !res && n.[i] >= '0' && n.[i] <= '9' !res) then let pos = String.rindex n sym diff --git a/src/absil/il.fsi b/src/absil/il.fsi index 514725a3bd..a83051ad89 100644 --- a/src/absil/il.fsi +++ b/src/absil/il.fsi @@ -71,7 +71,7 @@ type ILPlatform = /// points and some other locations. [] type ILSourceDocument = - static member Create : language: ILGuid option * vendor: ILGuid option * documentType: ILGuid option * file: string -> ILSourceDocument + static member Create: language: ILGuid option * vendor: ILGuid option * documentType: ILGuid option * file: string -> ILSourceDocument member Language: ILGuid option member Vendor: ILGuid option member DocumentType: ILGuid option @@ -80,7 +80,7 @@ type ILSourceDocument = [] type ILSourceMarker = - static member Create : document: ILSourceDocument * line: int * column: int * endLine:int * endColumn: int-> ILSourceMarker + static member Create: document: ILSourceDocument * line: int * column: int * endLine:int * endColumn: int-> ILSourceMarker member Document: ILSourceDocument member Line: int member Column: int @@ -101,8 +101,8 @@ type ILVersionInfo = uint16 * uint16 * uint16 * uint16 [] type ILAssemblyRef = - static member Create : name: string * hash: byte[] option * publicKey: PublicKey option * retargetable: bool * version: ILVersionInfo option * locale: string option -> ILAssemblyRef - static member FromAssemblyName : System.Reflection.AssemblyName -> ILAssemblyRef + static member Create: name: string * hash: byte[] option * publicKey: PublicKey option * retargetable: bool * version: ILVersionInfo option * locale: string option -> ILAssemblyRef + static member FromAssemblyName: System.Reflection.AssemblyName -> ILAssemblyRef member Name: string /// The fully qualified name of the assembly reference, e.g. mscorlib, Version=1.0.3705 etc. member QualifiedName: string @@ -116,7 +116,7 @@ type ILAssemblyRef = [] type ILModuleRef = - static member Create : name: string * hasMetadata: bool * hash: byte[] option -> ILModuleRef + static member Create: name: string * hasMetadata: bool * hash: byte[] option -> ILModuleRef member Name: string member HasMetadata: bool member Hash: byte[] option @@ -228,13 +228,13 @@ type ILThisConvention = [] type ILCallingConv = | Callconv of ILThisConvention * ILArgConvention - member IsInstance : bool - member IsInstanceExplicit : bool - member IsStatic : bool - member ThisConv : ILThisConvention - member BasicConv : ILArgConvention - static member Instance : ILCallingConv - static member Static : ILCallingConv + member IsInstance: bool + member IsInstanceExplicit: bool + member IsStatic: bool + member ThisConv: ILThisConvention + member BasicConv: ILArgConvention + static member Instance: ILCallingConv + static member Static : ILCallingConv /// Array shapes. For most purposes, including verification, the /// rank is the only thing that matters. @@ -245,10 +245,10 @@ type ILArrayBounds = ILArrayBound * ILArrayBound [] type ILArrayShape = | ILArrayShape of ILArrayBounds list // lobound/size pairs - member Rank : int + member Rank: int /// Bounds for a single dimensional, zero based array static member SingleDimensional: ILArrayShape - static member FromRank : int -> ILArrayShape + static member FromRank: int -> ILArrayShape [] type ILBoxity = @@ -265,7 +265,7 @@ type ILGenericVariance = type ILTypeRef = /// Create a ILTypeRef. - static member Create : scope: ILScopeRef * enclosing: string list * name: string -> ILTypeRef + static member Create: scope: ILScopeRef * enclosing: string list * name: string -> ILTypeRef /// Where is the type, i.e. is it in this module, in another module in this assembly or in another assembly? member Scope: ILScopeRef @@ -280,7 +280,7 @@ type ILTypeRef = member FullName: string /// The name of the type in the assembly using the '+' notation for nested types. - member BasicQualifiedName : string + member BasicQualifiedName: string member QualifiedName: string @@ -301,7 +301,7 @@ type ILTypeRef = [] type ILTypeSpec = - static member Create : typeRef:ILTypeRef * instantiation:ILGenericArgs -> ILTypeSpec + static member Create: typeRef:ILTypeRef * instantiation:ILGenericArgs -> ILTypeSpec /// Which type is being referred to? member TypeRef: ILTypeRef @@ -341,14 +341,14 @@ and ILTypeRef * /// The type being modified. ILType - member TypeSpec : ILTypeSpec - member Boxity : ILBoxity - member TypeRef : ILTypeRef - member IsNominal : bool - member GenericArgs : ILGenericArgs - member IsTyvar : bool - member BasicQualifiedName : string - member QualifiedNameWithNoShortPrimaryAssembly : string + member TypeSpec: ILTypeSpec + member Boxity: ILBoxity + member TypeRef: ILTypeRef + member IsNominal: bool + member GenericArgs: ILGenericArgs + member IsTyvar: bool + member BasicQualifiedName: string + member QualifiedNameWithNoShortPrimaryAssembly: string and [] ILCallingSignature = @@ -372,7 +372,7 @@ and ILTypes = list [] type ILMethodRef = - static member Create : enclosingTypeRef: ILTypeRef * callingConv: ILCallingConv * name: string * genericArity: int * argTypes: ILTypes * returnType: ILType -> ILMethodRef + static member Create: enclosingTypeRef: ILTypeRef * callingConv: ILCallingConv * name: string * genericArity: int * argTypes: ILTypes * returnType: ILType -> ILMethodRef member DeclaringTypeRef: ILTypeRef member CallingConv: ILCallingConv member Name: string @@ -406,7 +406,7 @@ type ILFieldRef = [] type ILMethodSpec = - static member Create : ILType * ILMethodRef * ILGenericArgs -> ILMethodSpec + static member Create: ILType * ILMethodRef * ILGenericArgs -> ILMethodSpec member MethodRef: ILMethodRef member DeclaringType: ILType member GenericArgs: ILGenericArgs @@ -426,7 +426,7 @@ type ILFieldSpec = member DeclaringTypeRef: ILTypeRef member Name: string member FormalType: ILType - member ActualType : ILType + member ActualType: ILType /// ILCode labels. In structured code each code label /// refers to a basic block somewhere in the code of the method. @@ -636,7 +636,7 @@ type ILInstr = // Varargs - C++ only | I_arglist - // Local aggregates, i.e. stack allocated data (alloca) : C++ only + // Local aggregates, i.e. stack allocated data (alloca): C++ only | I_localloc | I_cpblk of ILAlignment * ILVolatility | I_initblk of ILAlignment * ILVolatility @@ -854,8 +854,8 @@ type ILAttribute = [] type ILAttributes = - member AsArray : ILAttribute [] - member AsList : ILAttribute list + member AsArray: ILAttribute [] + member AsList: ILAttribute list /// Method parameters and return values. @@ -873,7 +873,7 @@ type ILParameter = type ILParameters = list -val typesOfILParams : ILParameters -> ILType list +val typesOfILParams: ILParameters -> ILType list /// Method return values. [] @@ -882,7 +882,7 @@ type ILReturn = Type: ILType CustomAttrs: ILAttributes } -/// Security ILPermissions +/// Security ILSecurityDecls /// Attached to various structures... [] type ILSecurityAction = @@ -905,14 +905,14 @@ type ILSecurityAction = | InheritanceDemandChoice | DemandChoice -type ILPermission = - | PermissionSet of ILSecurityAction * byte[] +type ILSecurityDecl = + | ILSecurityDecl of ILSecurityAction * byte[] -/// Abstract type equivalent to ILPermission list - use helpers +/// Abstract type equivalent to ILSecurityDecl list - use helpers /// below to construct/destruct these. [] -type ILPermissions = - member AsList : ILPermission list +type ILSecurityDecls = + member AsList: ILSecurityDecl list /// PInvoke attributes. [] @@ -1006,62 +1006,58 @@ type ILGenericParameterDef = Variance: ILGenericVariance /// Indicates the type argument must be a reference type. HasReferenceTypeConstraint: bool - CustomAttrs : ILAttributes + CustomAttrs: ILAttributes /// Indicates the type argument must be a value type, but not Nullable. HasNotNullableValueTypeConstraint: bool /// Indicates the type argument must have a public nullary constructor. HasDefaultConstructorConstraint: bool } - type ILGenericParameterDefs = ILGenericParameterDef list [] type ILLazyMethodBody = - member Contents : MethodBody + member Contents: MethodBody -/// Method definitions. +/// IL Method definitions. /// -/// There are several different flavours of methods (constructors, -/// abstract, virtual, static, instance, class constructors). There -/// is no perfect factorization of these as the combinations are not -/// independent. - +/// The object is immutable. We use a class to get control over the representation used, +/// which allows more efficient representation of the information. [] type ILMethodDef = - { Name: string - Attributes: MethodAttributes - ImplAttributes: MethodImplAttributes - CallingConv: ILCallingConv - Parameters: ILParameters - Return: ILReturn - mdBody: ILLazyMethodBody - SecurityDecls: ILPermissions - IsEntryPoint:bool - GenericParams: ILGenericParameterDefs - CustomAttrs: ILAttributes } + new: name: string * attributes: MethodAttributes * implAttributes: MethodImplAttributes * callingConv: ILCallingConv * parameters: ILParameters * ret: ILReturn * body: ILLazyMethodBody * securityDecls: ILSecurityDecls * isEntryPoint:bool * genericParams: ILGenericParameterDefs * customAttrs: ILAttributes -> ILMethodDef + member With: ?name: string * ?attributes: MethodAttributes * ?implAttributes: MethodImplAttributes * ?callingConv: ILCallingConv * ?parameters: ILParameters * ?ret: ILReturn * ?body: ILLazyMethodBody * ?securityDecls: ILSecurityDecls * ?isEntryPoint:bool * ?genericParams: ILGenericParameterDefs * ?customAttrs: ILAttributes -> ILMethodDef + member Name: string + member Attributes: MethodAttributes + member ImplAttributes: MethodImplAttributes + member CallingConv: ILCallingConv + member Parameters: ILParameters + member Return: ILReturn + member Body: ILLazyMethodBody + member SecurityDecls: ILSecurityDecls + member IsEntryPoint:bool + member GenericParams: ILGenericParameterDefs + member CustomAttrs: ILAttributes member ParameterTypes: ILTypes - member IsIL : bool - member Code : ILCode option - member Locals : ILLocals - member MaxStack : int32 - member IsZeroInit : bool + member IsIL: bool + member Code: ILCode option + member Locals: ILLocals + member MaxStack: int32 + member IsZeroInit: bool - /// .cctor methods. The predicates (IsClassInitializer,IsConstructor,IsStatic,IsNonVirtualInstance,IsVirtual) - /// form a complete, non-overlapping classification of this type. + /// Indicates a .cctor method. member IsClassInitializer: bool - /// .ctor methods. The predicates (IsClassInitializer,IsConstructor,IsStatic,IsNonVirtualInstance,IsVirtual) - /// form a complete, non-overlapping classification of this type. + + /// Indicates a .ctor method. member IsConstructor: bool - /// static methods. The predicates (IsClassInitializer,IsConstructor,IsStatic,IsNonVirtualInstance,IsVirtual) - /// form a complete, non-overlapping classification of this type. + + /// Indicates a static method. member IsStatic: bool - /// instance methods that are not virtual. The predicates (IsClassInitializer,IsConstructor,IsStatic,IsNonVirtualInstance,IsVirtual) - /// form a complete, non-overlapping classification of this type. + + /// Indicates this is an instance methods that is not virtual. member IsNonVirtualInstance: bool - /// instance methods that are virtual or abstract or implement an interface slot. - /// The predicates (IsClassInitializer,IsConstructor,IsStatic,IsNonVirtualInstance,IsVirtual) - /// form a complete, non-overlapping classification of this type. + + /// Indicates an instance methods that is virtual or abstract or implements an interface slot. member IsVirtual: bool member IsFinal: bool @@ -1073,6 +1069,7 @@ type ILMethodDef = member Access: ILMemberAccess member IsHideBySig: bool member IsSpecialName: bool + /// The method is exported to unmanaged code using COM interop. member IsUnmanagedExport: bool member IsReqSecObj: bool @@ -1085,7 +1082,8 @@ type ILMethodDef = member IsSynchronized: bool member IsNoInline: bool member IsAggressiveInline: bool - /// .NET 2.0 feature: SafeHandle finalizer must be run. + + /// SafeHandle finalizer must be run. member IsMustRun: bool member WithSpecialName: ILMethodDef @@ -1111,98 +1109,100 @@ type ILMethodDef = [] type ILMethodDefs = interface IEnumerable - member AsArray : ILMethodDef[] - member AsList : ILMethodDef list - member FindByName : string -> ILMethodDef list + member AsArray: ILMethodDef[] + member AsList: ILMethodDef list + member FindByName: string -> ILMethodDef list /// Field definitions. [] type ILFieldDef = - { Name: string - Type: ILType - Attributes: FieldAttributes - Data: byte[] option - LiteralValue: ILFieldInit option - /// The explicit offset in bytes when explicit layout is used. - Offset: int32 option - Marshal: ILNativeType option - CustomAttrs: ILAttributes } - member IsStatic: bool - member IsSpecialName: bool - member IsLiteral: bool - member NotSerialized: bool - member IsInitOnly: bool - member Access: ILMemberAccess - member WithAccess: ILMemberAccess -> ILFieldDef - member WithInitOnly: bool -> ILFieldDef - member WithStatic: bool -> ILFieldDef - member WithSpecialName: bool -> ILFieldDef - member WithNotSerialized: bool -> ILFieldDef - member WithLiteralDefaultValue: ILFieldInit option -> ILFieldDef - member WithFieldMarshal: ILNativeType option -> ILFieldDef + new: name: string * fieldType: ILType * attributes: FieldAttributes * data: byte[] option * literalValue: ILFieldInit option * offset: int32 option * marshal: ILNativeType option * customAttrs: ILAttributes -> ILFieldDef + member With: ?name: string * ?fieldType: ILType * ?attributes: FieldAttributes * ?data: byte[] option * ?literalValue: ILFieldInit option * ?offset: int32 option * ?marshal: ILNativeType option * ?customAttrs: ILAttributes -> ILFieldDef + member Name: string + member FieldType: ILType + member Attributes: FieldAttributes + member Data: byte[] option + member LiteralValue: ILFieldInit option + /// The explicit offset in bytes when explicit layout is used. + member Offset: int32 option + member Marshal: ILNativeType option + member CustomAttrs: ILAttributes + member IsStatic: bool + member IsSpecialName: bool + member IsLiteral: bool + member NotSerialized: bool + member IsInitOnly: bool + member Access: ILMemberAccess + member WithAccess: ILMemberAccess -> ILFieldDef + member WithInitOnly: bool -> ILFieldDef + member WithStatic: bool -> ILFieldDef + member WithSpecialName: bool -> ILFieldDef + member WithNotSerialized: bool -> ILFieldDef + member WithLiteralDefaultValue: ILFieldInit option -> ILFieldDef + member WithFieldMarshal: ILNativeType option -> ILFieldDef /// Tables of fields. Logically equivalent to a list of fields but /// the table is kept in a form optimized for looking up fields by /// name. [] type ILFieldDefs = - member AsList : ILFieldDef list - member LookupByName : string -> ILFieldDef list + member AsList: ILFieldDef list + member LookupByName: string -> ILFieldDef list /// Event definitions. [] type ILEventDef = - { Type: ILType option - Name: string - Attributes: EventAttributes - AddMethod: ILMethodRef - RemoveMethod: ILMethodRef - FireMethod: ILMethodRef option - OtherMethods: ILMethodRef list - CustomAttrs: ILAttributes } - member IsSpecialName : bool - member IsRTSpecialName : bool + new: eventType: ILType option * name: string * attributes: EventAttributes * addMethod: ILMethodRef * removeMethod: ILMethodRef * fireMethod: ILMethodRef option * otherMethods: ILMethodRef list * customAttrs: ILAttributes -> ILEventDef + member With: ?eventType: ILType option * ?name: string * ?attributes: EventAttributes * ?addMethod: ILMethodRef * ?removeMethod: ILMethodRef * ?fireMethod: ILMethodRef option * ?otherMethods: ILMethodRef list * ?customAttrs: ILAttributes -> ILEventDef + member EventType: ILType option + member Name: string + member Attributes: EventAttributes + member AddMethod: ILMethodRef + member RemoveMethod: ILMethodRef + member FireMethod: ILMethodRef option + member OtherMethods: ILMethodRef list + member CustomAttrs: ILAttributes + member IsSpecialName: bool + member IsRTSpecialName: bool /// Table of those events in a type definition. [] type ILEventDefs = - member AsList : ILEventDef list - member LookupByName : string -> ILEventDef list + member AsList: ILEventDef list + member LookupByName: string -> ILEventDef list -/// Property definitions. +/// Property definitions [] type ILPropertyDef = - { Name: string - Attributes: PropertyAttributes - SetMethod: ILMethodRef option - GetMethod: ILMethodRef option - CallingConv: ILThisConvention - Type: ILType - Init: ILFieldInit option - Args: ILTypes - CustomAttrs: ILAttributes } - member IsSpecialName : bool - member IsRTSpecialName : bool + new: name: string * attributes: PropertyAttributes * setMethod: ILMethodRef option * getMethod: ILMethodRef option * callingConv: ILThisConvention * propertyType: ILType * init: ILFieldInit option * args: ILTypes * customAttrs: ILAttributes -> ILPropertyDef + member With: ?name: string * ?attributes: PropertyAttributes * ?setMethod: ILMethodRef option * ?getMethod: ILMethodRef option * ?callingConv: ILThisConvention * ?propertyType: ILType * ?init: ILFieldInit option * ?args: ILTypes * ?customAttrs: ILAttributes -> ILPropertyDef + member Name: string + member Attributes: PropertyAttributes + member SetMethod: ILMethodRef option + member GetMethod: ILMethodRef option + member CallingConv: ILThisConvention + member PropertyType: ILType + member Init: ILFieldInit option + member Args: ILTypes + member CustomAttrs: ILAttributes + member IsSpecialName: bool + member IsRTSpecialName: bool -/// Table of those properties in a type definition. +/// Table of properties in an IL type definition. [] [] type ILPropertyDefs = - member AsList : ILPropertyDef list - member LookupByName : string -> ILPropertyDef list + member AsList: ILPropertyDef list + member LookupByName: string -> ILPropertyDef list /// Method Impls -/// -/// If there is an entry (pms --> ms) in this table, then method [ms] -/// is used to implement method [pms] for the purposes of this class -/// and its subclasses. type ILMethodImplDef = { Overrides: ILOverridesSpec OverrideBy: ILMethodSpec } [] type ILMethodImplDefs = - member AsList : ILMethodImplDef list + member AsList: ILMethodImplDef list /// Type Layout information. [] @@ -1236,20 +1236,6 @@ type ILTypeDefAccess = | Nested of ILMemberAccess /// A categorization of type definitions into "kinds" - -//------------------------------------------------------------------- -// A note for the nit-picky.... In theory, the "kind" of a type -// definition can only be partially determined prior to binding. -// For example, you cannot really, absolutely tell if a type is -// really, absolutely a value type until you bind the -// super class and test it for type equality against System.ValueType. -// However, this is unbearably annoying, as it means you -// have to load "primary runtime assembly (System.Runtime or mscorlib)" and perform bind operations -// in order to be able to determine some quite simple -// things. So we approximate by simply looking at the name -// of the superclass when loading. -// ------------------------------------------------------------------ - [] type ILTypeDefKind = | Class @@ -1260,48 +1246,54 @@ type ILTypeDefKind = /// Tables of named type definitions. The types and table may contain on-demand /// (lazy) computations, e.g. the actual reading of some aspects -/// of a type definition may be delayed if the reader being used supports -/// this. -/// -/// This is an abstract type equivalent to "ILTypeDef list". +/// of a type definition may be delayed. [] [] type ILTypeDefs = interface IEnumerable - member AsArray : ILTypeDef[] - member AsList : ILTypeDef list + + member AsArray: ILTypeDef[] + + member AsList: ILTypeDef list /// Get some information about the type defs, but do not force the read of the type defs themselves. - member AsArrayOfLazyTypeDefs : (string list * string * ILAttributes * Lazy) array + member AsArrayOfLazyTypeDefs: (string list * string * ILAttributes * Lazy) array /// Calls to FindByName will result in any laziness in the overall /// set of ILTypeDefs being read in in addition /// to the details for the type found, but the remaining individual /// type definitions will not be read. - member FindByName : string -> ILTypeDef + member FindByName: string -> ILTypeDef -/// Type Definitions +/// Represents IL Type Definitions. /// -/// As for methods there are several important constraints not encoded -/// in the type definition below, for example that the super class of -/// an interface type is always None, or that enumerations always -/// have a very specific form. -and [] +/// The object is immutable. We use a class +/// to get control over the representation used, which allows more efficient representation of the information. +and [] ILTypeDef = - { Name: string - Attributes: TypeAttributes - GenericParams: ILGenericParameterDefs - Layout: ILTypeDefLayout - NestedTypes: ILTypeDefs - Implements: ILTypes - Extends: ILType option - Methods: ILMethodDefs - SecurityDecls: ILPermissions - Fields: ILFieldDefs - MethodImpls: ILMethodImplDefs - Events: ILEventDefs - Properties: ILPropertyDefs - CustomAttrs: ILAttributes } + + /// Create the contents + new: name: string * attributes: TypeAttributes * layout: ILTypeDefLayout * implements: ILTypes * genericParams: ILGenericParameterDefs * + extends: ILType option * methods: ILMethodDefs * nestedTypes: ILTypeDefs * fields: ILFieldDefs * methodImpls: ILMethodImplDefs * + events: ILEventDefs * properties: ILPropertyDefs * customAttrs: ILAttributes * securityDecls: ILSecurityDecls -> ILTypeDef + + /// Update the contents + member With: ?name: string * ?attributes: TypeAttributes * ?layout: ILTypeDefLayout * ?implements: ILTypes * ?genericParams:ILGenericParameterDefs * ?extends:ILType option * ?methods:ILMethodDefs * ?nestedTypes:ILTypeDefs * ?fields: ILFieldDefs * ?methodImpls:ILMethodImplDefs * ?events:ILEventDefs * ?properties:ILPropertyDefs * ?customAttrs:ILAttributes * ?securityDecls: ILSecurityDecls -> ILTypeDef + + member Name: string + member Attributes: TypeAttributes + member GenericParams: ILGenericParameterDefs + member Layout: ILTypeDefLayout + member NestedTypes: ILTypeDefs + member Implements: ILTypes + member Extends: ILType option + member Methods: ILMethodDefs + member SecurityDecls: ILSecurityDecls + member Fields: ILFieldDefs + member MethodImpls: ILMethodImplDefs + member Events: ILEventDefs + member Properties: ILPropertyDefs + member CustomAttrs: ILAttributes member IsClass: bool member IsStruct: bool member IsInterface: bool @@ -1319,6 +1311,7 @@ and [] /// e.g. if they use SuppressUnmanagedCodeSecurityAttribute member HasSecurity: bool member Encoding: ILDefaultPInvokeEncoding + member WithAccess: ILTypeDefAccess -> ILTypeDef member WithNestedAccess: ILMemberAccess -> ILTypeDef member WithSealed: bool -> ILTypeDef @@ -1335,7 +1328,7 @@ and [] [] [] type ILNestedExportedTypes = - member AsList : ILNestedExportedType list + member AsList: ILNestedExportedType list /// "Classes Elsewhere" - classes in auxiliary modules. /// @@ -1385,7 +1378,7 @@ type ILExportedTypeOrForwarder = [] [] type ILExportedTypesAndForwarders = - member AsList : ILExportedTypeOrForwarder list + member AsList: ILExportedTypeOrForwarder list [] type ILResourceAccess = @@ -1408,13 +1401,13 @@ type ILResource = Access: ILResourceAccess CustomAttrs: ILAttributes } /// Read the bytes from a resource local to an assembly - member Bytes : byte[] + member Bytes: byte[] /// Table of resources in a module. [] [] type ILResources = - member AsList : ILResource list + member AsList: ILResource list [] @@ -1434,7 +1427,7 @@ type ILAssemblyManifest = /// cryptographic hashes: they are simple file hashes. The algorithm /// is normally 0x00008004 indicating the SHA1 hash algorithm. AuxModuleHashAlgorithm: int32 - SecurityDecls: ILPermissions + SecurityDecls: ILSecurityDecls /// This is the public key used to sign this /// assembly (the signature itself is stored elsewhere: see the /// binary format, and may not have been written if delay signing @@ -1466,8 +1459,8 @@ type ILModuleDef = CustomAttrs: ILAttributes Name: string TypeDefs: ILTypeDefs - SubsystemVersion : int * int - UseHighEntropyVA : bool + SubsystemVersion: int * int + UseHighEntropyVA: bool SubSystemFlags: int32 IsDLL: bool IsILOnly: bool @@ -1484,7 +1477,7 @@ type ILModuleDef = /// e.g. win86 resources, as the exact contents of a .res or .obj file. NativeResources: Lazy list } member ManifestOfAssembly: ILAssemblyManifest - member HasManifest : bool + member HasManifest: bool /// Find the method definition corresponding to the given property or /// event operation. These are always in the same class as the property @@ -1541,8 +1534,8 @@ val ungenericizeTypeName: string -> string (* e.g. List`1 --> List *) /// reference items from it via an ILGlobals for that specific version built using mkILGlobals. [] type ILGlobals = - member primaryAssemblyScopeRef : ILScopeRef - member primaryAssemblyName : string + member primaryAssemblyScopeRef: ILScopeRef + member primaryAssemblyName: string member typ_Object: ILType member typ_String: ILType member typ_Type: ILType @@ -1566,7 +1559,7 @@ type ILGlobals = /// Build the table of commonly used references given functions to find types in system assemblies val mkILGlobals: ILScopeRef -> ILGlobals -val EcmaMscorlibILGlobals : ILGlobals +val EcmaMscorlibILGlobals: ILGlobals /// When writing a binary the fake "toplevel" type definition (called ) /// must come first. This function puts it first, and creates it in the returned @@ -1610,7 +1603,7 @@ val mkILArrTy: ILType * ILArrayShape -> ILType val mkILArr1DTy: ILType -> ILType val isILArrTy: ILType -> bool val destILArrTy: ILType -> ILArrayShape * ILType -val mkILBoxedType : ILTypeSpec -> ILType +val mkILBoxedType: ILTypeSpec -> ILType /// Make method references and specs. val mkILMethRef: ILTypeRef * ILCallingConv * string * int * ILType list * ILType -> ILMethodRef @@ -1650,7 +1643,7 @@ val mkILFormalNamedTy: ILBoxity -> ILTypeRef -> ILGenericParameterDef list -> IL val mkILFormalTypars: ILType list -> ILGenericParameterDefs val mkILFormalGenericArgs: int -> ILGenericParameterDefs -> ILGenericArgsList -val mkILSimpleTypar : string -> ILGenericParameterDef +val mkILSimpleTypar: string -> ILGenericParameterDef /// Make custom attributes. val mkILCustomAttribMethRef: ILGlobals @@ -1666,11 +1659,11 @@ val mkILCustomAttribute: ILAttributeNamedArg list (* named args: values and flags indicating if they are fields or properties *) -> ILAttribute -val mkPermissionSet : ILGlobals -> ILSecurityAction * (ILTypeRef * (string * ILType * ILAttribElem) list) list -> ILPermission +val mkPermissionSet: ILGlobals -> ILSecurityAction * (ILTypeRef * (string * ILType * ILAttribElem) list) list -> ILSecurityDecl /// Making code. val generateCodeLabel: unit -> ILCodeLabel -val formatCodeLabel : ILCodeLabel -> string +val formatCodeLabel: ILCodeLabel -> string /// Make some code that is a straight line sequence of instructions. /// The function will add a "return" if the last instruction is not an exiting instruction. @@ -1678,16 +1671,16 @@ val nonBranchingInstrsToCode: ILInstr list -> ILCode /// Helpers for codegen: scopes for allocating new temporary variables. type ILLocalsAllocator = - new : preAlloc: int -> ILLocalsAllocator - member AllocLocal : ILLocal -> uint16 - member Close : unit -> ILLocal list + new: preAlloc: int -> ILLocalsAllocator + member AllocLocal: ILLocal -> uint16 + member Close: unit -> ILLocal list /// Derived functions for making some common patterns of instructions. val mkNormalCall: ILMethodSpec -> ILInstr val mkNormalCallvirt: ILMethodSpec -> ILInstr val mkNormalCallconstraint: ILType * ILMethodSpec -> ILInstr val mkNormalNewobj: ILMethodSpec -> ILInstr -val mkCallBaseConstructor : ILType * ILType list -> ILInstr list +val mkCallBaseConstructor: ILType * ILType list -> ILInstr list val mkNormalStfld: ILFieldSpec -> ILInstr val mkNormalStsfld: ILFieldSpec -> ILInstr val mkNormalLdsfld: ILFieldSpec -> ILInstr @@ -1780,12 +1773,12 @@ val mkILCustomAttrsFromArray: ILAttribute[] -> ILAttributes val mkILComputedCustomAttrs: (unit -> ILAttribute[]) -> ILAttributes val emptyILCustomAttrs: ILAttributes -val mkILSecurityDecls: ILPermission list -> ILPermissions -val mkILLazySecurityDecls: Lazy -> ILPermissions -val emptyILSecurityDecls: ILPermissions +val mkILSecurityDecls: ILSecurityDecl list -> ILSecurityDecls +val mkILLazySecurityDecls: Lazy -> ILSecurityDecls +val emptyILSecurityDecls: ILSecurityDecls -val mkMethBodyAux : MethodBody -> ILLazyMethodBody -val mkMethBodyLazyAux : Lazy -> ILLazyMethodBody +val mkMethBodyAux: MethodBody -> ILLazyMethodBody +val mkMethBodyLazyAux: Lazy -> ILLazyMethodBody val mkILEvents: ILEventDef list -> ILEventDefs val mkILEventsLazy: Lazy -> ILEventDefs @@ -1834,7 +1827,7 @@ val mkILResources: ILResource list -> ILResources val mkILResourcesLazy: Lazy -> ILResources /// Making modules. -val mkILSimpleModule: assemblyName:string -> moduleName:string -> dll:bool -> subsystemVersion : (int * int) -> useHighEntropyVA : bool -> ILTypeDefs -> int32 option -> string option -> int -> ILExportedTypesAndForwarders -> string -> ILModuleDef +val mkILSimpleModule: assemblyName:string -> moduleName:string -> dll:bool -> subsystemVersion: (int * int) -> useHighEntropyVA: bool -> ILTypeDefs -> int32 option -> string option -> int -> ILExportedTypesAndForwarders -> string -> ILModuleDef /// Generate references to existing type definitions, method definitions /// etc. Useful for generating references, e.g. to a class we're processing @@ -1843,9 +1836,9 @@ val mkILSimpleModule: assemblyName:string -> moduleName:string -> dll:bool -> su /// an auxiliary module or are generating multiple assemblies at /// once. -val mkRefForNestedILTypeDef : ILScopeRef -> ILTypeDef list * ILTypeDef -> ILTypeRef -val mkRefForILMethod : ILScopeRef -> ILTypeDef list * ILTypeDef -> ILMethodDef -> ILMethodRef -val mkRefForILField : ILScopeRef -> ILTypeDef list * ILTypeDef -> ILFieldDef -> ILFieldRef +val mkRefForNestedILTypeDef: ILScopeRef -> ILTypeDef list * ILTypeDef -> ILTypeRef +val mkRefForILMethod : ILScopeRef -> ILTypeDef list * ILTypeDef -> ILMethodDef -> ILMethodRef +val mkRefForILField : ILScopeRef -> ILTypeDef list * ILTypeDef -> ILFieldDef -> ILFieldRef val mkRefToILMethod: ILTypeRef * ILMethodDef -> ILMethodRef val mkRefToILField: ILTypeRef * ILFieldDef -> ILFieldRef @@ -1934,7 +1927,7 @@ val isILDoubleTy: ILType -> bool val isILSingleTy: ILType -> bool /// Get a public key token from a public key. -val sha1HashBytes : byte[] -> byte[] (* SHA1 hash *) +val sha1HashBytes: byte[] -> byte[] (* SHA1 hash *) /// Get a version number from a CLR version string, e.g. 1.0.3705.0 val parseILVersion: string -> ILVersionInfo @@ -1959,13 +1952,13 @@ val computeILEnumInfo: string * ILFieldDefs -> ILEnumInfo [] type ILEventRef = - static member Create : ILTypeRef * string -> ILEventRef + static member Create: ILTypeRef * string -> ILEventRef member DeclaringTypeRef: ILTypeRef member Name: string [] type ILPropertyRef = - static member Create : ILTypeRef * string -> ILPropertyRef + static member Create: ILTypeRef * string -> ILPropertyRef member DeclaringTypeRef: ILTypeRef member Name: string interface System.IComparable diff --git a/src/absil/ilmorph.fs b/src/absil/ilmorph.fs index 90b0e267f6..4e8d4ed8c0 100644 --- a/src/absil/ilmorph.fs +++ b/src/absil/ilmorph.fs @@ -155,8 +155,8 @@ let cattrs_typ2typ ilg f (cs: ILAttributes) = mkILCustomAttrs (List.map (cattr_typ2typ ilg f) cs.AsList) let fdef_typ2typ ilg ftype (fd: ILFieldDef) = - {fd with Type=ftype fd.Type; - CustomAttrs=cattrs_typ2typ ilg ftype fd.CustomAttrs} + fd.With(fieldType=ftype fd.FieldType, + customAttrs=cattrs_typ2typ ilg ftype fd.CustomAttrs) let local_typ2typ f (l: ILLocal) = {l with Type = f l.Type} let varargs_typ2typ f (varargs: ILVarArgs) = Option.map (List.map f) varargs @@ -225,16 +225,15 @@ let morphILMethodBody (filmbody) (x: ILLazyMethodBody) = let ospec_typ2typ f (OverridesSpec(mref,ty)) = OverridesSpec(mref_typ2typ f mref, f ty) -let mdef_typ2typ_ilmbody2ilmbody ilg fs md = +let mdef_typ2typ_ilmbody2ilmbody ilg fs (md: ILMethodDef) = let (ftype,filmbody) = fs let ftype' = ftype (Some md) - let body' = morphILMethodBody (filmbody (Some md)) md.mdBody - {md with - GenericParams=gparams_typ2typ ftype' md.GenericParams; - mdBody= body'; - Parameters = List.map (param_typ2typ ilg ftype') md.Parameters; - Return = return_typ2typ ilg ftype' md.Return; - CustomAttrs=cattrs_typ2typ ilg ftype' md.CustomAttrs } + let body' = morphILMethodBody (filmbody (Some md)) md.Body + md.With(genericParams=gparams_typ2typ ftype' md.GenericParams, + body= body', + parameters = List.map (param_typ2typ ilg ftype') md.Parameters, + ret = return_typ2typ ilg ftype' md.Return, + customAttrs=cattrs_typ2typ ilg ftype' md.CustomAttrs) let fdefs_typ2typ ilg f x = fdefs_fdef2fdef (fdef_typ2typ ilg f) x @@ -244,44 +243,41 @@ let mimpl_typ2typ f e = { Overrides = ospec_typ2typ f e.Overrides; OverrideBy = mspec_typ2typ (f,(fun _ -> f)) e.OverrideBy; } -let edef_typ2typ ilg f e = - { e with - Type = Option.map f e.Type; - AddMethod = mref_typ2typ f e.AddMethod; - RemoveMethod = mref_typ2typ f e.RemoveMethod; - FireMethod = Option.map (mref_typ2typ f) e.FireMethod; - OtherMethods = List.map (mref_typ2typ f) e.OtherMethods; - CustomAttrs = cattrs_typ2typ ilg f e.CustomAttrs } - -let pdef_typ2typ ilg f p = - { p with - SetMethod = Option.map (mref_typ2typ f) p.SetMethod; - GetMethod = Option.map (mref_typ2typ f) p.GetMethod; - Type = f p.Type; - Args = List.map f p.Args; - CustomAttrs = cattrs_typ2typ ilg f p.CustomAttrs } +let edef_typ2typ ilg f (e: ILEventDef) = + e.With(eventType = Option.map f e.EventType, + addMethod = mref_typ2typ f e.AddMethod, + removeMethod = mref_typ2typ f e.RemoveMethod, + fireMethod = Option.map (mref_typ2typ f) e.FireMethod, + otherMethods = List.map (mref_typ2typ f) e.OtherMethods, + customAttrs = cattrs_typ2typ ilg f e.CustomAttrs) + +let pdef_typ2typ ilg f (p: ILPropertyDef) = + p.With(setMethod = Option.map (mref_typ2typ f) p.SetMethod, + getMethod = Option.map (mref_typ2typ f) p.GetMethod, + propertyType = f p.PropertyType, + args = List.map f p.Args, + customAttrs = cattrs_typ2typ ilg f p.CustomAttrs) let pdefs_typ2typ ilg f (pdefs: ILPropertyDefs) = mkILProperties (List.map (pdef_typ2typ ilg f) pdefs.AsList) let edefs_typ2typ ilg f (edefs: ILEventDefs) = mkILEvents (List.map (edef_typ2typ ilg f) edefs.AsList) let mimpls_typ2typ f (mimpls : ILMethodImplDefs) = mkILMethodImpls (List.map (mimpl_typ2typ f) mimpls.AsList) -let rec tdef_typ2typ_ilmbody2ilmbody_mdefs2mdefs ilg enc fs td = +let rec tdef_typ2typ_ilmbody2ilmbody_mdefs2mdefs ilg enc fs (td: ILTypeDef) = let (ftype,fmdefs) = fs let ftype' = ftype (Some (enc,td)) None let mdefs' = fmdefs (enc,td) td.Methods let fdefs' = fdefs_typ2typ ilg ftype' td.Fields - {td with Implements= List.map ftype' td.Implements; - GenericParams= gparams_typ2typ ftype' td.GenericParams; - Extends = Option.map ftype' td.Extends; - Methods=mdefs'; - NestedTypes=tdefs_typ2typ_ilmbody2ilmbody_mdefs2mdefs ilg (enc@[td]) fs td.NestedTypes; - Fields=fdefs'; - MethodImpls = mimpls_typ2typ ftype' td.MethodImpls; - Events = edefs_typ2typ ilg ftype' td.Events; - Properties = pdefs_typ2typ ilg ftype' td.Properties; - CustomAttrs = cattrs_typ2typ ilg ftype' td.CustomAttrs; - } + td.With(implements= List.map ftype' td.Implements, + genericParams= gparams_typ2typ ftype' td.GenericParams, + extends = Option.map ftype' td.Extends, + methods=mdefs', + nestedTypes=tdefs_typ2typ_ilmbody2ilmbody_mdefs2mdefs ilg (enc@[td]) fs td.NestedTypes, + fields=fdefs', + methodImpls = mimpls_typ2typ ftype' td.MethodImpls, + events = edefs_typ2typ ilg ftype' td.Events, + properties = pdefs_typ2typ ilg ftype' td.Properties, + customAttrs = cattrs_typ2typ ilg ftype' td.CustomAttrs) and tdefs_typ2typ_ilmbody2ilmbody_mdefs2mdefs ilg enc fs tdefs = morphILTypeDefs (tdef_typ2typ_ilmbody2ilmbody_mdefs2mdefs ilg enc fs) tdefs diff --git a/src/absil/ilprint.fs b/src/absil/ilprint.fs index abad68c977..f2b722292f 100644 --- a/src/absil/ilprint.fs +++ b/src/absil/ilprint.fs @@ -270,14 +270,14 @@ and goutput_permission _env os p = match p with - | PermissionSet (sa,b) -> + | ILSecurityDecl (sa,b) -> output_string os " .permissionset " output_security_action os sa output_string os " = (" output_bytes os b output_string os ")" -and goutput_security_decls env os (ps: ILPermissions) = output_seq " " (goutput_permission env) os ps.AsList +and goutput_security_decls env os (ps: ILSecurityDecls) = output_seq " " (goutput_permission env) os ps.AsList and goutput_gparam env os (gf: ILGenericParameterDef) = output_string os (tyvar_generator gf.Name); @@ -469,30 +469,30 @@ let output_custom_attr_data os data = output_string os " = "; output_parens output_bytes os data let goutput_custom_attr env os attr = - output_string os " .custom "; - goutput_mspec env os attr.Method; + output_string os " .custom " + goutput_mspec env os attr.Method output_custom_attr_data os attr.Data let goutput_custom_attrs env os (attrs : ILAttributes) = List.iter (fun attr -> goutput_custom_attr env os attr; output_string os "\n" ) attrs.AsList -let goutput_fdef _tref env os fd = - output_string os " .field "; +let goutput_fdef _tref env os (fd: ILFieldDef) = + output_string os " .field " match fd.Offset with Some i -> output_string os "["; output_i32 os i; output_string os "] " | None -> () match fd.Marshal with Some _i -> output_string os "// marshal attribute not printed\n"; | None -> () - output_member_access os fd.Access; - output_string os " "; - if fd.IsStatic then output_string os " static "; - if fd.IsLiteral then output_string os " literal "; - if fd.IsSpecialName then output_string os " specialname rtspecialname "; - if fd.IsInitOnly then output_string os " initonly "; - if fd.NotSerialized then output_string os " notserialized "; - goutput_typ env os fd.Type; - output_string os " "; - output_id os fd.Name; - output_option output_at os fd.Data; - output_option output_field_init os fd.LiteralValue; - output_string os "\n"; + output_member_access os fd.Access + output_string os " " + if fd.IsStatic then output_string os " static " + if fd.IsLiteral then output_string os " literal " + if fd.IsSpecialName then output_string os " specialname rtspecialname " + if fd.IsInitOnly then output_string os " initonly " + if fd.NotSerialized then output_string os " notserialized " + goutput_typ env os fd.FieldType + output_string os " " + output_id os fd.Name + output_option output_at os fd.Data + output_option output_field_init os fd.LiteralValue + output_string os "\n" goutput_custom_attrs env os fd.CustomAttrs @@ -768,7 +768,7 @@ let goutput_ilmbody env os (il: ILMethodBody) = output_string os ")\n" -let goutput_mbody is_entrypoint env os md = +let goutput_mbody is_entrypoint env os (md: ILMethodDef) = if md.ImplAttributes &&& MethodImplAttributes.Native <> enum 0 then output_string os "native " elif md.ImplAttributes &&& MethodImplAttributes.IL <> enum 0 then output_string os "cil " else output_string os "runtime " @@ -779,7 +779,7 @@ let goutput_mbody is_entrypoint env os md = output_string os " \n{ \n" ; goutput_security_decls env os md.SecurityDecls; goutput_custom_attrs env os md.CustomAttrs; - match md.mdBody.Contents with + match md.Body.Contents with | MethodBody.IL il -> goutput_ilmbody env os il | _ -> () if is_entrypoint then output_string os " .entrypoint"; @@ -799,7 +799,7 @@ let goutput_mdef env os (md:ILMethodDef) = elif md.IsConstructor then "rtspecialname" elif md.IsStatic then "static "^ - (match md.mdBody.Contents with + (match md.Body.Contents with MethodBody.PInvoke (attr) -> "pinvokeimpl(\""^ attr.Where.Name^"\" as \""^ attr.Name ^"\""^ (match attr.CallingConv with @@ -852,7 +852,7 @@ let goutput_mdef env os (md:ILMethodDef) = (goutput_mbody is_entrypoint menv) os md; output_string os "\n" -let goutput_pdef env os pd = +let goutput_pdef env os (pd: ILPropertyDef) = output_string os "property\n\tgetter: "; (match pd.GetMethod with None -> () | Some mref -> goutput_mref env os mref); output_string os "\n\tsetter: "; @@ -891,7 +891,7 @@ let goutput_mdefs env os (mdefs: ILMethodDefs) = let goutput_pdefs env os (pdefs: ILPropertyDefs) = List.iter (fun f -> (goutput_pdef env) os f; output_string os "\n" ) pdefs.AsList -let rec goutput_tdef (enc) env contents os cd = +let rec goutput_tdef enc env contents os (cd: ILTypeDef) = let env = ppenv_enter_tdef cd.GenericParams env let layout_attr,pp_layout_decls = splitTypeLayout cd.Layout if isTypeNameForGlobalFunctions cd.Name then @@ -939,26 +939,26 @@ and output_init_semantics os f = and goutput_lambdas env os lambdas = match lambdas with | Lambdas_forall (gf,l) -> - output_angled (goutput_gparam env) os gf; - output_string os " "; + output_angled (goutput_gparam env) os gf + output_string os " " (goutput_lambdas env) os l | Lambdas_lambda (ps,l) -> output_parens (goutput_param env) os ps; - output_string os " "; + output_string os " " (goutput_lambdas env) os l | Lambdas_return typ -> output_string os "--> "; (goutput_typ env) os typ -and goutput_tdefs contents (enc) env os (td: ILTypeDefs) = +and goutput_tdefs contents enc env os (td: ILTypeDefs) = List.iter (goutput_tdef enc env contents os) td.AsList let output_ver os (a,b,c,d) = - output_string os " .ver "; - output_u16 os a; - output_string os " : "; - output_u16 os b; - output_string os " : "; - output_u16 os c; - output_string os " : "; + output_string os " .ver " + output_u16 os a + output_string os " : " + output_u16 os b + output_string os " : " + output_u16 os c + output_string os " : " output_u16 os d let output_locale os s = output_string os " .Locale "; output_qstring os s diff --git a/src/absil/ilread.fs b/src/absil/ilread.fs index e89164a42a..aca3d1ee15 100644 --- a/src/absil/ilread.fs +++ b/src/absil/ilread.fs @@ -1009,7 +1009,7 @@ type ILReaderContext = seekReadMemberRefAsMethodData : MemberRefAsMspecIdx -> VarArgMethodData seekReadMemberRefAsFieldSpec : MemberRefAsFspecIdx -> ILFieldSpec seekReadCustomAttr : CustomAttrIdx -> ILAttribute - seekReadSecurityDecl : SecurityDeclIdx -> ILPermission + seekReadSecurityDecl : SecurityDeclIdx -> ILSecurityDecl seekReadTypeRef : int ->ILTypeRef seekReadTypeRefAsType : TypeRefAsTypIdx -> ILType readBlobHeapAsPropertySig : BlobAsPropSigIdx -> ILThisConvention * ILType * ILTypes @@ -1703,20 +1703,20 @@ and seekReadTypeDef ctxt toponly (idx:int) = let mimpls = seekReadMethodImpls ctxt numtypars idx let props = seekReadProperties ctxt numtypars idx let events = seekReadEvents ctxt numtypars idx - { Name=nm - GenericParams=typars - Attributes= enum(flags) - Layout = layout - NestedTypes= nested - Implements = impls - Extends = super - Methods = mdefs - SecurityDecls = sdecls - Fields=fdefs - MethodImpls=mimpls - Events= events - Properties=props - CustomAttrs=cas } + ILTypeDef(name=nm, + genericParams=typars , + attributes= enum(flags), + layout = layout, + nestedTypes= nested, + implements = impls, + extends = super, + methods = mdefs, + securityDecls = sdecls, + fields=fdefs, + methodImpls=mimpls, + events= events, + properties=props, + customAttrs=cas) Some (ns, n, cas, rest) and seekReadTopTypeDefs ctxt () = @@ -1888,32 +1888,33 @@ and seekReadOptionalTypeDefOrRef ctxt numtypars boxity idx = else Some (seekReadTypeDefOrRef ctxt numtypars boxity List.empty idx) and seekReadField ctxt (numtypars, hasLayout) (idx:int) = - let (flags, nameIdx, typeIdx) = seekReadFieldRow ctxt idx - let nm = readStringHeap ctxt nameIdx - let isStatic = (flags &&& 0x0010) <> 0 - let fd = - { Name = nm - Type= readBlobHeapAsFieldSig ctxt numtypars typeIdx - Attributes = enum(flags) - LiteralValue = if (flags &&& 0x8000) = 0 then None else Some (seekReadConstant ctxt (TaggedIndex(hc_FieldDef, idx))) - Marshal = - if (flags &&& 0x1000) = 0 then None else - Some (seekReadIndexedRow (ctxt.getNumRows TableNames.FieldMarshal, seekReadFieldMarshalRow ctxt, - fst, hfmCompare (TaggedIndex(hfm_FieldDef, idx)), - isSorted ctxt TableNames.FieldMarshal, - (snd >> readBlobHeapAsNativeType ctxt))) - Data = - if (flags &&& 0x0100) = 0 then None - else - let rva = seekReadIndexedRow (ctxt.getNumRows TableNames.FieldRVA, seekReadFieldRVARow ctxt, - snd, simpleIndexCompare idx, isSorted ctxt TableNames.FieldRVA, fst) - Some (rvaToData ctxt "field" rva) - Offset = - if hasLayout && not isStatic then - Some (seekReadIndexedRow (ctxt.getNumRows TableNames.FieldLayout, seekReadFieldLayoutRow ctxt, - snd, simpleIndexCompare idx, isSorted ctxt TableNames.FieldLayout, fst)) else None - CustomAttrs=seekReadCustomAttrs ctxt (TaggedIndex(hca_FieldDef, idx)) } - fd + let (flags, nameIdx, typeIdx) = seekReadFieldRow ctxt idx + let nm = readStringHeap ctxt nameIdx + let isStatic = (flags &&& 0x0010) <> 0 + ILFieldDef(name = nm, + fieldType= readBlobHeapAsFieldSig ctxt numtypars typeIdx, + attributes = enum(flags), + literalValue = (if (flags &&& 0x8000) = 0 then None else Some (seekReadConstant ctxt (TaggedIndex(hc_FieldDef, idx)))), + marshal = + (if (flags &&& 0x1000) = 0 then + None + else + Some (seekReadIndexedRow (ctxt.getNumRows TableNames.FieldMarshal, seekReadFieldMarshalRow ctxt, + fst, hfmCompare (TaggedIndex(hfm_FieldDef, idx)), + isSorted ctxt TableNames.FieldMarshal, + (snd >> readBlobHeapAsNativeType ctxt)))), + data = + (if (flags &&& 0x0100) = 0 then + None + else + let rva = seekReadIndexedRow (ctxt.getNumRows TableNames.FieldRVA, seekReadFieldRVARow ctxt, + snd, simpleIndexCompare idx, isSorted ctxt TableNames.FieldRVA, fst) + Some (rvaToData ctxt "field" rva)), + offset = + (if hasLayout && not isStatic then + Some (seekReadIndexedRow (ctxt.getNumRows TableNames.FieldLayout, seekReadFieldLayoutRow ctxt, + snd, simpleIndexCompare idx, isSorted ctxt TableNames.FieldLayout, fst)) else None), + customAttrs=seekReadCustomAttrs ctxt (TaggedIndex(hca_FieldDef, idx) )) and seekReadFields ctxt (numtypars, hasLayout) fidx1 fidx2 = mkILFieldsLazy @@ -2254,27 +2255,26 @@ and seekReadMethod ctxt numtypars (idx:int) = let ret, ilParams = seekReadParams ctxt (retty, argtys) paramIdx endParamIdx - { Name=nm - Attributes = enum(flags) - ImplAttributes= enum(implflags) - SecurityDecls=seekReadSecurityDecls ctxt (TaggedIndex(hds_MethodDef, idx)) - IsEntryPoint= (fst ctxt.entryPointToken = TableNames.Method && snd ctxt.entryPointToken = idx) - GenericParams=seekReadGenericParams ctxt numtypars (tomd_MethodDef, idx) - CustomAttrs=seekReadCustomAttrs ctxt (TaggedIndex(hca_MethodDef, idx)) - Parameters= ilParams - CallingConv=cc - Return=ret - mdBody= - if (codetype = 0x01) && pinvoke then - mkMethBodyLazyAux (notlazy MethodBody.Native) - elif pinvoke then - seekReadImplMap ctxt nm idx - elif internalcall || abstr || unmanaged || (codetype <> 0x00) then - //if codeRVA <> 0x0 then dprintn "non-IL or abstract method with non-zero RVA" - mkMethBodyLazyAux (notlazy MethodBody.Abstract) - else - seekReadMethodRVA ctxt (idx, nm, internalcall, noinline, aggressiveinline, numtypars) codeRVA - } + ILMethodDef(name=nm, + attributes = enum(flags), + implAttributes= enum(implflags), + securityDecls=seekReadSecurityDecls ctxt (TaggedIndex(hds_MethodDef, idx)), + isEntryPoint= (fst ctxt.entryPointToken = TableNames.Method && snd ctxt.entryPointToken = idx), + genericParams=seekReadGenericParams ctxt numtypars (tomd_MethodDef, idx), + customAttrs=seekReadCustomAttrs ctxt (TaggedIndex(hca_MethodDef, idx)) , + parameters= ilParams, + callingConv=cc, + ret=ret, + body= + (if (codetype = 0x01) && pinvoke then + mkMethBodyLazyAux (notlazy MethodBody.Native) + elif pinvoke then + seekReadImplMap ctxt nm idx + elif internalcall || abstr || unmanaged || (codetype <> 0x00) then + //if codeRVA <> 0x0 then dprintn "non-IL or abstract method with non-zero RVA" + mkMethBodyLazyAux (notlazy MethodBody.Abstract) + else + seekReadMethodRVA ctxt (idx, nm, internalcall, noinline, aggressiveinline, numtypars) codeRVA)) and seekReadParams ctxt (retty, argtys) pidx1 pidx2 = @@ -2358,14 +2358,14 @@ and seekReadMethodSemantics ctxt id = and seekReadEvent ctxt numtypars idx = let (flags, nameIdx, typIdx) = seekReadEventRow ctxt idx - { Type = seekReadOptionalTypeDefOrRef ctxt numtypars AsObject typIdx - Name = readStringHeap ctxt nameIdx - Attributes = enum(flags) - AddMethod= seekReadMethodSemantics ctxt (0x0008, TaggedIndex(hs_Event, idx)) - RemoveMethod=seekReadMethodSemantics ctxt (0x0010, TaggedIndex(hs_Event, idx)) - FireMethod=seekReadoptional_MethodSemantics ctxt (0x0020, TaggedIndex(hs_Event, idx)) - OtherMethods = seekReadMultipleMethodSemantics ctxt (0x0004, TaggedIndex(hs_Event, idx)) - CustomAttrs=seekReadCustomAttrs ctxt (TaggedIndex(hca_Event, idx)) } + ILEventDef(eventType = seekReadOptionalTypeDefOrRef ctxt numtypars AsObject typIdx, + name = readStringHeap ctxt nameIdx, + attributes = enum(flags), + addMethod= seekReadMethodSemantics ctxt (0x0008, TaggedIndex(hs_Event, idx)), + removeMethod=seekReadMethodSemantics ctxt (0x0010, TaggedIndex(hs_Event, idx)), + fireMethod=seekReadoptional_MethodSemantics ctxt (0x0020, TaggedIndex(hs_Event, idx)), + otherMethods = seekReadMultipleMethodSemantics ctxt (0x0004, TaggedIndex(hs_Event, idx)), + customAttrs=seekReadCustomAttrs ctxt (TaggedIndex(hca_Event, idx))) (* REVIEW: can substantially reduce numbers of EventMap and PropertyMap reads by first checking if the whole table is sorted according to ILTypeDef tokens and then doing a binary chop *) and seekReadEvents ctxt numtypars tidx = @@ -2398,15 +2398,15 @@ and seekReadProperty ctxt numtypars idx = match setter with | Some mref -> mref.CallingConv .ThisConv | None -> cc - { Name=readStringHeap ctxt nameIdx - CallingConv = cc2 - Attributes = enum(flags) - SetMethod=setter - GetMethod=getter - Type=retty - Init= if (flags &&& 0x1000) = 0 then None else Some (seekReadConstant ctxt (TaggedIndex(hc_Property, idx))) - Args=argtys - CustomAttrs=seekReadCustomAttrs ctxt (TaggedIndex(hca_Property, idx)) } + ILPropertyDef(name=readStringHeap ctxt nameIdx, + callingConv = cc2, + attributes = enum(flags), + setMethod=setter, + getMethod=getter, + propertyType=retty, + init= (if (flags &&& 0x1000) = 0 then None else Some (seekReadConstant ctxt (TaggedIndex(hc_Property, idx)))), + args=argtys, + customAttrs=seekReadCustomAttrs ctxt (TaggedIndex(hca_Property, idx))) and seekReadProperties ctxt numtypars tidx = mkILPropertiesLazy @@ -2461,10 +2461,9 @@ and seekReadSecurityDecl ctxt (a, b) = and seekReadSecurityDeclUncached ctxtH (SecurityDeclIdx (act, ty)) = let ctxt = getHole ctxtH - PermissionSet ((if List.memAssoc (int act) (Lazy.force ILSecurityActionRevMap) then List.assoc (int act) (Lazy.force ILSecurityActionRevMap) else failwith "unknown security action"), + ILSecurityDecl ((if List.memAssoc (int act) (Lazy.force ILSecurityActionRevMap) then List.assoc (int act) (Lazy.force ILSecurityActionRevMap) else failwith "unknown security action"), readBlobHeap ctxt ty) - and seekReadConstant ctxt idx = let kind, vidx = seekReadIndexedRow (ctxt.getNumRows TableNames.Constant, seekReadConstantRow ctxt, diff --git a/src/absil/ilreflect.fs b/src/absil/ilreflect.fs index 8f040838c6..6fc0c03e12 100644 --- a/src/absil/ilreflect.fs +++ b/src/absil/ilreflect.fs @@ -1474,17 +1474,12 @@ let rec buildMethodPass2 cenv tref (typB:TypeBuilder) emEnv (mdef : ILMethodDef) let implflags = mdef.ImplAttributes let cconv = convCallConv mdef.CallingConv let mref = mkRefToILMethod (tref, mdef) - let emEnv = if mdef.IsEntryPoint && isNil mdef.ParameterTypes then - (* Bug 2209: - Here, we collect the entry points generated by ilxgen corresponding to the top-level effects. - Users can (now) annotate their own functions with EntryPoint attributes. - However, these user entry points functions must take string[] argument. - By only adding entry points with no arguments, we only collect the top-level effects. - *) - envAddEntryPt emEnv (typB, mdef.Name) - else - emEnv - match mdef.mdBody.Contents with + let emEnv = + if mdef.IsEntryPoint && isNil mdef.ParameterTypes then + envAddEntryPt emEnv (typB, mdef.Name) + else + emEnv + match mdef.Body.Contents with #if !FX_RESHAPED_REFEMIT | MethodBody.PInvoke p -> let argtys = convTypesToArray cenv emEnv mdef.ParameterTypes @@ -1508,17 +1503,7 @@ let rec buildMethodPass2 cenv tref (typB:TypeBuilder) emEnv (mdef : ILMethodDef) (* p.CharBestFit *) (* p.NoMangle *) - let methB = typB.DefinePInvokeMethod(mdef.Name, - p.Where.Name, - p.Name, - attrs, - cconv, - rty, - null, null, - argtys, - null, null, - pcc, - pcs) + let methB = typB.DefinePInvokeMethod(mdef.Name, p.Where.Name, p.Name, attrs, cconv, rty, null, null, argtys, null, null, pcc, pcs) methB.SetImplementationFlagsAndLog(implflags); envBindMethodRef emEnv mref methB #endif @@ -1554,7 +1539,7 @@ let rec buildMethodPass2 cenv tref (typB:TypeBuilder) emEnv (mdef : ILMethodDef) let rec buildMethodPass3 cenv tref modB (typB:TypeBuilder) emEnv (mdef : ILMethodDef) = let mref = mkRefToILMethod (tref, mdef) let isPInvoke = - match mdef.mdBody.Contents with + match mdef.Body.Contents with | MethodBody.PInvoke _p -> true | _ -> false match mdef.Name with @@ -1566,7 +1551,7 @@ let rec buildMethodPass3 cenv tref modB (typB:TypeBuilder) emEnv (mdef : ILMetho let defineParameter (i, attr, name) = consB.DefineParameterAndLog(i+1, attr, name) mdef.Parameters |> List.iteri (emitParameter cenv emEnv defineParameter); // Body - emitMethodBody cenv modB emEnv consB.GetILGenerator mdef.Name mdef.mdBody; + emitMethodBody cenv modB emEnv consB.GetILGenerator mdef.Name mdef.Body; emitCustomAttrs cenv emEnv (wrapCustomAttr consB.SetCustomAttribute) mdef.CustomAttrs; () | _name -> @@ -1587,7 +1572,7 @@ let rec buildMethodPass3 cenv tref modB (typB:TypeBuilder) emEnv (mdef : ILMetho mdef.Parameters |> List.iteri (fun a b -> emitParameter cenv emEnv defineParameter a b); // Body if not isPInvoke then - emitMethodBody cenv modB emEnv methB.GetILGeneratorAndLog mdef.Name mdef.mdBody; + emitMethodBody cenv modB emEnv methB.GetILGeneratorAndLog mdef.Name mdef.Body; let emEnv = envPopTyvars emEnv // case fold later... emitCustomAttrs cenv emEnv methB.SetCustomAttributeAndLog mdef.CustomAttrs @@ -1597,11 +1582,8 @@ let rec buildMethodPass3 cenv tref modB (typB:TypeBuilder) emEnv (mdef : ILMetho let buildFieldPass2 cenv tref (typB:TypeBuilder) emEnv (fdef : ILFieldDef) = - (*{ -Data: bytes option; - -Marshal: NativeType option; *) - let attrs = fdef.Attributes - let fieldT = convType cenv emEnv fdef.Type + let fieldT = convType cenv emEnv fdef.FieldType let fieldB = match fdef.Data with | Some d -> typB.DefineInitializedData(fdef.Name, d, attrs) @@ -1628,11 +1610,11 @@ let buildFieldPass2 cenv tref (typB:TypeBuilder) emEnv (fdef : ILFieldDef) = fdef.Offset |> Option.iter (fun offset -> fieldB.SetOffset(offset)); // custom attributes: done on pass 3 as they may reference attribute constructors generated on // pass 2. - let fref = mkILFieldRef (tref, fdef.Name, fdef.Type) + let fref = mkILFieldRef (tref, fdef.Name, fdef.FieldType) envBindFieldRef emEnv fref fieldB let buildFieldPass3 cenv tref (_typB:TypeBuilder) emEnv (fdef : ILFieldDef) = - let fref = mkILFieldRef (tref, fdef.Name, fdef.Type) + let fref = mkILFieldRef (tref, fdef.Name, fdef.FieldType) let fieldB = envGetFieldB emEnv fref emitCustomAttrs cenv emEnv (wrapCustomAttr fieldB.SetCustomAttribute) fdef.CustomAttrs @@ -1644,7 +1626,7 @@ let buildPropertyPass2 cenv tref (typB:TypeBuilder) emEnv (prop : ILPropertyDef) let attrs = flagsIf prop.IsRTSpecialName PropertyAttributes.RTSpecialName ||| flagsIf prop.IsSpecialName PropertyAttributes.SpecialName - let propB = typB.DefinePropertyAndLog(prop.Name, attrs, convType cenv emEnv prop.Type, convTypesToArray cenv emEnv prop.Args) + let propB = typB.DefinePropertyAndLog(prop.Name, attrs, convType cenv emEnv prop.PropertyType, convTypesToArray cenv emEnv prop.Args) prop.SetMethod |> Option.iter (fun mref -> propB.SetSetMethod(envGetMethB emEnv mref)); prop.GetMethod |> Option.iter (fun mref -> propB.SetGetMethod(envGetMethB emEnv mref)); @@ -1667,8 +1649,8 @@ let buildPropertyPass3 cenv tref (_typB:TypeBuilder) emEnv (prop : ILPropertyDef let buildEventPass3 cenv (typB:TypeBuilder) emEnv (eventDef : ILEventDef) = let attrs = flagsIf eventDef.IsSpecialName EventAttributes.SpecialName ||| flagsIf eventDef.IsRTSpecialName EventAttributes.RTSpecialName - assert eventDef.Type.IsSome - let eventB = typB.DefineEventAndLog(eventDef.Name, attrs, convType cenv emEnv eventDef.Type.Value) + assert eventDef.EventType.IsSome + let eventB = typB.DefineEventAndLog(eventDef.Name, attrs, convType cenv emEnv eventDef.EventType.Value) eventDef.AddMethod |> (fun mref -> eventB.SetAddOnMethod(envGetMethB emEnv mref)); eventDef.RemoveMethod |> (fun mref -> eventB.SetRemoveOnMethod(envGetMethB emEnv mref)); @@ -1911,33 +1893,33 @@ let verbose2 = false let createTypeRef (visited : Dictionary<_, _>, created : Dictionary<_, _>) emEnv tref = let rec traverseTypeDef (tref:ILTypeRef) (tdef:ILTypeDef) = - if verbose2 then dprintf "buildTypeDefPass4: Creating Enclosing Types of %s\n" tdef.Name; + if verbose2 then dprintf "buildTypeDefPass4: Creating Enclosing Types of %s\n" tdef.Name for enc in getEnclosingTypeRefs tref do traverseTypeRef enc // WORKAROUND (ProductStudio FSharp 1.0 bug 615): the constraints on generic method parameters // are resolved overly eagerly by reflection emit's CreateType. - if verbose2 then dprintf "buildTypeDefPass4: Doing type typar constraints of %s\n" tdef.Name; + if verbose2 then dprintf "buildTypeDefPass4: Doing type typar constraints of %s\n" tdef.Name for gp in tdef.GenericParams do for cx in gp.Constraints do traverseType CollectTypes.All cx - if verbose2 then dprintf "buildTypeDefPass4: Doing method constraints of %s\n" tdef.Name; + if verbose2 then dprintf "buildTypeDefPass4: Doing method constraints of %s\n" tdef.Name for md in tdef.Methods.AsList do for gp in md.GenericParams do for cx in gp.Constraints do traverseType CollectTypes.All cx // We absolutely need the exact parent type... - if verbose2 then dprintf "buildTypeDefPass4: Creating Super Class Chain of %s\n" tdef.Name; + if verbose2 then dprintf "buildTypeDefPass4: Creating Super Class Chain of %s\n" tdef.Name tdef.Extends |> Option.iter (traverseType CollectTypes.All) // We absolutely need the exact interface types... - if verbose2 then dprintf "buildTypeDefPass4: Creating Interface Chain of %s\n" tdef.Name; + if verbose2 then dprintf "buildTypeDefPass4: Creating Interface Chain of %s\n" tdef.Name tdef.Implements |> List.iter (traverseType CollectTypes.All) - if verbose2 then dprintf "buildTypeDefPass4: Do value types in fields of %s\n" tdef.Name; - tdef.Fields.AsList |> List.iter (fun fd -> traverseType CollectTypes.ValueTypesOnly fd.Type) + if verbose2 then dprintf "buildTypeDefPass4: Do value types in fields of %s\n" tdef.Name + tdef.Fields.AsList |> List.iter (fun fd -> traverseType CollectTypes.ValueTypesOnly fd.FieldType) if verbose2 then dprintf "buildTypeDefPass4: Done with dependencies of %s\n" tdef.Name diff --git a/src/absil/ilwrite.fs b/src/absil/ilwrite.fs index e1af01dd56..3b307720a3 100644 --- a/src/absil/ilwrite.fs +++ b/src/absil/ilwrite.fs @@ -1120,7 +1120,7 @@ and GetTypeDefAsEventMapRow cenv tidx = SimpleIndex (TableNames.Event, cenv.eventDefs.Count + 1) |] and GetKeyForFieldDef tidx (fd: ILFieldDef) = - FieldDefKey (tidx, fd.Name, fd.Type) + FieldDefKey (tidx, fd.Name, fd.FieldType) and GenFieldDefPass2 cenv tidx fd = ignore (cenv.fieldDefs.AddUniqueEntry "field" (fun (fdkey:FieldDefKey) -> fdkey.Name) (GetKeyForFieldDef tidx fd)) @@ -1144,7 +1144,7 @@ and GenMethodDefPass2 cenv tidx md = cenv.methodDefIdxs.[md] <- idx and GetKeyForPropertyDef tidx (x: ILPropertyDef) = - PropKey (tidx, x.Name, x.Type, x.Args) + PropKey (tidx, x.Name, x.PropertyType, x.Args) and GenPropertyDefPass2 cenv tidx x = ignore (cenv.propertyDefs.AddUniqueEntry "property" (fun (PropKey (_, n, _, _)) -> n) (GetKeyForPropertyDef tidx x)) @@ -1400,10 +1400,10 @@ and GenCustomAttrsPass3Or4 cenv hca (attrs: ILAttributes) = attrs.AsList |> List.iter (GenCustomAttrPass3Or4 cenv hca) // -------------------------------------------------------------------- -// ILPermissionSet --> DeclSecurity rows +// ILSecurityDecl --> DeclSecurity rows // -------------------------------------------------------------------- *) -let rec GetSecurityDeclRow cenv hds (PermissionSet (action, s)) = +let rec GetSecurityDeclRow cenv hds (ILSecurityDecl (action, s)) = UnsharedRow [| UShort (uint16 (List.assoc action (Lazy.force ILSecurityActionMap))) HasDeclSecurity (fst hds, snd hds) @@ -2323,7 +2323,7 @@ let rec GetFieldDefAsFieldDefRow cenv env (fd: ILFieldDef) = StringE (GetStringHeapIdx cenv fd.Name) Blob (GetFieldDefSigAsBlobIdx cenv env fd ) |] -and GetFieldDefSigAsBlobIdx cenv env fd = GetFieldDefTypeAsBlobIdx cenv env fd.Type +and GetFieldDefSigAsBlobIdx cenv env fd = GetFieldDefTypeAsBlobIdx cenv env fd.FieldType and GenFieldDefPass3 cenv env fd = let fidx = AddUnsharedRow cenv TableNames.Field (GetFieldDefAsFieldDefRow cenv env fd) @@ -2492,7 +2492,7 @@ let GenMethodDefAsRow cenv env midx (md: ILMethodDef) = if cenv.entrypoint <> None then failwith "duplicate entrypoint" else cenv.entrypoint <- Some (true, midx) let codeAddr = - (match md.mdBody.Contents with + (match md.Body.Contents with | MethodBody.IL ilmbody -> let addr = cenv.nextCodeAddr let (localToken, code, seqpoints, rootScope) = GenILMethodBody md.Name cenv env ilmbody @@ -2563,7 +2563,7 @@ let GenMethodDefPass3 cenv env (md:ILMethodDef) = md.CustomAttrs |> GenCustomAttrsPass3Or4 cenv (hca_MethodDef, midx) md.SecurityDecls.AsList |> GenSecurityDeclsPass3 cenv (hds_MethodDef, midx) md.GenericParams |> List.iteri (fun n gp -> GenGenericParamPass3 cenv env n (tomd_MethodDef, midx) gp) - match md.mdBody.Contents with + match md.Body.Contents with | MethodBody.PInvoke attr -> let flags = begin match attr.CallingConv with @@ -2616,12 +2616,12 @@ let GenPropertyMethodSemanticsPass3 cenv pidx kind mref = let rec GetPropertySigAsBlobIdx cenv env prop = GetBytesAsBlobIdx cenv (GetPropertySigAsBytes cenv env prop) -and GetPropertySigAsBytes cenv env prop = +and GetPropertySigAsBytes cenv env (prop: ILPropertyDef) = emitBytesViaBuffer (fun bb -> let b = ((hasthisToByte prop.CallingConv) ||| e_IMAGE_CEE_CS_CALLCONV_PROPERTY) bb.EmitByte b bb.EmitZ32 prop.Args.Length - EmitType cenv env bb prop.Type + EmitType cenv env bb prop.PropertyType prop.Args |> List.iter (EmitType cenv env bb)) and GetPropertyAsPropertyRow cenv env (prop:ILPropertyDef) = @@ -2658,7 +2658,7 @@ let rec GenEventMethodSemanticsPass3 cenv eidx kind mref = /// ILEventDef --> Event Row + MethodSemantics entries and GenEventAsEventRow cenv env (md: ILEventDef) = let flags = md.Attributes - let tdorTag, tdorRow = GetTypeOptionAsTypeDefOrRef cenv env md.Type + let tdorTag, tdorRow = GetTypeOptionAsTypeDefOrRef cenv env md.EventType UnsharedRow [| UShort (uint16 flags) StringE (GetStringHeapIdx cenv md.Name) diff --git a/src/absil/ilx.fs b/src/absil/ilx.fs index d28ff3d2f4..1914ace9b0 100644 --- a/src/absil/ilx.fs +++ b/src/absil/ilx.fs @@ -22,7 +22,7 @@ let mkLowerName (nm: string) = type IlxUnionField(fd: ILFieldDef) = let lowerName = mkLowerName fd.Name member x.ILField = fd - member x.Type = x.ILField.Type + member x.Type = x.ILField.FieldType member x.Name = x.ILField.Name member x.LowerName = lowerName diff --git a/src/fsharp/IlxGen.fs b/src/fsharp/IlxGen.fs index ed07bc51d7..90385b2c2e 100644 --- a/src/fsharp/IlxGen.fs +++ b/src/fsharp/IlxGen.fs @@ -434,14 +434,13 @@ and GenTypeAux amap m (tyenv: TypeReprEnv) voidOK ptrsOK ty = // Generate ILX references to closures, classunions etc. given a tyenv //-------------------------------------------------------------------------- -and GenUnionCaseRef (amap: ImportMap) m tyenv i (fspecs:RecdField array) = +and GenUnionCaseRef (amap: ImportMap) m tyenv i (fspecs:RecdField[]) = let g = amap.g fspecs |> Array.mapi (fun j fspec -> let ilFieldDef = IL.mkILInstanceField(fspec.Name,GenType amap m tyenv fspec.FormalType, None, ILMemberAccess.Public) + // These properties on the "field" of an alternative end up going on a property generated by cu_erase.fs IlxUnionField - { ilFieldDef with - // These properties on the "field" of an alternative end up going on a property generated by cu_erase.fs - CustomAttrs = mkILCustomAttrs [(mkCompilationMappingAttrWithVariantNumAndSeqNum g (int SourceConstructFlags.Field) i j )] } ) + (ilFieldDef.With(customAttrs = mkILCustomAttrs [(mkCompilationMappingAttrWithVariantNumAndSeqNum g (int SourceConstructFlags.Field) i j )]))) and GenUnionRef (amap: ImportMap) m (tcref: TyconRef) = @@ -1047,9 +1046,9 @@ let MergeOptions m o1 o2 = #endif Some x -let MergePropertyPair m (pd: ILPropertyDef) pdef = - {pd with GetMethod=MergeOptions m pd.GetMethod pdef.GetMethod - SetMethod=MergeOptions m pd.SetMethod pdef.SetMethod} +let MergePropertyPair m (pd: ILPropertyDef) (pdef: ILPropertyDef) = + pd.With(getMethod=MergeOptions m pd.GetMethod pdef.GetMethod, + setMethod=MergeOptions m pd.SetMethod pdef.SetMethod) type PropKey = PropKey of string * ILTypes * ILThisConvention @@ -1073,7 +1072,7 @@ let MergePropertyDefs m ilPropertyDefs = //-------------------------------------------------------------------------- /// Information collected imperatively for each type definition -type TypeDefBuilder(tdef, tdefDiscards) = +type TypeDefBuilder(tdef: ILTypeDef, tdefDiscards) = let gmethods = new ResizeArray(0) let gfields = new ResizeArray(0) let gproperties : Dictionary = new Dictionary<_,_>(3,HashIdentity.Structural) @@ -1081,16 +1080,16 @@ type TypeDefBuilder(tdef, tdefDiscards) = let gnested = new TypeDefsBuilder() member b.Close() = - { tdef with - Methods = mkILMethods (tdef.Methods.AsList @ ResizeArray.toList gmethods) - Fields = mkILFields (tdef.Fields.AsList @ ResizeArray.toList gfields) - Properties = mkILProperties (tdef.Properties.AsList @ HashRangeSorted gproperties ) - Events = mkILEvents (tdef.Events.AsList @ ResizeArray.toList gevents) - NestedTypes = mkILTypeDefs (tdef.NestedTypes.AsList @ gnested.Close()) } - + tdef.With(methods = mkILMethods (tdef.Methods.AsList @ ResizeArray.toList gmethods), + fields = mkILFields (tdef.Fields.AsList @ ResizeArray.toList gfields), + properties = mkILProperties (tdef.Properties.AsList @ HashRangeSorted gproperties ), + events = mkILEvents (tdef.Events.AsList @ ResizeArray.toList gevents), + nestedTypes = mkILTypeDefs (tdef.NestedTypes.AsList @ gnested.Close())) member b.AddEventDef(edef) = gevents.Add edef + member b.AddFieldDef(ilFieldDef) = gfields.Add ilFieldDef + member b.AddMethodDef(ilMethodDef) = let discard = match tdefDiscards with @@ -1098,7 +1097,9 @@ type TypeDefBuilder(tdef, tdefDiscards) = | None -> false if not discard then gmethods.Add ilMethodDef + member b.NestedTypeDefs = gnested + member b.GetCurrentFields() = gfields |> Seq.readonly /// Merge Get and Set property nodes, which we generate independently for F# code @@ -1185,7 +1186,7 @@ type AssemblyBuilder(cenv:cenv) as mgbuf = match explicitEntryPointInfo with | Some tref -> let IntializeCompiledScript(fspec,m) = - mgbuf.AddExplicitInitToSpecificMethodDef((fun md -> md.IsEntryPoint), tref, fspec, GenPossibleILSourceMarker cenv m, [], []) + mgbuf.AddExplicitInitToSpecificMethodDef((fun (md:ILMethodDef) -> md.IsEntryPoint), tref, fspec, GenPossibleILSourceMarker cenv m, [], []) scriptInitFspecs |> List.iter IntializeCompiledScript | None -> () @@ -1500,7 +1501,7 @@ let GenConstArray cenv (cgbuf:CodeGenBuffer) eenv ilElementType (data:'a[]) (wri let ilFieldName = CompilerGeneratedName ("field" + string(newUnique())) let fty = ILType.Value vtspec let ilFieldDef = mkILStaticField (ilFieldName,fty, None, Some bytes, ILMemberAccess.Assembly) - let ilFieldDef = { ilFieldDef with CustomAttrs = mkILCustomAttrs [ cenv.g.DebuggerBrowsableNeverAttribute ] } + let ilFieldDef = ilFieldDef.With(customAttrs = mkILCustomAttrs [ cenv.g.DebuggerBrowsableNeverAttribute ]) let fspec = mkILFieldSpecInTy (mkILTyForCompLoc eenv.cloc,ilFieldName, fty) CountStaticFieldDef() cgbuf.mgbuf.AddFieldDef(fspec.DeclaringTypeRef,ilFieldDef) @@ -3524,7 +3525,7 @@ and fixupVirtualSlotFlags (mdef:ILMethodDef) = mdef.WithHideBySig() and renameMethodDef nameOfOverridingMethod (mdef : ILMethodDef) = - {mdef with Name=nameOfOverridingMethod } + mdef.With(name=nameOfOverridingMethod) and fixupMethodImplFlags (mdef:ILMethodDef) = mdef.WithAccess(ILMemberAccess.Private).WithHideBySig().WithFinal(true).WithNewSlot @@ -3560,7 +3561,7 @@ and GenObjectMethod cenv eenvinner (cgbuf:CodeGenBuffer) useMethodImpl tmethod = // fixup attributes to generate a method impl let mdef = if useMethodImpl then fixupMethodImplFlags mdef else mdef let mdef = fixupVirtualSlotFlags mdef - let mdef = { mdef with CustomAttrs = mkILCustomAttrs ilAttribs } + let mdef = mdef.With(customAttrs = mkILCustomAttrs ilAttribs) [(useMethodImpl,methodImplGenerator,methTyparsOfOverridingMethod),mdef] and GenObjectExpr cenv cgbuf eenvouter expr (baseType,baseValOpt,basecall,overrides,interfaceImpls,m) sequel = @@ -3713,24 +3714,30 @@ and GenClosureTypeDefs cenv (tref:ILTypeRef, ilGenParams, attrs, ilCloFreeVars, cloStructure=ilCloLambdas cloCode=notlazy ilCtorBody } - let td = - { Name = tref.Name - Layout = ILTypeDefLayout.Auto - Attributes = enum 0 - GenericParams = ilGenParams - CustomAttrs = mkILCustomAttrs(attrs @ [mkCompilationMappingAttr cenv.g (int SourceConstructFlags.Closure) ]) - Fields = emptyILFields - Events= emptyILEvents - Properties = emptyILProperties - Methods= mkILMethods mdefs - MethodImpls= mkILMethodImpls mimpls - NestedTypes=emptyILTypeDefs - Implements = ilIntfTys - Extends= Some ext - SecurityDecls= emptyILSecurityDecls } - let td = td.WithSealed(true).WithSerializable(true).WithSpecialName(true).WithAccess(ComputeTypeAccess tref true).WithLayout(ILTypeDefLayout.Auto).WithEncoding(ILDefaultPInvokeEncoding.Auto).WithInitSemantics(ILTypeInit.BeforeField) - - let tdefs = EraseClosures.convIlxClosureDef cenv.g.ilxPubCloEnv tref.Enclosing td cloInfo + let tdef = + ILTypeDef(name = tref.Name, + layout = ILTypeDefLayout.Auto, + attributes = enum 0, + genericParams = ilGenParams, + customAttrs = mkILCustomAttrs(attrs @ [mkCompilationMappingAttr cenv.g (int SourceConstructFlags.Closure) ]), + fields = emptyILFields, + events= emptyILEvents, + properties = emptyILProperties, + methods= mkILMethods mdefs, + methodImpls= mkILMethodImpls mimpls, + nestedTypes=emptyILTypeDefs, + implements = ilIntfTys, + extends= Some ext, + securityDecls= emptyILSecurityDecls) + .WithSealed(true) + .WithSerializable(true) + .WithSpecialName(true) + .WithAccess(ComputeTypeAccess tref true) + .WithLayout(ILTypeDefLayout.Auto) + .WithEncoding(ILDefaultPInvokeEncoding.Auto) + .WithInitSemantics(ILTypeInit.BeforeField) + + let tdefs = EraseClosures.convIlxClosureDef cenv.g.ilxPubCloEnv tref.Enclosing tdef cloInfo tdefs and GenGenericParams cenv eenv tps = tps |> DropErasedTypars |> List.map (GenGenericParam cenv eenv) @@ -3761,20 +3768,20 @@ and GenLambdaClosure cenv (cgbuf:CodeGenBuffer) eenv isLocalTypeFunc selfv expr let ilContractMeths = [ilContractCtor; mkILGenericVirtualMethod("DirectInvoke",ILMemberAccess.Assembly,ilContractMethTyargs,[],mkILReturn ilContractFormalRetTy, MethodBody.Abstract) ] let ilContractTypeDef = - { Name = ilContractTypeRef.Name - Layout = ILTypeDefLayout.Auto - Attributes = enum 0 - GenericParams = ilContractGenericParams - CustomAttrs = mkILCustomAttrs [mkCompilationMappingAttr cenv.g (int SourceConstructFlags.Closure) ] - Fields = emptyILFields - Events= emptyILEvents - Properties = emptyILProperties - Methods= mkILMethods ilContractMeths - MethodImpls= emptyILMethodImpls - NestedTypes=emptyILTypeDefs - Implements = [] - Extends= Some cenv.g.ilg.typ_Object - SecurityDecls= emptyILSecurityDecls } + ILTypeDef(name = ilContractTypeRef.Name, + layout = ILTypeDefLayout.Auto, + attributes = enum 0, + genericParams = ilContractGenericParams, + customAttrs = mkILCustomAttrs [mkCompilationMappingAttr cenv.g (int SourceConstructFlags.Closure) ], + fields = emptyILFields, + events= emptyILEvents, + properties = emptyILProperties, + methods= mkILMethods ilContractMeths, + methodImpls= emptyILMethodImpls, + nestedTypes=emptyILTypeDefs, + implements = [], + extends= Some cenv.g.ilg.typ_Object, + securityDecls= emptyILSecurityDecls) let ilContractTypeDef = ilContractTypeDef.WithAbstract(true).WithAccess(ComputeTypeAccess ilContractTypeRef true).WithSerializable(true).WithSpecialName(true).WithLayout(ILTypeDefLayout.Auto).WithInitSemantics(ILTypeInit.BeforeField).WithEncoding(ILDefaultPInvokeEncoding.Auto) // the contract type is an abstract type and not sealed cgbuf.mgbuf.AddTypeDef(ilContractTypeRef, ilContractTypeDef, false, false, None) @@ -4700,15 +4707,15 @@ and GenBindingAfterSequencePoint cenv cgbuf eenv sp (TBind(vspec,rhsExpr,_)) sta let ilAttribs = GenAttrs cenv eenv vspec.Attribs let ilTy = ilGetterMethSpec.FormalReturnType let ilPropDef = - { Name = PrettyNaming.ChopPropertyName ilGetterMethSpec.Name - Attributes = PropertyAttributes.None - SetMethod = None - GetMethod = Some ilGetterMethSpec.MethodRef - CallingConv = ILThisConvention.Static - Type = ilTy - Init = None - Args = [] - CustomAttrs = mkILCustomAttrs ilAttribs } + ILPropertyDef(name = PrettyNaming.ChopPropertyName ilGetterMethSpec.Name, + attributes = PropertyAttributes.None, + setMethod = None, + getMethod = Some ilGetterMethSpec.MethodRef, + callingConv = ILThisConvention.Static, + propertyType = ilTy, + init = None, + args = [], + customAttrs = mkILCustomAttrs ilAttribs) cgbuf.mgbuf.AddOrMergePropertyDef(ilGetterMethSpec.MethodRef.DeclaringTypeRef, ilPropDef,m) let ilMethodDef = @@ -4755,9 +4762,7 @@ and GenBindingAfterSequencePoint cenv cgbuf eenv sp (TBind(vspec,rhsExpr,_)) sta else GenAttrs cenv eenv vspec.Attribs // literals have no property, so preserve all the attributes on the field itself - let ilFieldDef = - { ilFieldDef with - CustomAttrs = mkILCustomAttrs (ilAttribs @ [ cenv.g.DebuggerBrowsableNeverAttribute ]) } + let ilFieldDef = ilFieldDef.With(customAttrs = mkILCustomAttrs (ilAttribs @ [ cenv.g.DebuggerBrowsableNeverAttribute ])) [ (fspec.DeclaringTypeRef, ilFieldDef) ] @@ -4774,15 +4779,15 @@ and GenBindingAfterSequencePoint cenv cgbuf eenv sp (TBind(vspec,rhsExpr,_)) sta |> List.filter (fun (Attrib(_,_,_,_,_,targets,_)) -> canTarget(targets, System.AttributeTargets.Property)) |> GenAttrs cenv eenv // property only gets attributes that target properties let ilPropDef = - { Name=ilPropName - Attributes = PropertyAttributes.None - SetMethod=if mut || cenv.opts.isInteractiveItExpr then Some ilSetterMethRef else None - GetMethod=Some ilGetterMethRef - CallingConv=ILThisConvention.Static - Type=fty - Init=None - Args = [] - CustomAttrs=mkILCustomAttrs (ilAttribs @ [mkCompilationMappingAttr cenv.g (int SourceConstructFlags.Value)]) } + ILPropertyDef(name=ilPropName, + attributes = PropertyAttributes.None, + setMethod=(if mut || cenv.opts.isInteractiveItExpr then Some ilSetterMethRef else None), + getMethod=Some ilGetterMethRef, + callingConv=ILThisConvention.Static, + propertyType=fty, + init=None, + args = [], + customAttrs=mkILCustomAttrs (ilAttribs @ [mkCompilationMappingAttr cenv.g (int SourceConstructFlags.Value)])) cgbuf.mgbuf.AddOrMergePropertyDef(ilTypeRefForProperty,ilPropDef,m) let getterMethod = @@ -5014,15 +5019,15 @@ and GenReturnInfo cenv eenv ilRetTy (retInfo : ArgReprInfo) : ILReturn = and GenPropertyForMethodDef compileAsInstance tref mdef (v:Val) (memberInfo:ValMemberInfo) ilArgTys ilPropTy ilAttrs compiledName = let name = match compiledName with | Some n -> n | _ -> v.PropertyName in (* chop "get_" *) - { Name = name - Attributes = PropertyAttributes.None - SetMethod = (if memberInfo.MemberFlags.MemberKind= MemberKind.PropertySet then Some(mkRefToILMethod(tref,mdef)) else None) - GetMethod = (if memberInfo.MemberFlags.MemberKind= MemberKind.PropertyGet then Some(mkRefToILMethod(tref,mdef)) else None) - CallingConv = (if compileAsInstance then ILThisConvention.Instance else ILThisConvention.Static) - Type = ilPropTy - Init = None - Args = ilArgTys - CustomAttrs = ilAttrs } + ILPropertyDef(name = name, + attributes = PropertyAttributes.None, + setMethod = (if memberInfo.MemberFlags.MemberKind= MemberKind.PropertySet then Some(mkRefToILMethod(tref,mdef)) else None), + getMethod = (if memberInfo.MemberFlags.MemberKind= MemberKind.PropertyGet then Some(mkRefToILMethod(tref,mdef)) else None), + callingConv = (if compileAsInstance then ILThisConvention.Instance else ILThisConvention.Static), + propertyType = ilPropTy, + init = None, + args = ilArgTys, + customAttrs = ilAttrs) and GenEventForProperty cenv eenvForMeth (mspec:ILMethodSpec) (v:Val) ilAttrsThatGoOnPrimaryItem m returnTy = let evname = v.PropertyName @@ -5031,14 +5036,14 @@ and GenEventForProperty cenv eenvForMeth (mspec:ILMethodSpec) (v:Val) ilAttrsTha let ilThisTy = mspec.DeclaringType let addMethRef = mkILMethRef (ilThisTy.TypeRef,mspec.CallingConv,"add_" + evname,0,[ilDelegateTy],ILType.Void) let removeMethRef = mkILMethRef (ilThisTy.TypeRef,mspec.CallingConv,"remove_" + evname,0,[ilDelegateTy],ILType.Void) - { Type = Some(ilDelegateTy) - Name= evname - Attributes = EventAttributes.None - AddMethod = addMethRef - RemoveMethod = removeMethRef - FireMethod= None - OtherMethods= [] - CustomAttrs = mkILCustomAttrs ilAttrsThatGoOnPrimaryItem } + ILEventDef(eventType = Some ilDelegateTy, + name= evname, + attributes = EventAttributes.None, + addMethod = addMethRef, + removeMethod = removeMethRef, + fireMethod= None, + otherMethods= [], + customAttrs = mkILCustomAttrs ilAttrsThatGoOnPrimaryItem) and ComputeFlagFixupsForMemberBinding cenv (v:Val,memberInfo:ValMemberInfo) = @@ -5205,12 +5210,15 @@ and GenMethodForBinding // Does the function have an explicit [] attribute? let isExplicitEntryPoint = HasFSharpAttribute cenv.g cenv.g.attrib_EntryPointAttribute attrs - let mdef = mdef.WithSecurity(not (List.isEmpty securityAttributes)).WithPInvoke(hasDllImport) - let mdef = mdef.WithPreserveSig(hasPreserveSigImplFlag || hasPreserveSigNamedArg).WithSynchronized(hasSynchronizedImplFlag).WithNoInlining(hasNoInliningFlag).WithAggressiveInlining(hasAggressiveInliningImplFlag) - let mdef = - { mdef with - IsEntryPoint = isExplicitEntryPoint - SecurityDecls = secDecls } + let mdef = + mdef + .WithSecurity(not (List.isEmpty securityAttributes)) + .WithPInvoke(hasDllImport) + .WithPreserveSig(hasPreserveSigImplFlag || hasPreserveSigNamedArg) + .WithSynchronized(hasSynchronizedImplFlag) + .WithNoInlining(hasNoInliningFlag) + .WithAggressiveInlining(hasAggressiveInliningImplFlag) + .With(isEntryPoint=isExplicitEntryPoint, securityDecls=secDecls) let mdef = if // operator names @@ -5237,13 +5245,13 @@ and GenMethodForBinding if memberInfo.MemberFlags.MemberKind = MemberKind.Constructor then assert (isNil ilMethTypars) let mdef = mkILCtor (access,ilParams,ilMethodBody) - let mdef = { mdef with CustomAttrs= mkILCustomAttrs (ilAttrsThatGoOnPrimaryItem @ sourceNameAttribs @ ilAttrsCompilerGenerated) } + let mdef = mdef.With(customAttrs= mkILCustomAttrs (ilAttrsThatGoOnPrimaryItem @ sourceNameAttribs @ ilAttrsCompilerGenerated)) EmitTheMethodDef mdef elif memberInfo.MemberFlags.MemberKind = MemberKind.ClassConstructor then assert (isNil ilMethTypars) let mdef = mkILClassCtor ilMethodBody - let mdef = { mdef with CustomAttrs= mkILCustomAttrs (ilAttrsThatGoOnPrimaryItem @ sourceNameAttribs @ ilAttrsCompilerGenerated) } + let mdef = mdef.With(customAttrs= mkILCustomAttrs (ilAttrsThatGoOnPrimaryItem @ sourceNameAttribs @ ilAttrsCompilerGenerated)) EmitTheMethodDef mdef // Generate virtual/override methods + method-impl information if needed @@ -5300,10 +5308,10 @@ and GenMethodForBinding cgbuf.mgbuf.AddOrMergePropertyDef(tref,ilPropDef,m) // Add the special name flag for all properties - let mdef = { mdef.WithSpecialName with CustomAttrs= mkILCustomAttrs ((GenAttrs cenv eenv attrsAppliedToGetterOrSetter) @ sourceNameAttribs @ ilAttrsCompilerGenerated) } + let mdef = mdef.WithSpecialName.With(customAttrs= mkILCustomAttrs ((GenAttrs cenv eenv attrsAppliedToGetterOrSetter) @ sourceNameAttribs @ ilAttrsCompilerGenerated)) EmitTheMethodDef mdef | _ -> - let mdef = { mdef with CustomAttrs= mkILCustomAttrs (ilAttrsThatGoOnPrimaryItem @ sourceNameAttribs @ ilAttrsCompilerGenerated) } + let mdef = mdef.With(customAttrs= mkILCustomAttrs (ilAttrsThatGoOnPrimaryItem @ sourceNameAttribs @ ilAttrsCompilerGenerated)) EmitTheMethodDef mdef | _ -> @@ -5319,7 +5327,7 @@ and GenMethodForBinding | _ -> ilAttrsThatGoOnPrimaryItem let ilCustomAttrs = mkILCustomAttrs (ilAttrs @ sourceNameAttribs @ ilAttrsCompilerGenerated) - let mdef = { mdef with CustomAttrs= ilCustomAttrs } + let mdef = mdef.With(customAttrs= ilCustomAttrs) EmitTheMethodDef mdef @@ -5952,7 +5960,7 @@ and GenTopImpl cenv mgbuf mainInfoOpt eenv (TImplFile(qname, _, mexpr, hasExplic // generate main@ let ilMainMethodDef = let mdef = mkILNonGenericStaticMethod(mainMethName,ILMemberAccess.Public,[],mkILReturn ILType.Void, MethodBody.IL topCode) - {mdef with IsEntryPoint= true; CustomAttrs = ilAttrs } + mdef.With(isEntryPoint= true, customAttrs = ilAttrs) mgbuf.AddMethodDef(initClassTy.TypeRef,ilMainMethodDef) @@ -6062,7 +6070,7 @@ and GenAbstractBinding cenv eenv tref (vref:ValRef) = | MemberKind.ClassConstructor | MemberKind.Constructor | MemberKind.Member -> - let mdef = {mdef with CustomAttrs= mkILCustomAttrs ilAttrs } + let mdef = mdef.With(customAttrs= mkILCustomAttrs ilAttrs) [mdef], [], [] | MemberKind.PropertyGetSet -> error(Error(FSComp.SR.ilUnexpectedGetSetAnnotation(),m)) | MemberKind.PropertySet | MemberKind.PropertyGet -> @@ -6104,22 +6112,23 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = let sprintfMethSpec = mkILMethSpec(sprintfMethSpec.MethodRef,AsObject,[],[funcTy]) // Here's the body of the method. Call printf, then invoke the function it returns let callInstrs = EraseClosures.mkCallFunc cenv.g.ilxPubCloEnv (fun _ -> 0us) eenv.tyenv.Count Normalcall (Apps_app(ilThisTy, Apps_done cenv.g.ilg.typ_String)) - let ilMethodDef = mkILNonGenericVirtualMethod ("ToString",ILMemberAccess.Public,[], - mkILReturn cenv.g.ilg.typ_String, - mkMethodBody (true,[],2,nonBranchingInstrsToCode - ([ // load the hardwired format string - yield I_ldstr "%+A" - // make the printf format object - yield mkNormalNewobj newFormatMethSpec - // call sprintf - yield mkNormalCall sprintfMethSpec - // call the function returned by sprintf - yield mkLdarg0 - if ilThisTy.Boxity = ILBoxity.AsValue then - yield mkNormalLdobj ilThisTy ] @ - callInstrs), - None)) - let mdef = { ilMethodDef with CustomAttrs = mkILCustomAttrs [ cenv.g.CompilerGeneratedAttribute ] } + let mdef = + mkILNonGenericVirtualMethod ("ToString",ILMemberAccess.Public,[], + mkILReturn cenv.g.ilg.typ_String, + mkMethodBody (true,[],2,nonBranchingInstrsToCode + ([ // load the hardwired format string + yield I_ldstr "%+A" + // make the printf format object + yield mkNormalNewobj newFormatMethSpec + // call sprintf + yield mkNormalCall sprintfMethSpec + // call the function returned by sprintf + yield mkLdarg0 + if ilThisTy.Boxity = ILBoxity.AsValue then + yield mkNormalLdobj ilThisTy ] @ + callInstrs), + None)) + let mdef = mdef.With(customAttrs = mkILCustomAttrs [ cenv.g.CompilerGeneratedAttribute ]) yield mdef | None,_ -> () | _,None -> () @@ -6342,16 +6351,15 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = let literalValue = Option.map (GenFieldInit m) fspec.LiteralValue let fdef = - { Name = ilFieldName - Type = ilPropType - Attributes = enum 0 - Data = None - LiteralValue = None - Offset = ilFieldOffset - Marshal = None - CustomAttrs = mkILCustomAttrs (GenAttrs cenv eenv fattribs @ extraAttribs) } - let fdef = - fdef.WithAccess(access) + ILFieldDef(name = ilFieldName, + fieldType = ilPropType, + attributes = enum 0, + data = None, + literalValue = None, + offset = ilFieldOffset, + marshal = None, + customAttrs = mkILCustomAttrs (GenAttrs cenv eenv fattribs @ extraAttribs)) + .WithAccess(access) .WithStatic(isStatic) .WithSpecialName(ilFieldName="value__" && tycon.IsEnumTycon) .WithNotSerialized(ilNotSerialized) @@ -6371,15 +6379,15 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = let ilHasSetter = isCLIMutable || isFSharpMutable let ilFieldAttrs = GenAttrs cenv eenv propAttribs @ [mkCompilationMappingAttrWithSeqNum cenv.g (int SourceConstructFlags.Field) i] yield - { Name = ilPropName - Attributes = PropertyAttributes.None - SetMethod = (if ilHasSetter then Some(mkILMethRef(tref,ilCallingConv,"set_" + ilPropName,0,[ilPropType],ILType.Void)) else None) - GetMethod = Some(mkILMethRef(tref,ilCallingConv,"get_" + ilPropName,0,[],ilPropType)) - CallingConv = ilCallingConv.ThisConv - Type = ilPropType - Init = None - Args = [] - CustomAttrs = mkILCustomAttrs ilFieldAttrs } ] + ILPropertyDef(name= ilPropName, + attributes= PropertyAttributes.None, + setMethod= (if ilHasSetter then Some(mkILMethRef(tref,ilCallingConv,"set_" + ilPropName,0,[ilPropType],ILType.Void)) else None), + getMethod= Some(mkILMethRef(tref,ilCallingConv,"get_" + ilPropName,0,[],ilPropType)), + callingConv= ilCallingConv.ThisConv, + propertyType= ilPropType, + init= None, + args= [], + customAttrs = mkILCustomAttrs ilFieldAttrs) ] let methodDefs = [ // Generate property getter methods for those fields that have properties @@ -6520,9 +6528,9 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = match tycon.TypeReprInfo with | TILObjectRepr _ -> - let td = tycon.ILTyconRawMetadata.WithAccess(access) - {td with CustomAttrs = mkILCustomAttrs ilCustomAttrs - GenericParams = ilGenParams }, None + let tdef = tycon.ILTyconRawMetadata.WithAccess(access) + let tdef = tdef.With(customAttrs = mkILCustomAttrs ilCustomAttrs, genericParams = ilGenParams) + tdef, None | TRecdRepr _ | TFSharpObjectRepr _ as tyconRepr -> let super = superOfTycon cenv.g tycon @@ -6563,7 +6571,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = let isTheSealedAttribute = tyconRefEq cenv.g tcref cenv.g.attrib_SealedAttribute.TyconRef let tdef = tdef.WithSealed(isSealedTy cenv.g thisTy || isTheSealedAttribute).WithSerializable(isSerializable).WithAbstract(isAbstract).WithImport(isComInteropTy cenv.g thisTy) - let tdef = { tdef with MethodImpls=mkILMethodImpls methodImpls } + let tdef = tdef.With(methodImpls=mkILMethodImpls methodImpls) let tdLayout,tdEncoding = match TryFindFSharpAttribute cenv.g cenv.g.attrib_StructLayoutAttribute tycon.Attribs with @@ -6609,14 +6617,14 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = ILTypeDefLayout.Auto, ILDefaultPInvokeEncoding.Ansi // if the type's layout is Explicit, ensure that each field has a valid offset - let validateExplicit fdef = + let validateExplicit (fdef: ILFieldDef) = match fdef.Offset with // Remove field suffix "@" for pretty printing | None -> errorR(Error(FSComp.SR.ilFieldDoesNotHaveValidOffsetForStructureLayout(tdef.Name, fdef.Name.Replace("@","")), (trimRangeToLine m))) | _ -> () // if the type's layout is Sequential, no offsets should be applied - let validateSequential fdef = + let validateSequential (fdef: ILFieldDef) = match fdef.Offset with | Some _ -> errorR(Error(FSComp.SR.ilFieldHasOffsetForSequentialLayout(), (trimRangeToLine m))) | _ -> () @@ -6655,26 +6663,33 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = else ILTypeDefLayout.Auto + let cattrs = + mkILCustomAttrs (ilCustomAttrs @ + [mkCompilationMappingAttr cenv.g + (int (if hiddenRepr + then SourceConstructFlags.SumType ||| SourceConstructFlags.NonPublicRepresentation + else SourceConstructFlags.SumType)) ]) let tdef = - { Name = ilTypeName - Layout = layout - Attributes = enum 0 - GenericParams = ilGenParams - CustomAttrs = - mkILCustomAttrs (ilCustomAttrs @ - [mkCompilationMappingAttr cenv.g - (int (if hiddenRepr - then SourceConstructFlags.SumType ||| SourceConstructFlags.NonPublicRepresentation - else SourceConstructFlags.SumType)) ]) - Fields = ilFields - Events= ilEvents - Properties = ilProperties - Methods= mkILMethods ilMethods - MethodImpls= mkILMethodImpls methodImpls - NestedTypes=emptyILTypeDefs - Implements = ilIntfTys - Extends= Some (if tycon.IsStructOrEnumTycon then cenv.g.iltyp_ValueType else cenv.g.ilg.typ_Object) - SecurityDecls= emptyILSecurityDecls }.WithLayout(layout).WithSerializable(isSerializable).WithSealed(true).WithEncoding(ILDefaultPInvokeEncoding.Auto).WithAccess(access).WithInitSemantics(ILTypeInit.BeforeField) + ILTypeDef(name = ilTypeName, + layout = layout, + attributes = enum 0, + genericParams = ilGenParams, + customAttrs = cattrs, + fields = ilFields, + events= ilEvents, + properties = ilProperties, + methods= mkILMethods ilMethods, + methodImpls= mkILMethodImpls methodImpls, + nestedTypes=emptyILTypeDefs, + implements = ilIntfTys, + extends= Some (if tycon.IsStructOrEnumTycon then cenv.g.iltyp_ValueType else cenv.g.ilg.typ_Object), + securityDecls= emptyILSecurityDecls) + .WithLayout(layout) + .WithSerializable(isSerializable) + .WithSealed(true) + .WithEncoding(ILDefaultPInvokeEncoding.Auto) + .WithAccess(access) + .WithInitSemantics(ILTypeInit.BeforeField) let tdef2 = cenv.g.eraseClassUnionDef tref tdef cuinfo @@ -6697,9 +6712,7 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon:Tycon) = | _ -> failwith "??" let tdef = tdef.WithHasSecurity(not (List.isEmpty securityAttrs)) - let tdef = - { tdef with - SecurityDecls = secDecls } + let tdef = tdef.With(securityDecls = secDecls) mgbuf.AddTypeDef(tref, tdef, false, false, tdefDiscards) // If a non-generic type is written with "static let" and "static do" (i.e. it has a ".cctor") @@ -6735,15 +6748,15 @@ and GenExnDef cenv mgbuf eenv m (exnc:Tycon) = let ilMethodDef = mkLdfldMethodDef (ilMethName,reprAccess,false,ilThisTy,ilFieldName,ilPropType) let ilFieldDef = IL.mkILInstanceField(ilFieldName,ilPropType, None, ILMemberAccess.Assembly) let ilPropDef = - { Name = ilPropName - Attributes = PropertyAttributes.None - SetMethod = None - GetMethod = Some(mkILMethRef(tref,ILCallingConv.Instance,ilMethName,0,[],ilPropType)) - CallingConv = ILThisConvention.Instance - Type = ilPropType - Init = None - Args = [] - CustomAttrs=mkILCustomAttrs (GenAttrs cenv eenv fld.PropertyAttribs @ [mkCompilationMappingAttrWithSeqNum cenv.g (int SourceConstructFlags.Field) i]) } + ILPropertyDef(name = ilPropName, + attributes = PropertyAttributes.None, + setMethod = None, + getMethod = Some(mkILMethRef(tref,ILCallingConv.Instance,ilMethName,0,[],ilPropType)), + callingConv = ILThisConvention.Instance, + propertyType = ilPropType, + init = None, + args = [], + customAttrs=mkILCustomAttrs (GenAttrs cenv eenv fld.PropertyAttribs @ [mkCompilationMappingAttrWithSeqNum cenv.g (int SourceConstructFlags.Field) i])) yield (ilMethodDef,ilFieldDef,ilPropDef,(ilPropName,ilFieldName,ilPropType)) ] |> List.unzip4 diff --git a/src/fsharp/IlxGen.fsi b/src/fsharp/IlxGen.fsi index f7a5071d14..25c727eca8 100644 --- a/src/fsharp/IlxGen.fsi +++ b/src/fsharp/IlxGen.fsi @@ -89,7 +89,7 @@ type public IlxAssemblyGenerator = member GenerateCode : IlxGenOptions * TypedAssemblyAfterOptimization * Attribs * Attribs -> IlxGenResults /// Create the CAS permission sets for an assembly fragment - member CreatePermissionSets : Attrib list -> ILPermission list + member CreatePermissionSets : Attrib list -> ILSecurityDecl list /// Invert the compilation of the given value and clear the storage of the value member ClearGeneratedValue : ExecutionContext * Val -> unit diff --git a/src/fsharp/NicePrint.fs b/src/fsharp/NicePrint.fs index d311665060..e3ad74ad0d 100755 --- a/src/fsharp/NicePrint.fs +++ b/src/fsharp/NicePrint.fs @@ -260,7 +260,7 @@ module private PrintIL = let staticL = if f.IsStatic then WordL.keywordStatic else emptyL let name = adjustILName f.Name let nameL = wordL (tagField name) - let typL = layoutILType denv ilTyparSubst f.Type + let typL = layoutILType denv ilTyparSubst f.FieldType staticL ^^ WordL.keywordVal ^^ nameL ^^ WordL.colon ^^ typL let private layoutILEventDef denv ilTyparSubst (e: ILEventDef) = @@ -268,7 +268,7 @@ module private PrintIL = let name = adjustILName e.Name let nameL = wordL (tagEvent name) let typL = - match e.Type with + match e.EventType with | Some t -> layoutILType denv ilTyparSubst t | _ -> emptyL staticL ^^ WordL.keywordEvent ^^ nameL ^^ WordL.colon ^^ typL @@ -295,16 +295,16 @@ module private PrintIL = let typL = match p.GetMethod, p.SetMethod with - | None, None -> layoutILType denv ilTyparSubst p.Type // shouldn't happen - | Some getterRef, _ -> layoutGetterType getterRef - | None, Some setterRef -> layoutSetterType setterRef + | None, None -> layoutILType denv ilTyparSubst p.PropertyType // shouldn't happen + | Some getterRef, _ -> layoutGetterType getterRef + | None, Some setterRef -> layoutSetterType setterRef let specGetSetL = match p.GetMethod, p.SetMethod with - | None,None - | Some _, None -> emptyL - | None, Some _ -> WordL.keywordWith ^^ WordL.keywordSet - | Some _, Some _ -> WordL.keywordWith ^^ WordL.keywordGet ^^ RightL.comma ^^ WordL.keywordSet + | None,None + | Some _, None -> emptyL + | None, Some _ -> WordL.keywordWith ^^ WordL.keywordSet + | Some _, Some _ -> WordL.keywordWith ^^ WordL.keywordGet ^^ RightL.comma ^^ WordL.keywordSet staticL ^^ WordL.keywordMember ^^ nameL ^^ WordL.colon ^^ typL ^^ specGetSetL let layoutILFieldInit x = diff --git a/src/fsharp/TcGlobals.fs b/src/fsharp/TcGlobals.fs index 72c8fbb0a7..64ea4e96d6 100755 --- a/src/fsharp/TcGlobals.fs +++ b/src/fsharp/TcGlobals.fs @@ -719,9 +719,9 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d | res -> res mkILCustomAttrs (attrs.AsList @ attribs) - let addMethodGeneratedAttrs (mdef:ILMethodDef) = {mdef with CustomAttrs = addGeneratedAttrs mdef.CustomAttrs} - let addPropertyGeneratedAttrs (pdef:ILPropertyDef) = {pdef with CustomAttrs = addGeneratedAttrs pdef.CustomAttrs} - let addFieldGeneratedAttrs (fdef:ILFieldDef) = {fdef with CustomAttrs = addGeneratedAttrs fdef.CustomAttrs} + let addMethodGeneratedAttrs (mdef:ILMethodDef) = mdef.With(customAttrs = addGeneratedAttrs mdef.CustomAttrs) + let addPropertyGeneratedAttrs (pdef:ILPropertyDef) = pdef.With(customAttrs = addGeneratedAttrs pdef.CustomAttrs) + let addFieldGeneratedAttrs (fdef:ILFieldDef) = fdef.With(customAttrs = addGeneratedAttrs fdef.CustomAttrs) let tref_DebuggerBrowsableAttribute n = let typ_DebuggerBrowsableState = @@ -738,8 +738,8 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d | Some res -> res let addNeverAttrs (attrs: ILAttributes) = mkILCustomAttrs (attrs.AsList @ [mkDebuggerBrowsableNeverAttribute()]) - let addPropertyNeverAttrs (pdef:ILPropertyDef) = {pdef with CustomAttrs = addNeverAttrs pdef.CustomAttrs} - let addFieldNeverAttrs (fdef:ILFieldDef) = {fdef with CustomAttrs = addNeverAttrs fdef.CustomAttrs} + let addPropertyNeverAttrs (pdef:ILPropertyDef) = pdef.With(customAttrs = addNeverAttrs pdef.CustomAttrs) + let addFieldNeverAttrs (fdef:ILFieldDef) = fdef.With(customAttrs = addNeverAttrs fdef.CustomAttrs) let mkDebuggerTypeProxyAttribute (ty : ILType) = mkILCustomAttribute ilg (findSysILTypeRef tname_DebuggerTypeProxyAttribute, [ilg.typ_Type], [ILAttribElem.TypeRef (Some ty.TypeRef)], []) let betterTyconEntries = diff --git a/src/fsharp/fsc.fs b/src/fsharp/fsc.fs index 699b6c52ec..f0aa3d96a2 100644 --- a/src/fsharp/fsc.fs +++ b/src/fsharp/fsc.fs @@ -1188,14 +1188,14 @@ module StaticLinker = TypeDefs = mkILTypeDefs ([ for td in fakeModule.TypeDefs do - yield {td with - Methods = - td.Methods.AsList - |> List.map (fun md -> - {md with CustomAttrs = - mkILCustomAttrs (td.CustomAttrs.AsList |> List.filter (fun ilattr -> - ilattr.Method.DeclaringType.TypeRef.FullName <> "System.Runtime.TargetedPatchingOptOutAttribute") )}) - |> mkILMethods } ])} + let meths = td.Methods.AsList + |> List.map (fun md -> + md.With(customAttrs = + mkILCustomAttrs (td.CustomAttrs.AsList |> List.filter (fun ilattr -> + ilattr.Method.DeclaringType.TypeRef.FullName <> "System.Runtime.TargetedPatchingOptOutAttribute")))) + |> mkILMethods + let td = td.With(methods=meths) + yield td.With(methods=meths) ])} //ILAsciiWriter.output_module stdout fakeModule fakeModule.TypeDefs.AsList @@ -1416,9 +1416,8 @@ module StaticLinker = | ILTypeDefAccess.Private -> ILTypeDefAccess.Nested ILMemberAccess.Private | _ -> ilOrigTypeDef.Access) else ilOrigTypeDef - { ilOrigTypeDef with - Name = ilTgtTyRef.Name - NestedTypes = mkILTypeDefs (List.map buildRelocatedGeneratedType ch) } + ilOrigTypeDef.With(name = ilTgtTyRef.Name, + nestedTypes = mkILTypeDefs (List.map buildRelocatedGeneratedType ch)) else // If there is no matching IL type definition, then make a simple container class if debugStaticLinking then printfn "Generating simple class '%s' because we didn't find an original type '%s' in a provider generated assembly" ilTgtTyRef.QualifiedName ilOrigTyRef.QualifiedName @@ -1452,7 +1451,7 @@ module StaticLinker = (ltdefs, fresh, rtdefs) | (ltdefs, Some htd, rtdefs) -> (ltdefs, htd, rtdefs) - let htd = { htd with NestedTypes = implantTypeDef true htd.NestedTypes t td } + let htd = htd.With(nestedTypes = implantTypeDef true htd.NestedTypes t td) mkILTypeDefs (ltdefs @ [htd] @ rtdefs) let newTypeDefs = @@ -1471,7 +1470,7 @@ module StaticLinker = let ilOrigTyRef = mkILNestedTyRef (ilOrigScopeRef, enc, tdef.Name) if not (ilOrigTyRefsForProviderGeneratedTypesToRelocate.ContainsKey ilOrigTyRef) then if debugStaticLinking then printfn "Keep provided type %s in place because it wasn't relocated" ilOrigTyRef.QualifiedName - yield { tdef with NestedTypes = rw (enc@[tdef.Name]) tdef.NestedTypes } ] + yield tdef.With(nestedTypes = rw (enc@[tdef.Name]) tdef.NestedTypes) ] rw [] ilModule.TypeDefs (ccu, { ilModule with TypeDefs = ilTypeDefsAfterRemovingRelocatedTypes })) diff --git a/src/fsharp/infos.fs b/src/fsharp/infos.fs index ca5cb77813..f6fb690c62 100755 --- a/src/fsharp/infos.fs +++ b/src/fsharp/infos.fs @@ -1676,7 +1676,7 @@ type ILFieldInfo = /// Get the type of the field as an IL type member x.ILFieldType = match x with - | ILFieldInfo (_,fdef) -> fdef.Type + | ILFieldInfo (_,fdef) -> fdef.FieldType #if !NO_EXTENSIONTYPING | ProvidedField(amap,fi,m) -> Import.ImportProvidedTypeAsILType amap m (fi.PApply((fun fi -> fi.FieldType),m)) #endif @@ -1684,7 +1684,7 @@ type ILFieldInfo = /// Get the type of the field as an F# type member x.FieldType(amap,m) = match x with - | ILFieldInfo (tinfo,fdef) -> ImportILTypeFromMetadata amap m tinfo.ILScopeRef tinfo.TypeInstOfRawMetadata [] fdef.Type + | ILFieldInfo (tinfo,fdef) -> ImportILTypeFromMetadata amap m tinfo.ILScopeRef tinfo.TypeInstOfRawMetadata [] fdef.FieldType #if !NO_EXTENSIONTYPING | ProvidedField(amap,fi,m) -> Import.ImportProvidedType amap m (fi.PApply((fun fi -> fi.FieldType),m)) #endif @@ -1848,7 +1848,7 @@ type ILPropInfo = /// Any type parameters of the enclosing type are instantiated in the type returned. member x.GetPropertyType (amap,m) = let (ILPropInfo (tinfo,pdef)) = x - ImportILTypeFromMetadata amap m tinfo.ILScopeRef tinfo.TypeInstOfRawMetadata [] pdef.Type + ImportILTypeFromMetadata amap m tinfo.ILScopeRef tinfo.TypeInstOfRawMetadata [] pdef.PropertyType override x.ToString() = x.ILTypeInfo.ToString() + "::" + x.PropertyName @@ -2405,8 +2405,8 @@ type EventInfo = | ILEvent(ILEventInfo(tinfo,edef)) -> // Get the delegate type associated with an IL event, taking into account the instantiation of the // declaring type. - if Option.isNone edef.Type then error (nonStandardEventError x.EventName m) - ImportILTypeFromMetadata amap m tinfo.ILScopeRef tinfo.TypeInstOfRawMetadata [] edef.Type.Value + if Option.isNone edef.EventType then error (nonStandardEventError x.EventName m) + ImportILTypeFromMetadata amap m tinfo.ILScopeRef tinfo.TypeInstOfRawMetadata [] edef.EventType.Value | FSEvent(g,p,_,_) -> FindDelegateTypeOfPropertyEvent g amap x.EventName m (p.GetPropertyType(amap,m)) diff --git a/src/ilx/EraseClosures.fs b/src/ilx/EraseClosures.fs index c8adbfff69..92476961fe 100644 --- a/src/ilx/EraseClosures.fs +++ b/src/ilx/EraseClosures.fs @@ -123,8 +123,8 @@ type cenv = addFieldNeverAttrs: ILFieldDef -> ILFieldDef addMethodGeneratedAttrs: ILMethodDef -> ILMethodDef } -let addMethodGeneratedAttrsToTypeDef cenv tdef = - { tdef with Methods = tdef.Methods.AsList |> List.map (fun md -> md |> cenv.addMethodGeneratedAttrs) |> mkILMethods } +let addMethodGeneratedAttrsToTypeDef cenv (tdef: ILTypeDef) = + tdef.With(methods = (tdef.Methods.AsList |> List.map (fun md -> md |> cenv.addMethodGeneratedAttrs) |> mkILMethods)) let newIlxPubCloEnv(ilg, addMethodGeneratedAttrs, addFieldGeneratedAttrs, addFieldNeverAttrs) = { ilg = ilg @@ -314,8 +314,8 @@ let convMethodBody thisClo = function | x -> x let convMethodDef thisClo (md: ILMethodDef) = - let b' = convMethodBody thisClo (md.mdBody.Contents) - {md with mdBody=mkMethBodyAux b'} + let b' = convMethodBody thisClo (md.Body.Contents) + md.With(body=mkMethBodyAux b') // -------------------------------------------------------------------- // Make fields for free variables of a type abstraction. @@ -428,8 +428,7 @@ let rec convIlxClosureDef cenv encl (td: ILTypeDef) clo = let laterCode = rewriteCodeToAccessArgsFromEnv laterCloSpec [(0, selfFreeVar)] let laterTypeDefs = convIlxClosureDef cenv encl - {td with GenericParams=laterGenericParams - Name=laterTypeName} + (td.With(genericParams=laterGenericParams, name=laterTypeName)) {clo with cloStructure=laterStruct cloFreeVars=laterFields cloCode=notlazy laterCode} @@ -479,20 +478,27 @@ let rec convIlxClosureDef cenv encl (td: ILTypeDef) clo = |> cenv.addMethodGeneratedAttrs let cloTypeDef = - { Name = td.Name - GenericParams= td.GenericParams - Attributes = td.Attributes - Implements = List.empty - NestedTypes = emptyILTypeDefs - Layout=ILTypeDefLayout.Auto - Extends= Some cenv.mkILTyFuncTy - Methods= mkILMethods ([ctorMethodDef] @ [nowApplyMethDef]) - Fields= mkILFields (mkILCloFldDefs cenv nowFields) - CustomAttrs=emptyILCustomAttrs - MethodImpls=emptyILMethodImpls - Properties=emptyILProperties - Events=emptyILEvents - SecurityDecls=emptyILSecurityDecls }.WithSpecialName(false).WithImport(false).WithHasSecurity(false).WithAbstract(false).WithSealed(true).WithInitSemantics(ILTypeInit.BeforeField).WithEncoding(ILDefaultPInvokeEncoding.Ansi) + ILTypeDef(name = td.Name, + genericParams= td.GenericParams, + attributes = td.Attributes, + implements = [], + nestedTypes = emptyILTypeDefs, + layout=ILTypeDefLayout.Auto, + extends= Some cenv.mkILTyFuncTy, + methods= mkILMethods ([ctorMethodDef] @ [nowApplyMethDef]) , + fields= mkILFields (mkILCloFldDefs cenv nowFields), + customAttrs=emptyILCustomAttrs, + methodImpls=emptyILMethodImpls, + properties=emptyILProperties, + events=emptyILEvents, + securityDecls=emptyILSecurityDecls) + .WithSpecialName(false) + .WithImport(false) + .WithHasSecurity(false) + .WithAbstract(false) + .WithSealed(true) + .WithInitSemantics(ILTypeInit.BeforeField) + .WithEncoding(ILDefaultPInvokeEncoding.Ansi) [ cloTypeDef] // CASE 2 - Term Application @@ -536,8 +542,7 @@ let rec convIlxClosureDef cenv encl (td: ILTypeDef) clo = let laterTypeDefs = convIlxClosureDef cenv encl - {td with GenericParams=laterGenericParams - Name=laterTypeName} + (td.With(genericParams=laterGenericParams, name=laterTypeName)) {clo with cloStructure=laterStruct cloFreeVars=laterFields cloCode=notlazy laterCode} @@ -570,20 +575,27 @@ let rec convIlxClosureDef cenv encl (td: ILTypeDef) clo = ILMemberAccess.Assembly) |> cenv.addMethodGeneratedAttrs - { Name = td.Name - GenericParams= td.GenericParams - Attributes = td.Attributes - Implements = [] - Layout=ILTypeDefLayout.Auto - NestedTypes = emptyILTypeDefs - Extends= Some nowEnvParentClass - Methods= mkILMethods ([ctorMethodDef] @ [nowApplyMethDef]) - Fields= mkILFields (mkILCloFldDefs cenv nowFields) - CustomAttrs=emptyILCustomAttrs - MethodImpls=emptyILMethodImpls - Properties=emptyILProperties - Events=emptyILEvents - SecurityDecls=emptyILSecurityDecls }.WithHasSecurity(false).WithSpecialName(false).WithAbstract(false).WithImport(false).WithEncoding(ILDefaultPInvokeEncoding.Ansi).WithSealed(true).WithInitSemantics(ILTypeInit.BeforeField) + ILTypeDef(name = td.Name, + genericParams= td.GenericParams, + attributes = td.Attributes, + implements = [], + layout=ILTypeDefLayout.Auto, + nestedTypes = emptyILTypeDefs, + extends= Some nowEnvParentClass, + methods= mkILMethods ([ctorMethodDef] @ [nowApplyMethDef]), + fields= mkILFields (mkILCloFldDefs cenv nowFields), + customAttrs=emptyILCustomAttrs, + methodImpls=emptyILMethodImpls, + properties=emptyILProperties, + events=emptyILEvents, + securityDecls=emptyILSecurityDecls) + .WithHasSecurity(false) + .WithSpecialName(false) + .WithAbstract(false) + .WithImport(false) + .WithEncoding(ILDefaultPInvokeEncoding.Ansi) + .WithSealed(true) + .WithInitSemantics(ILTypeInit.BeforeField) [cloTypeDef] @@ -613,13 +625,12 @@ let rec convIlxClosureDef cenv encl (td: ILTypeDef) clo = None)) let cloTypeDef = - { td with - Implements= td.Implements - Extends= (match td.Extends with None -> Some cenv.ilg.typ_Object | Some x -> Some(x)) - Name = td.Name - GenericParams= td.GenericParams - Methods= mkILMethods (ctorMethodDef :: List.map (convMethodDef (Some nowCloSpec)) td.Methods.AsList) - Fields= mkILFields (mkILCloFldDefs cenv nowFields @ td.Fields.AsList) } + td.With(implements= td.Implements, + extends= (match td.Extends with None -> Some cenv.ilg.typ_Object | Some x -> Some(x)), + name = td.Name, + genericParams= td.GenericParams, + methods= mkILMethods (ctorMethodDef :: List.map (convMethodDef (Some nowCloSpec)) td.Methods.AsList), + fields= mkILFields (mkILCloFldDefs cenv nowFields @ td.Fields.AsList)) [cloTypeDef] diff --git a/src/ilx/EraseUnions.fs b/src/ilx/EraseUnions.fs index 6eece54f24..51ae9a26e9 100644 --- a/src/ilx/EraseUnions.fs +++ b/src/ilx/EraseUnions.fs @@ -614,15 +614,15 @@ let mkMethodsAndPropertiesForFields (addMethodGeneratedAttrs, addPropertyGenerat let basicProps = fields |> Array.map (fun field -> - { Name = adjustFieldName hasHelpers field.Name - Attributes = PropertyAttributes.None - SetMethod = None - GetMethod = Some (mkILMethRef (typ.TypeRef, ILCallingConv.Instance, "get_" + adjustFieldName hasHelpers field.Name, 0, [], field.Type)) - CallingConv = ILThisConvention.Instance - Type = field.Type - Init = None - Args = [] - CustomAttrs = field.ILField.CustomAttrs } + ILPropertyDef(name = adjustFieldName hasHelpers field.Name, + attributes = PropertyAttributes.None, + setMethod = None, + getMethod = Some (mkILMethRef (typ.TypeRef, ILCallingConv.Instance, "get_" + adjustFieldName hasHelpers field.Name, 0, [], field.Type)), + callingConv = ILThisConvention.Instance, + propertyType = field.Type, + init = None, + args = [], + customAttrs = field.ILField.CustomAttrs) |> addPropertyGeneratedAttrs ) |> Array.toList @@ -648,7 +648,7 @@ let convAlternativeDef (addMethodGeneratedAttrs, addPropertyGeneratedAttrs, addP let repr = cudefRepr // Attributes on unions get attached to the construction methods in the helpers - let addAltAttribs (mdef: ILMethodDef) = { mdef with CustomAttrs=alt.altCustomAttrs } + let addAltAttribs (mdef: ILMethodDef) = mdef.With(customAttrs=alt.altCustomAttrs) // The stdata instruction is only ever used for the F# "List" type // @@ -698,15 +698,15 @@ let convAlternativeDef (addMethodGeneratedAttrs, addPropertyGeneratedAttrs, addP mkMethodBody(true,[],2,nonBranchingInstrsToCode ([ mkLdarg0 ] @ mkIsData ilg (true, cuspec, num)), attr)) |> addMethodGeneratedAttrs ], - [ { Name = mkTesterName altName - Attributes = PropertyAttributes.None - SetMethod = None - GetMethod = Some (mkILMethRef (baseTy.TypeRef, ILCallingConv.Instance, "get_" + mkTesterName altName, 0, [], ilg.typ_Bool)) - CallingConv = ILThisConvention.Instance - Type = ilg.typ_Bool - Init = None - Args = [] - CustomAttrs = emptyILCustomAttrs } + [ ILPropertyDef(name = mkTesterName altName, + attributes = PropertyAttributes.None, + setMethod = None, + getMethod = Some (mkILMethRef (baseTy.TypeRef, ILCallingConv.Instance, "get_" + mkTesterName altName, 0, [], ilg.typ_Bool)), + callingConv = ILThisConvention.Instance, + propertyType = ilg.typ_Bool, + init = None, + args = [], + customAttrs = emptyILCustomAttrs) |> addPropertyGeneratedAttrs |> addPropertyNeverAttrs ] @@ -726,15 +726,15 @@ let convAlternativeDef (addMethodGeneratedAttrs, addPropertyGeneratedAttrs, addP let nullaryProp = - { Name = altName - Attributes = PropertyAttributes.None - SetMethod = None - GetMethod = Some (mkILMethRef (baseTy.TypeRef, ILCallingConv.Static, "get_" + altName, 0, [], baseTy)) - CallingConv = ILThisConvention.Static - Type = baseTy - Init = None - Args = [] - CustomAttrs = emptyILCustomAttrs } + ILPropertyDef(name = altName, + attributes = PropertyAttributes.None, + setMethod = None, + getMethod = Some (mkILMethRef (baseTy.TypeRef, ILCallingConv.Static, "get_" + altName, 0, [], baseTy)), + callingConv = ILThisConvention.Static, + propertyType = baseTy, + init = None, + args = [], + customAttrs = emptyILCustomAttrs) |> addPropertyGeneratedAttrs |> addPropertyNeverAttrs @@ -827,15 +827,15 @@ let convAlternativeDef (addMethodGeneratedAttrs, addPropertyGeneratedAttrs, addP let debugProxyGetterProps = fields |> Array.map (fun fdef -> - { Name = fdef.Name - Attributes = PropertyAttributes.None - SetMethod = None - GetMethod = Some(mkILMethRef(debugProxyTy.TypeRef,ILCallingConv.Instance,"get_" + fdef.Name,0,[],fdef.Type)) - CallingConv = ILThisConvention.Instance - Type = fdef.Type - Init = None - Args = [] - CustomAttrs = fdef.ILField.CustomAttrs } + ILPropertyDef(name = fdef.Name, + attributes = PropertyAttributes.None, + setMethod = None, + getMethod = Some(mkILMethRef(debugProxyTy.TypeRef,ILCallingConv.Instance,"get_" + fdef.Name,0,[],fdef.Type)), + callingConv = ILThisConvention.Instance, + propertyType = fdef.Type, + init = None, + args = [], + customAttrs = fdef.ILField.CustomAttrs) |> addPropertyGeneratedAttrs) |> Array.toList @@ -881,7 +881,7 @@ let convAlternativeDef (addMethodGeneratedAttrs, addPropertyGeneratedAttrs, addP | TailOrNull -> failwith "unreachable" ], altTy, - (basicFields |> List.map (fun fdef -> fdef.Name, fdef.Type) ), + (basicFields |> List.map (fun fdef -> fdef.Name, fdef.FieldType) ), (if cuspec.HasHelpers = AllHelpers then ILMemberAccess.Assembly else cud.cudReprAccess)) |> addMethodGeneratedAttrs @@ -1039,15 +1039,15 @@ let mkClassUnionDef (addMethodGeneratedAttrs, addPropertyGeneratedAttrs, addProp [ mkILNonGenericInstanceMethod("get_" + tagPropertyName,cud.cudHelpersAccess,[],mkILReturn tagFieldType,body) |> addMethodGeneratedAttrs ], - [ { Name = tagPropertyName - Attributes = PropertyAttributes.None - SetMethod = None - GetMethod = Some(mkILMethRef(baseTy.TypeRef,ILCallingConv.Instance,"get_" + tagPropertyName,0,[], tagFieldType)) - CallingConv = ILThisConvention.Instance - Type = tagFieldType - Init = None - Args = [] - CustomAttrs = emptyILCustomAttrs } + [ ILPropertyDef(name = tagPropertyName, + attributes = PropertyAttributes.None, + setMethod = None, + getMethod = Some(mkILMethRef(baseTy.TypeRef,ILCallingConv.Instance,"get_" + tagPropertyName,0,[], tagFieldType)), + callingConv = ILThisConvention.Instance, + propertyType = tagFieldType, + init = None, + args = [], + customAttrs = emptyILCustomAttrs) |> addPropertyGeneratedAttrs |> addPropertyNeverAttrs ] @@ -1065,29 +1065,36 @@ let mkClassUnionDef (addMethodGeneratedAttrs, addPropertyGeneratedAttrs, addProp if tagEnumFields.Length <= 1 then None else - Some( - { Name = "Tags" - NestedTypes = emptyILTypeDefs - GenericParams= td.GenericParams - Attributes = enum 0 - Layout=ILTypeDefLayout.Auto - Implements = [] - Extends= Some ilg.typ_Object - Methods= emptyILMethods - SecurityDecls=emptyILSecurityDecls - Fields=mkILFields tagEnumFields - MethodImpls=emptyILMethodImpls - Events=emptyILEvents - Properties=emptyILProperties - CustomAttrs= emptyILCustomAttrs }.WithNestedAccess(cud.cudReprAccess).WithAbstract(true).WithSealed(true).WithImport(false).WithEncoding(ILDefaultPInvokeEncoding.Ansi).WithHasSecurity(false)) + let tdef = + ILTypeDef(name = "Tags", + nestedTypes = emptyILTypeDefs, + genericParams= td.GenericParams, + attributes = enum 0, + layout=ILTypeDefLayout.Auto, + implements = [], + extends= Some ilg.typ_Object, + methods= emptyILMethods, + securityDecls=emptyILSecurityDecls, + fields=mkILFields tagEnumFields, + methodImpls=emptyILMethodImpls, + events=emptyILEvents, + properties=emptyILProperties, + customAttrs= emptyILCustomAttrs) + .WithNestedAccess(cud.cudReprAccess) + .WithAbstract(true) + .WithSealed(true) + .WithImport(false) + .WithEncoding(ILDefaultPInvokeEncoding.Ansi) + .WithHasSecurity(false) + Some tdef let baseTypeDef = - { td.WithInitSemantics(ILTypeInit.BeforeField) with - NestedTypes = mkILTypeDefs (Option.toList enumTypeDef @ altTypeDefs @ altDebugTypeDefs @ td.NestedTypes.AsList) - Extends= (match td.Extends with None -> Some ilg.typ_Object | _ -> td.Extends) - Methods= mkILMethods (ctorMeths @ baseMethsFromAlt @ selfMeths @ tagMeths @ altUniqObjMeths @ existingMeths) - Fields=mkILFields (selfAndTagFields @ List.map (fun (_,_,_,_,fdef,_) -> fdef) altNullaryFields @ td.Fields.AsList) - Properties=mkILProperties (tagProps @ basePropsFromAlt @ selfProps @ existingProps) } + td.WithInitSemantics(ILTypeInit.BeforeField) + .With(nestedTypes = mkILTypeDefs (Option.toList enumTypeDef @ altTypeDefs @ altDebugTypeDefs @ td.NestedTypes.AsList), + extends= (match td.Extends with None -> Some ilg.typ_Object | _ -> td.Extends), + methods= mkILMethods (ctorMeths @ baseMethsFromAlt @ selfMeths @ tagMeths @ altUniqObjMeths @ existingMeths), + fields=mkILFields (selfAndTagFields @ List.map (fun (_,_,_,_,fdef,_) -> fdef) altNullaryFields @ td.Fields.AsList), + properties=mkILProperties (tagProps @ basePropsFromAlt @ selfProps @ existingProps)) // The .cctor goes on the Cases type since that's where the constant fields for nullary constructors live |> addConstFieldInit From b606cb5ca195fcbdb9023a3b592c36e73a2bb5e4 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 21 Mar 2018 23:23:12 +0000 Subject: [PATCH 135/147] hide representations in Abstract IL --- src/absil/il.fsi | 61 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 50 insertions(+), 11 deletions(-) diff --git a/src/absil/il.fsi b/src/absil/il.fsi index a83051ad89..d16c91002d 100644 --- a/src/absil/il.fsi +++ b/src/absil/il.fsi @@ -1000,15 +1000,21 @@ type MethodCodeKind = /// may include the bounds, if any, on the generic parameter. type ILGenericParameterDef = { Name: string - /// At most one is the parent type, the others are interface types. + + /// At most one is the parent type, the others are interface types. Constraints: ILTypes + /// Variance of type parameters, only applicable to generic parameters for generic interfaces and delegates. Variance: ILGenericVariance + /// Indicates the type argument must be a reference type. HasReferenceTypeConstraint: bool + CustomAttrs: ILAttributes + /// Indicates the type argument must be a value type, but not Nullable. HasNotNullableValueTypeConstraint: bool + /// Indicates the type argument must have a public nullary constructor. HasDefaultConstructorConstraint: bool } @@ -1020,13 +1026,14 @@ type ILLazyMethodBody = /// IL Method definitions. /// -/// The object is immutable. We use a class to get control over the representation used, -/// which allows more efficient representation of the information. +/// This type is immutable and record-like. We use a class to get control over the representation +/// used, which allows more efficient representation of the information. [] type ILMethodDef = + + /// Functional creation of a value new: name: string * attributes: MethodAttributes * implAttributes: MethodImplAttributes * callingConv: ILCallingConv * parameters: ILParameters * ret: ILReturn * body: ILLazyMethodBody * securityDecls: ILSecurityDecls * isEntryPoint:bool * genericParams: ILGenericParameterDefs * customAttrs: ILAttributes -> ILMethodDef - member With: ?name: string * ?attributes: MethodAttributes * ?implAttributes: MethodImplAttributes * ?callingConv: ILCallingConv * ?parameters: ILParameters * ?ret: ILReturn * ?body: ILLazyMethodBody * ?securityDecls: ILSecurityDecls * ?isEntryPoint:bool * ?genericParams: ILGenericParameterDefs * ?customAttrs: ILAttributes -> ILMethodDef member Name: string member Attributes: MethodAttributes member ImplAttributes: MethodImplAttributes @@ -1073,6 +1080,7 @@ type ILMethodDef = /// The method is exported to unmanaged code using COM interop. member IsUnmanagedExport: bool member IsReqSecObj: bool + /// Some methods are marked "HasSecurity" even if there are no permissions attached, e.g. if they use SuppressUnmanagedCodeSecurityAttribute member HasSecurity: bool member IsManaged: bool @@ -1086,6 +1094,8 @@ type ILMethodDef = /// SafeHandle finalizer must be run. member IsMustRun: bool + /// Functional update of the value + member With: ?name: string * ?attributes: MethodAttributes * ?implAttributes: MethodImplAttributes * ?callingConv: ILCallingConv * ?parameters: ILParameters * ?ret: ILReturn * ?body: ILLazyMethodBody * ?securityDecls: ILSecurityDecls * ?isEntryPoint:bool * ?genericParams: ILGenericParameterDefs * ?customAttrs: ILAttributes -> ILMethodDef member WithSpecialName: ILMethodDef member WithHideBySig: unit -> ILMethodDef member WithHideBySig: bool -> ILMethodDef @@ -1104,8 +1114,9 @@ type ILMethodDef = /// Tables of methods. Logically equivalent to a list of methods but /// the table is kept in a form optimized for looking up methods by /// name and arity. - -/// abstract type equivalent to [ILMethodDef list] +/// +/// This type is immutable and record-like. We use a class to get control over the representation +/// used, which allows more efficient representation of the information. [] type ILMethodDefs = interface IEnumerable @@ -1114,15 +1125,21 @@ type ILMethodDefs = member FindByName: string -> ILMethodDef list /// Field definitions. +/// +/// This type is immutable and record-like. We use a class to get control over the representation +/// used, which allows more efficient representation of the information. [] type ILFieldDef = + + /// Functional creation of a value new: name: string * fieldType: ILType * attributes: FieldAttributes * data: byte[] option * literalValue: ILFieldInit option * offset: int32 option * marshal: ILNativeType option * customAttrs: ILAttributes -> ILFieldDef - member With: ?name: string * ?fieldType: ILType * ?attributes: FieldAttributes * ?data: byte[] option * ?literalValue: ILFieldInit option * ?offset: int32 option * ?marshal: ILNativeType option * ?customAttrs: ILAttributes -> ILFieldDef + member Name: string member FieldType: ILType member Attributes: FieldAttributes member Data: byte[] option member LiteralValue: ILFieldInit option + /// The explicit offset in bytes when explicit layout is used. member Offset: int32 option member Marshal: ILNativeType option @@ -1133,6 +1150,9 @@ type ILFieldDef = member NotSerialized: bool member IsInitOnly: bool member Access: ILMemberAccess + + /// Functional update of the value + member With: ?name: string * ?fieldType: ILType * ?attributes: FieldAttributes * ?data: byte[] option * ?literalValue: ILFieldInit option * ?offset: int32 option * ?marshal: ILNativeType option * ?customAttrs: ILAttributes -> ILFieldDef member WithAccess: ILMemberAccess -> ILFieldDef member WithInitOnly: bool -> ILFieldDef member WithStatic: bool -> ILFieldDef @@ -1150,10 +1170,15 @@ type ILFieldDefs = member LookupByName: string -> ILFieldDef list /// Event definitions. +/// +/// This type is immutable and record-like. We use a class to get control over the representation +/// used, which allows more efficient representation of the information. [] type ILEventDef = + + /// Functional creation of a value new: eventType: ILType option * name: string * attributes: EventAttributes * addMethod: ILMethodRef * removeMethod: ILMethodRef * fireMethod: ILMethodRef option * otherMethods: ILMethodRef list * customAttrs: ILAttributes -> ILEventDef - member With: ?eventType: ILType option * ?name: string * ?attributes: EventAttributes * ?addMethod: ILMethodRef * ?removeMethod: ILMethodRef * ?fireMethod: ILMethodRef option * ?otherMethods: ILMethodRef list * ?customAttrs: ILAttributes -> ILEventDef + member EventType: ILType option member Name: string member Attributes: EventAttributes @@ -1165,17 +1190,31 @@ type ILEventDef = member IsSpecialName: bool member IsRTSpecialName: bool + /// Functional update of the value + member With: ?eventType: ILType option * ?name: string * ?attributes: EventAttributes * ?addMethod: ILMethodRef * ?removeMethod: ILMethodRef * ?fireMethod: ILMethodRef option * ?otherMethods: ILMethodRef list * ?customAttrs: ILAttributes -> ILEventDef + /// Table of those events in a type definition. +/// +/// This type is immutable and record-like. We use a class to get control over the representation +/// used, which allows more efficient representation of the information. [] type ILEventDefs = member AsList: ILEventDef list member LookupByName: string -> ILEventDef list /// Property definitions +/// +/// This type is immutable and record-like. We use a class to get control over the representation +/// used, which allows more efficient representation of the information. [] type ILPropertyDef = + + /// Functional creation of a value new: name: string * attributes: PropertyAttributes * setMethod: ILMethodRef option * getMethod: ILMethodRef option * callingConv: ILThisConvention * propertyType: ILType * init: ILFieldInit option * args: ILTypes * customAttrs: ILAttributes -> ILPropertyDef + + /// Functional update of the value member With: ?name: string * ?attributes: PropertyAttributes * ?setMethod: ILMethodRef option * ?getMethod: ILMethodRef option * ?callingConv: ILThisConvention * ?propertyType: ILType * ?init: ILFieldInit option * ?args: ILTypes * ?customAttrs: ILAttributes -> ILPropertyDef + member Name: string member Attributes: PropertyAttributes member SetMethod: ILMethodRef option @@ -1267,9 +1306,9 @@ type ILTypeDefs = /// Represents IL Type Definitions. /// -/// The object is immutable. We use a class -/// to get control over the representation used, which allows more efficient representation of the information. -and [] +/// This type is immutable and record-like. We use a class to get control over the representation +/// used, which allows more efficient representation of the information. +and [] ILTypeDef = /// Create the contents From 92e6d6af25886eea254ce4e2058e9bcebbe4a6ab Mon Sep 17 00:00:00 2001 From: Jakub Majocha Date: Thu, 22 Mar 2018 01:07:28 +0100 Subject: [PATCH 136/147] remove FSharp.LanguageService.Base dependency (#4588) * extract PatternMatcher to separate project * add project reference --- VisualFSharp.sln | 11 ++++++++ .../Commands/HelpContextService.fs | 1 - .../Commands/XmlDocCommandService.fs | 1 - .../src/FSharp.Editor/Common/RoslynHelpers.fs | 1 - .../Completion/CompletionProvider.fs | 1 - .../Diagnostics/ProjectDiagnosticAnalyzer.fs | 2 -- .../SimplifyNameDiagnosticAnalyzer.fs | 2 -- .../src/FSharp.Editor/FSharp.Editor.fsproj | 2 +- .../FSharp.Editor/LanguageService/Symbols.fs | 1 - .../LanguageService/Tokenizer.fs | 1 - .../PatternMatcher/ArrayBuilder.Enumerator.cs | 0 .../PatternMatcher/ArrayBuilder.cs | 0 .../PatternMatcher/ArraySlice.cs | 0 .../PatternMatcher/BKTree.Builder.cs | 0 .../PatternMatcher/BKTree.Edge.cs | 0 .../PatternMatcher/BKTree.Node.cs | 0 .../PatternMatcher/BKTree.cs | 0 .../PatternMatcher/CaseSensitiveComparison.cs | 0 .../PatternMatcher/EditDistance.cs | 0 .../PatternMatcher/Hash.cs | 0 .../PatternMatcher/IDictionaryExtensions.cs | 0 .../PatternMatcher/IObjectWritable.cs | 0 .../ImmutableArrayExtensions.cs | 0 .../NormalizedTextSpanCollection.cs | 0 .../PatternMatcher/ObjectPool.cs | 0 .../PatternMatcher/ObjectReader.cs | 0 .../PatternMatcher/ObjectWriter.cs | 0 .../PatternMatcher/PatternMatch.cs | 0 .../PatternMatcher/PatternMatchKind.cs | 0 .../PatternMatcher/PatternMatcher.Segment.cs | 0 .../PatternMatcher.TextChunk.cs | 0 .../PatternMatcher/PatternMatcher.cs | 0 .../src/PatternMatcher/PatternMatcher.csproj | 25 +++++++++++++++++++ .../PatternMatcher/PatternMatches.cs | 0 .../PatternMatcher/PooledHashSet.cs | 0 .../PatternMatcher/PooledStringBuilder.cs | 0 .../PatternMatcher/Properties/AssemblyInfo.cs | 9 +++++++ .../PatternMatcher/SpellChecker.cs | 0 .../PatternMatcher/StringBreaker.cs | 0 .../PatternMatcher/StringSlice.cs | 0 .../PatternMatcher/TextSpan.cs | 0 .../PatternMatcher/VersionStamp.cs | 0 42 files changed, 46 insertions(+), 11 deletions(-) rename vsintegration/src/{FSharp.LanguageService.Base => }/PatternMatcher/ArrayBuilder.Enumerator.cs (100%) rename vsintegration/src/{FSharp.LanguageService.Base => }/PatternMatcher/ArrayBuilder.cs (100%) rename vsintegration/src/{FSharp.LanguageService.Base => }/PatternMatcher/ArraySlice.cs (100%) rename vsintegration/src/{FSharp.LanguageService.Base => }/PatternMatcher/BKTree.Builder.cs (100%) rename vsintegration/src/{FSharp.LanguageService.Base => }/PatternMatcher/BKTree.Edge.cs (100%) rename vsintegration/src/{FSharp.LanguageService.Base => }/PatternMatcher/BKTree.Node.cs (100%) rename vsintegration/src/{FSharp.LanguageService.Base => }/PatternMatcher/BKTree.cs (100%) rename vsintegration/src/{FSharp.LanguageService.Base => }/PatternMatcher/CaseSensitiveComparison.cs (100%) rename vsintegration/src/{FSharp.LanguageService.Base => }/PatternMatcher/EditDistance.cs (100%) rename vsintegration/src/{FSharp.LanguageService.Base => }/PatternMatcher/Hash.cs (100%) rename vsintegration/src/{FSharp.LanguageService.Base => }/PatternMatcher/IDictionaryExtensions.cs (100%) rename vsintegration/src/{FSharp.LanguageService.Base => }/PatternMatcher/IObjectWritable.cs (100%) rename vsintegration/src/{FSharp.LanguageService.Base => }/PatternMatcher/ImmutableArrayExtensions.cs (100%) rename vsintegration/src/{FSharp.LanguageService.Base => }/PatternMatcher/NormalizedTextSpanCollection.cs (100%) rename vsintegration/src/{FSharp.LanguageService.Base => }/PatternMatcher/ObjectPool.cs (100%) rename vsintegration/src/{FSharp.LanguageService.Base => }/PatternMatcher/ObjectReader.cs (100%) rename vsintegration/src/{FSharp.LanguageService.Base => }/PatternMatcher/ObjectWriter.cs (100%) rename vsintegration/src/{FSharp.LanguageService.Base => }/PatternMatcher/PatternMatch.cs (100%) rename vsintegration/src/{FSharp.LanguageService.Base => }/PatternMatcher/PatternMatchKind.cs (100%) rename vsintegration/src/{FSharp.LanguageService.Base => }/PatternMatcher/PatternMatcher.Segment.cs (100%) rename vsintegration/src/{FSharp.LanguageService.Base => }/PatternMatcher/PatternMatcher.TextChunk.cs (100%) rename vsintegration/src/{FSharp.LanguageService.Base => }/PatternMatcher/PatternMatcher.cs (100%) create mode 100644 vsintegration/src/PatternMatcher/PatternMatcher.csproj rename vsintegration/src/{FSharp.LanguageService.Base => }/PatternMatcher/PatternMatches.cs (100%) rename vsintegration/src/{FSharp.LanguageService.Base => }/PatternMatcher/PooledHashSet.cs (100%) rename vsintegration/src/{FSharp.LanguageService.Base => }/PatternMatcher/PooledStringBuilder.cs (100%) create mode 100644 vsintegration/src/PatternMatcher/Properties/AssemblyInfo.cs rename vsintegration/src/{FSharp.LanguageService.Base => }/PatternMatcher/SpellChecker.cs (100%) rename vsintegration/src/{FSharp.LanguageService.Base => }/PatternMatcher/StringBreaker.cs (100%) rename vsintegration/src/{FSharp.LanguageService.Base => }/PatternMatcher/StringSlice.cs (100%) rename vsintegration/src/{FSharp.LanguageService.Base => }/PatternMatcher/TextSpan.cs (100%) rename vsintegration/src/{FSharp.LanguageService.Base => }/PatternMatcher/VersionStamp.cs (100%) diff --git a/VisualFSharp.sln b/VisualFSharp.sln index 3d3a37ecdf..13e160058a 100644 --- a/VisualFSharp.sln +++ b/VisualFSharp.sln @@ -138,6 +138,8 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Build.UnitTests", "t EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PEVerify", "tests\fsharpqa\testenv\src\PEVerify\PEVerify.csproj", "{B0689A4E-07D8-494D-A0C8-791CB1D74E54}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PatternMatcher", "vsintegration\src\PatternMatcher\PatternMatcher.csproj", "{18227628-DF90-4C47-AF3D-CC72D2EDD986}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -554,6 +556,14 @@ Global {B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Release|Any CPU.Build.0 = Release|Any CPU {B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Release|x86.ActiveCfg = Release|Any CPU {B0689A4E-07D8-494D-A0C8-791CB1D74E54}.Release|x86.Build.0 = Release|Any CPU + {18227628-DF90-4C47-AF3D-CC72D2EDD986}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {18227628-DF90-4C47-AF3D-CC72D2EDD986}.Debug|Any CPU.Build.0 = Debug|Any CPU + {18227628-DF90-4C47-AF3D-CC72D2EDD986}.Debug|x86.ActiveCfg = Debug|Any CPU + {18227628-DF90-4C47-AF3D-CC72D2EDD986}.Debug|x86.Build.0 = Debug|Any CPU + {18227628-DF90-4C47-AF3D-CC72D2EDD986}.Release|Any CPU.ActiveCfg = Release|Any CPU + {18227628-DF90-4C47-AF3D-CC72D2EDD986}.Release|Any CPU.Build.0 = Release|Any CPU + {18227628-DF90-4C47-AF3D-CC72D2EDD986}.Release|x86.ActiveCfg = Release|Any CPU + {18227628-DF90-4C47-AF3D-CC72D2EDD986}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -617,6 +627,7 @@ Global {0385564F-07B4-4264-AB8A-17C393E9140C} = {F6DAEE9A-8BE1-4C4A-BC83-09215517C7DA} {400FAB03-786E-40CC-85A8-04B0C2869B14} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} {B0689A4E-07D8-494D-A0C8-791CB1D74E54} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} + {18227628-DF90-4C47-AF3D-CC72D2EDD986} = {4C7B48D7-19AF-4AE7-9D1D-3BB289D5480D} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {48EDBBBE-C8EE-4E3C-8B19-97184A487B37} diff --git a/vsintegration/src/FSharp.Editor/Commands/HelpContextService.fs b/vsintegration/src/FSharp.Editor/Commands/HelpContextService.fs index b8f8ac4c4c..b8c940fa70 100644 --- a/vsintegration/src/FSharp.Editor/Commands/HelpContextService.fs +++ b/vsintegration/src/FSharp.Editor/Commands/HelpContextService.fs @@ -7,7 +7,6 @@ open System.Collections.Generic open System.Composition open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.Classification -open Microsoft.VisualStudio.FSharp.LanguageService open Microsoft.VisualStudio.LanguageServices.Implementation.F1Help open Microsoft.CodeAnalysis.Host.Mef open Microsoft.FSharp.Compiler diff --git a/vsintegration/src/FSharp.Editor/Commands/XmlDocCommandService.fs b/vsintegration/src/FSharp.Editor/Commands/XmlDocCommandService.fs index 9d5c2990ae..db9bf16ae2 100644 --- a/vsintegration/src/FSharp.Editor/Commands/XmlDocCommandService.fs +++ b/vsintegration/src/FSharp.Editor/Commands/XmlDocCommandService.fs @@ -15,7 +15,6 @@ open Microsoft.VisualStudio.TextManager.Interop open Microsoft.VisualStudio.Utilities open Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem open Microsoft.FSharp.Compiler.SourceCodeServices -open Microsoft.VisualStudio.FSharp.LanguageService type internal XmlDocCommandFilter ( diff --git a/vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs b/vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs index feb1e89e57..a1c7b8f573 100644 --- a/vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs +++ b/vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs @@ -14,7 +14,6 @@ open Microsoft.FSharp.Compiler open Microsoft.FSharp.Compiler.Layout open Microsoft.FSharp.Compiler.SourceCodeServices open Microsoft.FSharp.Compiler.Range -open Microsoft.VisualStudio.FSharp.LanguageService [] module internal RoslynHelpers = diff --git a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs index b5da2f6bb2..823b65e7a5 100644 --- a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs +++ b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs @@ -14,7 +14,6 @@ open Microsoft.CodeAnalysis.Completion open Microsoft.CodeAnalysis.Options open Microsoft.CodeAnalysis.Text -open Microsoft.VisualStudio.FSharp.LanguageService open Microsoft.VisualStudio.Shell open Microsoft.VisualStudio.Shell.Interop diff --git a/vsintegration/src/FSharp.Editor/Diagnostics/ProjectDiagnosticAnalyzer.fs b/vsintegration/src/FSharp.Editor/Diagnostics/ProjectDiagnosticAnalyzer.fs index cbf2f34fb8..7861df8e56 100644 --- a/vsintegration/src/FSharp.Editor/Diagnostics/ProjectDiagnosticAnalyzer.fs +++ b/vsintegration/src/FSharp.Editor/Diagnostics/ProjectDiagnosticAnalyzer.fs @@ -19,8 +19,6 @@ open Microsoft.FSharp.Compiler open Microsoft.FSharp.Compiler.SourceCodeServices open Microsoft.FSharp.Compiler.Range -open Microsoft.VisualStudio.FSharp.LanguageService - #if PROJECT_ANALYSIS // Project-wide error analysis. We don't enable this because ParseAndCheckProject checks projects against the versions of the files // saves to the file system. This is different to the versions of the files active in the editor. This results in out-of-sync error diff --git a/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs b/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs index cc7c46debb..ba47e84026 100644 --- a/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs +++ b/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs @@ -15,8 +15,6 @@ open Microsoft.FSharp.Compiler open Microsoft.FSharp.Compiler.Range open Microsoft.FSharp.Compiler.SourceCodeServices -open Microsoft.VisualStudio.FSharp.LanguageService - type private TextVersionHash = int [] diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index a03ba5b93f..fa8177d0a7 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -96,9 +96,9 @@ - + diff --git a/vsintegration/src/FSharp.Editor/LanguageService/Symbols.fs b/vsintegration/src/FSharp.Editor/LanguageService/Symbols.fs index 13de16c081..7ece4c858c 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/Symbols.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/Symbols.fs @@ -11,7 +11,6 @@ open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Classification open Microsoft.CodeAnalysis.Text -open Microsoft.VisualStudio.FSharp.LanguageService open Microsoft.FSharp.Compiler open Microsoft.FSharp.Compiler.Ast open Microsoft.FSharp.Compiler.SourceCodeServices diff --git a/vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs b/vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs index 840138c00b..478243881a 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs @@ -11,7 +11,6 @@ open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Classification open Microsoft.CodeAnalysis.Text -open Microsoft.VisualStudio.FSharp.LanguageService open Microsoft.FSharp.Compiler open Microsoft.FSharp.Compiler.Ast open Microsoft.FSharp.Compiler.SourceCodeServices diff --git a/vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/ArrayBuilder.Enumerator.cs b/vsintegration/src/PatternMatcher/ArrayBuilder.Enumerator.cs similarity index 100% rename from vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/ArrayBuilder.Enumerator.cs rename to vsintegration/src/PatternMatcher/ArrayBuilder.Enumerator.cs diff --git a/vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/ArrayBuilder.cs b/vsintegration/src/PatternMatcher/ArrayBuilder.cs similarity index 100% rename from vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/ArrayBuilder.cs rename to vsintegration/src/PatternMatcher/ArrayBuilder.cs diff --git a/vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/ArraySlice.cs b/vsintegration/src/PatternMatcher/ArraySlice.cs similarity index 100% rename from vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/ArraySlice.cs rename to vsintegration/src/PatternMatcher/ArraySlice.cs diff --git a/vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/BKTree.Builder.cs b/vsintegration/src/PatternMatcher/BKTree.Builder.cs similarity index 100% rename from vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/BKTree.Builder.cs rename to vsintegration/src/PatternMatcher/BKTree.Builder.cs diff --git a/vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/BKTree.Edge.cs b/vsintegration/src/PatternMatcher/BKTree.Edge.cs similarity index 100% rename from vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/BKTree.Edge.cs rename to vsintegration/src/PatternMatcher/BKTree.Edge.cs diff --git a/vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/BKTree.Node.cs b/vsintegration/src/PatternMatcher/BKTree.Node.cs similarity index 100% rename from vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/BKTree.Node.cs rename to vsintegration/src/PatternMatcher/BKTree.Node.cs diff --git a/vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/BKTree.cs b/vsintegration/src/PatternMatcher/BKTree.cs similarity index 100% rename from vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/BKTree.cs rename to vsintegration/src/PatternMatcher/BKTree.cs diff --git a/vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/CaseSensitiveComparison.cs b/vsintegration/src/PatternMatcher/CaseSensitiveComparison.cs similarity index 100% rename from vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/CaseSensitiveComparison.cs rename to vsintegration/src/PatternMatcher/CaseSensitiveComparison.cs diff --git a/vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/EditDistance.cs b/vsintegration/src/PatternMatcher/EditDistance.cs similarity index 100% rename from vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/EditDistance.cs rename to vsintegration/src/PatternMatcher/EditDistance.cs diff --git a/vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/Hash.cs b/vsintegration/src/PatternMatcher/Hash.cs similarity index 100% rename from vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/Hash.cs rename to vsintegration/src/PatternMatcher/Hash.cs diff --git a/vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/IDictionaryExtensions.cs b/vsintegration/src/PatternMatcher/IDictionaryExtensions.cs similarity index 100% rename from vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/IDictionaryExtensions.cs rename to vsintegration/src/PatternMatcher/IDictionaryExtensions.cs diff --git a/vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/IObjectWritable.cs b/vsintegration/src/PatternMatcher/IObjectWritable.cs similarity index 100% rename from vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/IObjectWritable.cs rename to vsintegration/src/PatternMatcher/IObjectWritable.cs diff --git a/vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/ImmutableArrayExtensions.cs b/vsintegration/src/PatternMatcher/ImmutableArrayExtensions.cs similarity index 100% rename from vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/ImmutableArrayExtensions.cs rename to vsintegration/src/PatternMatcher/ImmutableArrayExtensions.cs diff --git a/vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/NormalizedTextSpanCollection.cs b/vsintegration/src/PatternMatcher/NormalizedTextSpanCollection.cs similarity index 100% rename from vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/NormalizedTextSpanCollection.cs rename to vsintegration/src/PatternMatcher/NormalizedTextSpanCollection.cs diff --git a/vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/ObjectPool.cs b/vsintegration/src/PatternMatcher/ObjectPool.cs similarity index 100% rename from vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/ObjectPool.cs rename to vsintegration/src/PatternMatcher/ObjectPool.cs diff --git a/vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/ObjectReader.cs b/vsintegration/src/PatternMatcher/ObjectReader.cs similarity index 100% rename from vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/ObjectReader.cs rename to vsintegration/src/PatternMatcher/ObjectReader.cs diff --git a/vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/ObjectWriter.cs b/vsintegration/src/PatternMatcher/ObjectWriter.cs similarity index 100% rename from vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/ObjectWriter.cs rename to vsintegration/src/PatternMatcher/ObjectWriter.cs diff --git a/vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/PatternMatch.cs b/vsintegration/src/PatternMatcher/PatternMatch.cs similarity index 100% rename from vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/PatternMatch.cs rename to vsintegration/src/PatternMatcher/PatternMatch.cs diff --git a/vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/PatternMatchKind.cs b/vsintegration/src/PatternMatcher/PatternMatchKind.cs similarity index 100% rename from vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/PatternMatchKind.cs rename to vsintegration/src/PatternMatcher/PatternMatchKind.cs diff --git a/vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/PatternMatcher.Segment.cs b/vsintegration/src/PatternMatcher/PatternMatcher.Segment.cs similarity index 100% rename from vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/PatternMatcher.Segment.cs rename to vsintegration/src/PatternMatcher/PatternMatcher.Segment.cs diff --git a/vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/PatternMatcher.TextChunk.cs b/vsintegration/src/PatternMatcher/PatternMatcher.TextChunk.cs similarity index 100% rename from vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/PatternMatcher.TextChunk.cs rename to vsintegration/src/PatternMatcher/PatternMatcher.TextChunk.cs diff --git a/vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/PatternMatcher.cs b/vsintegration/src/PatternMatcher/PatternMatcher.cs similarity index 100% rename from vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/PatternMatcher.cs rename to vsintegration/src/PatternMatcher/PatternMatcher.cs diff --git a/vsintegration/src/PatternMatcher/PatternMatcher.csproj b/vsintegration/src/PatternMatcher/PatternMatcher.csproj new file mode 100644 index 0000000000..f793788688 --- /dev/null +++ b/vsintegration/src/PatternMatcher/PatternMatcher.csproj @@ -0,0 +1,25 @@ + + + + + + net46 + Library + false + true + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/PatternMatches.cs b/vsintegration/src/PatternMatcher/PatternMatches.cs similarity index 100% rename from vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/PatternMatches.cs rename to vsintegration/src/PatternMatcher/PatternMatches.cs diff --git a/vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/PooledHashSet.cs b/vsintegration/src/PatternMatcher/PooledHashSet.cs similarity index 100% rename from vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/PooledHashSet.cs rename to vsintegration/src/PatternMatcher/PooledHashSet.cs diff --git a/vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/PooledStringBuilder.cs b/vsintegration/src/PatternMatcher/PooledStringBuilder.cs similarity index 100% rename from vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/PooledStringBuilder.cs rename to vsintegration/src/PatternMatcher/PooledStringBuilder.cs diff --git a/vsintegration/src/PatternMatcher/Properties/AssemblyInfo.cs b/vsintegration/src/PatternMatcher/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..c16abf8279 --- /dev/null +++ b/vsintegration/src/PatternMatcher/Properties/AssemblyInfo.cs @@ -0,0 +1,9 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + diff --git a/vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/SpellChecker.cs b/vsintegration/src/PatternMatcher/SpellChecker.cs similarity index 100% rename from vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/SpellChecker.cs rename to vsintegration/src/PatternMatcher/SpellChecker.cs diff --git a/vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/StringBreaker.cs b/vsintegration/src/PatternMatcher/StringBreaker.cs similarity index 100% rename from vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/StringBreaker.cs rename to vsintegration/src/PatternMatcher/StringBreaker.cs diff --git a/vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/StringSlice.cs b/vsintegration/src/PatternMatcher/StringSlice.cs similarity index 100% rename from vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/StringSlice.cs rename to vsintegration/src/PatternMatcher/StringSlice.cs diff --git a/vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/TextSpan.cs b/vsintegration/src/PatternMatcher/TextSpan.cs similarity index 100% rename from vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/TextSpan.cs rename to vsintegration/src/PatternMatcher/TextSpan.cs diff --git a/vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/VersionStamp.cs b/vsintegration/src/PatternMatcher/VersionStamp.cs similarity index 100% rename from vsintegration/src/FSharp.LanguageService.Base/PatternMatcher/VersionStamp.cs rename to vsintegration/src/PatternMatcher/VersionStamp.cs From 176d6692669adc5922c87d22f6f9066f3df1909e Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Wed, 21 Mar 2018 17:28:58 -0700 Subject: [PATCH 137/147] issue# 4591 - Resx files are not working for fsharp project (#4595) --- build-everything.proj | 2 +- build.cmd | 35 ++++++---- src/fsharp/FSharp.Build/WriteCodeFragment.fs | 31 ++++++--- .../WriteCodeFragmentTests.fs | 69 ++++++++++++++++++- 4 files changed, 112 insertions(+), 25 deletions(-) diff --git a/build-everything.proj b/build-everything.proj index 34b2eb335d..8341ed5962 100644 --- a/build-everything.proj +++ b/build-everything.proj @@ -61,7 +61,7 @@ - + diff --git a/build.cmd b/build.cmd index 2a86730556..bd86cc75fb 100644 --- a/build.cmd +++ b/build.cmd @@ -841,7 +841,7 @@ echo SNEXE32: %SNEXE32% echo SNEXE64: %SNEXE64% echo -if "%TEST_NET40_COMPILERUNIT_SUITE%" == "0" if "%TEST_FCS%" == "0" if "%TEST_NET40_COREUNIT_SUITE%" == "0" if "%TEST_CORECLR_COREUNIT_SUITE%" == "0" if "%TEST_VS_IDEUNIT_SUITE%" == "0" if "%TEST_NET40_FSHARP_SUITE%" == "0" if "%TEST_NET40_FSHARPQA_SUITE%" == "0" goto :success +if "%TEST_NET40_COMPILERUNIT_SUITE%" == "0" if "%TEST_FCS%" == "0" if "%TEST_NET40_COREUNIT_SUITE%" == "0" if "TEST_CORECLR_FSHARP_SUITE" == "0" if "%TEST_CORECLR_COREUNIT_SUITE%" == "0" if "%TEST_VS_IDEUNIT_SUITE%" == "0" if "%TEST_NET40_FSHARP_SUITE%" == "0" if "%TEST_NET40_FSHARPQA_SUITE%" == "0" goto :success if "%no_test%" == "1" goto :success @@ -996,38 +996,49 @@ if "%TEST_NET40_COMPILERUNIT_SUITE%" == "1" ( echo ----------------------------------------------------------------- goto :failure ) -) - -REM ---------------- net40-coreunit ----------------------- - -if "%TEST_NET40_COREUNIT_SUITE%" == "1" ( set OUTPUTARG= set ERRORARG= set OUTPUTFILE= set ERRORFILE= - set XMLFILE=!RESULTSDIR!\test-net40-coreunit-results.xml + set XMLFILE=!RESULTSDIR!\test-net40-buildunit-results.xml if "%CI%" == "1" ( - set ERRORFILE=!RESULTSDIR!\test-net40-coreunit-errors.log - set OUTPUTFILE=!RESULTSDIR!\test-net40-coreunit-output.log + set OUTPUTFILE=!RESULTSDIR!\test-net40-buildunit-output.log + set ERRORFILE=!RESULTSDIR!\test-net40-buildunit-errors.log set ERRORARG=--err:"!ERRORFILE!" set OUTPUTARG=--output:"!OUTPUTFILE!" ) - + set ERRORFILE=!RESULTSDIR!\test-net40-buildunit-errors.log echo "!NUNIT3_CONSOLE!" --verbose --framework:V4.0 --result:"!XMLFILE!;format=nunit3" !OUTPUTARG! !ERRORARG! --work:"!FSCBINPATH!" "!FSCBINPATH!\FSharp.Build.UnitTests.dll" !WHERE_ARG_NUNIT! "!NUNIT3_CONSOLE!" --verbose --framework:V4.0 --result:"!XMLFILE!;format=nunit3" !OUTPUTARG! !ERRORARG! --work:"!FSCBINPATH!" "!FSCBINPATH!\FSharp.Build.UnitTests.dll" !WHERE_ARG_NUNIT! - if errorlevel 1 ( echo ----------------------------------------------------------------- type "!OUTPUTFILE!" echo ----------------------------------------------------------------- type "!ERRORFILE!" echo ----------------------------------------------------------------- - echo Error: Running tests net40-coreunit failed, see logs above -- FAILED + echo Error: Running tests net40-compilernit failed, see logs above -- FAILED echo ----------------------------------------------------------------- goto :failure ) +) + +REM ---------------- net40-coreunit ----------------------- + +if "%TEST_NET40_COREUNIT_SUITE%" == "1" ( + + set OUTPUTARG= + set ERRORARG= + set OUTPUTFILE= + set ERRORFILE= + set XMLFILE=!RESULTSDIR!\test-net40-coreunit-results.xml + if "%CI%" == "1" ( + set ERRORFILE=!RESULTSDIR!\test-net40-coreunit-errors.log + set OUTPUTFILE=!RESULTSDIR!\test-net40-coreunit-output.log + set ERRORARG=--err:"!ERRORFILE!" + set OUTPUTARG=--output:"!OUTPUTFILE!" + ) echo "!NUNIT3_CONSOLE!" --verbose --framework:V4.0 --result:"!XMLFILE!;format=nunit3" !OUTPUTARG! !ERRORARG! --work:"!FSCBINPATH!" "!FSCBINPATH!\FSharp.Core.UnitTests.dll" !WHERE_ARG_NUNIT! "!NUNIT3_CONSOLE!" --verbose --framework:V4.0 --result:"!XMLFILE!;format=nunit3" !OUTPUTARG! !ERRORARG! --work:"!FSCBINPATH!" "!FSCBINPATH!\FSharp.Core.UnitTests.dll" !WHERE_ARG_NUNIT! diff --git a/src/fsharp/FSharp.Build/WriteCodeFragment.fs b/src/fsharp/FSharp.Build/WriteCodeFragment.fs index 1002a489b1..a36193da54 100644 --- a/src/fsharp/FSharp.Build/WriteCodeFragment.fs +++ b/src/fsharp/FSharp.Build/WriteCodeFragment.fs @@ -33,7 +33,7 @@ type WriteCodeFragment() = | _ -> sb.Append(c)) (StringBuilder().Append("\"")) sb.Append("\"").ToString() - static member GenerateAttribute (item:ITaskItem) = + static member GenerateAttribute (item:ITaskItem, language:string) = let attributeName = item.ItemSpec let args = // mimicking the behavior from https://github.com/Microsoft/msbuild/blob/70ce7e9ccb891b63f0859f1f7f0b955693ed3742/src/Tasks/WriteCodeFragment.cs#L355-L415 @@ -73,7 +73,11 @@ type WriteCodeFragment() = | (0, _) -> combinedNamedParameters // only named arguments | (_, 0) -> combinedOrderedParameters // only positional arguments | (_, _) -> combinedOrderedParameters + ", " + combinedNamedParameters // both positional and named arguments - sprintf "[]" attributeName args + match language.ToLowerInvariant() with + | "f#" -> sprintf "[]" attributeName args + | "c#" -> sprintf "[assembly: %s(%s)]" attributeName args + | "vb" -> sprintf "" attributeName args + | _ -> failwith "Language name must be one of F#, C# or VB" // adding this property to maintain API equivalence with the MSBuild task member this.Language @@ -93,27 +97,32 @@ type WriteCodeFragment() = with get() = _outputFile and set(value) = _outputFile <- value + interface ITask with member this.BuildEngine with get() = _buildEngine and set(value) = _buildEngine <- value + member this.HostObject with get() = _hostObject and set(value) = _hostObject <- value + member this.Execute() = try if isNull _outputFile && isNull _outputDirectory then failwith "Output location must be specified" - if _language.ToLowerInvariant() <> "f#" then failwith "Language name must be F#" - let boilerplate = @"// + let boilerplate = + match _language.ToLowerInvariant() with + | "f#" -> "// \n// Generated by the FSharp WriteCodeFragment class.\n// \nnamespace FSharp\n\nopen System\nopen System.Reflection\n" + | "c#" -> "// \n// Generated by the FSharp WriteCodeFragment class.\n// \n\nusing System;\nusing System.Reflection;" + | "vb" -> "'------------------------------------------------------------------------------\n' \n' Generated by the FSharp WriteCodeFragment class.\n' \n'------------------------------------------------------------------------------\n\nOption Strict Off\nOption Explicit On\n\nImports System\nImports System.Reflection" + | _ -> failwith "Language name must be one of F#, C# or VB" -namespace FSharp - -open System -open System.Reflection" let sb = StringBuilder().AppendLine(boilerplate).AppendLine() - let code = Array.fold (fun (sb:StringBuilder) (item:ITaskItem) -> sb.AppendLine(WriteCodeFragment.GenerateAttribute item)) sb _assemblyAttributes - code.AppendLine().AppendLine("do()") |> ignore + let code = Array.fold (fun (sb:StringBuilder) (item:ITaskItem) -> sb.AppendLine(WriteCodeFragment.GenerateAttribute (item, _language.ToLowerInvariant()))) sb _assemblyAttributes + + if _language.ToLowerInvariant() = "f#" then code.AppendLine("do()") |> ignore let fileName = _outputFile.ItemSpec + let outputFileItem = if not (isNull _outputFile) && not (isNull _outputDirectory) && not (Path.IsPathRooted(fileName)) then TaskItem(Path.Combine(_outputDirectory.ItemSpec, fileName)) :> ITaskItem @@ -122,12 +131,14 @@ open System.Reflection" TaskItem(tempFile) :> ITaskItem else _outputFile + let codeText = code.ToString() let alreadyExists = (try File.Exists fileName && File.ReadAllText(fileName) = codeText with _ -> false) if not alreadyExists then File.WriteAllText(fileName, codeText) _outputFile <- outputFileItem true + with e -> printf "Error writing code fragment: %s" (e.ToString()) false diff --git a/tests/FSharp.Build.UnitTests/WriteCodeFragmentTests.fs b/tests/FSharp.Build.UnitTests/WriteCodeFragmentTests.fs index 70800400d2..977c265be0 100644 --- a/tests/FSharp.Build.UnitTests/WriteCodeFragmentTests.fs +++ b/tests/FSharp.Build.UnitTests/WriteCodeFragmentTests.fs @@ -8,12 +8,12 @@ open Microsoft.FSharp.Build open NUnit.Framework [] -type WriteCodeFragmentTests()= +type WriteCodeFragmentFSharpTests() = let verifyAttribute (attributeName:string) (parameters:(string*string) list) (expectedAttributeText:string) = let taskItem = TaskItem(attributeName) parameters |> List.iter (fun (key, value) -> taskItem.SetMetadata(key, value)) - let actualAttributeText = WriteCodeFragment.GenerateAttribute (taskItem :> ITaskItem) + let actualAttributeText = WriteCodeFragment.GenerateAttribute (taskItem :> ITaskItem, "f#") let fullExpectedAttributeText = "[]" Assert.AreEqual(fullExpectedAttributeText, actualAttributeText) @@ -37,3 +37,68 @@ type WriteCodeFragmentTests()= member this.``Escaped string parameters``() = verifyAttribute "SomeAttribute" [("_Parameter1", "\"uno\"")] "SomeAttribute(\"\\\"uno\\\"\")" // this should look like: SomeAttribute("\"uno\"") + + +[] +type WriteCodeFragmentCSharpTests() = + + let verifyAttribute (attributeName:string) (parameters:(string*string) list) (expectedAttributeText:string) = + let taskItem = TaskItem(attributeName) + parameters |> List.iter (fun (key, value) -> taskItem.SetMetadata(key, value)) + let actualAttributeText = WriteCodeFragment.GenerateAttribute (taskItem :> ITaskItem, "c#") + let fullExpectedAttributeText = "[assembly: " + expectedAttributeText + "]" + Assert.AreEqual(fullExpectedAttributeText, actualAttributeText) + + [] + member this.``No parameters``() = + verifyAttribute "SomeAttribute" [] "SomeAttribute()" + + [] + member this.``Skipped and out of order positional parameters``() = + verifyAttribute "SomeAttribute" [("_Parameter3", "3"); ("_Parameter5", "5"); ("_Parameter2", "2")] "SomeAttribute(null, \"2\", \"3\", null, \"5\")" + + [] + member this.``Named parameters``() = + verifyAttribute "SomeAttribute" [("One", "1"); ("Two", "2")] "SomeAttribute(One = \"1\", Two = \"2\")" + + [] + member this.``Named and positional parameters``() = + verifyAttribute "SomeAttribute" [("One", "1"); ("_Parameter2", "2.2"); ("Two", "2")] "SomeAttribute(null, \"2.2\", One = \"1\", Two = \"2\")" + + [] + member this.``Escaped string parameters``() = + verifyAttribute "SomeAttribute" [("_Parameter1", "\"uno\"")] "SomeAttribute(\"\\\"uno\\\"\")" + // this should look like: SomeAttribute("\"uno\"") + + +[] +type WriteCodeFragmentVisualBasicTests() = + + let verifyAttribute (attributeName:string) (parameters:(string*string) list) (expectedAttributeText:string) = + let taskItem = TaskItem(attributeName) + parameters |> List.iter (fun (key, value) -> taskItem.SetMetadata(key, value)) + let actualAttributeText = WriteCodeFragment.GenerateAttribute (taskItem :> ITaskItem, "vb") + let fullExpectedAttributeText = "" + Assert.AreEqual(fullExpectedAttributeText, actualAttributeText) + + [] + member this.``No parameters``() = + verifyAttribute "SomeAttribute" [] "SomeAttribute()" + + [] + member this.``Skipped and out of order positional parameters``() = + verifyAttribute "SomeAttribute" [("_Parameter3", "3"); ("_Parameter5", "5"); ("_Parameter2", "2")] "SomeAttribute(null, \"2\", \"3\", null, \"5\")" + + [] + member this.``Named parameters``() = + verifyAttribute "SomeAttribute" [("One", "1"); ("Two", "2")] "SomeAttribute(One = \"1\", Two = \"2\")" + + [] + member this.``Named and positional parameters``() = + verifyAttribute "SomeAttribute" [("One", "1"); ("_Parameter2", "2.2"); ("Two", "2")] "SomeAttribute(null, \"2.2\", One = \"1\", Two = \"2\")" + + [] + member this.``Escaped string parameters``() = + verifyAttribute "SomeAttribute" [("_Parameter1", "\"uno\"")] "SomeAttribute(\"\\\"uno\\\"\")" + // this should look like: SomeAttribute("\"uno\"") + From 75e435e74b81bb47c4a0ced11be0d7560d2a66ea Mon Sep 17 00:00:00 2001 From: Don Syme Date: Thu, 22 Mar 2018 13:07:38 +0000 Subject: [PATCH 138/147] Use Roslyn for backing metadata bytes in VS (#4586) * weak ByteFile * cleanup, only use in VS * cleanup flags * some comments * some comments * use Roslyn memory manager for metadata in VS * report statistics only with --times, clarify flags2 * minor updates * us in VS * fix build * fix build * fix build * add SFH to FileSystem * fix build * fix build * fix build * fix build * add some comments --- fcs/build.fsx | 2 +- src/absil/il.fs | 37 +- src/absil/il.fsi | 36 +- src/absil/illib.fs | 148 +- src/absil/ilprint.fs | 3 +- src/absil/ilread.fs | 2363 +++++++++-------- src/absil/ilread.fsi | 63 +- src/absil/ilreflect.fs | 14 +- src/absil/ilwrite.fs | 17 +- .../FSharp.Compiler.Private/FSComp.fs | 4 + .../FSharp.Compiler.Private/FSComp.resx | 5 +- src/fsharp/CompileOps.fs | 221 +- src/fsharp/CompileOps.fsi | 48 +- src/fsharp/CompileOptions.fs | 18 +- src/fsharp/FSComp.txt | 3 +- src/fsharp/LegacyHostedCompilerForTesting.fs | 3 +- src/fsharp/UnicodeLexing.fs | 2 +- src/fsharp/fsc.fs | 113 +- src/fsharp/fsc.fsi | 11 +- src/fsharp/fscmain.fs | 20 +- src/fsharp/fsi/fsi.fs | 18 +- src/fsharp/fsi/fsimain.fs | 9 + src/fsharp/lib.fs | 4 +- src/fsharp/service/IncrementalBuild.fs | 24 +- src/fsharp/service/IncrementalBuild.fsi | 2 +- src/fsharp/service/service.fs | 40 +- src/fsharp/service/service.fsi | 11 +- src/fsharp/xlf/FSComp.txt.cs.xlf | 5 + src/fsharp/xlf/FSComp.txt.de.xlf | 5 + src/fsharp/xlf/FSComp.txt.en.xlf | 5 + src/fsharp/xlf/FSComp.txt.es.xlf | 5 + src/fsharp/xlf/FSComp.txt.fr.xlf | 5 + src/fsharp/xlf/FSComp.txt.it.xlf | 5 + src/fsharp/xlf/FSComp.txt.ja.xlf | 5 + src/fsharp/xlf/FSComp.txt.ko.xlf | 5 + src/fsharp/xlf/FSComp.txt.pl.xlf | 5 + src/fsharp/xlf/FSComp.txt.pt-BR.xlf | 5 + src/fsharp/xlf/FSComp.txt.ru.xlf | 5 + src/fsharp/xlf/FSComp.txt.tr.xlf | 5 + src/fsharp/xlf/FSComp.txt.zh-Hans.xlf | 5 + src/fsharp/xlf/FSComp.txt.zh-Hant.xlf | 5 + tests/scripts/compiler-perf-results.txt | 2 + tests/service/FileSystemTests.fs | 5 +- .../LanguageService/LanguageService.fs | 57 +- .../Tests.LanguageService.QuickParse.fs | 1 - .../UnitTests/TestLib.LanguageService.fs | 1 - vsintegration/tests/UnitTests/Tests.Watson.fs | 4 +- 47 files changed, 1904 insertions(+), 1475 deletions(-) diff --git a/fcs/build.fsx b/fcs/build.fsx index 03b57797b0..f9e1ab1dec 100644 --- a/fcs/build.fsx +++ b/fcs/build.fsx @@ -24,7 +24,7 @@ let isMono = false // Utilities // -------------------------------------------------------------------------------------- -let dotnetExePath = DotNetCli.InstallDotNetSDK "2.1.4" +let dotnetExePath = DotNetCli.InstallDotNetSDK "2.1.100" let runDotnet workingDir args = let result = diff --git a/src/absil/il.fs b/src/absil/il.fs index 5d07cb5b5c..288f69474d 100644 --- a/src/absil/il.fs +++ b/src/absil/il.fs @@ -1324,6 +1324,7 @@ type MethodBody = | PInvoke of PInvokeMethod (* platform invoke to native *) | Abstract | Native + | NotAvailable type ILLazyMethodBody = | ILLazyMethodBody of Lazy @@ -1859,7 +1860,8 @@ type ILResourceAccess = [] type ILResourceLocation = - | Local of (unit -> byte[]) + | LocalIn of string * int * int + | LocalOut of byte[] | File of ILModuleRef * int32 | Assembly of ILAssemblyRef @@ -1868,15 +1870,16 @@ type ILResource = Location: ILResourceLocation; Access: ILResourceAccess; CustomAttrs: ILAttributes } - /// Read the bytes from a resource local to an assembly - member r.Bytes = - match r.Location with - | ILResourceLocation.Local b -> b() - | _ -> failwith "Bytes" + member r.GetBytes() = + match r.Location with + | ILResourceLocation.LocalIn (file, start, len) -> + FileSystem.ReadAllBytesShim(file).[start .. start + len - 1] + | ILResourceLocation.LocalOut bytes -> bytes + | _ -> failwith "GetBytes" type ILResources = - | ILResources of Lazy - member x.AsList = let (ILResources ltab) = x in (ltab.Force()) + | ILResources of ILResource list + member x.AsList = let (ILResources ltab) = x in ltab // -------------------------------------------------------------------- // One module in the "current" assembly @@ -1912,6 +1915,11 @@ type ILAssemblyManifest = EntrypointElsewhere: ILModuleRef option } +[] +type ILNativeResource = + | In of fileName: string * linkedResourceBase: int * linkedResourceStart: int * linkedResourceLength: int + | Out of unlinkedResource: byte[] + type ILModuleDef = { Manifest: ILAssemblyManifest option CustomAttrs: ILAttributes @@ -1923,7 +1931,7 @@ type ILModuleDef = SubSystemFlags: int32 IsDLL: bool IsILOnly: bool - Platform: ILPlatform option + Platform: ILPlatform option StackReserveSize: int32 option Is32Bit: bool Is32BitPreferred: bool @@ -1933,7 +1941,7 @@ type ILModuleDef = ImageBase: int32 MetadataVersion: string Resources: ILResources - NativeResources: list> (* e.g. win32 resources *) + NativeResources: ILNativeResource list (* e.g. win32 resources *) } member x.ManifestOfAssembly = match x.Manifest with @@ -2515,6 +2523,9 @@ let mkMethodBody (zeroinit,locals,maxstack,code,tag) = MethodBody.IL (mkILMethod let mkILVoidReturn = mkILReturn ILType.Void +let methBodyNotAvailable = mkMethBodyAux MethodBody.NotAvailable +let methBodyAbstract = mkMethBodyAux MethodBody.Abstract +let methBodyNative = mkMethBodyAux MethodBody.Native let mkILCtor (access,args,impl) = ILMethodDef(name=".ctor", @@ -2764,8 +2775,7 @@ let mkILNestedExportedTypes l = let mkILNestedExportedTypesLazy (l:Lazy<_>) = ILNestedExportedTypes (lazy (List.foldBack addNestedExportedTypeToTable (l.Force()) Map.empty)) -let mkILResources l = ILResources (notlazy l) -let mkILResourcesLazy l = ILResources l +let mkILResources l = ILResources l let addMethodImplToTable y tab = let key = (y.Overrides.MethodRef.Name,y.Overrides.MethodRef.ArgTypes.Length) @@ -3751,7 +3761,8 @@ and refs_of_exported_types s (tab: ILExportedTypesAndForwarders) = List.iter (re and refs_of_resource_where s x = match x with - | ILResourceLocation.Local _ -> () + | ILResourceLocation.LocalIn _ -> () + | ILResourceLocation.LocalOut _ -> () | ILResourceLocation.File (mref,_) -> refs_of_modref s mref | ILResourceLocation.Assembly aref -> refs_of_assref s aref diff --git a/src/absil/il.fsi b/src/absil/il.fsi index d16c91002d..a83be837f6 100644 --- a/src/absil/il.fsi +++ b/src/absil/il.fsi @@ -988,6 +988,7 @@ type MethodBody = | PInvoke of PInvokeMethod (* platform invoke to native *) | Abstract | Native + | NotAvailable // REVIEW: fold this into ILMethodDef. [] @@ -1426,8 +1427,16 @@ type ILResourceAccess = [] type ILResourceLocation = - | Local of (unit -> byte[]) (* resources may be re-read each time this function is called *) + /// Represents a manifest resource that can be read from within the PE file + | LocalIn of string * int * int + + /// Represents a manifest resource that is due to be written to the output PE file + | LocalOut of byte[] + + /// Represents a manifest resource in an associated file | File of ILModuleRef * int32 + + /// Represents a manifest resource in a different assembly | Assembly of ILAssemblyRef /// "Manifest ILResources" are chunks of resource data, being one of: @@ -1439,8 +1448,9 @@ type ILResource = Location: ILResourceLocation Access: ILResourceAccess CustomAttrs: ILAttributes } - /// Read the bytes from a resource local to an assembly - member Bytes: byte[] + + /// Read the bytes from a resource local to an assembly. Will fail for non-local resources. + member GetBytes : unit -> byte[] /// Table of resources in a module. [] @@ -1487,7 +1497,15 @@ type ILAssemblyManifest = /// Records whether the entrypoint resides in another module. EntrypointElsewhere: ILModuleRef option } - + +[] +type ILNativeResource = + /// Represents a native resource to be read from the PE file + | In of fileName: string * linkedResourceBase: int * linkedResourceStart: int * linkedResourceLength: int + + /// Represents a native resource to be written in an output file + | Out of unlinkedResource: byte[] + /// One module in the "current" assembly, either a main-module or /// an auxiliary module. The main module will have a manifest. /// @@ -1512,9 +1530,9 @@ type ILModuleDef = PhysicalAlignment: int32 ImageBase: int32 MetadataVersion: string - Resources: ILResources - /// e.g. win86 resources, as the exact contents of a .res or .obj file. - NativeResources: Lazy list } + Resources: ILResources + /// e.g. win86 resources, as the exact contents of a .res or .obj file. Must be unlinked manually. + NativeResources: ILNativeResource list } member ManifestOfAssembly: ILAssemblyManifest member HasManifest: bool @@ -1749,6 +1767,9 @@ val mkILEmptyGenericParams: ILGenericParameterDefs /// Make method definitions. val mkILMethodBody: initlocals:bool * ILLocals * int * ILCode * ILSourceMarker option -> ILMethodBody val mkMethodBody: bool * ILLocals * int * ILCode * ILSourceMarker option -> MethodBody +val methBodyNotAvailable: ILLazyMethodBody +val methBodyAbstract: ILLazyMethodBody +val methBodyNative: ILLazyMethodBody val mkILCtor: ILMemberAccess * ILParameter list * MethodBody -> ILMethodDef val mkILClassCtor: MethodBody -> ILMethodDef @@ -1863,7 +1884,6 @@ val mkILExportedTypes: ILExportedTypeOrForwarder list -> ILExportedTypesAndForwa val mkILExportedTypesLazy: Lazy -> ILExportedTypesAndForwarders val mkILResources: ILResource list -> ILResources -val mkILResourcesLazy: Lazy -> ILResources /// Making modules. val mkILSimpleModule: assemblyName:string -> moduleName:string -> dll:bool -> subsystemVersion: (int * int) -> useHighEntropyVA: bool -> ILTypeDefs -> int32 option -> string option -> int -> ILExportedTypesAndForwarders -> string -> ILModuleDef diff --git a/src/absil/illib.fs b/src/absil/illib.fs index 2e97b0ab88..01aa270788 100644 --- a/src/absil/illib.fs +++ b/src/absil/illib.fs @@ -7,7 +7,11 @@ module public Microsoft.FSharp.Compiler.AbstractIL.Internal.Library open System open System.Collections open System.Collections.Generic +open System.Diagnostics +open System.IO open System.Reflection +open System.Text +open System.Threading open Internal.Utilities #if FX_RESHAPED_REFLECTION @@ -47,7 +51,7 @@ let reportTime = let tPrev = ref None fun showTimes descr -> if showTimes then - let t = System.Diagnostics.Process.GetCurrentProcess().UserProcessorTime.TotalSeconds + let t = Process.GetCurrentProcess().UserProcessorTime.TotalSeconds let prev = match !tPrev with None -> 0.0 | Some t -> t let first = match !tFirst with None -> (tFirst := Some t; t) | Some t -> t printf "ilwrite: TIME %10.3f (total) %10.3f (delta) - %s\n" (t - first) (t - prev) descr @@ -60,14 +64,14 @@ let reportTime = [] /// An efficient lazy for inline storage in a class type. Results in fewer thunks. type InlineDelayInit<'T when 'T : not struct> = - new (f: unit -> 'T) = {store = Unchecked.defaultof<'T>; func = System.Func<_>(f) } + new (f: unit -> 'T) = {store = Unchecked.defaultof<'T>; func = Func<_>(f) } val mutable store : 'T - val mutable func : System.Func<'T> + val mutable func : Func<'T> member x.Value = match x.func with | null -> x.store | _ -> - let res = System.Threading.LazyInitializer.EnsureInitialized(&x.store, x.func) + let res = LazyInitializer.EnsureInitialized(&x.store, x.func) x.func <- Unchecked.defaultof<_> res @@ -334,7 +338,7 @@ module List = let rec loop acc l = match l with | [] -> - System.Diagnostics.Debug.Assert(false, "empty list") + Debug.Assert(false, "empty list") invalidArg "l" "empty list" | [h] -> List.rev acc,h | h::t -> loop (h::acc) t @@ -353,7 +357,7 @@ module List = let headAndTail l = match l with | [] -> - System.Diagnostics.Debug.Assert(false, "empty list") + Debug.Assert(false, "empty list") failwith "List.headAndTail" | h::t -> h,t @@ -395,7 +399,7 @@ module List = let range n m = [ n .. m ] - let indexNotFound() = raise (new System.Collections.Generic.KeyNotFoundException("An index satisfying the predicate was not found in the collection")) + let indexNotFound() = raise (new KeyNotFoundException("An index satisfying the predicate was not found in the collection")) let rec assoc x l = match l with @@ -456,9 +460,9 @@ module ValueOption = let inline bind f x = match x with VSome x -> f x | VNone -> VNone module String = - let indexNotFound() = raise (new System.Collections.Generic.KeyNotFoundException("An index for the character was not found in the string")) + let indexNotFound() = raise (new KeyNotFoundException("An index for the character was not found in the string")) - let make (n: int) (c: char) : string = new System.String(c, n) + let make (n: int) (c: char) : string = new String(c, n) let get (str:string) i = str.[i] @@ -484,7 +488,7 @@ module String = s.ToUpperInvariant() let isUpper (s:string) = - s.Length >= 1 && System.Char.IsUpper s.[0] && not (System.Char.IsLower s.[0]) + s.Length >= 1 && Char.IsUpper s.[0] && not (Char.IsLower s.[0]) let capitalize (s:string) = if s.Length = 0 then s @@ -498,9 +502,6 @@ module String = let dropSuffix (s:string) (t:string) = s.[0..s.Length - t.Length - 1] - open System - open System.IO - let inline toCharArray (str: string) = str.ToCharArray() let lowerCaseFirstChar (str: string) = @@ -562,7 +563,7 @@ module String = |] module Dictionary = - let inline newWithSize (size: int) = System.Collections.Generic.Dictionary<_,_>(size, HashIdentity.Structural) + let inline newWithSize (size: int) = Dictionary<_,_>(size, HashIdentity.Structural) module Lazy = @@ -619,7 +620,7 @@ module Map = type ResultOrException<'TResult> = | Result of 'TResult - | Exception of System.Exception + | Exception of Exception [] module ResultOrException = @@ -653,13 +654,13 @@ type ValueOrCancelled<'TResult> = /// /// A cancellable computation is passed may be cancelled via a CancellationToken, which is propagated implicitly. /// If cancellation occurs, it is propagated as data rather than by raising an OperationCanceledException. -type Cancellable<'TResult> = Cancellable of (System.Threading.CancellationToken -> ValueOrCancelled<'TResult>) +type Cancellable<'TResult> = Cancellable of (CancellationToken -> ValueOrCancelled<'TResult>) [] module Cancellable = /// Run a cancellable computation using the given cancellation token - let run (ct: System.Threading.CancellationToken) (Cancellable oper) = + let run (ct: CancellationToken) (Cancellable oper) = if ct.IsCancellationRequested then ValueOrCancelled.Cancelled (OperationCanceledException ct) else @@ -712,7 +713,7 @@ module Cancellable = /// Run the computation in a mode where it may not be cancelled. The computation never results in a /// ValueOrCancelled.Cancelled. let runWithoutCancellation comp = - let res = run System.Threading.CancellationToken.None comp + let res = run CancellationToken.None comp match res with | ValueOrCancelled.Cancelled _ -> failwith "unexpected cancellation" | ValueOrCancelled.Value r -> r @@ -766,7 +767,7 @@ type CancellableBuilder() = member x.ReturnFrom(v) = v member x.Combine(e1,e2) = e1 |> Cancellable.bind (fun () -> e2) member x.TryWith(e,handler) = Cancellable.tryWith e handler - member x.Using(resource,e) = Cancellable.tryFinally (e resource) (fun () -> (resource :> System.IDisposable).Dispose()) + member x.Using(resource,e) = Cancellable.tryFinally (e resource) (fun () -> (resource :> IDisposable).Dispose()) member x.TryFinally(e,compensation) = Cancellable.tryFinally e compensation member x.Delay(f) = Cancellable.delay f member x.Zero() = Cancellable.ret () @@ -791,7 +792,6 @@ type Eventually<'T> = [] module Eventually = - open System.Threading let rec box e = match e with @@ -814,7 +814,7 @@ module Eventually = /// /// If cancellation happens, the operation is left half-complete, ready to resume. let repeatedlyProgressUntilDoneOrTimeShareOverOrCanceled timeShareInMilliseconds (ct: CancellationToken) runner e = - let sw = new System.Diagnostics.Stopwatch() + let sw = new Stopwatch() let rec runTimeShare ctok e = runner ctok (fun ctok -> sw.Reset() @@ -925,7 +925,7 @@ type UniqueStampGenerator<'T when 'T : equality>() = type MemoizationTable<'T,'U>(compute: 'T -> 'U, keyComparer: IEqualityComparer<'T>, ?canMemoize) = - let table = new System.Collections.Generic.Dictionary<'T,'U>(keyComparer) + let table = new Dictionary<'T,'U>(keyComparer) member t.Apply(x) = if (match canMemoize with None -> true | Some f -> f x) then let mutable res = Unchecked.defaultof<'U> @@ -977,11 +977,11 @@ type LazyWithContext<'T,'ctxt> = | null -> x.value | _ -> // Enter the lock in case another thread is in the process of evaluating the result - System.Threading.Monitor.Enter(x); + Monitor.Enter(x); try x.UnsynchronizedForce(ctxt) finally - System.Threading.Monitor.Exit(x) + Monitor.Exit(x) member x.UnsynchronizedForce(ctxt) = match x.funcOrException with @@ -1181,56 +1181,85 @@ type LayeredMultiMap<'Key,'Value when 'Key : equality and 'Key : comparison>(con [] module Shim = - open System.IO - #if FX_RESHAPED_REFLECTION open PrimReflectionAdapters open Microsoft.FSharp.Core.ReflectionAdapters #endif type IFileSystem = + + /// A shim over File.ReadAllBytes abstract ReadAllBytesShim: fileName:string -> byte[] - abstract FileStreamReadShim: fileName:string -> System.IO.Stream - abstract FileStreamCreateShim: fileName:string -> System.IO.Stream - abstract FileStreamWriteExistingShim: fileName:string -> System.IO.Stream + + /// A shim over FileStream with FileMode.Open,FileAccess.Read,FileShare.ReadWrite + abstract FileStreamReadShim: fileName:string -> Stream + + /// A shim over FileStream with FileMode.Create,FileAccess.Write,FileShare.Read + abstract FileStreamCreateShim: fileName:string -> Stream + + /// A shim over FileStream with FileMode.Open,FileAccess.Write,FileShare.Read + abstract FileStreamWriteExistingShim: fileName:string -> Stream /// Take in a filename with an absolute path, and return the same filename /// but canonicalized with respect to extra path separators (e.g. C:\\\\foo.txt) /// and '..' portions abstract GetFullPathShim: fileName:string -> string + + /// A shim over Path.IsPathRooted abstract IsPathRootedShim: path:string -> bool + + /// A shim over Path.IsInvalidPath abstract IsInvalidPathShim: filename:string -> bool + + /// A shim over Path.GetTempPath abstract GetTempPathShim : unit -> string /// Utc time of the last modification - abstract GetLastWriteTimeShim: fileName:string -> System.DateTime - abstract SafeExists: fileName:string -> bool - abstract FileDelete: fileName:string -> unit - abstract AssemblyLoadFrom: fileName:string -> System.Reflection.Assembly - abstract AssemblyLoad: assemblyName:System.Reflection.AssemblyName -> System.Reflection.Assembly + abstract GetLastWriteTimeShim: fileName: string -> DateTime + + /// A shim over File.Exists + abstract SafeExists: fileName: string -> bool + + /// A shim over File.Delete + abstract FileDelete: fileName: string -> unit + + /// Used to load type providers and located assemblies in F# Interactive + abstract AssemblyLoadFrom: fileName: string -> Assembly + + /// Used to load a dependency for F# Interactive and in an unused corner-case of type provider loading + abstract AssemblyLoad: assemblyName: AssemblyName -> Assembly + + /// Used to determine if a file will not be subject to deletion during the lifetime of a typical client process. + abstract IsStableFileHeuristic: fileName: string -> bool type DefaultFileSystem() = interface IFileSystem with - member __.AssemblyLoadFrom(fileName:string) = + + member __.AssemblyLoadFrom(fileName: string) = Assembly.LoadFrom fileName - member __.AssemblyLoad(assemblyName:System.Reflection.AssemblyName) = + + member __.AssemblyLoad(assemblyName: AssemblyName) = Assembly.Load assemblyName - member __.ReadAllBytesShim (fileName:string) = File.ReadAllBytes fileName - member __.FileStreamReadShim (fileName:string) = new FileStream(fileName,FileMode.Open,FileAccess.Read,FileShare.ReadWrite) :> Stream - member __.FileStreamCreateShim (fileName:string) = new FileStream(fileName,FileMode.Create,FileAccess.Write,FileShare.Read ,0x1000,false) :> Stream - member __.FileStreamWriteExistingShim (fileName:string) = new FileStream(fileName,FileMode.Open,FileAccess.Write,FileShare.Read ,0x1000,false) :> Stream - member __.GetFullPathShim (fileName:string) = System.IO.Path.GetFullPath fileName + member __.ReadAllBytesShim (fileName: string) = File.ReadAllBytes fileName + + member __.FileStreamReadShim (fileName: string) = new FileStream(fileName,FileMode.Open,FileAccess.Read,FileShare.ReadWrite) :> Stream + + member __.FileStreamCreateShim (fileName: string) = new FileStream(fileName,FileMode.Create,FileAccess.Write,FileShare.Read ,0x1000,false) :> Stream - member __.IsPathRootedShim (path:string) = Path.IsPathRooted path + member __.FileStreamWriteExistingShim (fileName: string) = new FileStream(fileName,FileMode.Open,FileAccess.Write,FileShare.Read ,0x1000,false) :> Stream - member __.IsInvalidPathShim(path:string) = + member __.GetFullPathShim (fileName: string) = System.IO.Path.GetFullPath fileName + + member __.IsPathRootedShim (path: string) = Path.IsPathRooted path + + member __.IsInvalidPathShim(path: string) = let isInvalidPath(p:string) = - String.IsNullOrEmpty(p) || p.IndexOfAny(System.IO.Path.GetInvalidPathChars()) <> -1 + String.IsNullOrEmpty(p) || p.IndexOfAny(Path.GetInvalidPathChars()) <> -1 let isInvalidFilename(p:string) = - String.IsNullOrEmpty(p) || p.IndexOfAny(System.IO.Path.GetInvalidFileNameChars()) <> -1 + String.IsNullOrEmpty(p) || p.IndexOfAny(Path.GetInvalidFileNameChars()) <> -1 let isInvalidDirectory(d:string) = d=null || d.IndexOfAny(Path.GetInvalidPathChars()) <> -1 @@ -1240,14 +1269,31 @@ module Shim = let filename = Path.GetFileName(path) isInvalidDirectory(directory) || isInvalidFilename(filename) - member __.GetTempPathShim() = System.IO.Path.GetTempPath() + member __.GetTempPathShim() = Path.GetTempPath() member __.GetLastWriteTimeShim (fileName:string) = File.GetLastWriteTimeUtc fileName - member __.SafeExists (fileName:string) = System.IO.File.Exists fileName - member __.FileDelete (fileName:string) = System.IO.File.Delete fileName - type System.Text.Encoding with - static member GetEncodingShim(n:int) = - System.Text.Encoding.GetEncoding(n) + member __.SafeExists (fileName:string) = File.Exists fileName + + member __.FileDelete (fileName:string) = File.Delete fileName + + member __.IsStableFileHeuristic (fileName: string) = + let directory = Path.GetDirectoryName(fileName) + directory.Contains("Reference Assemblies/") || + directory.Contains("Reference Assemblies\\") || + directory.Contains("packages/") || + directory.Contains("packages\\") || + directory.Contains("lib/mono/") let mutable FileSystem = DefaultFileSystem() :> IFileSystem + + type File with + static member ReadBinaryChunk (fileName, start, len) = + use stream = FileSystem.FileStreamReadShim fileName + stream.Seek(int64 start, SeekOrigin.Begin) |> ignore + let buffer = Array.zeroCreate len + let mutable n = 0 + while n < len do + n <- n + stream.Read(buffer, n, len-n) + buffer + diff --git a/src/absil/ilprint.fs b/src/absil/ilprint.fs index f2b722292f..7b12d098dc 100644 --- a/src/absil/ilprint.fs +++ b/src/absil/ilprint.fs @@ -997,7 +997,8 @@ let goutput_resource env os r = output_string os " { "; goutput_custom_attrs env os r.CustomAttrs; match r.Location with - | ILResourceLocation.Local _ -> + | ILResourceLocation.LocalIn _ + | ILResourceLocation.LocalOut _ -> output_string os " /* loc nyi */ "; | ILResourceLocation.File (mref,off) -> output_string os " .file "; diff --git a/src/absil/ilread.fs b/src/absil/ilread.fs index aca3d1ee15..5bfb5f60fc 100644 --- a/src/absil/ilread.fs +++ b/src/absil/ilread.fs @@ -5,14 +5,16 @@ // //--------------------------------------------------------------------- -module internal Microsoft.FSharp.Compiler.AbstractIL.ILBinaryReader +module Microsoft.FSharp.Compiler.AbstractIL.ILBinaryReader #nowarn "42" // This construct is deprecated: it is only for use in the F# library open System +open System.Collections.Generic +open System.Diagnostics open System.IO open System.Runtime.InteropServices -open System.Collections.Generic +open System.Text open Internal.Utilities open Internal.Utilities.Collections open Microsoft.FSharp.Compiler.AbstractIL @@ -29,20 +31,11 @@ open Microsoft.FSharp.Compiler.Range open Microsoft.FSharp.NativeInterop open System.Reflection -type ILReaderOptions = - { pdbPath: string option - ilGlobals: ILGlobals - optimizeForMemory: bool } - -#if STATISTICS -let reportRef = ref (fun _oc -> ()) -let addReport f = let old = !reportRef in reportRef := (fun oc -> old oc; f oc) -let report (oc:TextWriter) = !reportRef oc ; reportRef := ref (fun _oc -> ()) -#endif - let checking = false let logging = false let _ = if checking then dprintn "warning : Ilread.checking is on" +let noStableFileHeuristic = try (System.Environment.GetEnvironmentVariable("FSharp_NoStableFileHeuristic") <> null) with _ -> false +let alwaysMemoryMapFSC = try (System.Environment.GetEnvironmentVariable("FSharp_AlwaysMemoryMapCommandLineCompiler") <> null) with _ -> false let singleOfBits (x:int32) = System.BitConverter.ToSingle(System.BitConverter.GetBytes(x), 0) let doubleOfBits (x:int64) = System.BitConverter.Int64BitsToDouble(x) @@ -95,16 +88,103 @@ let tokToTaggedIdx f nbits tok = let idx = tok >>>& nbits TaggedIndex(f tag, idx) +type Statistics = + { mutable rawMemoryFileCount : int + mutable memoryMapFileOpenedCount : int + mutable memoryMapFileClosedCount : int + mutable weakByteFileCount : int + mutable byteFileCount : int } + +let stats = + { rawMemoryFileCount = 0 + memoryMapFileOpenedCount = 0 + memoryMapFileClosedCount = 0 + weakByteFileCount = 0 + byteFileCount = 0 } + +let GetStatistics() = stats [] -type BinaryFile() = +/// An abstraction over how we access the contents of .NET binaries. May be backed by managed or unmanaged memory, +/// memory mapped file or by on-disk resources. These objects should never need explicit disposal - they must either +/// not hold resources of clean up after themselves when collected. +type BinaryView() = + + /// Read a byte from the file abstract ReadByte : addr:int -> byte + + /// Read a chunk of bytes from the file abstract ReadBytes : addr:int -> int -> byte[] + + /// Read an Int32 from the file abstract ReadInt32 : addr:int -> int + + /// Read a UInt16 from the file abstract ReadUInt16 : addr:int -> uint16 + + /// Read a length of a UTF8 string from the file abstract CountUtf8String : addr:int -> int + + /// Read a UTF8 string from the file abstract ReadUTF8String : addr: int -> string +/// An abstraction over how we access the contents of .NET binaries. May be backed by managed or unmanaged memory, +/// memory mapped file or by on-disk resources. +type BinaryFile = + /// Return a BinaryView for temporary use which eagerly holds any necessary memory resources for the duration of its lifetime, + /// and is faster to access byte-by-byte. The returned BinaryView should _not_ be captured in a closure that outlives the + /// desired lifetime. + abstract GetView : unit -> BinaryView + +/// A view over a raw pointer to memory +type RawMemoryView(obj: obj, start:nativeint, len: int) = + inherit BinaryView() + + override m.ReadByte i = + if nativeint i + 1n > nativeint len then failwithf "RawMemoryView overrun, i = %d, obj = %A" i obj + Marshal.ReadByte(start + nativeint i) + + override m.ReadBytes i n = + if nativeint i + nativeint n > nativeint len then failwithf "RawMemoryView overrun, i = %d, n = %d, obj = %A" i n obj + let res = Bytes.zeroCreate n + Marshal.Copy(start + nativeint i, res, 0, n) + res + + override m.ReadInt32 i = + if nativeint i + 4n > nativeint len then failwithf "RawMemoryView overrun, i = %d, obj = %A" i obj + Marshal.ReadInt32(start + nativeint i) + + override m.ReadUInt16 i = + if nativeint i + 2n > nativeint len then failwithf "RawMemoryView overrun, i = %d, obj = %A" i obj + uint16(Marshal.ReadInt16(start + nativeint i)) + + override m.CountUtf8String i = + if nativeint i > nativeint len then failwithf "RawMemoryView overrun, i = %d, obj = %A" i obj + let pStart = start + nativeint i + let mutable p = start + while Marshal.ReadByte(p) <> 0uy do + p <- p + 1n + int (p - pStart) + + override m.ReadUTF8String i = + let n = m.CountUtf8String i + if nativeint i + nativeint n > nativeint len then failwithf "RawMemoryView overrun, i = %d, n = %d, obj = %A" i n obj + System.Runtime.InteropServices.Marshal.PtrToStringAnsi(start + nativeint i, n) + + member __.HoldObj() = obj + + +/// Gives views over a raw chunk of memory, for example those returned to us by the memory manager in Roslyn's +/// Visual Studio integration. 'obj' must keep the memory alive. The object will capture it and thus also keep the memory alive for +/// the lifetime of this object. +type RawMemoryFile(fileName: string, obj: obj, addr: nativeint, length: int) = + do stats.rawMemoryFileCount <- stats.rawMemoryFileCount + 1 + let view = RawMemoryView(obj, addr, length) + member __.HoldObj() = obj // make sure we capture 'obj' + member __.FileName = fileName + interface BinaryFile with + override __.GetView() = view :>_ + /// Read from memory mapped files. module MemoryMapping = @@ -154,160 +234,217 @@ module MemoryMapping = let OPEN_EXISTING = 0x0003 let OPEN_ALWAYS = 0x0004 -type MemoryMappedFile(hMap: MemoryMapping.HANDLE, start:nativeint) = - inherit BinaryFile() - - static member Create fileName = - //printf "fileName = %s\n" fileName - let hFile = MemoryMapping.CreateFile (fileName, MemoryMapping.GENERIC_READ, MemoryMapping.FILE_SHARE_READ_WRITE, IntPtr.Zero, MemoryMapping.OPEN_EXISTING, 0, IntPtr.Zero ) - //printf "hFile = %Lx\n" (hFile.ToInt64()) - if ( hFile.Equals(MemoryMapping.INVALID_HANDLE) ) then - failwithf "CreateFile(0x%08x)" ( Marshal.GetHRForLastWin32Error() ) - let protection = 0x00000002 (* ReadOnly *) - //printf "OK! hFile = %Lx\n" (hFile.ToInt64()) - let hMap = MemoryMapping.CreateFileMapping (hFile, IntPtr.Zero, protection, 0, 0, null ) - ignore(MemoryMapping.CloseHandle(hFile)) - if hMap.Equals(MemoryMapping.NULL_HANDLE) then - failwithf "CreateFileMapping(0x%08x)" ( Marshal.GetHRForLastWin32Error() ) - - let start = MemoryMapping.MapViewOfFile (hMap, MemoryMapping.MAP_READ, 0, 0, 0n) - - if start.Equals(IntPtr.Zero) then - failwithf "MapViewOfFile(0x%08x)" ( Marshal.GetHRForLastWin32Error() ) - MemoryMappedFile(hMap, start) - - member m.Addr (i:int) : nativeint = - start + nativeint i +/// A view over a raw pointer to memory given by a memory mapped file. +/// NOTE: we should do more checking of validity here. +type MemoryMapView(start:nativeint) = + inherit BinaryView() override m.ReadByte i = - Marshal.ReadByte(m.Addr i) + Marshal.ReadByte(start + nativeint i) - override m.ReadBytes i len = - let res = Bytes.zeroCreate len - Marshal.Copy(m.Addr i, res, 0, len) + override m.ReadBytes i n = + let res = Bytes.zeroCreate n + Marshal.Copy(start + nativeint i, res, 0, n) res override m.ReadInt32 i = - Marshal.ReadInt32(m.Addr i) + Marshal.ReadInt32(start + nativeint i) override m.ReadUInt16 i = - uint16(Marshal.ReadInt16(m.Addr i)) - - member m.Close() = - ignore(MemoryMapping.UnmapViewOfFile start) - ignore(MemoryMapping.CloseHandle hMap) + uint16(Marshal.ReadInt16(start + nativeint i)) override m.CountUtf8String i = - let start = m.Addr i + let pStart = start + nativeint i let mutable p = start while Marshal.ReadByte(p) <> 0uy do p <- p + 1n - int (p - start) + int (p - pStart) override m.ReadUTF8String i = let n = m.CountUtf8String i - System.Runtime.InteropServices.Marshal.PtrToStringAnsi((m.Addr i), n) -//#if FX_RESHAPED_REFLECTION -// System.Text.Encoding.UTF8.GetString(NativePtr.ofNativeInt (m.Addr i), n) -//#else -// new System.String(NativePtr.ofNativeInt (m.Addr i), 0, n, System.Text.Encoding.UTF8) -//#endif + System.Runtime.InteropServices.Marshal.PtrToStringAnsi(start + nativeint i, n) +/// Memory maps a file and creates a single view over the entirety of its contents. The +/// lock on the file is only released when the object is disposed. +/// For memory mapping we currently take one view and never release it. +[] +type MemoryMapFile(fileName: string, view: MemoryMapView, hMap: MemoryMapping.HANDLE, hView:nativeint) = -//--------------------------------------------------------------------- -// Read file from memory blocks -//--------------------------------------------------------------------- + do stats.memoryMapFileOpenedCount <- stats.memoryMapFileOpenedCount + 1 + let mutable closed = false + static member Create fileName = + let hFile = MemoryMapping.CreateFile (fileName, MemoryMapping.GENERIC_READ, MemoryMapping.FILE_SHARE_READ_WRITE, IntPtr.Zero, MemoryMapping.OPEN_EXISTING, 0, IntPtr.Zero ) + if hFile.Equals(MemoryMapping.INVALID_HANDLE) then + failwithf "CreateFile(0x%08x)" (Marshal.GetHRForLastWin32Error()) + let protection = 0x00000002 + let hMap = MemoryMapping.CreateFileMapping (hFile, IntPtr.Zero, protection, 0, 0, null ) + ignore(MemoryMapping.CloseHandle(hFile)) + if hMap.Equals(MemoryMapping.NULL_HANDLE) then + failwithf "CreateFileMapping(0x%08x)" (Marshal.GetHRForLastWin32Error()) + + let hView = MemoryMapping.MapViewOfFile (hMap, MemoryMapping.MAP_READ, 0, 0, 0n) + + if hView.Equals(IntPtr.Zero) then + failwithf "MapViewOfFile(0x%08x)" (Marshal.GetHRForLastWin32Error()) + + let view = MemoryMapView(hView) + + MemoryMapFile(fileName, view, hMap, hView) + + member __.FileName = fileName + member __.Close() = + stats.memoryMapFileClosedCount <- stats.memoryMapFileClosedCount + 1 + if not closed then + closed <- true + MemoryMapping.UnmapViewOfFile hView |> ignore + MemoryMapping.CloseHandle hMap |> ignore -type ByteFile(bytes:byte[]) = - inherit BinaryFile() + interface BinaryFile with + override __.GetView() = (view :> BinaryView) - override mc.ReadByte addr = bytes.[addr] - override mc.ReadBytes addr len = Array.sub bytes addr len - override m.CountUtf8String addr = +/// Read file from memory blocks +type ByteView(bytes:byte[]) = + inherit BinaryView() + + override __.ReadByte addr = bytes.[addr] + + override __.ReadBytes addr len = Array.sub bytes addr len + + override __.CountUtf8String addr = let mutable p = addr while bytes.[p] <> 0uy do p <- p + 1 p - addr - override m.ReadUTF8String addr = - let n = m.CountUtf8String addr + override bfv.ReadUTF8String addr = + let n = bfv.CountUtf8String addr System.Text.Encoding.UTF8.GetString (bytes, addr, n) - override is.ReadInt32 addr = - let b0 = is.ReadByte addr - let b1 = is.ReadByte (addr+1) - let b2 = is.ReadByte (addr+2) - let b3 = is.ReadByte (addr+3) + override bfv.ReadInt32 addr = + let b0 = bfv.ReadByte addr + let b1 = bfv.ReadByte (addr+1) + let b2 = bfv.ReadByte (addr+2) + let b3 = bfv.ReadByte (addr+3) int b0 ||| (int b1 <<< 8) ||| (int b2 <<< 16) ||| (int b3 <<< 24) - override is.ReadUInt16 addr = - let b0 = is.ReadByte addr - let b1 = is.ReadByte (addr+1) + override bfv.ReadUInt16 addr = + let b0 = bfv.ReadByte addr + let b1 = bfv.ReadByte (addr+1) uint16 b0 ||| (uint16 b1 <<< 8) + +/// A BinaryFile backed by an array of bytes held strongly as managed memory +[] +type ByteFile(fileName: string, bytes:byte[]) = + let view = ByteView(bytes) + do stats.byteFileCount <- stats.byteFileCount + 1 + member __.FileName = fileName + interface BinaryFile with + override bf.GetView() = view :> BinaryView + +/// Same as ByteFile but holds the bytes weakly. The bytes will be re-read from the backing file when a view is requested. +/// This is the default implementation used by F# Compiler Services when accessing "stable" binaries. It is not used +/// by Visual Studio, where tryGetMetadataSnapshot provides a RawMemoryFile backed by Roslyn data. +[] +type WeakByteFile(fileName: string) = + + do stats.weakByteFileCount <- stats.weakByteFileCount + 1 + + /// Used to check that the file hasn't changed + let fileStamp = FileSystem.GetLastWriteTimeShim(fileName) + + /// The weak handle to the bytes for the file + let weakBytes = new WeakReference (null) + + member __.FileName = fileName + /// Get the bytes for the file + member this.Get() = + let mutable tg = null + if not (weakBytes.TryGetTarget(&tg)) then + if FileSystem.GetLastWriteTimeShim(fileName) <> fileStamp then + errorR (Error (FSComp.SR.ilreadFileChanged fileName, range0)) + + tg <- FileSystem.ReadAllBytesShim fileName + weakBytes.SetTarget tg + tg + + interface BinaryFile with + override __.GetView() = + let mutable tg = null + let strongBytes = + if not (weakBytes.TryGetTarget(&tg)) then + if FileSystem.GetLastWriteTimeShim(fileName) <> fileStamp then + errorR (Error (FSComp.SR.ilreadFileChanged fileName, range0)) + + tg <- FileSystem.ReadAllBytesShim fileName + weakBytes.SetTarget tg + tg + (ByteView(strongBytes) :> BinaryView) + + -let seekReadByte (is:BinaryFile) addr = is.ReadByte addr -let seekReadBytes (is:BinaryFile) addr len = is.ReadBytes addr len -let seekReadInt32 (is:BinaryFile) addr = is.ReadInt32 addr -let seekReadUInt16 (is:BinaryFile) addr = is.ReadUInt16 addr +let seekReadByte (mdv:BinaryView) addr = mdv.ReadByte addr +let seekReadBytes (mdv:BinaryView) addr len = mdv.ReadBytes addr len +let seekReadInt32 (mdv:BinaryView) addr = mdv.ReadInt32 addr +let seekReadUInt16 (mdv:BinaryView) addr = mdv.ReadUInt16 addr -let seekReadByteAsInt32 is addr = int32 (seekReadByte is addr) +let seekReadByteAsInt32 mdv addr = int32 (seekReadByte mdv addr) -let seekReadInt64 is addr = - let b0 = seekReadByte is addr - let b1 = seekReadByte is (addr+1) - let b2 = seekReadByte is (addr+2) - let b3 = seekReadByte is (addr+3) - let b4 = seekReadByte is (addr+4) - let b5 = seekReadByte is (addr+5) - let b6 = seekReadByte is (addr+6) - let b7 = seekReadByte is (addr+7) +let seekReadInt64 mdv addr = + let b0 = seekReadByte mdv addr + let b1 = seekReadByte mdv (addr+1) + let b2 = seekReadByte mdv (addr+2) + let b3 = seekReadByte mdv (addr+3) + let b4 = seekReadByte mdv (addr+4) + let b5 = seekReadByte mdv (addr+5) + let b6 = seekReadByte mdv (addr+6) + let b7 = seekReadByte mdv (addr+7) int64 b0 ||| (int64 b1 <<< 8) ||| (int64 b2 <<< 16) ||| (int64 b3 <<< 24) ||| (int64 b4 <<< 32) ||| (int64 b5 <<< 40) ||| (int64 b6 <<< 48) ||| (int64 b7 <<< 56) -let seekReadUInt16AsInt32 is addr = int32 (seekReadUInt16 is addr) +let seekReadUInt16AsInt32 mdv addr = int32 (seekReadUInt16 mdv addr) -let seekReadCompressedUInt32 is addr = - let b0 = seekReadByte is addr +let seekReadCompressedUInt32 mdv addr = + let b0 = seekReadByte mdv addr if b0 <= 0x7Fuy then int b0, addr+1 elif b0 <= 0xBFuy then let b0 = b0 &&& 0x7Fuy - let b1 = seekReadByteAsInt32 is (addr+1) + let b1 = seekReadByteAsInt32 mdv (addr+1) (int b0 <<< 8) ||| int b1, addr+2 else let b0 = b0 &&& 0x3Fuy - let b1 = seekReadByteAsInt32 is (addr+1) - let b2 = seekReadByteAsInt32 is (addr+2) - let b3 = seekReadByteAsInt32 is (addr+3) + let b1 = seekReadByteAsInt32 mdv (addr+1) + let b2 = seekReadByteAsInt32 mdv (addr+2) + let b3 = seekReadByteAsInt32 mdv (addr+3) (int b0 <<< 24) ||| (int b1 <<< 16) ||| (int b2 <<< 8) ||| int b3, addr+4 -let seekReadSByte is addr = sbyte (seekReadByte is addr) -let seekReadSingle is addr = singleOfBits (seekReadInt32 is addr) -let seekReadDouble is addr = doubleOfBits (seekReadInt64 is addr) +let seekReadSByte mdv addr = sbyte (seekReadByte mdv addr) +let seekReadSingle mdv addr = singleOfBits (seekReadInt32 mdv addr) +let seekReadDouble mdv addr = doubleOfBits (seekReadInt64 mdv addr) -let rec seekCountUtf8String is addr n = - let c = seekReadByteAsInt32 is addr +let rec seekCountUtf8String mdv addr n = + let c = seekReadByteAsInt32 mdv addr if c = 0 then n - else seekCountUtf8String is (addr+1) (n+1) + else seekCountUtf8String mdv (addr+1) (n+1) -let seekReadUTF8String is addr = - let n = seekCountUtf8String is addr 0 - let bytes = seekReadBytes is addr n +let seekReadUTF8String mdv addr = + let n = seekCountUtf8String mdv addr 0 + let bytes = seekReadBytes mdv addr n System.Text.Encoding.UTF8.GetString (bytes, 0, bytes.Length) -let seekReadBlob is addr = - let len, addr = seekReadCompressedUInt32 is addr - seekReadBytes is addr len +let seekReadBlob mdv addr = + let len, addr = seekReadCompressedUInt32 mdv addr + seekReadBytes mdv addr len -let seekReadUserString is addr = - let len, addr = seekReadCompressedUInt32 is addr - let bytes = seekReadBytes is addr (len - 1) - System.Text.Encoding.Unicode.GetString(bytes, 0, bytes.Length) +let seekReadUserString mdv addr = + let len, addr = seekReadCompressedUInt32 mdv addr + let bytes = seekReadBytes mdv addr (len - 1) + Encoding.Unicode.GetString(bytes, 0, bytes.Length) -let seekReadGuid is addr = seekReadBytes is addr 0x10 +let seekReadGuid mdv addr = seekReadBytes mdv addr 0x10 -let seekReadUncodedToken is addr = - i32ToUncodedToken (seekReadInt32 is addr) +let seekReadUncodedToken mdv addr = + i32ToUncodedToken (seekReadInt32 mdv addr) //--------------------------------------------------------------------- @@ -745,7 +882,6 @@ type MemberRefAsMspecIdx = MemberRefAsMspecIdx of int * int type MethodSpecAsMspecIdx = MethodSpecAsMspecIdx of int * int type MemberRefAsFspecIdx = MemberRefAsFspecIdx of int * int type CustomAttrIdx = CustomAttrIdx of CustomAttributeTypeTag * int * int32 -type SecurityDeclIdx = SecurityDeclIdx of uint16 * int32 type GenericParamsIdx = GenericParamsIdx of int * TypeOrMethodDefTag * int //--------------------------------------------------------------------- @@ -881,7 +1017,7 @@ let seekReadIndexedRows (numRows, rowReader, keyFunc, keyComparer, binaryChop, r List.rev !res -let seekReadOptionalIndexedRow (info) = +let seekReadOptionalIndexedRow info = match seekReadIndexedRows info with | [k] -> Some k | [] -> None @@ -889,7 +1025,7 @@ let seekReadOptionalIndexedRow (info) = dprintn ("multiple rows found when indexing table") Some h -let seekReadIndexedRow (info) = +let seekReadIndexedRow info = match seekReadOptionalIndexedRow info with | Some row -> row | None -> failwith ("no row found for key when indexing table") @@ -898,31 +1034,19 @@ let seekReadIndexedRow (info) = // The big fat reader. //--------------------------------------------------------------------- -type ILModuleReader = - { modul: ILModuleDef - ilAssemblyRefs: Lazy - dispose: unit -> unit } - member x.ILModuleDef = x.modul - member x.ILAssemblyRefs = x.ilAssemblyRefs.Force() - interface IDisposable with - member x.Dispose() = x.dispose() - - type MethodData = MethodData of ILType * ILCallingConv * string * ILTypes * ILType * ILTypes type VarArgMethodData = VarArgMethodData of ILType * ILCallingConv * string * ILTypes * ILVarArgs * ILType * ILTypes -[] -type ILReaderContext = - { ilg: ILGlobals - dataEndPoints: Lazy - sorted: int64 +[] +type PEReader = + { fileName: string #if FX_NO_PDB_READER pdb: obj option #else pdb: (PdbReader * (string -> ILSourceDocument)) option #endif entryPointToken: TableName * int - getNumRows: TableName -> int + pefile: BinaryFile textSegmentPhysicalLoc : int32 textSegmentPhysicalSize : int32 dataSegmentPhysicalLoc : int32 @@ -935,8 +1059,18 @@ type ILReaderContext = resourcesAddr:int32 strongnameAddr:int32 vtableFixupsAddr:int32 - is: BinaryFile - infile:string +} + +[] +type ILMetadataReader = + { ilg: ILGlobals + sorted: int64 + mdfile: BinaryFile + pectxtCaptured: PEReader option // only set when reading full PE including code etc. for static linking + entryPointToken: TableName * int + dataEndPoints: Lazy + fileName:string + getNumRows: TableName -> int userStringsStreamPhysicalLoc: int32 stringsStreamPhysicalLoc: int32 blobsStreamPhysicalLoc: int32 @@ -964,52 +1098,15 @@ type ILReaderContext = stringsBigness: bool guidsBigness: bool blobsBigness: bool - countTypeRef : int ref - countTypeDef : int ref - countField : int ref - countMethod : int ref - countParam : int ref - countInterfaceImpl : int ref - countMemberRef : int ref - countConstant : int ref - countCustomAttribute : int ref - countFieldMarshal: int ref - countPermission : int ref - countClassLayout : int ref - countFieldLayout : int ref - countStandAloneSig : int ref - countEventMap : int ref - countEvent : int ref - countPropertyMap : int ref - countProperty : int ref - countMethodSemantics : int ref - countMethodImpl : int ref - countModuleRef : int ref - countTypeSpec : int ref - countImplMap : int ref - countFieldRVA : int ref - countAssembly : int ref - countAssemblyRef : int ref - countFile : int ref - countExportedType : int ref - countManifestResource : int ref - countNested : int ref - countGenericParam : int ref - countGenericParamConstraint : int ref - countMethodSpec : int ref seekReadNestedRow : int -> int * int seekReadConstantRow : int -> uint16 * TaggedIndex * int32 seekReadMethodSemanticsRow : int -> int32 * int * TaggedIndex seekReadTypeDefRow : int -> int32 * int32 * int32 * TaggedIndex * int * int - seekReadInterfaceImplRow : int -> int * TaggedIndex - seekReadFieldMarshalRow : int -> TaggedIndex * int32 - seekReadPropertyMapRow : int -> int * int seekReadAssemblyRef : int -> ILAssemblyRef seekReadMethodSpecAsMethodData : MethodSpecAsMspecIdx -> VarArgMethodData seekReadMemberRefAsMethodData : MemberRefAsMspecIdx -> VarArgMethodData seekReadMemberRefAsFieldSpec : MemberRefAsFspecIdx -> ILFieldSpec seekReadCustomAttr : CustomAttrIdx -> ILAttribute - seekReadSecurityDecl : SecurityDeclIdx -> ILSecurityDecl seekReadTypeRef : int ->ILTypeRef seekReadTypeRefAsType : TypeRefAsTypIdx -> ILType readBlobHeapAsPropertySig : BlobAsPropSigIdx -> ILThisConvention * ILType * ILTypes @@ -1019,414 +1116,381 @@ type ILReaderContext = seekReadTypeDefAsType : TypeDefAsTypIdx -> ILType seekReadMethodDefAsMethodData : int -> MethodData seekReadGenericParams : GenericParamsIdx -> ILGenericParameterDef list - seekReadFieldDefAsFieldSpec : int -> ILFieldSpec } + seekReadFieldDefAsFieldSpec : int -> ILFieldSpec + } -let count c = -#if DEBUG - incr c -#else - c |> ignore - () -#endif - -let seekReadUInt16Adv ctxt (addr: byref) = - let res = seekReadUInt16 ctxt.is addr +let seekReadUInt16Adv mdv (addr: byref) = + let res = seekReadUInt16 mdv addr addr <- addr + 2 res -let seekReadInt32Adv ctxt (addr: byref) = - let res = seekReadInt32 ctxt.is addr +let seekReadInt32Adv mdv (addr: byref) = + let res = seekReadInt32 mdv addr addr <- addr+4 res -let seekReadUInt16AsInt32Adv ctxt (addr: byref) = - let res = seekReadUInt16AsInt32 ctxt.is addr +let seekReadUInt16AsInt32Adv mdv (addr: byref) = + let res = seekReadUInt16AsInt32 mdv addr addr <- addr+2 res -let seekReadTaggedIdx f nbits big is (addr: byref) = - let tok = if big then seekReadInt32Adv is &addr else seekReadUInt16AsInt32Adv is &addr +let seekReadTaggedIdx f nbits big mdv (addr: byref) = + let tok = if big then seekReadInt32Adv mdv &addr else seekReadUInt16AsInt32Adv mdv &addr tokToTaggedIdx f nbits tok -let seekReadIdx big ctxt (addr: byref) = - if big then seekReadInt32Adv ctxt &addr else seekReadUInt16AsInt32Adv ctxt &addr +let seekReadIdx big mdv (addr: byref) = + if big then seekReadInt32Adv mdv &addr else seekReadUInt16AsInt32Adv mdv &addr -let seekReadUntaggedIdx (tab:TableName) ctxt (addr: byref) = - seekReadIdx ctxt.tableBigness.[tab.Index] ctxt &addr +let seekReadUntaggedIdx (tab:TableName) (ctxt: ILMetadataReader) mdv (addr: byref) = + seekReadIdx ctxt.tableBigness.[tab.Index] mdv &addr -let seekReadResolutionScopeIdx ctxt (addr: byref) = seekReadTaggedIdx mkResolutionScopeTag 2 ctxt.rsBigness ctxt &addr -let seekReadTypeDefOrRefOrSpecIdx ctxt (addr: byref) = seekReadTaggedIdx mkTypeDefOrRefOrSpecTag 2 ctxt.tdorBigness ctxt &addr -let seekReadTypeOrMethodDefIdx ctxt (addr: byref) = seekReadTaggedIdx mkTypeOrMethodDefTag 1 ctxt.tomdBigness ctxt &addr -let seekReadHasConstantIdx ctxt (addr: byref) = seekReadTaggedIdx mkHasConstantTag 2 ctxt.hcBigness ctxt &addr -let seekReadHasCustomAttributeIdx ctxt (addr: byref) = seekReadTaggedIdx mkHasCustomAttributeTag 5 ctxt.hcaBigness ctxt &addr -let seekReadHasFieldMarshalIdx ctxt (addr: byref) = seekReadTaggedIdx mkHasFieldMarshalTag 1 ctxt.hfmBigness ctxt &addr -let seekReadHasDeclSecurityIdx ctxt (addr: byref) = seekReadTaggedIdx mkHasDeclSecurityTag 2 ctxt.hdsBigness ctxt &addr -let seekReadMemberRefParentIdx ctxt (addr: byref) = seekReadTaggedIdx mkMemberRefParentTag 3 ctxt.mrpBigness ctxt &addr -let seekReadHasSemanticsIdx ctxt (addr: byref) = seekReadTaggedIdx mkHasSemanticsTag 1 ctxt.hsBigness ctxt &addr -let seekReadMethodDefOrRefIdx ctxt (addr: byref) = seekReadTaggedIdx mkMethodDefOrRefTag 1 ctxt.mdorBigness ctxt &addr -let seekReadMemberForwardedIdx ctxt (addr: byref) = seekReadTaggedIdx mkMemberForwardedTag 1 ctxt.mfBigness ctxt &addr -let seekReadImplementationIdx ctxt (addr: byref) = seekReadTaggedIdx mkImplementationTag 2 ctxt.iBigness ctxt &addr -let seekReadCustomAttributeTypeIdx ctxt (addr: byref) = seekReadTaggedIdx mkILCustomAttributeTypeTag 3 ctxt.catBigness ctxt &addr -let seekReadStringIdx ctxt (addr: byref) = seekReadIdx ctxt.stringsBigness ctxt &addr -let seekReadGuidIdx ctxt (addr: byref) = seekReadIdx ctxt.guidsBigness ctxt &addr -let seekReadBlobIdx ctxt (addr: byref) = seekReadIdx ctxt.blobsBigness ctxt &addr +let seekReadResolutionScopeIdx (ctxt: ILMetadataReader) mdv (addr: byref) = seekReadTaggedIdx mkResolutionScopeTag 2 ctxt.rsBigness mdv &addr +let seekReadTypeDefOrRefOrSpecIdx (ctxt: ILMetadataReader) mdv (addr: byref) = seekReadTaggedIdx mkTypeDefOrRefOrSpecTag 2 ctxt.tdorBigness mdv &addr +let seekReadTypeOrMethodDefIdx (ctxt: ILMetadataReader) mdv (addr: byref) = seekReadTaggedIdx mkTypeOrMethodDefTag 1 ctxt.tomdBigness mdv &addr +let seekReadHasConstantIdx (ctxt: ILMetadataReader) mdv (addr: byref) = seekReadTaggedIdx mkHasConstantTag 2 ctxt.hcBigness mdv &addr +let seekReadHasCustomAttributeIdx (ctxt: ILMetadataReader) mdv (addr: byref) = seekReadTaggedIdx mkHasCustomAttributeTag 5 ctxt.hcaBigness mdv &addr +let seekReadHasFieldMarshalIdx (ctxt: ILMetadataReader) mdv (addr: byref) = seekReadTaggedIdx mkHasFieldMarshalTag 1 ctxt.hfmBigness mdv &addr +let seekReadHasDeclSecurityIdx (ctxt: ILMetadataReader) mdv (addr: byref) = seekReadTaggedIdx mkHasDeclSecurityTag 2 ctxt.hdsBigness mdv &addr +let seekReadMemberRefParentIdx (ctxt: ILMetadataReader) mdv (addr: byref) = seekReadTaggedIdx mkMemberRefParentTag 3 ctxt.mrpBigness mdv &addr +let seekReadHasSemanticsIdx (ctxt: ILMetadataReader) mdv (addr: byref) = seekReadTaggedIdx mkHasSemanticsTag 1 ctxt.hsBigness mdv &addr +let seekReadMethodDefOrRefIdx (ctxt: ILMetadataReader) mdv (addr: byref) = seekReadTaggedIdx mkMethodDefOrRefTag 1 ctxt.mdorBigness mdv &addr +let seekReadMemberForwardedIdx (ctxt: ILMetadataReader) mdv (addr: byref) = seekReadTaggedIdx mkMemberForwardedTag 1 ctxt.mfBigness mdv &addr +let seekReadImplementationIdx (ctxt: ILMetadataReader) mdv (addr: byref) = seekReadTaggedIdx mkImplementationTag 2 ctxt.iBigness mdv &addr +let seekReadCustomAttributeTypeIdx (ctxt: ILMetadataReader) mdv (addr: byref) = seekReadTaggedIdx mkILCustomAttributeTypeTag 3 ctxt.catBigness mdv &addr +let seekReadStringIdx (ctxt: ILMetadataReader) mdv (addr: byref) = seekReadIdx ctxt.stringsBigness mdv &addr +let seekReadGuidIdx (ctxt: ILMetadataReader) mdv (addr: byref) = seekReadIdx ctxt.guidsBigness mdv &addr +let seekReadBlobIdx (ctxt: ILMetadataReader) mdv (addr: byref) = seekReadIdx ctxt.blobsBigness mdv &addr -let seekReadModuleRow ctxt idx = +let seekReadModuleRow (ctxt: ILMetadataReader) mdv idx = if idx = 0 then failwith "cannot read Module table row 0" let mutable addr = ctxt.rowAddr TableNames.Module idx - let generation = seekReadUInt16Adv ctxt &addr - let nameIdx = seekReadStringIdx ctxt &addr - let mvidIdx = seekReadGuidIdx ctxt &addr - let encidIdx = seekReadGuidIdx ctxt &addr - let encbaseidIdx = seekReadGuidIdx ctxt &addr + let generation = seekReadUInt16Adv mdv &addr + let nameIdx = seekReadStringIdx ctxt mdv &addr + let mvidIdx = seekReadGuidIdx ctxt mdv &addr + let encidIdx = seekReadGuidIdx ctxt mdv &addr + let encbaseidIdx = seekReadGuidIdx ctxt mdv &addr (generation, nameIdx, mvidIdx, encidIdx, encbaseidIdx) /// Read Table ILTypeRef. -let seekReadTypeRefRow ctxt idx = - count ctxt.countTypeRef +let seekReadTypeRefRow (ctxt: ILMetadataReader) mdv idx = let mutable addr = ctxt.rowAddr TableNames.TypeRef idx - let scopeIdx = seekReadResolutionScopeIdx ctxt &addr - let nameIdx = seekReadStringIdx ctxt &addr - let namespaceIdx = seekReadStringIdx ctxt &addr + let scopeIdx = seekReadResolutionScopeIdx ctxt mdv &addr + let nameIdx = seekReadStringIdx ctxt mdv &addr + let namespaceIdx = seekReadStringIdx ctxt mdv &addr (scopeIdx, nameIdx, namespaceIdx) /// Read Table ILTypeDef. -let seekReadTypeDefRow ctxt idx = ctxt.seekReadTypeDefRow idx +let seekReadTypeDefRow (ctxt: ILMetadataReader) idx = ctxt.seekReadTypeDefRow idx let seekReadTypeDefRowUncached ctxtH idx = - let ctxt = getHole ctxtH - count ctxt.countTypeDef + let (ctxt : ILMetadataReader) = getHole ctxtH + let mdv = ctxt.mdfile.GetView() let mutable addr = ctxt.rowAddr TableNames.TypeDef idx - let flags = seekReadInt32Adv ctxt &addr - let nameIdx = seekReadStringIdx ctxt &addr - let namespaceIdx = seekReadStringIdx ctxt &addr - let extendsIdx = seekReadTypeDefOrRefOrSpecIdx ctxt &addr - let fieldsIdx = seekReadUntaggedIdx TableNames.Field ctxt &addr - let methodsIdx = seekReadUntaggedIdx TableNames.Method ctxt &addr + let flags = seekReadInt32Adv mdv &addr + let nameIdx = seekReadStringIdx ctxt mdv &addr + let namespaceIdx = seekReadStringIdx ctxt mdv &addr + let extendsIdx = seekReadTypeDefOrRefOrSpecIdx ctxt mdv &addr + let fieldsIdx = seekReadUntaggedIdx TableNames.Field ctxt mdv &addr + let methodsIdx = seekReadUntaggedIdx TableNames.Method ctxt mdv &addr (flags, nameIdx, namespaceIdx, extendsIdx, fieldsIdx, methodsIdx) /// Read Table Field. -let seekReadFieldRow ctxt idx = - count ctxt.countField +let seekReadFieldRow (ctxt: ILMetadataReader) mdv idx = let mutable addr = ctxt.rowAddr TableNames.Field idx - let flags = seekReadUInt16AsInt32Adv ctxt &addr - let nameIdx = seekReadStringIdx ctxt &addr - let typeIdx = seekReadBlobIdx ctxt &addr + let flags = seekReadUInt16AsInt32Adv mdv &addr + let nameIdx = seekReadStringIdx ctxt mdv &addr + let typeIdx = seekReadBlobIdx ctxt mdv &addr (flags, nameIdx, typeIdx) /// Read Table Method. -let seekReadMethodRow ctxt idx = - count ctxt.countMethod +let seekReadMethodRow (ctxt: ILMetadataReader) mdv idx = let mutable addr = ctxt.rowAddr TableNames.Method idx - let codeRVA = seekReadInt32Adv ctxt &addr - let implflags = seekReadUInt16AsInt32Adv ctxt &addr - let flags = seekReadUInt16AsInt32Adv ctxt &addr - let nameIdx = seekReadStringIdx ctxt &addr - let typeIdx = seekReadBlobIdx ctxt &addr - let paramIdx = seekReadUntaggedIdx TableNames.Param ctxt &addr + let codeRVA = seekReadInt32Adv mdv &addr + let implflags = seekReadUInt16AsInt32Adv mdv &addr + let flags = seekReadUInt16AsInt32Adv mdv &addr + let nameIdx = seekReadStringIdx ctxt mdv &addr + let typeIdx = seekReadBlobIdx ctxt mdv &addr + let paramIdx = seekReadUntaggedIdx TableNames.Param ctxt mdv &addr (codeRVA, implflags, flags, nameIdx, typeIdx, paramIdx) /// Read Table Param. -let seekReadParamRow ctxt idx = - count ctxt.countParam +let seekReadParamRow (ctxt: ILMetadataReader) mdv idx = let mutable addr = ctxt.rowAddr TableNames.Param idx - let flags = seekReadUInt16AsInt32Adv ctxt &addr - let seq = seekReadUInt16AsInt32Adv ctxt &addr - let nameIdx = seekReadStringIdx ctxt &addr + let flags = seekReadUInt16AsInt32Adv mdv &addr + let seq = seekReadUInt16AsInt32Adv mdv &addr + let nameIdx = seekReadStringIdx ctxt mdv &addr (flags, seq, nameIdx) /// Read Table InterfaceImpl. -let seekReadInterfaceImplRow ctxt idx = ctxt.seekReadInterfaceImplRow idx -let seekReadInterfaceImplRowUncached ctxtH idx = - let ctxt = getHole ctxtH - count ctxt.countInterfaceImpl +let seekReadInterfaceImplRow (ctxt: ILMetadataReader) mdv idx = let mutable addr = ctxt.rowAddr TableNames.InterfaceImpl idx - let tidx = seekReadUntaggedIdx TableNames.TypeDef ctxt &addr - let intfIdx = seekReadTypeDefOrRefOrSpecIdx ctxt &addr + let tidx = seekReadUntaggedIdx TableNames.TypeDef ctxt mdv &addr + let intfIdx = seekReadTypeDefOrRefOrSpecIdx ctxt mdv &addr (tidx, intfIdx) /// Read Table MemberRef. -let seekReadMemberRefRow ctxt idx = - count ctxt.countMemberRef +let seekReadMemberRefRow (ctxt: ILMetadataReader) mdv idx = let mutable addr = ctxt.rowAddr TableNames.MemberRef idx - let mrpIdx = seekReadMemberRefParentIdx ctxt &addr - let nameIdx = seekReadStringIdx ctxt &addr - let typeIdx = seekReadBlobIdx ctxt &addr + let mrpIdx = seekReadMemberRefParentIdx ctxt mdv &addr + let nameIdx = seekReadStringIdx ctxt mdv &addr + let typeIdx = seekReadBlobIdx ctxt mdv &addr (mrpIdx, nameIdx, typeIdx) /// Read Table Constant. -let seekReadConstantRow ctxt idx = ctxt.seekReadConstantRow idx +let seekReadConstantRow (ctxt: ILMetadataReader) idx = ctxt.seekReadConstantRow idx let seekReadConstantRowUncached ctxtH idx = - let ctxt = getHole ctxtH - count ctxt.countConstant + let (ctxt: ILMetadataReader) = getHole ctxtH + let mdv = ctxt.mdfile.GetView() let mutable addr = ctxt.rowAddr TableNames.Constant idx - let kind = seekReadUInt16Adv ctxt &addr - let parentIdx = seekReadHasConstantIdx ctxt &addr - let valIdx = seekReadBlobIdx ctxt &addr + let kind = seekReadUInt16Adv mdv &addr + let parentIdx = seekReadHasConstantIdx ctxt mdv &addr + let valIdx = seekReadBlobIdx ctxt mdv &addr (kind, parentIdx, valIdx) /// Read Table CustomAttribute. -let seekReadCustomAttributeRow ctxt idx = - count ctxt.countCustomAttribute +let seekReadCustomAttributeRow (ctxt: ILMetadataReader) idx = + let mdv = ctxt.mdfile.GetView() let mutable addr = ctxt.rowAddr TableNames.CustomAttribute idx - let parentIdx = seekReadHasCustomAttributeIdx ctxt &addr - let typeIdx = seekReadCustomAttributeTypeIdx ctxt &addr - let valIdx = seekReadBlobIdx ctxt &addr + let parentIdx = seekReadHasCustomAttributeIdx ctxt mdv &addr + let typeIdx = seekReadCustomAttributeTypeIdx ctxt mdv &addr + let valIdx = seekReadBlobIdx ctxt mdv &addr (parentIdx, typeIdx, valIdx) /// Read Table FieldMarshal. -let seekReadFieldMarshalRow ctxt idx = ctxt.seekReadFieldMarshalRow idx -let seekReadFieldMarshalRowUncached ctxtH idx = - let ctxt = getHole ctxtH - count ctxt.countFieldMarshal +let seekReadFieldMarshalRow (ctxt: ILMetadataReader) mdv idx = let mutable addr = ctxt.rowAddr TableNames.FieldMarshal idx - let parentIdx = seekReadHasFieldMarshalIdx ctxt &addr - let typeIdx = seekReadBlobIdx ctxt &addr + let parentIdx = seekReadHasFieldMarshalIdx ctxt mdv &addr + let typeIdx = seekReadBlobIdx ctxt mdv &addr (parentIdx, typeIdx) /// Read Table Permission. -let seekReadPermissionRow ctxt idx = - count ctxt.countPermission +let seekReadPermissionRow (ctxt: ILMetadataReader) mdv idx = let mutable addr = ctxt.rowAddr TableNames.Permission idx - let action = seekReadUInt16Adv ctxt &addr - let parentIdx = seekReadHasDeclSecurityIdx ctxt &addr - let typeIdx = seekReadBlobIdx ctxt &addr + let action = seekReadUInt16Adv mdv &addr + let parentIdx = seekReadHasDeclSecurityIdx ctxt mdv &addr + let typeIdx = seekReadBlobIdx ctxt mdv &addr (action, parentIdx, typeIdx) /// Read Table ClassLayout. -let seekReadClassLayoutRow ctxt idx = - count ctxt.countClassLayout +let seekReadClassLayoutRow (ctxt: ILMetadataReader) mdv idx = let mutable addr = ctxt.rowAddr TableNames.ClassLayout idx - let pack = seekReadUInt16Adv ctxt &addr - let size = seekReadInt32Adv ctxt &addr - let tidx = seekReadUntaggedIdx TableNames.TypeDef ctxt &addr + let pack = seekReadUInt16Adv mdv &addr + let size = seekReadInt32Adv mdv &addr + let tidx = seekReadUntaggedIdx TableNames.TypeDef ctxt mdv &addr (pack, size, tidx) /// Read Table FieldLayout. -let seekReadFieldLayoutRow ctxt idx = - count ctxt.countFieldLayout +let seekReadFieldLayoutRow (ctxt: ILMetadataReader) mdv idx = let mutable addr = ctxt.rowAddr TableNames.FieldLayout idx - let offset = seekReadInt32Adv ctxt &addr - let fidx = seekReadUntaggedIdx TableNames.Field ctxt &addr + let offset = seekReadInt32Adv mdv &addr + let fidx = seekReadUntaggedIdx TableNames.Field ctxt mdv &addr (offset, fidx) //// Read Table StandAloneSig. -let seekReadStandAloneSigRow ctxt idx = - count ctxt.countStandAloneSig +let seekReadStandAloneSigRow (ctxt: ILMetadataReader) mdv idx = let mutable addr = ctxt.rowAddr TableNames.StandAloneSig idx - let sigIdx = seekReadBlobIdx ctxt &addr + let sigIdx = seekReadBlobIdx ctxt mdv &addr sigIdx /// Read Table EventMap. -let seekReadEventMapRow ctxt idx = - count ctxt.countEventMap +let seekReadEventMapRow (ctxt: ILMetadataReader) mdv idx = let mutable addr = ctxt.rowAddr TableNames.EventMap idx - let tidx = seekReadUntaggedIdx TableNames.TypeDef ctxt &addr - let eventsIdx = seekReadUntaggedIdx TableNames.Event ctxt &addr + let tidx = seekReadUntaggedIdx TableNames.TypeDef ctxt mdv &addr + let eventsIdx = seekReadUntaggedIdx TableNames.Event ctxt mdv &addr (tidx, eventsIdx) /// Read Table Event. -let seekReadEventRow ctxt idx = - count ctxt.countEvent +let seekReadEventRow (ctxt: ILMetadataReader) mdv idx = let mutable addr = ctxt.rowAddr TableNames.Event idx - let flags = seekReadUInt16AsInt32Adv ctxt &addr - let nameIdx = seekReadStringIdx ctxt &addr - let typIdx = seekReadTypeDefOrRefOrSpecIdx ctxt &addr + let flags = seekReadUInt16AsInt32Adv mdv &addr + let nameIdx = seekReadStringIdx ctxt mdv &addr + let typIdx = seekReadTypeDefOrRefOrSpecIdx ctxt mdv &addr (flags, nameIdx, typIdx) /// Read Table PropertyMap. -let seekReadPropertyMapRow ctxt idx = ctxt.seekReadPropertyMapRow idx -let seekReadPropertyMapRowUncached ctxtH idx = - let ctxt = getHole ctxtH - count ctxt.countPropertyMap +let seekReadPropertyMapRow (ctxt: ILMetadataReader) mdv idx = let mutable addr = ctxt.rowAddr TableNames.PropertyMap idx - let tidx = seekReadUntaggedIdx TableNames.TypeDef ctxt &addr - let propsIdx = seekReadUntaggedIdx TableNames.Property ctxt &addr + let tidx = seekReadUntaggedIdx TableNames.TypeDef ctxt mdv &addr + let propsIdx = seekReadUntaggedIdx TableNames.Property ctxt mdv &addr (tidx, propsIdx) /// Read Table Property. -let seekReadPropertyRow ctxt idx = - count ctxt.countProperty +let seekReadPropertyRow (ctxt: ILMetadataReader) mdv idx = let mutable addr = ctxt.rowAddr TableNames.Property idx - let flags = seekReadUInt16AsInt32Adv ctxt &addr - let nameIdx = seekReadStringIdx ctxt &addr - let typIdx = seekReadBlobIdx ctxt &addr + let flags = seekReadUInt16AsInt32Adv mdv &addr + let nameIdx = seekReadStringIdx ctxt mdv &addr + let typIdx = seekReadBlobIdx ctxt mdv &addr (flags, nameIdx, typIdx) /// Read Table MethodSemantics. -let seekReadMethodSemanticsRow ctxt idx = ctxt.seekReadMethodSemanticsRow idx +let seekReadMethodSemanticsRow (ctxt: ILMetadataReader) idx = ctxt.seekReadMethodSemanticsRow idx let seekReadMethodSemanticsRowUncached ctxtH idx = - let ctxt = getHole ctxtH - count ctxt.countMethodSemantics + let (ctxt: ILMetadataReader) = getHole ctxtH + let mdv = ctxt.mdfile.GetView() let mutable addr = ctxt.rowAddr TableNames.MethodSemantics idx - let flags = seekReadUInt16AsInt32Adv ctxt &addr - let midx = seekReadUntaggedIdx TableNames.Method ctxt &addr - let assocIdx = seekReadHasSemanticsIdx ctxt &addr + let flags = seekReadUInt16AsInt32Adv mdv &addr + let midx = seekReadUntaggedIdx TableNames.Method ctxt mdv &addr + let assocIdx = seekReadHasSemanticsIdx ctxt mdv &addr (flags, midx, assocIdx) /// Read Table MethodImpl. -let seekReadMethodImplRow ctxt idx = - count ctxt.countMethodImpl +let seekReadMethodImplRow (ctxt: ILMetadataReader) mdv idx = let mutable addr = ctxt.rowAddr TableNames.MethodImpl idx - let tidx = seekReadUntaggedIdx TableNames.TypeDef ctxt &addr - let mbodyIdx = seekReadMethodDefOrRefIdx ctxt &addr - let mdeclIdx = seekReadMethodDefOrRefIdx ctxt &addr + let tidx = seekReadUntaggedIdx TableNames.TypeDef ctxt mdv &addr + let mbodyIdx = seekReadMethodDefOrRefIdx ctxt mdv &addr + let mdeclIdx = seekReadMethodDefOrRefIdx ctxt mdv &addr (tidx, mbodyIdx, mdeclIdx) /// Read Table ILModuleRef. -let seekReadModuleRefRow ctxt idx = - count ctxt.countModuleRef +let seekReadModuleRefRow (ctxt: ILMetadataReader) mdv idx = let mutable addr = ctxt.rowAddr TableNames.ModuleRef idx - let nameIdx = seekReadStringIdx ctxt &addr + let nameIdx = seekReadStringIdx ctxt mdv &addr nameIdx /// Read Table ILTypeSpec. -let seekReadTypeSpecRow ctxt idx = - count ctxt.countTypeSpec +let seekReadTypeSpecRow (ctxt: ILMetadataReader) mdv idx = let mutable addr = ctxt.rowAddr TableNames.TypeSpec idx - let blobIdx = seekReadBlobIdx ctxt &addr + let blobIdx = seekReadBlobIdx ctxt mdv &addr blobIdx /// Read Table ImplMap. -let seekReadImplMapRow ctxt idx = - count ctxt.countImplMap +let seekReadImplMapRow (ctxt: ILMetadataReader) mdv idx = let mutable addr = ctxt.rowAddr TableNames.ImplMap idx - let flags = seekReadUInt16AsInt32Adv ctxt &addr - let forwrdedIdx = seekReadMemberForwardedIdx ctxt &addr - let nameIdx = seekReadStringIdx ctxt &addr - let scopeIdx = seekReadUntaggedIdx TableNames.ModuleRef ctxt &addr + let flags = seekReadUInt16AsInt32Adv mdv &addr + let forwrdedIdx = seekReadMemberForwardedIdx ctxt mdv &addr + let nameIdx = seekReadStringIdx ctxt mdv &addr + let scopeIdx = seekReadUntaggedIdx TableNames.ModuleRef ctxt mdv &addr (flags, forwrdedIdx, nameIdx, scopeIdx) /// Read Table FieldRVA. -let seekReadFieldRVARow ctxt idx = - count ctxt.countFieldRVA +let seekReadFieldRVARow (ctxt: ILMetadataReader) mdv idx = let mutable addr = ctxt.rowAddr TableNames.FieldRVA idx - let rva = seekReadInt32Adv ctxt &addr - let fidx = seekReadUntaggedIdx TableNames.Field ctxt &addr + let rva = seekReadInt32Adv mdv &addr + let fidx = seekReadUntaggedIdx TableNames.Field ctxt mdv &addr (rva, fidx) /// Read Table Assembly. -let seekReadAssemblyRow ctxt idx = - count ctxt.countAssembly +let seekReadAssemblyRow (ctxt: ILMetadataReader) mdv idx = let mutable addr = ctxt.rowAddr TableNames.Assembly idx - let hash = seekReadInt32Adv ctxt &addr - let v1 = seekReadUInt16Adv ctxt &addr - let v2 = seekReadUInt16Adv ctxt &addr - let v3 = seekReadUInt16Adv ctxt &addr - let v4 = seekReadUInt16Adv ctxt &addr - let flags = seekReadInt32Adv ctxt &addr - let publicKeyIdx = seekReadBlobIdx ctxt &addr - let nameIdx = seekReadStringIdx ctxt &addr - let localeIdx = seekReadStringIdx ctxt &addr + let hash = seekReadInt32Adv mdv &addr + let v1 = seekReadUInt16Adv mdv &addr + let v2 = seekReadUInt16Adv mdv &addr + let v3 = seekReadUInt16Adv mdv &addr + let v4 = seekReadUInt16Adv mdv &addr + let flags = seekReadInt32Adv mdv &addr + let publicKeyIdx = seekReadBlobIdx ctxt mdv &addr + let nameIdx = seekReadStringIdx ctxt mdv &addr + let localeIdx = seekReadStringIdx ctxt mdv &addr (hash, v1, v2, v3, v4, flags, publicKeyIdx, nameIdx, localeIdx) /// Read Table ILAssemblyRef. -let seekReadAssemblyRefRow ctxt idx = - count ctxt.countAssemblyRef +let seekReadAssemblyRefRow (ctxt: ILMetadataReader) mdv idx = let mutable addr = ctxt.rowAddr TableNames.AssemblyRef idx - let v1 = seekReadUInt16Adv ctxt &addr - let v2 = seekReadUInt16Adv ctxt &addr - let v3 = seekReadUInt16Adv ctxt &addr - let v4 = seekReadUInt16Adv ctxt &addr - let flags = seekReadInt32Adv ctxt &addr - let publicKeyOrTokenIdx = seekReadBlobIdx ctxt &addr - let nameIdx = seekReadStringIdx ctxt &addr - let localeIdx = seekReadStringIdx ctxt &addr - let hashValueIdx = seekReadBlobIdx ctxt &addr + let v1 = seekReadUInt16Adv mdv &addr + let v2 = seekReadUInt16Adv mdv &addr + let v3 = seekReadUInt16Adv mdv &addr + let v4 = seekReadUInt16Adv mdv &addr + let flags = seekReadInt32Adv mdv &addr + let publicKeyOrTokenIdx = seekReadBlobIdx ctxt mdv &addr + let nameIdx = seekReadStringIdx ctxt mdv &addr + let localeIdx = seekReadStringIdx ctxt mdv &addr + let hashValueIdx = seekReadBlobIdx ctxt mdv &addr (v1, v2, v3, v4, flags, publicKeyOrTokenIdx, nameIdx, localeIdx, hashValueIdx) /// Read Table File. -let seekReadFileRow ctxt idx = - count ctxt.countFile +let seekReadFileRow (ctxt: ILMetadataReader) mdv idx = let mutable addr = ctxt.rowAddr TableNames.File idx - let flags = seekReadInt32Adv ctxt &addr - let nameIdx = seekReadStringIdx ctxt &addr - let hashValueIdx = seekReadBlobIdx ctxt &addr + let flags = seekReadInt32Adv mdv &addr + let nameIdx = seekReadStringIdx ctxt mdv &addr + let hashValueIdx = seekReadBlobIdx ctxt mdv &addr (flags, nameIdx, hashValueIdx) /// Read Table ILExportedTypeOrForwarder. -let seekReadExportedTypeRow ctxt idx = - count ctxt.countExportedType +let seekReadExportedTypeRow (ctxt: ILMetadataReader) mdv idx = let mutable addr = ctxt.rowAddr TableNames.ExportedType idx - let flags = seekReadInt32Adv ctxt &addr - let tok = seekReadInt32Adv ctxt &addr - let nameIdx = seekReadStringIdx ctxt &addr - let namespaceIdx = seekReadStringIdx ctxt &addr - let implIdx = seekReadImplementationIdx ctxt &addr + let flags = seekReadInt32Adv mdv &addr + let tok = seekReadInt32Adv mdv &addr + let nameIdx = seekReadStringIdx ctxt mdv &addr + let namespaceIdx = seekReadStringIdx ctxt mdv &addr + let implIdx = seekReadImplementationIdx ctxt mdv &addr (flags, tok, nameIdx, namespaceIdx, implIdx) /// Read Table ManifestResource. -let seekReadManifestResourceRow ctxt idx = - count ctxt.countManifestResource +let seekReadManifestResourceRow (ctxt: ILMetadataReader) mdv idx = let mutable addr = ctxt.rowAddr TableNames.ManifestResource idx - let offset = seekReadInt32Adv ctxt &addr - let flags = seekReadInt32Adv ctxt &addr - let nameIdx = seekReadStringIdx ctxt &addr - let implIdx = seekReadImplementationIdx ctxt &addr + let offset = seekReadInt32Adv mdv &addr + let flags = seekReadInt32Adv mdv &addr + let nameIdx = seekReadStringIdx ctxt mdv &addr + let implIdx = seekReadImplementationIdx ctxt mdv &addr (offset, flags, nameIdx, implIdx) /// Read Table Nested. -let seekReadNestedRow ctxt idx = ctxt.seekReadNestedRow idx +let seekReadNestedRow (ctxt: ILMetadataReader) idx = ctxt.seekReadNestedRow idx let seekReadNestedRowUncached ctxtH idx = - let ctxt = getHole ctxtH - count ctxt.countNested + let (ctxt: ILMetadataReader) = getHole ctxtH + let mdv = ctxt.mdfile.GetView() let mutable addr = ctxt.rowAddr TableNames.Nested idx - let nestedIdx = seekReadUntaggedIdx TableNames.TypeDef ctxt &addr - let enclIdx = seekReadUntaggedIdx TableNames.TypeDef ctxt &addr + let nestedIdx = seekReadUntaggedIdx TableNames.TypeDef ctxt mdv &addr + let enclIdx = seekReadUntaggedIdx TableNames.TypeDef ctxt mdv &addr (nestedIdx, enclIdx) /// Read Table GenericParam. -let seekReadGenericParamRow ctxt idx = - count ctxt.countGenericParam +let seekReadGenericParamRow (ctxt: ILMetadataReader) mdv idx = let mutable addr = ctxt.rowAddr TableNames.GenericParam idx - let seq = seekReadUInt16Adv ctxt &addr - let flags = seekReadUInt16Adv ctxt &addr - let ownerIdx = seekReadTypeOrMethodDefIdx ctxt &addr - let nameIdx = seekReadStringIdx ctxt &addr + let seq = seekReadUInt16Adv mdv &addr + let flags = seekReadUInt16Adv mdv &addr + let ownerIdx = seekReadTypeOrMethodDefIdx ctxt mdv &addr + let nameIdx = seekReadStringIdx ctxt mdv &addr (idx, seq, flags, ownerIdx, nameIdx) // Read Table GenericParamConstraint. -let seekReadGenericParamConstraintRow ctxt idx = - count ctxt.countGenericParamConstraint +let seekReadGenericParamConstraintRow (ctxt: ILMetadataReader) mdv idx = let mutable addr = ctxt.rowAddr TableNames.GenericParamConstraint idx - let pidx = seekReadUntaggedIdx TableNames.GenericParam ctxt &addr - let constraintIdx = seekReadTypeDefOrRefOrSpecIdx ctxt &addr + let pidx = seekReadUntaggedIdx TableNames.GenericParam ctxt mdv &addr + let constraintIdx = seekReadTypeDefOrRefOrSpecIdx ctxt mdv &addr (pidx, constraintIdx) /// Read Table ILMethodSpec. -let seekReadMethodSpecRow ctxt idx = - count ctxt.countMethodSpec +let seekReadMethodSpecRow (ctxt: ILMetadataReader) mdv idx = let mutable addr = ctxt.rowAddr TableNames.MethodSpec idx - let mdorIdx = seekReadMethodDefOrRefIdx ctxt &addr - let instIdx = seekReadBlobIdx ctxt &addr + let mdorIdx = seekReadMethodDefOrRefIdx ctxt mdv &addr + let instIdx = seekReadBlobIdx ctxt mdv &addr (mdorIdx, instIdx) let readUserStringHeapUncached ctxtH idx = - let ctxt = getHole ctxtH - seekReadUserString ctxt.is (ctxt.userStringsStreamPhysicalLoc + idx) + let (ctxt: ILMetadataReader) = getHole ctxtH + let mdv = ctxt.mdfile.GetView() + seekReadUserString mdv (ctxt.userStringsStreamPhysicalLoc + idx) -let readUserStringHeap ctxt idx = ctxt.readUserStringHeap idx +let readUserStringHeap (ctxt: ILMetadataReader) idx = ctxt.readUserStringHeap idx let readStringHeapUncached ctxtH idx = - let ctxt = getHole ctxtH - seekReadUTF8String ctxt.is (ctxt.stringsStreamPhysicalLoc + idx) -let readStringHeap ctxt idx = ctxt.readStringHeap idx -let readStringHeapOption ctxt idx = if idx = 0 then None else Some (readStringHeap ctxt idx) + let (ctxt: ILMetadataReader) = getHole ctxtH + let mdv = ctxt.mdfile.GetView() + seekReadUTF8String mdv (ctxt.stringsStreamPhysicalLoc + idx) + +let readStringHeap (ctxt: ILMetadataReader) idx = ctxt.readStringHeap idx + +let readStringHeapOption (ctxt: ILMetadataReader) idx = if idx = 0 then None else Some (readStringHeap ctxt idx) let emptyByteArray: byte[] = [||] + let readBlobHeapUncached ctxtH idx = - let ctxt = getHole ctxtH + let (ctxt: ILMetadataReader) = getHole ctxtH + let mdv = ctxt.mdfile.GetView() // valid index lies in range [1..streamSize) - // NOTE: idx cannot be 0 - Blob\String heap has first empty element that is one byte 0 + // NOTE: idx cannot be 0 - Blob\String heap has first empty element that mdv one byte 0 if idx <= 0 || idx >= ctxt.blobsStreamSize then emptyByteArray - else seekReadBlob ctxt.is (ctxt.blobsStreamPhysicalLoc + idx) -let readBlobHeap ctxt idx = ctxt.readBlobHeap idx + else seekReadBlob mdv (ctxt.blobsStreamPhysicalLoc + idx) + +let readBlobHeap (ctxt: ILMetadataReader) idx = ctxt.readBlobHeap idx + let readBlobHeapOption ctxt idx = if idx = 0 then None else Some (readBlobHeap ctxt idx) -let readGuidHeap ctxt idx = seekReadGuid ctxt.is (ctxt.guidsStreamPhysicalLoc + idx) +//let readGuidHeap ctxt idx = seekReadGuid ctxt.mdv (ctxt.guidsStreamPhysicalLoc + idx) // read a single value out of a blob heap using the given function let readBlobHeapAsBool ctxt vidx = fst (sigptrGetBool (readBlobHeap ctxt vidx) 0) @@ -1458,31 +1522,24 @@ let readBlobHeapAsDouble ctxt vidx = fst (sigptrGetDouble (readBlobHeap ctxt vid // (e) the start of the native resources attached to the binary if any // ----------------------------------------------------------------------*) -#if FX_NO_LINKEDRESOURCES -let readNativeResources _ctxt = [] -#else -let readNativeResources ctxt = - let nativeResources = - if ctxt.nativeResourcesSize = 0x0 || ctxt.nativeResourcesAddr = 0x0 then - [] - else - [ (lazy (let linkedResource = seekReadBytes ctxt.is (ctxt.anyV2P (ctxt.infile + ": native resources", ctxt.nativeResourcesAddr)) ctxt.nativeResourcesSize - unlinkResource ctxt.nativeResourcesAddr linkedResource)) ] - nativeResources -#endif +let readNativeResources (pectxt: PEReader) = + [ if pectxt.nativeResourcesSize <> 0x0 && pectxt.nativeResourcesAddr <> 0x0 then + let start = pectxt.anyV2P (pectxt.fileName + ": native resources", pectxt.nativeResourcesAddr) + yield ILNativeResource.In (pectxt.fileName, pectxt.nativeResourcesAddr, start, pectxt.nativeResourcesSize ) ] -let dataEndPoints ctxtH = +let getDataEndPointsDelayed (pectxt: PEReader) ctxtH = lazy - let ctxt = getHole ctxtH + let (ctxt: ILMetadataReader) = getHole ctxtH + let mdv = ctxt.mdfile.GetView() let dataStartPoints = let res = ref [] for i = 1 to ctxt.getNumRows (TableNames.FieldRVA) do - let rva, _fidx = seekReadFieldRVARow ctxt i + let rva, _fidx = seekReadFieldRVARow ctxt mdv i res := ("field", rva) :: !res for i = 1 to ctxt.getNumRows TableNames.ManifestResource do - let (offset, _, _, TaggedIndex(_tag, idx)) = seekReadManifestResourceRow ctxt i + let (offset, _, _, TaggedIndex(_tag, idx)) = seekReadManifestResourceRow ctxt mdv i if idx = 0 then - let rva = ctxt.resourcesAddr + offset + let rva = pectxt.resourcesAddr + offset res := ("manifest resource", rva) :: !res !res if isNil dataStartPoints then [] @@ -1490,61 +1547,64 @@ let dataEndPoints ctxtH = let methodRVAs = let res = ref [] for i = 1 to ctxt.getNumRows TableNames.Method do - let (rva, _, _, nameIdx, _, _) = seekReadMethodRow ctxt i + let (rva, _, _, nameIdx, _, _) = seekReadMethodRow ctxt mdv i if rva <> 0 then let nm = readStringHeap ctxt nameIdx res := (nm, rva) :: !res !res - ([ ctxt.textSegmentPhysicalLoc + ctxt.textSegmentPhysicalSize ; - ctxt.dataSegmentPhysicalLoc + ctxt.dataSegmentPhysicalSize ] + ([ pectxt.textSegmentPhysicalLoc + pectxt.textSegmentPhysicalSize ; + pectxt.dataSegmentPhysicalLoc + pectxt.dataSegmentPhysicalSize ] @ - (List.map ctxt.anyV2P + (List.map pectxt.anyV2P (dataStartPoints - @ [for (virtAddr, _virtSize, _physLoc) in ctxt.sectionHeaders do yield ("section start", virtAddr) done] - @ [("md", ctxt.metadataAddr)] - @ (if ctxt.nativeResourcesAddr = 0x0 then [] else [("native resources", ctxt.nativeResourcesAddr) ]) - @ (if ctxt.resourcesAddr = 0x0 then [] else [("managed resources", ctxt.resourcesAddr) ]) - @ (if ctxt.strongnameAddr = 0x0 then [] else [("managed strongname", ctxt.strongnameAddr) ]) - @ (if ctxt.vtableFixupsAddr = 0x0 then [] else [("managed vtable_fixups", ctxt.vtableFixupsAddr) ]) + @ [for (virtAddr, _virtSize, _physLoc) in pectxt.sectionHeaders do yield ("section start", virtAddr) done] + @ [("md", pectxt.metadataAddr)] + @ (if pectxt.nativeResourcesAddr = 0x0 then [] else [("native resources", pectxt.nativeResourcesAddr) ]) + @ (if pectxt.resourcesAddr = 0x0 then [] else [("managed resources", pectxt.resourcesAddr) ]) + @ (if pectxt.strongnameAddr = 0x0 then [] else [("managed strongname", pectxt.strongnameAddr) ]) + @ (if pectxt.vtableFixupsAddr = 0x0 then [] else [("managed vtable_fixups", pectxt.vtableFixupsAddr) ]) @ methodRVAs))) |> List.distinct |> List.sort -let rec rvaToData ctxt nm rva = +let rvaToData (ctxt: ILMetadataReader) (pectxt: PEReader) nm rva = if rva = 0x0 then failwith "rva is zero" - let start = ctxt.anyV2P (nm, rva) + let start = pectxt.anyV2P (nm, rva) let endPoints = (Lazy.force ctxt.dataEndPoints) let rec look l = match l with | [] -> - failwithf "find_text_data_extent: none found for infile=%s, name=%s, rva=0x%08x, start=0x%08x" ctxt.infile nm rva start + failwithf "find_text_data_extent: none found for fileName=%s, name=%s, rva=0x%08x, start=0x%08x" ctxt.fileName nm rva start | e::t -> if start < e then - (seekReadBytes ctxt.is start (e - start)) + let pev = pectxt.pefile.GetView() + seekReadBytes pev start (e - start) else look t look endPoints - //----------------------------------------------------------------------- // Read the AbsIL structure (lazily) by reading off the relevant rows. // ---------------------------------------------------------------------- -let isSorted ctxt (tab:TableName) = ((ctxt.sorted &&& (int64 1 <<< tab.Index)) <> int64 0x0) +let isSorted (ctxt: ILMetadataReader) (tab:TableName) = ((ctxt.sorted &&& (int64 1 <<< tab.Index)) <> int64 0x0) -let rec seekReadModule ctxt (subsys, subsysversion, useHighEntropyVA, ilOnly, only32, is32bitpreferred, only64, platform, isDll, alignVirt, alignPhys, imageBaseReal, ilMetadataVersion) idx = - let (_generation, nameIdx, _mvidIdx, _encidIdx, _encbaseidIdx) = seekReadModuleRow ctxt idx +// Note, pectxtEager and pevEager must not be captured by the results of this function +let rec seekReadModule (ctxt: ILMetadataReader) (pectxtEager: PEReader) pevEager peinfo ilMetadataVersion idx = + let (subsys, subsysversion, useHighEntropyVA, ilOnly, only32, is32bitpreferred, only64, platform, isDll, alignVirt, alignPhys, imageBaseReal) = peinfo + let mdv = ctxt.mdfile.GetView() + let (_generation, nameIdx, _mvidIdx, _encidIdx, _encbaseidIdx) = seekReadModuleRow ctxt mdv idx let ilModuleName = readStringHeap ctxt nameIdx - let nativeResources = readNativeResources ctxt + let nativeResources = readNativeResources pectxtEager { Manifest = - if ctxt.getNumRows (TableNames.Assembly) > 0 then Some (seekReadAssemblyManifest ctxt 1) + if ctxt.getNumRows (TableNames.Assembly) > 0 then Some (seekReadAssemblyManifest ctxt pectxtEager 1) else None CustomAttrs = seekReadCustomAttrs ctxt (TaggedIndex(hca_Module, idx)) Name = ilModuleName NativeResources=nativeResources - TypeDefs = mkILTypeDefsComputed (fun () -> seekReadTopTypeDefs ctxt ()) + TypeDefs = mkILTypeDefsComputed (fun () -> seekReadTopTypeDefs ctxt) SubSystemFlags = int32 subsys IsILOnly = ilOnly SubsystemVersion = subsysversion @@ -1559,10 +1619,11 @@ let rec seekReadModule ctxt (subsys, subsysversion, useHighEntropyVA, ilOnly, on PhysicalAlignment = alignPhys ImageBase = imageBaseReal MetadataVersion = ilMetadataVersion - Resources = seekReadManifestResources ctxt () } + Resources = seekReadManifestResources ctxt mdv pectxtEager pevEager } -and seekReadAssemblyManifest ctxt idx = - let (hash, v1, v2, v3, v4, flags, publicKeyIdx, nameIdx, localeIdx) = seekReadAssemblyRow ctxt idx +and seekReadAssemblyManifest (ctxt: ILMetadataReader) pectxt idx = + let mdview = ctxt.mdfile.GetView() + let (hash, v1, v2, v3, v4, flags, publicKeyIdx, nameIdx, localeIdx) = seekReadAssemblyRow ctxt mdview idx let name = readStringHeap ctxt nameIdx let pubkey = readBlobHeapOption ctxt publicKeyIdx { Name= name @@ -1573,25 +1634,27 @@ and seekReadAssemblyManifest ctxt idx = Locale= readStringHeapOption ctxt localeIdx CustomAttrs = seekReadCustomAttrs ctxt (TaggedIndex(hca_Assembly, idx)) AssemblyLongevity= - begin let masked = flags &&& 0x000e - if masked = 0x0000 then ILAssemblyLongevity.Unspecified - elif masked = 0x0002 then ILAssemblyLongevity.Library - elif masked = 0x0004 then ILAssemblyLongevity.PlatformAppDomain - elif masked = 0x0006 then ILAssemblyLongevity.PlatformProcess - elif masked = 0x0008 then ILAssemblyLongevity.PlatformSystem - else ILAssemblyLongevity.Unspecified - end - ExportedTypes= seekReadTopExportedTypes ctxt () - EntrypointElsewhere=(if fst ctxt.entryPointToken = TableNames.File then Some (seekReadFile ctxt (snd ctxt.entryPointToken)) else None) + let masked = flags &&& 0x000e + if masked = 0x0000 then ILAssemblyLongevity.Unspecified + elif masked = 0x0002 then ILAssemblyLongevity.Library + elif masked = 0x0004 then ILAssemblyLongevity.PlatformAppDomain + elif masked = 0x0006 then ILAssemblyLongevity.PlatformProcess + elif masked = 0x0008 then ILAssemblyLongevity.PlatformSystem + else ILAssemblyLongevity.Unspecified + ExportedTypes= seekReadTopExportedTypes ctxt + EntrypointElsewhere= + let (tab, tok) = pectxt.entryPointToken + if tab = TableNames.File then Some (seekReadFile ctxt mdview tok) else None Retargetable = 0 <> (flags &&& 0x100) DisableJitOptimizations = 0 <> (flags &&& 0x4000) JitTracking = 0 <> (flags &&& 0x8000) IgnoreSymbolStoreSequencePoints = 0 <> (flags &&& 0x2000) } -and seekReadAssemblyRef ctxt idx = ctxt.seekReadAssemblyRef idx +and seekReadAssemblyRef (ctxt: ILMetadataReader) idx = ctxt.seekReadAssemblyRef idx and seekReadAssemblyRefUncached ctxtH idx = - let ctxt = getHole ctxtH - let (v1, v2, v3, v4, flags, publicKeyOrTokenIdx, nameIdx, localeIdx, hashValueIdx) = seekReadAssemblyRefRow ctxt idx + let (ctxt: ILMetadataReader) = getHole ctxtH + let mdv = ctxt.mdfile.GetView() + let (v1, v2, v3, v4, flags, publicKeyOrTokenIdx, nameIdx, localeIdx, hashValueIdx) = seekReadAssemblyRefRow ctxt mdv idx let nm = readStringHeap ctxt nameIdx let publicKey = match readBlobHeapOption ctxt publicKeyOrTokenIdx with @@ -1606,20 +1669,16 @@ and seekReadAssemblyRefUncached ctxtH idx = version=Some(v1, v2, v3, v4), locale=readStringHeapOption ctxt localeIdx) -and seekReadModuleRef ctxt idx = - let (nameIdx) = seekReadModuleRefRow ctxt idx - ILModuleRef.Create(name = readStringHeap ctxt nameIdx, - hasMetadata=true, - hash=None) +and seekReadModuleRef (ctxt: ILMetadataReader) mdv idx = + let (nameIdx) = seekReadModuleRefRow ctxt mdv idx + ILModuleRef.Create(name = readStringHeap ctxt nameIdx, hasMetadata=true, hash=None) -and seekReadFile ctxt idx = - let (flags, nameIdx, hashValueIdx) = seekReadFileRow ctxt idx - ILModuleRef.Create(name = readStringHeap ctxt nameIdx, - hasMetadata= ((flags &&& 0x0001) = 0x0), - hash= readBlobHeapOption ctxt hashValueIdx) +and seekReadFile (ctxt: ILMetadataReader) mdv idx = + let (flags, nameIdx, hashValueIdx) = seekReadFileRow ctxt mdv idx + ILModuleRef.Create(name = readStringHeap ctxt nameIdx, hasMetadata= ((flags &&& 0x0001) = 0x0), hash= readBlobHeapOption ctxt hashValueIdx) -and seekReadClassLayout ctxt idx = - match seekReadOptionalIndexedRow (ctxt.getNumRows TableNames.ClassLayout, seekReadClassLayoutRow ctxt, (fun (_, _, tidx) -> tidx), simpleIndexCompare idx, isSorted ctxt TableNames.ClassLayout, (fun (pack, size, _) -> pack, size)) with +and seekReadClassLayout (ctxt: ILMetadataReader) mdv idx = + match seekReadOptionalIndexedRow (ctxt.getNumRows TableNames.ClassLayout, seekReadClassLayoutRow ctxt mdv, (fun (_, _, tidx) -> tidx), simpleIndexCompare idx, isSorted ctxt TableNames.ClassLayout, (fun (pack, size, _) -> pack, size)) with | None -> { Size = None; Pack = None } | Some (pack, size) -> { Size = Some size; Pack = Some pack } @@ -1634,10 +1693,10 @@ and typeAccessOfFlags flags = elif f = 0x00000005 then ILTypeDefAccess.Nested ILMemberAccess.Assembly else ILTypeDefAccess.Private -and typeLayoutOfFlags ctxt flags tidx = +and typeLayoutOfFlags (ctxt: ILMetadataReader) mdv flags tidx = let f = (flags &&& 0x00000018) - if f = 0x00000008 then ILTypeDefLayout.Sequential (seekReadClassLayout ctxt tidx) - elif f = 0x00000010 then ILTypeDefLayout.Explicit (seekReadClassLayout ctxt tidx) + if f = 0x00000008 then ILTypeDefLayout.Sequential (seekReadClassLayout ctxt mdv tidx) + elif f = 0x00000010 then ILTypeDefLayout.Explicit (seekReadClassLayout ctxt mdv tidx) else ILTypeDefLayout.Auto and isTopTypeDef flags = @@ -1662,7 +1721,7 @@ and readBlobHeapAsTypeName ctxt (nameIdx, namespaceIdx) = | None -> name | Some ns -> ctxt.memoizeString (ns+"."+name) -and seekReadTypeDefRowExtents ctxt _info (idx:int) = +and seekReadTypeDefRowExtents (ctxt: ILMetadataReader) _info (idx:int) = if idx >= ctxt.getNumRows TableNames.TypeDef then ctxt.getNumRows TableNames.Field + 1, ctxt.getNumRows TableNames.Method + 1 @@ -1683,22 +1742,23 @@ and seekReadTypeDef ctxt toponly (idx:int) = let rest = lazy - // Re-read so as not to save all these in the lazy closure - this suspension ctxt.is the largest + let mdv = ctxt.mdfile.GetView() + // Re-read so as not to save all these in the lazy closure - this suspension is the largest // heavily allocated one in all of AbsIL + let ((flags, nameIdx, namespaceIdx, extendsIdx, fieldsIdx, methodsIdx) as info) = seekReadTypeDefRow ctxt idx let nm = readBlobHeapAsTypeName ctxt (nameIdx, namespaceIdx) let cas = seekReadCustomAttrs ctxt (TaggedIndex(hca_TypeDef, idx)) - let (endFieldsIdx, endMethodsIdx) = seekReadTypeDefRowExtents ctxt info idx let typars = seekReadGenericParams ctxt 0 (tomd_TypeDef, idx) let numtypars = typars.Length let super = seekReadOptionalTypeDefOrRef ctxt numtypars AsObject extendsIdx - let layout = typeLayoutOfFlags ctxt flags idx + let layout = typeLayoutOfFlags ctxt mdv flags idx let hasLayout = (match layout with ILTypeDefLayout.Explicit _ -> true | _ -> false) let mdefs = seekReadMethods ctxt numtypars methodsIdx endMethodsIdx let fdefs = seekReadFields ctxt (numtypars, hasLayout) fieldsIdx endFieldsIdx let nested = seekReadNestedTypeDefs ctxt idx - let impls = seekReadInterfaceImpls ctxt numtypars idx + let impls = seekReadInterfaceImpls ctxt mdv numtypars idx let sdecls = seekReadSecurityDecls ctxt (TaggedIndex(hds_TypeDef, idx)) let mimpls = seekReadMethodImpls ctxt numtypars idx let props = seekReadProperties ctxt numtypars idx @@ -1719,13 +1779,13 @@ and seekReadTypeDef ctxt toponly (idx:int) = customAttrs=cas) Some (ns, n, cas, rest) -and seekReadTopTypeDefs ctxt () = +and seekReadTopTypeDefs (ctxt: ILMetadataReader) = [| for i = 1 to ctxt.getNumRows TableNames.TypeDef do match seekReadTypeDef ctxt true i with | None -> () | Some td -> yield td |] -and seekReadNestedTypeDefs ctxt tidx = +and seekReadNestedTypeDefs (ctxt: ILMetadataReader) tidx = mkILTypeDefsComputed (fun () -> let nestedIdxs = seekReadIndexedRows (ctxt.getNumRows TableNames.Nested, seekReadNestedRow ctxt, snd, simpleIndexCompare tidx, false, fst) [| for i in nestedIdxs do @@ -1733,22 +1793,23 @@ and seekReadNestedTypeDefs ctxt tidx = | None -> () | Some td -> yield td |]) -and seekReadInterfaceImpls ctxt numtypars tidx = +and seekReadInterfaceImpls (ctxt: ILMetadataReader) mdv numtypars tidx = seekReadIndexedRows (ctxt.getNumRows TableNames.InterfaceImpl, - seekReadInterfaceImplRow ctxt, - fst, - simpleIndexCompare tidx, - isSorted ctxt TableNames.InterfaceImpl, - (snd >> seekReadTypeDefOrRef ctxt numtypars AsObject (*ok*) List.empty)) + seekReadInterfaceImplRow ctxt mdv, + fst, + simpleIndexCompare tidx, + isSorted ctxt TableNames.InterfaceImpl, + (snd >> seekReadTypeDefOrRef ctxt numtypars AsObject (*ok*) List.empty)) and seekReadGenericParams ctxt numtypars (a, b) : ILGenericParameterDefs = ctxt.seekReadGenericParams (GenericParamsIdx(numtypars, a, b)) and seekReadGenericParamsUncached ctxtH (GenericParamsIdx(numtypars, a, b)) = - let ctxt = getHole ctxtH + let (ctxt: ILMetadataReader) = getHole ctxtH + let mdv = ctxt.mdfile.GetView() let pars = seekReadIndexedRows - (ctxt.getNumRows TableNames.GenericParam, seekReadGenericParamRow ctxt, + (ctxt.getNumRows TableNames.GenericParam, seekReadGenericParamRow ctxt mdv, (fun (_, _, _, tomd, _) -> tomd), tomdCompare (TaggedIndex(a, b)), isSorted ctxt TableNames.GenericParam, @@ -1760,7 +1821,7 @@ and seekReadGenericParamsUncached ctxtH (GenericParamsIdx(numtypars, a, b)) = elif variance_flags = 0x0001 then CoVariant elif variance_flags = 0x0002 then ContraVariant else NonVariant - let constraints = seekReadGenericParamConstraintsUncached ctxt numtypars gpidx + let constraints = seekReadGenericParamConstraints ctxt mdv numtypars gpidx let cas = seekReadCustomAttrs ctxt (TaggedIndex(hca_GenericParam, gpidx)) seq, {Name=readStringHeap ctxt nameIdx Constraints = constraints @@ -1771,23 +1832,23 @@ and seekReadGenericParamsUncached ctxtH (GenericParamsIdx(numtypars, a, b)) = HasDefaultConstructorConstraint=(flags &&& 0x0010) <> 0 })) pars |> List.sortBy fst |> List.map snd -and seekReadGenericParamConstraintsUncached ctxt numtypars gpidx = +and seekReadGenericParamConstraints (ctxt: ILMetadataReader) mdv numtypars gpidx = seekReadIndexedRows (ctxt.getNumRows TableNames.GenericParamConstraint, - seekReadGenericParamConstraintRow ctxt, + seekReadGenericParamConstraintRow ctxt mdv, fst, simpleIndexCompare gpidx, isSorted ctxt TableNames.GenericParamConstraint, (snd >> seekReadTypeDefOrRef ctxt numtypars AsObject (*ok*) List.empty)) -and seekReadTypeDefAsType ctxt boxity (ginst:ILTypes) idx = +and seekReadTypeDefAsType (ctxt: ILMetadataReader) boxity (ginst:ILTypes) idx = ctxt.seekReadTypeDefAsType (TypeDefAsTypIdx (boxity, ginst, idx)) and seekReadTypeDefAsTypeUncached ctxtH (TypeDefAsTypIdx (boxity, ginst, idx)) = let ctxt = getHole ctxtH mkILTy boxity (ILTypeSpec.Create(seekReadTypeDefAsTypeRef ctxt idx, ginst)) -and seekReadTypeDefAsTypeRef ctxt idx = +and seekReadTypeDefAsTypeRef (ctxt: ILMetadataReader) idx = let enc = if seekIsTopTypeDefOfIdx ctxt idx then [] else @@ -1798,63 +1859,65 @@ and seekReadTypeDefAsTypeRef ctxt idx = let nm = readBlobHeapAsTypeName ctxt (nameIdx, namespaceIdx) ILTypeRef.Create(scope=ILScopeRef.Local, enclosing=enc, name = nm ) -and seekReadTypeRef ctxt idx = ctxt.seekReadTypeRef idx +and seekReadTypeRef (ctxt: ILMetadataReader) idx = ctxt.seekReadTypeRef idx and seekReadTypeRefUncached ctxtH idx = - let ctxt = getHole ctxtH - let scopeIdx, nameIdx, namespaceIdx = seekReadTypeRefRow ctxt idx - let scope, enc = seekReadTypeRefScope ctxt scopeIdx + let (ctxt: ILMetadataReader) = getHole ctxtH + let mdv = ctxt.mdfile.GetView() + let scopeIdx, nameIdx, namespaceIdx = seekReadTypeRefRow ctxt mdv idx + let scope, enc = seekReadTypeRefScope ctxt mdv scopeIdx let nm = readBlobHeapAsTypeName ctxt (nameIdx, namespaceIdx) ILTypeRef.Create(scope=scope, enclosing=enc, name = nm) -and seekReadTypeRefAsType ctxt boxity ginst idx = ctxt.seekReadTypeRefAsType (TypeRefAsTypIdx (boxity, ginst, idx)) +and seekReadTypeRefAsType (ctxt: ILMetadataReader) boxity ginst idx = ctxt.seekReadTypeRefAsType (TypeRefAsTypIdx (boxity, ginst, idx)) and seekReadTypeRefAsTypeUncached ctxtH (TypeRefAsTypIdx (boxity, ginst, idx)) = let ctxt = getHole ctxtH mkILTy boxity (ILTypeSpec.Create(seekReadTypeRef ctxt idx, ginst)) -and seekReadTypeDefOrRef ctxt numtypars boxity (ginst:ILTypes) (TaggedIndex(tag, idx) ) = +and seekReadTypeDefOrRef (ctxt: ILMetadataReader) numtypars boxity (ginst:ILTypes) (TaggedIndex(tag, idx) ) = + let mdv = ctxt.mdfile.GetView() match tag with | tag when tag = tdor_TypeDef -> seekReadTypeDefAsType ctxt boxity ginst idx | tag when tag = tdor_TypeRef -> seekReadTypeRefAsType ctxt boxity ginst idx | tag when tag = tdor_TypeSpec -> if not (List.isEmpty ginst) then dprintn ("type spec used as type constructor for a generic instantiation: ignoring instantiation") - readBlobHeapAsType ctxt numtypars (seekReadTypeSpecRow ctxt idx) + readBlobHeapAsType ctxt numtypars (seekReadTypeSpecRow ctxt mdv idx) | _ -> failwith "seekReadTypeDefOrRef ctxt" -and seekReadTypeDefOrRefAsTypeRef ctxt (TaggedIndex(tag, idx) ) = +and seekReadTypeDefOrRefAsTypeRef (ctxt: ILMetadataReader) (TaggedIndex(tag, idx) ) = match tag with | tag when tag = tdor_TypeDef -> seekReadTypeDefAsTypeRef ctxt idx | tag when tag = tdor_TypeRef -> seekReadTypeRef ctxt idx | tag when tag = tdor_TypeSpec -> - dprintn ("type spec used where a type ref or def ctxt.is required") + dprintn ("type spec used where a type ref or def is required") ctxt.ilg.typ_Object.TypeRef | _ -> failwith "seekReadTypeDefOrRefAsTypeRef_readTypeDefOrRefOrSpec" -and seekReadMethodRefParent ctxt numtypars (TaggedIndex(tag, idx)) = +and seekReadMethodRefParent (ctxt: ILMetadataReader) mdv numtypars (TaggedIndex(tag, idx)) = match tag with - | tag when tag = mrp_TypeRef -> seekReadTypeRefAsType ctxt AsObject (* not ok - no way to tell if a member ref parent ctxt.is a value type or not *) List.empty idx - | tag when tag = mrp_ModuleRef -> mkILTypeForGlobalFunctions (ILScopeRef.Module (seekReadModuleRef ctxt idx)) + | tag when tag = mrp_TypeRef -> seekReadTypeRefAsType ctxt AsObject (* not ok - no way to tell if a member ref parent is a value type or not *) List.empty idx + | tag when tag = mrp_ModuleRef -> mkILTypeForGlobalFunctions (ILScopeRef.Module (seekReadModuleRef ctxt mdv idx)) | tag when tag = mrp_MethodDef -> let (MethodData(enclTyp, cc, nm, argtys, retty, minst)) = seekReadMethodDefAsMethodData ctxt idx let mspec = mkILMethSpecInTy (enclTyp, cc, nm, argtys, retty, minst) mspec.DeclaringType - | tag when tag = mrp_TypeSpec -> readBlobHeapAsType ctxt numtypars (seekReadTypeSpecRow ctxt idx) - | _ -> failwith "seekReadMethodRefParent ctxt" + | tag when tag = mrp_TypeSpec -> readBlobHeapAsType ctxt numtypars (seekReadTypeSpecRow ctxt mdv idx) + | _ -> failwith "seekReadMethodRefParent" -and seekReadMethodDefOrRef ctxt numtypars (TaggedIndex(tag, idx)) = +and seekReadMethodDefOrRef (ctxt: ILMetadataReader) numtypars (TaggedIndex(tag, idx)) = match tag with | tag when tag = mdor_MethodDef -> let (MethodData(enclTyp, cc, nm, argtys, retty, minst)) = seekReadMethodDefAsMethodData ctxt idx VarArgMethodData(enclTyp, cc, nm, argtys, None, retty, minst) | tag when tag = mdor_MemberRef -> seekReadMemberRefAsMethodData ctxt numtypars idx - | _ -> failwith "seekReadMethodDefOrRef ctxt" + | _ -> failwith "seekReadMethodDefOrRef" -and seekReadMethodDefOrRefNoVarargs ctxt numtypars x = +and seekReadMethodDefOrRefNoVarargs (ctxt: ILMetadataReader) numtypars x = let (VarArgMethodData(enclTyp, cc, nm, argtys, varargs, retty, minst)) = seekReadMethodDefOrRef ctxt numtypars x if varargs <> None then dprintf "ignoring sentinel and varargs in ILMethodDef token signature" MethodData(enclTyp, cc, nm, argtys, retty, minst) -and seekReadCustomAttrType ctxt (TaggedIndex(tag, idx) ) = +and seekReadCustomAttrType (ctxt: ILMetadataReader) (TaggedIndex(tag, idx) ) = match tag with | tag when tag = cat_MethodDef -> let (MethodData(enclTyp, cc, nm, argtys, retty, minst)) = seekReadMethodDefAsMethodData ctxt idx @@ -1864,31 +1927,31 @@ and seekReadCustomAttrType ctxt (TaggedIndex(tag, idx) ) = mkILMethSpecInTy (enclTyp, cc, nm, argtys, retty, minst) | _ -> failwith "seekReadCustomAttrType ctxt" -and seekReadImplAsScopeRef ctxt (TaggedIndex(tag, idx) ) = +and seekReadImplAsScopeRef (ctxt: ILMetadataReader) mdv (TaggedIndex(tag, idx) ) = if idx = 0 then ILScopeRef.Local else match tag with - | tag when tag = i_File -> ILScopeRef.Module (seekReadFile ctxt idx) + | tag when tag = i_File -> ILScopeRef.Module (seekReadFile ctxt mdv idx) | tag when tag = i_AssemblyRef -> ILScopeRef.Assembly (seekReadAssemblyRef ctxt idx) - | tag when tag = i_ExportedType -> failwith "seekReadImplAsScopeRef ctxt" - | _ -> failwith "seekReadImplAsScopeRef ctxt" + | tag when tag = i_ExportedType -> failwith "seekReadImplAsScopeRef" + | _ -> failwith "seekReadImplAsScopeRef" -and seekReadTypeRefScope ctxt (TaggedIndex(tag, idx) ) = +and seekReadTypeRefScope (ctxt: ILMetadataReader) mdv (TaggedIndex(tag, idx) ) = match tag with | tag when tag = rs_Module -> ILScopeRef.Local, [] - | tag when tag = rs_ModuleRef -> ILScopeRef.Module (seekReadModuleRef ctxt idx), [] + | tag when tag = rs_ModuleRef -> ILScopeRef.Module (seekReadModuleRef ctxt mdv idx), [] | tag when tag = rs_AssemblyRef -> ILScopeRef.Assembly (seekReadAssemblyRef ctxt idx), [] | tag when tag = rs_TypeRef -> let tref = seekReadTypeRef ctxt idx tref.Scope, (tref.Enclosing@[tref.Name]) - | _ -> failwith "seekReadTypeRefScope ctxt" + | _ -> failwith "seekReadTypeRefScope" -and seekReadOptionalTypeDefOrRef ctxt numtypars boxity idx = +and seekReadOptionalTypeDefOrRef (ctxt: ILMetadataReader) numtypars boxity idx = if idx = TaggedIndex(tdor_TypeDef, 0) then None else Some (seekReadTypeDefOrRef ctxt numtypars boxity List.empty idx) -and seekReadField ctxt (numtypars, hasLayout) (idx:int) = - let (flags, nameIdx, typeIdx) = seekReadFieldRow ctxt idx +and seekReadField ctxt mdv (numtypars, hasLayout) (idx:int) = + let (flags, nameIdx, typeIdx) = seekReadFieldRow ctxt mdv idx let nm = readStringHeap ctxt nameIdx let isStatic = (flags &&& 0x0010) <> 0 ILFieldDef(name = nm, @@ -1899,7 +1962,7 @@ and seekReadField ctxt (numtypars, hasLayout) (idx:int) = (if (flags &&& 0x1000) = 0 then None else - Some (seekReadIndexedRow (ctxt.getNumRows TableNames.FieldMarshal, seekReadFieldMarshalRow ctxt, + Some (seekReadIndexedRow (ctxt.getNumRows TableNames.FieldMarshal, seekReadFieldMarshalRow ctxt mdv, fst, hfmCompare (TaggedIndex(hfm_FieldDef, idx)), isSorted ctxt TableNames.FieldMarshal, (snd >> readBlobHeapAsNativeType ctxt)))), @@ -1907,25 +1970,30 @@ and seekReadField ctxt (numtypars, hasLayout) (idx:int) = (if (flags &&& 0x0100) = 0 then None else - let rva = seekReadIndexedRow (ctxt.getNumRows TableNames.FieldRVA, seekReadFieldRVARow ctxt, - snd, simpleIndexCompare idx, isSorted ctxt TableNames.FieldRVA, fst) - Some (rvaToData ctxt "field" rva)), + match ctxt.pectxtCaptured with + | None -> None // indicates metadata only, where Data is not available + | Some pectxt -> + let rva = seekReadIndexedRow (ctxt.getNumRows TableNames.FieldRVA, seekReadFieldRVARow ctxt mdv, + snd, simpleIndexCompare idx, isSorted ctxt TableNames.FieldRVA, fst) + Some (rvaToData ctxt pectxt "field" rva)), offset = (if hasLayout && not isStatic then - Some (seekReadIndexedRow (ctxt.getNumRows TableNames.FieldLayout, seekReadFieldLayoutRow ctxt, + Some (seekReadIndexedRow (ctxt.getNumRows TableNames.FieldLayout, seekReadFieldLayoutRow ctxt mdv, snd, simpleIndexCompare idx, isSorted ctxt TableNames.FieldLayout, fst)) else None), customAttrs=seekReadCustomAttrs ctxt (TaggedIndex(hca_FieldDef, idx) )) - -and seekReadFields ctxt (numtypars, hasLayout) fidx1 fidx2 = + +and seekReadFields (ctxt: ILMetadataReader) (numtypars, hasLayout) fidx1 fidx2 = mkILFieldsLazy (lazy + let mdv = ctxt.mdfile.GetView() [ for i = fidx1 to fidx2 - 1 do - yield seekReadField ctxt (numtypars, hasLayout) i ]) + yield seekReadField ctxt mdv (numtypars, hasLayout) i ]) -and seekReadMethods ctxt numtypars midx1 midx2 = +and seekReadMethods (ctxt: ILMetadataReader) numtypars midx1 midx2 = mkILMethodsComputed (fun () -> + let mdv = ctxt.mdfile.GetView() [| for i = midx1 to midx2 - 1 do - yield seekReadMethod ctxt numtypars i |]) + yield seekReadMethod ctxt mdv numtypars i |]) and sigptrGetTypeDefOrRefOrSpecIdx bytes sigptr = let n, sigptr = sigptrGetZInt32 bytes sigptr @@ -1934,7 +2002,7 @@ and sigptrGetTypeDefOrRefOrSpecIdx bytes sigptr = else (* Type Ref *) TaggedIndex(tdor_TypeRef, (n >>>& 2)), sigptr -and sigptrGetTy ctxt numtypars bytes sigptr = +and sigptrGetTy (ctxt: ILMetadataReader) numtypars bytes sigptr = let b0, sigptr = sigptrGetByte bytes sigptr if b0 = et_OBJECT then ctxt.ilg.typ_Object , sigptr elif b0 = et_STRING then ctxt.ilg.typ_String, sigptr @@ -2018,10 +2086,10 @@ and sigptrGetTy ctxt numtypars bytes sigptr = elif b0 = et_SENTINEL then failwith "varargs NYI" else ILType.Void , sigptr -and sigptrGetVarArgTys ctxt n numtypars bytes sigptr = +and sigptrGetVarArgTys (ctxt: ILMetadataReader) n numtypars bytes sigptr = sigptrFold (sigptrGetTy ctxt numtypars) n bytes sigptr -and sigptrGetArgTys ctxt n numtypars bytes sigptr acc = +and sigptrGetArgTys (ctxt: ILMetadataReader) n numtypars bytes sigptr acc = if n <= 0 then (List.rev acc, None), sigptr else let b0, sigptr2 = sigptrGetByte bytes sigptr @@ -2032,7 +2100,7 @@ and sigptrGetArgTys ctxt n numtypars bytes sigptr acc = let x, sigptr = sigptrGetTy ctxt numtypars bytes sigptr sigptrGetArgTys ctxt (n-1) numtypars bytes sigptr (x::acc) -and sigptrGetLocal ctxt numtypars bytes sigptr = +and sigptrGetLocal (ctxt: ILMetadataReader) numtypars bytes sigptr = let pinned, sigptr = let b0, sigptr' = sigptrGetByte bytes sigptr if b0 = et_PINNED then @@ -2043,11 +2111,11 @@ and sigptrGetLocal ctxt numtypars bytes sigptr = let loc : ILLocal = { IsPinned = pinned; Type = typ; DebugInfo = None } loc, sigptr -and readBlobHeapAsMethodSig ctxt numtypars blobIdx = +and readBlobHeapAsMethodSig (ctxt: ILMetadataReader) numtypars blobIdx = ctxt.readBlobHeapAsMethodSig (BlobAsMethodSigIdx (numtypars, blobIdx)) and readBlobHeapAsMethodSigUncached ctxtH (BlobAsMethodSigIdx (numtypars, blobIdx)) = - let ctxt = getHole ctxtH + let (ctxt: ILMetadataReader) = getHole ctxtH let bytes = readBlobHeap ctxt blobIdx let sigptr = 0 let ccByte, sigptr = sigptrGetByte bytes sigptr @@ -2055,7 +2123,7 @@ and readBlobHeapAsMethodSigUncached ctxtH (BlobAsMethodSigIdx (numtypars, blobId let genarity, sigptr = if generic then sigptrGetZInt32 bytes sigptr else 0x0, sigptr let numparams, sigptr = sigptrGetZInt32 bytes sigptr let retty, sigptr = sigptrGetTy ctxt numtypars bytes sigptr - let (argtys, varargs), _sigptr = sigptrGetArgTys ctxt ( numparams) numtypars bytes sigptr [] + let (argtys, varargs), _sigptr = sigptrGetArgTys ctxt numparams numtypars bytes sigptr [] generic, genarity, cc, retty, argtys, varargs and readBlobHeapAsType ctxt numtypars blobIdx = @@ -2076,8 +2144,9 @@ and readBlobHeapAsFieldSigUncached ctxtH (BlobAsFieldSigIdx (numtypars, blobIdx) retty -and readBlobHeapAsPropertySig ctxt numtypars blobIdx = +and readBlobHeapAsPropertySig (ctxt: ILMetadataReader) numtypars blobIdx = ctxt.readBlobHeapAsPropertySig (BlobAsPropSigIdx (numtypars, blobIdx)) + and readBlobHeapAsPropertySigUncached ctxtH (BlobAsPropSigIdx (numtypars, blobIdx)) = let ctxt = getHole ctxtH let bytes = readBlobHeap ctxt blobIdx @@ -2091,7 +2160,7 @@ and readBlobHeapAsPropertySigUncached ctxtH (BlobAsPropSigIdx (numtypars, blobId let argtys, _sigptr = sigptrFold (sigptrGetTy ctxt numtypars) ( numparams) bytes sigptr hasthis, retty, argtys -and readBlobHeapAsLocalsSig ctxt numtypars blobIdx = +and readBlobHeapAsLocalsSig (ctxt: ILMetadataReader) numtypars blobIdx = ctxt.readBlobHeapAsLocalsSig (BlobAsLocalSigIdx (numtypars, blobIdx)) and readBlobHeapAsLocalsSigUncached ctxtH (BlobAsLocalSigIdx (numtypars, blobIdx)) = @@ -2124,11 +2193,13 @@ and byteAsCallConv b = and seekReadMemberRefAsMethodData ctxt numtypars idx : VarArgMethodData = ctxt.seekReadMemberRefAsMethodData (MemberRefAsMspecIdx (numtypars, idx)) + and seekReadMemberRefAsMethodDataUncached ctxtH (MemberRefAsMspecIdx (numtypars, idx)) = - let ctxt = getHole ctxtH - let (mrpIdx, nameIdx, typeIdx) = seekReadMemberRefRow ctxt idx + let (ctxt: ILMetadataReader) = getHole ctxtH + let mdv = ctxt.mdfile.GetView() + let (mrpIdx, nameIdx, typeIdx) = seekReadMemberRefRow ctxt mdv idx let nm = readStringHeap ctxt nameIdx - let enclTyp = seekReadMethodRefParent ctxt numtypars mrpIdx + let enclTyp = seekReadMethodRefParent ctxt mdv numtypars mrpIdx let _generic, genarity, cc, retty, argtys, varargs = readBlobHeapAsMethodSig ctxt enclTyp.GenericArgs.Length typeIdx let minst = List.init genarity (fun n -> mkILTyvarTy (uint16 (numtypars+n))) (VarArgMethodData(enclTyp, cc, nm, argtys, varargs, retty, minst)) @@ -2138,11 +2209,13 @@ and seekReadMemberRefAsMethDataNoVarArgs ctxt numtypars idx : MethodData = if Option.isSome varargs then dprintf "ignoring sentinel and varargs in ILMethodDef token signature" (MethodData(enclTyp, cc, nm, argtys, retty, minst)) -and seekReadMethodSpecAsMethodData ctxt numtypars idx = +and seekReadMethodSpecAsMethodData (ctxt: ILMetadataReader) numtypars idx = ctxt.seekReadMethodSpecAsMethodData (MethodSpecAsMspecIdx (numtypars, idx)) + and seekReadMethodSpecAsMethodDataUncached ctxtH (MethodSpecAsMspecIdx (numtypars, idx)) = - let ctxt = getHole ctxtH - let (mdorIdx, instIdx) = seekReadMethodSpecRow ctxt idx + let (ctxt: ILMetadataReader) = getHole ctxtH + let mdv = ctxt.mdfile.GetView() + let (mdorIdx, instIdx) = seekReadMethodSpecRow ctxt mdv idx let (VarArgMethodData(enclTyp, cc, nm, argtys, varargs, retty, _)) = seekReadMethodDefOrRef ctxt numtypars mdorIdx let minst = let bytes = readBlobHeap ctxt instIdx @@ -2154,13 +2227,15 @@ and seekReadMethodSpecAsMethodDataUncached ctxtH (MethodSpecAsMspecIdx (numtypar argtys VarArgMethodData(enclTyp, cc, nm, argtys, varargs, retty, minst) -and seekReadMemberRefAsFieldSpec ctxt numtypars idx = +and seekReadMemberRefAsFieldSpec (ctxt: ILMetadataReader) numtypars idx = ctxt.seekReadMemberRefAsFieldSpec (MemberRefAsFspecIdx (numtypars, idx)) + and seekReadMemberRefAsFieldSpecUncached ctxtH (MemberRefAsFspecIdx (numtypars, idx)) = - let ctxt = getHole ctxtH - let (mrpIdx, nameIdx, typeIdx) = seekReadMemberRefRow ctxt idx + let (ctxt: ILMetadataReader) = getHole ctxtH + let mdv = ctxt.mdfile.GetView() + let (mrpIdx, nameIdx, typeIdx) = seekReadMemberRefRow ctxt mdv idx let nm = readStringHeap ctxt nameIdx - let enclTyp = seekReadMethodRefParent ctxt numtypars mrpIdx + let enclTyp = seekReadMethodRefParent ctxt mdv numtypars mrpIdx let retty = readBlobHeapAsFieldSig ctxt numtypars typeIdx mkILFieldSpecInTy(enclTyp, nm, retty) @@ -2172,8 +2247,10 @@ and seekReadMemberRefAsFieldSpecUncached ctxtH (MemberRefAsFspecIdx (numtypars, // method-range and field-range start/finish indexes and seekReadMethodDefAsMethodData ctxt idx = ctxt.seekReadMethodDefAsMethodData idx + and seekReadMethodDefAsMethodDataUncached ctxtH idx = - let ctxt = getHole ctxtH + let (ctxt: ILMetadataReader) = getHole ctxtH + let mdv = ctxt.mdfile.GetView() // Look for the method def parent. let tidx = seekReadIndexedRow (ctxt.getNumRows TableNames.TypeDef, @@ -2193,11 +2270,12 @@ and seekReadMethodDefAsMethodDataUncached ctxtH idx = let finst = mkILFormalGenericArgs 0 typeGenericArgs let minst = mkILFormalGenericArgs typeGenericArgsCount methodGenericArgs + // Read the method def parent. let enclTyp = seekReadTypeDefAsType ctxt AsObject (* not ok: see note *) finst tidx - // Return the constituent parts: put it together at the place where this is called. - let (_code_rva, _implflags, _flags, nameIdx, typeIdx, _paramIdx) = seekReadMethodRow ctxt idx + // Return the constituent parts: put it together at the place where this is called. + let (_code_rva, _implflags, _flags, nameIdx, typeIdx, _paramIdx) = seekReadMethodRow ctxt mdv idx let nm = readStringHeap ctxt nameIdx // Read the method def signature. @@ -2207,12 +2285,13 @@ and seekReadMethodDefAsMethodDataUncached ctxtH idx = MethodData(enclTyp, cc, nm, argtys, retty, minst) - (* Similarly for fields. *) -and seekReadFieldDefAsFieldSpec ctxt idx = +and seekReadFieldDefAsFieldSpec (ctxt: ILMetadataReader) idx = ctxt.seekReadFieldDefAsFieldSpec idx + and seekReadFieldDefAsFieldSpecUncached ctxtH idx = - let ctxt = getHole ctxtH - let (_flags, nameIdx, typeIdx) = seekReadFieldRow ctxt idx + let (ctxt: ILMetadataReader) = getHole ctxtH + let mdv = ctxt.mdfile.GetView() + let (_flags, nameIdx, typeIdx) = seekReadFieldRow ctxt mdv idx let nm = readStringHeap ctxt nameIdx (* Look for the field def parent. *) let tidx = @@ -2226,15 +2305,18 @@ and seekReadFieldDefAsFieldSpecUncached ctxtH idx = true, fst) // Read the field signature. let retty = readBlobHeapAsFieldSig ctxt 0 typeIdx + // Create a formal instantiation if needed let finst = mkILFormalGenericArgs 0 (seekReadGenericParams ctxt 0 (tomd_TypeDef, tidx)) + // Read the field def parent. let enclTyp = seekReadTypeDefAsType ctxt AsObject (* not ok: see note *) finst tidx + // Put it together. mkILFieldSpecInTy(enclTyp, nm, retty) -and seekReadMethod ctxt numtypars (idx:int) = - let (codeRVA, implflags, flags, nameIdx, typeIdx, paramIdx) = seekReadMethodRow ctxt idx +and seekReadMethod (ctxt: ILMetadataReader) mdv numtypars (idx:int) = + let (codeRVA, implflags, flags, nameIdx, typeIdx, paramIdx) = seekReadMethodRow ctxt mdv idx let nm = readStringHeap ctxt nameIdx let abstr = (flags &&& 0x0400) <> 0x0 let pinvoke = (flags &&& 0x2000) <> 0x0 @@ -2250,34 +2332,41 @@ and seekReadMethod ctxt numtypars (idx:int) = if idx >= ctxt.getNumRows TableNames.Method then ctxt.getNumRows TableNames.Param + 1 else - let (_, _, _, _, _, paramIdx) = seekReadMethodRow ctxt (idx + 1) + let (_, _, _, _, _, paramIdx) = seekReadMethodRow ctxt mdv (idx + 1) paramIdx - let ret, ilParams = seekReadParams ctxt (retty, argtys) paramIdx endParamIdx + let ret, ilParams = seekReadParams ctxt mdv (retty, argtys) paramIdx endParamIdx + + let isEntryPoint = + let (tab, tok) = ctxt.entryPointToken + (tab = TableNames.Method && tok = idx) + + let body = + if (codetype = 0x01) && pinvoke then + methBodyNative + elif pinvoke then + seekReadImplMap ctxt nm idx + elif internalcall || abstr || unmanaged || (codetype <> 0x00) then + methBodyAbstract + else + match ctxt.pectxtCaptured with + | None -> methBodyNotAvailable + | Some pectxt -> seekReadMethodRVA pectxt ctxt (idx, nm, internalcall, noinline, aggressiveinline, numtypars) codeRVA ILMethodDef(name=nm, attributes = enum(flags), implAttributes= enum(implflags), securityDecls=seekReadSecurityDecls ctxt (TaggedIndex(hds_MethodDef, idx)), - isEntryPoint= (fst ctxt.entryPointToken = TableNames.Method && snd ctxt.entryPointToken = idx), + isEntryPoint=isEntryPoint, genericParams=seekReadGenericParams ctxt numtypars (tomd_MethodDef, idx), - customAttrs=seekReadCustomAttrs ctxt (TaggedIndex(hca_MethodDef, idx)) , + customAttrs=seekReadCustomAttrs ctxt (TaggedIndex(hca_MethodDef, idx)), parameters= ilParams, callingConv=cc, ret=ret, - body= - (if (codetype = 0x01) && pinvoke then - mkMethBodyLazyAux (notlazy MethodBody.Native) - elif pinvoke then - seekReadImplMap ctxt nm idx - elif internalcall || abstr || unmanaged || (codetype <> 0x00) then - //if codeRVA <> 0x0 then dprintn "non-IL or abstract method with non-zero RVA" - mkMethBodyLazyAux (notlazy MethodBody.Abstract) - else - seekReadMethodRVA ctxt (idx, nm, internalcall, noinline, aggressiveinline, numtypars) codeRVA)) + body=body) -and seekReadParams ctxt (retty, argtys) pidx1 pidx2 = +and seekReadParams (ctxt: ILMetadataReader) mdv (retty, argtys) pidx1 pidx2 = let retRes : ILReturn ref = ref { Marshal=None; Type=retty; CustomAttrs=emptyILCustomAttrs } let paramsRes : ILParameter [] = argtys @@ -2292,15 +2381,15 @@ and seekReadParams ctxt (retty, argtys) pidx1 pidx2 = Type=ty CustomAttrs=emptyILCustomAttrs }) for i = pidx1 to pidx2 - 1 do - seekReadParamExtras ctxt (retRes, paramsRes) i + seekReadParamExtras ctxt mdv (retRes, paramsRes) i !retRes, List.ofArray paramsRes -and seekReadParamExtras ctxt (retRes, paramsRes) (idx:int) = - let (flags, seq, nameIdx) = seekReadParamRow ctxt idx +and seekReadParamExtras (ctxt: ILMetadataReader) mdv (retRes, paramsRes) (idx:int) = + let (flags, seq, nameIdx) = seekReadParamRow ctxt mdv idx let inOutMasked = (flags &&& 0x00FF) let hasMarshal = (flags &&& 0x2000) <> 0x0 let hasDefault = (flags &&& 0x1000) <> 0x0 - let fmReader idx = seekReadIndexedRow (ctxt.getNumRows TableNames.FieldMarshal, seekReadFieldMarshalRow ctxt, fst, hfmCompare idx, isSorted ctxt TableNames.FieldMarshal, (snd >> readBlobHeapAsNativeType ctxt)) + let fmReader idx = seekReadIndexedRow (ctxt.getNumRows TableNames.FieldMarshal, seekReadFieldMarshalRow ctxt mdv, fst, hfmCompare idx, isSorted ctxt TableNames.FieldMarshal, (snd >> readBlobHeapAsNativeType ctxt)) let cas = seekReadCustomAttrs ctxt (TaggedIndex(hca_ParamDef, idx)) if seq = 0 then retRes := { !retRes with @@ -2318,10 +2407,11 @@ and seekReadParamExtras ctxt (retRes, paramsRes) (idx:int) = IsOptional = ((inOutMasked &&& 0x0010) <> 0x0) CustomAttrs =cas } -and seekReadMethodImpls ctxt numtypars tidx = +and seekReadMethodImpls (ctxt: ILMetadataReader) numtypars tidx = mkILMethodImplsLazy (lazy - let mimpls = seekReadIndexedRows (ctxt.getNumRows TableNames.MethodImpl, seekReadMethodImplRow ctxt, (fun (a, _, _) -> a), simpleIndexCompare tidx, isSorted ctxt TableNames.MethodImpl, (fun (_, b, c) -> b, c)) + let mdv = ctxt.mdfile.GetView() + let mimpls = seekReadIndexedRows (ctxt.getNumRows TableNames.MethodImpl, seekReadMethodImplRow ctxt mdv, (fun (a, _, _) -> a), simpleIndexCompare tidx, isSorted ctxt TableNames.MethodImpl, (fun (_, b, c) -> b, c)) mimpls |> List.map (fun (b, c) -> { OverrideBy= let (MethodData(enclTyp, cc, nm, argtys, retty, minst)) = seekReadMethodDefOrRefNoVarargs ctxt numtypars b @@ -2331,7 +2421,7 @@ and seekReadMethodImpls ctxt numtypars tidx = let mspec = mkILMethSpecInTy (enclTyp, cc, nm, argtys, retty, minst) OverridesSpec(mspec.MethodRef, mspec.DeclaringType) })) -and seekReadMultipleMethodSemantics ctxt (flags, id) = +and seekReadMultipleMethodSemantics (ctxt: ILMetadataReader) (flags, id) = seekReadIndexedRows (ctxt.getNumRows TableNames.MethodSemantics , seekReadMethodSemanticsRow ctxt, @@ -2356,8 +2446,8 @@ and seekReadMethodSemantics ctxt id = | None -> failwith "seekReadMethodSemantics ctxt: no method found" | Some x -> x -and seekReadEvent ctxt numtypars idx = - let (flags, nameIdx, typIdx) = seekReadEventRow ctxt idx +and seekReadEvent ctxt mdv numtypars idx = + let (flags, nameIdx, typIdx) = seekReadEventRow ctxt mdv idx ILEventDef(eventType = seekReadOptionalTypeDefOrRef ctxt numtypars AsObject typIdx, name = readStringHeap ctxt nameIdx, attributes = enum(flags), @@ -2367,25 +2457,26 @@ and seekReadEvent ctxt numtypars idx = otherMethods = seekReadMultipleMethodSemantics ctxt (0x0004, TaggedIndex(hs_Event, idx)), customAttrs=seekReadCustomAttrs ctxt (TaggedIndex(hca_Event, idx))) - (* REVIEW: can substantially reduce numbers of EventMap and PropertyMap reads by first checking if the whole table is sorted according to ILTypeDef tokens and then doing a binary chop *) -and seekReadEvents ctxt numtypars tidx = + (* REVIEW: can substantially reduce numbers of EventMap and PropertyMap reads by first checking if the whole table mdv sorted according to ILTypeDef tokens and then doing a binary chop *) +and seekReadEvents (ctxt: ILMetadataReader) numtypars tidx = mkILEventsLazy (lazy - match seekReadOptionalIndexedRow (ctxt.getNumRows TableNames.EventMap, (fun i -> i, seekReadEventMapRow ctxt i), (fun (_, row) -> fst row), compare tidx, false, (fun (i, row) -> (i, snd row))) with + let mdv = ctxt.mdfile.GetView() + match seekReadOptionalIndexedRow (ctxt.getNumRows TableNames.EventMap, (fun i -> i, seekReadEventMapRow ctxt mdv i), (fun (_, row) -> fst row), compare tidx, false, (fun (i, row) -> (i, snd row))) with | None -> [] | Some (rowNum, beginEventIdx) -> let endEventIdx = if rowNum >= ctxt.getNumRows TableNames.EventMap then ctxt.getNumRows TableNames.Event + 1 else - let (_, endEventIdx) = seekReadEventMapRow ctxt (rowNum + 1) + let (_, endEventIdx) = seekReadEventMapRow ctxt mdv (rowNum + 1) endEventIdx [ for i in beginEventIdx .. endEventIdx - 1 do - yield seekReadEvent ctxt numtypars i ]) + yield seekReadEvent ctxt mdv numtypars i ]) -and seekReadProperty ctxt numtypars idx = - let (flags, nameIdx, typIdx) = seekReadPropertyRow ctxt idx +and seekReadProperty ctxt mdv numtypars idx = + let (flags, nameIdx, typIdx) = seekReadPropertyRow ctxt mdv idx let cc, retty, argtys = readBlobHeapAsPropertySig ctxt numtypars typIdx let setter= seekReadoptional_MethodSemantics ctxt (0x0001, TaggedIndex(hs_Property, idx)) let getter = seekReadoptional_MethodSemantics ctxt (0x0002, TaggedIndex(hs_Property, idx)) @@ -2408,23 +2499,24 @@ and seekReadProperty ctxt numtypars idx = args=argtys, customAttrs=seekReadCustomAttrs ctxt (TaggedIndex(hca_Property, idx))) -and seekReadProperties ctxt numtypars tidx = +and seekReadProperties (ctxt: ILMetadataReader) numtypars tidx = mkILPropertiesLazy (lazy - match seekReadOptionalIndexedRow (ctxt.getNumRows TableNames.PropertyMap, (fun i -> i, seekReadPropertyMapRow ctxt i), (fun (_, row) -> fst row), compare tidx, false, (fun (i, row) -> (i, snd row))) with + let mdv = ctxt.mdfile.GetView() + match seekReadOptionalIndexedRow (ctxt.getNumRows TableNames.PropertyMap, (fun i -> i, seekReadPropertyMapRow ctxt mdv i), (fun (_, row) -> fst row), compare tidx, false, (fun (i, row) -> (i, snd row))) with | None -> [] | Some (rowNum, beginPropIdx) -> let endPropIdx = if rowNum >= ctxt.getNumRows TableNames.PropertyMap then ctxt.getNumRows TableNames.Property + 1 else - let (_, endPropIdx) = seekReadPropertyMapRow ctxt (rowNum + 1) + let (_, endPropIdx) = seekReadPropertyMapRow ctxt mdv (rowNum + 1) endPropIdx [ for i in beginPropIdx .. endPropIdx - 1 do - yield seekReadProperty ctxt numtypars i ]) + yield seekReadProperty ctxt mdv numtypars i ]) -and seekReadCustomAttrs ctxt idx = +and seekReadCustomAttrs (ctxt: ILMetadataReader) idx = mkILComputedCustomAttrs (fun () -> seekReadIndexedRows (ctxt.getNumRows TableNames.CustomAttribute, @@ -2446,25 +2538,22 @@ and seekReadCustomAttrUncached ctxtH (CustomAttrIdx (cat, idx, valIdx)) = | None -> Bytes.ofInt32Array [| |] Elements = [] } -and seekReadSecurityDecls ctxt idx = +and seekReadSecurityDecls (ctxt: ILMetadataReader) idx = mkILLazySecurityDecls (lazy + let mdv = ctxt.mdfile.GetView() seekReadIndexedRows (ctxt.getNumRows TableNames.Permission, - seekReadPermissionRow ctxt, + seekReadPermissionRow ctxt mdv, (fun (_, par, _) -> par), hdsCompare idx, isSorted ctxt TableNames.Permission, (fun (act, _, ty) -> seekReadSecurityDecl ctxt (act, ty)))) -and seekReadSecurityDecl ctxt (a, b) = - ctxt.seekReadSecurityDecl (SecurityDeclIdx (a, b)) - -and seekReadSecurityDeclUncached ctxtH (SecurityDeclIdx (act, ty)) = - let ctxt = getHole ctxtH +and seekReadSecurityDecl ctxt (act, ty) = ILSecurityDecl ((if List.memAssoc (int act) (Lazy.force ILSecurityActionRevMap) then List.assoc (int act) (Lazy.force ILSecurityActionRevMap) else failwith "unknown security action"), - readBlobHeap ctxt ty) + readBlobHeap ctxt ty) -and seekReadConstant ctxt idx = +and seekReadConstant (ctxt: ILMetadataReader) idx = let kind, vidx = seekReadIndexedRow (ctxt.getNumRows TableNames.Constant, seekReadConstantRow ctxt, (fun (_, key, _) -> key), @@ -2489,11 +2578,12 @@ and seekReadConstant ctxt idx = | x when x = uint16 et_CLASS || x = uint16 et_OBJECT -> ILFieldInit.Null | _ -> ILFieldInit.Null -and seekReadImplMap ctxt nm midx = +and seekReadImplMap (ctxt: ILMetadataReader) nm midx = mkMethBodyLazyAux (lazy + let mdv = ctxt.mdfile.GetView() let (flags, nameIdx, scopeIdx) = seekReadIndexedRow (ctxt.getNumRows TableNames.ImplMap, - seekReadImplMapRow ctxt, + seekReadImplMapRow ctxt mdv, (fun (_, m, _, _) -> m), mfCompare (TaggedIndex(mf_MethodDef, midx)), isSorted ctxt TableNames.ImplMap, @@ -2507,6 +2597,7 @@ and seekReadImplMap ctxt nm midx = elif masked = 0x0500 then PInvokeCallingConvention.Fastcall elif masked = 0x0100 then PInvokeCallingConvention.WinApi else (dprintn "strange CallingConv"; PInvokeCallingConvention.None) + let enc = let masked = flags &&& 0x0006 if masked = 0x0000 then PInvokeCharEncoding.None @@ -2514,12 +2605,14 @@ and seekReadImplMap ctxt nm midx = elif masked = 0x0004 then PInvokeCharEncoding.Unicode elif masked = 0x0006 then PInvokeCharEncoding.Auto else (dprintn "strange CharEncoding"; PInvokeCharEncoding.None) + let bestfit = let masked = flags &&& 0x0030 if masked = 0x0000 then PInvokeCharBestFit.UseAssembly elif masked = 0x0010 then PInvokeCharBestFit.Enabled elif masked = 0x0020 then PInvokeCharBestFit.Disabled else (dprintn "strange CharBestFit"; PInvokeCharBestFit.UseAssembly) + let unmap = let masked = flags &&& 0x3000 if masked = 0x0000 then PInvokeThrowOnUnmappableChar.UseAssembly @@ -2537,9 +2630,9 @@ and seekReadImplMap ctxt nm midx = (match readStringHeapOption ctxt nameIdx with | None -> nm | Some nm2 -> nm2) - Where = seekReadModuleRef ctxt scopeIdx }) + Where = seekReadModuleRef ctxt mdv scopeIdx }) -and seekReadTopCode ctxt numtypars (sz:int) start seqpoints = +and seekReadTopCode (ctxt: ILMetadataReader) pev mdv numtypars (sz:int) start seqpoints = let labelsOfRawOffsets = new Dictionary<_, _>(sz/2) let ilOffsetsOfLabels = new Dictionary<_, _>(sz/2) let tryRawToLabel rawOffset = @@ -2567,11 +2660,11 @@ and seekReadTopCode ctxt numtypars (sz:int) start seqpoints = let lastb2 = ref 0x0 let b = ref 0x0 let get () = - lastb := seekReadByteAsInt32 ctxt.is (start + (!curr)) + lastb := seekReadByteAsInt32 pev (start + (!curr)) incr curr b := if !lastb = 0xfe && !curr < sz then - lastb2 := seekReadByteAsInt32 ctxt.is (start + (!curr)) + lastb2 := seekReadByteAsInt32 pev (start + (!curr)) incr curr !lastb2 else @@ -2611,7 +2704,7 @@ and seekReadTopCode ctxt numtypars (sz:int) start seqpoints = !b = (i_tail &&& 0xff)) do begin if !b = (i_unaligned &&& 0xff) then - let unal = seekReadByteAsInt32 ctxt.is (start + (!curr)) + let unal = seekReadByteAsInt32 pev (start + (!curr)) incr curr prefixes.al <- if unal = 0x1 then Unaligned1 @@ -2621,7 +2714,7 @@ and seekReadTopCode ctxt numtypars (sz:int) start seqpoints = elif !b = (i_volatile &&& 0xff) then prefixes.vol <- Volatile elif !b = (i_readonly &&& 0xff) then prefixes.ro <- ReadonlyAddress elif !b = (i_constrained &&& 0xff) then - let uncoded = seekReadUncodedToken ctxt.is (start + (!curr)) + let uncoded = seekReadUncodedToken pev (start + (!curr)) curr := !curr + 4 let typ = seekReadTypeDefOrRef ctxt numtypars AsObject [] (uncodedTokenToTypeDefOrRefOrSpec uncoded) prefixes.constrained <- Some typ @@ -2639,37 +2732,37 @@ and seekReadTopCode ctxt numtypars (sz:int) start seqpoints = let instr = match idecoder with | I_u16_u8_instr f -> - let x = seekReadByte ctxt.is (start + (!curr)) |> uint16 + let x = seekReadByte pev (start + (!curr)) |> uint16 curr := !curr + 1 f prefixes x | I_u16_u16_instr f -> - let x = seekReadUInt16 ctxt.is (start + (!curr)) + let x = seekReadUInt16 pev (start + (!curr)) curr := !curr + 2 f prefixes x | I_none_instr f -> f prefixes | I_i64_instr f -> - let x = seekReadInt64 ctxt.is (start + (!curr)) + let x = seekReadInt64 pev (start + (!curr)) curr := !curr + 8 f prefixes x | I_i32_i8_instr f -> - let x = seekReadSByte ctxt.is (start + (!curr)) |> int32 + let x = seekReadSByte pev (start + (!curr)) |> int32 curr := !curr + 1 f prefixes x | I_i32_i32_instr f -> - let x = seekReadInt32 ctxt.is (start + (!curr)) + let x = seekReadInt32 pev (start + (!curr)) curr := !curr + 4 f prefixes x | I_r4_instr f -> - let x = seekReadSingle ctxt.is (start + (!curr)) + let x = seekReadSingle pev (start + (!curr)) curr := !curr + 4 f prefixes x | I_r8_instr f -> - let x = seekReadDouble ctxt.is (start + (!curr)) + let x = seekReadDouble pev (start + (!curr)) curr := !curr + 8 f prefixes x | I_field_instr f -> - let (tab, tok) = seekReadUncodedToken ctxt.is (start + (!curr)) + let (tab, tok) = seekReadUncodedToken pev (start + (!curr)) curr := !curr + 4 let fspec = if tab = TableNames.Field then @@ -2681,7 +2774,7 @@ and seekReadTopCode ctxt numtypars (sz:int) start seqpoints = | I_method_instr f -> // method instruction, curr = "+string !curr - let (tab, idx) = seekReadUncodedToken ctxt.is (start + (!curr)) + let (tab, idx) = seekReadUncodedToken pev (start + (!curr)) curr := !curr + 4 let (VarArgMethodData(enclTyp, cc, nm, argtys, varargs, retty, minst)) = if tab = TableNames.Method then @@ -2703,33 +2796,33 @@ and seekReadTopCode ctxt numtypars (sz:int) start seqpoints = let mspec = mkILMethSpecInTy (enclTyp, cc, nm, argtys, retty, minst) f prefixes (mspec, varargs) | I_type_instr f -> - let uncoded = seekReadUncodedToken ctxt.is (start + (!curr)) + let uncoded = seekReadUncodedToken pev (start + (!curr)) curr := !curr + 4 let typ = seekReadTypeDefOrRef ctxt numtypars AsObject [] (uncodedTokenToTypeDefOrRefOrSpec uncoded) f prefixes typ | I_string_instr f -> - let (tab, idx) = seekReadUncodedToken ctxt.is (start + (!curr)) + let (tab, idx) = seekReadUncodedToken pev (start + (!curr)) curr := !curr + 4 if tab <> TableNames.UserStrings then dprintn "warning: bad table in user string for ldstr" f prefixes (readUserStringHeap ctxt (idx)) | I_conditional_i32_instr f -> - let offsDest = (seekReadInt32 ctxt.is (start + (!curr))) + let offsDest = (seekReadInt32 pev (start + (!curr))) curr := !curr + 4 let dest = !curr + offsDest f prefixes (rawToLabel dest) | I_conditional_i8_instr f -> - let offsDest = int (seekReadSByte ctxt.is (start + (!curr))) + let offsDest = int (seekReadSByte pev (start + (!curr))) curr := !curr + 1 let dest = !curr + offsDest f prefixes (rawToLabel dest) | I_unconditional_i32_instr f -> - let offsDest = (seekReadInt32 ctxt.is (start + (!curr))) + let offsDest = (seekReadInt32 pev (start + (!curr))) curr := !curr + 4 let dest = !curr + offsDest f prefixes (rawToLabel dest) | I_unconditional_i8_instr f -> - let offsDest = int (seekReadSByte ctxt.is (start + (!curr))) + let offsDest = int (seekReadSByte pev (start + (!curr))) curr := !curr + 1 let dest = !curr + offsDest f prefixes (rawToLabel dest) @@ -2737,7 +2830,7 @@ and seekReadTopCode ctxt numtypars (sz:int) start seqpoints = dprintn ("invalid instruction: "+string !lastb+ (if !lastb = 0xfe then ", "+string !lastb2 else "")) I_ret | I_tok_instr f -> - let (tab, idx) = seekReadUncodedToken ctxt.is (start + (!curr)) + let (tab, idx) = seekReadUncodedToken pev (start + (!curr)) curr := !curr + 4 (* REVIEW: this incorrectly labels all MemberRef tokens as ILMethod's: we should go look at the MemberRef sig to determine if it is a field or method *) let token_info = @@ -2751,18 +2844,18 @@ and seekReadTopCode ctxt numtypars (sz:int) start seqpoints = else failwith "bad token for ldtoken" f prefixes token_info | I_sig_instr f -> - let (tab, idx) = seekReadUncodedToken ctxt.is (start + (!curr)) + let (tab, idx) = seekReadUncodedToken pev (start + (!curr)) curr := !curr + 4 if tab <> TableNames.StandAloneSig then dprintn "strange table for callsig token" - let generic, _genarity, cc, retty, argtys, varargs = readBlobHeapAsMethodSig ctxt numtypars (seekReadStandAloneSigRow ctxt idx) - if generic then failwith "bad image: a generic method signature ctxt.is begin used at a calli instruction" + let generic, _genarity, cc, retty, argtys, varargs = readBlobHeapAsMethodSig ctxt numtypars (seekReadStandAloneSigRow ctxt mdv idx) + if generic then failwith "bad image: a generic method signature is begin used at a calli instruction" f prefixes (mkILCallSig (cc, argtys, retty), varargs) | I_switch_instr f -> - let n = (seekReadInt32 ctxt.is (start + (!curr))) + let n = (seekReadInt32 pev (start + (!curr))) curr := !curr + 4 let offsets = List.init n (fun _ -> - let i = (seekReadInt32 ctxt.is (start + (!curr))) + let i = (seekReadInt32 pev (start + (!curr))) curr := !curr + 4 i) let dests = List.map (fun offs -> rawToLabel (!curr + offs)) offsets @@ -2790,13 +2883,14 @@ and seekReadTopCode ctxt numtypars (sz:int) start seqpoints = instrs, rawToLabel, lab2pc, raw2nextLab #if FX_NO_PDB_READER -and seekReadMethodRVA ctxt (_idx, nm, _internalcall, noinline, aggressiveinline, numtypars) rva = +and seekReadMethodRVA (pectxt: PEReader) (ctxt: ILMetadataReader) (_idx, nm, _internalcall, noinline, aggressiveinline, numtypars) rva = #else -and seekReadMethodRVA ctxt (idx, nm, _internalcall, noinline, aggressiveinline, numtypars) rva = +and seekReadMethodRVA (pectxt: PEReader) (ctxt: ILMetadataReader) (idx, nm, _internalcall, noinline, aggressiveinline, numtypars) rva = #endif mkMethBodyLazyAux (lazy - begin + let pev = pectxt.pefile.GetView() + let mdv = ctxt.mdfile.GetView() // Read any debug information for this method into temporary data structures // -- a list of locals, marked with the raw offsets (actually closures which accept the resolution function that maps raw offsets to labels) @@ -2806,7 +2900,7 @@ and seekReadMethodRVA ctxt (idx, nm, _internalcall, noinline, aggressiveinline, #if FX_NO_PDB_READER [], None, [] #else - match ctxt.pdb with + match pectxt.pdb with | None -> [], None, [] | Some (pdbr, get_doc) -> @@ -2862,14 +2956,14 @@ and seekReadMethodRVA ctxt (idx, nm, _internalcall, noinline, aggressiveinline, [], None, [] #endif - let baseRVA = ctxt.anyV2P("method rva", rva) + let baseRVA = pectxt.anyV2P("method rva", rva) // ": reading body of method "+nm+" at rva "+string rva+", phys "+string baseRVA - let b = seekReadByte ctxt.is baseRVA + let b = seekReadByte pev baseRVA if (b &&& e_CorILMethod_FormatMask) = e_CorILMethod_TinyFormat then let codeBase = baseRVA + 1 let codeSize = (int32 b >>>& 2) // tiny format for "+nm+", code size = " + string codeSize) - let instrs, _, lab2pc, raw2nextLab = seekReadTopCode ctxt numtypars codeSize codeBase seqpoints + let instrs, _, lab2pc, raw2nextLab = seekReadTopCode ctxt pev mdv numtypars codeSize codeBase seqpoints (* Convert the linear code format to the nested code format *) let localPdbInfos2 = List.map (fun f -> f raw2nextLab) localPdbInfos let code = buildILCode nm lab2pc instrs [] localPdbInfos2 @@ -2885,20 +2979,20 @@ and seekReadMethodRVA ctxt (idx, nm, _internalcall, noinline, aggressiveinline, elif (b &&& e_CorILMethod_FormatMask) = e_CorILMethod_FatFormat then let hasMoreSections = (b &&& e_CorILMethod_MoreSects) <> 0x0uy let initlocals = (b &&& e_CorILMethod_InitLocals) <> 0x0uy - let maxstack = seekReadUInt16AsInt32 ctxt.is (baseRVA + 2) - let codeSize = seekReadInt32 ctxt.is (baseRVA + 4) - let localsTab, localToken = seekReadUncodedToken ctxt.is (baseRVA + 8) + let maxstack = seekReadUInt16AsInt32 pev (baseRVA + 2) + let codeSize = seekReadInt32 pev (baseRVA + 4) + let localsTab, localToken = seekReadUncodedToken pev (baseRVA + 8) let codeBase = baseRVA + 12 let locals = if localToken = 0x0 then [] else if localsTab <> TableNames.StandAloneSig then dprintn "strange table for locals token" - readBlobHeapAsLocalsSig ctxt numtypars (seekReadStandAloneSigRow ctxt localToken) + readBlobHeapAsLocalsSig ctxt numtypars (seekReadStandAloneSigRow ctxt pev localToken) // fat format for "+nm+", code size = " + string codeSize+", hasMoreSections = "+(if hasMoreSections then "true" else "false")+", b = "+string b) // Read the method body - let instrs, rawToLabel, lab2pc, raw2nextLab = seekReadTopCode ctxt numtypars ( codeSize) codeBase seqpoints + let instrs, rawToLabel, lab2pc, raw2nextLab = seekReadTopCode ctxt pev mdv numtypars ( codeSize) codeBase seqpoints // Read all the sections that follow the method body. // These contain the exception clauses. @@ -2907,11 +3001,11 @@ and seekReadMethodRVA ctxt (idx, nm, _internalcall, noinline, aggressiveinline, let seh = ref [] while !moreSections do let sectionBase = !nextSectionBase - let sectionFlag = seekReadByte ctxt.is sectionBase + let sectionFlag = seekReadByte pev sectionBase // fat format for "+nm+", sectionFlag = " + string sectionFlag) let sectionSize, clauses = if (sectionFlag &&& e_CorILMethod_Sect_FatFormat) <> 0x0uy then - let bigSize = (seekReadInt32 ctxt.is sectionBase) >>>& 8 + let bigSize = (seekReadInt32 pev sectionBase) >>>& 8 // bigSize = "+string bigSize) let clauses = if (sectionFlag &&& e_CorILMethod_Sect_EHTable) <> 0x0uy then @@ -2922,17 +3016,17 @@ and seekReadMethodRVA ctxt (idx, nm, _internalcall, noinline, aggressiveinline, List.init numClauses (fun i -> let clauseBase = sectionBase + 4 + (i * 24) - let kind = seekReadInt32 ctxt.is (clauseBase + 0) - let st1 = seekReadInt32 ctxt.is (clauseBase + 4) - let sz1 = seekReadInt32 ctxt.is (clauseBase + 8) - let st2 = seekReadInt32 ctxt.is (clauseBase + 12) - let sz2 = seekReadInt32 ctxt.is (clauseBase + 16) - let extra = seekReadInt32 ctxt.is (clauseBase + 20) + let kind = seekReadInt32 pev (clauseBase + 0) + let st1 = seekReadInt32 pev (clauseBase + 4) + let sz1 = seekReadInt32 pev (clauseBase + 8) + let st2 = seekReadInt32 pev (clauseBase + 12) + let sz2 = seekReadInt32 pev (clauseBase + 16) + let extra = seekReadInt32 pev (clauseBase + 20) (kind, st1, sz1, st2, sz2, extra)) else [] bigSize, clauses else - let smallSize = seekReadByteAsInt32 ctxt.is (sectionBase + 0x01) + let smallSize = seekReadByteAsInt32 pev (sectionBase + 0x01) let clauses = if (sectionFlag &&& e_CorILMethod_Sect_EHTable) <> 0x0uy then // WORKAROUND: The ECMA spec says this should be @@ -2942,13 +3036,13 @@ and seekReadMethodRVA ctxt (idx, nm, _internalcall, noinline, aggressiveinline, // dprintn (nm+" has " + string numClauses + " tiny seh clauses") List.init numClauses (fun i -> let clauseBase = sectionBase + 4 + (i * 12) - let kind = seekReadUInt16AsInt32 ctxt.is (clauseBase + 0) + let kind = seekReadUInt16AsInt32 pev (clauseBase + 0) if logging then dprintn ("One tiny SEH clause, kind = "+string kind) - let st1 = seekReadUInt16AsInt32 ctxt.is (clauseBase + 2) - let sz1 = seekReadByteAsInt32 ctxt.is (clauseBase + 4) - let st2 = seekReadUInt16AsInt32 ctxt.is (clauseBase + 5) - let sz2 = seekReadByteAsInt32 ctxt.is (clauseBase + 7) - let extra = seekReadInt32 ctxt.is (clauseBase + 8) + let st1 = seekReadUInt16AsInt32 pev (clauseBase + 2) + let sz1 = seekReadByteAsInt32 pev (clauseBase + 4) + let st2 = seekReadUInt16AsInt32 pev (clauseBase + 5) + let sz2 = seekReadByteAsInt32 pev (clauseBase + 7) + let extra = seekReadInt32 pev (clauseBase + 8) (kind, st1, sz1, st2, sz2, extra)) else [] @@ -2976,7 +3070,7 @@ and seekReadMethodRVA ctxt (idx, nm, _internalcall, noinline, aggressiveinline, elif kind = e_COR_ILEXCEPTION_CLAUSE_FAULT then ILExceptionClause.Fault(handlerStart, handlerFinish) else begin - dprintn (ctxt.infile + ": unknown exception handler kind: "+string kind) + dprintn (ctxt.fileName + ": unknown exception handler kind: "+string kind) ILExceptionClause.Finally(handlerStart, handlerFinish) end @@ -3009,16 +3103,15 @@ and seekReadMethodRVA ctxt (idx, nm, _internalcall, noinline, aggressiveinline, SourceMarker=methRangePdbInfo} else if logging then failwith "unknown format" - MethodBody.Abstract - end) + MethodBody.Abstract) -and int32AsILVariantType ctxt (n:int32) = +and int32AsILVariantType (ctxt: ILMetadataReader) (n:int32) = if List.memAssoc n (Lazy.force ILVariantTypeRevMap) then List.assoc n (Lazy.force ILVariantTypeRevMap) elif (n &&& vt_ARRAY) <> 0x0 then ILNativeVariant.Array (int32AsILVariantType ctxt (n &&& (~~~ vt_ARRAY))) elif (n &&& vt_VECTOR) <> 0x0 then ILNativeVariant.Vector (int32AsILVariantType ctxt (n &&& (~~~ vt_VECTOR))) elif (n &&& vt_BYREF) <> 0x0 then ILNativeVariant.Byref (int32AsILVariantType ctxt (n &&& (~~~ vt_BYREF))) - else (dprintn (ctxt.infile + ": int32AsILVariantType ctxt: unexpected variant type, n = "+string n) ; ILNativeVariant.Empty) + else (dprintn (ctxt.fileName + ": int32AsILVariantType ctxt: unexpected variant type, n = "+string n) ; ILNativeVariant.Empty) and readBlobHeapAsNativeType ctxt blobIdx = // reading native type blob "+string blobIdx) @@ -3093,28 +3186,32 @@ and sigptrGetILNativeType ctxt bytes sigptr = ILNativeType.Array (Some nt, Some(pnum, Some(additive))), sigptr else (ILNativeType.Empty, sigptr) -and seekReadManifestResources ctxt () = - mkILResourcesLazy - (lazy - [ for i = 1 to ctxt.getNumRows TableNames.ManifestResource do - let (offset, flags, nameIdx, implIdx) = seekReadManifestResourceRow ctxt i - let scoref = seekReadImplAsScopeRef ctxt implIdx - let datalab = +// Note, pectxtEager and pevEager must not be captured by the results of this function +// As a result, reading the resource offsets in the physical file is done eagerly to avoid holding on to any resources +and seekReadManifestResources (ctxt: ILMetadataReader) (mdv: BinaryView) (pectxtEager: PEReader) (pevEager: BinaryView) = + mkILResources + [ for i = 1 to ctxt.getNumRows TableNames.ManifestResource do + let (offset, flags, nameIdx, implIdx) = seekReadManifestResourceRow ctxt mdv i + + let scoref = seekReadImplAsScopeRef ctxt mdv implIdx + + let location = match scoref with | ILScopeRef.Local -> - let start = ctxt.anyV2P ("resource", offset + ctxt.resourcesAddr) - let len = seekReadInt32 ctxt.is start - ILResourceLocation.Local (fun () -> seekReadBytes ctxt.is (start + 4) len) + let start = pectxtEager.anyV2P ("resource", offset + pectxtEager.resourcesAddr) + let resourceLength = seekReadInt32 pevEager start + let offsetOfBytesFromStartOfPhysicalPEFile = start + 4 + ILResourceLocation.LocalIn (ctxt.fileName, offsetOfBytesFromStartOfPhysicalPEFile, resourceLength) | ILScopeRef.Module mref -> ILResourceLocation.File (mref, offset) | ILScopeRef.Assembly aref -> ILResourceLocation.Assembly aref let r = { Name= readStringHeap ctxt nameIdx - Location = datalab + Location = location Access = (if (flags &&& 0x01) <> 0x0 then ILResourceAccess.Public else ILResourceAccess.Private) CustomAttrs = seekReadCustomAttrs ctxt (TaggedIndex(hca_ManifestResource, i)) } - yield r ]) + yield r ] and seekReadNestedExportedTypes ctxt (exported: _ array) (nested: Lazy<_ array>) parentIdx = mkILNestedExportedTypesLazy @@ -3130,11 +3227,12 @@ and seekReadNestedExportedTypes ctxt (exported: _ array) (nested: Lazy<_ array>) CustomAttrs = seekReadCustomAttrs ctxt (TaggedIndex(hca_ExportedType, i)) } )) -and seekReadTopExportedTypes ctxt () = +and seekReadTopExportedTypes (ctxt: ILMetadataReader) = mkILExportedTypesLazy (lazy + let mdv = ctxt.mdfile.GetView() let numRows = ctxt.getNumRows TableNames.ExportedType - let exported = [| for i in 1..numRows -> seekReadExportedTypeRow ctxt i |] + let exported = [| for i in 1..numRows -> seekReadExportedTypeRow ctxt mdv i |] // add each nested type id to their parent's children list let nested = lazy ( @@ -3153,7 +3251,7 @@ and seekReadTopExportedTypes ctxt () = // if not a nested type if (isTopTypeDef flags) && (tag <> i_ExportedType) then yield - { ScopeRef = seekReadImplAsScopeRef ctxt implIdx + { ScopeRef = seekReadImplAsScopeRef ctxt mdv implIdx Name = readBlobHeapAsTypeName ctxt (nameIdx, namespaceIdx) Attributes = enum(flags) Nested = seekReadNestedExportedTypes ctxt exported nested i @@ -3161,12 +3259,12 @@ and seekReadTopExportedTypes ctxt () = ]) #if !FX_NO_PDB_READER -let getPdbReader opts infile = - match opts.pdbPath with +let getPdbReader pdbPath fileName = + match pdbPath with | None -> None | Some pdbpath -> try - let pdbr = pdbReadOpen infile pdbpath + let pdbr = pdbReadOpen fileName pdbpath let pdbdocs = pdbReaderGetDocuments pdbr let tab = new Dictionary<_, _>(Array.length pdbdocs) @@ -3183,215 +3281,34 @@ let getPdbReader opts infile = with e -> dprintn ("* Warning: PDB file could not be read and will be ignored: "+e.Message); None #endif -//----------------------------------------------------------------------- -// Crack the binary headers, build a reader context and return the lazy -// read of the AbsIL module. -// ---------------------------------------------------------------------- - -let rec genOpenBinaryReader infile is opts = - - (* MSDOS HEADER *) - let peSignaturePhysLoc = seekReadInt32 is 0x3c - - (* PE HEADER *) - let peFileHeaderPhysLoc = peSignaturePhysLoc + 0x04 - let peOptionalHeaderPhysLoc = peFileHeaderPhysLoc + 0x14 - let peSignature = seekReadInt32 is (peSignaturePhysLoc + 0) - if peSignature <> 0x4550 then failwithf "not a PE file - bad magic PE number 0x%08x, is = %A" peSignature is - - - (* PE SIGNATURE *) - let machine = seekReadUInt16AsInt32 is (peFileHeaderPhysLoc + 0) - let numSections = seekReadUInt16AsInt32 is (peFileHeaderPhysLoc + 2) - let optHeaderSize = seekReadUInt16AsInt32 is (peFileHeaderPhysLoc + 16) - if optHeaderSize <> 0xe0 && - optHeaderSize <> 0xf0 then failwith "not a PE file - bad optional header size" - let x64adjust = optHeaderSize - 0xe0 - let only64 = (optHeaderSize = 0xf0) (* May want to read in the optional header Magic number and check that as well... *) - let platform = match machine with | 0x8664 -> Some(AMD64) | 0x200 -> Some(IA64) | _ -> Some(X86) - let sectionHeadersStartPhysLoc = peOptionalHeaderPhysLoc + optHeaderSize - - let flags = seekReadUInt16AsInt32 is (peFileHeaderPhysLoc + 18) - let isDll = (flags &&& 0x2000) <> 0x0 - - (* OPTIONAL PE HEADER *) - let _textPhysSize = seekReadInt32 is (peOptionalHeaderPhysLoc + 4) (* Size of the code (text) section, or the sum of all code sections if there are multiple sections. *) - (* x86: 000000a0 *) - let _initdataPhysSize = seekReadInt32 is (peOptionalHeaderPhysLoc + 8) (* Size of the initialized data section, or the sum of all such sections if there are multiple data sections. *) - let _uninitdataPhysSize = seekReadInt32 is (peOptionalHeaderPhysLoc + 12) (* Size of the uninitialized data section, or the sum of all such sections if there are multiple data sections. *) - let _entrypointAddr = seekReadInt32 is (peOptionalHeaderPhysLoc + 16) (* RVA of entry point , needs to point to bytes 0xFF 0x25 followed by the RVA+!0x4000000 in a section marked execute/read for EXEs or 0 for DLLs e.g. 0x0000b57e *) - let _textAddr = seekReadInt32 is (peOptionalHeaderPhysLoc + 20) (* e.g. 0x0002000 *) - (* x86: 000000b0 *) - let dataSegmentAddr = seekReadInt32 is (peOptionalHeaderPhysLoc + 24) (* e.g. 0x0000c000 *) - (* REVIEW: For now, we'll use the DWORD at offset 24 for x64. This currently ok since fsc doesn't support true 64-bit image bases, - but we'll have to fix this up when such support is added. *) - let imageBaseReal = if only64 then dataSegmentAddr else seekReadInt32 is (peOptionalHeaderPhysLoc + 28) (* Image Base Always 0x400000 (see Section 23.1). - QUERY : no it's not always 0x400000, e.g. 0x034f0000 *) - let alignVirt = seekReadInt32 is (peOptionalHeaderPhysLoc + 32) (* Section Alignment Always 0x2000 (see Section 23.1). *) - let alignPhys = seekReadInt32 is (peOptionalHeaderPhysLoc + 36) (* File Alignment Either 0x200 or 0x1000. *) - (* x86: 000000c0 *) - let _osMajor = seekReadUInt16 is (peOptionalHeaderPhysLoc + 40) (* OS Major Always 4 (see Section 23.1). *) - let _osMinor = seekReadUInt16 is (peOptionalHeaderPhysLoc + 42) (* OS Minor Always 0 (see Section 23.1). *) - let _userMajor = seekReadUInt16 is (peOptionalHeaderPhysLoc + 44) (* User Major Always 0 (see Section 23.1). *) - let _userMinor = seekReadUInt16 is (peOptionalHeaderPhysLoc + 46) (* User Minor Always 0 (see Section 23.1). *) - let subsysMajor = seekReadUInt16AsInt32 is (peOptionalHeaderPhysLoc + 48) (* SubSys Major Always 4 (see Section 23.1). *) - let subsysMinor = seekReadUInt16AsInt32 is (peOptionalHeaderPhysLoc + 50) (* SubSys Minor Always 0 (see Section 23.1). *) - (* x86: 000000d0 *) - let _imageEndAddr = seekReadInt32 is (peOptionalHeaderPhysLoc + 56) (* Image Size: Size, in bytes, of image, including all headers and padding; shall be a multiple of Section Alignment. e.g. 0x0000e000 *) - let _headerPhysSize = seekReadInt32 is (peOptionalHeaderPhysLoc + 60) (* Header Size Combined size of MS-DOS Header, PE Header, PE Optional Header and padding; shall be a multiple of the file alignment. *) - let subsys = seekReadUInt16 is (peOptionalHeaderPhysLoc + 68) (* SubSystem Subsystem required to run this image. Shall be either IMAGE_SUBSYSTEM_WINDOWS_CE_GUI (!0x3) or IMAGE_SUBSYSTEM_WINDOWS_GUI (!0x2). QUERY: Why is this 3 on the images ILASM produces??? *) - let useHighEnthropyVA = - let n = seekReadUInt16 is (peOptionalHeaderPhysLoc + 70) - let highEnthropyVA = 0x20us - (n &&& highEnthropyVA) = highEnthropyVA - - (* x86: 000000e0 *) - - (* WARNING: THESE ARE 64 bit ON x64/ia64 *) - (* REVIEW: If we ever decide that we need these values for x64, we'll have to read them in as 64bit and fix up the rest of the offsets. - Then again, it should suffice to just use the defaults, and still not bother... *) - (* let stackReserve = seekReadInt32 is (peOptionalHeaderPhysLoc + 72) in *) (* Stack Reserve Size Always 0x100000 (1Mb) (see Section 23.1). *) - (* let stackCommit = seekReadInt32 is (peOptionalHeaderPhysLoc + 76) in *) (* Stack Commit Size Always 0x1000 (4Kb) (see Section 23.1). *) - (* let heapReserve = seekReadInt32 is (peOptionalHeaderPhysLoc + 80) in *) (* Heap Reserve Size Always 0x100000 (1Mb) (see Section 23.1). *) - (* let heapCommit = seekReadInt32 is (peOptionalHeaderPhysLoc + 84) in *) (* Heap Commit Size Always 0x1000 (4Kb) (see Section 23.1). *) - - (* x86: 000000f0, x64: 00000100 *) - let _numDataDirectories = seekReadInt32 is (peOptionalHeaderPhysLoc + 92 + x64adjust) (* Number of Data Directories: Always 0x10 (see Section 23.1). *) - (* 00000100 - these addresses are for x86 - for the x64 location, add x64adjust (0x10) *) - let _importTableAddr = seekReadInt32 is (peOptionalHeaderPhysLoc + 104 + x64adjust) (* Import Table RVA of Import Table, (see clause 24.3.1). e.g. 0000b530 *) - let _importTableSize = seekReadInt32 is (peOptionalHeaderPhysLoc + 108 + x64adjust) (* Size of Import Table, (see clause 24.3.1). *) - let nativeResourcesAddr = seekReadInt32 is (peOptionalHeaderPhysLoc + 112 + x64adjust) - let nativeResourcesSize = seekReadInt32 is (peOptionalHeaderPhysLoc + 116 + x64adjust) - (* 00000110 *) - (* 00000120 *) - (* let base_relocTableNames.addr = seekReadInt32 is (peOptionalHeaderPhysLoc + 136) - let base_relocTableNames.size = seekReadInt32 is (peOptionalHeaderPhysLoc + 140) in *) - (* 00000130 *) - (* 00000140 *) - (* 00000150 *) - let _importAddrTableAddr = seekReadInt32 is (peOptionalHeaderPhysLoc + 192 + x64adjust) (* RVA of Import Addr Table, (see clause 24.3.1). e.g. 0x00002000 *) - let _importAddrTableSize = seekReadInt32 is (peOptionalHeaderPhysLoc + 196 + x64adjust) (* Size of Import Addr Table, (see clause 24.3.1). e.g. 0x00002000 *) - (* 00000160 *) - let cliHeaderAddr = seekReadInt32 is (peOptionalHeaderPhysLoc + 208 + x64adjust) - let _cliHeaderSize = seekReadInt32 is (peOptionalHeaderPhysLoc + 212 + x64adjust) - (* 00000170 *) - - - (* Crack section headers *) - - let sectionHeaders = - [ for i in 0 .. numSections-1 do - let pos = sectionHeadersStartPhysLoc + i * 0x28 - let virtSize = seekReadInt32 is (pos + 8) - let virtAddr = seekReadInt32 is (pos + 12) - let physLoc = seekReadInt32 is (pos + 20) - yield (virtAddr, virtSize, physLoc) ] - - let findSectionHeader addr = - let rec look i pos = - if i >= numSections then 0x0 - else - let virtSize = seekReadInt32 is (pos + 8) - let virtAddr = seekReadInt32 is (pos + 12) - if (addr >= virtAddr && addr < virtAddr + virtSize) then pos - else look (i+1) (pos + 0x28) - look 0 sectionHeadersStartPhysLoc - - let textHeaderStart = findSectionHeader cliHeaderAddr - let dataHeaderStart = findSectionHeader dataSegmentAddr - (* let relocHeaderStart = findSectionHeader base_relocTableNames.addr in *) - - let _textSize = if textHeaderStart = 0x0 then 0x0 else seekReadInt32 is (textHeaderStart + 8) - let _textAddr = if textHeaderStart = 0x0 then 0x0 else seekReadInt32 is (textHeaderStart + 12) - let textSegmentPhysicalSize = if textHeaderStart = 0x0 then 0x0 else seekReadInt32 is (textHeaderStart + 16) - let textSegmentPhysicalLoc = if textHeaderStart = 0x0 then 0x0 else seekReadInt32 is (textHeaderStart + 20) - - if logging then dprintn (infile + ": textHeaderStart = "+string textHeaderStart) - if logging then dprintn (infile + ": dataHeaderStart = "+string dataHeaderStart) - if logging then dprintn (infile + ": dataSegmentAddr (pre section crack) = "+string dataSegmentAddr) - - let dataSegmentSize = if dataHeaderStart = 0x0 then 0x0 else seekReadInt32 is (dataHeaderStart + 8) - let dataSegmentAddr = if dataHeaderStart = 0x0 then 0x0 else seekReadInt32 is (dataHeaderStart + 12) - let dataSegmentPhysicalSize = if dataHeaderStart = 0x0 then 0x0 else seekReadInt32 is (dataHeaderStart + 16) - let dataSegmentPhysicalLoc = if dataHeaderStart = 0x0 then 0x0 else seekReadInt32 is (dataHeaderStart + 20) - - if logging then dprintn (infile + ": dataSegmentAddr (post section crack) = "+string dataSegmentAddr) - - let anyV2P (n, v) = - let rec look i pos = - if i >= numSections then (failwith (infile + ": bad "+n+", rva "+string v); 0x0) - else - let virtSize = seekReadInt32 is (pos + 8) - let virtAddr = seekReadInt32 is (pos + 12) - let physLoc = seekReadInt32 is (pos + 20) - if (v >= virtAddr && (v < virtAddr + virtSize)) then (v - virtAddr) + physLoc - else look (i+1) (pos + 0x28) - look 0 sectionHeadersStartPhysLoc - - if logging then dprintn (infile + ": numSections = "+string numSections) - if logging then dprintn (infile + ": cliHeaderAddr = "+string cliHeaderAddr) - if logging then dprintn (infile + ": cliHeaderPhys = "+string (anyV2P ("cli header", cliHeaderAddr))) - if logging then dprintn (infile + ": dataSegmentSize = "+string dataSegmentSize) - if logging then dprintn (infile + ": dataSegmentAddr = "+string dataSegmentAddr) - - let cliHeaderPhysLoc = anyV2P ("cli header", cliHeaderAddr) - - let _majorRuntimeVersion = seekReadUInt16 is (cliHeaderPhysLoc + 4) - let _minorRuntimeVersion = seekReadUInt16 is (cliHeaderPhysLoc + 6) - let metadataAddr = seekReadInt32 is (cliHeaderPhysLoc + 8) - let _metadataSegmentSize = seekReadInt32 is (cliHeaderPhysLoc + 12) - let cliFlags = seekReadInt32 is (cliHeaderPhysLoc + 16) - - let ilOnly = (cliFlags &&& 0x01) <> 0x00 - let only32 = (cliFlags &&& 0x02) <> 0x00 - let is32bitpreferred = (cliFlags &&& 0x00020003) <> 0x00 - let _strongnameSigned = (cliFlags &&& 0x08) <> 0x00 - let _trackdebugdata = (cliFlags &&& 0x010000) <> 0x00 - - let entryPointToken = seekReadUncodedToken is (cliHeaderPhysLoc + 20) - let resourcesAddr = seekReadInt32 is (cliHeaderPhysLoc + 24) - let resourcesSize = seekReadInt32 is (cliHeaderPhysLoc + 28) - let strongnameAddr = seekReadInt32 is (cliHeaderPhysLoc + 32) - let _strongnameSize = seekReadInt32 is (cliHeaderPhysLoc + 36) - let vtableFixupsAddr = seekReadInt32 is (cliHeaderPhysLoc + 40) - let _vtableFixupsSize = seekReadInt32 is (cliHeaderPhysLoc + 44) - - if logging then dprintn (infile + ": metadataAddr = "+string metadataAddr) - if logging then dprintn (infile + ": resourcesAddr = "+string resourcesAddr) - if logging then dprintn (infile + ": resourcesSize = "+string resourcesSize) - if logging then dprintn (infile + ": nativeResourcesAddr = "+string nativeResourcesAddr) - if logging then dprintn (infile + ": nativeResourcesSize = "+string nativeResourcesSize) - - let metadataPhysLoc = anyV2P ("metadata", metadataAddr) - let magic = seekReadUInt16AsInt32 is metadataPhysLoc - if magic <> 0x5342 then failwith (infile + ": bad metadata magic number: " + string magic) - let magic2 = seekReadUInt16AsInt32 is (metadataPhysLoc + 2) +// Note, pectxtEager and pevEager must not be captured by the results of this function +let openMetadataReader (fileName, mdfile: BinaryFile, metadataPhysLoc, peinfo, pectxtEager: PEReader, pevEager: BinaryView, pectxtCaptured, reduceMemoryUsage, ilGlobals) = + let mdv = mdfile.GetView() + let magic = seekReadUInt16AsInt32 mdv metadataPhysLoc + if magic <> 0x5342 then failwith (fileName + ": bad metadata magic number: " + string magic) + let magic2 = seekReadUInt16AsInt32 mdv (metadataPhysLoc + 2) if magic2 <> 0x424a then failwith "bad metadata magic number" - let _majorMetadataVersion = seekReadUInt16 is (metadataPhysLoc + 4) - let _minorMetadataVersion = seekReadUInt16 is (metadataPhysLoc + 6) + let _majorMetadataVersion = seekReadUInt16 mdv (metadataPhysLoc + 4) + let _minorMetadataVersion = seekReadUInt16 mdv (metadataPhysLoc + 6) - let versionLength = seekReadInt32 is (metadataPhysLoc + 12) - let ilMetadataVersion = seekReadBytes is (metadataPhysLoc + 16) versionLength |> Array.filter (fun b -> b <> 0uy) + let versionLength = seekReadInt32 mdv (metadataPhysLoc + 12) + let ilMetadataVersion = seekReadBytes mdv (metadataPhysLoc + 16) versionLength |> Array.filter (fun b -> b <> 0uy) let x = align 0x04 (16 + versionLength) - let numStreams = seekReadUInt16AsInt32 is (metadataPhysLoc + x + 2) + let numStreams = seekReadUInt16AsInt32 mdv (metadataPhysLoc + x + 2) let streamHeadersStart = (metadataPhysLoc + x + 4) - if logging then dprintn (infile + ": numStreams = "+string numStreams) - if logging then dprintn (infile + ": streamHeadersStart = "+string streamHeadersStart) - - (* Crack stream headers *) - let tryFindStream name = let rec look i pos = if i >= numStreams then None else - let offset = seekReadInt32 is (pos + 0) - let length = seekReadInt32 is (pos + 4) + let offset = seekReadInt32 mdv (pos + 0) + let length = seekReadInt32 mdv (pos + 4) let res = ref true let fin = ref false let n = ref 0 // read and compare the stream name byte by byte while (not !fin) do - let c= seekReadByteAsInt32 is (pos + 8 + (!n)) + let c= seekReadByteAsInt32 mdv (pos + 8 + (!n)) if c = 0 then fin := true elif !n >= Array.length name || c <> name.[!n] then @@ -3413,9 +3330,8 @@ let rec genOpenBinaryReader infile is opts = match tryFindStream [| 0x23; 0x2d |] (* #-: at least one DLL I've seen uses this! *) with | Some res -> res | None -> - dprintf "no metadata tables found under stream names '#~' or '#-', please report this\n" - let firstStreamOffset = seekReadInt32 is (streamHeadersStart + 0) - let firstStreamLength = seekReadInt32 is (streamHeadersStart + 4) + let firstStreamOffset = seekReadInt32 mdv (streamHeadersStart + 0) + let firstStreamLength = seekReadInt32 mdv (streamHeadersStart + 4) firstStreamOffset, firstStreamLength let (stringsStreamPhysicalLoc, stringsStreamSize) = findStream [| 0x23; 0x53; 0x74; 0x72; 0x69; 0x6e; 0x67; 0x73; |] (* #Strings *) @@ -3490,9 +3406,9 @@ let rec genOpenBinaryReader infile is opts = kindIllegal (* Table 63 *) |] - let heapSizes = seekReadByteAsInt32 is (tablesStreamPhysLoc + 6) - let valid = seekReadInt64 is (tablesStreamPhysLoc + 8) - let sorted = seekReadInt64 is (tablesStreamPhysLoc + 16) + let heapSizes = seekReadByteAsInt32 mdv (tablesStreamPhysLoc + 6) + let valid = seekReadInt64 mdv (tablesStreamPhysLoc + 8) + let sorted = seekReadInt64 mdv (tablesStreamPhysLoc + 16) let tablesPresent, tableRowCount, startOfTables = let present = ref [] let numRows = Array.create 64 0 @@ -3500,7 +3416,7 @@ let rec genOpenBinaryReader infile is opts = for i = 0 to 63 do if (valid &&& (int64 1 <<< i)) <> int64 0 then present := i :: !present - numRows.[i] <- (seekReadInt32 is !prevNumRowIdx) + numRows.[i] <- (seekReadInt32 mdv !prevNumRowIdx) prevNumRowIdx := !prevNumRowIdx + 4 List.rev !present, numRows, !prevNumRowIdx @@ -3510,9 +3426,9 @@ let rec genOpenBinaryReader infile is opts = let guidsBigness = (heapSizes &&& 2) <> 0 let blobsBigness = (heapSizes &&& 4) <> 0 - if logging then dprintn (infile + ": numTables = "+string numTables) - if logging && stringsBigness then dprintn (infile + ": strings are big") - if logging && blobsBigness then dprintn (infile + ": blobs are big") + if logging then dprintn (fileName + ": numTables = "+string numTables) + if logging && stringsBigness then dprintn (fileName + ": strings are big") + if logging && blobsBigness then dprintn (fileName + ": blobs are big") let tableBigness = Array.map (fun n -> n >= 0x10000) tableRowCount @@ -3630,226 +3546,319 @@ let rec genOpenBinaryReader infile is opts = let tablePhysLocations = let res = Array.create 64 0x0 - let prevTablePhysLoc = ref startOfTables + let mutable prevTablePhysLoc = startOfTables for i = 0 to 63 do - res.[i] <- !prevTablePhysLoc - prevTablePhysLoc := !prevTablePhysLoc + (tableRowCount.[i] * tableRowSizes.[i]) - if logging then dprintf "tablePhysLocations.[%d] = %d, offset from startOfTables = 0x%08x\n" i res.[i] (res.[i] - startOfTables) + res.[i] <- prevTablePhysLoc + prevTablePhysLoc <- prevTablePhysLoc + (tableRowCount.[i] * tableRowSizes.[i]) res - let inbase = Filename.fileNameOfPath infile + ": " + let inbase = Filename.fileNameOfPath fileName + ": " // All the caches. The sizes are guesstimates for the rough sharing-density of the assembly - let cacheAssemblyRef = mkCacheInt32 opts.optimizeForMemory inbase "ILAssemblyRef" (getNumRows TableNames.AssemblyRef) - let cacheMethodSpecAsMethodData = mkCacheGeneric opts.optimizeForMemory inbase "MethodSpecAsMethodData" (getNumRows TableNames.MethodSpec / 20 + 1) - let cacheMemberRefAsMemberData = mkCacheGeneric opts.optimizeForMemory inbase "MemberRefAsMemberData" (getNumRows TableNames.MemberRef / 20 + 1) - let cacheCustomAttr = mkCacheGeneric opts.optimizeForMemory inbase "CustomAttr" (getNumRows TableNames.CustomAttribute / 50 + 1) - let cacheTypeRef = mkCacheInt32 opts.optimizeForMemory inbase "ILTypeRef" (getNumRows TableNames.TypeRef / 20 + 1) - let cacheTypeRefAsType = mkCacheGeneric opts.optimizeForMemory inbase "TypeRefAsType" (getNumRows TableNames.TypeRef / 20 + 1) - let cacheBlobHeapAsPropertySig = mkCacheGeneric opts.optimizeForMemory inbase "BlobHeapAsPropertySig" (getNumRows TableNames.Property / 20 + 1) - let cacheBlobHeapAsFieldSig = mkCacheGeneric opts.optimizeForMemory inbase "BlobHeapAsFieldSig" (getNumRows TableNames.Field / 20 + 1) - let cacheBlobHeapAsMethodSig = mkCacheGeneric opts.optimizeForMemory inbase "BlobHeapAsMethodSig" (getNumRows TableNames.Method / 20 + 1) - let cacheTypeDefAsType = mkCacheGeneric opts.optimizeForMemory inbase "TypeDefAsType" (getNumRows TableNames.TypeDef / 20 + 1) - let cacheMethodDefAsMethodData = mkCacheInt32 opts.optimizeForMemory inbase "MethodDefAsMethodData" (getNumRows TableNames.Method / 20 + 1) - let cacheGenericParams = mkCacheGeneric opts.optimizeForMemory inbase "GenericParams" (getNumRows TableNames.GenericParam / 20 + 1) - let cacheFieldDefAsFieldSpec = mkCacheInt32 opts.optimizeForMemory inbase "FieldDefAsFieldSpec" (getNumRows TableNames.Field / 20 + 1) - let cacheUserStringHeap = mkCacheInt32 opts.optimizeForMemory inbase "UserStringHeap" ( userStringsStreamSize / 20 + 1) + let cacheAssemblyRef = mkCacheInt32 reduceMemoryUsage inbase "ILAssemblyRef" (getNumRows TableNames.AssemblyRef) + let cacheMethodSpecAsMethodData = mkCacheGeneric reduceMemoryUsage inbase "MethodSpecAsMethodData" (getNumRows TableNames.MethodSpec / 20 + 1) + let cacheMemberRefAsMemberData = mkCacheGeneric reduceMemoryUsage inbase "MemberRefAsMemberData" (getNumRows TableNames.MemberRef / 20 + 1) + let cacheCustomAttr = mkCacheGeneric reduceMemoryUsage inbase "CustomAttr" (getNumRows TableNames.CustomAttribute / 50 + 1) + let cacheTypeRef = mkCacheInt32 reduceMemoryUsage inbase "ILTypeRef" (getNumRows TableNames.TypeRef / 20 + 1) + let cacheTypeRefAsType = mkCacheGeneric reduceMemoryUsage inbase "TypeRefAsType" (getNumRows TableNames.TypeRef / 20 + 1) + let cacheBlobHeapAsPropertySig = mkCacheGeneric reduceMemoryUsage inbase "BlobHeapAsPropertySig" (getNumRows TableNames.Property / 20 + 1) + let cacheBlobHeapAsFieldSig = mkCacheGeneric reduceMemoryUsage inbase "BlobHeapAsFieldSig" (getNumRows TableNames.Field / 20 + 1) + let cacheBlobHeapAsMethodSig = mkCacheGeneric reduceMemoryUsage inbase "BlobHeapAsMethodSig" (getNumRows TableNames.Method / 20 + 1) + let cacheTypeDefAsType = mkCacheGeneric reduceMemoryUsage inbase "TypeDefAsType" (getNumRows TableNames.TypeDef / 20 + 1) + let cacheMethodDefAsMethodData = mkCacheInt32 reduceMemoryUsage inbase "MethodDefAsMethodData" (getNumRows TableNames.Method / 20 + 1) + let cacheGenericParams = mkCacheGeneric reduceMemoryUsage inbase "GenericParams" (getNumRows TableNames.GenericParam / 20 + 1) + let cacheFieldDefAsFieldSpec = mkCacheInt32 reduceMemoryUsage inbase "FieldDefAsFieldSpec" (getNumRows TableNames.Field / 20 + 1) + let cacheUserStringHeap = mkCacheInt32 reduceMemoryUsage inbase "UserStringHeap" ( userStringsStreamSize / 20 + 1) // nb. Lots and lots of cache hits on this cache, hence never optimize cache away let cacheStringHeap = mkCacheInt32 false inbase "string heap" ( stringsStreamSize / 50 + 1) - let cacheBlobHeap = mkCacheInt32 opts.optimizeForMemory inbase "blob heap" ( blobsStreamSize / 50 + 1) + let cacheBlobHeap = mkCacheInt32 reduceMemoryUsage inbase "blob heap" ( blobsStreamSize / 50 + 1) // These tables are not required to enforce sharing fo the final data // structure, but are very useful as searching these tables gives rise to many reads // in standard applications. - let cacheNestedRow = mkCacheInt32 opts.optimizeForMemory inbase "Nested Table Rows" (getNumRows TableNames.Nested / 20 + 1) - let cacheConstantRow = mkCacheInt32 opts.optimizeForMemory inbase "Constant Rows" (getNumRows TableNames.Constant / 20 + 1) - let cacheMethodSemanticsRow = mkCacheInt32 opts.optimizeForMemory inbase "MethodSemantics Rows" (getNumRows TableNames.MethodSemantics / 20 + 1) - let cacheTypeDefRow = mkCacheInt32 opts.optimizeForMemory inbase "ILTypeDef Rows" (getNumRows TableNames.TypeDef / 20 + 1) - let cacheInterfaceImplRow = mkCacheInt32 opts.optimizeForMemory inbase "InterfaceImpl Rows" (getNumRows TableNames.InterfaceImpl / 20 + 1) - let cacheFieldMarshalRow = mkCacheInt32 opts.optimizeForMemory inbase "FieldMarshal Rows" (getNumRows TableNames.FieldMarshal / 20 + 1) - let cachePropertyMapRow = mkCacheInt32 opts.optimizeForMemory inbase "PropertyMap Rows" (getNumRows TableNames.PropertyMap / 20 + 1) - - let mkRowCounter _nm = - let count = ref 0 -#if DEBUG -#if STATISTICS - addReport (fun oc -> if !count <> 0 then oc.WriteLine (inbase+string !count + " "+_nm+" rows read")) -#endif -#else - _nm |> ignore -#endif - count - - let countTypeRef = mkRowCounter "ILTypeRef" - let countTypeDef = mkRowCounter "ILTypeDef" - let countField = mkRowCounter "Field" - let countMethod = mkRowCounter "Method" - let countParam = mkRowCounter "Param" - let countInterfaceImpl = mkRowCounter "InterfaceImpl" - let countMemberRef = mkRowCounter "MemberRef" - let countConstant = mkRowCounter "Constant" - let countCustomAttribute = mkRowCounter "CustomAttribute" - let countFieldMarshal = mkRowCounter "FieldMarshal" - let countPermission = mkRowCounter "Permission" - let countClassLayout = mkRowCounter "ClassLayout" - let countFieldLayout = mkRowCounter "FieldLayout" - let countStandAloneSig = mkRowCounter "StandAloneSig" - let countEventMap = mkRowCounter "EventMap" - let countEvent = mkRowCounter "Event" - let countPropertyMap = mkRowCounter "PropertyMap" - let countProperty = mkRowCounter "Property" - let countMethodSemantics = mkRowCounter "MethodSemantics" - let countMethodImpl = mkRowCounter "MethodImpl" - let countModuleRef = mkRowCounter "ILModuleRef" - let countTypeSpec = mkRowCounter "ILTypeSpec" - let countImplMap = mkRowCounter "ImplMap" - let countFieldRVA = mkRowCounter "FieldRVA" - let countAssembly = mkRowCounter "Assembly" - let countAssemblyRef = mkRowCounter "ILAssemblyRef" - let countFile = mkRowCounter "File" - let countExportedType = mkRowCounter "ILExportedTypeOrForwarder" - let countManifestResource = mkRowCounter "ManifestResource" - let countNested = mkRowCounter "Nested" - let countGenericParam = mkRowCounter "GenericParam" - let countGenericParamConstraint = mkRowCounter "GenericParamConstraint" - let countMethodSpec = mkRowCounter "ILMethodSpec" + let cacheNestedRow = mkCacheInt32 reduceMemoryUsage inbase "Nested Table Rows" (getNumRows TableNames.Nested / 20 + 1) + let cacheConstantRow = mkCacheInt32 reduceMemoryUsage inbase "Constant Rows" (getNumRows TableNames.Constant / 20 + 1) + let cacheMethodSemanticsRow = mkCacheInt32 reduceMemoryUsage inbase "MethodSemantics Rows" (getNumRows TableNames.MethodSemantics / 20 + 1) + let cacheTypeDefRow = mkCacheInt32 reduceMemoryUsage inbase "ILTypeDef Rows" (getNumRows TableNames.TypeDef / 20 + 1) + + let rowAddr (tab:TableName) idx = tablePhysLocations.[tab.Index] + (idx - 1) * tableRowSizes.[tab.Index] + + // Build the reader context + // Use an initialization hole + let ctxtH = ref None + let ctxt : ILMetadataReader = + { ilg=ilGlobals + sorted=sorted + getNumRows=getNumRows + mdfile=mdfile + dataEndPoints = match pectxtCaptured with None -> notlazy [] | Some pectxt -> getDataEndPointsDelayed pectxt ctxtH + pectxtCaptured=pectxtCaptured + entryPointToken=pectxtEager.entryPointToken + fileName=fileName + userStringsStreamPhysicalLoc = userStringsStreamPhysicalLoc + stringsStreamPhysicalLoc = stringsStreamPhysicalLoc + blobsStreamPhysicalLoc = blobsStreamPhysicalLoc + blobsStreamSize = blobsStreamSize + memoizeString = Tables.memoize id + readUserStringHeap = cacheUserStringHeap (readUserStringHeapUncached ctxtH) + readStringHeap = cacheStringHeap (readStringHeapUncached ctxtH) + readBlobHeap = cacheBlobHeap (readBlobHeapUncached ctxtH) + seekReadNestedRow = cacheNestedRow (seekReadNestedRowUncached ctxtH) + seekReadConstantRow = cacheConstantRow (seekReadConstantRowUncached ctxtH) + seekReadMethodSemanticsRow = cacheMethodSemanticsRow (seekReadMethodSemanticsRowUncached ctxtH) + seekReadTypeDefRow = cacheTypeDefRow (seekReadTypeDefRowUncached ctxtH) + seekReadAssemblyRef = cacheAssemblyRef (seekReadAssemblyRefUncached ctxtH) + seekReadMethodSpecAsMethodData = cacheMethodSpecAsMethodData (seekReadMethodSpecAsMethodDataUncached ctxtH) + seekReadMemberRefAsMethodData = cacheMemberRefAsMemberData (seekReadMemberRefAsMethodDataUncached ctxtH) + seekReadMemberRefAsFieldSpec = seekReadMemberRefAsFieldSpecUncached ctxtH + seekReadCustomAttr = cacheCustomAttr (seekReadCustomAttrUncached ctxtH) + seekReadTypeRef = cacheTypeRef (seekReadTypeRefUncached ctxtH) + readBlobHeapAsPropertySig = cacheBlobHeapAsPropertySig (readBlobHeapAsPropertySigUncached ctxtH) + readBlobHeapAsFieldSig = cacheBlobHeapAsFieldSig (readBlobHeapAsFieldSigUncached ctxtH) + readBlobHeapAsMethodSig = cacheBlobHeapAsMethodSig (readBlobHeapAsMethodSigUncached ctxtH) + readBlobHeapAsLocalsSig = readBlobHeapAsLocalsSigUncached ctxtH + seekReadTypeDefAsType = cacheTypeDefAsType (seekReadTypeDefAsTypeUncached ctxtH) + seekReadTypeRefAsType = cacheTypeRefAsType (seekReadTypeRefAsTypeUncached ctxtH) + seekReadMethodDefAsMethodData = cacheMethodDefAsMethodData (seekReadMethodDefAsMethodDataUncached ctxtH) + seekReadGenericParams = cacheGenericParams (seekReadGenericParamsUncached ctxtH) + seekReadFieldDefAsFieldSpec = cacheFieldDefAsFieldSpec (seekReadFieldDefAsFieldSpecUncached ctxtH) + guidsStreamPhysicalLoc = guidsStreamPhysicalLoc + rowAddr=rowAddr + rsBigness=rsBigness + tdorBigness=tdorBigness + tomdBigness=tomdBigness + hcBigness=hcBigness + hcaBigness=hcaBigness + hfmBigness=hfmBigness + hdsBigness=hdsBigness + mrpBigness=mrpBigness + hsBigness=hsBigness + mdorBigness=mdorBigness + mfBigness=mfBigness + iBigness=iBigness + catBigness=catBigness + stringsBigness=stringsBigness + guidsBigness=guidsBigness + blobsBigness=blobsBigness + tableBigness=tableBigness } + ctxtH := Some ctxt + + let ilModule = seekReadModule ctxt pectxtEager pevEager peinfo (System.Text.Encoding.UTF8.GetString (ilMetadataVersion, 0, ilMetadataVersion.Length)) 1 + let ilAssemblyRefs = lazy [ for i in 1 .. getNumRows TableNames.AssemblyRef do yield seekReadAssemblyRef ctxt i ] + + ilModule, ilAssemblyRefs + +//----------------------------------------------------------------------- +// Crack the binary headers, build a reader context and return the lazy +// read of the AbsIL module. +// ---------------------------------------------------------------------- + +let openPEFileReader (fileName, pefile: BinaryFile, pdbPath) = + let pev = pefile.GetView() + (* MSDOS HEADER *) + let peSignaturePhysLoc = seekReadInt32 pev 0x3c + (* PE HEADER *) + let peFileHeaderPhysLoc = peSignaturePhysLoc + 0x04 + let peOptionalHeaderPhysLoc = peFileHeaderPhysLoc + 0x14 + let peSignature = seekReadInt32 pev (peSignaturePhysLoc + 0) + if peSignature <> 0x4550 then failwithf "not a PE file - bad magic PE number 0x%08x, is = %A" peSignature pev + + + (* PE SIGNATURE *) + let machine = seekReadUInt16AsInt32 pev (peFileHeaderPhysLoc + 0) + let numSections = seekReadUInt16AsInt32 pev (peFileHeaderPhysLoc + 2) + let optHeaderSize = seekReadUInt16AsInt32 pev (peFileHeaderPhysLoc + 16) + if optHeaderSize <> 0xe0 && + optHeaderSize <> 0xf0 then failwith "not a PE file - bad optional header size" + let x64adjust = optHeaderSize - 0xe0 + let only64 = (optHeaderSize = 0xf0) (* May want to read in the optional header Magic number and check that as well... *) + let platform = match machine with | 0x8664 -> Some(AMD64) | 0x200 -> Some(IA64) | _ -> Some(X86) + let sectionHeadersStartPhysLoc = peOptionalHeaderPhysLoc + optHeaderSize + + let flags = seekReadUInt16AsInt32 pev (peFileHeaderPhysLoc + 18) + let isDll = (flags &&& 0x2000) <> 0x0 + + (* OPTIONAL PE HEADER *) + let _textPhysSize = seekReadInt32 pev (peOptionalHeaderPhysLoc + 4) (* Size of the code (text) section, or the sum of all code sections if there are multiple sections. *) + (* x86: 000000a0 *) + let _initdataPhysSize = seekReadInt32 pev (peOptionalHeaderPhysLoc + 8) (* Size of the initialized data section, or the sum of all such sections if there are multiple data sections. *) + let _uninitdataPhysSize = seekReadInt32 pev (peOptionalHeaderPhysLoc + 12) (* Size of the uninitialized data section, or the sum of all such sections if there are multiple data sections. *) + let _entrypointAddr = seekReadInt32 pev (peOptionalHeaderPhysLoc + 16) (* RVA of entry point , needs to point to bytes 0xFF 0x25 followed by the RVA+!0x4000000 in a section marked execute/read for EXEs or 0 for DLLs e.g. 0x0000b57e *) + let _textAddr = seekReadInt32 pev (peOptionalHeaderPhysLoc + 20) (* e.g. 0x0002000 *) + (* x86: 000000b0 *) + let dataSegmentAddr = seekReadInt32 pev (peOptionalHeaderPhysLoc + 24) (* e.g. 0x0000c000 *) + (* REVIEW: For now, we'll use the DWORD at offset 24 for x64. This currently ok since fsc doesn't support true 64-bit image bases, + but we'll have to fix this up when such support is added. *) + let imageBaseReal = if only64 then dataSegmentAddr else seekReadInt32 pev (peOptionalHeaderPhysLoc + 28) (* Image Base Always 0x400000 (see Section 23.1). - QUERY : no it's not always 0x400000, e.g. 0x034f0000 *) + let alignVirt = seekReadInt32 pev (peOptionalHeaderPhysLoc + 32) (* Section Alignment Always 0x2000 (see Section 23.1). *) + let alignPhys = seekReadInt32 pev (peOptionalHeaderPhysLoc + 36) (* File Alignment Either 0x200 or 0x1000. *) + (* x86: 000000c0 *) + let _osMajor = seekReadUInt16 pev (peOptionalHeaderPhysLoc + 40) (* OS Major Always 4 (see Section 23.1). *) + let _osMinor = seekReadUInt16 pev (peOptionalHeaderPhysLoc + 42) (* OS Minor Always 0 (see Section 23.1). *) + let _userMajor = seekReadUInt16 pev (peOptionalHeaderPhysLoc + 44) (* User Major Always 0 (see Section 23.1). *) + let _userMinor = seekReadUInt16 pev (peOptionalHeaderPhysLoc + 46) (* User Minor Always 0 (see Section 23.1). *) + let subsysMajor = seekReadUInt16AsInt32 pev (peOptionalHeaderPhysLoc + 48) (* SubSys Major Always 4 (see Section 23.1). *) + let subsysMinor = seekReadUInt16AsInt32 pev (peOptionalHeaderPhysLoc + 50) (* SubSys Minor Always 0 (see Section 23.1). *) + (* x86: 000000d0 *) + let _imageEndAddr = seekReadInt32 pev (peOptionalHeaderPhysLoc + 56) (* Image Size: Size, in bytes, of image, including all headers and padding; shall be a multiple of Section Alignment. e.g. 0x0000e000 *) + let _headerPhysSize = seekReadInt32 pev (peOptionalHeaderPhysLoc + 60) (* Header Size Combined size of MS-DOS Header, PE Header, PE Optional Header and padding; shall be a multiple of the file alignment. *) + let subsys = seekReadUInt16 pev (peOptionalHeaderPhysLoc + 68) (* SubSystem Subsystem required to run this image. Shall be either IMAGE_SUBSYSTEM_WINDOWS_CE_GUI (!0x3) or IMAGE_SUBSYSTEM_WINDOWS_GUI (!0x2). QUERY: Why is this 3 on the images ILASM produces??? *) + let useHighEnthropyVA = + let n = seekReadUInt16 pev (peOptionalHeaderPhysLoc + 70) + let highEnthropyVA = 0x20us + (n &&& highEnthropyVA) = highEnthropyVA + (* x86: 000000e0 *) + + (* WARNING: THESE ARE 64 bit ON x64/ia64 *) + (* REVIEW: If we ever decide that we need these values for x64, we'll have to read them in as 64bit and fix up the rest of the offsets. + Then again, it should suffice to just use the defaults, and still not bother... *) + (* let stackReserve = seekReadInt32 is (peOptionalHeaderPhysLoc + 72) in *) (* Stack Reserve Size Always 0x100000 (1Mb) (see Section 23.1). *) + (* let stackCommit = seekReadInt32 is (peOptionalHeaderPhysLoc + 76) in *) (* Stack Commit Size Always 0x1000 (4Kb) (see Section 23.1). *) + (* let heapReserve = seekReadInt32 is (peOptionalHeaderPhysLoc + 80) in *) (* Heap Reserve Size Always 0x100000 (1Mb) (see Section 23.1). *) + (* let heapCommit = seekReadInt32 is (peOptionalHeaderPhysLoc + 84) in *) (* Heap Commit Size Always 0x1000 (4Kb) (see Section 23.1). *) + + (* x86: 000000f0, x64: 00000100 *) + let _numDataDirectories = seekReadInt32 pev (peOptionalHeaderPhysLoc + 92 + x64adjust) (* Number of Data Directories: Always 0x10 (see Section 23.1). *) + (* 00000100 - these addresses are for x86 - for the x64 location, add x64adjust (0x10) *) + let _importTableAddr = seekReadInt32 pev (peOptionalHeaderPhysLoc + 104 + x64adjust) (* Import Table RVA of Import Table, (see clause 24.3.1). e.g. 0000b530 *) + let _importTableSize = seekReadInt32 pev (peOptionalHeaderPhysLoc + 108 + x64adjust) (* Size of Import Table, (see clause 24.3.1). *) + let nativeResourcesAddr = seekReadInt32 pev (peOptionalHeaderPhysLoc + 112 + x64adjust) + let nativeResourcesSize = seekReadInt32 pev (peOptionalHeaderPhysLoc + 116 + x64adjust) + (* 00000110 *) + (* 00000120 *) + (* let base_relocTableNames.addr = seekReadInt32 is (peOptionalHeaderPhysLoc + 136) + let base_relocTableNames.size = seekReadInt32 is (peOptionalHeaderPhysLoc + 140) in *) + (* 00000130 *) + (* 00000140 *) + (* 00000150 *) + let _importAddrTableAddr = seekReadInt32 pev (peOptionalHeaderPhysLoc + 192 + x64adjust) (* RVA of Import Addr Table, (see clause 24.3.1). e.g. 0x00002000 *) + let _importAddrTableSize = seekReadInt32 pev (peOptionalHeaderPhysLoc + 196 + x64adjust) (* Size of Import Addr Table, (see clause 24.3.1). e.g. 0x00002000 *) + (* 00000160 *) + let cliHeaderAddr = seekReadInt32 pev (peOptionalHeaderPhysLoc + 208 + x64adjust) + let _cliHeaderSize = seekReadInt32 pev (peOptionalHeaderPhysLoc + 212 + x64adjust) + (* 00000170 *) + + + (* Crack section headers *) + + let sectionHeaders = + [ for i in 0 .. numSections-1 do + let pos = sectionHeadersStartPhysLoc + i * 0x28 + let virtSize = seekReadInt32 pev (pos + 8) + let virtAddr = seekReadInt32 pev (pos + 12) + let physLoc = seekReadInt32 pev (pos + 20) + yield (virtAddr, virtSize, physLoc) ] + + let findSectionHeader addr = + let rec look i pos = + if i >= numSections then 0x0 + else + let virtSize = seekReadInt32 pev (pos + 8) + let virtAddr = seekReadInt32 pev (pos + 12) + if (addr >= virtAddr && addr < virtAddr + virtSize) then pos + else look (i+1) (pos + 0x28) + look 0 sectionHeadersStartPhysLoc + + let textHeaderStart = findSectionHeader cliHeaderAddr + let dataHeaderStart = findSectionHeader dataSegmentAddr + (* let relocHeaderStart = findSectionHeader base_relocTableNames.addr in *) + + let _textSize = if textHeaderStart = 0x0 then 0x0 else seekReadInt32 pev (textHeaderStart + 8) + let _textAddr = if textHeaderStart = 0x0 then 0x0 else seekReadInt32 pev (textHeaderStart + 12) + let textSegmentPhysicalSize = if textHeaderStart = 0x0 then 0x0 else seekReadInt32 pev (textHeaderStart + 16) + let textSegmentPhysicalLoc = if textHeaderStart = 0x0 then 0x0 else seekReadInt32 pev (textHeaderStart + 20) + + //let dataSegmentSize = if dataHeaderStart = 0x0 then 0x0 else seekReadInt32 pev (dataHeaderStart + 8) + //let dataSegmentAddr = if dataHeaderStart = 0x0 then 0x0 else seekReadInt32 pev (dataHeaderStart + 12) + let dataSegmentPhysicalSize = if dataHeaderStart = 0x0 then 0x0 else seekReadInt32 pev (dataHeaderStart + 16) + let dataSegmentPhysicalLoc = if dataHeaderStart = 0x0 then 0x0 else seekReadInt32 pev (dataHeaderStart + 20) + + let anyV2P (n, v) = + let pev = pefile.GetView() + let rec look i pos = + if i >= numSections then (failwith (fileName + ": bad "+n+", rva "+string v); 0x0) + else + let virtSize = seekReadInt32 pev (pos + 8) + let virtAddr = seekReadInt32 pev (pos + 12) + let physLoc = seekReadInt32 pev (pos + 20) + if (v >= virtAddr && (v < virtAddr + virtSize)) then (v - virtAddr) + physLoc + else look (i+1) (pos + 0x28) + look 0 sectionHeadersStartPhysLoc + + let cliHeaderPhysLoc = anyV2P ("cli header", cliHeaderAddr) + + let _majorRuntimeVersion = seekReadUInt16 pev (cliHeaderPhysLoc + 4) + let _minorRuntimeVersion = seekReadUInt16 pev (cliHeaderPhysLoc + 6) + let metadataAddr = seekReadInt32 pev (cliHeaderPhysLoc + 8) + let metadataSize = seekReadInt32 pev (cliHeaderPhysLoc + 12) + let cliFlags = seekReadInt32 pev (cliHeaderPhysLoc + 16) + + let ilOnly = (cliFlags &&& 0x01) <> 0x00 + let only32 = (cliFlags &&& 0x02) <> 0x00 + let is32bitpreferred = (cliFlags &&& 0x00020003) <> 0x00 + let _strongnameSigned = (cliFlags &&& 0x08) <> 0x00 + let _trackdebugdata = (cliFlags &&& 0x010000) <> 0x00 + + let entryPointToken = seekReadUncodedToken pev (cliHeaderPhysLoc + 20) + let resourcesAddr = seekReadInt32 pev (cliHeaderPhysLoc + 24) + let resourcesSize = seekReadInt32 pev (cliHeaderPhysLoc + 28) + let strongnameAddr = seekReadInt32 pev (cliHeaderPhysLoc + 32) + let _strongnameSize = seekReadInt32 pev (cliHeaderPhysLoc + 36) + let vtableFixupsAddr = seekReadInt32 pev (cliHeaderPhysLoc + 40) + let _vtableFixupsSize = seekReadInt32 pev (cliHeaderPhysLoc + 44) + + if logging then dprintn (fileName + ": metadataAddr = "+string metadataAddr) + if logging then dprintn (fileName + ": resourcesAddr = "+string resourcesAddr) + if logging then dprintn (fileName + ": resourcesSize = "+string resourcesSize) + if logging then dprintn (fileName + ": nativeResourcesAddr = "+string nativeResourcesAddr) + if logging then dprintn (fileName + ": nativeResourcesSize = "+string nativeResourcesSize) + + let metadataPhysLoc = anyV2P ("metadata", metadataAddr) //----------------------------------------------------------------------- // Set up the PDB reader so we can read debug info for methods. // ---------------------------------------------------------------------- #if FX_NO_PDB_READER - let pdb = None + let pdb = ignore pdbPath; None #else let pdb = if runningOnMono then None else - getPdbReader opts infile + getPdbReader pdbPath fileName #endif - let rowAddr (tab:TableName) idx = tablePhysLocations.[tab.Index] + (idx - 1) * tableRowSizes.[tab.Index] - - - // Build the reader context - // Use an initialization hole - let ctxtH = ref None - let ctxt = { ilg=opts.ilGlobals - dataEndPoints = dataEndPoints ctxtH - pdb=pdb - sorted=sorted - getNumRows=getNumRows - textSegmentPhysicalLoc=textSegmentPhysicalLoc - textSegmentPhysicalSize=textSegmentPhysicalSize - dataSegmentPhysicalLoc=dataSegmentPhysicalLoc - dataSegmentPhysicalSize=dataSegmentPhysicalSize - anyV2P=anyV2P - metadataAddr=metadataAddr - sectionHeaders=sectionHeaders - nativeResourcesAddr=nativeResourcesAddr - nativeResourcesSize=nativeResourcesSize - resourcesAddr=resourcesAddr - strongnameAddr=strongnameAddr - vtableFixupsAddr=vtableFixupsAddr - is=is - infile=infile - userStringsStreamPhysicalLoc = userStringsStreamPhysicalLoc - stringsStreamPhysicalLoc = stringsStreamPhysicalLoc - blobsStreamPhysicalLoc = blobsStreamPhysicalLoc - blobsStreamSize = blobsStreamSize - memoizeString = Tables.memoize id - readUserStringHeap = cacheUserStringHeap (readUserStringHeapUncached ctxtH) - readStringHeap = cacheStringHeap (readStringHeapUncached ctxtH) - readBlobHeap = cacheBlobHeap (readBlobHeapUncached ctxtH) - seekReadNestedRow = cacheNestedRow (seekReadNestedRowUncached ctxtH) - seekReadConstantRow = cacheConstantRow (seekReadConstantRowUncached ctxtH) - seekReadMethodSemanticsRow = cacheMethodSemanticsRow (seekReadMethodSemanticsRowUncached ctxtH) - seekReadTypeDefRow = cacheTypeDefRow (seekReadTypeDefRowUncached ctxtH) - seekReadInterfaceImplRow = cacheInterfaceImplRow (seekReadInterfaceImplRowUncached ctxtH) - seekReadFieldMarshalRow = cacheFieldMarshalRow (seekReadFieldMarshalRowUncached ctxtH) - seekReadPropertyMapRow = cachePropertyMapRow (seekReadPropertyMapRowUncached ctxtH) - seekReadAssemblyRef = cacheAssemblyRef (seekReadAssemblyRefUncached ctxtH) - seekReadMethodSpecAsMethodData = cacheMethodSpecAsMethodData (seekReadMethodSpecAsMethodDataUncached ctxtH) - seekReadMemberRefAsMethodData = cacheMemberRefAsMemberData (seekReadMemberRefAsMethodDataUncached ctxtH) - seekReadMemberRefAsFieldSpec = seekReadMemberRefAsFieldSpecUncached ctxtH - seekReadCustomAttr = cacheCustomAttr (seekReadCustomAttrUncached ctxtH) - seekReadSecurityDecl = seekReadSecurityDeclUncached ctxtH - seekReadTypeRef = cacheTypeRef (seekReadTypeRefUncached ctxtH) - readBlobHeapAsPropertySig = cacheBlobHeapAsPropertySig (readBlobHeapAsPropertySigUncached ctxtH) - readBlobHeapAsFieldSig = cacheBlobHeapAsFieldSig (readBlobHeapAsFieldSigUncached ctxtH) - readBlobHeapAsMethodSig = cacheBlobHeapAsMethodSig (readBlobHeapAsMethodSigUncached ctxtH) - readBlobHeapAsLocalsSig = readBlobHeapAsLocalsSigUncached ctxtH - seekReadTypeDefAsType = cacheTypeDefAsType (seekReadTypeDefAsTypeUncached ctxtH) - seekReadTypeRefAsType = cacheTypeRefAsType (seekReadTypeRefAsTypeUncached ctxtH) - seekReadMethodDefAsMethodData = cacheMethodDefAsMethodData (seekReadMethodDefAsMethodDataUncached ctxtH) - seekReadGenericParams = cacheGenericParams (seekReadGenericParamsUncached ctxtH) - seekReadFieldDefAsFieldSpec = cacheFieldDefAsFieldSpec (seekReadFieldDefAsFieldSpecUncached ctxtH) - guidsStreamPhysicalLoc = guidsStreamPhysicalLoc - rowAddr=rowAddr - entryPointToken=entryPointToken - rsBigness=rsBigness - tdorBigness=tdorBigness - tomdBigness=tomdBigness - hcBigness=hcBigness - hcaBigness=hcaBigness - hfmBigness=hfmBigness - hdsBigness=hdsBigness - mrpBigness=mrpBigness - hsBigness=hsBigness - mdorBigness=mdorBigness - mfBigness=mfBigness - iBigness=iBigness - catBigness=catBigness - stringsBigness=stringsBigness - guidsBigness=guidsBigness - blobsBigness=blobsBigness - tableBigness=tableBigness - countTypeRef = countTypeRef - countTypeDef = countTypeDef - countField = countField - countMethod = countMethod - countParam = countParam - countInterfaceImpl = countInterfaceImpl - countMemberRef = countMemberRef - countConstant = countConstant - countCustomAttribute = countCustomAttribute - countFieldMarshal = countFieldMarshal - countPermission = countPermission - countClassLayout = countClassLayout - countFieldLayout = countFieldLayout - countStandAloneSig = countStandAloneSig - countEventMap = countEventMap - countEvent = countEvent - countPropertyMap = countPropertyMap - countProperty = countProperty - countMethodSemantics = countMethodSemantics - countMethodImpl = countMethodImpl - countModuleRef = countModuleRef - countTypeSpec = countTypeSpec - countImplMap = countImplMap - countFieldRVA = countFieldRVA - countAssembly = countAssembly - countAssemblyRef = countAssemblyRef - countFile = countFile - countExportedType = countExportedType - countManifestResource = countManifestResource - countNested = countNested - countGenericParam = countGenericParam - countGenericParamConstraint = countGenericParamConstraint - countMethodSpec = countMethodSpec } - ctxtH := Some ctxt - - let ilModule = seekReadModule ctxt (subsys, (subsysMajor, subsysMinor), useHighEnthropyVA, ilOnly, only32, is32bitpreferred, only64, platform, isDll, alignVirt, alignPhys, imageBaseReal, System.Text.Encoding.UTF8.GetString (ilMetadataVersion, 0, ilMetadataVersion.Length)) 1 - let ilAssemblyRefs = lazy [ for i in 1 .. getNumRows TableNames.AssemblyRef do yield seekReadAssemblyRef ctxt i ] - + let pectxt : PEReader = + { pdb=pdb + textSegmentPhysicalLoc=textSegmentPhysicalLoc + textSegmentPhysicalSize=textSegmentPhysicalSize + dataSegmentPhysicalLoc=dataSegmentPhysicalLoc + dataSegmentPhysicalSize=dataSegmentPhysicalSize + anyV2P=anyV2P + metadataAddr=metadataAddr + sectionHeaders=sectionHeaders + nativeResourcesAddr=nativeResourcesAddr + nativeResourcesSize=nativeResourcesSize + resourcesAddr=resourcesAddr + strongnameAddr=strongnameAddr + vtableFixupsAddr=vtableFixupsAddr + pefile=pefile + fileName=fileName + entryPointToken=entryPointToken + } + let peinfo = (subsys, (subsysMajor, subsysMinor), useHighEnthropyVA, ilOnly, only32, is32bitpreferred, only64, platform, isDll, alignVirt, alignPhys, imageBaseReal) + (metadataPhysLoc, metadataSize, peinfo, pectxt, pev, pdb) + +let openPE (fileName, pefile, pdbPath, reduceMemoryUsage, ilGlobals) = + let (metadataPhysLoc, _metadataSize, peinfo, pectxt, pev, pdb) = openPEFileReader (fileName, pefile, pdbPath) + let ilModule, ilAssemblyRefs = openMetadataReader (fileName, pefile, metadataPhysLoc, peinfo, pectxt, pev, Some pectxt, reduceMemoryUsage, ilGlobals) ilModule, ilAssemblyRefs, pdb - -let mkDefault ilg = - { optimizeForMemory=false - pdbPath= None - ilGlobals = ilg } +let openPEMetadataOnly (fileName, peinfo, pectxtEager, pev, mdfile: BinaryFile, reduceMemoryUsage, ilGlobals) = + openMetadataReader (fileName, mdfile, 0, peinfo, pectxtEager, pev, None, reduceMemoryUsage, ilGlobals) + let ClosePdbReader pdb = #if FX_NO_PDB_READER ignore pdb @@ -3860,69 +3869,161 @@ let ClosePdbReader pdb = | None -> () #endif -let OpenILModuleReader infile opts = - - try - let mmap = MemoryMappedFile.Create infile - let modul, ilAssemblyRefs, pdb = genOpenBinaryReader infile mmap opts - { modul = modul - ilAssemblyRefs=ilAssemblyRefs - dispose = (fun () -> - mmap.Close() - ClosePdbReader pdb) } - with _ -> - let mc = ByteFile(infile |> FileSystem.ReadAllBytesShim) - let modul, ilAssemblyRefs, pdb = genOpenBinaryReader infile mc opts - { modul = modul - ilAssemblyRefs = ilAssemblyRefs - dispose = (fun () -> - ClosePdbReader pdb) } +type ILReaderMetadataSnapshot = (obj * nativeint * int) +type ILReaderTryGetMetadataSnapshot = (* path: *) string * (* snapshotTimeStamp: *) System.DateTime -> ILReaderMetadataSnapshot option +[] +type MetadataOnlyFlag = Yes | No + +[] +type ReduceMemoryFlag = Yes | No + +type ILReaderOptions = + { pdbPath: string option + ilGlobals: ILGlobals + reduceMemoryUsage: ReduceMemoryFlag + metadataOnly: MetadataOnlyFlag + tryGetMetadataSnapshot: ILReaderTryGetMetadataSnapshot } + +[] +type ILModuleReader(ilModule: ILModuleDef, ilAssemblyRefs: Lazy, dispose: unit -> unit) = + member x.ILModuleDef = ilModule + member x.ILAssemblyRefs = ilAssemblyRefs.Force() + interface IDisposable with + member x.Dispose() = dispose() + // ++GLOBAL MUTABLE STATE (concurrency safe via locking) type ILModuleReaderCacheLockToken() = interface LockToken -let ilModuleReaderCache = new AgedLookup(0, areSimilar=(fun (x, y) -> x = y)) +let ilModuleReaderCache = new AgedLookup(0, areSimilar=(fun (x, y) -> x = y)) let ilModuleReaderCacheLock = Lock() -let OpenILModuleReaderAfterReadingAllBytes infile opts = +let stableFileHeuristicApplies fileName = + not noStableFileHeuristic && try FileSystem.IsStableFileHeuristic fileName with _ -> false + +let createByteFile opts fileName = + // If we're trying to reduce memory usage then we are willing to go back and re-read the binary, so we can use + // a weakly-held handle to an array of bytes. + if opts.reduceMemoryUsage = ReduceMemoryFlag.Yes && stableFileHeuristicApplies fileName then + WeakByteFile(fileName) :> BinaryFile + else + let bytes = FileSystem.ReadAllBytesShim(fileName) + ByteFile(fileName, bytes) :> BinaryFile + +let tryMemoryMap opts fileName = + let file = + try + MemoryMapFile.Create fileName :> BinaryFile + with _ -> + createByteFile opts fileName + let disposer = + { new IDisposable with + member __.Dispose() = + match file with + | :? MemoryMapFile as m -> m.Close() // Note that the PE file reader is not required after this point for metadata-only reading + | _ -> () } + disposer, file + +let OpenILModuleReaderFromBytes fileName bytes opts = + let pefile = ByteFile(fileName, bytes) :> BinaryFile + let ilModule, ilAssemblyRefs, pdb = openPE (fileName, pefile, opts.pdbPath, (opts.reduceMemoryUsage = ReduceMemoryFlag.Yes), opts.ilGlobals) + new ILModuleReader(ilModule, ilAssemblyRefs, (fun () -> ClosePdbReader pdb)) + +let OpenILModuleReader fileName opts = // Pseudo-normalize the paths. - let key, succeeded = + let ((_,writeStamp,_,_,_,_) as key), keyOk = try - (FileSystem.GetFullPathShim(infile), - FileSystem.GetLastWriteTimeShim(infile), + (FileSystem.GetFullPathShim(fileName), + FileSystem.GetLastWriteTimeShim(fileName), opts.ilGlobals.primaryAssemblyScopeRef, - opts.pdbPath.IsSome), true + opts.pdbPath.IsSome, + opts.reduceMemoryUsage, + opts.metadataOnly), true with e -> - System.Diagnostics.Debug.Assert(false, sprintf "Failed to compute key in OpenILModuleReaderAfterReadingAllBytes cache for '%s'. Falling back to uncached." infile) - ("", System.DateTime.UtcNow, ILScopeRef.Local, false), false + System.Diagnostics.Debug.Assert(false, sprintf "Failed to compute key in OpenILModuleReader cache for '%s'. Falling back to uncached." fileName) + ("", System.DateTime.UtcNow, ILScopeRef.Local, false, ReduceMemoryFlag.Yes, MetadataOnlyFlag.Yes), false let cacheResult = - if not succeeded then None // Fall back to uncached. - else if opts.pdbPath.IsSome then None // can't used a cached entry when reading PDBs, since it makes the returned object IDisposable - else ilModuleReaderCacheLock.AcquireLock (fun ltok -> ilModuleReaderCache.TryGet(ltok, key)) + if keyOk then + if opts.pdbPath.IsSome then None // can't used a cached entry when reading PDBs, since it makes the returned object IDisposable + else ilModuleReaderCacheLock.AcquireLock (fun ltok -> ilModuleReaderCache.TryGet(ltok, key)) + else + None match cacheResult with - | Some(ilModuleReader) -> ilModuleReader + | Some ilModuleReader -> ilModuleReader | None -> - let mc = ByteFile(infile |> FileSystem.ReadAllBytesShim) - let modul, ilAssemblyRefs, pdb = genOpenBinaryReader infile mc opts + + let reduceMemoryUsage = (opts.reduceMemoryUsage = ReduceMemoryFlag.Yes) + let metadataOnly = (opts.metadataOnly = MetadataOnlyFlag.Yes) + + if reduceMemoryUsage && opts.pdbPath.IsNone then + + // This case is used in FCS applications, devenv.exe and fsi.exe + // let ilModuleReader = - { modul = modul - ilAssemblyRefs = ilAssemblyRefs - dispose = (fun () -> ClosePdbReader pdb) } - if Option.isNone pdb && succeeded then + // Check if we are doing metadataOnly reading (the most common case in both the compiler and IDE) + if metadataOnly then + + // See if tryGetMetadata gives us a BinaryFile for the metadata section alone. + let mdfileOpt = + match opts.tryGetMetadataSnapshot (fileName, writeStamp) with + | Some (obj, start, len) -> Some (RawMemoryFile(fileName, obj, start, len) :> BinaryFile) + | None -> None + + // For metadata-only, always use a temporary, short-lived PE file reader, preferably over a memory mapped file. + // Then use the metadata blob as the long-lived memory resource. + let disposer, pefileEager = tryMemoryMap opts fileName + use _disposer = disposer + let (metadataPhysLoc, metadataSize, peinfo, pectxtEager, pevEager, _pdb) = openPEFileReader (fileName, pefileEager, None) + let mdfile = + match mdfileOpt with + | Some mdfile -> mdfile + | None -> + // If tryGetMetadata doesn't give anything, then just read the metadata chunk out of the binary + let bytes = File.ReadBinaryChunk (fileName, metadataPhysLoc, metadataSize) + ByteFile(fileName, bytes) :> BinaryFile + + let ilModule, ilAssemblyRefs = openPEMetadataOnly (fileName, peinfo, pectxtEager, pevEager, mdfile, reduceMemoryUsage, opts.ilGlobals) + new ILModuleReader(ilModule, ilAssemblyRefs, ignore) + else + // If we are not doing metadata-only, then just go ahead and read all the bytes and hold them either strongly or weakly + // depending on the heuristic + let pefile = createByteFile opts fileName + let ilModule, ilAssemblyRefs, _pdb = openPE (fileName, pefile, None, reduceMemoryUsage, opts.ilGlobals) + new ILModuleReader(ilModule, ilAssemblyRefs, ignore) + + if keyOk then ilModuleReaderCacheLock.AcquireLock (fun ltok -> ilModuleReaderCache.Put(ltok, key, ilModuleReader)) - ilModuleReader -let OpenILModuleReaderFromBytes fileNameForDebugOutput bytes opts = - assert opts.pdbPath.IsNone - let mc = ByteFile(bytes) - let modul, ilAssemblyRefs, pdb = genOpenBinaryReader fileNameForDebugOutput mc opts - let ilModuleReader = - { modul = modul - ilAssemblyRefs = ilAssemblyRefs - dispose = (fun () -> ClosePdbReader pdb) } ilModuleReader + + else + // This case is primarily used in fsc.exe. + // + // In fsc.exe, we're not trying to reduce memory usage, nor do we really care if we leak memory. + // + // Note we ignore the "metadata only" flag as it's generally OK to read in the + // whole binary for the command-line compiler: address space is rarely an issue. + // + // We do however care about avoiding locks on files that prevent their deletion during a + // multi-proc build. So use memory mapping, but only for stable files. Other files + // fill use an in-memory ByteFile + let _disposer, pefile = + if alwaysMemoryMapFSC || stableFileHeuristicApplies fileName then + tryMemoryMap opts fileName + else + let pefile = createByteFile opts fileName + let disposer = { new IDisposable with member __.Dispose() = () } + disposer, pefile + + let ilModule, ilAssemblyRefs, pdb = openPE (fileName, pefile, opts.pdbPath, reduceMemoryUsage, opts.ilGlobals) + let ilModuleReader = new ILModuleReader(ilModule, ilAssemblyRefs, (fun () -> ClosePdbReader pdb)) + + // Readers with PDB reader disposal logic don't go in the cache. Note the PDB reader is only used in static linking. + if keyOk && opts.pdbPath.IsNone then + ilModuleReaderCacheLock.AcquireLock (fun ltok -> ilModuleReaderCache.Put(ltok, key, ilModuleReader)) + ilModuleReader diff --git a/src/absil/ilread.fsi b/src/absil/ilread.fsi index c69312f037..8101e4d4ef 100644 --- a/src/absil/ilread.fsi +++ b/src/absil/ilread.fsi @@ -24,7 +24,7 @@ /// class. That is not particularly satisfactory, and it may be /// a good idea to build a small library which extracts the information /// you need. -module internal Microsoft.FSharp.Compiler.AbstractIL.ILBinaryReader +module Microsoft.FSharp.Compiler.AbstractIL.ILBinaryReader open Internal.Utilities open Microsoft.FSharp.Compiler.AbstractIL @@ -33,35 +33,60 @@ open Microsoft.FSharp.Compiler.AbstractIL.Internal open Microsoft.FSharp.Compiler.ErrorLogger open System.IO +/// Used to implement a Binary file over native memory, used by Roslyn integration +type ILReaderMetadataSnapshot = (obj * nativeint * int) +type ILReaderTryGetMetadataSnapshot = (* path: *) string * (* snapshotTimeStamp: *) System.DateTime -> ILReaderMetadataSnapshot option -type ILReaderOptions = - { pdbPath: string option; - ilGlobals: ILGlobals; - optimizeForMemory: bool (* normally off, i.e. optimize for startup-path speed *) } +[] +type internal MetadataOnlyFlag = Yes | No -val mkDefault : ILGlobals -> ILReaderOptions +[] +type internal ReduceMemoryFlag = Yes | No -// The non-memory resources (i.e. the file handle) associated with -// the read can be recovered by calling Dispose. Any remaining -// lazily-computed items in the metadata graph returned by MetadataOfILModuleReader -// will no longer be valid. +type internal ILReaderOptions = + { pdbPath: string option + + ilGlobals: ILGlobals + + // fsc.exe does not use reduceMemoryUsage (hence keeps MORE caches in AbstractIL and MORE memory mapping and MORE memory hogging but FASTER and SIMPLER file access) + // fsi.exe does uses reduceMemoryUsage (hence keeps FEWER caches in AbstractIL and LESS memory mapping and LESS memory hogging but slightly SLOWER file access), because its long running + // FCS uses reduceMemoryUsage (hence keeps FEWER caches in AbstractIL and LESS memory mapping and LESS memory hogging), because it is typically long running + reduceMemoryUsage: ReduceMemoryFlag + + /// Only open a metadata reader for the metadata portion of the .NET binary without keeping alive any data associated with the PE reader + /// - IL code will not be available (mdBody in ILMethodDef will return NotAvailable) + /// - Managed resources will be reported back as ILResourceLocation.LocalIn (as always) + /// - Native resources will not be available (none will be returned) + /// - Static data associated with fields will not be available + metadataOnly: MetadataOnlyFlag + + /// A function to call to try to get an object that acts as a snapshot of the metadata section of a .NET binary, + /// and from which we can read the metadata. Only used when metadataOnly=true. + tryGetMetadataSnapshot: ILReaderTryGetMetadataSnapshot } + +/// Represents a reader of the metadata of a .NET binary. May also give some values (e.g. IL code) from the PE file +/// if it was provided. [] -type ILModuleReader = +type internal ILModuleReader = member ILModuleDef : ILModuleDef member ILAssemblyRefs : ILAssemblyRef list + + /// ILModuleReader objects only need to be explicitly disposed if memory mapping is used, i.e. reduceMemoryUsage = false interface System.IDisposable -val OpenILModuleReader: string -> ILReaderOptions -> ILModuleReader - /// Open a binary reader, except first copy the entire contents of the binary into /// memory, close the file and ensure any subsequent reads happen from the in-memory store. /// PDB files may not be read with this option. -val OpenILModuleReaderAfterReadingAllBytes: string -> ILReaderOptions -> ILModuleReader +val internal OpenILModuleReader: string -> ILReaderOptions -> ILModuleReader /// Open a binary reader based on the given bytes. -val OpenILModuleReaderFromBytes: fileNameForDebugOutput:string -> assemblyContents: byte[] -> options: ILReaderOptions -> ILModuleReader +val internal OpenILModuleReaderFromBytes: fileNameForDebugOutput:string -> assemblyContents: byte[] -> options: ILReaderOptions -> ILModuleReader + +type Statistics = + { mutable rawMemoryFileCount : int + mutable memoryMapFileOpenedCount : int + mutable memoryMapFileClosedCount : int + mutable weakByteFileCount : int + mutable byteFileCount : int } -#if STATISTICS -(* report statistics from all reads *) -val report: TextWriter -> unit -#endif +val GetStatistics : unit -> Statistics \ No newline at end of file diff --git a/src/absil/ilreflect.fs b/src/absil/ilreflect.fs index 6fc0c03e12..589c948a9b 100644 --- a/src/absil/ilreflect.fs +++ b/src/absil/ilreflect.fs @@ -1385,9 +1385,10 @@ let emitILMethodBody cenv modB emEnv (ilG:ILGenerator) (ilmbody: ILMethodBody) = let emitMethodBody cenv modB emEnv ilG _name (mbody: ILLazyMethodBody) = match mbody.Contents with | MethodBody.IL ilmbody -> emitILMethodBody cenv modB emEnv (ilG()) ilmbody - | MethodBody.PInvoke _pinvoke -> () (* printf "EMIT: pinvoke method %s\n" name *) (* XXX - check *) - | MethodBody.Abstract -> () (* printf "EMIT: abstract method %s\n" name *) (* XXX - check *) - | MethodBody.Native -> failwith "emitMethodBody cenv: native" (* XXX - gap *) + | MethodBody.PInvoke _pinvoke -> () + | MethodBody.Abstract -> () + | MethodBody.Native -> failwith "emitMethodBody: native" + | MethodBody.NotAvailable -> failwith "emitMethodBody: metadata only" let convCustomAttr cenv emEnv cattr = let methInfo = @@ -2023,8 +2024,11 @@ let buildModuleFragment cenv emEnv (asmB : AssemblyBuilder) (modB : ModuleBuilde m.Resources.AsList |> List.iter (fun r -> let attribs = (match r.Access with ILResourceAccess.Public -> ResourceAttributes.Public | ILResourceAccess.Private -> ResourceAttributes.Private) match r.Location with - | ILResourceLocation.Local bf -> - modB.DefineManifestResourceAndLog(r.Name, new System.IO.MemoryStream(bf()), attribs) + | ILResourceLocation.LocalIn (file, start, len) -> + let bytes = FileSystem.ReadAllBytesShim(file).[start .. start + len - 1] + modB.DefineManifestResourceAndLog(r.Name, new System.IO.MemoryStream(bytes), attribs) + | ILResourceLocation.LocalOut bytes -> + modB.DefineManifestResourceAndLog(r.Name, new System.IO.MemoryStream(bytes), attribs) | ILResourceLocation.File (mr, _) -> asmB.AddResourceFileAndLog(r.Name, mr.Name, attribs) | ILResourceLocation.Assembly _ -> diff --git a/src/absil/ilwrite.fs b/src/absil/ilwrite.fs index 3b307720a3..b7ef6be5f5 100644 --- a/src/absil/ilwrite.fs +++ b/src/absil/ilwrite.fs @@ -2680,17 +2680,18 @@ and GenEventPass3 cenv env (md: ILEventDef) = let rec GetResourceAsManifestResourceRow cenv r = let data, impl = match r.Location with - | ILResourceLocation.Local bf -> - let b = bf() + | ILResourceLocation.LocalIn _ + | ILResourceLocation.LocalOut _ -> + let bytes = r.GetBytes() // Embedded managed resources must be word-aligned. However resource format is // not specified in ECMA. Some mscorlib resources appear to be non-aligned - it seems it doesn't matter.. let offset = cenv.resources.Position let alignedOffset = (align 0x8 offset) let pad = alignedOffset - offset - let resourceSize = b.Length + let resourceSize = bytes.Length cenv.resources.EmitPadding pad cenv.resources.EmitInt32 resourceSize - cenv.resources.EmitBytes b + cenv.resources.EmitBytes bytes Data (alignedOffset, true), (i_File, 0) | ILResourceLocation.File (mref, offset) -> ULong offset, (i_File, GetModuleRefAsFileIdx cenv mref) | ILResourceLocation.Assembly aref -> ULong 0x0, (i_AssemblyRef, GetAssemblyRefAsIdx cenv aref) @@ -3712,7 +3713,13 @@ let writeBinaryAndReportMappings (outfile, ignore resourceFormat [||] #else - let unlinkedResources = List.map Lazy.force resources + let unlinkedResources = + resources |> List.map (function + | ILNativeResource.Out bytes -> bytes + | ILNativeResource.In (fileName, linkedResourceBase, start, len) -> + let linkedResource = File.ReadBinaryChunk (fileName, start, len) + unlinkResource linkedResourceBase linkedResource) + begin try linkNativeResources unlinkedResources next resourceFormat (Path.GetDirectoryName(outfile)) with e -> failwith ("Linking a native resource failed: "+e.Message+"") diff --git a/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs b/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs index ac222406a2..6bda35855d 100644 --- a/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs +++ b/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs @@ -4306,6 +4306,9 @@ type internal SR private() = /// This expression returns a value of type '%s' but is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to use the expression as a value in the sequence then use an explicit 'yield!'. /// (Originally from ..\FSComp.txt:1426) static member implicitlyDiscardedSequenceInSequenceExpression(a0 : System.String) = (3222, GetStringFunc("implicitlyDiscardedSequenceInSequenceExpression",",,,%s,,,") a0) + /// The file '%s' changed on disk unexpectedly, please reload. + /// (Originally from ..\FSComp.txt:1427) + static member ilreadFileChanged(a0 : System.String) = (3223, GetStringFunc("ilreadFileChanged",",,,%s,,,") a0) /// Call this method once to validate that all known resources are valid; throws if not static member RunStartupValidation() = @@ -5706,4 +5709,5 @@ type internal SR private() = ignore(GetString("tcTupleMemberNotNormallyUsed")) ignore(GetString("implicitlyDiscardedInSequenceExpression")) ignore(GetString("implicitlyDiscardedSequenceInSequenceExpression")) + ignore(GetString("ilreadFileChanged")) () diff --git a/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx b/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx index 98d1c657ba..5100d157ea 100644 --- a/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx +++ b/src/buildfromsource/FSharp.Compiler.Private/FSComp.resx @@ -1117,7 +1117,7 @@ The member or object constructor '{0}' is not {1} - The member or object constructor '{0}' is not {1}. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from within inner lambda expressions, object expressions or computation expressions (such as async { }). If {0} is a protected member, consider creating a member in this type that calls it. + The member or object constructor '{0}' is not {1}. Private members may only be accessed from within the declaring type. Protected members may only be accessed from an extending type and cannot be accessed from inner lambda expressions. {0} is not a static method @@ -4309,4 +4309,7 @@ This expression returns a value of type '{0}' but is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to use the expression as a value in the sequence then use an explicit 'yield!'. + + The file '{0}' changed on disk unexpectedly, please reload. + \ No newline at end of file diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs index 069dba4859..24f9615222 100644 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -18,6 +18,7 @@ open Internal.Utilities.Filename open Microsoft.FSharp.Compiler.AbstractIL open Microsoft.FSharp.Compiler.AbstractIL.IL +open Microsoft.FSharp.Compiler.AbstractIL.ILBinaryReader open Microsoft.FSharp.Compiler.AbstractIL.Internal open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library open Microsoft.FSharp.Compiler.AbstractIL.Extensions.ILX @@ -2036,6 +2037,7 @@ let ComputeMakePathAbsolute implicitIncludeDir (path : string) = // Configuration //---------------------------------------------------------------------------- +[] type CompilerTarget = | WinExe | ConsoleExe @@ -2043,8 +2045,12 @@ type CompilerTarget = | Module member x.IsExe = (match x with ConsoleExe | WinExe -> true | _ -> false) +[] type ResolveAssemblyReferenceMode = Speculative | ReportErrors +[] +type CopyFSharpCoreFlag = Yes | No + /// Represents the file or string used for the --version flag type VersionFlag = | VersionString of string @@ -2179,13 +2185,13 @@ type CcuLoadFailureAction = | RaiseError | ReturnNone +[] type TcConfigBuilder = { mutable primaryAssembly : PrimaryAssembly mutable autoResolveOpenDirectivesToDlls: bool mutable noFeedback: bool mutable stackReserveSize: int32 option mutable implicitIncludeDir: string (* normally "." *) - mutable openBinariesInMemory: bool (* false for command line, true for VS *) mutable openDebugInformationForLaterStaticLinking: bool (* only for --standalone *) defaultFSharpBinariesDir: string mutable compilingFslib: bool @@ -2205,7 +2211,7 @@ type TcConfigBuilder = mutable referencedDLLs : AssemblyReference list mutable projectReferences : IProjectReference list mutable knownUnresolvedReferences : UnresolvedAssemblyReference list - optimizeForMemory: bool + reduceMemoryUsage: ReduceMemoryFlag mutable subsystemVersion : int * int mutable useHighEntropyVA : bool mutable inputCodePage: int option @@ -2326,10 +2332,15 @@ type TcConfigBuilder = mutable exename : string option // If true - the compiler will copy FSharp.Core.dll along the produced binaries - mutable copyFSharpCore : bool + mutable copyFSharpCore : CopyFSharpCoreFlag /// When false FSI will lock referenced assemblies requiring process restart, false = disable Shadow Copy false (*default*) mutable shadowCopyReferences : bool + + /// A function to call to try to get an object that acts as a snapshot of the metadata section of a .NET binary, + /// and from which we can read the metadata. Only used when metadataOnly=true. + mutable tryGetMetadataSnapshot : ILReaderTryGetMetadataSnapshot + } static member Initial = @@ -2345,7 +2356,6 @@ type TcConfigBuilder = conditionalCompilationDefines = [] implicitIncludeDir = String.Empty autoResolveOpenDirectivesToDlls = false - openBinariesInMemory = false openDebugInformationForLaterStaticLinking = false defaultFSharpBinariesDir = String.Empty compilingFslib = false @@ -2366,7 +2376,7 @@ type TcConfigBuilder = errorSeverityOptions = FSharpErrorSeverityOptions.Default embedResources = [] inputCodePage = None - optimizeForMemory = true + reduceMemoryUsage = ReduceMemoryFlag.Yes // always gets set explicitly subsystemVersion = 4, 0 // per spec for 357994 useHighEntropyVA = false mlCompatibility = false @@ -2376,7 +2386,7 @@ type TcConfigBuilder = platform = None prefer32Bit = false useSimpleResolution = runningOnMono - target = ConsoleExe + target = CompilerTarget.ConsoleExe debuginfo = false testFlagEmitFeeFeeAs100001 = false dumpDebugInfo = false @@ -2467,24 +2477,29 @@ type TcConfigBuilder = sqmSessionStartedTime = System.DateTime.UtcNow.Ticks emitDebugInfoInQuotations = false exename = None - copyFSharpCore = false + copyFSharpCore = CopyFSharpCoreFlag.No shadowCopyReferences = false + tryGetMetadataSnapshot = (fun _ -> None) } - static member CreateNew(legacyReferenceResolver, defaultFSharpBinariesDir, optimizeForMemory, implicitIncludeDir, - isInteractive, isInvalidationSupported, defaultCopyFSharpCore) = - Debug.Assert(FileSystem.IsPathRootedShim(implicitIncludeDir), sprintf "implicitIncludeDir should be absolute: '%s'" implicitIncludeDir) - if (String.IsNullOrEmpty(defaultFSharpBinariesDir)) then - failwith "Expected a valid defaultFSharpBinariesDir" - { TcConfigBuilder.Initial with - implicitIncludeDir = implicitIncludeDir - defaultFSharpBinariesDir = defaultFSharpBinariesDir - optimizeForMemory = optimizeForMemory - legacyReferenceResolver = legacyReferenceResolver - isInteractive = isInteractive - isInvalidationSupported = isInvalidationSupported - copyFSharpCore = defaultCopyFSharpCore - } + static member CreateNew(legacyReferenceResolver, defaultFSharpBinariesDir, reduceMemoryUsage, implicitIncludeDir, + isInteractive, isInvalidationSupported, defaultCopyFSharpCore, tryGetMetadataSnapshot) = + + Debug.Assert(FileSystem.IsPathRootedShim(implicitIncludeDir), sprintf "implicitIncludeDir should be absolute: '%s'" implicitIncludeDir) + + if (String.IsNullOrEmpty(defaultFSharpBinariesDir)) then + failwith "Expected a valid defaultFSharpBinariesDir" + + { TcConfigBuilder.Initial with + implicitIncludeDir = implicitIncludeDir + defaultFSharpBinariesDir = defaultFSharpBinariesDir + reduceMemoryUsage = reduceMemoryUsage + legacyReferenceResolver = legacyReferenceResolver + isInteractive = isInteractive + isInvalidationSupported = isInvalidationSupported + copyFSharpCore = defaultCopyFSharpCore + tryGetMetadataSnapshot = tryGetMetadataSnapshot + } member tcConfigB.ResolveSourceFile(m, nm, pathLoadedFrom) = use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter @@ -2494,7 +2509,7 @@ type TcConfigBuilder = member tcConfigB.DecideNames (sourceFiles) = use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter if sourceFiles = [] then errorR(Error(FSComp.SR.buildNoInputsSpecified(), rangeCmdArgs)) - let ext() = match tcConfigB.target with Dll -> ".dll" | Module -> ".netmodule" | ConsoleExe | WinExe -> ".exe" + let ext() = match tcConfigB.target with CompilerTarget.Dll -> ".dll" | CompilerTarget.Module -> ".netmodule" | CompilerTarget.ConsoleExe | CompilerTarget.WinExe -> ".exe" let implFiles = sourceFiles |> List.filter (fun lower -> List.exists (Filename.checkSuffix (String.lowercase lower)) FSharpImplFileSuffixes) let outfile = match tcConfigB.outputFile, List.rev implFiles with @@ -2607,7 +2622,7 @@ type TcConfigBuilder = ri, fileNameOfPath ri, ILResourceAccess.Public -let OpenILBinary(filename, optimizeForMemory, openBinariesInMemory, ilGlobalsOpt, pdbPathOption, shadowCopyReferences) = +let OpenILBinary(filename, reduceMemoryUsage, ilGlobalsOpt, pdbPathOption, shadowCopyReferences, tryGetMetadataSnapshot) = let ilGlobals = // ILScopeRef.Local can be used only for primary assembly (mscorlib or System.Runtime) itself // Remaining assemblies should be opened using existing ilGlobals (so they can properly locate fundamental types) @@ -2615,18 +2630,14 @@ let OpenILBinary(filename, optimizeForMemory, openBinariesInMemory, ilGlobalsOpt | None -> mkILGlobals ILScopeRef.Local | Some g -> g - let opts = { ILBinaryReader.mkDefault ilGlobals with - // fsc.exe does not uses optimizeForMemory (hence keeps MORE caches in AbstractIL) - // fsi.exe does use optimizeForMemory (hence keeps FEWER caches in AbstractIL), because its long running - // Visual Studio does use optimizeForMemory (hence keeps FEWER caches in AbstractIL), because its long running - ILBinaryReader.optimizeForMemory=optimizeForMemory - ILBinaryReader.pdbPath = pdbPathOption } + let opts : ILReaderOptions = + { ilGlobals = ilGlobals + metadataOnly = MetadataOnlyFlag.Yes + reduceMemoryUsage = reduceMemoryUsage + pdbPath = pdbPathOption + tryGetMetadataSnapshot = tryGetMetadataSnapshot } - // Visual Studio uses OpenILModuleReaderAfterReadingAllBytes for all DLLs to avoid having to dispose of any readers explicitly - if openBinariesInMemory then // && not syslib - ILBinaryReader.OpenILModuleReaderAfterReadingAllBytes filename opts - else - let location = + let location = #if !FX_RESHAPED_REFLECTION // shadow copy not supported // In order to use memory mapped files on the shadow copied version of the Assembly, we `preload the assembly // We swallow all exceptions so that we do not change the exception contract of this API @@ -2639,7 +2650,7 @@ let OpenILBinary(filename, optimizeForMemory, openBinariesInMemory, ilGlobalsOpt ignore shadowCopyReferences #endif filename - ILBinaryReader.OpenILModuleReader location opts + OpenILModuleReader location opts #if DEBUG [] @@ -2662,7 +2673,7 @@ type AssemblyResolution = /// This is because ``EvaluateRawContents(ctok)`` is used. However this path is only currently used /// in fsi.fs, which does not use project references. // - member this.GetILAssemblyRef(ctok) = + member this.GetILAssemblyRef(ctok, reduceMemoryUsage, tryGetMetadataSnapshot) = cancellable { match !this.ilAssemblyRef with | Some(assref) -> return assref @@ -2684,8 +2695,13 @@ type AssemblyResolution = match assRefOpt with | Some aref -> aref | None -> - let readerSettings : ILBinaryReader.ILReaderOptions = {pdbPath=None;ilGlobals = EcmaMscorlibILGlobals;optimizeForMemory=false} - use reader = ILBinaryReader.OpenILModuleReaderAfterReadingAllBytes this.resolvedPath readerSettings + let readerSettings : ILReaderOptions = + { pdbPath=None + ilGlobals = EcmaMscorlibILGlobals + reduceMemoryUsage = reduceMemoryUsage + metadataOnly = MetadataOnlyFlag.Yes + tryGetMetadataSnapshot = tryGetMetadataSnapshot } + use reader = OpenILModuleReader this.resolvedPath readerSettings mkRefToILAssembly reader.ILModuleDef.ManifestOfAssembly this.ilAssemblyRef := Some(assRef) return assRef @@ -2769,7 +2785,7 @@ type TcConfig private (data : TcConfigBuilder, validate:bool) = | Some(primaryAssemblyFilename) -> let filename = ComputeMakePathAbsolute data.implicitIncludeDir primaryAssemblyFilename try - use ilReader = OpenILBinary(filename, data.optimizeForMemory, data.openBinariesInMemory, None, None, data.shadowCopyReferences) + use ilReader = OpenILBinary(filename, data.reduceMemoryUsage, None, None, data.shadowCopyReferences, data.tryGetMetadataSnapshot) let ilModule = ilReader.ILModuleDef match ilModule.ManifestOfAssembly.Version with | Some(v1, v2, _, _) -> @@ -2798,11 +2814,11 @@ type TcConfig private (data : TcConfigBuilder, validate:bool) = data.defaultFSharpBinariesDir #else match fslibExplicitFilenameOpt with - | Some(fslibFilename) -> + | Some fslibFilename -> let filename = ComputeMakePathAbsolute data.implicitIncludeDir fslibFilename if fslibReference.ProjectReference.IsNone then try - use ilReader = OpenILBinary(filename, data.optimizeForMemory, data.openBinariesInMemory, None, None, data.shadowCopyReferences) + use ilReader = OpenILBinary(filename, data.reduceMemoryUsage, None, None, data.shadowCopyReferences, data.tryGetMetadataSnapshot) () with e -> error(Error(FSComp.SR.buildErrorOpeningBinaryFile(filename, e.Message), rangeStartup)) @@ -2818,7 +2834,6 @@ type TcConfig private (data : TcConfigBuilder, validate:bool) = member x.noFeedback = data.noFeedback member x.stackReserveSize = data.stackReserveSize member x.implicitIncludeDir = data.implicitIncludeDir - member x.openBinariesInMemory = data.openBinariesInMemory member x.openDebugInformationForLaterStaticLinking = data.openDebugInformationForLaterStaticLinking member x.fsharpBinariesDir = fsharpBinariesDirValue member x.compilingFslib = data.compilingFslib @@ -2838,7 +2853,7 @@ type TcConfig private (data : TcConfigBuilder, validate:bool) = member x.referencedDLLs = data.referencedDLLs member x.knownUnresolvedReferences = data.knownUnresolvedReferences member x.clrRoot = clrRootValue - member x.optimizeForMemory = data.optimizeForMemory + member x.reduceMemoryUsage = data.reduceMemoryUsage member x.subsystemVersion = data.subsystemVersion member x.useHighEntropyVA = data.useHighEntropyVA member x.inputCodePage = data.inputCodePage @@ -2933,6 +2948,7 @@ type TcConfig private (data : TcConfigBuilder, validate:bool) = member x.sqmSessionStartedTime = data.sqmSessionStartedTime member x.copyFSharpCore = data.copyFSharpCore member x.shadowCopyReferences = data.shadowCopyReferences + member x.tryGetMetadataSnapshot = data.tryGetMetadataSnapshot static member Create(builder, validate) = use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parameter TcConfig(builder, validate) @@ -3067,10 +3083,6 @@ type TcConfig private (data : TcConfigBuilder, validate:bool) = let ext = System.IO.Path.GetExtension(nm) let isNetModule = String.Compare(ext, ".netmodule", StringComparison.OrdinalIgnoreCase)=0 - let unknownToolTip (resolvedPath, resolved) = - let line(append:string) = append.Trim([|' '|])+"\n" - line(resolvedPath) + line(resolved) - // See if the language service has already produced the contents of the assembly for us, virtually match r.ProjectReference with | Some _ -> @@ -3102,20 +3114,13 @@ type TcConfig private (data : TcConfigBuilder, validate:bool) = match resolved with | Some(resolved) -> let sysdir = tcConfig.IsSystemAssembly resolved - let fusionName = - if isNetModule then "" - else - try - let readerSettings : ILBinaryReader.ILReaderOptions = {pdbPath=None;ilGlobals = EcmaMscorlibILGlobals;optimizeForMemory=false} - use reader = ILBinaryReader.OpenILModuleReaderAfterReadingAllBytes resolved readerSettings - let assRef = mkRefToILAssembly reader.ILModuleDef.ManifestOfAssembly - assRef.QualifiedName - with e -> - "" Some { originalReference = r resolvedPath = resolved - prepareToolTip = (fun () -> unknownToolTip (resolved, fusionName)) + prepareToolTip = (fun () -> + let fusionName = System.Reflection.AssemblyName.GetAssemblyName(resolved).ToString() + let line(append:string) = append.Trim([|' '|])+"\n" + line(resolved) + line(fusionName)) sysdir = sysdir ilAssemblyRef = ref None } | None -> None @@ -3177,7 +3182,7 @@ type TcConfig private (data : TcConfigBuilder, validate:bool) = let logDiagnostic showMessages = (fun isError code message-> - if showMessages && mode = ReportErrors then + if showMessages && mode = ResolveAssemblyReferenceMode.ReportErrors then if isError then errorR(MSBuildReferenceResolutionError(code, message, errorAndWarningRange)) else @@ -3243,11 +3248,11 @@ type TcConfig private (data : TcConfigBuilder, validate:bool) = ms|>List.map(fun originalReference -> System.Diagnostics.Debug.Assert(FileSystem.IsPathRootedShim(resolvedFile.itemSpec), sprintf "msbuild-resolved path is not absolute: '%s'" resolvedFile.itemSpec) let canonicalItemSpec = FileSystem.GetFullPathShim(resolvedFile.itemSpec) - {originalReference=originalReference - resolvedPath=canonicalItemSpec - prepareToolTip = (fun () -> resolvedFile.prepareToolTip (originalReference.Text, canonicalItemSpec)) - sysdir= tcConfig.IsSystemAssembly canonicalItemSpec - ilAssemblyRef = ref None}) + { originalReference=originalReference + resolvedPath=canonicalItemSpec + prepareToolTip = (fun () -> resolvedFile.prepareToolTip (originalReference.Text, canonicalItemSpec)) + sysdir= tcConfig.IsSystemAssembly canonicalItemSpec + ilAssemblyRef = ref None }) (maxIndexOfReference, assemblyResolutions)) // When calculating the resulting resolutions, we're going to use the index of the reference @@ -3276,7 +3281,7 @@ type TcConfig private (data : TcConfigBuilder, validate:bool) = // If mode=Speculative, then we haven't reported any errors. // We report the error condition by returning an empty list of resolutions - if mode = Speculative && (List.length unresolvedReferences) > 0 then + if mode = ResolveAssemblyReferenceMode.Speculative && (List.length unresolvedReferences) > 0 then [], (List.ofArray groupedReferences) |> List.map (fun (name, _, r) -> (name, r)) |> List.map UnresolvedAssemblyReference else resultingResolutions, unresolvedReferences |> List.map (fun (name, _, r) -> (name, r)) |> List.map UnresolvedAssemblyReference @@ -3622,7 +3627,7 @@ let ParseOneInputLexbuf (tcConfig:TcConfig, lexResourceManager, conditionalCompi with e -> (* errorR(Failure("parse failed")); *) errorRecovery e rangeStartup; None -let ParseOneInputFile (tcConfig:TcConfig, lexResourceManager, conditionalCompilationDefines, filename, isLastCompiland, errorLogger, retryLocked) = +let ParseOneInputFile (tcConfig: TcConfig, lexResourceManager, conditionalCompilationDefines, filename, isLastCompiland, errorLogger, retryLocked) = try let lower = String.lowercase filename if List.exists (Filename.checkSuffix lower) (FSharpSigFileSuffixes@FSharpImplFileSuffixes) then @@ -3636,16 +3641,16 @@ let ParseOneInputFile (tcConfig:TcConfig, lexResourceManager, conditionalCompila [] -type TcAssemblyResolutions(results : AssemblyResolution list, unresolved : UnresolvedAssemblyReference list) = +type TcAssemblyResolutions(tcConfig: TcConfig, results: AssemblyResolution list, unresolved : UnresolvedAssemblyReference list) = let originalReferenceToResolution = results |> List.map (fun r -> r.originalReference.Text, r) |> Map.ofList let resolvedPathToResolution = results |> List.map (fun r -> r.resolvedPath, r) |> Map.ofList /// Add some resolutions to the map of resolution results. - member tcResolutions.AddResolutionResults(newResults) = TcAssemblyResolutions(results @ newResults, unresolved) + member tcResolutions.AddResolutionResults(newResults) = TcAssemblyResolutions(tcConfig, results @ newResults, unresolved) /// Add some unresolved results. - member tcResolutions.AddUnresolvedReferences(newUnresolved) = TcAssemblyResolutions(results, unresolved @ newUnresolved) + member tcResolutions.AddUnresolvedReferences(newUnresolved) = TcAssemblyResolutions(tcConfig, results, unresolved @ newUnresolved) /// Get information about referenced DLLs member tcResolutions.GetAssemblyResolutions() = results @@ -3655,13 +3660,13 @@ type TcAssemblyResolutions(results : AssemblyResolution list, unresolved : Unres /// This doesn't need to be cancellable, it is only used by F# Interactive member tcResolution.TryFindByExactILAssemblyRef (ctok, assref) = results |> List.tryFind (fun ar-> - let r = ar.GetILAssemblyRef(ctok) |> Cancellable.runWithoutCancellation + let r = ar.GetILAssemblyRef(ctok, tcConfig.reduceMemoryUsage, tcConfig.tryGetMetadataSnapshot) |> Cancellable.runWithoutCancellation r = assref) /// This doesn't need to be cancellable, it is only used by F# Interactive member tcResolution.TryFindBySimpleAssemblyName (ctok, simpleAssemName) = results |> List.tryFind (fun ar-> - let r = ar.GetILAssemblyRef(ctok) |> Cancellable.runWithoutCancellation + let r = ar.GetILAssemblyRef(ctok, tcConfig.reduceMemoryUsage, tcConfig.tryGetMetadataSnapshot) |> Cancellable.runWithoutCancellation r.Name = simpleAssemName) member tcResolutions.TryFindByResolvedPath nm = resolvedPathToResolution.TryFind nm @@ -3683,8 +3688,8 @@ type TcAssemblyResolutions(results : AssemblyResolution list, unresolved : Unres successes, failures else RequireCompilationThread ctok // we don't want to do assembly resolution concurrently, we assume MSBuild doesn't handle this - TcConfig.TryResolveLibsUsingMSBuildRules (tcConfig, assemblyList, rangeStartup, ReportErrors) - TcAssemblyResolutions(resolved, unresolved @ knownUnresolved) + TcConfig.TryResolveLibsUsingMSBuildRules (tcConfig, assemblyList, rangeStartup, ResolveAssemblyReferenceMode.ReportErrors) + TcAssemblyResolutions(tcConfig, resolved, unresolved @ knownUnresolved) static member GetAllDllReferences (tcConfig:TcConfig) = @@ -3772,22 +3777,15 @@ let GetOptimizationDataResourceName (r: ILResource) = let IsReflectedDefinitionsResource (r: ILResource) = r.Name.StartsWith QuotationPickler.SerializedReflectedDefinitionsResourceNameBase -type ILResource with - /// Get a function to read the bytes from a resource local to an assembly - member r.GetByteReader(m) = - match r.Location with - | ILResourceLocation.Local b -> b - | _-> error(InternalError("GetByteReader", m)) - let MakeILResource rname bytes = { Name = rname - Location = ILResourceLocation.Local (fun () -> bytes) + Location = ILResourceLocation.LocalOut bytes Access = ILResourceAccess.Public CustomAttrs = emptyILCustomAttrs } let PickleToResource inMem file g scope rname p x = { Name = rname - Location = (let bytes = pickleObjWithDanglingCcus inMem file g scope p x in ILResourceLocation.Local (fun () -> bytes)) + Location = (let bytes = pickleObjWithDanglingCcus inMem file g scope p x in ILResourceLocation.LocalOut bytes) Access = ILResourceAccess.Public CustomAttrs = emptyILCustomAttrs } @@ -3829,8 +3827,8 @@ type RawFSharpAssemblyDataBackedByFileOnDisk (ilModule: ILModuleDef, ilAssemblyR [ for iresource in resources do if IsSignatureDataResource iresource then let ccuName = GetSignatureDataResourceName iresource - let byteReader = iresource.GetByteReader(m) - yield (ccuName, byteReader()) ] + let bytes = iresource.GetBytes() + yield (ccuName, bytes) ] let sigDataReaders = if sigDataReaders.IsEmpty && List.contains ilShortAssemName externalSigAndOptData then @@ -3844,7 +3842,7 @@ type RawFSharpAssemblyDataBackedByFileOnDisk (ilModule: ILModuleDef, ilAssemblyR member __.GetRawFSharpOptimizationData(m, ilShortAssemName, filename) = let optDataReaders = ilModule.Resources.AsList - |> List.choose (fun r -> if IsOptimizationDataResource r then Some(GetOptimizationDataResourceName r, r.GetByteReader(m)) else None) + |> List.choose (fun r -> if IsOptimizationDataResource r then Some(GetOptimizationDataResourceName r, (fun () -> r.GetBytes())) else None) // Look for optimization data in a file let optDataReaders = @@ -4056,11 +4054,15 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti let ilScopeRef = ILScopeRef.Assembly (ILAssemblyRef.FromAssemblyName aname) let fileName = aname.Name + ".dll" let bytes = assembly.PApplyWithProvider((fun (assembly, provider) -> assembly.GetManifestModuleContents(provider)), m).PUntaint(id, m) + let tcConfig = tcConfigP.Get(ctok) let ilModule, ilAssemblyRefs = - let opts = { ILBinaryReader.mkDefault g.ilg with - ILBinaryReader.optimizeForMemory=true - ILBinaryReader.pdbPath = None } - let reader = ILBinaryReader.OpenILModuleReaderFromBytes fileName bytes opts + let opts : ILReaderOptions = + { ilGlobals = g.ilg + reduceMemoryUsage = tcConfig.reduceMemoryUsage + pdbPath = None + metadataOnly = MetadataOnlyFlag.Yes + tryGetMetadataSnapshot = tcConfig.tryGetMetadataSnapshot } + let reader = OpenILModuleReaderFromBytes fileName bytes opts reader.ILModuleDef, reader.ILAssemblyRefs let theActualAssembly = assembly.PUntaint((fun x -> x.Handle), m) @@ -4121,15 +4123,6 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti CheckDisposed() disposeActions <- action :: disposeActions - override obj.ToString() = - sprintf "tcImports = \n dllInfos=%A\n dllTable=%A\n ccuInfos=%A\n ccuTable=%A\n Base=%s\n" - dllInfos - dllTable - ccuInfos - ccuTable - (match importsBase with None-> "None" | Some(importsBase) -> importsBase.ToString()) - - // Note: the returned binary reader is associated with the tcImports, i.e. when the tcImports are closed // then the reader is closed. member tcImports.OpenILBinaryModule(ctok, filename, m) = @@ -4149,7 +4142,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti None else None - let ilILBinaryReader = OpenILBinary(filename, tcConfig.optimizeForMemory, tcConfig.openBinariesInMemory, ilGlobalsOpt, pdbPathOption, tcConfig.shadowCopyReferences) + let ilILBinaryReader = OpenILBinary(filename, tcConfig.reduceMemoryUsage, ilGlobalsOpt, pdbPathOption, tcConfig.shadowCopyReferences, tcConfig.tryGetMetadataSnapshot) tcImports.AttachDisposeAction(fun _ -> (ilILBinaryReader :> IDisposable).Dispose()) ilILBinaryReader.ILModuleDef, ilILBinaryReader.ILAssemblyRefs with e -> @@ -4826,6 +4819,8 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti disposeActions <- [] for action in actions do action() + override tcImports.ToString() = "TcImports(...)" + /// Process #r in F# Interactive. /// Adds the reference to the tcImports and add the ccu to the type checking environment. let RequireDLL (ctok, tcImports:TcImports, tcEnv, thisAssemblyName, m, file) = @@ -5056,11 +5051,11 @@ module private ScriptPreprocessClosure = ParseOneInputLexbuf (tcConfig, lexResourceManager, defines, lexbuf, filename, isLastCompiland, errorLogger) /// Create a TcConfig for load closure starting from a single .fsx file - let CreateScriptSourceTcConfig (legacyReferenceResolver, defaultFSharpBinariesDir, filename:string, codeContext, useSimpleResolution, useFsiAuxLib, basicReferences, applyCommandLineArgs, assumeDotNetFramework) = + let CreateScriptTextTcConfig (legacyReferenceResolver, defaultFSharpBinariesDir, filename:string, codeContext, useSimpleResolution, useFsiAuxLib, basicReferences, applyCommandLineArgs, assumeDotNetFramework, tryGetMetadataSnapshot, reduceMemoryUsage) = let projectDir = Path.GetDirectoryName(filename) let isInteractive = (codeContext = CodeContext.CompilationAndEvaluation) let isInvalidationSupported = (codeContext = CodeContext.Editing) - let tcConfigB = TcConfigBuilder.CreateNew(legacyReferenceResolver, defaultFSharpBinariesDir, true (* optimize for memory *), projectDir, isInteractive, isInvalidationSupported, defaultCopyFSharpCore=false) + let tcConfigB = TcConfigBuilder.CreateNew(legacyReferenceResolver, defaultFSharpBinariesDir, reduceMemoryUsage, projectDir, isInteractive, isInvalidationSupported, defaultCopyFSharpCore=CopyFSharpCoreFlag.No, tryGetMetadataSnapshot=tryGetMetadataSnapshot) applyCommandLineArgs tcConfigB match basicReferences with | None -> BasicReferencesForScriptLoadClosure(useFsiAuxLib, assumeDotNetFramework) |> List.iter(fun f->tcConfigB.AddReferencedAssemblyByPath(range0, f)) // Add script references @@ -5085,7 +5080,7 @@ module private ScriptPreprocessClosure = use reader = match inputCodePage with | None -> new StreamReader(stream, true) - | Some n -> new StreamReader(stream, Encoding.GetEncodingShim(n)) + | Some (n: int) -> new StreamReader(stream, Encoding.GetEncoding(n)) let source = reader.ReadToEnd() [ClosureSource(filename, m, source, parseRequired)] with e -> @@ -5223,18 +5218,18 @@ module private ScriptPreprocessClosure = result /// Given source text, find the full load closure. Used from service.fs, when editing a script file - let GetFullClosureOfScriptSource(ctok, legacyReferenceResolver, defaultFSharpBinariesDir, filename, source, codeContext, useSimpleResolution, useFsiAuxLib, lexResourceManager:Lexhelp.LexResourceManager, applyCommmandLineArgs, assumeDotNetFramework) = + let GetFullClosureOfScriptText(ctok, legacyReferenceResolver, defaultFSharpBinariesDir, filename, source, codeContext, useSimpleResolution, useFsiAuxLib, lexResourceManager:Lexhelp.LexResourceManager, applyCommmandLineArgs, assumeDotNetFramework, tryGetMetadataSnapshot, reduceMemoryUsage) = // Resolve the basic references such as FSharp.Core.dll first, before processing any #I directives in the script // // This is tries to mimic the action of running the script in F# Interactive - the initial context for scripting is created // first, then #I and other directives are processed. let references0 = - let tcConfig = CreateScriptSourceTcConfig(legacyReferenceResolver, defaultFSharpBinariesDir, filename, codeContext, useSimpleResolution, useFsiAuxLib, None, applyCommmandLineArgs, assumeDotNetFramework) + let tcConfig = CreateScriptTextTcConfig(legacyReferenceResolver, defaultFSharpBinariesDir, filename, codeContext, useSimpleResolution, useFsiAuxLib, None, applyCommmandLineArgs, assumeDotNetFramework, tryGetMetadataSnapshot, reduceMemoryUsage) let resolutions0, _unresolvedReferences = GetAssemblyResolutionInformation(ctok, tcConfig) let references0 = resolutions0 |> List.map (fun r->r.originalReference.Range, r.resolvedPath) |> Seq.distinct |> List.ofSeq references0 - let tcConfig = CreateScriptSourceTcConfig(legacyReferenceResolver, defaultFSharpBinariesDir, filename, codeContext, useSimpleResolution, useFsiAuxLib, Some references0, applyCommmandLineArgs, assumeDotNetFramework) + let tcConfig = CreateScriptTextTcConfig(legacyReferenceResolver, defaultFSharpBinariesDir, filename, codeContext, useSimpleResolution, useFsiAuxLib, Some references0, applyCommmandLineArgs, assumeDotNetFramework, tryGetMetadataSnapshot, reduceMemoryUsage) let closureSources = [ClosureSource(filename, range0, source, true)] let closureFiles, tcConfig = FindClosureFiles(closureSources, tcConfig, codeContext, lexResourceManager) @@ -5249,14 +5244,18 @@ module private ScriptPreprocessClosure = GetLoadClosure(ctok, mainFile, closureFiles, tcConfig, codeContext) type LoadClosure with - // Used from service.fs, when editing a script file - static member ComputeClosureOfSourceText(ctok, legacyReferenceResolver, defaultFSharpBinariesDir, filename:string, source:string, codeContext, useSimpleResolution:bool, useFsiAuxLib, lexResourceManager:Lexhelp.LexResourceManager, applyCommmandLineArgs, assumeDotNetFramework) : LoadClosure = + /// Analyze a script text and find the closure of its references. + /// Used from FCS, when editing a script file. + // + /// A temporary TcConfig is created along the way, is why this routine takes so many arguments. We want to be sure to use exactly the + /// same arguments as the rest of the application. + static member ComputeClosureOfScriptText(ctok, legacyReferenceResolver, defaultFSharpBinariesDir, filename:string, source:string, codeContext, useSimpleResolution:bool, useFsiAuxLib, lexResourceManager:Lexhelp.LexResourceManager, applyCommmandLineArgs, assumeDotNetFramework, tryGetMetadataSnapshot, reduceMemoryUsage) : LoadClosure = use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse - ScriptPreprocessClosure.GetFullClosureOfScriptSource(ctok, legacyReferenceResolver, defaultFSharpBinariesDir, filename, source, codeContext, useSimpleResolution, useFsiAuxLib, lexResourceManager, applyCommmandLineArgs, assumeDotNetFramework) + ScriptPreprocessClosure.GetFullClosureOfScriptText(ctok, legacyReferenceResolver, defaultFSharpBinariesDir, filename, source, codeContext, useSimpleResolution, useFsiAuxLib, lexResourceManager, applyCommmandLineArgs, assumeDotNetFramework, tryGetMetadataSnapshot, reduceMemoryUsage) - /// Used from fsi.fs and fsc.fs, for #load and command line. - /// The resulting references are then added to a TcConfig. - static member ComputeClosureOfSourceFiles (ctok, tcConfig:TcConfig, files:(string*range) list, codeContext, lexResourceManager:Lexhelp.LexResourceManager) = + /// Analyze a set of script files and find the closure of their references. The resulting references are then added to the given TcConfig. + /// Used from fsi.fs and fsc.fs, for #load and command line. + static member ComputeClosureOfScriptFiles (ctok, tcConfig:TcConfig, files:(string*range) list, codeContext, lexResourceManager:Lexhelp.LexResourceManager) = use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse ScriptPreprocessClosure.GetFullClosureOfScriptFiles (ctok, tcConfig, files, codeContext, lexResourceManager) diff --git a/src/fsharp/CompileOps.fsi b/src/fsharp/CompileOps.fsi index 1d7d2b1f77..22a9e176c6 100755 --- a/src/fsharp/CompileOps.fsi +++ b/src/fsharp/CompileOps.fsi @@ -6,7 +6,9 @@ module internal Microsoft.FSharp.Compiler.CompileOps open System open System.Text open System.Collections.Generic +open Microsoft.FSharp.Compiler.AbstractIL open Microsoft.FSharp.Compiler.AbstractIL.IL +open Microsoft.FSharp.Compiler.AbstractIL.ILBinaryReader open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library open Microsoft.FSharp.Compiler open Microsoft.FSharp.Compiler.TypeChecker @@ -204,6 +206,7 @@ type UnresolvedAssemblyReference = UnresolvedAssemblyReference of string * Assem type ResolvedExtensionReference = ResolvedExtensionReference of string * AssemblyReference list * Tainted list #endif +[] type CompilerTarget = | WinExe | ConsoleExe @@ -211,10 +214,14 @@ type CompilerTarget = | Module member IsExe: bool +[] type ResolveAssemblyReferenceMode = | Speculative | ReportErrors +[] +type CopyFSharpCoreFlag = Yes | No + //---------------------------------------------------------------------------- // TcConfig //-------------------------------------------------------------------------- @@ -227,13 +234,13 @@ type VersionFlag = member GetVersionInfo: implicitIncludeDir:string -> ILVersionInfo member GetVersionString: implicitIncludeDir:string -> string +[] type TcConfigBuilder = { mutable primaryAssembly: PrimaryAssembly mutable autoResolveOpenDirectivesToDlls: bool mutable noFeedback: bool mutable stackReserveSize: int32 option mutable implicitIncludeDir: string - mutable openBinariesInMemory: bool mutable openDebugInformationForLaterStaticLinking: bool defaultFSharpBinariesDir: string mutable compilingFslib: bool @@ -256,7 +263,7 @@ type TcConfigBuilder = mutable referencedDLLs: AssemblyReference list mutable projectReferences: IProjectReference list mutable knownUnresolvedReferences: UnresolvedAssemblyReference list - optimizeForMemory: bool + reduceMemoryUsage: ReduceMemoryFlag mutable subsystemVersion: int * int mutable useHighEntropyVA: bool mutable inputCodePage: int option @@ -353,8 +360,12 @@ type TcConfigBuilder = sqmSessionStartedTime: int64 mutable emitDebugInfoInQuotations: bool mutable exename: string option - mutable copyFSharpCore: bool + mutable copyFSharpCore: CopyFSharpCoreFlag mutable shadowCopyReferences: bool + + /// A function to call to try to get an object that acts as a snapshot of the metadata section of a .NET binary, + /// and from which we can read the metadata. Only used when metadataOnly=true. + mutable tryGetMetadataSnapshot : ILReaderTryGetMetadataSnapshot } static member Initial: TcConfigBuilder @@ -362,11 +373,13 @@ type TcConfigBuilder = static member CreateNew: legacyReferenceResolver: ReferenceResolver.Resolver * defaultFSharpBinariesDir: string * - optimizeForMemory: bool * + reduceMemoryUsage: ReduceMemoryFlag * implicitIncludeDir: string * isInteractive: bool * isInvalidationSupported: bool * - defaultCopyFSharpCore: bool -> TcConfigBuilder + defaultCopyFSharpCore: CopyFSharpCoreFlag * + tryGetMetadataSnapshot: ILReaderTryGetMetadataSnapshot + -> TcConfigBuilder member DecideNames: string list -> outfile: string * pdbfile: string option * assemblyName: string member TurnWarningOff: range * string -> unit @@ -389,7 +402,6 @@ type TcConfig = member noFeedback: bool member stackReserveSize: int32 option member implicitIncludeDir: string - member openBinariesInMemory: bool member openDebugInformationForLaterStaticLinking: bool member fsharpBinariesDir: string member compilingFslib: bool @@ -408,7 +420,7 @@ type TcConfig = member subsystemVersion: int * int member useHighEntropyVA: bool member referencedDLLs: AssemblyReference list - member optimizeForMemory: bool + member reduceMemoryUsage: ReduceMemoryFlag member inputCodePage: int option member embedResources: string list member errorSeverityOptions: FSharpErrorSeverityOptions @@ -515,7 +527,7 @@ type TcConfig = member sqmSessionGuid: System.Guid option member sqmNumOfSourceFiles: int member sqmSessionStartedTime: int64 - member copyFSharpCore: bool + member copyFSharpCore: CopyFSharpCoreFlag member shadowCopyReferences: bool static member Create: TcConfigBuilder * validate: bool -> TcConfig @@ -567,11 +579,8 @@ type ImportedAssembly = [] type TcAssemblyResolutions = member GetAssemblyResolutions: unit -> AssemblyResolution list - static member SplitNonFoundationalResolutions : CompilationThreadToken * TcConfig -> AssemblyResolution list * AssemblyResolution list * UnresolvedAssemblyReference list static member BuildFromPriorResolutions : CompilationThreadToken * TcConfig * AssemblyResolution list * UnresolvedAssemblyReference list -> TcAssemblyResolutions - - /// Represents a table of imported assemblies with their resolutions. [] @@ -636,6 +645,9 @@ val WriteSignatureData: TcConfig * TcGlobals * Tastops.Remap * CcuThunk * filena /// Write F# optimization data as an IL resource val WriteOptimizationData: TcGlobals * filename: string * inMem: bool * CcuThunk * Optimizer.LazyModuleInfo -> ILResource +//---------------------------------------------------------------------------- +// #r and other directives +//-------------------------------------------------------------------------- //---------------------------------------------------------------------------- // #r and other directives @@ -751,7 +763,6 @@ type LoadClosureInput = ParseDiagnostics: (PhasedDiagnostic * bool) list MetaCommandDiagnostics: (PhasedDiagnostic * bool) list } - [] type LoadClosure = { /// The source files along with the ranges of the #load positions in each file. @@ -781,8 +792,13 @@ type LoadClosure = /// Diagnostics seen while processing the compiler options implied root of closure LoadClosureRootFileDiagnostics: (PhasedDiagnostic * bool) list } - // Used from service.fs, when editing a script file - static member ComputeClosureOfSourceText: CompilationThreadToken * legacyReferenceResolver: ReferenceResolver.Resolver * defaultFSharpBinariesDir: string * filename: string * source: string * implicitDefines:CodeContext * useSimpleResolution: bool * useFsiAuxLib: bool * lexResourceManager: Lexhelp.LexResourceManager * applyCompilerOptions: (TcConfigBuilder -> unit) * assumeDotNetFramework: bool -> LoadClosure + /// Analyze a script text and find the closure of its references. + /// Used from FCS, when editing a script file. + // + /// A temporary TcConfig is created along the way, is why this routine takes so many arguments. We want to be sure to use exactly the + /// same arguments as the rest of the application. + static member ComputeClosureOfScriptText: CompilationThreadToken * legacyReferenceResolver: ReferenceResolver.Resolver * defaultFSharpBinariesDir: string * filename: string * source: string * implicitDefines:CodeContext * useSimpleResolution: bool * useFsiAuxLib: bool * lexResourceManager: Lexhelp.LexResourceManager * applyCompilerOptions: (TcConfigBuilder -> unit) * assumeDotNetFramework: bool * tryGetMetadataSnapshot: ILReaderTryGetMetadataSnapshot * reduceMemoryUsage: ReduceMemoryFlag -> LoadClosure - /// Used from fsi.fs and fsc.fs, for #load and command line. The resulting references are then added to a TcConfig. - static member ComputeClosureOfSourceFiles: CompilationThreadToken * tcConfig:TcConfig * (string * range) list * implicitDefines:CodeContext * lexResourceManager: Lexhelp.LexResourceManager -> LoadClosure + /// Analyze a set of script files and find the closure of their references. The resulting references are then added to the given TcConfig. + /// Used from fsi.fs and fsc.fs, for #load and command line. + static member ComputeClosureOfScriptFiles: CompilationThreadToken * tcConfig:TcConfig * (string * range) list * implicitDefines:CodeContext * lexResourceManager: Lexhelp.LexResourceManager -> LoadClosure diff --git a/src/fsharp/CompileOptions.fs b/src/fsharp/CompileOptions.fs index dd4ea4e1ef..871eb5ea17 100644 --- a/src/fsharp/CompileOptions.fs +++ b/src/fsharp/CompileOptions.fs @@ -457,10 +457,10 @@ let (++) x s = x @ [s] let SetTarget (tcConfigB : TcConfigBuilder)(s : string) = match s.ToLowerInvariant() with - | "exe" -> tcConfigB.target <- ConsoleExe - | "winexe" -> tcConfigB.target <- WinExe - | "library" -> tcConfigB.target <- Dll - | "module" -> tcConfigB.target <- Module + | "exe" -> tcConfigB.target <- CompilerTarget.ConsoleExe + | "winexe" -> tcConfigB.target <- CompilerTarget.WinExe + | "library" -> tcConfigB.target <- CompilerTarget.Dll + | "module" -> tcConfigB.target <- CompilerTarget.Module | _ -> error(Error(FSComp.SR.optsUnrecognizedTarget(s),rangeCmdArgs)) let SetDebugSwitch (tcConfigB : TcConfigBuilder) (dtype : string option) (s : OptionSwitch) = @@ -648,7 +648,7 @@ let outputFileFlagsFsc (tcConfigB : TcConfigBuilder) = CompilerOption("sig", tagFile, OptionString (setSignatureFile tcConfigB), None, Some (FSComp.SR.optsSig())) - CompilerOption("nocopyfsharpcore", tagNone, OptionUnit (fun () -> tcConfigB.copyFSharpCore <- false), None, Some (FSComp.SR.optsNoCopyFsharpCore())) + CompilerOption("nocopyfsharpcore", tagNone, OptionUnit (fun () -> tcConfigB.copyFSharpCore <- CopyFSharpCoreFlag.No), None, Some (FSComp.SR.optsNoCopyFsharpCore())) ] @@ -738,7 +738,7 @@ let libFlagAbbrev (tcConfigB : TcConfigBuilder) = let codePageFlag (tcConfigB : TcConfigBuilder) = CompilerOption("codepage", tagInt, OptionInt (fun n -> try - System.Text.Encoding.GetEncodingShim(n) |> ignore + System.Text.Encoding.GetEncoding(n) |> ignore with :? System.ArgumentException as err -> error(Error(FSComp.SR.optsProblemWithCodepage(n,err.Message),rangeCmdArgs)) @@ -1016,7 +1016,7 @@ let abbreviatedFlagsFsc tcConfigB = abbreviatedFlagsBoth tcConfigB @ [ (* FSC only abbreviated options *) CompilerOption("o", tagString, OptionString (setOutFileName tcConfigB), None, Some(FSComp.SR.optsShortFormOf("--out"))) - CompilerOption("a", tagString, OptionUnit (fun () -> tcConfigB.target <- Dll), None, Some(FSComp.SR.optsShortFormOf("--target library"))) + CompilerOption("a", tagString, OptionUnit (fun () -> tcConfigB.target <- CompilerTarget.Dll), None, Some(FSComp.SR.optsShortFormOf("--target library"))) (* FSC help abbreviations. FSI has it's own help options... *) CompilerOption("?" , tagNone, OptionHelp (fun blocks -> displayHelpFsc tcConfigB blocks), None, Some(FSComp.SR.optsShortFormOf("--help"))) CompilerOption("help" , tagNone, OptionHelp (fun blocks -> displayHelpFsc tcConfigB blocks), None, Some(FSComp.SR.optsShortFormOf("--help"))) @@ -1348,7 +1348,7 @@ let GenerateIlxCode (ilxBackend, isInteractiveItExpr, isInteractiveOnMono, tcCon fragName = fragName localOptimizationsAreOn= tcConfig.optSettings.localOpt () testFlagEmitFeeFeeAs100001 = tcConfig.testFlagEmitFeeFeeAs100001 - mainMethodInfo= (if (tcConfig.target = Dll || tcConfig.target = Module) then None else Some topAttrs.mainMethodAttrs) + mainMethodInfo= (if (tcConfig.target = CompilerTarget.Dll || tcConfig.target = CompilerTarget.Module) then None else Some topAttrs.mainMethodAttrs) ilxBackend = ilxBackend isInteractive = tcConfig.isInteractive isInteractiveItExpr = isInteractiveItExpr @@ -1372,7 +1372,7 @@ let NormalizeAssemblyRefs (ctok, tcImports:TcImports) scoref = let GetGeneratedILModuleName (t:CompilerTarget) (s:string) = // return the name of the file as a module name - let ext = match t with | Dll -> "dll" | Module -> "netmodule" | _ -> "exe" + let ext = match t with CompilerTarget.Dll -> "dll" | CompilerTarget.Module -> "netmodule" | _ -> "exe" s + "." + ext let ignoreFailureOnMono1_1_16 f = try f() with _ -> () diff --git a/src/fsharp/FSComp.txt b/src/fsharp/FSComp.txt index f09efb42d9..7e0b05f5ea 100644 --- a/src/fsharp/FSComp.txt +++ b/src/fsharp/FSComp.txt @@ -1423,4 +1423,5 @@ notAFunctionButMaybeDeclaration,"This value is not a function and cannot be appl 3219,pickleUnexpectedNonZero,"An error occurred while reading the F# metadata of assembly '%s'. A reserved construct was utilized. You may need to upgrade your F# compiler or use an earlier version of the assembly that doesn't make use of a specific construct." 3220,tcTupleMemberNotNormallyUsed,"This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead." 3221,implicitlyDiscardedInSequenceExpression,"This expression returns a value of type '%s' but is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to use the expression as a value in the sequence then use an explicit 'yield'." -3222,implicitlyDiscardedSequenceInSequenceExpression,"This expression returns a value of type '%s' but is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to use the expression as a value in the sequence then use an explicit 'yield!'." \ No newline at end of file +3222,implicitlyDiscardedSequenceInSequenceExpression,"This expression returns a value of type '%s' but is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to use the expression as a value in the sequence then use an explicit 'yield!'." +3223,ilreadFileChanged,"The file '%s' changed on disk unexpectedly, please reload." \ No newline at end of file diff --git a/src/fsharp/LegacyHostedCompilerForTesting.fs b/src/fsharp/LegacyHostedCompilerForTesting.fs index 38cfd28d8e..1f8e258e07 100644 --- a/src/fsharp/LegacyHostedCompilerForTesting.fs +++ b/src/fsharp/LegacyHostedCompilerForTesting.fs @@ -13,6 +13,7 @@ open Microsoft.FSharp.Compiler open Microsoft.FSharp.Compiler.Driver open Microsoft.FSharp.Compiler.ErrorLogger open Microsoft.FSharp.Compiler.CompileOps +open Microsoft.FSharp.Compiler.AbstractIL.ILBinaryReader open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library /// build issue location @@ -65,7 +66,7 @@ type internal InProcCompiler(legacyReferenceResolver) = { new Exiter with member this.Exit n = exitCode := n; raise StopProcessing } try - typecheckAndCompile(ctok, argv, legacyReferenceResolver, false, false, true, exiter, loggerProvider.Provider, None, None) + typecheckAndCompile(ctok, argv, legacyReferenceResolver, false, ReduceMemoryFlag.Yes, CopyFSharpCoreFlag.Yes, exiter, loggerProvider.Provider, None, None) with | StopProcessing -> () | ReportedError _ | WrappedError(ReportedError _,_) -> diff --git a/src/fsharp/UnicodeLexing.fs b/src/fsharp/UnicodeLexing.fs index 254eb8dd33..b6013c0342 100644 --- a/src/fsharp/UnicodeLexing.fs +++ b/src/fsharp/UnicodeLexing.fs @@ -47,7 +47,7 @@ let UnicodeFileAsLexbuf (filename,codePage : int option, retryLocked:bool) : Le use reader = match codePage with | None -> new StreamReader(stream,true) - | Some n -> new StreamReader(stream,System.Text.Encoding.GetEncodingShim(n)) + | Some n -> new StreamReader(stream,System.Text.Encoding.GetEncoding(n)) reader.ReadToEnd() with // We can get here if the file is locked--like when VS is saving a file--we don't have direct diff --git a/src/fsharp/fsc.fs b/src/fsharp/fsc.fs index f0aa3d96a2..bd28de3b30 100644 --- a/src/fsharp/fsc.fs +++ b/src/fsharp/fsc.fs @@ -30,6 +30,7 @@ open Internal.Utilities.Filename open Microsoft.FSharp.Compiler open Microsoft.FSharp.Compiler.AbstractIL open Microsoft.FSharp.Compiler.AbstractIL.IL +open Microsoft.FSharp.Compiler.AbstractIL.ILBinaryReader open Microsoft.FSharp.Compiler.AbstractIL.Internal open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library open Microsoft.FSharp.Compiler.AbstractIL.Diagnostics @@ -206,7 +207,7 @@ let AdjustForScriptCompile(ctok, tcConfigB:TcConfigBuilder, commandLineSourceFil let AppendClosureInformation(filename) = if IsScript filename then - let closure = LoadClosure.ComputeClosureOfSourceFiles(ctok, tcConfig, [filename, rangeStartup], CodeContext.Compilation, lexResourceManager=lexResourceManager) + let closure = LoadClosure.ComputeClosureOfScriptFiles(ctok, tcConfig, [filename, rangeStartup], CodeContext.Compilation, lexResourceManager=lexResourceManager) // Record the references from the analysis of the script. The full resolutions are recorded as the corresponding #I paths used to resolve them // are local to the scripts and not added to the tcConfigB (they are added to localized clones of the tcConfigB). let references = closure.References |> List.collect snd |> List.filter (fun r->r.originalReference.Range<>range0 && r.originalReference.Range<>rangeStartup) @@ -215,7 +216,7 @@ let AdjustForScriptCompile(ctok, tcConfigB:TcConfigBuilder, commandLineSourceFil closure.SourceFiles |> List.map fst |> List.iter AddIfNotPresent closure.AllRootFileDiagnostics |> List.iter diagnosticSink - else AddIfNotPresent(filename) + else AddIfNotPresent(filename) // Find closure of .fsx files. commandLineSourceFiles |> List.iter AppendClosureInformation @@ -437,7 +438,7 @@ let EncodeInterfaceData(tcConfig: TcConfig, tcGlobals, exportRemapping, generate let useDataFiles = (tcConfig.useOptimizationDataFile || tcGlobals.compilingFslib) && not isIncrementalBuild if useDataFiles then let sigDataFileName = (Filename.chopExtension outfile)+".sigdata" - File.WriteAllBytes(sigDataFileName, resource.Bytes) + File.WriteAllBytes(sigDataFileName, resource.GetBytes()) let resources = [ resource ] let sigAttr = mkSignatureDataVersionAttr tcGlobals (IL.parseILVersion Internal.Utilities.FSharpEnvironment.FSharpBinaryMetadataFormatRevision) @@ -827,7 +828,7 @@ module MainModuleBuilder = let flags = match AttributeHelpers.TryFindIntAttribute tcGlobals "System.Reflection.AssemblyFlagsAttribute" topAttrs.assemblyAttrs with | Some f -> f | _ -> 0x0 // You're only allowed to set a locale if the assembly is a library - if (locale <> None && locale.Value <> "") && tcConfig.target <> Dll then + if (locale <> None && locale.Value <> "") && tcConfig.target <> CompilerTarget.Dll then error(Error(FSComp.SR.fscAssemblyCultureAttributeError(), rangeCmdArgs)) // Add the type forwarders to any .NET DLL post-.NET-2.0, to give binary compatibility @@ -839,7 +840,7 @@ module MainModuleBuilder = else [] - mkILSimpleModule assemblyName (GetGeneratedILModuleName tcConfig.target assemblyName) (tcConfig.target = Dll || tcConfig.target = Module) tcConfig.subsystemVersion tcConfig.useHighEntropyVA ilTypeDefs hashAlg locale flags (mkILExportedTypes exportedTypesList) metadataVersion + mkILSimpleModule assemblyName (GetGeneratedILModuleName tcConfig.target assemblyName) (tcConfig.target = CompilerTarget.Dll || tcConfig.target = CompilerTarget.Module) tcConfig.subsystemVersion tcConfig.useHighEntropyVA ilTypeDefs hashAlg locale flags (mkILExportedTypes exportedTypesList) metadataVersion let disableJitOptimizations = not (tcConfig.optSettings.jitOpt()) @@ -857,7 +858,7 @@ module MainModuleBuilder = [ ] let reflectedDefinitionResource = { Name=reflectedDefinitionResourceName - Location = ILResourceLocation.Local (fun () -> reflectedDefinitionBytes) + Location = ILResourceLocation.LocalOut reflectedDefinitionBytes Access= ILResourceAccess.Public CustomAttrs = emptyILCustomAttrs } reflectedDefinitionAttrs, reflectedDefinitionResource) @@ -878,7 +879,7 @@ module MainModuleBuilder = // Make the manifest of the assembly let manifest = - if tcConfig.target = Module then None else + if tcConfig.target = CompilerTarget.Module then None else let man = mainModule.ManifestOfAssembly let ver = match assemVerFromAttrib with @@ -900,7 +901,7 @@ module MainModuleBuilder = let bytes = FileSystem.ReadAllBytesShim file name, bytes, pub yield { Name=name - Location=ILResourceLocation.Local (fun () -> bytes) + Location=ILResourceLocation.LocalOut bytes Access=pub CustomAttrs=emptyILCustomAttrs } @@ -1013,28 +1014,28 @@ module MainModuleBuilder = #endif let nativeResources = [ for av in assemblyVersionResources findAttribute assemblyVersion do - yield Lazy<_>.CreateFromValue av + yield ILNativeResource.Out av if not(tcConfig.win32res = "") then - yield Lazy<_>.CreateFromValue (FileSystem.ReadAllBytesShim tcConfig.win32res) + yield ILNativeResource.Out (FileSystem.ReadAllBytesShim tcConfig.win32res) if tcConfig.includewin32manifest && not(win32Manifest = "") && not runningOnMono then - yield Lazy<_>.CreateFromValue [| yield! ResFileFormat.ResFileHeader() - yield! (ManifestResourceFormat.VS_MANIFEST_RESOURCE((FileSystem.ReadAllBytesShim win32Manifest), tcConfig.target = Dll)) |]] + yield ILNativeResource.Out [| yield! ResFileFormat.ResFileHeader() + yield! (ManifestResourceFormat.VS_MANIFEST_RESOURCE((FileSystem.ReadAllBytesShim win32Manifest), tcConfig.target = CompilerTarget.Dll)) |]] // Add attributes, version number, resources etc. {mainModule with StackReserveSize = tcConfig.stackReserveSize - Name = (if tcConfig.target = Module then Filename.fileNameOfPath outfile else mainModule.Name) - SubSystemFlags = (if tcConfig.target = WinExe then 2 else 3) + Name = (if tcConfig.target = CompilerTarget.Module then Filename.fileNameOfPath outfile else mainModule.Name) + SubSystemFlags = (if tcConfig.target = CompilerTarget.WinExe then 2 else 3) Resources= resources ImageBase = (match tcConfig.baseAddress with None -> 0x00400000l | Some b -> b) - IsDLL=(tcConfig.target = Dll || tcConfig.target=Module) + IsDLL=(tcConfig.target = CompilerTarget.Dll || tcConfig.target=CompilerTarget.Module) Platform = tcConfig.platform Is32Bit=(match tcConfig.platform with Some X86 -> true | _ -> false) Is64Bit=(match tcConfig.platform with Some AMD64 | Some IA64 -> true | _ -> false) Is32BitPreferred = if tcConfig.prefer32Bit && not tcConfig.target.IsExe then (error(Error(FSComp.SR.invalidPlatformTarget(), rangeCmdArgs))) else tcConfig.prefer32Bit CustomAttrs= mkILCustomAttrs - [ if tcConfig.target = Module then + [ if tcConfig.target = CompilerTarget.Module then yield! iattrs yield! codegenResults.ilNetModuleAttrs ] NativeResources=nativeResources @@ -1122,7 +1123,6 @@ module StaticLinker = let moduls = ilxMainModule :: (List.map snd dependentILModules) - // NOTE: version resources from statically linked DLLs are dropped in the binary reader/writer let savedNativeResources = [ //yield! ilxMainModule.NativeResources for m in moduls do @@ -1159,9 +1159,12 @@ module StaticLinker = let ilBinaryReader = let ilGlobals = mkILGlobals ILScopeRef.Local - let opts = { ILBinaryReader.mkDefault (ilGlobals) with - optimizeForMemory=tcConfig.optimizeForMemory - pdbPath = None } + let opts : ILReaderOptions = + { ilGlobals = ilGlobals + reduceMemoryUsage = tcConfig.reduceMemoryUsage + metadataOnly = MetadataOnlyFlag.No + tryGetMetadataSnapshot = (fun _ -> None) + pdbPath = None } ILBinaryReader.OpenILModuleReader mscorlib40 opts let tdefs1 = ilxMainModule.TypeDefs.AsList |> List.filter (fun td -> not (MainModuleBuilder.injectedCompatTypes.Contains(td.Name))) @@ -1214,7 +1217,7 @@ module StaticLinker = mutable visited: bool } // Find all IL modules that are to be statically linked given the static linking roots. - let FindDependentILModulesForStaticLinking (ctok, tcConfig:TcConfig, tcImports:TcImports, ilxMainModule) = + let FindDependentILModulesForStaticLinking (ctok, tcConfig:TcConfig, tcImports:TcImports, ilGlobals, ilxMainModule) = if not tcConfig.standalone && tcConfig.extraStaticLinkRoots.IsEmpty then [] else @@ -1245,7 +1248,31 @@ module StaticLinker = | ResolvedCcu ccu -> Some ccu | UnresolvedCcu(_ccuName) -> None - let modul = dllInfo.RawMetadata.TryGetRawILModule().Value + let fileName = dllInfo.FileName + let modul = + let pdbPathOption = + // We open the pdb file if one exists parallel to the binary we + // are reading, so that --standalone will preserve debug information. + if tcConfig.openDebugInformationForLaterStaticLinking then + let pdbDir = (try Filename.directoryName fileName with _ -> ".") + let pdbFile = (try Filename.chopExtension fileName with _ -> fileName)+".pdb" + if FileSystem.SafeExists pdbFile then + if verbose then dprintf "reading PDB file %s from directory %s during static linking\n" pdbFile pdbDir + Some pdbDir + else + None + else + None + + let opts : ILReaderOptions = + { ilGlobals = ilGlobals + metadataOnly = MetadataOnlyFlag.No // turn this off here as we need the actual IL code + reduceMemoryUsage = tcConfig.reduceMemoryUsage + pdbPath = pdbPathOption + tryGetMetadataSnapshot = (fun _ -> None) } + + let reader = ILBinaryReader.OpenILModuleReader dllInfo.FileName opts + reader.ILModuleDef let refs = if ilAssemRef.Name = GetFSharpCoreLibraryName() then @@ -1346,7 +1373,7 @@ module StaticLinker = (fun ilxMainModule -> ReportTime tcConfig "Find assembly references" - let dependentILModules = FindDependentILModulesForStaticLinking (ctok, tcConfig, tcImports, ilxMainModule) + let dependentILModules = FindDependentILModulesForStaticLinking (ctok, tcConfig, tcImports, ilGlobals, ilxMainModule) ReportTime tcConfig "Static link" @@ -1614,7 +1641,7 @@ let CopyFSharpCore(outFile: string, referencedDlls: AssemblyReference list) = [] type Args<'T> = Args of 'T -let main0(ctok, argv, legacyReferenceResolver, bannerAlreadyPrinted, openBinariesInMemory:bool, defaultCopyFSharpCore: bool, exiter:Exiter, errorLoggerProvider : ErrorLoggerProvider, disposables : DisposablesTracker) = +let main0(ctok, argv, legacyReferenceResolver, bannerAlreadyPrinted, reduceMemoryUsage:ReduceMemoryFlag, defaultCopyFSharpCore: CopyFSharpCoreFlag, exiter:Exiter, errorLoggerProvider : ErrorLoggerProvider, disposables : DisposablesTracker) = // See Bug 735819 let lcidFromCodePage = @@ -1630,7 +1657,6 @@ let main0(ctok, argv, legacyReferenceResolver, bannerAlreadyPrinted, openBinarie let directoryBuildingFrom = Directory.GetCurrentDirectory() let setProcessThreadLocals tcConfigB = - tcConfigB.openBinariesInMemory <- openBinariesInMemory match tcConfigB.preferredUiLang with #if FX_RESHAPED_GLOBALIZATION | Some s -> System.Globalization.CultureInfo.CurrentUICulture <- new System.Globalization.CultureInfo(s) @@ -1646,9 +1672,15 @@ let main0(ctok, argv, legacyReferenceResolver, bannerAlreadyPrinted, openBinarie if not bannerAlreadyPrinted then DisplayBannerText tcConfigB - let optimizeForMemory = false // optimizeForMemory - fsc.exe can use as much memory as it likes to try to compile as fast as possible + let tryGetMetadataSnapshot = (fun _ -> None) + + let tcConfigB = + TcConfigBuilder.CreateNew(legacyReferenceResolver, DefaultFSharpBinariesDir, + reduceMemoryUsage=reduceMemoryUsage, implicitIncludeDir=directoryBuildingFrom, + isInteractive=false, isInvalidationSupported=false, + defaultCopyFSharpCore=defaultCopyFSharpCore, + tryGetMetadataSnapshot=tryGetMetadataSnapshot) - let tcConfigB = TcConfigBuilder.CreateNew(legacyReferenceResolver, DefaultFSharpBinariesDir, optimizeForMemory, directoryBuildingFrom, isInteractive=false, isInvalidationSupported=false, defaultCopyFSharpCore=defaultCopyFSharpCore) // Preset: --optimize+ -g --tailcalls+ (see 4505) SetOptimizeSwitch tcConfigB OptionSwitch.On SetDebugSwitch tcConfigB None OptionSwitch.Off @@ -1836,10 +1868,17 @@ let main1(Args (ctok, tcGlobals, tcImports: TcImports, frameworkTcImports, gener // set up typecheck for given AST without parsing any command line parameters -let main1OfAst (ctok, legacyReferenceResolver, openBinariesInMemory, assemblyName, target, outfile, pdbFile, dllReferences, noframework, exiter, errorLoggerProvider: ErrorLoggerProvider, inputs : ParsedInput list) = +let main1OfAst (ctok, legacyReferenceResolver, reduceMemoryUsage, assemblyName, target, outfile, pdbFile, dllReferences, noframework, exiter, errorLoggerProvider: ErrorLoggerProvider, inputs : ParsedInput list) = + + let tryGetMetadataSnapshot = (fun _ -> None) + + let tcConfigB = + TcConfigBuilder.CreateNew(legacyReferenceResolver, DefaultFSharpBinariesDir, + reduceMemoryUsage=reduceMemoryUsage, implicitIncludeDir=Directory.GetCurrentDirectory(), + isInteractive=false, isInvalidationSupported=false, + defaultCopyFSharpCore=CopyFSharpCoreFlag.No, + tryGetMetadataSnapshot=tryGetMetadataSnapshot) - let tcConfigB = TcConfigBuilder.CreateNew(legacyReferenceResolver, DefaultFSharpBinariesDir, (*optimizeForMemory*) false, Directory.GetCurrentDirectory(), isInteractive=false, isInvalidationSupported=false, defaultCopyFSharpCore=false) - tcConfigB.openBinariesInMemory <- openBinariesInMemory tcConfigB.framework <- not noframework // Preset: --optimize+ -g --tailcalls+ (see 4505) SetOptimizeSwitch tcConfigB OptionSwitch.On @@ -2030,7 +2069,7 @@ let main4 dynamicAssemblyCreator (Args (ctok, tcConfig, errorLogger: ErrorLogger AbortOnError(errorLogger, exiter) // Don't copy referenced FSharp.core.dll if we are building FSharp.Core.dll - if tcConfig.copyFSharpCore && not tcConfig.compilingFslib && not tcConfig.standalone then + if (tcConfig.copyFSharpCore = CopyFSharpCoreFlag.Yes) && not tcConfig.compilingFslib && not tcConfig.standalone then CopyFSharpCore(outfile, tcConfig.referencedDLLs) ReportTime tcConfig "Exiting" @@ -2040,12 +2079,12 @@ let main4 dynamicAssemblyCreator (Args (ctok, tcConfig, errorLogger: ErrorLogger //----------------------------------------------------------------------------- /// Entry point typecheckAndCompile -let typecheckAndCompile (ctok, argv, legacyReferenceResolver, bannerAlreadyPrinted, openBinariesInMemory, defaultCopyFSharpCore, exiter:Exiter, errorLoggerProvider, tcImportsCapture, dynamicAssemblyCreator) = +let typecheckAndCompile (ctok, argv, legacyReferenceResolver, bannerAlreadyPrinted, reduceMemoryUsage, defaultCopyFSharpCore, exiter:Exiter, errorLoggerProvider, tcImportsCapture, dynamicAssemblyCreator) = use d = new DisposablesTracker() use e = new SaveAndRestoreConsoleEncoding() - main0(ctok, argv, legacyReferenceResolver, bannerAlreadyPrinted, openBinariesInMemory, defaultCopyFSharpCore, exiter, errorLoggerProvider, d) + main0(ctok, argv, legacyReferenceResolver, bannerAlreadyPrinted, reduceMemoryUsage, defaultCopyFSharpCore, exiter, errorLoggerProvider, d) |> main1 |> main2a |> main2b (tcImportsCapture,dynamicAssemblyCreator) @@ -2053,14 +2092,14 @@ let typecheckAndCompile (ctok, argv, legacyReferenceResolver, bannerAlreadyPrint |> main4 dynamicAssemblyCreator -let compileOfAst (ctok, legacyReferenceResolver, openBinariesInMemory, assemblyName, target, outFile, pdbFile, dllReferences, noframework, exiter, errorLoggerProvider, inputs, tcImportsCapture, dynamicAssemblyCreator) = - main1OfAst (ctok, legacyReferenceResolver, openBinariesInMemory, assemblyName, target, outFile, pdbFile, dllReferences, noframework, exiter, errorLoggerProvider, inputs) +let compileOfAst (ctok, legacyReferenceResolver, reduceMemoryUsage, assemblyName, target, outFile, pdbFile, dllReferences, noframework, exiter, errorLoggerProvider, inputs, tcImportsCapture, dynamicAssemblyCreator) = + main1OfAst (ctok, legacyReferenceResolver, reduceMemoryUsage, assemblyName, target, outFile, pdbFile, dllReferences, noframework, exiter, errorLoggerProvider, inputs) |> main2a |> main2b (tcImportsCapture, dynamicAssemblyCreator) |> main3 |> main4 dynamicAssemblyCreator -let mainCompile (ctok, argv, legacyReferenceResolver, bannerAlreadyPrinted, openBinariesInMemory, defaultCopyFSharpCore, exiter, errorLoggerProvider, tcImportsCapture, dynamicAssemblyCreator) = +let mainCompile (ctok, argv, legacyReferenceResolver, bannerAlreadyPrinted, reduceMemoryUsage, defaultCopyFSharpCore, exiter, errorLoggerProvider, tcImportsCapture, dynamicAssemblyCreator) = //System.Runtime.GCSettings.LatencyMode <- System.Runtime.GCLatencyMode.Batch - typecheckAndCompile(ctok, argv, legacyReferenceResolver, bannerAlreadyPrinted, openBinariesInMemory, defaultCopyFSharpCore, exiter, errorLoggerProvider, tcImportsCapture, dynamicAssemblyCreator) + typecheckAndCompile(ctok, argv, legacyReferenceResolver, bannerAlreadyPrinted, reduceMemoryUsage, defaultCopyFSharpCore, exiter, errorLoggerProvider, tcImportsCapture, dynamicAssemblyCreator) diff --git a/src/fsharp/fsc.fsi b/src/fsharp/fsc.fsi index a2ff860977..aec98d978c 100755 --- a/src/fsharp/fsc.fsi +++ b/src/fsharp/fsc.fsi @@ -4,6 +4,7 @@ module internal Microsoft.FSharp.Compiler.Driver open Microsoft.FSharp.Compiler.Ast open Microsoft.FSharp.Compiler.AbstractIL.IL +open Microsoft.FSharp.Compiler.AbstractIL.ILBinaryReader open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library open Microsoft.FSharp.Compiler.AbstractIL open Microsoft.FSharp.Compiler.ErrorLogger @@ -32,8 +33,8 @@ val typecheckAndCompile : argv : string[] * legacyReferenceResolver: ReferenceResolver.Resolver * bannerAlreadyPrinted : bool * - openBinariesInMemory: bool * - defaultCopyFSharpCore: bool * + reduceMemoryUsage: ReduceMemoryFlag * + defaultCopyFSharpCore: CopyFSharpCoreFlag * exiter : Exiter * loggerProvider: ErrorLoggerProvider * tcImportsCapture: (TcImports -> unit) option * @@ -45,8 +46,8 @@ val mainCompile : argv: string[] * legacyReferenceResolver: ReferenceResolver.Resolver * bannerAlreadyPrinted: bool * - openBinariesInMemory: bool * - defaultCopyFSharpCore: bool * + reduceMemoryUsage: ReduceMemoryFlag * + defaultCopyFSharpCore: CopyFSharpCoreFlag * exiter: Exiter * loggerProvider: ErrorLoggerProvider * tcImportsCapture: (TcImports -> unit) option * @@ -56,7 +57,7 @@ val mainCompile : val compileOfAst : ctok: CompilationThreadToken * legacyReferenceResolver: ReferenceResolver.Resolver * - openBinariesInMemory: bool * + reduceMemoryUsage: ReduceMemoryFlag * assemblyName:string * target:CompilerTarget * targetDll:string * diff --git a/src/fsharp/fscmain.fs b/src/fsharp/fscmain.fs index 344656d6b5..1d50e0c68d 100644 --- a/src/fsharp/fscmain.fs +++ b/src/fsharp/fscmain.fs @@ -9,7 +9,9 @@ open System.Reflection open System.Runtime.CompilerServices open Microsoft.FSharp.Compiler -open Microsoft.FSharp.Compiler.AbstractIL.IL // runningOnMono +open Microsoft.FSharp.Compiler.AbstractIL +open Microsoft.FSharp.Compiler.AbstractIL.IL +open Microsoft.FSharp.Compiler.AbstractIL.ILBinaryReader open Microsoft.FSharp.Compiler.ErrorLogger open Microsoft.FSharp.Compiler.Driver open Microsoft.FSharp.Compiler.Lib @@ -34,10 +36,18 @@ module Driver = let ctok = AssumeCompilationThreadWithoutEvidence () // Check for --pause as the very first step so that a compiler can be attached here. - if argv |> Array.exists (fun x -> x = "/pause" || x = "--pause") then + let pauseFlag = argv |> Array.exists (fun x -> x = "/pause" || x = "--pause") + if pauseFlag then System.Console.WriteLine("Press return to continue...") System.Console.ReadLine() |> ignore +#if !FX_NO_APP_DOMAINS + let timesFlag = argv |> Array.exists (fun x -> x = "/times" || x = "--times") + if timesFlag then + let stats = ILBinaryReader.GetStatistics() + AppDomain.CurrentDomain.ProcessExit.Add(fun _ -> printfn "STATS: #ByteArrayFile = %d, #MemoryMappedFileOpen = %d, #MemoryMappedFileClosed = %d, #RawMemoryFile = %d, #WeakByteArrayFile = %d" stats.byteFileCount stats.memoryMapFileOpenedCount stats.memoryMapFileClosedCount stats.rawMemoryFileCount stats.weakByteFileCount) +#endif + let quitProcessExiter = { new Exiter with member x.Exit(n) = @@ -55,7 +65,11 @@ module Driver = MSBuildReferenceResolver.Resolver #endif - mainCompile (ctok, argv, legacyReferenceResolver, (*bannerAlreadyPrinted*)false, (*openBinariesInMemory*)false, (*defaultCopyFSharpCore*)true, quitProcessExiter, ConsoleLoggerProvider(), None, None) + // This is the only place where ReduceMemoryFlag.No is set. This is because fsc.exe is not a long-running process and + // thus we can use file-locking memory mapped files. + // + // This is also one of only two places where CopyFSharpCoreFlag.Yes is set. The other is in LegacyHostedCompilerForTesting. + mainCompile (ctok, argv, legacyReferenceResolver, (*bannerAlreadyPrinted*)false, ReduceMemoryFlag.No, CopyFSharpCoreFlag.Yes, quitProcessExiter, ConsoleLoggerProvider(), None, None) 0 [] diff --git a/src/fsharp/fsi/fsi.fs b/src/fsharp/fsi/fsi.fs index b0d55326c4..45800b8092 100644 --- a/src/fsharp/fsi/fsi.fs +++ b/src/fsharp/fsi/fsi.fs @@ -23,6 +23,7 @@ open Microsoft.FSharp.Compiler open Microsoft.FSharp.Compiler.AbstractIL open Microsoft.FSharp.Compiler.AbstractIL.Diagnostics open Microsoft.FSharp.Compiler.AbstractIL.IL +open Microsoft.FSharp.Compiler.AbstractIL.ILBinaryReader open Microsoft.FSharp.Compiler.AbstractIL.Internal open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library open Microsoft.FSharp.Compiler.AbstractIL.Extensions.ILX @@ -1000,7 +1001,7 @@ type internal FsiDynamicCompiler /// Add attributes let CreateModuleFragment (tcConfigB: TcConfigBuilder, assemblyName, codegenResults) = if !progress then fprintfn fsiConsoleOutput.Out "Creating main module..."; - let mainModule = mkILSimpleModule assemblyName (GetGeneratedILModuleName tcConfigB.target assemblyName) (tcConfigB.target = Dll) tcConfigB.subsystemVersion tcConfigB.useHighEntropyVA (mkILTypeDefs codegenResults.ilTypeDefs) None None 0x0 (mkILExportedTypes []) "" + let mainModule = mkILSimpleModule assemblyName (GetGeneratedILModuleName tcConfigB.target assemblyName) (tcConfigB.target = CompilerTarget.Dll) tcConfigB.subsystemVersion tcConfigB.useHighEntropyVA (mkILTypeDefs codegenResults.ilTypeDefs) None None 0x0 (mkILExportedTypes []) "" { mainModule with Manifest = (let man = mainModule.ManifestOfAssembly @@ -1292,7 +1293,8 @@ type internal FsiDynamicCompiler let sourceFiles = sourceFiles |> List.map (fun nm -> tcConfig.ResolveSourceFile(m, nm, tcConfig.implicitIncludeDir),m) // Close the #load graph on each file and gather the inputs from the scripts. - let closure = LoadClosure.ComputeClosureOfSourceFiles(ctok, TcConfig.Create(tcConfigB,validate=false), sourceFiles, CodeContext.CompilationAndEvaluation, lexResourceManager=lexResourceManager) + let tcConfig = TcConfig.Create(tcConfigB,validate=false) + let closure = LoadClosure.ComputeClosureOfScriptFiles(ctok, tcConfig, sourceFiles, CodeContext.CompilationAndEvaluation, lexResourceManager=lexResourceManager) // Intent "[Loading %s]\n" (String.concat "\n and " sourceFiles) fsiConsoleOutput.uprintf "[%s " (FSIstrings.SR.fsiLoadingFilesPrefixText()) @@ -2437,6 +2439,7 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i //---------------------------------------------------------------------------- let currentDirectory = Directory.GetCurrentDirectory() + let tryGetMetadataSnapshot = (fun _ -> None) let defaultFSharpBinariesDir = FSharpEnvironment.BinFolderOfDefaultFSharpCompiler(FSharpEnvironment.tryCurrentDomain()).Value @@ -2445,7 +2448,16 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i | None -> SimulatedMSBuildReferenceResolver.GetBestAvailableResolver() | Some rr -> rr - let tcConfigB = TcConfigBuilder.CreateNew(legacyReferenceResolver, defaultFSharpBinariesDir=defaultFSharpBinariesDir, optimizeForMemory=true, implicitIncludeDir=currentDirectory, isInteractive=true, isInvalidationSupported=false, defaultCopyFSharpCore=false) + let tcConfigB = + TcConfigBuilder.CreateNew(legacyReferenceResolver, + defaultFSharpBinariesDir=defaultFSharpBinariesDir, + reduceMemoryUsage=ReduceMemoryFlag.Yes, + implicitIncludeDir=currentDirectory, + isInteractive=true, + isInvalidationSupported=false, + defaultCopyFSharpCore=CopyFSharpCoreFlag.No, + tryGetMetadataSnapshot=tryGetMetadataSnapshot) + let tcConfigP = TcConfigProvider.BasedOnMutableBuilder(tcConfigB) do tcConfigB.resolutionEnvironment <- ResolutionEnvironment.CompilationAndEvaluation // See Bug 3608 do tcConfigB.useFsiAuxLib <- fsi.UseFsiAuxLib diff --git a/src/fsharp/fsi/fsimain.fs b/src/fsharp/fsi/fsimain.fs index 002cfa54a4..92a2f72270 100644 --- a/src/fsharp/fsi/fsimain.fs +++ b/src/fsharp/fsi/fsimain.fs @@ -22,6 +22,7 @@ open System.Windows.Forms #endif open Microsoft.FSharp.Compiler +open Microsoft.FSharp.Compiler.AbstractIL open Microsoft.FSharp.Compiler.Lib open Microsoft.FSharp.Compiler.Interactive.Shell open Microsoft.FSharp.Compiler.Interactive @@ -331,6 +332,14 @@ let MainMain argv = let argv = System.Environment.GetCommandLineArgs() use e = new SaveAndRestoreConsoleEncoding() +#if !FX_NO_APP_DOMAINS + let timesFlag = argv |> Array.exists (fun x -> x = "/times" || x = "--times") + if timesFlag then + AppDomain.CurrentDomain.ProcessExit.Add(fun _ -> + let stats = ILBinaryReader.GetStatistics() + printfn "STATS: #ByteArrayFile = %d, #MemoryMappedFileOpen = %d, #MemoryMappedFileClosed = %d, #RawMemoryFile = %d, #WeakByteArrayFile = %d" stats.byteFileCount stats.memoryMapFileOpenedCount stats.memoryMapFileClosedCount stats.rawMemoryFileCount stats.weakByteFileCount) +#endif + #if FSI_SHADOW_COPY_REFERENCES let isShadowCopy x = (x = "/shadowcopyreferences" || x = "--shadowcopyreferences" || x = "/shadowcopyreferences+" || x = "--shadowcopyreferences+") if AppDomain.CurrentDomain.IsDefaultAppDomain() && argv |> Array.exists isShadowCopy then diff --git a/src/fsharp/lib.fs b/src/fsharp/lib.fs index ac44bd844c..0f8f3077e1 100755 --- a/src/fsharp/lib.fs +++ b/src/fsharp/lib.fs @@ -16,8 +16,8 @@ let verbose = false let progress = ref false let tracking = ref false // intended to be a general hook to control diagnostic output when tracking down bugs -let condition _s = - try (System.Environment.GetEnvironmentVariable(_s) <> null) with _ -> false +let condition s = + try (System.Environment.GetEnvironmentVariable(s) <> null) with _ -> false let GetEnvInteger e dflt = match System.Environment.GetEnvironmentVariable(e) with null -> dflt | t -> try int t with _ -> dflt diff --git a/src/fsharp/service/IncrementalBuild.fs b/src/fsharp/service/IncrementalBuild.fs index 3fd19dacfe..10f63f5ac7 100755 --- a/src/fsharp/service/IncrementalBuild.fs +++ b/src/fsharp/service/IncrementalBuild.fs @@ -14,6 +14,7 @@ open Microsoft.FSharp.Compiler.Tastops open Microsoft.FSharp.Compiler.Lib open Microsoft.FSharp.Compiler.AbstractIL open Microsoft.FSharp.Compiler.AbstractIL.IL +open Microsoft.FSharp.Compiler.AbstractIL.ILBinaryReader open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library open Microsoft.FSharp.Compiler.CompileOps open Microsoft.FSharp.Compiler.CompileOptions @@ -1137,8 +1138,6 @@ module Utilities = /// a virtualized view of the assembly contents as computed by background checking. type RawFSharpAssemblyDataBackedByLanguageService (tcConfig, tcGlobals, tcState:TcState, outfile, topAttrs, assemblyName, ilAssemRef) = - /// Try to find an attribute that takes a string argument - let generatedCcu = tcState.Ccu let exportRemapping = MakeExportRemapping generatedCcu generatedCcu.Contents @@ -1146,10 +1145,7 @@ type RawFSharpAssemblyDataBackedByLanguageService (tcConfig, tcGlobals, tcState: let _sigDataAttributes, sigDataResources = Driver.EncodeInterfaceData(tcConfig, tcGlobals, exportRemapping, generatedCcu, outfile, true) [ for r in sigDataResources do let ccuName = GetSignatureDataResourceName r - let bytes = - match r.Location with - | ILResourceLocation.Local b -> b() - | _ -> assert false; failwith "unreachable" + let bytes = r.GetBytes() yield (ccuName, bytes) ] let autoOpenAttrs = topAttrs.assemblyAttrs |> List.choose (List.singleton >> TryFindFSharpStringAttribute tcGlobals tcGlobals.attrib_AutoOpenAttribute) @@ -1697,7 +1693,7 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput /// CreateIncrementalBuilder (for background type checking). Note that fsc.fs also /// creates an incremental builder used by the command line compiler. - static member TryCreateBackgroundBuilderForProjectOptions (ctok, legacyReferenceResolver, defaultFSharpBinariesDir, frameworkTcImportsCache: FrameworkImportsCache, loadClosureOpt:LoadClosure option, sourceFiles:string list, commandLineArgs:string list, projectReferences, projectDirectory, useScriptResolutionRules, keepAssemblyContents, keepAllBackgroundResolutions, maxTimeShareMilliseconds) = + static member TryCreateBackgroundBuilderForProjectOptions (ctok, legacyReferenceResolver, defaultFSharpBinariesDir, frameworkTcImportsCache: FrameworkImportsCache, loadClosureOpt:LoadClosure option, sourceFiles:string list, commandLineArgs:string list, projectReferences, projectDirectory, useScriptResolutionRules, keepAssemblyContents, keepAllBackgroundResolutions, maxTimeShareMilliseconds, tryGetMetadataSnapshot) = let useSimpleResolutionSwitch = "--simpleresolution" cancellable { @@ -1724,11 +1720,15 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput | _ -> None // see also fsc.fs:runFromCommandLineToImportingAssemblies(), as there are many similarities to where the PS creates a tcConfigB - let tcConfigB = TcConfigBuilder.CreateNew(legacyReferenceResolver, defaultFSharpBinariesDir, implicitIncludeDir=projectDirectory, optimizeForMemory=true, isInteractive=false, isInvalidationSupported=true, defaultCopyFSharpCore=false) - - // The following uses more memory but means we don't take read-exclusions on the DLLs we reference - // Could detect well-known assemblies--ie System.dll--and open them with read-locks - tcConfigB.openBinariesInMemory <- true + let tcConfigB = + TcConfigBuilder.CreateNew(legacyReferenceResolver, + defaultFSharpBinariesDir, + implicitIncludeDir=projectDirectory, + reduceMemoryUsage=ReduceMemoryFlag.Yes, + isInteractive=false, + isInvalidationSupported=true, + defaultCopyFSharpCore=CopyFSharpCoreFlag.No, + tryGetMetadataSnapshot=tryGetMetadataSnapshot) tcConfigB.resolutionEnvironment <- (ReferenceResolver.ResolutionEnvironment.EditingOrCompilation true) diff --git a/src/fsharp/service/IncrementalBuild.fsi b/src/fsharp/service/IncrementalBuild.fsi index 807c934281..73b3dc4be6 100755 --- a/src/fsharp/service/IncrementalBuild.fsi +++ b/src/fsharp/service/IncrementalBuild.fsi @@ -153,7 +153,7 @@ type internal IncrementalBuilder = /// This may be a marginally long-running operation (parses are relatively quick, only one file needs to be parsed) member GetParseResultsForFile : CompilationThreadToken * filename:string -> Cancellable - static member TryCreateBackgroundBuilderForProjectOptions : CompilationThreadToken * ReferenceResolver.Resolver * defaultFSharpBinariesDir: string * FrameworkImportsCache * scriptClosureOptions:LoadClosure option * sourceFiles:string list * commandLineArgs:string list * projectReferences: IProjectReference list * projectDirectory:string * useScriptResolutionRules:bool * keepAssemblyContents: bool * keepAllBackgroundResolutions: bool * maxTimeShareMilliseconds: int64 -> Cancellable + static member TryCreateBackgroundBuilderForProjectOptions : CompilationThreadToken * ReferenceResolver.Resolver * defaultFSharpBinariesDir: string * FrameworkImportsCache * scriptClosureOptions:LoadClosure option * sourceFiles:string list * commandLineArgs:string list * projectReferences: IProjectReference list * projectDirectory:string * useScriptResolutionRules:bool * keepAssemblyContents: bool * keepAllBackgroundResolutions: bool * maxTimeShareMilliseconds: int64 * tryGetMetadataSnapshot: ILBinaryReader.ILReaderTryGetMetadataSnapshot -> Cancellable /// Increment the usage count on the IncrementalBuilder by 1. This initial usage count is 0 so immediately after creation /// a call to KeepBuilderAlive should be made. The returns an IDisposable which will diff --git a/src/fsharp/service/service.fs b/src/fsharp/service/service.fs index 38e95e816d..615b8aecdf 100644 --- a/src/fsharp/service/service.fs +++ b/src/fsharp/service/service.fs @@ -17,6 +17,7 @@ open Microsoft.FSharp.Core.Printf open Microsoft.FSharp.Compiler open Microsoft.FSharp.Compiler.AbstractIL open Microsoft.FSharp.Compiler.AbstractIL.IL +open Microsoft.FSharp.Compiler.AbstractIL.ILBinaryReader open Microsoft.FSharp.Compiler.AbstractIL.Diagnostics open Microsoft.FSharp.Compiler.AbstractIL.Internal open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library @@ -2202,7 +2203,7 @@ module CompileHelpers = let errors, errorLogger, loggerProvider = mkCompilationErorHandlers() let result = tryCompile errorLogger (fun exiter -> - mainCompile (ctok, argv, legacyReferenceResolver, (*bannerAlreadyPrinted*)true, (*openBinariesInMemory*)true, (*defaultCopyFSharpCore*)false, exiter, loggerProvider, tcImportsCapture, dynamicAssemblyCreator) ) + mainCompile (ctok, argv, legacyReferenceResolver, (*bannerAlreadyPrinted*)true, ReduceMemoryFlag.Yes, CopyFSharpCoreFlag.No, exiter, loggerProvider, tcImportsCapture, dynamicAssemblyCreator) ) errors.ToArray(), result @@ -2215,7 +2216,7 @@ module CompileHelpers = let result = tryCompile errorLogger (fun exiter -> - compileOfAst (ctok, legacyReferenceResolver, (*openBinariesInMemory=*)true, assemblyName, target, outFile, pdbFile, dependencies, noframework, exiter, loggerProvider, asts, tcImportsCapture, dynamicAssemblyCreator)) + compileOfAst (ctok, legacyReferenceResolver, ReduceMemoryFlag.Yes, assemblyName, target, outFile, pdbFile, dependencies, noframework, exiter, loggerProvider, asts, tcImportsCapture, dynamicAssemblyCreator)) errors.ToArray(), result @@ -2261,7 +2262,7 @@ module CompileHelpers = // Register the reflected definitions for the dynamically generated assembly for resource in ilxMainModule.Resources.AsList do if IsReflectedDefinitionsResource resource then - Quotations.Expr.RegisterReflectedDefinitions(assemblyBuilder, moduleBuilder.Name, resource.Bytes) + Quotations.Expr.RegisterReflectedDefinitions(assemblyBuilder, moduleBuilder.Name, resource.GetBytes()) // Save the result assemblyBuilderRef := Some assemblyBuilder @@ -2286,7 +2287,7 @@ type ScriptClosureCacheToken() = interface LockToken // There is only one instance of this type, held in FSharpChecker -type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyContents, keepAllBackgroundResolutions) as self = +type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyContents, keepAllBackgroundResolutions, tryGetMetadataSnapshot) as self = // STATIC ROOT: FSharpLanguageServiceTestable.FSharpChecker.backgroundCompiler.reactor: The one and only Reactor let reactor = Reactor.Singleton let beforeFileChecked = Event() @@ -2342,7 +2343,8 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC IncrementalBuilder.TryCreateBackgroundBuilderForProjectOptions (ctok, legacyReferenceResolver, defaultFSharpBinariesDir, frameworkTcImportsCache, loadClosure, Array.toList options.SourceFiles, Array.toList options.OtherOptions, projectReferences, options.ProjectDirectory, - options.UseScriptResolutionRules, keepAssemblyContents, keepAllBackgroundResolutions, maxTimeShareMilliseconds) + options.UseScriptResolutionRules, keepAssemblyContents, keepAllBackgroundResolutions, maxTimeShareMilliseconds, + tryGetMetadataSnapshot) // We're putting the builder in the cache, so increment its count. let decrement = IncrementalBuilder.KeepBuilderAlive builderOpt @@ -2764,8 +2766,12 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC reactor.EnqueueAndAwaitOpAsync (userOpName, "GetProjectOptionsFromScript", filename, fun ctok -> cancellable { use errors = new ErrorScope() + // Do we add a reference to FSharp.Compiler.Interactive.Settings by default? let useFsiAuxLib = defaultArg useFsiAuxLib true + + let reduceMemoryUsage = ReduceMemoryFlag.Yes + // Do we assume .NET Framework references for scripts? let assumeDotNetFramework = defaultArg assumeDotNetFramework true let otherFlags = defaultArg otherFlags [| |] @@ -2779,13 +2785,22 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC let applyCompilerOptions tcConfigB = let fsiCompilerOptions = CompileOptions.GetCoreFsiCompilerOptions tcConfigB CompileOptions.ParseCompilerOptions (ignore, fsiCompilerOptions, Array.toList otherFlags) - let loadClosure = LoadClosure.ComputeClosureOfSourceText(ctok, legacyReferenceResolver, defaultFSharpBinariesDir, filename, source, CodeContext.Editing, useSimpleResolution, useFsiAuxLib, new Lexhelp.LexResourceManager(), applyCompilerOptions, assumeDotNetFramework) + + let loadClosure = + LoadClosure.ComputeClosureOfScriptText(ctok, legacyReferenceResolver, + defaultFSharpBinariesDir, filename, source, + CodeContext.Editing, useSimpleResolution, useFsiAuxLib, new Lexhelp.LexResourceManager(), + applyCompilerOptions, assumeDotNetFramework, + tryGetMetadataSnapshot=tryGetMetadataSnapshot, + reduceMemoryUsage=reduceMemoryUsage) + let otherFlags = [| yield "--noframework"; yield "--warn:3"; yield! otherFlags for r in loadClosure.References do yield "-r:" + fst r for (code,_) in loadClosure.NoWarns do yield "--nowarn:" + code |] + let options = { ProjectFileName = filename + ".fsproj" // Make a name that is unique in this directory. @@ -2902,9 +2917,9 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC [] [] // There is typically only one instance of this type in a Visual Studio process. -type FSharpChecker(legacyReferenceResolver, projectCacheSize, keepAssemblyContents, keepAllBackgroundResolutions) = +type FSharpChecker(legacyReferenceResolver, projectCacheSize, keepAssemblyContents, keepAllBackgroundResolutions, tryGetMetadataSnapshot) = - let backgroundCompiler = BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyContents, keepAllBackgroundResolutions) + let backgroundCompiler = BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyContents, keepAllBackgroundResolutions, tryGetMetadataSnapshot) static let globalInstance = lazy FSharpChecker.Create() @@ -2920,7 +2935,7 @@ type FSharpChecker(legacyReferenceResolver, projectCacheSize, keepAssemblyConten let maxMemEvent = new Event() /// Instantiate an interactive checker. - static member Create(?projectCacheSize, ?keepAssemblyContents, ?keepAllBackgroundResolutions, ?legacyReferenceResolver) = + static member Create(?projectCacheSize, ?keepAssemblyContents, ?keepAllBackgroundResolutions, ?legacyReferenceResolver, ?tryGetMetadataSnapshot) = let legacyReferenceResolver = match legacyReferenceResolver with @@ -2930,7 +2945,8 @@ type FSharpChecker(legacyReferenceResolver, projectCacheSize, keepAssemblyConten let keepAssemblyContents = defaultArg keepAssemblyContents false let keepAllBackgroundResolutions = defaultArg keepAllBackgroundResolutions true let projectCacheSizeReal = defaultArg projectCacheSize projectCacheSizeDefault - new FSharpChecker(legacyReferenceResolver, projectCacheSizeReal,keepAssemblyContents, keepAllBackgroundResolutions) + let tryGetMetadataSnapshot = defaultArg tryGetMetadataSnapshot (fun _ -> None) + new FSharpChecker(legacyReferenceResolver, projectCacheSizeReal,keepAssemblyContents, keepAllBackgroundResolutions, tryGetMetadataSnapshot) member ic.ReferenceResolver = legacyReferenceResolver @@ -3238,14 +3254,14 @@ type FsiInteractiveChecker(legacyReferenceResolver, reactorOps: IReactorOperatio let parseResults = FSharpParseFileResults(parseErrors, parseTreeOpt, parseHadErrors = anyErrors, dependencyFiles = dependencyFiles) let backgroundDiagnostics = [] - + let reduceMemoryUsage = ReduceMemoryFlag.Yes let assumeDotNetFramework = true let applyCompilerOptions tcConfigB = let fsiCompilerOptions = CompileOptions.GetCoreFsiCompilerOptions tcConfigB CompileOptions.ParseCompilerOptions (ignore, fsiCompilerOptions, [ ]) - let loadClosure = LoadClosure.ComputeClosureOfSourceText(ctok, legacyReferenceResolver, defaultFSharpBinariesDir, filename, source, CodeContext.Editing, tcConfig.useSimpleResolution, tcConfig.useFsiAuxLib, new Lexhelp.LexResourceManager(), applyCompilerOptions, assumeDotNetFramework) + let loadClosure = LoadClosure.ComputeClosureOfScriptText(ctok, legacyReferenceResolver, defaultFSharpBinariesDir, filename, source, CodeContext.Editing, tcConfig.useSimpleResolution, tcConfig.useFsiAuxLib, new Lexhelp.LexResourceManager(), applyCompilerOptions, assumeDotNetFramework, tryGetMetadataSnapshot=(fun _ -> None), reduceMemoryUsage=reduceMemoryUsage) let! tcErrors, tcFileResult = Parser.CheckOneFile(parseResults, source, filename, "project", tcConfig, tcGlobals, tcImports, tcState, Some loadClosure, backgroundDiagnostics, reactorOps, (fun () -> true), None, userOpName) return diff --git a/src/fsharp/service/service.fsi b/src/fsharp/service/service.fsi index 82a1a563ea..594f9a2da8 100755 --- a/src/fsharp/service/service.fsi +++ b/src/fsharp/service/service.fsi @@ -10,7 +10,10 @@ open System open System.IO open System.Collections.Generic +open Microsoft.FSharp.Compiler.AbstractIL open Microsoft.FSharp.Compiler.AbstractIL.IL +open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library +open Microsoft.FSharp.Compiler.AbstractIL.ILBinaryReader open Microsoft.FSharp.Compiler open Microsoft.FSharp.Compiler.Ast open Microsoft.FSharp.Compiler.Driver @@ -19,12 +22,7 @@ open Microsoft.FSharp.Compiler.Range open Microsoft.FSharp.Compiler.TcGlobals open Microsoft.FSharp.Compiler.NameResolution open Microsoft.FSharp.Compiler.CompileOps -open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library -open Microsoft.FSharp.Compiler -open Microsoft.FSharp.Compiler.Range -open Microsoft.FSharp.Compiler.TcGlobals open Microsoft.FSharp.Compiler.Infos -open Microsoft.FSharp.Compiler.NameResolution open Microsoft.FSharp.Compiler.InfoReader open Microsoft.FSharp.Compiler.Tast open Microsoft.FSharp.Compiler.Tastops @@ -366,7 +364,8 @@ type public FSharpChecker = /// Keep the checked contents of projects. /// If false, do not keep full intermediate checking results from background checking suitable for returning from GetBackgroundCheckResultsForFileInProject. This reduces memory usage. /// An optional resolver for non-file references, for legacy purposes - static member Create : ?projectCacheSize: int * ?keepAssemblyContents: bool * ?keepAllBackgroundResolutions: bool * ?legacyReferenceResolver: ReferenceResolver.Resolver -> FSharpChecker + /// An optional resolver to access the contents of .NET binaries in a memory-efficient way + static member Create : ?projectCacheSize: int * ?keepAssemblyContents: bool * ?keepAllBackgroundResolutions: bool * ?legacyReferenceResolver: ReferenceResolver.Resolver * ?tryGetMetadataSnapshot: ILReaderTryGetMetadataSnapshot -> FSharpChecker /// /// Parse a source code file, returning information about brace matching in the file. diff --git a/src/fsharp/xlf/FSComp.txt.cs.xlf b/src/fsharp/xlf/FSComp.txt.cs.xlf index ad7572ef05..3c5262f1e5 100644 --- a/src/fsharp/xlf/FSComp.txt.cs.xlf +++ b/src/fsharp/xlf/FSComp.txt.cs.xlf @@ -6982,6 +6982,11 @@ Tento výraz vrátí hodnotu typu {0}, ale implicitně se zahodí. Zvažte vytvoření vazby mezi výsledkem a názvem pomocí klíčového slova let, např. let výsledek = výraz. Pokud jste chtěli výraz použít jako hodnotu v sekvenci, použijte explicitní klíčové slovo yield!. + + The file '{0}' changed on disk unexpectedly, please reload. + The file '{0}' changed on disk unexpectedly, please reload. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.de.xlf b/src/fsharp/xlf/FSComp.txt.de.xlf index 1754e4d729..913d7626ab 100644 --- a/src/fsharp/xlf/FSComp.txt.de.xlf +++ b/src/fsharp/xlf/FSComp.txt.de.xlf @@ -6982,6 +6982,11 @@ Dieser Ausdruck gibt einen Wert des Typs "{0}" zurück, wird aber implizit verworfen. Verwenden Sie ggf. "let", um das Ergebnis an einen Namen zu binden. Beispiel: "let Ergebnis = Ausdruck". Falls Sie den Ausdruck als Wert in der Sequenz einsetzen möchten, verwenden Sie explizit "yield!". + + The file '{0}' changed on disk unexpectedly, please reload. + The file '{0}' changed on disk unexpectedly, please reload. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.en.xlf b/src/fsharp/xlf/FSComp.txt.en.xlf index a1dece2d6f..a49183bb55 100644 --- a/src/fsharp/xlf/FSComp.txt.en.xlf +++ b/src/fsharp/xlf/FSComp.txt.en.xlf @@ -6982,6 +6982,11 @@ This expression returns a value of type '{0}' but is implicitly discarded. Consider using 'let' to bind the result to a name, e.g. 'let result = expression'. If you intended to use the expression as a value in the sequence then use an explicit 'yield!'. + + The file '{0}' changed on disk unexpectedly, please reload. + The file '{0}' changed on disk unexpectedly, please reload. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.es.xlf b/src/fsharp/xlf/FSComp.txt.es.xlf index 0ea4958ff7..469eb05b8a 100644 --- a/src/fsharp/xlf/FSComp.txt.es.xlf +++ b/src/fsharp/xlf/FSComp.txt.es.xlf @@ -6982,6 +6982,11 @@ Esta expresión devuelve un valor de tipo “{0}”, pero se descarta de forma implícita. Considere el uso de “let” para enlazar el resultado a un nombre; por ejemplo, “let result = expression”. Si su intención es utilizar la expresión como un valor en la secuencia, utilice “yield” de forma explícita. + + The file '{0}' changed on disk unexpectedly, please reload. + The file '{0}' changed on disk unexpectedly, please reload. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.fr.xlf b/src/fsharp/xlf/FSComp.txt.fr.xlf index c74eb738e5..aa9cf6d616 100644 --- a/src/fsharp/xlf/FSComp.txt.fr.xlf +++ b/src/fsharp/xlf/FSComp.txt.fr.xlf @@ -6982,6 +6982,11 @@ Cette expression retourne une valeur de type '{0}', mais est implicitement ignorée. Utilisez 'let' pour lier le résultat à un nom, par ex. 'let result = expression'. Si vous voulez utiliser l'expression comme valeur dans la séquence, utilisez un 'yield!' explicite. + + The file '{0}' changed on disk unexpectedly, please reload. + The file '{0}' changed on disk unexpectedly, please reload. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.it.xlf b/src/fsharp/xlf/FSComp.txt.it.xlf index d063e9e49c..1aba9476cd 100644 --- a/src/fsharp/xlf/FSComp.txt.it.xlf +++ b/src/fsharp/xlf/FSComp.txt.it.xlf @@ -6982,6 +6982,11 @@ Questa espressione restituisce un valore di tipo '{0}' ma viene rimossa in modo implicito. Provare a usare 'let' per eseguire il binding del risultato a un nome, ad esempio 'let risultato = espressione'. Se si intende usare l'espressione come valore nella sequenza, usare l'operando 'yield!' esplicito. + + The file '{0}' changed on disk unexpectedly, please reload. + The file '{0}' changed on disk unexpectedly, please reload. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.ja.xlf b/src/fsharp/xlf/FSComp.txt.ja.xlf index f515115c15..70b0780034 100644 --- a/src/fsharp/xlf/FSComp.txt.ja.xlf +++ b/src/fsharp/xlf/FSComp.txt.ja.xlf @@ -6982,6 +6982,11 @@ この式は型 '{0}' の値を返しますが、暗黙的に破棄されます。'let' を使用して結果を名前にバインドすることを検討してください。例: 'let result = expression'。式をシーケンス内で値として使用する場合は、明示的に 'yield!' を使用してください。 + + The file '{0}' changed on disk unexpectedly, please reload. + The file '{0}' changed on disk unexpectedly, please reload. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.ko.xlf b/src/fsharp/xlf/FSComp.txt.ko.xlf index ca9ffe834f..ebe3543726 100644 --- a/src/fsharp/xlf/FSComp.txt.ko.xlf +++ b/src/fsharp/xlf/FSComp.txt.ko.xlf @@ -6982,6 +6982,11 @@ 이 식은 '{0}' 형식의 값을 반환하지만 암시적으로 삭제됩니다. 'let'을 사용하여 결과를 이름에 바인딩하세요(예: 'let result = expression'). 식을 시퀀스의 값으로 사용하려면 명시적 'yield!'를 사용하세요. + + The file '{0}' changed on disk unexpectedly, please reload. + The file '{0}' changed on disk unexpectedly, please reload. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.pl.xlf b/src/fsharp/xlf/FSComp.txt.pl.xlf index 4cad63a4af..24de81d82d 100644 --- a/src/fsharp/xlf/FSComp.txt.pl.xlf +++ b/src/fsharp/xlf/FSComp.txt.pl.xlf @@ -6982,6 +6982,11 @@ To wyrażenie zwraca wartość typu „{0}”, ale jest niejawnie odrzucane. Rozważ użycie instrukcji „let” do powiązania wyniku z nazwą, np. „let wynik = wyrażenie”. Jeśli chcesz użyć tego wyrażenia jako wartości w sekwencji, użyj jawnej instrukcji „yield!”. + + The file '{0}' changed on disk unexpectedly, please reload. + The file '{0}' changed on disk unexpectedly, please reload. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf index 98205cd7a1..560d2e3cc3 100644 --- a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf +++ b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf @@ -6982,6 +6982,11 @@ Essa expressão retorna um valor de tipo '{0}', mas é descartada de forma implícita. Considere o uso de 'let' para associar o resultado a um nome, por exemplo, 'let result = expression'. Se você pretende usar a expressão como um valor na sequência, use um “yield!” explícito. + + The file '{0}' changed on disk unexpectedly, please reload. + The file '{0}' changed on disk unexpectedly, please reload. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.ru.xlf b/src/fsharp/xlf/FSComp.txt.ru.xlf index 4e32cbed5d..21a5391220 100644 --- a/src/fsharp/xlf/FSComp.txt.ru.xlf +++ b/src/fsharp/xlf/FSComp.txt.ru.xlf @@ -6982,6 +6982,11 @@ Это выражение возвращает значение типа "{0}", но оно неявно отбрасывается. Чтобы привязать результат к какому-то имени, используйте "let", например: "let <результат> = <выражение>". Если вы собирались использовать выражение как значение в последовательности, используйте в явном виде "yield!". + + The file '{0}' changed on disk unexpectedly, please reload. + The file '{0}' changed on disk unexpectedly, please reload. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.tr.xlf b/src/fsharp/xlf/FSComp.txt.tr.xlf index 93cfa3de92..ebd9797632 100644 --- a/src/fsharp/xlf/FSComp.txt.tr.xlf +++ b/src/fsharp/xlf/FSComp.txt.tr.xlf @@ -6982,6 +6982,11 @@ Bu ifade '{0}' türünde bir değer döndürür ancak örtük olarak atılır. Sonucu bir ada bağlamak için 'let' kullanabilirsiniz, örn. 'let sonuc = ifade'. İfadeyi dizide bir değer olarak kullanmayı amaçladıysanız açık bir 'yield!' kullanın. + + The file '{0}' changed on disk unexpectedly, please reload. + The file '{0}' changed on disk unexpectedly, please reload. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf index f9af6c23c8..7f249b1272 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf @@ -6982,6 +6982,11 @@ 此表达式返回类型为“{0}”的值,但被隐式放弃。请考虑使用 "let" 将结果绑定到名称,例如 "let result = expression"。如果要使用该表达式作为序列中的值,则使用显式 "yield!"。 + + The file '{0}' changed on disk unexpectedly, please reload. + The file '{0}' changed on disk unexpectedly, please reload. + + \ No newline at end of file diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf index 63e673fe13..6797e69e96 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf @@ -6982,6 +6982,11 @@ 此運算式會傳回類型為 '{0}' 的值,但會被間接捨棄。請考慮使用 'let' 將結果繫結到名稱。例如 'let result = expression'。若您想要在序列中,以值的形式使用運算式,請直接使用 'yield!'。 + + The file '{0}' changed on disk unexpectedly, please reload. + The file '{0}' changed on disk unexpectedly, please reload. + + \ No newline at end of file diff --git a/tests/scripts/compiler-perf-results.txt b/tests/scripts/compiler-perf-results.txt index e5d28e9dca..867991b488 100644 --- a/tests/scripts/compiler-perf-results.txt +++ b/tests/scripts/compiler-perf-results.txt @@ -135,3 +135,5 @@ https://github.com/manofstick/visualfsharp.git all-your-collections-are-belong-t https://github.com/dsyme/visualfsharp.git weak1 58bd2bec78f01e57fecff604146a3cc55eec4966 221224e6d20bd835c2b9e01e0a52bf45e740a8d0 MSRC-3617253 260.05 10.97 30.78 47.15 58.04 59.77 https://github.com/dsyme/visualfsharp.git range1 e49ac8a2f21223e60d0d9597e52ea9e5f8705963 221224e6d20bd835c2b9e01e0a52bf45e740a8d0 MSRC-3617253 275.83 12.79 32.57 53.38 61.94 58.03 https://github.com/Microsoft/visualfsharp master 221224e6d20bd835c2b9e01e0a52bf45e740a8d0 221224e6d20bd835c2b9e01e0a52bf45e740a8d0 MSRC-3617253 273.00 12.46 32.80 51.38 60.93 58.66 +https://github.com/dsyme/visualfsharp.git weak2 35b7e2caed9b81e2ceb9de9f325ddeb550bf97d6 4df997507226caa272f2c7d4fbdc52eb71c8ead2 MSRC-3617253 257.26 11.24 30.62 48.03 57.80 57.60 +https://github.com/Microsoft/visualfsharp master 4df997507226caa272f2c7d4fbdc52eb71c8ead2 4df997507226caa272f2c7d4fbdc52eb71c8ead2 MSRC-3617253 254.53 11.55 31.80 46.58 57.03 58.89 diff --git a/tests/service/FileSystemTests.fs b/tests/service/FileSystemTests.fs index 16a0bdcc26..e7442e5298 100644 --- a/tests/service/FileSystemTests.fs +++ b/tests/service/FileSystemTests.fs @@ -38,10 +38,13 @@ let B = File1.A + File1.A""" match files.TryGetValue(fileName) with | true, text -> new MemoryStream(Encoding.UTF8.GetBytes(text)) :> Stream | _ -> defaultFileSystem.FileStreamReadShim(fileName) - + member __.FileStreamCreateShim(fileName) = defaultFileSystem.FileStreamCreateShim(fileName) + member __.IsStableFileHeuristic(fileName) = + defaultFileSystem.IsStableFileHeuristic(fileName) + member __.FileStreamWriteExistingShim(fileName) = defaultFileSystem.FileStreamWriteExistingShim(fileName) diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index 5b6ccb784e..0686521382 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -35,17 +35,43 @@ open Microsoft.VisualStudio.Shell open Microsoft.VisualStudio.Shell.Interop open Microsoft.VisualStudio.ComponentModelHost open Microsoft.VisualStudio.Text.Outlining +open FSharp.NativeInterop + +#nowarn "9" // NativePtr.toNativeInt // Exposes FSharpChecker as MEF export [); Composition.Shared>] type internal FSharpCheckerProvider [] ( - analyzerService: IDiagnosticAnalyzerService + analyzerService: IDiagnosticAnalyzerService, + [)>] workspace: VisualStudioWorkspaceImpl ) = - // Enabling this would mean that if devenv.exe goes above 2.3GB we do a one-off downsize of the F# Compiler Service caches - //let maxMemory = 2300 + let tryGetMetadataSnapshot (path, timeStamp) = + try + let metadataReferenceProvider = workspace.Services.GetService() + let md = metadataReferenceProvider.GetMetadata(path, timeStamp) + let amd = (md :?> AssemblyMetadata) + let mmd = amd.GetModules().[0] + let mmr = mmd.GetMetadataReader() + + // "lifetime is timed to Metadata you got from the GetMetadata(). As long as you hold it strongly, raw + // memory we got from metadata reader will be alive. Once you are done, just let everything go and + // let finalizer handle resource rather than calling Dispose from Metadata directly. It is shared metadata. + // You shouldnt dispose it directly." + + let objToHold = box md + + // We don't expect any ilread WeakByteFile to be created when working in Visual Studio + Debug.Assert((Microsoft.FSharp.Compiler.AbstractIL.ILBinaryReader.GetStatistics().weakByteFileCount = 0), "Expected weakByteFileCount to be zero when using F# in Visual Studio. Was there a problem reading a .NET binary?") + + Some (objToHold, NativePtr.toNativeInt mmr.MetadataPointer, mmr.MetadataLength) + with ex -> + // We catch all and let the backup routines in the F# compiler find the error + Assert.Exception(ex) + None + let checker = lazy @@ -53,26 +79,25 @@ type internal FSharpCheckerProvider FSharpChecker.Create( projectCacheSize = Settings.LanguageServicePerformance.ProjectCheckCacheSize, keepAllBackgroundResolutions = false, + // Enabling this would mean that if devenv.exe goes above 2.3GB we do a one-off downsize of the F# Compiler Service caches (* , MaxMemory = 2300 *) - legacyReferenceResolver=Microsoft.FSharp.Compiler.MSBuildReferenceResolver.Resolver) + legacyReferenceResolver=Microsoft.FSharp.Compiler.MSBuildReferenceResolver.Resolver, + tryGetMetadataSnapshot = tryGetMetadataSnapshot) // This is one half of the bridge between the F# background builder and the Roslyn analysis engine. // When the F# background builder refreshes the background semantic build context for a file, // we request Roslyn to reanalyze that individual file. - checker.BeforeBackgroundFileCheck.Add(fun (fileName, extraProjectInfo) -> + checker.BeforeBackgroundFileCheck.Add(fun (fileName, _extraProjectInfo) -> async { try - match extraProjectInfo with - | Some (:? Workspace as workspace) -> - let solution = workspace.CurrentSolution - let documentIds = solution.GetDocumentIdsWithFilePath(fileName) - if not documentIds.IsEmpty then - let documentIdsFiltered = documentIds |> Seq.filter workspace.IsDocumentOpen |> Seq.toArray - for documentId in documentIdsFiltered do - Trace.TraceInformation("{0:n3} Requesting Roslyn reanalysis of {1}", DateTime.Now.TimeOfDay.TotalSeconds, documentId) - if documentIdsFiltered.Length > 0 then - analyzerService.Reanalyze(workspace,documentIds=documentIdsFiltered) - | _ -> () + let solution = workspace.CurrentSolution + let documentIds = solution.GetDocumentIdsWithFilePath(fileName) + if not documentIds.IsEmpty then + let documentIdsFiltered = documentIds |> Seq.filter workspace.IsDocumentOpen |> Seq.toArray + for documentId in documentIdsFiltered do + Trace.TraceInformation("{0:n3} Requesting Roslyn reanalysis of {1}", DateTime.Now.TimeOfDay.TotalSeconds, documentId) + if documentIdsFiltered.Length > 0 then + analyzerService.Reanalyze(workspace,documentIds=documentIdsFiltered) with ex -> Assert.Exception(ex) } |> Async.StartImmediate diff --git a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.QuickParse.fs b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.QuickParse.fs index 7d08f8e496..1798a9f05f 100644 --- a/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.QuickParse.fs +++ b/vsintegration/tests/UnitTests/LegacyLanguageService/Tests.LanguageService.QuickParse.fs @@ -29,7 +29,6 @@ type QuickParse() = let Check(line,expected) = CheckAt(line, line.Length-1, expected) - do Microsoft.FSharp.Compiler.AbstractIL.Diagnostics.setDiagnosticsChannel(Some(Console.Out)); Check("let y = List.",(["List"], "", Some 12)) Check("let y = List.conc",(["List"], "conc", Some 12)) Check("let y = S", ([], "S", None)) diff --git a/vsintegration/tests/UnitTests/TestLib.LanguageService.fs b/vsintegration/tests/UnitTests/TestLib.LanguageService.fs index c1b1d73dcc..9e90d65ae2 100644 --- a/vsintegration/tests/UnitTests/TestLib.LanguageService.fs +++ b/vsintegration/tests/UnitTests/TestLib.LanguageService.fs @@ -427,7 +427,6 @@ type LanguageServiceBaseTests() = ShiftKeyUp(currentVS) ops.CleanInvisibleProject(currentVS) - do AbstractIL.Diagnostics.setDiagnosticsChannel(None); ResetStopWatch() testStopwatch.Reset() testStopwatch.Start() diff --git a/vsintegration/tests/UnitTests/Tests.Watson.fs b/vsintegration/tests/UnitTests/Tests.Watson.fs index 824edef867..1e660ac359 100644 --- a/vsintegration/tests/UnitTests/Tests.Watson.fs +++ b/vsintegration/tests/UnitTests/Tests.Watson.fs @@ -4,7 +4,9 @@ namespace Tests.Compiler.Watson #nowarn "52" // The value has been copied to ensure the original is not mutated +open Microsoft.FSharp.Compiler.AbstractIL.ILBinaryReader open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library +open Microsoft.FSharp.Compiler.CompileOps open Microsoft.FSharp.Compiler.Driver open NUnit.Framework open System @@ -27,7 +29,7 @@ type Check = let argv = [| "--simulateException:"+simulationCode; "watson-test.fs"|] let ctok = AssumeCompilationThreadWithoutEvidence () - let _code = mainCompile (ctok, argv, Microsoft.FSharp.Compiler.MSBuildReferenceResolver.Resolver, false, false, false, Microsoft.FSharp.Compiler.ErrorLogger.QuitProcessExiter, ConsoleLoggerProvider(), None, None) + let _code = mainCompile (ctok, argv, Microsoft.FSharp.Compiler.MSBuildReferenceResolver.Resolver, false, ReduceMemoryFlag.No, CopyFSharpCoreFlag.No, Microsoft.FSharp.Compiler.ErrorLogger.QuitProcessExiter, ConsoleLoggerProvider(), None, None) () with | :? 'TException as e -> From b6dfbb69e9f3f5dd86f0b96cc93933a4c63ec83e Mon Sep 17 00:00:00 2001 From: Don Syme Date: Thu, 22 Mar 2018 13:19:03 +0000 Subject: [PATCH 139/147] Reduce resident memory for VS tokenization and other caches (#4590) * improve tokenizer memory performance * add comments * use Memory Cache with sliding window for tokeniztion information * use MemoryCache --- src/fsharp/service/ServiceDeclarationLists.fs | 2 +- src/fsharp/service/ServiceLexing.fs | 3 + src/fsharp/service/ServiceLexing.fsi | 6 + .../ImplementInterfaceCodeFixProvider.fs | 34 +-- .../src/FSharp.Editor/Common/Extensions.fs | 25 +-- .../Completion/CompletionProvider.fs | 44 ++-- .../SimplifyNameDiagnosticAnalyzer.fs | 16 +- .../DocComments/XMLDocumentation.fs | 4 +- .../src/FSharp.Editor/FSharp.Editor.fsproj | 1 + .../Formatting/EditorFormattingService.fs | 2 +- .../Formatting/IndentationService.fs | 6 +- .../LanguageService/Tokenizer.fs | 211 ++++++++++++------ .../Navigation/NavigateToSearchService.fs | 31 ++- .../FSharp.Editor/Options/EditorOptions.fs | 5 + 14 files changed, 243 insertions(+), 147 deletions(-) diff --git a/src/fsharp/service/ServiceDeclarationLists.fs b/src/fsharp/service/ServiceDeclarationLists.fs index 5acc998cf4..83f1bccba0 100644 --- a/src/fsharp/service/ServiceDeclarationLists.fs +++ b/src/fsharp/service/ServiceDeclarationLists.fs @@ -736,7 +736,7 @@ type FSharpMethodGroup( name: string, unsortedMethods: FSharpMethodGroupItem[] ) // BUG 413009 : [ParameterInfo] takes about 3 seconds to move from one overload parameter to another // cache allows to avoid recomputing parameterinfo for the same item #if !FX_NO_WEAKTABLE - static let methodOverloadsCache = System.Runtime.CompilerServices.ConditionalWeakTable() + static let methodOverloadsCache = System.Runtime.CompilerServices.ConditionalWeakTable() #endif let methods = diff --git a/src/fsharp/service/ServiceLexing.fs b/src/fsharp/service/ServiceLexing.fs index ce78b9101e..07a300e2b9 100755 --- a/src/fsharp/service/ServiceLexing.fs +++ b/src/fsharp/service/ServiceLexing.fs @@ -77,6 +77,9 @@ module FSharpTokenTag = let STRUCT = tagOfToken STRUCT let CLASS = tagOfToken CLASS let TRY = tagOfToken TRY + let NEW = tagOfToken NEW + let WITH = tagOfToken WITH + let OWITH = tagOfToken OWITH /// This corresponds to a token categorization originally used in Visual Studio 2003. diff --git a/src/fsharp/service/ServiceLexing.fsi b/src/fsharp/service/ServiceLexing.fsi index 01836f0c70..1501f45415 100755 --- a/src/fsharp/service/ServiceLexing.fsi +++ b/src/fsharp/service/ServiceLexing.fsi @@ -182,6 +182,12 @@ module FSharpTokenTag = val CLASS : int /// Indicates the token is keyword `try` val TRY : int + /// Indicates the token is keyword `with` + val WITH : int + /// Indicates the token is keyword `with` in #light + val OWITH : int + /// Indicates the token is keyword `new` + val NEW : int /// Information about a particular token from the tokenizer type FSharpTokenInfo = diff --git a/vsintegration/src/FSharp.Editor/CodeFix/ImplementInterfaceCodeFixProvider.fs b/vsintegration/src/FSharp.Editor/CodeFix/ImplementInterfaceCodeFixProvider.fs index da7c424826..5c102727ab 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/ImplementInterfaceCodeFixProvider.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/ImplementInterfaceCodeFixProvider.fs @@ -22,7 +22,7 @@ type internal InterfaceState = { InterfaceData: InterfaceData EndPosOfWith: pos option AppendBracketAt: int option - Tokens: FSharpTokenInfo list } + Tokens: Tokenizer.SavedTokenInfo[] } [] type internal FSharpImplementInterfaceCodeFixProvider @@ -36,15 +36,15 @@ type internal FSharpImplementInterfaceCodeFixProvider let checker = checkerProvider.Checker static let userOpName = "ImplementInterfaceCodeFixProvider" - let queryInterfaceState appendBracketAt (pos: pos) tokens (ast: Ast.ParsedInput) = + let queryInterfaceState appendBracketAt (pos: pos) (tokens: Tokenizer.SavedTokenInfo[]) (ast: Ast.ParsedInput) = asyncMaybe { let line = pos.Line - 1 let column = pos.Column let! iface = InterfaceStubGenerator.tryFindInterfaceDeclaration pos ast let endPosOfWidth = tokens - |> List.tryPick (fun (t: FSharpTokenInfo) -> - if t.CharClass = FSharpTokenCharKind.Keyword && t.LeftColumn >= column && t.TokenName = "WITH" then + |> Array.tryPick (fun (t: Tokenizer.SavedTokenInfo) -> + if t.Tag = FSharpTokenTag.WITH || t.Tag = FSharpTokenTag.OWITH then Some (Pos.fromZ line (t.RightColumn + 1)) else None) let appendBracketAt = @@ -70,8 +70,8 @@ type internal FSharpImplementInterfaceCodeFixProvider getLineIdent lineStr + indentSize | InterfaceData.ObjExpr _ as iface -> state.Tokens - |> List.tryPick (fun (t: FSharpTokenInfo) -> - if t.CharClass = FSharpTokenCharKind.Keyword && t.TokenName = "NEW" then + |> Array.tryPick (fun (t: Tokenizer.SavedTokenInfo) -> + if t.Tag = FSharpTokenTag.NEW then Some (t.LeftColumn + indentSize) else None) // There is no reference point, we indent the content at the start column of the interface @@ -149,18 +149,18 @@ type internal FSharpImplementInterfaceCodeFixProvider // That's why we tokenize the line and try to find the last successive identifier token let tokens = Tokenizer.tokenizeLine(context.Document.Id, sourceText, context.Span.Start, context.Document.FilePath, defines) let startLeftColumn = context.Span.Start - textLine.Start - let rec tryFindIdentifierToken acc tokens = - match tokens with - | t :: remainingTokens when t.LeftColumn < startLeftColumn -> + let rec tryFindIdentifierToken acc i = + if i >= tokens.Length then acc else + match tokens.[i] with + | t when t.LeftColumn < startLeftColumn -> // Skip all the tokens starting before the context - tryFindIdentifierToken acc remainingTokens - | t :: remainingTokens when t.Tag = FSharpTokenTag.Identifier -> - tryFindIdentifierToken (Some t) remainingTokens - | t :: remainingTokens when t.Tag = FSharpTokenTag.DOT || Option.isNone acc -> - tryFindIdentifierToken acc remainingTokens - | _ :: _ - | [] -> acc - let! token = tryFindIdentifierToken None tokens + tryFindIdentifierToken acc (i+1) + | t when t.Tag = FSharpTokenTag.Identifier -> + tryFindIdentifierToken (Some t) (i+1) + | t when t.Tag = FSharpTokenTag.DOT || Option.isNone acc -> + tryFindIdentifierToken acc (i+1) + | _ -> acc + let! token = tryFindIdentifierToken None 0 let fixupPosition = textLine.Start + token.RightColumn let interfacePos = Pos.fromZ textLine.LineNumber token.RightColumn // We rely on the observation that the lastChar of the context should be '}' if that character is present diff --git a/vsintegration/src/FSharp.Editor/Common/Extensions.fs b/vsintegration/src/FSharp.Editor/Common/Extensions.fs index b01d0b0ffa..4446dbd040 100644 --- a/vsintegration/src/FSharp.Editor/Common/Extensions.fs +++ b/vsintegration/src/FSharp.Editor/Common/Extensions.fs @@ -147,10 +147,15 @@ module Option = else None +[] +module Seq = + open System.Collections.Immutable + + let toImmutableArray (xs: seq<'a>) : ImmutableArray<'a> = xs.ToImmutableArray() [] -module List = - let foldi (folder : 'State -> int -> 'T -> 'State) (state : 'State) (xs : 'T list) = +module Array = + let foldi (folder : 'State -> int -> 'T -> 'State) (state : 'State) (xs : 'T[]) = let mutable state = state let mutable i = 0 for x in xs do @@ -158,16 +163,6 @@ module List = i <- i + 1 state - -[] -module Seq = - open System.Collections.Immutable - - let toImmutableArray (xs: seq<'a>) : ImmutableArray<'a> = xs.ToImmutableArray() - - -[] -module Array = /// Optimized arrays equality. ~100x faster than `array1 = array2` on strings. /// ~2x faster for floats /// ~0.8x slower for ints @@ -178,12 +173,12 @@ module Array = | null, _ | _, null -> false | _ when xs.Length <> ys.Length -> false | _ -> - let mutable break' = false + let mutable stop = false let mutable i = 0 let mutable result = true - while i < xs.Length && not break' do + while i < xs.Length && not stop do if xs.[i] <> ys.[i] then - break' <- true + stop <- true result <- false i <- i + 1 result diff --git a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs index 823b65e7a5..1ae6774b98 100644 --- a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs +++ b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs @@ -20,6 +20,7 @@ open Microsoft.VisualStudio.Shell.Interop open Microsoft.FSharp.Compiler open Microsoft.FSharp.Compiler.Range open Microsoft.FSharp.Compiler.SourceCodeServices +open System.Runtime.Caching type internal FSharpCompletionProvider ( @@ -33,7 +34,8 @@ type internal FSharpCompletionProvider inherit CompletionProvider() static let userOpName = "CompletionProvider" - static let declarationItemsCache = ConditionalWeakTable() + // Save the backing data in a memory cache held in a sliding window + static let declarationItemsCache = new MemoryCache("FSharp.Editor." + userOpName) static let [] NameInCodePropName = "NameInCode" static let [] FullNamePropName = "FullName" static let [] IsExtensionMemberPropName = "IsExtensionMember" @@ -138,15 +140,15 @@ type internal FSharpCompletionProvider let maxHints = if mruItems.Values.Count = 0 then 0 else Seq.max mruItems.Values - sortedDeclItems |> Array.iteri (fun number declItem -> - let glyph = Tokenizer.FSharpGlyphToRoslynGlyph (declItem.Glyph, declItem.Accessibility) + sortedDeclItems |> Array.iteri (fun number declarationItem -> + let glyph = Tokenizer.FSharpGlyphToRoslynGlyph (declarationItem.Glyph, declarationItem.Accessibility) let name = - match declItem.NamespaceToOpen with - | Some namespaceToOpen -> sprintf "%s (open %s)" declItem.Name namespaceToOpen - | _ -> declItem.Name + match declarationItem.NamespaceToOpen with + | Some namespaceToOpen -> sprintf "%s (open %s)" declarationItem.Name namespaceToOpen + | _ -> declarationItem.Name let filterText = - match declItem.NamespaceToOpen, declItem.Name.Split '.' with + match declarationItem.NamespaceToOpen, declarationItem.Name.Split '.' with // There is no namespace to open and the item name does not contain dots, so we don't need to pass special FilterText to Roslyn. | None, [|_|] -> null // Either we have a namespace to open ("DateTime (open System)") or item name contains dots ("Array.map"), or both. @@ -155,39 +157,37 @@ type internal FSharpCompletionProvider let completionItem = CommonCompletionItem.Create(name, glyph = Nullable glyph, rules = getRules(), filterText = filterText) - .AddProperty(FullNamePropName, declItem.FullName) + .AddProperty(FullNamePropName, declarationItem.FullName) let completionItem = - match declItem.Kind with + match declarationItem.Kind with | CompletionItemKind.Method (isExtension = true) -> completionItem.AddProperty(IsExtensionMemberPropName, "") | _ -> completionItem let completionItem = - if name <> declItem.NameInCode then - completionItem.AddProperty(NameInCodePropName, declItem.NameInCode) + if name <> declarationItem.NameInCode then + completionItem.AddProperty(NameInCodePropName, declarationItem.NameInCode) else completionItem let completionItem = - match declItem.NamespaceToOpen with + match declarationItem.NamespaceToOpen with | Some ns -> completionItem.AddProperty(NamespaceToOpenPropName, ns) | None -> completionItem let priority = - match mruItems.TryGetValue declItem.FullName with + match mruItems.TryGetValue declarationItem.FullName with | true, hints -> maxHints - hints | _ -> number + maxHints + 1 let sortText = sprintf "%06d" priority - //#if DEBUG - //Logging.Logging.logInfof "***** %s => %s" name sortText - //#endif - let completionItem = completionItem.WithSortText(sortText) - declarationItemsCache.Remove(completionItem.DisplayText) |> ignore // clear out stale entries if they exist - declarationItemsCache.Add(completionItem.DisplayText, declItem) + let key = completionItem.DisplayText + let cacheItem = CacheItem(key, declarationItem) + let policy = CacheItemPolicy(SlidingExpiration=DefaultTuning.PerDocumentSavedDataSlidingWindow) + declarationItemsCache.Set(cacheItem, policy) results.Add(completionItem)) if results.Count > 0 && not declarations.IsForType && not declarations.IsError && List.isEmpty partialName.QualifyingIdents then @@ -234,15 +234,15 @@ type internal FSharpCompletionProvider override this.GetDescriptionAsync(_: Document, completionItem: Completion.CompletionItem, cancellationToken: CancellationToken): Task = async { - let exists, declarationItem = declarationItemsCache.TryGetValue(completionItem.DisplayText) - if exists then + match declarationItemsCache.Get(completionItem.DisplayText) with + | :? FSharpDeclarationListItem as declarationItem -> let! description = declarationItem.StructuredDescriptionTextAsync let documentation = List() let collector = RoslynHelpers.CollectTaggedText documentation // mix main description and xmldoc by using one collector XmlDocumentation.BuildDataTipText(documentationBuilder, collector, collector, collector, collector, collector, description) return CompletionDescription.Create(documentation.ToImmutableArray()) - else + | _ -> return CompletionDescription.Empty } |> RoslynHelpers.StartAsyncAsTask cancellationToken diff --git a/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs b/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs index ba47e84026..d02366cf8d 100644 --- a/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs +++ b/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs @@ -14,8 +14,10 @@ open Microsoft.CodeAnalysis.Diagnostics open Microsoft.FSharp.Compiler open Microsoft.FSharp.Compiler.Range open Microsoft.FSharp.Compiler.SourceCodeServices +open System.Runtime.Caching type private TextVersionHash = int +type private PerDocumentSavedData = { Hash: int; Diagnostics: ImmutableArray } [] type internal SimplifyNameDiagnosticAnalyzer() = @@ -25,7 +27,7 @@ type internal SimplifyNameDiagnosticAnalyzer() = let getProjectInfoManager (document: Document) = document.Project.Solution.Workspace.Services.GetService().FSharpProjectOptionsManager let getChecker (document: Document) = document.Project.Solution.Workspace.Services.GetService().Checker let getPlidLength (plid: string list) = (plid |> List.sumBy String.length) + plid.Length - static let cache = ConditionalWeakTable>() + static let cache = new MemoryCache("FSharp.Editor." + userOpName) // Make sure only one document is being analyzed at a time, to be nice static let guard = new SemaphoreSlim(1) @@ -54,8 +56,9 @@ type internal SimplifyNameDiagnosticAnalyzer() = let textVersionHash = textVersion.GetHashCode() let! _ = guard.WaitAsync(cancellationToken) |> Async.AwaitTask |> liftAsync try - match cache.TryGetValue document.Id with - | true, (oldTextVersionHash, diagnostics) when oldTextVersionHash = textVersionHash -> return diagnostics + let key = document.Id.ToString() + match cache.Get(key) with + | :? PerDocumentSavedData as data when data.Hash = textVersionHash -> return data.Diagnostics | _ -> let! sourceText = document.GetTextAsync() let checker = getChecker document @@ -116,8 +119,11 @@ type internal SimplifyNameDiagnosticAnalyzer() = properties = (dict [SimplifyNameDiagnosticAnalyzer.LongIdentPropertyKey, relativeName]).ToImmutableDictionary())) let diagnostics = result.ToImmutableArray() - cache.Remove(document.Id) |> ignore - cache.Add(document.Id, (textVersionHash, diagnostics)) + cache.Remove(key) |> ignore + let data = { Hash = textVersionHash; Diagnostics=diagnostics } + let cacheItem = CacheItem(key, data) + let policy = CacheItemPolicy(SlidingExpiration=DefaultTuning.PerDocumentSavedDataSlidingWindow) + cache.Set(cacheItem, policy) return diagnostics finally guard.Release() |> ignore } diff --git a/vsintegration/src/FSharp.Editor/DocComments/XMLDocumentation.fs b/vsintegration/src/FSharp.Editor/DocComments/XMLDocumentation.fs index db616ba510..4d8d46db0e 100644 --- a/vsintegration/src/FSharp.Editor/DocComments/XMLDocumentation.fs +++ b/vsintegration/src/FSharp.Editor/DocComments/XMLDocumentation.fs @@ -3,6 +3,8 @@ namespace Microsoft.VisualStudio.FSharp.Editor open System +open System.Runtime.CompilerServices +open System.Runtime.Caching open System.Text.RegularExpressions open Internal.Utilities.Collections open EnvDTE @@ -413,6 +415,6 @@ module internal XmlDocumentation = let BuildMethodParamText(documentationProvider, xmlCollector, xml, paramName) = AppendXmlComment(documentationProvider, TextSanitizingCollector(xmlCollector), TextSanitizingCollector(xmlCollector), xml, false, true, Some paramName) - let documentationBuilderCache = System.Runtime.CompilerServices.ConditionalWeakTable() + let documentationBuilderCache = ConditionalWeakTable() let CreateDocumentationBuilder(xmlIndexService: IVsXMLMemberIndexService, dte: DTE) = documentationBuilderCache.GetValue(xmlIndexService,(fun _ -> Provider(xmlIndexService, dte) :> IDocumentationBuilder)) \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index fa8177d0a7..eb29d4d0df 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -109,6 +109,7 @@ + diff --git a/vsintegration/src/FSharp.Editor/Formatting/EditorFormattingService.fs b/vsintegration/src/FSharp.Editor/Formatting/EditorFormattingService.fs index fd20d89d26..f5fdc45016 100644 --- a/vsintegration/src/FSharp.Editor/Formatting/EditorFormattingService.fs +++ b/vsintegration/src/FSharp.Editor/Formatting/EditorFormattingService.fs @@ -44,7 +44,7 @@ type internal FSharpEditorFormattingService let! firstMeaningfulToken = tokens - |> List.tryFind (fun x -> + |> Array.tryFind (fun x -> x.Tag <> FSharpTokenTag.WHITESPACE && x.Tag <> FSharpTokenTag.COMMENT && x.Tag <> FSharpTokenTag.LINE_COMMENT) diff --git a/vsintegration/src/FSharp.Editor/Formatting/IndentationService.fs b/vsintegration/src/FSharp.Editor/Formatting/IndentationService.fs index c0fb75430f..c4c293624b 100644 --- a/vsintegration/src/FSharp.Editor/Formatting/IndentationService.fs +++ b/vsintegration/src/FSharp.Editor/Formatting/IndentationService.fs @@ -42,8 +42,8 @@ type internal FSharpIndentationService return! tokens - |> List.rev - |> List.tryFind (fun x -> + |> Array.rev + |> Array.tryFind (fun x -> x.Tag <> FSharpTokenTag.WHITESPACE && x.Tag <> FSharpTokenTag.COMMENT && x.Tag <> FSharpTokenTag.LINE_COMMENT) @@ -53,7 +53,7 @@ type internal FSharpIndentationService if x = y then Some() else None - let (|NeedIndent|_|) (token: FSharpTokenInfo) = + let (|NeedIndent|_|) (token: Tokenizer.SavedTokenInfo) = match token.Tag with | Eq FSharpTokenTag.EQUALS // = | Eq FSharpTokenTag.LARROW // <- diff --git a/vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs b/vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs index 478243881a..4a78365e5a 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs @@ -3,9 +3,11 @@ open System open System.Collections.Generic open System.Collections.Concurrent +open System.Diagnostics open System.Threading open System.Threading.Tasks open System.Runtime.CompilerServices +open System.Runtime.Caching open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Classification @@ -17,14 +19,14 @@ open Microsoft.FSharp.Compiler.SourceCodeServices [] -type internal LexerSymbolKind = - | Ident - | Operator - | Punctuation - | GenericTypeParameter - | StaticallyResolvedTypeParameter - | ActivePattern - | Other +type internal LexerSymbolKind = + | Ident = 0 + | Operator = 1 + | Punctuation = 2 + | GenericTypeParameter = 3 + | StaticallyResolvedTypeParameter = 4 + | ActivePattern = 5 + | Other = 6 type internal LexerSymbol = { Kind: LexerSymbolKind @@ -44,6 +46,7 @@ type internal SymbolLookupKind = [] module internal Tokenizer = + let (|Public|Internal|Protected|Private|) (a: FSharpAccessibility option) = match a with | None -> Public @@ -236,14 +239,73 @@ module internal Tokenizer = | _ -> Glyph.None + type FSharpTokenInfo with + member token.IsIdentifier = (token.CharClass = FSharpTokenCharKind.Identifier) + member token.IsOperator = (token.ColorClass = FSharpTokenColorKind.Operator) + member token.IsPunctuation = (token.ColorClass = FSharpTokenColorKind.Punctuation) + + /// This is the information we save for each token in a line for each active document. + /// It is a memory-critical data structure - do not make larger. This used to be ~100 bytes class, is now 8-byte struct + let [] TagMask = 0xFFFF000000000000UL // note, there are some spare bits here + let [] KindMask = 0x0000FF0000000000UL + let [] LeftColumnMask = 0x000000FFFFF00000UL + let [] MatchedLengthMask = 0x00000000000FFFFFUL + + [] + type SavedTokenInfo = + { Bits: uint64 } + //TagSaved: uint16 + //KindSaved: byte + //LeftColumnSaved: uint20 (up to 1048576) + //MatchedLengthSaved: uint20 (up to 1048576) + + member token.Tag = int ((token.Bits &&& TagMask) >>> 48) + member token.Kind = enum(int ((token.Bits &&& KindMask) >>> 40)) + member token.LeftColumn = int ((token.Bits &&& LeftColumnMask) >>> 20) + member token.MatchedLength = int ((token.Bits &&& MatchedLengthMask)) + + member token.IsIdentifier = (token.Kind = LexerSymbolKind.Ident) + member token.IsOperator = (token.Kind = LexerSymbolKind.Operator) + member token.IsPunctuation = (token.Kind = LexerSymbolKind.Punctuation) + + static member inline Create (token: FSharpTokenInfo) = + let kind = + if token.IsOperator then LexerSymbolKind.Operator + elif token.IsIdentifier then LexerSymbolKind.Ident + elif token.IsPunctuation then LexerSymbolKind.Punctuation + else LexerSymbolKind.Other + Debug.Assert(uint32 token.Tag < 0xFFFFu) + Debug.Assert(uint32 kind < 0xFFu) + Debug.Assert(uint32 token.LeftColumn < 0xFFFFFu) + Debug.Assert(uint32 token.FullMatchedLength < 0xFFFFFu) + { Bits = + ((uint64 token.Tag <<< 48) &&& TagMask) ||| + ((uint64 kind <<< 40) &&& KindMask) ||| + ((uint64 token.LeftColumn <<< 20) &&& LeftColumnMask) ||| + (uint64 token.FullMatchedLength &&& MatchedLengthMask) } + + member token.RightColumn = token.LeftColumn + token.MatchedLength - 1 + + /// An intermediate extraction of information from the token + type private DraftTokenInfo = + { Kind: LexerSymbolKind + LeftColumn: int + MatchedLength: int } + + static member Create kind (token: SavedTokenInfo) = { Kind = kind; LeftColumn = int token.LeftColumn; MatchedLength = int token.MatchedLength } + + member token.RightColumn = token.LeftColumn + token.MatchedLength - 1 + + /// This is the data saved about each line. It is held strongly while a file is open and + /// is important for memory performance type private SourceLineData(lineStart: int, lexStateAtStartOfLine: FSharpTokenizerLexState, lexStateAtEndOfLine: FSharpTokenizerLexState, - hashCode: int, classifiedSpans: IReadOnlyList, tokens: FSharpTokenInfo list) = + hashCode: int, classifiedSpans: ClassifiedSpan[], savedTokens: SavedTokenInfo[]) = member val LineStart = lineStart member val LexStateAtStartOfLine = lexStateAtStartOfLine member val LexStateAtEndOfLine = lexStateAtEndOfLine member val HashCode = hashCode member val ClassifiedSpans = classifiedSpans - member val Tokens = tokens + member val SavedTokens = savedTokens member data.IsValid(textLine: TextLine) = data.LineStart = textLine.Start && @@ -267,7 +329,12 @@ module internal Tokenizer = data.[i] <- None i <- i + 1 - let private dataCache = ConditionalWeakTable>() + /// This saves the tokenization data for a file for as long as the DocumentId object is alive. + /// This seems risky - if one single thing leaks a DocumentId (e.g. stores it in some global table of documents + /// that have been closed), then we leak **all** this associated data, forever. + + type private PerDocumentSavedData = ConcurrentDictionary + let private dataCache = new MemoryCache("FSharp.Editor.Tokenization") let compilerTokenToRoslynToken(colorKind: FSharpTokenColorKind) : string = match colorKind with @@ -287,7 +354,7 @@ module internal Tokenizer = let private scanSourceLine(sourceTokenizer: FSharpSourceTokenizer, textLine: TextLine, lineContents: string, lexState: FSharpTokenizerLexState) : SourceLineData = let colorMap = Array.create textLine.Span.Length ClassificationTypeNames.Text let lineTokenizer = sourceTokenizer.CreateLineTokenizer(lineContents) - let tokens = ResizeArray() + let tokens = ResizeArray() let mutable tokenInfoOption = None let previousLexState = ref lexState @@ -295,12 +362,18 @@ module internal Tokenizer = let classificationType = compilerTokenToRoslynToken(tokenInfoOption.Value.ColorClass) for i = tokenInfoOption.Value.LeftColumn to tokenInfoOption.Value.RightColumn do Array.set colorMap i classificationType - tokens.Add tokenInfoOption.Value + + let token = tokenInfoOption.Value + let savedToken = SavedTokenInfo.Create token + + tokens.Add savedToken let scanAndColorNextToken() = let info, nextLexState = lineTokenizer.ScanToken(!previousLexState) tokenInfoOption <- info previousLexState := nextLexState + + // Apply some hacks to clean up the token stream (we apply more later) match info with | Some info when info.Tag = FSharpTokenTag.INT32_DOT_DOT -> tokenInfoOption <- @@ -344,14 +417,25 @@ module internal Tokenizer = classifiedSpans.Add(new ClassifiedSpan(classificationType, textSpan)) startPosition <- endPosition - SourceLineData(textLine.Start, lexState, previousLexState.Value, lineContents.GetHashCode(), classifiedSpans, List.ofSeq tokens) + SourceLineData(textLine.Start, lexState, previousLexState.Value, lineContents.GetHashCode(), classifiedSpans.ToArray(), tokens.ToArray()) // We keep incremental data per-document. When text changes we correlate text line-by-line (by hash codes of lines) // We index the data by the active defines in the document. let private getSourceTextData(documentKey: DocumentId, defines: string list, linesCount) = - let dict = dataCache.GetValue(documentKey, fun key -> new ConcurrentDictionary<_,_>(1,1,HashIdentity.Structural)) - if dict.ContainsKey(defines) then dict.[defines] + let key = documentKey.ToString() + let dict = + match dataCache.Get(key) with + | :? PerDocumentSavedData as dict -> dict + | _ -> + let dict = new PerDocumentSavedData(1,1,HashIdentity.Structural) + let cacheItem = CacheItem(key, dict) + // evict per-document data after a sliding window + let policy = CacheItemPolicy(SlidingExpiration=DefaultTuning.PerDocumentSavedDataSlidingWindow) + dataCache.Set(cacheItem, policy) + dict + if dict.ContainsKey(defines) then + dict.[defines] else let data = SourceTextData(linesCount) dict.TryAdd(defines, data) |> ignore @@ -398,7 +482,7 @@ module internal Tokenizer = lexState <- lineData.LexStateAtEndOfLine if startLine <= i then - result.AddRange(lineData.ClassifiedSpans |> Seq.filter(fun token -> + result.AddRange(lineData.ClassifiedSpans |> Array.filter(fun token -> textSpan.Contains(token.TextSpan.Start) || textSpan.Contains(token.TextSpan.End - 1) || (token.TextSpan.Start <= textSpan.Start && textSpan.End <= token.TextSpan.End))) @@ -417,19 +501,11 @@ module internal Tokenizer = Assert.Exception(ex) List() - type private DraftToken = { - Kind: LexerSymbolKind - Token: FSharpTokenInfo - RightColumn: int - } with - static member inline Create kind token = - { Kind = kind; Token = token; RightColumn = token.LeftColumn + token.FullMatchedLength - 1 } - /// Returns symbol at a given position. - let private getSymbolFromTokens + let private getSymbolFromSavedTokens ( fileName: string, - tokens: FSharpTokenInfo list, + savedTokens: SavedTokenInfo[], linePos: LinePosition, lineStr: string, lookupKind: SymbolLookupKind, @@ -437,26 +513,22 @@ module internal Tokenizer = ) : LexerSymbol option = - let isIdentifier t = t.CharClass = FSharpTokenCharKind.Identifier - let isOperator t = t.ColorClass = FSharpTokenColorKind.Operator - let isPunctuation t = t.ColorClass = FSharpTokenColorKind.Punctuation - - let (|GenericTypeParameterPrefix|StaticallyResolvedTypeParameterPrefix|ActivePattern|Other|) (token: FSharpTokenInfo) = + let (|GenericTypeParameterPrefix|StaticallyResolvedTypeParameterPrefix|ActivePattern|Other|) (token: SavedTokenInfo) = if token.Tag = FSharpTokenTag.QUOTE then GenericTypeParameterPrefix elif token.Tag = FSharpTokenTag.INFIX_AT_HAT_OP then // The lexer return INFIX_AT_HAT_OP token for both "^" and "@" symbols. // We have to check the char itself to distinguish one from another. - if token.FullMatchedLength = 1 && token.LeftColumn < lineStr.Length && lineStr.[token.LeftColumn] = '^' then + if token.MatchedLength = 1 && token.LeftColumn < lineStr.Length && lineStr.[token.LeftColumn] = '^' then StaticallyResolvedTypeParameterPrefix else Other elif token.Tag = FSharpTokenTag.LPAREN then - if token.FullMatchedLength = 1 && token.LeftColumn+1 < lineStr.Length && lineStr.[token.LeftColumn+1] = '|' then + if token.MatchedLength = 1 && token.LeftColumn+1 < lineStr.Length && lineStr.[token.LeftColumn+1] = '|' then ActivePattern else Other else Other // Operators: Filter out overlapped operators (>>= operator is tokenized as three distinct tokens: GREATER, GREATER, EQUALS. - // Each of them has FullMatchedLength = 3. So, we take the first GREATER and skip the other two). + // Each of them has MatchedLength = 3. So, we take the first GREATER and skip the other two). // // Generic type parameters: we convert QUOTE + IDENT tokens into single IDENT token, altering its LeftColumn // and FullMathedLength (for "'type" which is tokenized as (QUOTE, left=2) + (IDENT, left=3, length=4) @@ -465,10 +537,9 @@ module internal Tokenizer = // Statically resolved type parameters: we convert INFIX_AT_HAT_OP + IDENT tokens into single IDENT token, altering its LeftColumn // and FullMathedLength (for "^type" which is tokenized as (INFIX_AT_HAT_OP, left=2) + (IDENT, left=3, length=4) // we'll get (IDENT, left=2, length=5). - let tokens = - let tokensCount = tokens.Length - tokens - |> List.foldi (fun (acc, lastToken) index (token: FSharpTokenInfo) -> + let draftTokens = + let tokensCount = savedTokens.Length + (([], None), savedTokens) ||> Array.foldi (fun (acc, lastToken: DraftTokenInfo option) index token -> match lastToken with | Some t when token.LeftColumn <= t.RightColumn -> acc, lastToken | Some ({ Kind = LexerSymbolKind.ActivePattern } as lastToken) when @@ -476,39 +547,39 @@ module internal Tokenizer = (token.Tag = FSharpTokenTag.BAR || token.Tag = FSharpTokenTag.IDENT || token.Tag = FSharpTokenTag.UNDERSCORE) -> let mergedToken = - {lastToken.Token with Tag = FSharpTokenTag.IDENT - RightColumn = token.RightColumn - FullMatchedLength = lastToken.Token.FullMatchedLength + token.FullMatchedLength } + { lastToken with + Kind = LexerSymbolKind.Ident + MatchedLength = lastToken.MatchedLength + token.MatchedLength } - acc, Some { lastToken with Token = mergedToken; RightColumn = lastToken.RightColumn + token.FullMatchedLength } + acc, Some mergedToken | _ -> let isLastToken = index = tokensCount - 1 match token with - | GenericTypeParameterPrefix when not isLastToken -> acc, Some (DraftToken.Create LexerSymbolKind.GenericTypeParameter token) - | StaticallyResolvedTypeParameterPrefix when not isLastToken -> acc, Some (DraftToken.Create LexerSymbolKind.StaticallyResolvedTypeParameter token) - | ActivePattern when wholeActivePatterns -> acc, Some (DraftToken.Create LexerSymbolKind.ActivePattern token) + | GenericTypeParameterPrefix when not isLastToken -> acc, Some (DraftTokenInfo.Create LexerSymbolKind.GenericTypeParameter token) + | StaticallyResolvedTypeParameterPrefix when not isLastToken -> acc, Some (DraftTokenInfo.Create LexerSymbolKind.StaticallyResolvedTypeParameter token) + | ActivePattern when wholeActivePatterns -> acc, Some (DraftTokenInfo.Create LexerSymbolKind.ActivePattern token) | _ -> let draftToken = match lastToken with - | Some { Kind = LexerSymbolKind.GenericTypeParameter | LexerSymbolKind.StaticallyResolvedTypeParameter as kind } when isIdentifier token -> - DraftToken.Create kind { token with LeftColumn = token.LeftColumn - 1 - FullMatchedLength = token.FullMatchedLength + 1 } + | Some { Kind = LexerSymbolKind.GenericTypeParameter | LexerSymbolKind.StaticallyResolvedTypeParameter as kind } when token.IsIdentifier -> + { Kind = kind + LeftColumn = token.LeftColumn - 1 + MatchedLength = token.MatchedLength + 1 } // ^ operator | Some { Kind = LexerSymbolKind.StaticallyResolvedTypeParameter } -> - DraftToken.Create LexerSymbolKind.Operator { token with LeftColumn = token.LeftColumn - 1 - FullMatchedLength = 1 } + { Kind = LexerSymbolKind.Operator + LeftColumn = token.LeftColumn - 1 + MatchedLength = 1 } | Some ( { Kind = LexerSymbolKind.ActivePattern } as ap) when wholeActivePatterns && token.Tag = FSharpTokenTag.RPAREN -> - DraftToken.Create LexerSymbolKind.Ident ap.Token + { Kind = LexerSymbolKind.Ident + LeftColumn = ap.LeftColumn + MatchedLength = ap.MatchedLength } | _ -> - let kind = - if isOperator token then LexerSymbolKind.Operator - elif isIdentifier token then LexerSymbolKind.Ident - elif isPunctuation token then LexerSymbolKind.Punctuation - else LexerSymbolKind.Other - - DraftToken.Create kind token + { Kind = token.Kind + LeftColumn = token.LeftColumn + MatchedLength = token.MatchedLength } draftToken :: acc, Some draftToken - ) ([], None) + ) |> fst // One or two tokens that in touch with the cursor (for "let x|(g) = ()" the tokens will be "x" and "(") @@ -518,27 +589,27 @@ module internal Tokenizer = | SymbolLookupKind.Precise -> 0 | SymbolLookupKind.Greedy -> 1 - tokens |> List.filter (fun x -> x.Token.LeftColumn <= linePos.Character && (x.RightColumn + rightColumnCorrection) >= linePos.Character) + draftTokens |> List.filter (fun x -> x.LeftColumn <= linePos.Character && (x.RightColumn + rightColumnCorrection) >= linePos.Character) // Select IDENT token. If failed, select OPERATOR token. tokensUnderCursor - |> List.tryFind (fun { DraftToken.Kind = k } -> - match k with + |> List.tryFind (fun token -> + match token.Kind with | LexerSymbolKind.Ident | LexerSymbolKind.ActivePattern | LexerSymbolKind.GenericTypeParameter | LexerSymbolKind.StaticallyResolvedTypeParameter -> true | _ -> false) - |> Option.orElseWith (fun _ -> tokensUnderCursor |> List.tryFind (fun { DraftToken.Kind = k } -> k = LexerSymbolKind.Operator)) + |> Option.orElseWith (fun _ -> tokensUnderCursor |> List.tryFind (fun token -> token.Kind = LexerSymbolKind.Operator)) |> Option.map (fun token -> let partialName = QuickParse.GetPartialLongNameEx(lineStr, token.RightColumn) - let identStr = lineStr.Substring(token.Token.LeftColumn, token.Token.FullMatchedLength) + let identStr = lineStr.Substring(token.LeftColumn, token.MatchedLength) { Kind = token.Kind Ident = Ident(identStr, Range.mkRange fileName - (Range.mkPos (linePos.Line + 1) token.Token.LeftColumn) + (Range.mkPos (linePos.Line + 1) token.LeftColumn) (Range.mkPos (linePos.Line + 1) (token.RightColumn + 1))) FullIsland = partialName.QualifyingIdents @ [identStr] }) @@ -579,11 +650,11 @@ module internal Tokenizer = let tokenizeLine (documentKey, sourceText, position, fileName, defines) = try let lineData, _, _ = getCachedSourceLineData(documentKey, sourceText, position, fileName, defines) - lineData.Tokens + lineData.SavedTokens with | ex -> Assert.Exception(ex) - [] + [| |] let getSymbolAtPosition ( @@ -599,7 +670,7 @@ module internal Tokenizer = try let lineData, textLinePos, lineContents = getCachedSourceLineData(documentKey, sourceText, position, fileName, defines) - getSymbolFromTokens(fileName, lineData.Tokens, textLinePos, lineContents, lookupKind, wholeActivePatterns) + getSymbolFromSavedTokens(fileName, lineData.SavedTokens, textLinePos, lineContents, lookupKind, wholeActivePatterns) with | :? System.OperationCanceledException -> reraise() | ex -> @@ -665,7 +736,7 @@ module internal Tokenizer = | LexerSymbolKind.Punctuation, _ -> PrettyNaming.IsPunctuation name | LexerSymbolKind.GenericTypeParameter, _ -> isGenericTypeParameter name | LexerSymbolKind.StaticallyResolvedTypeParameter, _ -> isStaticallyResolvedTypeParameter name - | (LexerSymbolKind.Ident | LexerSymbolKind.ActivePattern | LexerSymbolKind.Other), _ -> + | _ -> match symbol with | :? FSharpEntity as e when e.IsClass || e.IsFSharpRecord || e.IsFSharpUnion || e.IsValueType || e.IsFSharpModule || e.IsInterface -> isTypeNameIdent name | _ -> isFixableIdentifier name diff --git a/vsintegration/src/FSharp.Editor/Navigation/NavigateToSearchService.fs b/vsintegration/src/FSharp.Editor/Navigation/NavigateToSearchService.fs index 38c2abc968..6600843585 100644 --- a/vsintegration/src/FSharp.Editor/Navigation/NavigateToSearchService.fs +++ b/vsintegration/src/FSharp.Editor/Navigation/NavigateToSearchService.fs @@ -10,6 +10,7 @@ open System.Collections.Immutable open System.Threading open System.Threading.Tasks open System.Runtime.CompilerServices +open System.Runtime.Caching open System.Globalization open Microsoft.CodeAnalysis @@ -135,7 +136,9 @@ module private Index = Seq.toArray result member __.AllItems = items } +[] module private Utils = + let navigateToItemKindToRoslynKind = function | NavigateTo.NavigableItemKind.Module -> NavigateToItemKind.Module | NavigateTo.NavigableItemKind.ModuleAbbreviation -> NavigateToItemKind.Module @@ -177,6 +180,8 @@ module private Utils = | _ -> container.Name typeAsString + name + type PerDocumentSavedData = { Hash: int; Items: Index.IIndexedNavigableItems } + [, FSharpConstants.FSharpLanguageName); Shared>] type internal FSharpNavigateToSearchService [] @@ -185,7 +190,8 @@ type internal FSharpNavigateToSearchService projectInfoManager: FSharpProjectOptionsManager ) = - let itemsByDocumentId = ConditionalWeakTable() + // Save the backing navigation data in a memory cache held in a sliding window + let itemsByDocumentId = new MemoryCache("FSharp.Editor.FSharpNavigateToSearchService") let getNavigableItems(document: Document, parsingOptions: FSharpParsingOptions) = async { @@ -199,9 +205,9 @@ type internal FSharpNavigateToSearchService match RoslynHelpers.TryFSharpRangeToTextSpan(sourceText, item.Range) with | None -> () | Some sourceSpan -> - let glyph = Utils.navigateToItemKindToGlyph item.Kind - let kind = Utils.navigateToItemKindToRoslynKind item.Kind - let additionalInfo = Utils.containerToString item.Container document.Project + let glyph = navigateToItemKindToGlyph item.Kind + let kind = navigateToItemKindToRoslynKind item.Kind + let additionalInfo = containerToString item.Container document.Project yield NavigableItem(document, sourceSpan, glyph, item.Name, kind, additionalInfo) |] | None -> [||] } @@ -211,16 +217,17 @@ type internal FSharpNavigateToSearchService let! cancellationToken = Async.CancellationToken let! textVersion = document.GetTextVersionAsync(cancellationToken) |> Async.AwaitTask let textVersionHash = hash textVersion - match itemsByDocumentId.TryGetValue document.Id with - | true, (oldTextVersionHash, items) when oldTextVersionHash = textVersionHash -> - return items - | _ -> + let key = document.Id.ToString() + match itemsByDocumentId.Get(key) with + | :? PerDocumentSavedData as data when data.Hash = textVersionHash -> return data.Items + | _ -> let! items = getNavigableItems(document, parsingOptions) let indexedItems = Index.build items - itemsByDocumentId.Remove(document.Id) |> ignore - itemsByDocumentId.Add(document.Id, (textVersionHash, indexedItems)) - return indexedItems - } + let data = { Hash= textVersionHash; Items = indexedItems } + let cacheItem = CacheItem(key, data) + let policy = CacheItemPolicy(SlidingExpiration=DefaultTuning.PerDocumentSavedDataSlidingWindow) + itemsByDocumentId.Set(cacheItem, policy) + return indexedItems } let patternMatchKindToNavigateToMatchKind = function | PatternMatchKind.Exact -> NavigateToMatchKind.Exact diff --git a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs index 8444a3c157..f1beeba258 100644 --- a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs +++ b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs @@ -1,5 +1,6 @@ namespace Microsoft.VisualStudio.FSharp.Editor +open System open System.ComponentModel.Composition open System.Runtime.InteropServices @@ -14,6 +15,10 @@ module DefaultTuning = let SimplifyNameInitialDelay = 2000 (* milliseconds *) let SimplifyNameEachItemDelay = 0 (* milliseconds *) + /// How long is the per-document data saved before it is eligible for eviction from the cache? 10 seconds. + /// Re-tokenizing is fast so we don't need to save this data long. + let PerDocumentSavedDataSlidingWindow = TimeSpan(0,0,10)(* seconds *) + // CLIMutable to make the record work also as a view model [] type IntelliSenseOptions = From 9646a1d58831b8315cabd513fec48f16d354ff6f Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Thu, 22 Mar 2018 10:17:14 -0700 Subject: [PATCH 140/147] add System.ValueTuple.4.3.1.nupkg and PatternMatcher.dll to the sign list --- build/config/AssemblySignToolData.json | 4 +++- vsintegration/fsharp-vsintegration-src-build.proj | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/build/config/AssemblySignToolData.json b/build/config/AssemblySignToolData.json index a4cac39ae6..a3b3423bb5 100644 --- a/build/config/AssemblySignToolData.json +++ b/build/config/AssemblySignToolData.json @@ -32,6 +32,7 @@ "net40\\bin\\*\\FSharp.ProjectSystem.PropertyPages.resources.dll", "net40\\bin\\FSharp.ProjectSystem.FSharp.dll", "net40\\bin\\*\\FSharp.ProjectSystem.FSharp.resources.dll", + "net40\\bin\\PatternMatcher.dll", "coreclr\\bin\\FSharp.Core.dll", "coreclr\\bin\\*\\FSharp.Core.resources.dll", "coreclr\\bin\\FSharp.Build.dll", @@ -65,9 +66,10 @@ "Microsoft.DiaSymReader.dll", "Microsoft.DiaSymReader.PortablePdb.dll", "Newtonsoft.Json.dll", - "System.ValueTuple.4.4.0.nupkg", "System.Collections.Immutable.dll", "System.Reflection.Metadata.dll", + "System.ValueTuple.4.3.1.nupkg", + "System.ValueTuple.4.4.0.nupkg", "System.ValueTuple.dll" ] } diff --git a/vsintegration/fsharp-vsintegration-src-build.proj b/vsintegration/fsharp-vsintegration-src-build.proj index 4e0c3eb16d..34e84acbba 100644 --- a/vsintegration/fsharp-vsintegration-src-build.proj +++ b/vsintegration/fsharp-vsintegration-src-build.proj @@ -14,6 +14,7 @@ + From 2a206f980ebfb6a97488e9b078e18b29f2fcfd1b Mon Sep 17 00:00:00 2001 From: Don Syme Date: Thu, 22 Mar 2018 18:26:27 +0000 Subject: [PATCH 141/147] Read/store ILCustomAttrs, ILSecurityDecls, ILTypeDef sensibly (#4597) * Read/store ILCustomAttrs, ILSecurityDecls, ILTypeDef sensibly (#4597) * hide representation of ILPreTypeDef * fix build * remove unnecessary use of lists with repeated tail-appends * add comment * fix test --- src/absil/il.fs | 420 ++++++++++------ src/absil/il.fsi | 459 ++++++++---------- src/absil/ilmorph.fs | 8 +- src/absil/ilprint.fs | 9 +- src/absil/ilread.fs | 143 +++--- src/absil/ilreflect.fs | 2 +- src/fsharp/CompileOps.fs | 20 +- src/fsharp/CompileOps.fsi | 4 +- src/fsharp/IlxGen.fs | 12 +- src/fsharp/InternalCollections.fs | 34 -- src/fsharp/InternalCollections.fsi | 7 - src/fsharp/NameResolution.fs | 6 +- src/fsharp/NameResolution.fsi | 2 +- src/fsharp/fsc.fs | 39 +- src/fsharp/fsi/fsi.fs | 2 +- src/fsharp/import.fs | 19 +- src/fsharp/service/IncrementalBuild.fs | 93 ++-- src/fsharp/service/IncrementalBuild.fsi | 21 +- src/fsharp/service/ServiceAnalysis.fs | 8 +- src/fsharp/service/service.fs | 101 ++-- src/fsharp/service/service.fsi | 6 +- src/fsharp/symbols/SymbolHelpers.fs | 2 +- src/fsharp/symbols/SymbolHelpers.fsi | 2 +- tests/service/ProjectAnalysisTests.fs | 6 +- .../LanguageService/IProjectSite.fs | 2 +- 25 files changed, 757 insertions(+), 670 deletions(-) diff --git a/src/absil/il.fs b/src/absil/il.fs index 288f69474d..ce8ee4065e 100644 --- a/src/absil/il.fs +++ b/src/absil/il.fs @@ -7,16 +7,19 @@ module Microsoft.FSharp.Compiler.AbstractIL.IL #nowarn "346" // The struct, record or union type 'IlxExtensionType' has an explicit implementation of 'Object.Equals'. ... -open Internal.Utilities -open Microsoft.FSharp.Compiler.AbstractIL -open Microsoft.FSharp.Compiler.AbstractIL.Diagnostics -open Microsoft.FSharp.Compiler.AbstractIL.Internal -open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library +open System open System.Collections open System.Collections.Generic open System.Collections.Concurrent open System.Runtime.CompilerServices open System.Reflection + +open Microsoft.FSharp.Compiler.AbstractIL +open Microsoft.FSharp.Compiler.AbstractIL.Diagnostics +open Microsoft.FSharp.Compiler.AbstractIL.Internal +open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library + +open Internal.Utilities let logging = false @@ -42,7 +45,7 @@ let _ = if logging then dprintn "* warning: Il.logging is on" let int_order = LanguagePrimitives.FastGenericComparer -let notlazy v = Lazy.CreateFromValue v +let notlazy v = Lazy<_>.CreateFromValue v /// A little ugly, but the idea is that if a data structure does not /// contain lazy values then we don't add laziness. So if the thing to map @@ -321,12 +324,12 @@ type PublicKey = [] type AssemblyRefData = - { assemRefName: string; - assemRefHash: byte[] option; - assemRefPublicKeyInfo: PublicKey option; - assemRefRetargetable: bool; - assemRefVersion: ILVersionInfo option; - assemRefLocale: Locale option; } + { assemRefName: string + assemRefHash: byte[] option + assemRefPublicKeyInfo: PublicKey option + assemRefRetargetable: bool + assemRefVersion: ILVersionInfo option + assemRefLocale: Locale option } /// Global state: table of all assembly references keyed by AssemblyRefData. let AssemblyRefUniqueStampGenerator = new UniqueStampGenerator() @@ -721,11 +724,11 @@ let mkILCallSig (cc,args,ret) = { ArgTypes=args; CallingConv=cc; ReturnType=ret} let mkILBoxedType (tspec:ILTypeSpec) = tspec.TypeRef.AsBoxedType tspec type ILMethodRef = - { mrefParent: ILTypeRef; - mrefCallconv: ILCallingConv; - mrefGenericArity: int; - mrefName: string; - mrefArgs: ILTypes; + { mrefParent: ILTypeRef + mrefCallconv: ILCallingConv + mrefGenericArity: int + mrefName: string + mrefArgs: ILTypes mrefReturn: ILType } member x.DeclaringTypeRef = x.mrefParent member x.CallingConv = x.mrefCallconv @@ -736,8 +739,10 @@ type ILMethodRef = member x.ReturnType = x.mrefReturn member x.CallingSignature = mkILCallSig (x.CallingConv,x.ArgTypes,x.ReturnType) + static member Create(a,b,c,d,e,f) = { mrefParent= a;mrefCallconv=b;mrefName=c;mrefGenericArity=d; mrefArgs=e;mrefReturn=f } + override x.ToString() = x.DeclaringTypeRef.ToString() + "::" + x.Name + "(...)" @@ -750,9 +755,9 @@ type ILFieldRef = [] type ILMethodSpec = - { mspecMethodRef: ILMethodRef; - mspecDeclaringType: ILType; - mspecMethodInst: ILGenericArgs; } + { mspecMethodRef: ILMethodRef + mspecDeclaringType: ILType + mspecMethodInst: ILGenericArgs } static member Create(a,b,c) = { mspecDeclaringType=a; mspecMethodRef =b; mspecMethodInst=c } member x.MethodRef = x.mspecMethodRef member x.DeclaringType=x.mspecDeclaringType @@ -764,16 +769,14 @@ type ILMethodSpec = member x.FormalReturnType = x.MethodRef.ReturnType override x.ToString() = x.MethodRef.ToString() + "(...)" - type ILFieldSpec = - { FieldRef: ILFieldRef; + { FieldRef: ILFieldRef DeclaringType: ILType } member x.FormalType = x.FieldRef.Type member x.Name = x.FieldRef.Name member x.DeclaringTypeRef = x.FieldRef.DeclaringTypeRef override x.ToString() = x.FieldRef.ToString() - // -------------------------------------------------------------------- // Debug info. // -------------------------------------------------------------------- @@ -844,16 +847,34 @@ type ILAttribElem = type ILAttributeNamedArg = (string * ILType * bool * ILAttribElem) type ILAttribute = - { Method: ILMethodSpec; + { Method: ILMethodSpec Data: byte[] Elements: ILAttribElem list} -[] -type ILAttributes(f: unit -> ILAttribute[]) = - let mutable array = InlineDelayInit<_>(f) - member x.AsArray = array.Value +[] +type ILAttributes(array : ILAttribute[]) = + member x.AsArray = array member x.AsList = x.AsArray |> Array.toList +[] +type ILAttributesStored = + /// Computed by ilread.fs based on metadata index + | Reader of (int32 -> ILAttribute[]) + /// Already computed + | Given of ILAttributes + member x.GetCustomAttrs metadataIndex = + match x with + | Reader f -> ILAttributes(f metadataIndex) + | Given attrs -> attrs + +let emptyILCustomAttrs = ILAttributes [| |] +let mkILCustomAttrsFromArray (attrs: ILAttribute[]) = if attrs.Length = 0 then emptyILCustomAttrs else ILAttributes attrs +let mkILCustomAttrs l = match l with [] -> emptyILCustomAttrs | _ -> mkILCustomAttrsFromArray (List.toArray l) + +let emptyILCustomAttrsStored = ILAttributesStored.Given emptyILCustomAttrs +let storeILCustomAttrs (attrs: ILAttributes) = if attrs.AsArray.Length = 0 then emptyILCustomAttrsStored else ILAttributesStored.Given attrs +let mkILCustomAttrsReader f = ILAttributesStored.Reader f + type ILCodeLabel = int // -------------------------------------------------------------------- @@ -1236,11 +1257,28 @@ type type ILSecurityDecl = | ILSecurityDecl of ILSecurityAction * byte[] -[] -type ILSecurityDecls = - | ILSecurityDecls of ILSecurityDecl list - | ILSecurityDeclsLazy of Lazy - member x.AsList = match x with ILSecurityDecls m -> m | ILSecurityDeclsLazy m -> m.Force() +[] +type ILSecurityDecls(array : ILSecurityDecl[]) = + member x.AsArray = array + member x.AsList = x.AsArray |> Array.toList + +[] +type ILSecurityDeclsStored = + /// Computed by ilread.fs based on metadata index + | Reader of (int32 -> ILSecurityDecl[]) + /// Already computed + | Given of ILSecurityDecls + member x.GetSecurityDecls metadataIndex = + match x with + | Reader f -> ILSecurityDecls(f metadataIndex) + | Given attrs -> attrs + +let emptyILSecurityDecls = ILSecurityDecls [| |] +let emptyILSecurityDeclsStored = ILSecurityDeclsStored.Given emptyILSecurityDecls +let mkILSecurityDecls l = match l with [] -> emptyILSecurityDecls | _ -> ILSecurityDecls (Array.ofList l) +let storeILSecurityDecls (x: ILSecurityDecls) = if x.AsArray.Length = 0 then emptyILSecurityDeclsStored else ILSecurityDeclsStored.Given x +let mkILSecurityDeclsReader f = ILSecurityDeclsStored.Reader f + [] type PInvokeCharBestFit = @@ -1272,33 +1310,37 @@ type PInvokeCharEncoding = [] type PInvokeMethod = - { Where: ILModuleRef; - Name: string; - CallingConv: PInvokeCallingConvention; - CharEncoding: PInvokeCharEncoding; - NoMangle: bool; - LastError: bool; - ThrowOnUnmappableChar: PInvokeThrowOnUnmappableChar; + { Where: ILModuleRef + Name: string + CallingConv: PInvokeCallingConvention + CharEncoding: PInvokeCharEncoding + NoMangle: bool + LastError: bool + ThrowOnUnmappableChar: PInvokeThrowOnUnmappableChar CharBestFit: PInvokeCharBestFit } [] type ILParameter = - { Name: string option; - Type: ILType; - Default: ILFieldInit option; - Marshal: ILNativeType option; - IsIn: bool; - IsOut: bool; - IsOptional: bool; - CustomAttrs: ILAttributes } + { Name: string option + Type: ILType + Default: ILFieldInit option + Marshal: ILNativeType option + IsIn: bool + IsOut: bool + IsOptional: bool + CustomAttrsStored: ILAttributesStored + MetadataIndex: int32 } + member x.CustomAttrs = x.CustomAttrsStored.GetCustomAttrs x.MetadataIndex type ILParameters = list [] type ILReturn = - { Marshal: ILNativeType option; - Type: ILType; - CustomAttrs: ILAttributes } + { Marshal: ILNativeType option + Type: ILType + CustomAttrsStored: ILAttributesStored + MetadataIndex: int32 } + member x.CustomAttrs = x.CustomAttrsStored.GetCustomAttrs x.MetadataIndex type ILOverridesSpec = | OverridesSpec of ILMethodRef * ILType @@ -1336,7 +1378,7 @@ type MethodCodeKind = | Native | Runtime -let mkMethBodyAux mb = ILLazyMethodBody (Lazy.CreateFromValue mb) +let mkMethBodyAux mb = ILLazyMethodBody (notlazy mb) let mkMethBodyLazyAux mb = ILLazyMethodBody mb let typesOfILParams (ps:ILParameters) : ILTypes = ps |> List.map (fun p -> p.Type) @@ -1352,10 +1394,12 @@ type ILGenericParameterDef = Constraints: ILTypes Variance: ILGenericVariance HasReferenceTypeConstraint: bool - CustomAttrs : ILAttributes HasNotNullableValueTypeConstraint: bool - HasDefaultConstructorConstraint: bool } + HasDefaultConstructorConstraint: bool + CustomAttrsStored : ILAttributesStored + MetadataIndex: int32 } + member x.CustomAttrs = x.CustomAttrsStored.GetCustomAttrs x.MetadataIndex override x.ToString() = x.Name type ILGenericParameterDefs = ILGenericParameterDef list @@ -1381,9 +1425,18 @@ let convertMemberAccess (ilMemberAccess:ILMemberAccess) = let inline conditionalAdd condition flagToAdd source = if condition then source ||| flagToAdd else source &&& ~~~flagToAdd +let NoMetadataIdx = -1 + [] -type ILMethodDef (name: string, attributes: MethodAttributes, implAttributes: MethodImplAttributes, callingConv: ILCallingConv, parameters: ILParameters, ret: ILReturn, body: ILLazyMethodBody, securityDecls: ILSecurityDecls, isEntryPoint:bool, genericParams: ILGenericParameterDefs, customAttrs: ILAttributes) = - +type ILMethodDef (name: string, attributes: MethodAttributes, implAttributes: MethodImplAttributes, callingConv: ILCallingConv, + parameters: ILParameters, ret: ILReturn, body: ILLazyMethodBody, isEntryPoint:bool, genericParams: ILGenericParameterDefs, + securityDeclsStored: ILSecurityDeclsStored, customAttrsStored: ILAttributesStored, metadataIndex: int32) = + + new (name, attributes, implAttributes, callingConv, parameters, ret, body, isEntryPoint, genericParams, securityDecls, customAttrs) = + ILMethodDef(name, attributes, implAttributes, callingConv, parameters, ret, body, isEntryPoint, genericParams, + storeILSecurityDecls securityDecls, storeILCustomAttrs customAttrs, NoMetadataIdx) + + // The captured data - remember the object will be as large as the data captured by these members member __.Name = name member __.Attributes = attributes member __.ImplAttributes = implAttributes @@ -1391,10 +1444,11 @@ type ILMethodDef (name: string, attributes: MethodAttributes, implAttributes: Me member __.Parameters = parameters member __.Return = ret member __.Body = body - member __.SecurityDecls = securityDecls + member __.SecurityDeclsStored = securityDeclsStored member __.IsEntryPoint = isEntryPoint member __.GenericParams = genericParams - member __.CustomAttrs = customAttrs + member __.CustomAttrsStored = customAttrsStored + member __.MetadataIndex = metadataIndex member x.With (?name: string, ?attributes: MethodAttributes, ?implAttributes: MethodImplAttributes, ?callingConv: ILCallingConv, ?parameters: ILParameters, ?ret: ILReturn, ?body: ILLazyMethodBody, ?securityDecls: ILSecurityDecls, ?isEntryPoint:bool, ?genericParams: ILGenericParameterDefs, ?customAttrs: ILAttributes) = ILMethodDef (name = defaultArg name x.Name, @@ -1404,11 +1458,13 @@ type ILMethodDef (name: string, attributes: MethodAttributes, implAttributes: Me parameters = defaultArg parameters x.Parameters, ret = defaultArg ret x.Return, body = defaultArg body x.Body, - securityDecls = defaultArg securityDecls x.SecurityDecls, + securityDecls = (match securityDecls with None -> x.SecurityDecls | Some attrs -> attrs), isEntryPoint = defaultArg isEntryPoint x.IsEntryPoint, genericParams = defaultArg genericParams x.GenericParams, - customAttrs = defaultArg customAttrs x.CustomAttrs) + customAttrs=(match customAttrs with None -> x.CustomAttrs | Some attrs -> attrs)) + member x.CustomAttrs = x.CustomAttrsStored.GetCustomAttrs metadataIndex + member x.SecurityDecls = x.SecurityDeclsStored.GetSecurityDecls x.MetadataIndex member x.ParameterTypes = typesOfILParams x.Parameters member md.Code = @@ -1503,16 +1559,22 @@ type ILMethodDefs(f : (unit -> ILMethodDef[])) = member x.FindByNameAndArity (nm,arity) = x.FindByName nm |> List.filter (fun x -> List.length x.Parameters = arity) [] -type ILEventDef(eventType: ILType option, name: string, attributes: EventAttributes, addMethod: ILMethodRef, removeMethod: ILMethodRef, fireMethod: ILMethodRef option, otherMethods: ILMethodRef list, customAttrs: ILAttributes) = +type ILEventDef(eventType: ILType option, name: string, attributes: EventAttributes, addMethod: ILMethodRef, removeMethod: ILMethodRef, fireMethod: ILMethodRef option, otherMethods: ILMethodRef list, customAttrsStored: ILAttributesStored, metadataIndex: int32) = + + new (eventType, name, attributes, addMethod, removeMethod, fireMethod, otherMethods, customAttrs) = + ILEventDef(eventType, name, attributes, addMethod, removeMethod, fireMethod, otherMethods, storeILCustomAttrs customAttrs, NoMetadataIdx) + + member __.EventType = eventType + member __.Name = name + member __.Attributes = attributes + member __.AddMethod = addMethod + member __.RemoveMethod = removeMethod + member __.FireMethod = fireMethod + member __.OtherMethods = otherMethods + member __.CustomAttrsStored = customAttrsStored + member __.MetadataIndex = metadataIndex + member x.CustomAttrs = customAttrsStored.GetCustomAttrs x.MetadataIndex - member x.EventType = eventType - member x.Name = name - member x.Attributes = attributes - member x.AddMethod = addMethod - member x.RemoveMethod = removeMethod - member x.FireMethod = fireMethod - member x.OtherMethods = otherMethods - member x.CustomAttrs = customAttrs member x.With(?eventType, ?name, ?attributes, ?addMethod, ?removeMethod, ?fireMethod, ?otherMethods, ?customAttrs) = ILEventDef(eventType= defaultArg eventType x.EventType, name= defaultArg name x.Name, @@ -1521,9 +1583,11 @@ type ILEventDef(eventType: ILType option, name: string, attributes: EventAttribu removeMethod=defaultArg removeMethod x.RemoveMethod, fireMethod= defaultArg fireMethod x.FireMethod, otherMethods= defaultArg otherMethods x.OtherMethods, - customAttrs=defaultArg customAttrs x.CustomAttrs) + customAttrs=(match customAttrs with None -> x.CustomAttrs | Some attrs -> attrs)) + member x.IsSpecialName = (x.Attributes &&& EventAttributes.SpecialName) <> enum<_>(0) member x.IsRTSpecialName = (x.Attributes &&& EventAttributes.RTSpecialName) <> enum<_>(0) + override x.ToString() = "event " + x.Name (* Index table by name. *) @@ -1534,7 +1598,11 @@ type ILEventDefs = member x.LookupByName s = let (ILEvents t) = x in t.[s] [] -type ILPropertyDef(name: string, attributes: PropertyAttributes, setMethod: ILMethodRef option, getMethod: ILMethodRef option, callingConv: ILThisConvention, propertyType: ILType, init: ILFieldInit option, args: ILTypes, customAttrs: ILAttributes) = +type ILPropertyDef(name: string, attributes: PropertyAttributes, setMethod: ILMethodRef option, getMethod: ILMethodRef option, callingConv: ILThisConvention, propertyType: ILType, init: ILFieldInit option, args: ILTypes, customAttrsStored: ILAttributesStored, metadataIndex: int32) = + + new (name, attributes, setMethod, getMethod, callingConv, propertyType, init, args, customAttrs) = + ILPropertyDef(name, attributes, setMethod, getMethod, callingConv, propertyType, init, args, storeILCustomAttrs customAttrs, NoMetadataIdx) + member x.Name = name member x.Attributes = attributes member x.GetMethod = getMethod @@ -1543,7 +1611,10 @@ type ILPropertyDef(name: string, attributes: PropertyAttributes, setMethod: ILMe member x.PropertyType = propertyType member x.Init = init member x.Args = args - member x.CustomAttrs = customAttrs + member x.CustomAttrsStored = customAttrsStored + member x.CustomAttrs = customAttrsStored.GetCustomAttrs x.MetadataIndex + member x.MetadataIndex = metadataIndex + member x.With(?name, ?attributes, ?setMethod, ?getMethod, ?callingConv, ?propertyType, ?init, ?args, ?customAttrs) = ILPropertyDef(name=defaultArg name x.Name, attributes=defaultArg attributes x.Attributes, @@ -1553,7 +1624,8 @@ type ILPropertyDef(name: string, attributes: PropertyAttributes, setMethod: ILMe propertyType=defaultArg propertyType x.PropertyType, init=defaultArg init x.Init, args=defaultArg args x.Args, - customAttrs=defaultArg customAttrs x.CustomAttrs) + customAttrs=(match customAttrs with None -> x.CustomAttrs | Some attrs -> attrs)) + member x.IsSpecialName = (x.Attributes &&& PropertyAttributes.SpecialName) <> enum<_>(0) member x.IsRTSpecialName = (x.Attributes &&& PropertyAttributes.RTSpecialName) <> enum<_>(0) @@ -1576,8 +1648,10 @@ let convertFieldAccess (ilMemberAccess:ILMemberAccess) = | ILMemberAccess.Public -> FieldAttributes.Public [] -type ILFieldDef(name: string, fieldType: ILType, attributes: FieldAttributes, data: byte[] option, literalValue: ILFieldInit option, offset: int32 option, marshal: ILNativeType option, customAttrs: ILAttributes) = +type ILFieldDef(name: string, fieldType: ILType, attributes: FieldAttributes, data: byte[] option, literalValue: ILFieldInit option, offset: int32 option, marshal: ILNativeType option, customAttrsStored: ILAttributesStored, metadataIndex: int32) = + new (name, fieldType, attributes, data, literalValue, offset, marshal, customAttrs) = + ILFieldDef(name, fieldType, attributes, data, literalValue, offset, marshal, storeILCustomAttrs customAttrs, NoMetadataIdx) member __.Name=name member __.FieldType = fieldType member __.Attributes=attributes @@ -1585,7 +1659,9 @@ type ILFieldDef(name: string, fieldType: ILType, attributes: FieldAttributes, da member __.LiteralValue=literalValue member __.Offset=offset member __.Marshal=marshal - member __.CustomAttrs=customAttrs + member x.CustomAttrsStored = customAttrsStored + member x.CustomAttrs = customAttrsStored.GetCustomAttrs x.MetadataIndex + member x.MetadataIndex = metadataIndex member x.With(?name: string, ?fieldType: ILType, ?attributes: FieldAttributes, ?data: byte[] option, ?literalValue: ILFieldInit option, ?offset: int32 option, ?marshal: ILNativeType option, ?customAttrs: ILAttributes) = ILFieldDef(name=defaultArg name x.Name, @@ -1744,7 +1820,10 @@ let convertInitSemantics (init:ILTypeInit) = [] type ILTypeDef(name: string, attributes: TypeAttributes, layout: ILTypeDefLayout, implements: ILTypes, genericParams: ILGenericParameterDefs, extends: ILType option, methods: ILMethodDefs, nestedTypes: ILTypeDefs, fields: ILFieldDefs, methodImpls: ILMethodImplDefs, - events: ILEventDefs, properties: ILPropertyDefs, customAttrs: ILAttributes, securityDecls: ILSecurityDecls) = + events: ILEventDefs, properties: ILPropertyDefs, securityDeclsStored: ILSecurityDeclsStored, customAttrsStored: ILAttributesStored, metadataIndex: int32) = + + new (name, attributes, layout, implements, genericParams, extends, methods, nestedTypes, fields, methodImpls, events, properties, securityDecls, customAttrs) = + ILTypeDef (name, attributes, layout, implements, genericParams, extends, methods, nestedTypes, fields, methodImpls, events, properties, storeILSecurityDecls securityDecls, storeILCustomAttrs customAttrs, NoMetadataIdx) member __.Name = name member __.Attributes = attributes @@ -1754,12 +1833,14 @@ type ILTypeDef(name: string, attributes: TypeAttributes, layout: ILTypeDefLayout member __.Implements = implements member __.Extends = extends member __.Methods = methods - member __.SecurityDecls = securityDecls + member __.SecurityDeclsStored = securityDeclsStored member __.Fields = fields member __.MethodImpls = methodImpls member __.Events = events member __.Properties = properties - member __.CustomAttrs = customAttrs + member __.CustomAttrsStored = customAttrsStored + member __.MetadataIndex = metadataIndex + member x.With(?name, ?attributes, ?layout, ?implements, ?genericParams, ?extends, ?methods, ?nestedTypes, ?fields, ?methodImpls, ?events, ?properties, ?customAttrs, ?securityDecls) = ILTypeDef(name=defaultArg name x.Name, attributes=defaultArg attributes x.Attributes, @@ -1775,6 +1856,10 @@ type ILTypeDef(name: string, attributes: TypeAttributes, layout: ILTypeDefLayout events = defaultArg events x.Events, properties = defaultArg properties x.Properties, customAttrs = defaultArg customAttrs x.CustomAttrs) + + member x.CustomAttrs = customAttrsStored.GetCustomAttrs x.MetadataIndex + member x.SecurityDecls = x.SecurityDeclsStored.GetSecurityDecls x.MetadataIndex + member x.IsClass = (typeKindOfFlags x.Name x.Methods x.Fields x.Extends (int x.Attributes)) = ILTypeDefKind.Class member x.IsStruct = (typeKindOfFlags x.Name x.Methods x.Fields x.Extends (int x.Attributes)) = ILTypeDefKind.ValueType member x.IsInterface = (typeKindOfFlags x.Name x.Methods x.Fields x.Extends (int x.Attributes)) = ILTypeDefKind.Interface @@ -1802,38 +1887,68 @@ type ILTypeDef(name: string, attributes: TypeAttributes, layout: ILTypeDefLayout member x.WithSpecialName(condition) = x.With(attributes=(x.Attributes |> conditionalAdd condition TypeAttributes.SpecialName)) member x.WithInitSemantics(init) = x.With(attributes=(x.Attributes ||| convertInitSemantics init)) -and [] ILTypeDefs(f : unit -> (string list * string * ILAttributes * Lazy)[]) = +and [] ILTypeDefs(f : unit -> ILPreTypeDef[]) = let mutable array = InlineDelayInit<_>(f) let mutable dict = InlineDelayInit<_>(fun () -> - let arr = array.Value - let t = Dictionary<_,_>(HashIdentity.Structural) - for (nsp, nm, _attr, ltd) in arr do - let key = nsp, nm - t.[key] <- ltd - t) + let arr = array.Value + let t = Dictionary<_,_>(HashIdentity.Structural) + for pre in arr do + let key = pre.Namespace, pre.Name + t.[key] <- pre + t) - member x.AsArray = [| for (_,_,_,ltd) in array.Value -> ltd.Force() |] - member x.AsList = [ for (_,_,_,ltd) in array.Value -> ltd.Force() ] + member x.AsArray = [| for pre in array.Value -> pre.GetTypeDef() |] + member x.AsList = [ for pre in array.Value -> pre.GetTypeDef() ] interface IEnumerable with member x.GetEnumerator() = ((x :> IEnumerable).GetEnumerator() :> IEnumerator) interface IEnumerable with member x.GetEnumerator() = - (seq { for (_,_,_,ltd) in array.Value -> ltd.Force() }).GetEnumerator() + (seq { for pre in array.Value -> pre.GetTypeDef() }).GetEnumerator() - member x.AsArrayOfLazyTypeDefs = array.Value + member x.AsArrayOfPreTypeDefs = array.Value member x.FindByName nm = let ns,n = splitILTypeName nm - dict.Value.[(ns,n)].Force() + dict.Value.[(ns,n)].GetTypeDef() + +/// This is a memory-critical class. Very many of these objects get allocated and held to represent the contents of .NET assemblies. +and [] ILPreTypeDef(nameSpace: string list, name: string, metadataIndex: int32, storage: ILTypeDefStored) = + let mutable store : ILTypeDef = Unchecked.defaultof<_> + + member __.Namespace = nameSpace + member __.Name = name + member __.MetadataIndex = metadataIndex + + member x.GetTypeDef() = + match box store with + | null -> + match storage with + | ILTypeDefStored.Given td -> + store <- td + td + | ILTypeDefStored.Computed f -> + System.Threading.LazyInitializer.EnsureInitialized(&store, System.Func<_>(fun () -> f())) + | ILTypeDefStored.Reader f -> + System.Threading.LazyInitializer.EnsureInitialized(&store, System.Func<_>(fun () -> f x.MetadataIndex)) + | _ -> store + +and ILTypeDefStored = + | Given of ILTypeDef + | Reader of (int32 -> ILTypeDef) + | Computed of (unit -> ILTypeDef) + +let mkILTypeDefReader f = ILTypeDefStored.Reader f type ILNestedExportedType = - { Name: string; - Access: ILMemberAccess; - Nested: ILNestedExportedTypes; - CustomAttrs: ILAttributes } + { Name: string + Access: ILMemberAccess + Nested: ILNestedExportedTypes + CustomAttrsStored: ILAttributesStored + MetadataIndex: int32 } + member x.CustomAttrs = x.CustomAttrsStored.GetCustomAttrs x.MetadataIndex and ILNestedExportedTypes = | ILNestedExportedTypes of Lazy> @@ -1841,13 +1956,15 @@ and ILNestedExportedTypes = and [] ILExportedTypeOrForwarder = - { ScopeRef: ILScopeRef; - Name: string; + { ScopeRef: ILScopeRef + Name: string Attributes: TypeAttributes - Nested: ILNestedExportedTypes; - CustomAttrs: ILAttributes } + Nested: ILNestedExportedTypes + CustomAttrsStored: ILAttributesStored + MetadataIndex: int32 } member x.Access = typeAccessOfFlags (int x.Attributes) member x.IsForwarder = x.Attributes &&& enum(0x00200000) <> enum 0 + member x.CustomAttrs = x.CustomAttrsStored.GetCustomAttrs x.MetadataIndex and ILExportedTypesAndForwarders = | ILExportedTypesAndForwarders of Lazy> @@ -1867,9 +1984,12 @@ type ILResourceLocation = type ILResource = { Name: string; - Location: ILResourceLocation; - Access: ILResourceAccess; - CustomAttrs: ILAttributes } + Location: ILResourceLocation + Access: ILResourceAccess + CustomAttrsStored: ILAttributesStored + MetadataIndex: int32 } + + /// Read the bytes from a resource local to an assembly member r.GetBytes() = match r.Location with | ILResourceLocation.LocalIn (file, start, len) -> @@ -1877,6 +1997,8 @@ type ILResource = | ILResourceLocation.LocalOut bytes -> bytes | _ -> failwith "GetBytes" + member x.CustomAttrs = x.CustomAttrsStored.GetCustomAttrs x.MetadataIndex + type ILResources = | ILResources of ILResource list member x.AsList = let (ILResources ltab) = x in ltab @@ -1897,11 +2019,11 @@ type ILAssemblyLongevity = type ILAssemblyManifest = { Name: string AuxModuleHashAlgorithm: int32 - SecurityDecls: ILSecurityDecls + SecurityDeclsStored: ILSecurityDeclsStored PublicKey: byte[] option Version: ILVersionInfo option Locale: Locale option - CustomAttrs: ILAttributes + CustomAttrsStored: ILAttributesStored AssemblyLongevity: ILAssemblyLongevity DisableJitOptimizations: bool @@ -1913,7 +2035,10 @@ type ILAssemblyManifest = ExportedTypes: ILExportedTypesAndForwarders /// Records whether the entrypoint resides in another module. EntrypointElsewhere: ILModuleRef option + MetadataIndex: int32 } + member x.CustomAttrs = x.CustomAttrsStored.GetCustomAttrs x.MetadataIndex + member x.SecurityDecls = x.SecurityDeclsStored.GetSecurityDecls x.MetadataIndex [] type ILNativeResource = @@ -1922,7 +2047,6 @@ type ILNativeResource = type ILModuleDef = { Manifest: ILAssemblyManifest option - CustomAttrs: ILAttributes Name: string TypeDefs: ILTypeDefs SubsystemVersion : int * int @@ -1942,6 +2066,8 @@ type ILModuleDef = MetadataVersion: string Resources: ILResources NativeResources: ILNativeResource list (* e.g. win32 resources *) + CustomAttrsStored: ILAttributesStored + MetadataIndex: int32 } member x.ManifestOfAssembly = match x.Manifest with @@ -1951,6 +2077,7 @@ type ILModuleDef = member m.HasManifest = match m.Manifest with None -> false | _ -> true + member x.CustomAttrs = x.CustomAttrsStored.GetCustomAttrs x.MetadataIndex // -------------------------------------------------------------------- // Add fields and types to tables, with decent error messages @@ -2085,11 +2212,6 @@ let mkILFieldSpec (tref,ty) = { FieldRef= tref; DeclaringType=ty } let mkILFieldSpecInTy (typ:ILType,nm,fty) = mkILFieldSpec (mkILFieldRef (typ.TypeRef,nm,fty), typ) -let emptyILCustomAttrs = ILAttributes (fun () -> [| |]) - -let mkILCustomAttrsFromArray (l: ILAttribute[]) = if l.Length = 0 then emptyILCustomAttrs else ILAttributes (fun () -> l) -let mkILCustomAttrs l = l |> List.toArray |> mkILCustomAttrsFromArray -let mkILComputedCustomAttrs f = ILAttributes f let andTailness x y = match x with Tailcall when y -> Tailcall | _ -> Normalcall @@ -2125,20 +2247,17 @@ let nonBranchingInstrsToCode instrs : ILCode = // // -------------------------------------------------------------------- -let emptyILSecurityDecls = ILSecurityDecls.ILSecurityDecls [] -let mkILSecurityDecls l = match l with [] -> emptyILSecurityDecls | _ -> ILSecurityDecls.ILSecurityDecls l -let mkILLazySecurityDecls l = ILSecurityDecls.ILSecurityDeclsLazy l - let mkILTyvarTy tv = ILType.TypeVar tv let mkILSimpleTypar nm = - { Name=nm; + { Name=nm Constraints = [] - Variance=NonVariant; - HasReferenceTypeConstraint=false; - HasNotNullableValueTypeConstraint=false; - HasDefaultConstructorConstraint=false; - CustomAttrs = emptyILCustomAttrs } + Variance=NonVariant + HasReferenceTypeConstraint=false + HasNotNullableValueTypeConstraint=false + HasDefaultConstructorConstraint=false + CustomAttrsStored = storeILCustomAttrs emptyILCustomAttrs + MetadataIndex = NoMetadataIdx } let gparam_of_gactual (_ga:ILType) = mkILSimpleTypar "T" @@ -2162,13 +2281,17 @@ let mkRefForNestedILTypeDef scope (enc:ILTypeDef list,td:ILTypeDef) = // Operations on type tables. // -------------------------------------------------------------------- -let getName (ltd: Lazy) = - let td = Lazy.force ltd +let mkILPreTypeDef (td:ILTypeDef) = let ns,n = splitILTypeName td.Name - (ns,n,td.CustomAttrs,ltd) + ILPreTypeDef(ns, n, NoMetadataIdx, ILTypeDefStored.Given td) +let mkILPreTypeDefComputed (ns, n, f) = + ILPreTypeDef(ns, n, NoMetadataIdx, ILTypeDefStored.Computed f) +let mkILPreTypeDefRead (ns, n, idx, f) = + ILPreTypeDef(ns, n, idx, f) -let addILTypeDef td (tdefs: ILTypeDefs) = ILTypeDefs (fun () -> [| yield getName (notlazy td); yield! tdefs.AsArrayOfLazyTypeDefs |]) -let mkILTypeDefsFromArray l = ILTypeDefs (fun () -> Array.map (notlazy >> getName) l) + +let addILTypeDef td (tdefs: ILTypeDefs) = ILTypeDefs (fun () -> [| yield mkILPreTypeDef td; yield! tdefs.AsArrayOfPreTypeDefs |]) +let mkILTypeDefsFromArray (l: ILTypeDef[]) = ILTypeDefs (fun () -> Array.map mkILPreTypeDef l) let mkILTypeDefs l = mkILTypeDefsFromArray (Array.ofList l) let mkILTypeDefsComputed f = ILTypeDefs f let emptyILTypeDefs = mkILTypeDefsFromArray [| |] @@ -2476,21 +2599,23 @@ let instILType i t = instILTypeAux 0 i t // -------------------------------------------------------------------- let mkILParam (name,ty) : ILParameter = - { Name=name; - Default=None; - Marshal=None; - IsIn=false; - IsOut=false; - IsOptional=false; - Type=ty; - CustomAttrs=emptyILCustomAttrs } + { Name=name + Default=None + Marshal=None + IsIn=false + IsOut=false + IsOptional=false + Type=ty + CustomAttrsStored=storeILCustomAttrs emptyILCustomAttrs + MetadataIndex = NoMetadataIdx } let mkILParamNamed (s,ty) = mkILParam (Some s,ty) let mkILParamAnon ty = mkILParam (None,ty) let mkILReturn ty : ILReturn = - { Marshal=None; - Type=ty; - CustomAttrs=emptyILCustomAttrs } + { Marshal=None + Type=ty + CustomAttrsStored=storeILCustomAttrs emptyILCustomAttrs + MetadataIndex = NoMetadataIdx } let mkILLocal ty dbgInfo : ILLocal = { IsPinned=false; @@ -2592,7 +2717,7 @@ let mkILClassCtor impl = ret=mkILVoidReturn, isEntryPoint=false, securityDecls=emptyILSecurityDecls, - customAttrs = emptyILCustomAttrs, + customAttrs=emptyILCustomAttrs, body= mkMethBodyAux impl) // -------------------------------------------------------------------- @@ -2763,11 +2888,12 @@ let addNestedExportedTypeToTable (y: ILNestedExportedType) tab = Map.add y.Name y tab let mkTypeForwarder scopeRef name nested customAttrs access = - { ScopeRef=scopeRef; - Name=name; - Attributes=enum(0x00200000) ||| convertTypeAccessFlags access; - Nested=nested; - CustomAttrs=customAttrs; } + { ScopeRef=scopeRef + Name=name + Attributes=enum(0x00200000) ||| convertTypeAccessFlags access + Nested=nested + CustomAttrsStored=storeILCustomAttrs customAttrs + MetadataIndex = NoMetadataIdx } let mkILNestedExportedTypes l = ILNestedExportedTypes (notlazy (List.foldBack addNestedExportedTypeToTable l Map.empty)) @@ -2874,20 +3000,21 @@ let mkILSimpleModule assname modname dll subsystemVersion useHighEntropyVA tdefs let manifest = { Name=assname AuxModuleHashAlgorithm= match hashalg with | Some(alg) -> alg | _ -> 0x8004 // SHA1 - SecurityDecls=emptyILSecurityDecls + SecurityDeclsStored=emptyILSecurityDeclsStored PublicKey= None Version= None Locale=locale - CustomAttrs=emptyILCustomAttrs + CustomAttrsStored=storeILCustomAttrs emptyILCustomAttrs AssemblyLongevity=ILAssemblyLongevity.Unspecified DisableJitOptimizations = 0 <> (flags &&& 0x4000) JitTracking = (0 <> (flags &&& 0x8000)) // always turn these on IgnoreSymbolStoreSequencePoints = (0 <> (flags &&& 0x2000)) Retargetable = (0 <> (flags &&& 0x100)) ExportedTypes=exportedTypes - EntrypointElsewhere=None } + EntrypointElsewhere=None + MetadataIndex = NoMetadataIdx } { Manifest= Some manifest - CustomAttrs=emptyILCustomAttrs + CustomAttrsStored=storeILCustomAttrs emptyILCustomAttrs Name=modname NativeResources=[] TypeDefs=tdefs @@ -2906,6 +3033,7 @@ let mkILSimpleModule assname modname dll subsystemVersion useHighEntropyVA tdefs ImageBase=defaultImageBase MetadataVersion=metadataVersion Resources=mkILResources [] + MetadataIndex = NoMetadataIdx } @@ -3777,7 +3905,7 @@ and refs_of_modul s m = refs_of_resources s m.Resources Option.iter (refs_of_manifest s) m.Manifest -and refs_of_manifest s m = +and refs_of_manifest s (m: ILAssemblyManifest) = refs_of_custom_attrs s m.CustomAttrs refs_of_exported_types s m.ExportedTypes diff --git a/src/absil/il.fsi b/src/absil/il.fsi index a83be837f6..33b077e197 100644 --- a/src/absil/il.fsi +++ b/src/absil/il.fsi @@ -1,10 +1,8 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -/// The "unlinked" view of .NET metadata and code. Central to -/// to Abstract IL library +/// The "unlinked" view of .NET metadata and code. Central to the Abstract IL library module public Microsoft.FSharp.Compiler.AbstractIL.IL -open Internal.Utilities open System.Collections.Generic open System.Reflection @@ -16,49 +14,7 @@ type PrimaryAssembly = member Name: string -// ==================================================================== -// .NET binaries can be converted to the data structures below by using -// the functions in the "Ilread" module. -// -// Constituent types are listed in ascending order of complexity, -// all the way up to the type ILModuleDef, representing the read of an IL -// assembly (.dll or .exe), or part of a multi-module assembly. Types are -// often specified via a concrete representation for the type (e.g. a record), -// though some types are abstract. -// -// The second part of the file (after the definition of all the types) -// specifies a large set of utilities for building objects belonging to -// the types. You will only need to become familiar with these if you -// are transforming code or writing a code-generating compiler. -// -// Several other utilities are also defined in this file: -// 1. A code builder for turning linear sequences of instructions -// augmented with exception tables into the more structured -// format used for code. -// -// 2. The "typ_XYZ", "tspec_XYZ" and "mspec_XYZ" values which -// can be used to reference types in the "primary assembly (either System.Runtime or mscorlib)" assembly. -// -// 3. The "rescopeXYZ" functions which can be used to lift a piece of -// metadata from one assembly and transform it to a piece of metadata -// suitable for use from another assembly. The transformation adjusts -// references in the metadata to take into account the assembly -// where the metadata will now be located. -// -// 4. The "instantiateXYZ" utilities to replace type variables -// by types. These are associated with generics. -// -// 5. The "intern_XYZ" tables for reducing the memory used by -// generated constructs. -// -// 6. The "refs_of_XYZ" utilities for finding all the assemblies -// referenced by a module. -// -// 7. A somewhat obscure facility to allow new instructions and types -// to be added to the This is only used by ILX. -// ==================================================================== - -// Guids (Note: consider adjusting these to the System.Guid type) +/// Represents guids type ILGuid = byte[] [] @@ -104,10 +60,12 @@ type ILAssemblyRef = static member Create: name: string * hash: byte[] option * publicKey: PublicKey option * retargetable: bool * version: ILVersionInfo option * locale: string option -> ILAssemblyRef static member FromAssemblyName: System.Reflection.AssemblyName -> ILAssemblyRef member Name: string + /// The fully qualified name of the assembly reference, e.g. mscorlib, Version=1.0.3705 etc. member QualifiedName: string member Hash: byte[] option member PublicKey: PublicKey option + /// CLI says this indicates if the assembly can be retargeted (at runtime) to be from a different publisher. member Retargetable: bool member Version: ILVersionInfo option @@ -123,67 +81,7 @@ type ILModuleRef = interface System.IComparable // Scope references -// -// Scope references are the bits of metadata attached to type names -// that indicate where a type can be found. CIL has three -// kinds: local, module and assembly references: -// o Local: the type must reside in the same module as the scope reference -// o Module: the type must reside in the indicated module in the same -// assembly as the scope reference -// o Assembly: The type must reside in the indicated assembly. -// These have no implicit context. Assembly references can end up -// binding to the assembly containing the reference, i.e. -// may be self or mutually referential. -// -// Assembly reference may also resolve to type in an -// auxiliary module of an assembly when the assembly -// has an "exported types" (here called "classes elsewhere") table. -// -// We represent these references by values embedded within type -// references. These values are usually "shared" across the data -// structures for a module, i.e. one such value is created for each -// assembly or module reference, and this value is reused within each -// type object. -// -// Note that as with method references the term structure is not -// _linked_, i.e. a "ILScopeRef" is still a _reference_ to a scope, -// not the scope itself. Because the structure is not linked, -// the Abstract IL toolset does not require -// strongly connected inputs: you can manipulate an assembly -// without loading all its dependent assemblies. This is the primary -// difference between Abstract IL and Reflection, and it can be both -// a blessing and a curse depending on the kind of manipulation you -// wish to perform. -// -// Similarly, you can manipulate individual modules within -// an assembly without having the whole assembly loaded. (But note that -// most assemblies are single-module in any case). -// -// [ILScopeRef]'s _cannot_ be compared for equality in the way that -// might be expected, in these sense that two ILScopeRef's may -// resolve to the same assembly/module even though they are not equal. -// -// Aside: People have suggested normalizing all scope references -// so that this would be possible, and early versions of this -// toolkit did this. However, this meant that in order to load -// each module you had to tell the toolkit which assembly it belonged to. -// Furthermore, you had to know the exact resolved details of -// each assembly the module refers to. This is -// effectively like having a "fully-linked" view of the graph -// of assemblies, like that provided in the Ilbind module. This is really problematic for compile-time tools, -// as, for example, the policy for linking at the runtime-machine -// may actually alter the results of linking. If such compile-time -// assumptions are to be made then the tool built on top -// of the toolkit rather than the toolkit itself should -// make them. -// -// Scope references, type references, field references and method references -// can be "bound" to particular assemblies using the functions in "Ilbind". -// This simulates the resolution/binding process performed by a Common Language -// Runtime during execution. Various tests and derived operations -// can then be performed on the results of binding. -[] -[] +[] type ILScopeRef = /// A reference to the type in the current module | Local @@ -228,29 +126,31 @@ type ILThisConvention = [] type ILCallingConv = | Callconv of ILThisConvention * ILArgConvention + member IsInstance: bool member IsInstanceExplicit: bool member IsStatic: bool member ThisConv: ILThisConvention member BasicConv: ILArgConvention + static member Instance: ILCallingConv static member Static : ILCallingConv -/// Array shapes. For most purposes, including verification, the -/// rank is the only thing that matters. - +/// Array shapes. For most purposes the rank is the only thing that matters. type ILArrayBound = int32 option + +/// Lower-bound/size pairs type ILArrayBounds = ILArrayBound * ILArrayBound -[] type ILArrayShape = - | ILArrayShape of ILArrayBounds list // lobound/size pairs + | ILArrayShape of ILArrayBounds list + member Rank: int + /// Bounds for a single dimensional, zero based array static member SingleDimensional: ILArrayShape static member FromRank: int -> ILArrayShape -[] type ILBoxity = | AsObject | AsValue @@ -291,14 +191,6 @@ type ILTypeRef = interface System.IComparable /// Type specs and types. -/// -/// These are the types that appear syntactically in .NET binaries. -/// -/// Generic type definitions must be combined with -/// an instantiation to form a type. Throughout this file, -/// a "ref" refers to something that is uninstantiated, and -/// a "spec" to a ref that is combined with the relevant instantiations. - [] type ILTypeSpec = static member Create: typeRef:ILTypeRef * instantiation:ILGenericArgs -> ILTypeSpec @@ -317,22 +209,31 @@ type ILTypeSpec = and [] ILType = + /// Used only in return and pointer types. | Void + /// Array types | Array of ILArrayShape * ILType + /// Unboxed types, including builtin types. | Value of ILTypeSpec + /// Reference types. Also may be used for parents of members even if for members in value types. | Boxed of ILTypeSpec + /// Unmanaged pointers. Nb. the type is used by tools and for binding only, not by the verifier. | Ptr of ILType + /// Managed pointers. | Byref of ILType + /// ILCode pointers. | FunctionPointer of ILCallingSignature + /// Reference a generic arg. | TypeVar of uint16 + /// Custom modifiers. | Modified of /// True if modifier is "required". @@ -341,6 +242,7 @@ and ILTypeRef * /// The type being modified. ILType + member TypeSpec: ILTypeSpec member Boxity: ILBoxity member TypeRef: ILTypeRef @@ -357,22 +259,17 @@ and [] ReturnType: ILType } /// Actual generic parameters are always types. +and ILGenericArgs = ILType list +and ILTypes = ILType list -and ILGenericArgs = list -and ILTypes = list - -/// Formal identities of methods. Method refs refer to methods on -/// named types. In general you should work with ILMethodSpec objects -/// rather than MethodRef objects, because ILMethodSpec objects carry -/// information about how generic methods are instantiated. MethodRef -/// objects are only used at a few places in the Abstract IL syntax -/// and if analyzing or generating IL you will be unlikely to come across -/// these. - +/// Formal identities of methods. [] type ILMethodRef = + + /// Functional creation static member Create: enclosingTypeRef: ILTypeRef * callingConv: ILCallingConv * name: string * genericArity: int * argTypes: ILTypes * returnType: ILType -> ILMethodRef + member DeclaringTypeRef: ILTypeRef member CallingConv: ILCallingConv member Name: string @@ -383,8 +280,7 @@ type ILMethodRef = member CallingSignature: ILCallingSignature interface System.IComparable -/// Formal identities of fields. - +/// Formal identities of fields. [] type ILFieldRef = { DeclaringTypeRef: ILTypeRef @@ -392,21 +288,12 @@ type ILFieldRef = Type: ILType } /// The information at the callsite of a method -// -// A ILMethodSpec is everything given at the callsite (apart from whether the call is a tailcall and whether it is passing -// varargs - see the instruction set below). It is made up of: -// 1) a (possibly generic) ILMethodRef -// 2) a "usage type" that indicates the how the type containing the declaration is being used (as -// a value class, a boxed value class, an instantiated generic class or whatever - see below) -// 3) an instantiation in the case where the method is generic. -// -// In this unbound form of the metadata, the enclosing type may be ILType.Boxed even when the member is a member of a value type or -// enumeration. This is because the binary format of the metadata does not carry enough information in a MemberRefParent to determine -// from the binary alone whether the enclosing type is a value type or not. - [] type ILMethodSpec = + + /// Functional creation static member Create: ILType * ILMethodRef * ILGenericArgs -> ILMethodSpec + member MethodRef: ILMethodRef member DeclaringType: ILType member GenericArgs: ILGenericArgs @@ -417,20 +304,18 @@ type ILMethodSpec = member FormalReturnType: ILType interface System.IComparable - /// Field specs. The data given for a ldfld, stfld etc. instruction. [] type ILFieldSpec = { FieldRef: ILFieldRef DeclaringType: ILType } + member DeclaringTypeRef: ILTypeRef member Name: string member FormalType: ILType member ActualType: ILType -/// ILCode labels. In structured code each code label -/// refers to a basic block somewhere in the code of the method. - +/// ILCode labels. In structured code each code label refers to a basic block somewhere in the code of the method. type ILCodeLabel = int [] @@ -499,15 +384,8 @@ type ILComparisonInstr = | BI_brtrue /// The instruction set. -/// -/// In general we don't categorize instructions, as different -/// instruction groups are relevant for different types of operations. -/// However we do collect the branch and compare instructions together -/// because they all take an address, and the ILArithInstr ones because -/// none of them take any direct arguments. [] type ILInstr = - // Basic | AI_add | AI_add_ovf | AI_add_ovf_un @@ -641,11 +519,10 @@ type ILInstr = | I_cpblk of ILAlignment * ILVolatility | I_initblk of ILAlignment * ILVolatility - // EXTENSIONS, e.g. MS-ILX + // EXTENSIONS | EI_ilzero of ILType | EI_ldlen_multi of int32 * int32 - [] type ILExceptionClause = | Finally of (ILCodeLabel * ILCodeLabel) @@ -679,7 +556,6 @@ type ILCode = Locals: ILLocalDebugInfo list } /// Field Init - [] type ILFieldInit = | String of string @@ -746,7 +622,6 @@ type ILNativeVariant = /// Native Types, for marshalling to the native C interface. /// These are taken directly from the ILASM syntax, see ECMA Spec (Partition II, 7.4). - [] type ILNativeType = | Empty @@ -774,7 +649,8 @@ type ILNativeType = | UInt16 | UInt32 | UInt64 - | Array of ILNativeType option * (int32 * int32 option) option (* optional idx of parameter giving size plus optional additive i.e. num elems *) + /// optional idx of parameter giving size plus optional additive i.e. num elems + | Array of ILNativeType option * (int32 * int32 option) option | Int | UInt | Method @@ -788,7 +664,6 @@ type ILNativeType = | ANSIBSTR | VariantBool - /// Local variables [] type ILLocal = @@ -802,7 +677,6 @@ type ILLocals = list [] type ILMethodBody = { IsZeroInit: bool - /// strictly speaking should be a uint16 MaxStack: int32 NoInlining: bool AggressiveInlining: bool @@ -852,13 +726,16 @@ type ILAttribute = Data: byte[] Elements: ILAttribElem list} -[] +[] type ILAttributes = member AsArray: ILAttribute [] member AsList: ILAttribute list -/// Method parameters and return values. +/// Represents the efficiency-oriented storage of ILAttributes in another item. +[] +type ILAttributesStored +/// Method parameters and return values. [] type ILParameter = { Name: string option @@ -869,7 +746,9 @@ type ILParameter = IsIn: bool IsOut: bool IsOptional: bool - CustomAttrs: ILAttributes } + CustomAttrsStored: ILAttributesStored + MetadataIndex: int32 } + member CustomAttrs: ILAttributes type ILParameters = list @@ -880,10 +759,11 @@ val typesOfILParams: ILParameters -> ILType list type ILReturn = { Marshal: ILNativeType option Type: ILType - CustomAttrs: ILAttributes } + CustomAttrsStored: ILAttributesStored + MetadataIndex: int32 } + + member CustomAttrs: ILAttributes -/// Security ILSecurityDecls -/// Attached to various structures... [] type ILSecurityAction = | Request @@ -910,10 +790,14 @@ type ILSecurityDecl = /// Abstract type equivalent to ILSecurityDecl list - use helpers /// below to construct/destruct these. -[] +[] type ILSecurityDecls = member AsList: ILSecurityDecl list +/// Represents the efficiency-oriented storage of ILSecurityDecls in another item. +[] +type ILSecurityDeclsStored + /// PInvoke attributes. [] type PInvokeCallingConvention = @@ -955,18 +839,12 @@ type PInvokeMethod = CharBestFit: PInvokeCharBestFit } -/// [OverridesSpec] - refer to a method declaration in a superclass -/// or superinterface. Used for overriding/method impls. Includes -/// a type for the parent for the same reason that a method specs -/// includes the type of the enclosing type, i.e. the type -/// gives the "ILGenericArgs" at which the parent type is being used. - +/// [OverridesSpec] - refer to a method declaration in a superclass or interface. type ILOverridesSpec = | OverridesSpec of ILMethodRef * ILType member MethodRef: ILMethodRef member DeclaringType: ILType -// REVIEW: fold this into ILMethodDef. type ILMethodVirtualInfo = { IsFinal: bool IsNewSlot: bool @@ -981,24 +859,21 @@ type MethodKind = | NonVirtual | Virtual of ILMethodVirtualInfo -// REVIEW: fold this into ILMethodDef. [] type MethodBody = | IL of ILMethodBody - | PInvoke of PInvokeMethod (* platform invoke to native *) + | PInvoke of PInvokeMethod | Abstract | Native | NotAvailable -// REVIEW: fold this into ILMethodDef. [] type MethodCodeKind = | IL | Native | Runtime -/// Generic parameters. Formal generic parameter declarations -/// may include the bounds, if any, on the generic parameter. +/// Generic parameters. Formal generic parameter declarations may include the bounds, if any, on the generic parameter. type ILGenericParameterDef = { Name: string @@ -1011,13 +886,19 @@ type ILGenericParameterDef = /// Indicates the type argument must be a reference type. HasReferenceTypeConstraint: bool - CustomAttrs: ILAttributes - /// Indicates the type argument must be a value type, but not Nullable. HasNotNullableValueTypeConstraint: bool /// Indicates the type argument must have a public nullary constructor. - HasDefaultConstructorConstraint: bool } + HasDefaultConstructorConstraint: bool + + /// Do not use this + CustomAttrsStored: ILAttributesStored + + /// Do not use this + MetadataIndex: int32 } + + member CustomAttrs: ILAttributes type ILGenericParameterDefs = ILGenericParameterDef list @@ -1026,14 +907,18 @@ type ILLazyMethodBody = member Contents: MethodBody /// IL Method definitions. -/// -/// This type is immutable and record-like. We use a class to get control over the representation -/// used, which allows more efficient representation of the information. [] type ILMethodDef = - /// Functional creation of a value - new: name: string * attributes: MethodAttributes * implAttributes: MethodImplAttributes * callingConv: ILCallingConv * parameters: ILParameters * ret: ILReturn * body: ILLazyMethodBody * securityDecls: ILSecurityDecls * isEntryPoint:bool * genericParams: ILGenericParameterDefs * customAttrs: ILAttributes -> ILMethodDef + /// Functional creation of a value, with delayed reading of some elements via a metadata index + new: name: string * attributes: MethodAttributes * implAttributes: MethodImplAttributes * callingConv: ILCallingConv * + parameters: ILParameters * ret: ILReturn * body: ILLazyMethodBody * isEntryPoint:bool * genericParams: ILGenericParameterDefs * + securityDeclsStored: ILSecurityDeclsStored * customAttrsStored: ILAttributesStored * metadataIndex: int32 -> ILMethodDef + + /// Functional creation of a value, immediate + new: name: string * attributes: MethodAttributes * implAttributes: MethodImplAttributes * callingConv: ILCallingConv * + parameters: ILParameters * ret: ILReturn * body: ILLazyMethodBody * isEntryPoint:bool * genericParams: ILGenericParameterDefs * + securityDecls: ILSecurityDecls * customAttrs: ILAttributes -> ILMethodDef member Name: string member Attributes: MethodAttributes @@ -1096,7 +981,9 @@ type ILMethodDef = member IsMustRun: bool /// Functional update of the value - member With: ?name: string * ?attributes: MethodAttributes * ?implAttributes: MethodImplAttributes * ?callingConv: ILCallingConv * ?parameters: ILParameters * ?ret: ILReturn * ?body: ILLazyMethodBody * ?securityDecls: ILSecurityDecls * ?isEntryPoint:bool * ?genericParams: ILGenericParameterDefs * ?customAttrs: ILAttributes -> ILMethodDef + member With: ?name: string * ?attributes: MethodAttributes * ?implAttributes: MethodImplAttributes * ?callingConv: ILCallingConv * + ?parameters: ILParameters * ?ret: ILReturn * ?body: ILLazyMethodBody * ?securityDecls: ILSecurityDecls * ?isEntryPoint:bool * + ?genericParams: ILGenericParameterDefs * ?customAttrs: ILAttributes -> ILMethodDef member WithSpecialName: ILMethodDef member WithHideBySig: unit -> ILMethodDef member WithHideBySig: bool -> ILMethodDef @@ -1115,9 +1002,6 @@ type ILMethodDef = /// Tables of methods. Logically equivalent to a list of methods but /// the table is kept in a form optimized for looking up methods by /// name and arity. -/// -/// This type is immutable and record-like. We use a class to get control over the representation -/// used, which allows more efficient representation of the information. [] type ILMethodDefs = interface IEnumerable @@ -1126,14 +1010,18 @@ type ILMethodDefs = member FindByName: string -> ILMethodDef list /// Field definitions. -/// -/// This type is immutable and record-like. We use a class to get control over the representation -/// used, which allows more efficient representation of the information. [] type ILFieldDef = - /// Functional creation of a value - new: name: string * fieldType: ILType * attributes: FieldAttributes * data: byte[] option * literalValue: ILFieldInit option * offset: int32 option * marshal: ILNativeType option * customAttrs: ILAttributes -> ILFieldDef + /// Functional creation of a value using delayed reading via a metadata index + new: name: string * fieldType: ILType * attributes: FieldAttributes * data: byte[] option * + literalValue: ILFieldInit option * offset: int32 option * marshal: ILNativeType option * + customAttrsStored: ILAttributesStored * metadataIndex: int32 -> ILFieldDef + + /// Functional creation of a value, immediate + new: name: string * fieldType: ILType * attributes: FieldAttributes * data: byte[] option * + literalValue: ILFieldInit option * offset: int32 option * marshal: ILNativeType option * + customAttrs: ILAttributes -> ILFieldDef member Name: string member FieldType: ILType @@ -1144,7 +1032,7 @@ type ILFieldDef = /// The explicit offset in bytes when explicit layout is used. member Offset: int32 option member Marshal: ILNativeType option - member CustomAttrs: ILAttributes + member CustomAttrs: ILAttributes member IsStatic: bool member IsSpecialName: bool member IsLiteral: bool @@ -1153,7 +1041,8 @@ type ILFieldDef = member Access: ILMemberAccess /// Functional update of the value - member With: ?name: string * ?fieldType: ILType * ?attributes: FieldAttributes * ?data: byte[] option * ?literalValue: ILFieldInit option * ?offset: int32 option * ?marshal: ILNativeType option * ?customAttrs: ILAttributes -> ILFieldDef + member With: ?name: string * ?fieldType: ILType * ?attributes: FieldAttributes * ?data: byte[] option * ?literalValue: ILFieldInit option * + ?offset: int32 option * ?marshal: ILNativeType option * ?customAttrs: ILAttributes -> ILFieldDef member WithAccess: ILMemberAccess -> ILFieldDef member WithInitOnly: bool -> ILFieldDef member WithStatic: bool -> ILFieldDef @@ -1162,23 +1051,26 @@ type ILFieldDef = member WithLiteralDefaultValue: ILFieldInit option -> ILFieldDef member WithFieldMarshal: ILNativeType option -> ILFieldDef -/// Tables of fields. Logically equivalent to a list of fields but -/// the table is kept in a form optimized for looking up fields by -/// name. +/// Tables of fields. Logically equivalent to a list of fields but the table is kept in +/// a form to allow efficient looking up fields by name. [] type ILFieldDefs = member AsList: ILFieldDef list member LookupByName: string -> ILFieldDef list /// Event definitions. -/// -/// This type is immutable and record-like. We use a class to get control over the representation -/// used, which allows more efficient representation of the information. [] type ILEventDef = - /// Functional creation of a value - new: eventType: ILType option * name: string * attributes: EventAttributes * addMethod: ILMethodRef * removeMethod: ILMethodRef * fireMethod: ILMethodRef option * otherMethods: ILMethodRef list * customAttrs: ILAttributes -> ILEventDef + /// Functional creation of a value, using delayed reading via a metadata index, for ilread.fs + new: eventType: ILType option * name: string * attributes: EventAttributes * addMethod: ILMethodRef * + removeMethod: ILMethodRef * fireMethod: ILMethodRef option * otherMethods: ILMethodRef list * + customAttrsStored: ILAttributesStored * metadataIndex: int32 -> ILEventDef + + /// Functional creation of a value, immediate + new: eventType: ILType option * name: string * attributes: EventAttributes * addMethod: ILMethodRef * + removeMethod: ILMethodRef * fireMethod: ILMethodRef option * otherMethods: ILMethodRef list * + customAttrs: ILAttributes -> ILEventDef member EventType: ILType option member Name: string @@ -1192,29 +1084,29 @@ type ILEventDef = member IsRTSpecialName: bool /// Functional update of the value - member With: ?eventType: ILType option * ?name: string * ?attributes: EventAttributes * ?addMethod: ILMethodRef * ?removeMethod: ILMethodRef * ?fireMethod: ILMethodRef option * ?otherMethods: ILMethodRef list * ?customAttrs: ILAttributes -> ILEventDef + member With: ?eventType: ILType option * ?name: string * ?attributes: EventAttributes * ?addMethod: ILMethodRef * + ?removeMethod: ILMethodRef * ?fireMethod: ILMethodRef option * ?otherMethods: ILMethodRef list * + ?customAttrs: ILAttributes -> ILEventDef /// Table of those events in a type definition. -/// -/// This type is immutable and record-like. We use a class to get control over the representation -/// used, which allows more efficient representation of the information. [] type ILEventDefs = member AsList: ILEventDef list member LookupByName: string -> ILEventDef list /// Property definitions -/// -/// This type is immutable and record-like. We use a class to get control over the representation -/// used, which allows more efficient representation of the information. [] type ILPropertyDef = - /// Functional creation of a value - new: name: string * attributes: PropertyAttributes * setMethod: ILMethodRef option * getMethod: ILMethodRef option * callingConv: ILThisConvention * propertyType: ILType * init: ILFieldInit option * args: ILTypes * customAttrs: ILAttributes -> ILPropertyDef + /// Functional creation of a value, using delayed reading via a metadata index, for ilread.fs + new: name: string * attributes: PropertyAttributes * setMethod: ILMethodRef option * getMethod: ILMethodRef option * + callingConv: ILThisConvention * propertyType: ILType * init: ILFieldInit option * args: ILTypes * + customAttrsStored: ILAttributesStored * metadataIndex: int32 -> ILPropertyDef - /// Functional update of the value - member With: ?name: string * ?attributes: PropertyAttributes * ?setMethod: ILMethodRef option * ?getMethod: ILMethodRef option * ?callingConv: ILThisConvention * ?propertyType: ILType * ?init: ILFieldInit option * ?args: ILTypes * ?customAttrs: ILAttributes -> ILPropertyDef + /// Functional creation of a value, immediate + new: name: string * attributes: PropertyAttributes * setMethod: ILMethodRef option * getMethod: ILMethodRef option * + callingConv: ILThisConvention * propertyType: ILType * init: ILFieldInit option * args: ILTypes * + customAttrs: ILAttributes -> ILPropertyDef member Name: string member Attributes: PropertyAttributes @@ -1228,6 +1120,11 @@ type ILPropertyDef = member IsSpecialName: bool member IsRTSpecialName: bool + /// Functional update of the value + member With: ?name: string * ?attributes: PropertyAttributes * ?setMethod: ILMethodRef option * ?getMethod: ILMethodRef option * + ?callingConv: ILThisConvention * ?propertyType: ILType * ?init: ILFieldInit option * ?args: ILTypes * + ?customAttrs: ILAttributes -> ILPropertyDef + /// Table of properties in an IL type definition. [] [] @@ -1284,11 +1181,8 @@ type ILTypeDefKind = | Enum | Delegate -/// Tables of named type definitions. The types and table may contain on-demand -/// (lazy) computations, e.g. the actual reading of some aspects -/// of a type definition may be delayed. -[] -[] +/// Tables of named type definitions. +[] type ILTypeDefs = interface IEnumerable @@ -1297,7 +1191,7 @@ type ILTypeDefs = member AsList: ILTypeDef list /// Get some information about the type defs, but do not force the read of the type defs themselves. - member AsArrayOfLazyTypeDefs: (string list * string * ILAttributes * Lazy) array + member AsArrayOfPreTypeDefs: ILPreTypeDef[] /// Calls to FindByName will result in any laziness in the overall /// set of ILTypeDefs being read in in addition @@ -1306,19 +1200,18 @@ type ILTypeDefs = member FindByName: string -> ILTypeDef /// Represents IL Type Definitions. -/// -/// This type is immutable and record-like. We use a class to get control over the representation -/// used, which allows more efficient representation of the information. and [] ILTypeDef = - /// Create the contents + /// Functional creation of a value, using delayed reading via a metadata index, for ilread.fs new: name: string * attributes: TypeAttributes * layout: ILTypeDefLayout * implements: ILTypes * genericParams: ILGenericParameterDefs * extends: ILType option * methods: ILMethodDefs * nestedTypes: ILTypeDefs * fields: ILFieldDefs * methodImpls: ILMethodImplDefs * - events: ILEventDefs * properties: ILPropertyDefs * customAttrs: ILAttributes * securityDecls: ILSecurityDecls -> ILTypeDef + events: ILEventDefs * properties: ILPropertyDefs * securityDeclsStored: ILSecurityDeclsStored * customAttrsStored: ILAttributesStored * metadataIndex: int32 -> ILTypeDef - /// Update the contents - member With: ?name: string * ?attributes: TypeAttributes * ?layout: ILTypeDefLayout * ?implements: ILTypes * ?genericParams:ILGenericParameterDefs * ?extends:ILType option * ?methods:ILMethodDefs * ?nestedTypes:ILTypeDefs * ?fields: ILFieldDefs * ?methodImpls:ILMethodImplDefs * ?events:ILEventDefs * ?properties:ILPropertyDefs * ?customAttrs:ILAttributes * ?securityDecls: ILSecurityDecls -> ILTypeDef + /// Functional creation of a value, immediate + new: name: string * attributes: TypeAttributes * layout: ILTypeDefLayout * implements: ILTypes * genericParams: ILGenericParameterDefs * + extends: ILType option * methods: ILMethodDefs * nestedTypes: ILTypeDefs * fields: ILFieldDefs * methodImpls: ILMethodImplDefs * + events: ILEventDefs * properties: ILPropertyDefs * securityDecls: ILSecurityDecls * customAttrs: ILAttributes -> ILTypeDef member Name: string member Attributes: TypeAttributes @@ -1365,8 +1258,32 @@ and [] member WithSpecialName: bool -> ILTypeDef member WithInitSemantics: ILTypeInit -> ILTypeDef -[] -[] + /// Functional update + member With: ?name: string * ?attributes: TypeAttributes * ?layout: ILTypeDefLayout * ?implements: ILTypes * + ?genericParams:ILGenericParameterDefs * ?extends:ILType option * ?methods:ILMethodDefs * + ?nestedTypes:ILTypeDefs * ?fields: ILFieldDefs * ?methodImpls:ILMethodImplDefs * ?events:ILEventDefs * + ?properties:ILPropertyDefs * ?customAttrs:ILAttributes * ?securityDecls: ILSecurityDecls -> ILTypeDef + +/// Represents a prefix of information for ILTypeDef. +/// +/// The information is enough to perform name resolution for the F# compiler, probe attributes +/// for ExtensionAttribute etc. This is key to the on-demand exploration of .NET metadata. +/// This information has to be "Goldilocks" - not too much, not too little, just right. +and [] ILPreTypeDef = + member Namespace: string list + member Name: string + member MetadataIndex: int32 + /// Realise the actual full typedef + member GetTypeDef : unit -> ILTypeDef + +and [] ILTypeDefStored + +val mkILPreTypeDef : ILTypeDef -> ILPreTypeDef +val mkILPreTypeDefComputed : string list * string * (unit -> ILTypeDef) -> ILPreTypeDef +val mkILPreTypeDefRead : string list * string * int32 * ILTypeDefStored -> ILPreTypeDef +val mkILTypeDefReader: (int32 -> ILTypeDef) -> ILTypeDefStored + +[] type ILNestedExportedTypes = member AsList: ILNestedExportedType list @@ -1401,7 +1318,9 @@ and ILNestedExportedType = { Name: string Access: ILMemberAccess Nested: ILNestedExportedTypes - CustomAttrs: ILAttributes } + CustomAttrsStored: ILAttributesStored + MetadataIndex: int32 } + member CustomAttrs: ILAttributes /// these are only found in the ILExportedTypesAndForwarders table in the manifest [] @@ -1411,9 +1330,11 @@ type ILExportedTypeOrForwarder = Name: string Attributes: TypeAttributes Nested: ILNestedExportedTypes - CustomAttrs: ILAttributes } + CustomAttrsStored: ILAttributesStored + MetadataIndex: int32 } member Access: ILTypeDefAccess member IsForwarder: bool + member CustomAttrs: ILAttributes [] [] @@ -1447,11 +1368,14 @@ type ILResource = { Name: string Location: ILResourceLocation Access: ILResourceAccess - CustomAttrs: ILAttributes } + CustomAttrsStored: ILAttributesStored + MetadataIndex: int32 } /// Read the bytes from a resource local to an assembly. Will fail for non-local resources. member GetBytes : unit -> byte[] + member CustomAttrs: ILAttributes + /// Table of resources in a module. [] [] @@ -1476,7 +1400,7 @@ type ILAssemblyManifest = /// cryptographic hashes: they are simple file hashes. The algorithm /// is normally 0x00008004 indicating the SHA1 hash algorithm. AuxModuleHashAlgorithm: int32 - SecurityDecls: ILSecurityDecls + SecurityDeclsStored: ILSecurityDeclsStored /// This is the public key used to sign this /// assembly (the signature itself is stored elsewhere: see the /// binary format, and may not have been written if delay signing @@ -1485,7 +1409,7 @@ type ILAssemblyManifest = PublicKey: byte[] option Version: ILVersionInfo option Locale: string option - CustomAttrs: ILAttributes + CustomAttrsStored: ILAttributesStored AssemblyLongevity: ILAssemblyLongevity DisableJitOptimizations: bool JitTracking: bool @@ -1496,7 +1420,11 @@ type ILAssemblyManifest = ExportedTypes: ILExportedTypesAndForwarders /// Records whether the entrypoint resides in another module. EntrypointElsewhere: ILModuleRef option + MetadataIndex: int32 } + member CustomAttrs: ILAttributes + member SecurityDecls: ILSecurityDecls + [] type ILNativeResource = @@ -1513,7 +1441,6 @@ type ILNativeResource = /// several auxiliary modules. type ILModuleDef = { Manifest: ILAssemblyManifest option - CustomAttrs: ILAttributes Name: string TypeDefs: ILTypeDefs SubsystemVersion: int * int @@ -1530,11 +1457,14 @@ type ILModuleDef = PhysicalAlignment: int32 ImageBase: int32 MetadataVersion: string - Resources: ILResources + Resources: ILResources /// e.g. win86 resources, as the exact contents of a .res or .obj file. Must be unlinked manually. - NativeResources: ILNativeResource list } + NativeResources: ILNativeResource list + CustomAttrsStored: ILAttributesStored + MetadataIndex: int32 } member ManifestOfAssembly: ILAssemblyManifest member HasManifest: bool + member CustomAttrs: ILAttributes /// Find the method definition corresponding to the given property or /// event operation. These are always in the same class as the property @@ -1571,8 +1501,8 @@ val splitILTypeNameWithPossibleStaticArguments: string -> string[] * string /// namespace is kept as a whole string, rather than split at dots. val splitTypeNameRight: string -> string option * string - val typeNameForGlobalFunctions: string + val isTypeNameForGlobalFunctions: string -> bool val ungenericizeTypeName: string -> string (* e.g. List`1 --> List *) @@ -1634,6 +1564,7 @@ val decodeILAttribData: /// Generate simple references to assemblies and modules. val mkSimpleAssRef: string -> ILAssemblyRef + val mkSimpleModRef: string -> ILModuleRef val mkILTyvarTy: uint16 -> ILType @@ -1693,14 +1624,14 @@ val mkILFieldSpecInTy: ILType * string * ILType -> ILFieldSpec val mkILCallSig: ILCallingConv * ILType list * ILType -> ILCallingSignature -/// Make generalized versions of possibly-generic types, -/// e.g. Given the ILTypeDef for List, return the type "List". +/// Make generalized versions of possibly-generic types, e.g. Given the ILTypeDef for List, return the type "List". val mkILFormalBoxedTy: ILTypeRef -> ILGenericParameterDef list -> ILType val mkILFormalNamedTy: ILBoxity -> ILTypeRef -> ILGenericParameterDef list -> ILType val mkILFormalTypars: ILType list -> ILGenericParameterDefs val mkILFormalGenericArgs: int -> ILGenericParameterDefs -> ILGenericArgsList val mkILSimpleTypar: string -> ILGenericParameterDef + /// Make custom attributes. val mkILCustomAttribMethRef: ILGlobals @@ -1830,12 +1761,14 @@ val mkILTypeForGlobalFunctions: ILScopeRef -> ILType /// Making tables of custom attributes, etc. val mkILCustomAttrs: ILAttribute list -> ILAttributes val mkILCustomAttrsFromArray: ILAttribute[] -> ILAttributes -val mkILComputedCustomAttrs: (unit -> ILAttribute[]) -> ILAttributes +val storeILCustomAttrs: ILAttributes -> ILAttributesStored +val mkILCustomAttrsReader: (int32 -> ILAttribute[]) -> ILAttributesStored val emptyILCustomAttrs: ILAttributes val mkILSecurityDecls: ILSecurityDecl list -> ILSecurityDecls -val mkILLazySecurityDecls: Lazy -> ILSecurityDecls val emptyILSecurityDecls: ILSecurityDecls +val storeILSecurityDecls: ILSecurityDecls -> ILSecurityDeclsStored +val mkILSecurityDeclsReader: (int32 -> ILSecurityDecl[]) -> ILSecurityDeclsStored val mkMethBodyAux: MethodBody -> ILLazyMethodBody val mkMethBodyLazyAux: Lazy -> ILLazyMethodBody @@ -1873,7 +1806,7 @@ val emptyILTypeDefs: ILTypeDefs /// /// Note that individual type definitions may contain further delays /// in their method, field and other tables. -val mkILTypeDefsComputed: (unit -> (string list * string * ILAttributes * Lazy) array) -> ILTypeDefs +val mkILTypeDefsComputed: (unit -> ILPreTypeDef[]) -> ILTypeDefs val addILTypeDef: ILTypeDef -> ILTypeDefs -> ILTypeDefs val mkTypeForwarder: ILScopeRef -> string -> ILNestedExportedTypes -> ILAttributes -> ILTypeDefAccess -> ILExportedTypeOrForwarder @@ -1905,6 +1838,7 @@ val mkRefToILField: ILTypeRef * ILFieldDef -> ILFieldRef val mkRefToILAssembly: ILAssemblyManifest -> ILAssemblyRef val mkRefToILModule: ILModuleDef -> ILModuleRef +val NoMetadataIdx: int32 // -------------------------------------------------------------------- // Rescoping. @@ -1927,15 +1861,19 @@ val mkRefToILModule: ILModuleDef -> ILModuleRef /// Rescoping. The first argument tells the function how to reference the original scope from /// the new scope. val rescopeILScopeRef: ILScopeRef -> ILScopeRef -> ILScopeRef + /// Rescoping. The first argument tells the function how to reference the original scope from /// the new scope. val rescopeILTypeSpec: ILScopeRef -> ILTypeSpec -> ILTypeSpec + /// Rescoping. The first argument tells the function how to reference the original scope from /// the new scope. val rescopeILType: ILScopeRef -> ILType -> ILType + /// Rescoping. The first argument tells the function how to reference the original scope from /// the new scope. val rescopeILMethodRef: ILScopeRef -> ILMethodRef -> ILMethodRef + /// Rescoping. The first argument tells the function how to reference the original scope from /// the new scope. val rescopeILFieldRef: ILScopeRef -> ILFieldRef -> ILFieldRef @@ -1943,26 +1881,14 @@ val rescopeILFieldRef: ILScopeRef -> ILFieldRef -> ILFieldRef /// Unscoping. Clears every scope information, use for looking up IL method references only. val unscopeILType: ILType -> ILType -//----------------------------------------------------------------------- -// The ILCode Builder utility. -//---------------------------------------------------------------------- - val buildILCode: string -> lab2pc: Dictionary -> instrs:ILInstr[] -> ILExceptionSpec list -> ILLocalDebugInfo list -> ILCode -// -------------------------------------------------------------------- -// The instantiation utilities. -// -------------------------------------------------------------------- - /// Instantiate type variables that occur within types and other items. val instILTypeAux: int -> ILGenericArgs -> ILType -> ILType /// Instantiate type variables that occur within types and other items. val instILType: ILGenericArgs -> ILType -> ILType -// -------------------------------------------------------------------- -// ECMA globals -// -------------------------------------------------------------------- - /// This is a 'vendor neutral' way of referencing mscorlib. val ecmaPublicKey: PublicKey @@ -2002,19 +1928,14 @@ val getTyOfILEnumInfo: ILEnumInfo -> ILType val computeILEnumInfo: string * ILFieldDefs -> ILEnumInfo - -// -------------------------------------------------------------------- -// For completeness. These do not occur in metadata but tools that -// care about the existence of properties and events in the metadata -// can benefit from them. -// -------------------------------------------------------------------- - +/// A utility type provided for completeness [] type ILEventRef = static member Create: ILTypeRef * string -> ILEventRef member DeclaringTypeRef: ILTypeRef member Name: string +/// A utility type provided for completeness [] type ILPropertyRef = static member Create: ILTypeRef * string -> ILPropertyRef diff --git a/src/absil/ilmorph.fs b/src/absil/ilmorph.fs index 4e8d4ed8c0..ad28e1736a 100644 --- a/src/absil/ilmorph.fs +++ b/src/absil/ilmorph.fs @@ -200,8 +200,8 @@ let morphILTypesInILInstr ((factualty,fformalty)) i = | ILToken.ILField fr -> I_ldtoken (ILToken.ILField (conv_fspec fr)) | x -> x -let return_typ2typ ilg f (r:ILReturn) = {r with Type=f r.Type; CustomAttrs=cattrs_typ2typ ilg f r.CustomAttrs} -let param_typ2typ ilg f (p: ILParameter) = {p with Type=f p.Type; CustomAttrs=cattrs_typ2typ ilg f p.CustomAttrs} +let return_typ2typ ilg f (r:ILReturn) = {r with Type=f r.Type; CustomAttrsStored= storeILCustomAttrs (cattrs_typ2typ ilg f r.CustomAttrs)} +let param_typ2typ ilg f (p: ILParameter) = {p with Type=f p.Type; CustomAttrsStored= storeILCustomAttrs (cattrs_typ2typ ilg f p.CustomAttrs)} let morphILMethodDefs f (m:ILMethodDefs) = mkILMethods (List.map f m.AsList) let fdefs_fdef2fdef f (m:ILFieldDefs) = mkILFields (List.map f m.AsList) @@ -287,14 +287,14 @@ and tdefs_typ2typ_ilmbody2ilmbody_mdefs2mdefs ilg enc fs tdefs = // -------------------------------------------------------------------- let manifest_typ2typ ilg f (m : ILAssemblyManifest) = - { m with CustomAttrs = cattrs_typ2typ ilg f m.CustomAttrs } + { m with CustomAttrsStored = storeILCustomAttrs (cattrs_typ2typ ilg f m.CustomAttrs) } let morphILTypeInILModule_ilmbody2ilmbody_mdefs2mdefs ilg ((ftype: ILModuleDef -> (ILTypeDef list * ILTypeDef) option -> ILMethodDef option -> ILType -> ILType),fmdefs) m = let ftdefs = tdefs_typ2typ_ilmbody2ilmbody_mdefs2mdefs ilg [] (ftype m,fmdefs m) { m with TypeDefs=ftdefs m.TypeDefs; - CustomAttrs=cattrs_typ2typ ilg (ftype m None None) m.CustomAttrs; + CustomAttrsStored= storeILCustomAttrs (cattrs_typ2typ ilg (ftype m None None) m.CustomAttrs); Manifest=Option.map (manifest_typ2typ ilg (ftype m None None)) m.Manifest } let module_instr2instr_typ2typ ilg fs x = diff --git a/src/absil/ilprint.fs b/src/absil/ilprint.fs index 7b12d098dc..723c747007 100644 --- a/src/absil/ilprint.fs +++ b/src/absil/ilprint.fs @@ -1021,11 +1021,10 @@ let goutput_manifest env os m = output_sqstring os m.Name; output_string os " { \n"; output_string os ".hash algorithm "; output_i32 os m.AuxModuleHashAlgorithm; output_string os "\n"; - goutput_custom_attrs env os m.CustomAttrs; - goutput_security_decls env os m.SecurityDecls; - (output_option output_publickey) os m.PublicKey; - (output_option output_ver) os m.Version; - (output_option output_locale) os m.Locale; + goutput_custom_attrs env os m.CustomAttrs + (output_option output_publickey) os m.PublicKey + (output_option output_ver) os m.Version + (output_option output_locale) os m.Locale output_string os " } \n" diff --git a/src/absil/ilread.fs b/src/absil/ilread.fs index 5bfb5f60fc..d9d66d2464 100644 --- a/src/absil/ilread.fs +++ b/src/absil/ilread.fs @@ -1116,8 +1116,22 @@ type ILMetadataReader = seekReadTypeDefAsType : TypeDefAsTypIdx -> ILType seekReadMethodDefAsMethodData : int -> MethodData seekReadGenericParams : GenericParamsIdx -> ILGenericParameterDef list - seekReadFieldDefAsFieldSpec : int -> ILFieldSpec - } + seekReadFieldDefAsFieldSpec : int -> ILFieldSpec + customAttrsReader_Module : ILAttributesStored + customAttrsReader_Assembly : ILAttributesStored + customAttrsReader_TypeDef : ILAttributesStored + customAttrsReader_GenericParam: ILAttributesStored + customAttrsReader_FieldDef: ILAttributesStored + customAttrsReader_MethodDef: ILAttributesStored + customAttrsReader_ParamDef: ILAttributesStored + customAttrsReader_Event: ILAttributesStored + customAttrsReader_Property: ILAttributesStored + customAttrsReader_ManifestResource: ILAttributesStored + customAttrsReader_ExportedType: ILAttributesStored + securityDeclsReader_TypeDef : ILSecurityDeclsStored + securityDeclsReader_MethodDef : ILSecurityDeclsStored + securityDeclsReader_Assembly : ILSecurityDeclsStored + typeDefReader : ILTypeDefStored } let seekReadUInt16Adv mdv (addr: byref) = @@ -1601,7 +1615,8 @@ let rec seekReadModule (ctxt: ILMetadataReader) (pectxtEager: PEReader) pevEager { Manifest = if ctxt.getNumRows (TableNames.Assembly) > 0 then Some (seekReadAssemblyManifest ctxt pectxtEager 1) else None - CustomAttrs = seekReadCustomAttrs ctxt (TaggedIndex(hca_Module, idx)) + CustomAttrsStored = ctxt.customAttrsReader_Module + MetadataIndex = idx Name = ilModuleName NativeResources=nativeResources TypeDefs = mkILTypeDefsComputed (fun () -> seekReadTopTypeDefs ctxt) @@ -1628,11 +1643,12 @@ and seekReadAssemblyManifest (ctxt: ILMetadataReader) pectxt idx = let pubkey = readBlobHeapOption ctxt publicKeyIdx { Name= name AuxModuleHashAlgorithm=hash - SecurityDecls= seekReadSecurityDecls ctxt (TaggedIndex(hds_Assembly, idx)) + SecurityDeclsStored= ctxt.securityDeclsReader_Assembly PublicKey= pubkey Version= Some (v1, v2, v3, v4) Locale= readStringHeapOption ctxt localeIdx - CustomAttrs = seekReadCustomAttrs ctxt (TaggedIndex(hca_Assembly, idx)) + CustomAttrsStored = ctxt.customAttrsReader_Assembly + MetadataIndex = idx AssemblyLongevity= let masked = flags &&& 0x000e if masked = 0x0000 then ILAssemblyLongevity.Unspecified @@ -1733,22 +1749,24 @@ and seekReadTypeDefRowWithExtents ctxt (idx:int) = let info= seekReadTypeDefRow ctxt idx info, seekReadTypeDefRowExtents ctxt info idx -and seekReadTypeDef ctxt toponly (idx:int) = +and seekReadPreTypeDef ctxt toponly (idx:int) = let (flags, nameIdx, namespaceIdx, _, _, _) = seekReadTypeDefRow ctxt idx if toponly && not (isTopTypeDef flags) then None else let ns, n = readBlobHeapAsSplitTypeName ctxt (nameIdx, namespaceIdx) - let cas = seekReadCustomAttrs ctxt (TaggedIndex(hca_TypeDef, idx)) + // Return the ILPreTypeDef + Some (mkILPreTypeDefRead (ns, n, idx, ctxt.typeDefReader)) - let rest = - lazy +and typeDefReader ctxtH : ILTypeDefStored = + mkILTypeDefReader + (fun idx -> + let (ctxt: ILMetadataReader) = getHole ctxtH let mdv = ctxt.mdfile.GetView() - // Re-read so as not to save all these in the lazy closure - this suspension is the largest + // Re-read so as not to save all these in the lazy closure - this suspension ctxt.is the largest // heavily allocated one in all of AbsIL let ((flags, nameIdx, namespaceIdx, extendsIdx, fieldsIdx, methodsIdx) as info) = seekReadTypeDefRow ctxt idx let nm = readBlobHeapAsTypeName ctxt (nameIdx, namespaceIdx) - let cas = seekReadCustomAttrs ctxt (TaggedIndex(hca_TypeDef, idx)) let (endFieldsIdx, endMethodsIdx) = seekReadTypeDefRowExtents ctxt info idx let typars = seekReadGenericParams ctxt 0 (tomd_TypeDef, idx) let numtypars = typars.Length @@ -1759,7 +1777,6 @@ and seekReadTypeDef ctxt toponly (idx:int) = let fdefs = seekReadFields ctxt (numtypars, hasLayout) fieldsIdx endFieldsIdx let nested = seekReadNestedTypeDefs ctxt idx let impls = seekReadInterfaceImpls ctxt mdv numtypars idx - let sdecls = seekReadSecurityDecls ctxt (TaggedIndex(hds_TypeDef, idx)) let mimpls = seekReadMethodImpls ctxt numtypars idx let props = seekReadProperties ctxt numtypars idx let events = seekReadEvents ctxt numtypars idx @@ -1771,17 +1788,18 @@ and seekReadTypeDef ctxt toponly (idx:int) = implements = impls, extends = super, methods = mdefs, - securityDecls = sdecls, + securityDeclsStored = ctxt.securityDeclsReader_TypeDef, fields=fdefs, methodImpls=mimpls, events= events, properties=props, - customAttrs=cas) - Some (ns, n, cas, rest) + customAttrsStored=ctxt.customAttrsReader_TypeDef, + metadataIndex=idx) + ) and seekReadTopTypeDefs (ctxt: ILMetadataReader) = [| for i = 1 to ctxt.getNumRows TableNames.TypeDef do - match seekReadTypeDef ctxt true i with + match seekReadPreTypeDef ctxt true i with | None -> () | Some td -> yield td |] @@ -1789,7 +1807,7 @@ and seekReadNestedTypeDefs (ctxt: ILMetadataReader) tidx = mkILTypeDefsComputed (fun () -> let nestedIdxs = seekReadIndexedRows (ctxt.getNumRows TableNames.Nested, seekReadNestedRow ctxt, snd, simpleIndexCompare tidx, false, fst) [| for i in nestedIdxs do - match seekReadTypeDef ctxt false i with + match seekReadPreTypeDef ctxt false i with | None -> () | Some td -> yield td |]) @@ -1822,11 +1840,11 @@ and seekReadGenericParamsUncached ctxtH (GenericParamsIdx(numtypars, a, b)) = elif variance_flags = 0x0002 then ContraVariant else NonVariant let constraints = seekReadGenericParamConstraints ctxt mdv numtypars gpidx - let cas = seekReadCustomAttrs ctxt (TaggedIndex(hca_GenericParam, gpidx)) seq, {Name=readStringHeap ctxt nameIdx Constraints = constraints Variance=variance - CustomAttrs=cas + CustomAttrsStored = ctxt.customAttrsReader_GenericParam + MetadataIndex=gpidx HasReferenceTypeConstraint= (flags &&& 0x0004) <> 0 HasNotNullableValueTypeConstraint= (flags &&& 0x0008) <> 0 HasDefaultConstructorConstraint=(flags &&& 0x0010) <> 0 })) @@ -1980,8 +1998,9 @@ and seekReadField ctxt mdv (numtypars, hasLayout) (idx:int) = (if hasLayout && not isStatic then Some (seekReadIndexedRow (ctxt.getNumRows TableNames.FieldLayout, seekReadFieldLayoutRow ctxt mdv, snd, simpleIndexCompare idx, isSorted ctxt TableNames.FieldLayout, fst)) else None), - customAttrs=seekReadCustomAttrs ctxt (TaggedIndex(hca_FieldDef, idx) )) - + customAttrsStored=ctxt.customAttrsReader_FieldDef, + metadataIndex = idx) + and seekReadFields (ctxt: ILMetadataReader) (numtypars, hasLayout) fidx1 fidx2 = mkILFieldsLazy (lazy @@ -2356,30 +2375,20 @@ and seekReadMethod (ctxt: ILMetadataReader) mdv numtypars (idx:int) = ILMethodDef(name=nm, attributes = enum(flags), implAttributes= enum(implflags), - securityDecls=seekReadSecurityDecls ctxt (TaggedIndex(hds_MethodDef, idx)), + securityDeclsStored=ctxt.securityDeclsReader_MethodDef, isEntryPoint=isEntryPoint, genericParams=seekReadGenericParams ctxt numtypars (tomd_MethodDef, idx), - customAttrs=seekReadCustomAttrs ctxt (TaggedIndex(hca_MethodDef, idx)), parameters= ilParams, callingConv=cc, ret=ret, - body=body) + body=body, + customAttrsStored=ctxt.customAttrsReader_MethodDef, + metadataIndex=idx) and seekReadParams (ctxt: ILMetadataReader) mdv (retty, argtys) pidx1 pidx2 = - let retRes : ILReturn ref = ref { Marshal=None; Type=retty; CustomAttrs=emptyILCustomAttrs } - let paramsRes : ILParameter [] = - argtys - |> List.toArray - |> Array.map (fun ty -> - { Name=None - Default=None - Marshal=None - IsIn=false - IsOut=false - IsOptional=false - Type=ty - CustomAttrs=emptyILCustomAttrs }) + let retRes = ref (mkILReturn retty) + let paramsRes = argtys |> List.toArray |> Array.map mkILParamAnon for i = pidx1 to pidx2 - 1 do seekReadParamExtras ctxt mdv (retRes, paramsRes) i !retRes, List.ofArray paramsRes @@ -2390,11 +2399,11 @@ and seekReadParamExtras (ctxt: ILMetadataReader) mdv (retRes, paramsRes) (idx:i let hasMarshal = (flags &&& 0x2000) <> 0x0 let hasDefault = (flags &&& 0x1000) <> 0x0 let fmReader idx = seekReadIndexedRow (ctxt.getNumRows TableNames.FieldMarshal, seekReadFieldMarshalRow ctxt mdv, fst, hfmCompare idx, isSorted ctxt TableNames.FieldMarshal, (snd >> readBlobHeapAsNativeType ctxt)) - let cas = seekReadCustomAttrs ctxt (TaggedIndex(hca_ParamDef, idx)) if seq = 0 then retRes := { !retRes with Marshal=(if hasMarshal then Some (fmReader (TaggedIndex(hfm_ParamDef, idx))) else None) - CustomAttrs = cas } + CustomAttrsStored = ctxt.customAttrsReader_ParamDef + MetadataIndex = idx} elif seq > Array.length paramsRes then dprintn "bad seq num. for param" else paramsRes.[seq - 1] <- @@ -2405,7 +2414,8 @@ and seekReadParamExtras (ctxt: ILMetadataReader) mdv (retRes, paramsRes) (idx:i IsIn = ((inOutMasked &&& 0x0001) <> 0x0) IsOut = ((inOutMasked &&& 0x0002) <> 0x0) IsOptional = ((inOutMasked &&& 0x0010) <> 0x0) - CustomAttrs =cas } + CustomAttrsStored = ctxt.customAttrsReader_ParamDef + MetadataIndex = idx } and seekReadMethodImpls (ctxt: ILMetadataReader) numtypars tidx = mkILMethodImplsLazy @@ -2455,7 +2465,8 @@ and seekReadEvent ctxt mdv numtypars idx = removeMethod=seekReadMethodSemantics ctxt (0x0010, TaggedIndex(hs_Event, idx)), fireMethod=seekReadoptional_MethodSemantics ctxt (0x0020, TaggedIndex(hs_Event, idx)), otherMethods = seekReadMultipleMethodSemantics ctxt (0x0004, TaggedIndex(hs_Event, idx)), - customAttrs=seekReadCustomAttrs ctxt (TaggedIndex(hca_Event, idx))) + customAttrsStored=ctxt.customAttrsReader_Event, + metadataIndex = idx ) (* REVIEW: can substantially reduce numbers of EventMap and PropertyMap reads by first checking if the whole table mdv sorted according to ILTypeDef tokens and then doing a binary chop *) and seekReadEvents (ctxt: ILMetadataReader) numtypars tidx = @@ -2489,6 +2500,7 @@ and seekReadProperty ctxt mdv numtypars idx = match setter with | Some mref -> mref.CallingConv .ThisConv | None -> cc + ILPropertyDef(name=readStringHeap ctxt nameIdx, callingConv = cc2, attributes = enum(flags), @@ -2497,7 +2509,8 @@ and seekReadProperty ctxt mdv numtypars idx = propertyType=retty, init= (if (flags &&& 0x1000) = 0 then None else Some (seekReadConstant ctxt (TaggedIndex(hc_Property, idx)))), args=argtys, - customAttrs=seekReadCustomAttrs ctxt (TaggedIndex(hca_Property, idx))) + customAttrsStored=ctxt.customAttrsReader_Property, + metadataIndex = idx ) and seekReadProperties (ctxt: ILMetadataReader) numtypars tidx = mkILPropertiesLazy @@ -2516,12 +2529,13 @@ and seekReadProperties (ctxt: ILMetadataReader) numtypars tidx = yield seekReadProperty ctxt mdv numtypars i ]) -and seekReadCustomAttrs (ctxt: ILMetadataReader) idx = - mkILComputedCustomAttrs - (fun () -> +and customAttrsReader ctxtH tag : ILAttributesStored = + mkILCustomAttrsReader + (fun idx -> + let (ctxt: ILMetadataReader) = getHole ctxtH seekReadIndexedRows (ctxt.getNumRows TableNames.CustomAttribute, seekReadCustomAttributeRow ctxt, (fun (a, _, _) -> a), - hcaCompare idx, + hcaCompare (TaggedIndex(tag,idx)), isSorted ctxt TableNames.CustomAttribute, (fun (_, b, c) -> seekReadCustomAttr ctxt (b, c))) |> List.toArray) @@ -2538,16 +2552,18 @@ and seekReadCustomAttrUncached ctxtH (CustomAttrIdx (cat, idx, valIdx)) = | None -> Bytes.ofInt32Array [| |] Elements = [] } -and seekReadSecurityDecls (ctxt: ILMetadataReader) idx = - mkILLazySecurityDecls - (lazy +and securityDeclsReader ctxtH tag = + mkILSecurityDeclsReader + (fun idx -> + let (ctxt: ILMetadataReader) = getHole ctxtH let mdv = ctxt.mdfile.GetView() seekReadIndexedRows (ctxt.getNumRows TableNames.Permission, seekReadPermissionRow ctxt mdv, (fun (_, par, _) -> par), - hdsCompare idx, + hdsCompare (TaggedIndex(tag,idx)), isSorted ctxt TableNames.Permission, - (fun (act, _, ty) -> seekReadSecurityDecl ctxt (act, ty)))) + (fun (act, _, ty) -> seekReadSecurityDecl ctxt (act, ty))) + |> List.toArray) and seekReadSecurityDecl ctxt (act, ty) = ILSecurityDecl ((if List.memAssoc (int act) (Lazy.force ILSecurityActionRevMap) then List.assoc (int act) (Lazy.force ILSecurityActionRevMap) else failwith "unknown security action"), @@ -3209,8 +3225,8 @@ and seekReadManifestResources (ctxt: ILMetadataReader) (mdv: BinaryView) (pectxt { Name= readStringHeap ctxt nameIdx Location = location Access = (if (flags &&& 0x01) <> 0x0 then ILResourceAccess.Public else ILResourceAccess.Private) - CustomAttrs = seekReadCustomAttrs ctxt (TaggedIndex(hca_ManifestResource, i)) } - + CustomAttrsStored = ctxt.customAttrsReader_ManifestResource + MetadataIndex = i } yield r ] and seekReadNestedExportedTypes ctxt (exported: _ array) (nested: Lazy<_ array>) parentIdx = @@ -3224,7 +3240,8 @@ and seekReadNestedExportedTypes ctxt (exported: _ array) (nested: Lazy<_ array>) | ILTypeDefAccess.Nested n -> n | _ -> failwith "non-nested access for a nested type described as being in an auxiliary module") Nested = seekReadNestedExportedTypes ctxt exported nested i - CustomAttrs = seekReadCustomAttrs ctxt (TaggedIndex(hca_ExportedType, i)) } + CustomAttrsStored = ctxt.customAttrsReader_ExportedType + MetadataIndex = i } )) and seekReadTopExportedTypes (ctxt: ILMetadataReader) = @@ -3255,7 +3272,8 @@ and seekReadTopExportedTypes (ctxt: ILMetadataReader) = Name = readBlobHeapAsTypeName ctxt (nameIdx, namespaceIdx) Attributes = enum(flags) Nested = seekReadNestedExportedTypes ctxt exported nested i - CustomAttrs = seekReadCustomAttrs ctxt (TaggedIndex(hca_ExportedType, i)) } + CustomAttrsStored = ctxt.customAttrsReader_ExportedType + MetadataIndex = i } ]) #if !FX_NO_PDB_READER @@ -3623,6 +3641,21 @@ let openMetadataReader (fileName, mdfile: BinaryFile, metadataPhysLoc, peinfo, p seekReadMethodDefAsMethodData = cacheMethodDefAsMethodData (seekReadMethodDefAsMethodDataUncached ctxtH) seekReadGenericParams = cacheGenericParams (seekReadGenericParamsUncached ctxtH) seekReadFieldDefAsFieldSpec = cacheFieldDefAsFieldSpec (seekReadFieldDefAsFieldSpecUncached ctxtH) + customAttrsReader_Module = customAttrsReader ctxtH hca_Module + customAttrsReader_Assembly = customAttrsReader ctxtH hca_Assembly + customAttrsReader_TypeDef = customAttrsReader ctxtH hca_TypeDef + customAttrsReader_GenericParam= customAttrsReader ctxtH hca_GenericParam + customAttrsReader_FieldDef= customAttrsReader ctxtH hca_FieldDef + customAttrsReader_MethodDef= customAttrsReader ctxtH hca_MethodDef + customAttrsReader_ParamDef= customAttrsReader ctxtH hca_ParamDef + customAttrsReader_Event= customAttrsReader ctxtH hca_Event + customAttrsReader_Property= customAttrsReader ctxtH hca_Property + customAttrsReader_ManifestResource= customAttrsReader ctxtH hca_ManifestResource + customAttrsReader_ExportedType= customAttrsReader ctxtH hca_ExportedType + securityDeclsReader_TypeDef = securityDeclsReader ctxtH hds_TypeDef + securityDeclsReader_MethodDef = securityDeclsReader ctxtH hds_MethodDef + securityDeclsReader_Assembly = securityDeclsReader ctxtH hds_Assembly + typeDefReader = typeDefReader ctxtH guidsStreamPhysicalLoc = guidsStreamPhysicalLoc rowAddr=rowAddr rsBigness=rsBigness diff --git a/src/absil/ilreflect.fs b/src/absil/ilreflect.fs index 589c948a9b..841c16bb98 100644 --- a/src/absil/ilreflect.fs +++ b/src/absil/ilreflect.fs @@ -1431,7 +1431,7 @@ let buildGenParamsPass1b cenv emEnv (genArgs : Type array) (gps : ILGenericParam | _ -> failwith "buildGenParam: multiple base types" ); // set interface constraints (interfaces that instances of gp must meet) - gpB.SetInterfaceConstraints(Array.ofList interfaceTs); + gpB.SetInterfaceConstraints(Array.ofList interfaceTs) gp.CustomAttrs |> emitCustomAttrs cenv emEnv (wrapCustomAttr gpB.SetCustomAttribute) let flags = GenericParameterAttributes.None diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs index 24f9615222..8ecde4fe13 100644 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -3781,13 +3781,15 @@ let MakeILResource rname bytes = { Name = rname Location = ILResourceLocation.LocalOut bytes Access = ILResourceAccess.Public - CustomAttrs = emptyILCustomAttrs } + CustomAttrsStored = storeILCustomAttrs emptyILCustomAttrs + MetadataIndex = NoMetadataIdx } let PickleToResource inMem file g scope rname p x = { Name = rname Location = (let bytes = pickleObjWithDanglingCcus inMem file g scope p x in ILResourceLocation.LocalOut bytes) Access = ILResourceAccess.Public - CustomAttrs = emptyILCustomAttrs } + CustomAttrsStored = storeILCustomAttrs emptyILCustomAttrs + MetadataIndex = NoMetadataIdx } let GetSignatureData (file, ilScopeRef, ilModule, byteReader) : PickledDataWithReferences = unpickleObjWithDanglingCcus file ilScopeRef ilModule unpickleCcuInfo byteReader @@ -5205,11 +5207,11 @@ module private ScriptPreprocessClosure = let allRootDiagnostics = allRootDiagnostics |> List.filter (fst >> isRootRange) let result : LoadClosure = - { SourceFiles = List.groupByFirst sourceFiles - References = List.groupByFirst references + { SourceFiles = List.groupBy fst sourceFiles |> List.map (map2Of2 (List.map snd)) + References = List.groupBy fst references |> List.map (map2Of2 (List.map snd)) UnresolvedReferences = unresolvedReferences Inputs = sourceInputs - NoWarns = List.groupByFirst globalNoWarns + NoWarns = List.groupBy fst globalNoWarns |> List.map (map2Of2 (List.map snd)) OriginalLoadReferences = tcConfig.loadedSources ResolutionDiagnostics = resolutionDiagnostics AllRootFileDiagnostics = allRootDiagnostics @@ -5430,7 +5432,7 @@ let TypeCheckOneInputEventually let m = qualNameOfFile.Range TcOpenDecl tcSink tcGlobals amap m m tcEnv prefixPath - let res = (EmptyTopAttrs, [], tcEnv, tcEnv, tcState.tcsTcImplEnv, RootSigsAndImpls(rootSigs, rootImpls, allSigModulTyp, allImplementedSigModulTyp), tcState.tcsCcuType, createsGeneratedProvidedTypes) + let res = (EmptyTopAttrs, None, tcEnv, tcEnv, tcState.tcsTcImplEnv, RootSigsAndImpls(rootSigs, rootImpls, allSigModulTyp, allImplementedSigModulTyp), tcState.tcsCcuType, createsGeneratedProvidedTypes) return res | ParsedInput.ImplFile (ParsedImplFileInput(filename, _, qualNameOfFile, _, _, _, _) as file) -> @@ -5490,7 +5492,7 @@ let TypeCheckOneInputEventually if verbose then dprintf "done TypeCheckOneInputEventually...\n" let topSigsAndImpls = RootSigsAndImpls(rootSigs, rootImpls, allSigModulTyp, allImplementedSigModulTyp) - let res = (topAttrs, [implFile], tcEnvAtEnd, tcSigEnv, tcImplEnv, topSigsAndImpls, ccuType, createsGeneratedProvidedTypes) + let res = (topAttrs, Some implFile, tcEnvAtEnd, tcSigEnv, tcImplEnv, topSigsAndImpls, ccuType, createsGeneratedProvidedTypes) return res } return (tcEnvAtEnd, topAttrs, implFiles), @@ -5502,7 +5504,7 @@ let TypeCheckOneInputEventually tcsRootSigsAndImpls = topSigsAndImpls } with e -> errorRecovery e range0 - return (tcState.TcEnvFromSignatures, EmptyTopAttrs, []), tcState + return (tcState.TcEnvFromSignatures, EmptyTopAttrs, None), tcState } /// Typecheck a single file (or interactive entry into F# Interactive) @@ -5518,7 +5520,7 @@ let TypeCheckMultipleInputsFinish(results, tcState: TcState) = let tcEnvsAtEndFile, topAttrs, implFiles = List.unzip3 results let topAttrs = List.foldBack CombineTopAttrs topAttrs EmptyTopAttrs - let implFiles = List.concat implFiles + let implFiles = List.choose id implFiles // This is the environment required by fsi.exe when incrementally adding definitions let tcEnvAtEndOfLastFile = (match tcEnvsAtEndFile with h :: _ -> h | _ -> tcState.TcEnvFromSignatures) diff --git a/src/fsharp/CompileOps.fsi b/src/fsharp/CompileOps.fsi index 22a9e176c6..d749739f18 100755 --- a/src/fsharp/CompileOps.fsi +++ b/src/fsharp/CompileOps.fsi @@ -724,10 +724,10 @@ val GetInitialTcState: /// Check one input, returned as an Eventually computation val TypeCheckOneInputEventually : checkForErrors:(unit -> bool) * TcConfig * TcImports * TcGlobals * Ast.LongIdent option * NameResolution.TcResultsSink * TcState * Ast.ParsedInput - -> Eventually<(TcEnv * TopAttribs * TypedImplFile list) * TcState> + -> Eventually<(TcEnv * TopAttribs * TypedImplFile option) * TcState> /// Finish the checking of multiple inputs -val TypeCheckMultipleInputsFinish: (TcEnv * TopAttribs * 'T list) list * TcState -> (TcEnv * TopAttribs * 'T list) * TcState +val TypeCheckMultipleInputsFinish: (TcEnv * TopAttribs * 'T option) list * TcState -> (TcEnv * TopAttribs * 'T list) * TcState /// Finish the checking of a closed set of inputs val TypeCheckClosedInputSetFinish: TypedImplFile list * TcState -> TcState * TypedImplFile list diff --git a/src/fsharp/IlxGen.fs b/src/fsharp/IlxGen.fs index 90385b2c2e..493b9c3c96 100644 --- a/src/fsharp/IlxGen.fs +++ b/src/fsharp/IlxGen.fs @@ -3454,7 +3454,8 @@ and GenGenericParam cenv eenv (tp:Typar) = Constraints = subTypeConstraints Variance=NonVariant - CustomAttrs = mkILCustomAttrs (GenAttrs cenv eenv tp.Attribs) + CustomAttrsStored = storeILCustomAttrs (mkILCustomAttrs (GenAttrs cenv eenv tp.Attribs)) + MetadataIndex = NoMetadataIdx HasReferenceTypeConstraint=refTypeConstraint HasNotNullableValueTypeConstraint=notNullableValueTypeConstraint HasDefaultConstructorConstraint= defaultConstructorConstraint } @@ -3474,7 +3475,8 @@ and GenSlotParam m cenv eenv (TSlotParam(nm,ty,inFlag,outFlag,optionalFlag,attri IsIn=inFlag || inFlag2 IsOut=outFlag || outFlag2 IsOptional=optionalFlag || optionalFlag2 - CustomAttrs= mkILCustomAttrs (GenAttrs cenv eenv attribs) } + CustomAttrsStored = storeILCustomAttrs (mkILCustomAttrs (GenAttrs cenv eenv attribs)) + MetadataIndex = NoMetadataIdx } and GenFormalSlotsig m cenv eenv (TSlotSig(_,typ,ctps,mtps,paraml,returnTy)) = let paraml = List.concat paraml @@ -5005,7 +5007,8 @@ and GenParams cenv eenv (mspec:ILMethodSpec) (attribs:ArgReprInfo list) (implVal IsIn=inFlag IsOut=outFlag IsOptional=optionalFlag - CustomAttrs= mkILCustomAttrs (GenAttrs cenv eenv attribs) } + CustomAttrsStored = storeILCustomAttrs (mkILCustomAttrs (GenAttrs cenv eenv attribs)) + MetadataIndex = NoMetadataIdx } param, takenNames) |> fst @@ -5014,7 +5017,8 @@ and GenReturnInfo cenv eenv ilRetTy (retInfo : ArgReprInfo) : ILReturn = let marshal,attrs = GenMarshal cenv retInfo.Attribs { Type=ilRetTy Marshal=marshal - CustomAttrs= mkILCustomAttrs (GenAttrs cenv eenv attrs) } + CustomAttrsStored= storeILCustomAttrs (mkILCustomAttrs (GenAttrs cenv eenv attrs)) + MetadataIndex = NoMetadataIdx } and GenPropertyForMethodDef compileAsInstance tref mdef (v:Val) (memberInfo:ValMemberInfo) ilArgTys ilPropTy ilAttrs compiledName = let name = match compiledName with | Some n -> n | _ -> v.PropertyName in (* chop "get_" *) diff --git a/src/fsharp/InternalCollections.fs b/src/fsharp/InternalCollections.fs index 51fedcd6f9..8713eef00f 100755 --- a/src/fsharp/InternalCollections.fs +++ b/src/fsharp/InternalCollections.fs @@ -198,37 +198,3 @@ type internal MruCache<'Token, 'Key,'Value when 'Value : not struct>(keepStrongl member bc.Resize(tok, newKeepStrongly, ?newKeepMax) = cache.Resize(tok, newKeepStrongly, ?newKeepMax=newKeepMax) -/// List helpers -[] -type internal List = - /// Return a new list with one element for each unique 'Key. Multiple 'TValues are flattened. - /// The original order of the first instance of 'Key is preserved. - static member groupByFirst( l : ('Key * 'Value) list) : ('Key * 'Value list) list = - let nextIndex = ref 0 - let result = System.Collections.Generic.List<'Key * System.Collections.Generic.List<'Value>>() - let keyToIndex = Dictionary<'Key,int>(HashIdentity.Structural) - let indexOfKey(key) = - match keyToIndex.TryGetValue(key) with - | true, v -> v - | false, _ -> - keyToIndex.Add(key,!nextIndex) - nextIndex := !nextIndex + 1 - !nextIndex - 1 - - for kv in l do - let index = indexOfKey(fst kv) - if index>= result.Count then - let k,vs = fst kv,System.Collections.Generic.List<'Value>() - vs.Add(snd kv) - result.Add(k,vs) - else - let _,vs = result.[index] - vs.Add(snd kv) - - result |> Seq.map(fun (k,vs) -> k,vs |> List.ofSeq ) |> List.ofSeq - - /// Return each distinct item in the list using reference equality. - static member referenceDistinct( l : 'T list) : 'T list when 'T : not struct = - let set = System.Collections.Generic.Dictionary<'T,bool>(HashIdentity.Reference) - l |> List.iter(fun i->set.Add(i,true)) - set |> Seq.map(fun kv->kv.Key) |> List.ofSeq diff --git a/src/fsharp/InternalCollections.fsi b/src/fsharp/InternalCollections.fsi index 8e26bc9578..711fb91d84 100755 --- a/src/fsharp/InternalCollections.fsi +++ b/src/fsharp/InternalCollections.fsi @@ -75,10 +75,3 @@ namespace Internal.Utilities.Collections /// Resize member Resize : 'Token * keepStrongly: int * ?keepMax : int -> unit - [] - type internal List = - /// Return a new list with one element for each unique 'Key. Multiple 'TValues are flattened. - /// The original order of the first instance of 'Key is preserved. - static member groupByFirst : l:('Key * 'Value) list -> ('Key * 'Value list) list when 'Key : equality - /// Return each distinct item in the list using reference equality. - static member referenceDistinct : 'T list -> 'T list when 'T : not struct diff --git a/src/fsharp/NameResolution.fs b/src/fsharp/NameResolution.fs index 279bb145fe..09aa6e3350 100644 --- a/src/fsharp/NameResolution.fs +++ b/src/fsharp/NameResolution.fs @@ -1470,6 +1470,10 @@ type TcSymbolUseData = Range: range } /// Represents container for all name resolutions that were met so far when typechecking some particular file +/// +/// This is a memory-critical data structure - allocations of this data structure and its immediate contents +/// is one of the highest memory long-lived data structures in typical uses of IDEs. Not many of these objects +/// are allocated (one per file), but they are large because the allUsesOfAllSymbols array is large. type TcSymbolUses(g, capturedNameResolutions : ResizeArray, formatSpecifierLocations: (range * int)[]) = // Make sure we only capture the information we really need to report symbol uses @@ -1516,7 +1520,7 @@ type TcResultsSinkImpl(g, ?source: string) = member this.GetSymbolUses() = TcSymbolUses(g, capturedNameResolutions, capturedFormatSpecifierLocations.ToArray()) - member this.OpenDeclarations = Seq.toList capturedOpenDeclarations + member this.GetOpenDeclarations() = capturedOpenDeclarations.ToArray() interface ITypecheckResultsSink with member sink.NotifyEnvWithScope(m,nenv,ad) = diff --git a/src/fsharp/NameResolution.fsi b/src/fsharp/NameResolution.fsi index 326c310c57..7af7a278c2 100755 --- a/src/fsharp/NameResolution.fsi +++ b/src/fsharp/NameResolution.fsi @@ -375,7 +375,7 @@ type internal TcResultsSinkImpl = member GetSymbolUses : unit -> TcSymbolUses /// Get all open declarations reported to the sink - member OpenDeclarations : OpenDeclaration list + member GetOpenDeclarations : unit -> OpenDeclaration[] interface ITypecheckResultsSink diff --git a/src/fsharp/fsc.fs b/src/fsharp/fsc.fs index bd28de3b30..333a1d30a6 100644 --- a/src/fsharp/fsc.fs +++ b/src/fsharp/fsc.fs @@ -771,11 +771,12 @@ module MainModuleBuilder = let systemNumericsAssemblyRef = ILAssemblyRef.Create(refNumericsDllName, aref.Hash, aref.PublicKey, aref.Retargetable, aref.Version, aref.Locale) typesForwardedToSystemNumerics |> Seq.map (fun t -> - { ScopeRef = ILScopeRef.Assembly(systemNumericsAssemblyRef) - Name = t - Attributes = enum(0x00200000) ||| TypeAttributes.Public - Nested = mkILNestedExportedTypes List.empty - CustomAttrs = mkILCustomAttrs List.empty }) |> + { ScopeRef = ILScopeRef.Assembly(systemNumericsAssemblyRef) + Name = t + Attributes = enum(0x00200000) ||| TypeAttributes.Public + Nested = mkILNestedExportedTypes [] + CustomAttrsStored = storeILCustomAttrs emptyILCustomAttrs + MetadataIndex = NoMetadataIdx }) |> Seq.toList | None -> [] @@ -860,7 +861,8 @@ module MainModuleBuilder = { Name=reflectedDefinitionResourceName Location = ILResourceLocation.LocalOut reflectedDefinitionBytes Access= ILResourceAccess.Public - CustomAttrs = emptyILCustomAttrs } + CustomAttrsStored = storeILCustomAttrs emptyILCustomAttrs + MetadataIndex = NoMetadataIdx } reflectedDefinitionAttrs, reflectedDefinitionResource) |> List.unzip |> (fun (attrs, resource) -> List.concat attrs, resource) @@ -886,11 +888,11 @@ module MainModuleBuilder = | None -> tcVersion | Some v -> v Some { man with Version= Some ver - CustomAttrs = manifestAttrs + CustomAttrsStored = storeILCustomAttrs manifestAttrs DisableJitOptimizations=disableJitOptimizations JitTracking= tcConfig.jitTracking IgnoreSymbolStoreSequencePoints = tcConfig.ignoreSymbolStoreSequencePoints - SecurityDecls=secDecls } + SecurityDeclsStored=storeILSecurityDecls secDecls } let resources = mkILResources @@ -903,7 +905,8 @@ module MainModuleBuilder = yield { Name=name Location=ILResourceLocation.LocalOut bytes Access=pub - CustomAttrs=emptyILCustomAttrs } + CustomAttrsStored=storeILCustomAttrs emptyILCustomAttrs + MetadataIndex = NoMetadataIdx } yield! reflectedDefinitionResources yield! intfDataResources @@ -913,7 +916,8 @@ module MainModuleBuilder = yield { Name=name Location=ILResourceLocation.File(ILModuleRef.Create(name=file, hasMetadata=false, hash=Some (sha1HashBytes (FileSystem.ReadAllBytesShim file))), 0) Access=pub - CustomAttrs=emptyILCustomAttrs } ] + CustomAttrsStored=storeILCustomAttrs emptyILCustomAttrs + MetadataIndex = NoMetadataIdx } ] let assemblyVersion = match tcConfig.version with @@ -1033,11 +1037,12 @@ module MainModuleBuilder = Is32Bit=(match tcConfig.platform with Some X86 -> true | _ -> false) Is64Bit=(match tcConfig.platform with Some AMD64 | Some IA64 -> true | _ -> false) Is32BitPreferred = if tcConfig.prefer32Bit && not tcConfig.target.IsExe then (error(Error(FSComp.SR.invalidPlatformTarget(), rangeCmdArgs))) else tcConfig.prefer32Bit - CustomAttrs= - mkILCustomAttrs + CustomAttrsStored= + storeILCustomAttrs + (mkILCustomAttrs [ if tcConfig.target = CompilerTarget.Module then yield! iattrs - yield! codegenResults.ilNetModuleAttrs ] + yield! codegenResults.ilNetModuleAttrs ]) NativeResources=nativeResources Manifest = manifest } @@ -1084,7 +1089,7 @@ module StaticLinker = [ for (_, depILModule) in dependentILModules do match depILModule.Manifest with | Some m -> - for ca in m.CustomAttrs.AsList do + for ca in m.CustomAttrs.AsArray do if ca.Method.MethodRef.DeclaringTypeRef.FullName = typeof.FullName then yield ca | _ -> () ] @@ -1141,8 +1146,8 @@ module StaticLinker = let ilxMainModule = { ilxMainModule with - Manifest = (let m = ilxMainModule.ManifestOfAssembly in Some {m with CustomAttrs = mkILCustomAttrs (m.CustomAttrs.AsList @ savedManifestAttrs) }) - CustomAttrs = mkILCustomAttrs [ for m in moduls do yield! m.CustomAttrs.AsList ] + Manifest = (let m = ilxMainModule.ManifestOfAssembly in Some {m with CustomAttrsStored = storeILCustomAttrs (mkILCustomAttrs (m.CustomAttrs.AsList @ savedManifestAttrs)) }) + CustomAttrsStored = storeILCustomAttrs (mkILCustomAttrs [ for m in moduls do yield! m.CustomAttrs.AsArray ]) TypeDefs = mkILTypeDefs (topTypeDef :: List.concat normalTypeDefs) Resources = mkILResources (savedResources @ ilxMainModule.Resources.AsList) NativeResources = savedNativeResources } @@ -1194,7 +1199,7 @@ module StaticLinker = let meths = td.Methods.AsList |> List.map (fun md -> md.With(customAttrs = - mkILCustomAttrs (td.CustomAttrs.AsList |> List.filter (fun ilattr -> + mkILCustomAttrs (td.CustomAttrs.AsList |> List.filter (fun ilattr -> ilattr.Method.DeclaringType.TypeRef.FullName <> "System.Runtime.TargetedPatchingOptOutAttribute")))) |> mkILMethods let td = td.With(methods=meths) diff --git a/src/fsharp/fsi/fsi.fs b/src/fsharp/fsi/fsi.fs index 45800b8092..6b662c12af 100644 --- a/src/fsharp/fsi/fsi.fs +++ b/src/fsharp/fsi/fsi.fs @@ -1005,7 +1005,7 @@ type internal FsiDynamicCompiler { mainModule with Manifest = (let man = mainModule.ManifestOfAssembly - Some { man with CustomAttrs = mkILCustomAttrs codegenResults.ilAssemAttrs }); } + Some { man with CustomAttrsStored = storeILCustomAttrs (mkILCustomAttrs codegenResults.ilAssemAttrs) }) } let ProcessInputs (ctok, errorLogger: ErrorLogger, istate: FsiDynamicCompilerState, inputs: ParsedInput list, showTypes: bool, isIncrementalFragment: bool, isInteractiveItExpr: bool, prefixPath: LongIdent) = let optEnv = istate.optEnv diff --git a/src/fsharp/import.fs b/src/fsharp/import.fs index f6f5648d8e..41c27fd289 100644 --- a/src/fsharp/import.fs +++ b/src/fsharp/import.fs @@ -473,8 +473,8 @@ and ImportILTypeDefList amap m (cpath:CompilationPath) enc items = let modty = lazy (ImportILTypeDefList amap m (cpath.NestedCompPath n Namespace) enc tgs) NewModuleOrNamespace (Some cpath) taccessPublic (mkSynId m n) XmlDoc.Empty [] (MaybeLazy.Lazy modty)) (fun (n,info:Lazy<_>) -> - let (scoref2,_,lazyTypeDef:Lazy) = info.Force() - ImportILTypeDef amap m scoref2 cpath enc n (lazyTypeDef.Force())) + let (scoref2,_,lazyTypeDef:ILPreTypeDef) = info.Force() + ImportILTypeDef amap m scoref2 cpath enc n (lazyTypeDef.GetTypeDef())) let kind = match enc with [] -> Namespace | _ -> ModuleOrType NewModuleOrNamespaceType kind entities [] @@ -483,8 +483,8 @@ and ImportILTypeDefList amap m (cpath:CompilationPath) enc items = /// and ImportILTypeDefs amap m scoref cpath enc (tdefs: ILTypeDefs) = // We be very careful not to force a read of the type defs here - tdefs.AsArrayOfLazyTypeDefs - |> Array.map (fun (ns,n,attrs,lazyTypeDef) -> (ns,(n,notlazy(scoref,attrs,lazyTypeDef)))) + tdefs.AsArrayOfPreTypeDefs + |> Array.map (fun pre -> (pre.Namespace,(pre.Name,notlazy(scoref,pre.MetadataIndex,pre)))) |> Array.toList |> ImportILTypeDefList amap m cpath enc @@ -502,19 +502,20 @@ let ImportILAssemblyExportedType amap m auxModLoader (scoref:ILScopeRef) (export if exportedType.IsForwarder then [] else + let ns,n = splitILTypeName exportedType.Name let info = lazy (match (try let modul = auxModLoader exportedType.ScopeRef - Some (lazy modul.TypeDefs.FindByName exportedType.Name) - with :? System.Collections.Generic.KeyNotFoundException -> None) + let ptd = mkILPreTypeDefComputed (ns, n, (fun () -> modul.TypeDefs.FindByName exportedType.Name)) + Some ptd + with :? KeyNotFoundException -> None) with | None -> error(Error(FSComp.SR.impReferenceToDllRequiredByAssembly(exportedType.ScopeRef.QualifiedName, scoref.QualifiedName, exportedType.Name),m)) - | Some lazyTypeDef -> - scoref,exportedType.CustomAttrs,lazyTypeDef) + | Some preTypeDef -> + scoref,-1,preTypeDef) - let ns,n = splitILTypeName exportedType.Name [ ImportILTypeDefList amap m (CompPath(scoref,[])) [] [(ns,(n,info))] ] /// Import the "exported types" table for multi-module assemblies. diff --git a/src/fsharp/service/IncrementalBuild.fs b/src/fsharp/service/IncrementalBuild.fs index 10f63f5ac7..6f794fef9b 100755 --- a/src/fsharp/service/IncrementalBuild.fs +++ b/src/fsharp/service/IncrementalBuild.fs @@ -1025,13 +1025,24 @@ type TypeCheckAccumulator = tcGlobals:TcGlobals tcConfig:TcConfig tcEnvAtEndOfFile: TcEnv - tcResolutions: TcResolutions list - tcSymbolUses: TcSymbolUses list - tcOpenDeclarations: OpenDeclaration list + + /// Accumulated resolutions, last file first + tcResolutionsRev: TcResolutions list + + /// Accumulated symbol uses, last file first + tcSymbolUsesRev: TcSymbolUses list + + /// Accumulated 'open' declarations, last file first + tcOpenDeclarationsRev: OpenDeclaration[] list topAttribs:TopAttribs option - typedImplFiles:TypedImplFile list + + /// Result of checking most recent file, if any + lastestTypedImplFile:TypedImplFile option + tcDependencyFiles: string list - tcErrors:(PhasedDiagnostic * FSharpErrorSeverity) list } // errors=true, warnings=false + + /// Accumulated errors, last file first + tcErrorsRev:(PhasedDiagnostic * FSharpErrorSeverity)[] list } /// Global service state @@ -1099,14 +1110,26 @@ type PartialCheckResults = TcGlobals: TcGlobals TcConfig: TcConfig TcEnvAtEnd: TcEnv - Errors: (PhasedDiagnostic * FSharpErrorSeverity) list - TcResolutions: TcResolutions list - TcSymbolUses: TcSymbolUses list - TcOpenDeclarations: OpenDeclaration list + + /// Kept in a stack so that each incremental update shares storage with previous files + TcErrorsRev: (PhasedDiagnostic * FSharpErrorSeverity)[] list + + /// Kept in a stack so that each incremental update shares storage with previous files + TcResolutionsRev: TcResolutions list + + /// Kept in a stack so that each incremental update shares storage with previous files + TcSymbolUsesRev: TcSymbolUses list + + /// Kept in a stack so that each incremental update shares storage with previous files + TcOpenDeclarationsRev: OpenDeclaration[] list + TcDependencyFiles: string list TopAttribs: TopAttribs option - TimeStamp: System.DateTime - ImplementationFiles: TypedImplFile list } + TimeStamp: DateTime + LatestImplementationFile: TypedImplFile option } + + member x.TcErrors = Array.concat (List.rev x.TcErrorsRev) + member x.TcSymbolUses = List.rev x.TcSymbolUsesRev static member Create (tcAcc: TypeCheckAccumulator, timestamp) = { TcState = tcAcc.tcState @@ -1114,14 +1137,14 @@ type PartialCheckResults = TcGlobals = tcAcc.tcGlobals TcConfig = tcAcc.tcConfig TcEnvAtEnd = tcAcc.tcEnvAtEndOfFile - Errors = tcAcc.tcErrors - TcResolutions = tcAcc.tcResolutions - TcSymbolUses = tcAcc.tcSymbolUses - TcOpenDeclarations = tcAcc.tcOpenDeclarations + TcErrorsRev = tcAcc.tcErrorsRev + TcResolutionsRev = tcAcc.tcResolutionsRev + TcSymbolUsesRev = tcAcc.tcSymbolUsesRev + TcOpenDeclarationsRev = tcAcc.tcOpenDeclarationsRev TcDependencyFiles = tcAcc.tcDependencyFiles TopAttribs = tcAcc.topAttribs TimeStamp = timestamp - ImplementationFiles = tcAcc.typedImplFiles } + LatestImplementationFile = tcAcc.lastestTypedImplFile } [] @@ -1316,19 +1339,20 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput for (err, isError) in inp.MetaCommandDiagnostics do yield err, (if isError then FSharpErrorSeverity.Error else FSharpErrorSeverity.Warning) ] + let initialErrors = Array.append (Array.ofList loadClosureErrors) (errorLogger.GetErrors()) let tcAcc = { tcGlobals=tcGlobals tcImports=tcImports tcState=tcState tcConfig=tcConfig tcEnvAtEndOfFile=tcInitial - tcResolutions=[] - tcSymbolUses=[] - tcOpenDeclarations=[] + tcResolutionsRev=[] + tcSymbolUsesRev=[] + tcOpenDeclarationsRev=[] topAttribs=None - typedImplFiles=[] + lastestTypedImplFile=None tcDependencyFiles=basicDependencies - tcErrors = loadClosureErrors @ errorLogger.GetErrors() } + tcErrorsRev = [ initialErrors ] } return tcAcc } /// This is a build task function that gets placed into the build rules as the computation for a Vector.ScanLeft @@ -1347,9 +1371,9 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput ApplyMetaCommandsFromInputToTcConfig (tcConfig, input, Path.GetDirectoryName filename) |> ignore let sink = TcResultsSinkImpl(tcAcc.tcGlobals) - let hadParseErrors = not (List.isEmpty parseErrors) + let hadParseErrors = not (Array.isEmpty parseErrors) - let! (tcEnvAtEndOfFile, topAttribs, typedImplFiles), tcState = + let! (tcEnvAtEndOfFile, topAttribs, lastestTypedImplFile), tcState = TypeCheckOneInputEventually ((fun () -> hadParseErrors || errorLogger.ErrorCount > 0), tcConfig, tcAcc.tcImports, @@ -1359,7 +1383,7 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput tcAcc.tcState, input) /// Only keep the typed interface files when doing a "full" build for fsc.exe, otherwise just throw them away - let typedImplFiles = if keepAssemblyContents then typedImplFiles else [] + let lastestTypedImplFile = if keepAssemblyContents then lastestTypedImplFile else None let tcResolutions = if keepAllBackgroundResolutions then sink.GetResolutions() else TcResolutions.Empty let tcEnvAtEndOfFile = (if keepAllBackgroundResolutions then tcEnvAtEndOfFile else tcState.TcEnvFromImpls) let tcSymbolUses = sink.GetSymbolUses() @@ -1367,14 +1391,15 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput RequireCompilationThread ctok // Note: events get raised on the CompilationThread fileChecked.Trigger (filename) + let newErrors = Array.append parseErrors (capturingErrorLogger.GetErrors()) return {tcAcc with tcState=tcState tcEnvAtEndOfFile=tcEnvAtEndOfFile topAttribs=Some topAttribs - typedImplFiles=typedImplFiles - tcResolutions=tcAcc.tcResolutions @ [tcResolutions] - tcSymbolUses=tcAcc.tcSymbolUses @ [tcSymbolUses] - tcOpenDeclarations=tcAcc.tcOpenDeclarations @ sink.OpenDeclarations - tcErrors = tcAcc.tcErrors @ parseErrors @ capturingErrorLogger.GetErrors() + lastestTypedImplFile=lastestTypedImplFile + tcResolutionsRev=tcResolutions :: tcAcc.tcResolutionsRev + tcSymbolUsesRev=tcSymbolUses :: tcAcc.tcSymbolUsesRev + tcOpenDeclarationsRev = sink.GetOpenDeclarations() :: tcAcc.tcOpenDeclarationsRev + tcErrorsRev = newErrors :: tcAcc.tcErrorsRev tcDependencyFiles = filename :: tcAcc.tcDependencyFiles } } @@ -1413,7 +1438,7 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput // Finish the checking let (_tcEnvAtEndOfLastFile, topAttrs, mimpls), tcState = - let results = tcStates |> List.ofArray |> List.map (fun acc-> acc.tcEnvAtEndOfFile, defaultArg acc.topAttribs EmptyTopAttrs, acc.typedImplFiles) + let results = tcStates |> List.ofArray |> List.map (fun acc-> acc.tcEnvAtEndOfFile, defaultArg acc.topAttribs EmptyTopAttrs, acc.lastestTypedImplFile) TypeCheckMultipleInputsFinish (results, finalAcc.tcState) let ilAssemRef, tcAssemblyDataOpt, tcAssemblyExprOpt = @@ -1469,7 +1494,7 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput let finalAccWithErrors = { finalAcc with - tcErrors = finalAcc.tcErrors @ errorLogger.GetErrors() + tcErrorsRev = errorLogger.GetErrors() :: finalAcc.tcErrorsRev topAttribs = Some topAttrs } return ilAssemRef, tcAssemblyDataOpt, tcAssemblyExprOpt, finalAccWithErrors @@ -1823,10 +1848,10 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput let errorSeverityOptions = builder.TcConfig.errorSeverityOptions let errorLogger = CompilationErrorLogger("IncrementalBuilderCreation", errorSeverityOptions) delayedLogger.CommitDelayedDiagnostics(errorLogger) - errorLogger.GetErrors() |> List.map (fun (d, severity) -> d, severity = FSharpErrorSeverity.Error) + errorLogger.GetErrors() |> Array.map (fun (d, severity) -> d, severity = FSharpErrorSeverity.Error) | _ -> - delayedLogger.Diagnostics - |> List.map (fun (d, isError) -> FSharpErrorInfo.CreateFromException(d, isError, range.Zero)) + Array.ofList delayedLogger.Diagnostics + |> Array.map (fun (d, isError) -> FSharpErrorInfo.CreateFromException(d, isError, range.Zero)) return builderOpt, diagnostics } diff --git a/src/fsharp/service/IncrementalBuild.fsi b/src/fsharp/service/IncrementalBuild.fsi index 73b3dc4be6..0f41ce1054 100755 --- a/src/fsharp/service/IncrementalBuild.fsi +++ b/src/fsharp/service/IncrementalBuild.fsi @@ -44,16 +44,16 @@ type internal PartialCheckResults = TcEnvAtEnd : TypeChecker.TcEnv /// Represents the collected errors from type checking - Errors : (PhasedDiagnostic * FSharpErrorSeverity) list + TcErrorsRev : (PhasedDiagnostic * FSharpErrorSeverity)[] list /// Represents the collected name resolutions from type checking - TcResolutions: TcResolutions list + TcResolutionsRev: TcResolutions list /// Represents the collected uses of symbols from type checking - TcSymbolUses: TcSymbolUses list + TcSymbolUsesRev: TcSymbolUses list /// Represents open declarations - TcOpenDeclarations: OpenDeclaration list + TcOpenDeclarationsRev: OpenDeclaration[] list TcDependencyFiles: string list @@ -62,8 +62,13 @@ type internal PartialCheckResults = TimeStamp: DateTime - /// Represents complete typechecked implementation files, including thier typechecked signatures if any. - ImplementationFiles: TypedImplFile list } + /// Represents latest complete typechecked implementation file, including its typechecked signature if any. + /// Empty for a signature file. + LatestImplementationFile: TypedImplFile option } + + member TcErrors: (PhasedDiagnostic * FSharpErrorSeverity)[] + + member TcSymbolUses: TcSymbolUses list /// Manages an incremental build graph for the build of an F# project [] @@ -151,9 +156,9 @@ type internal IncrementalBuilder = /// Await the untyped parse results for a particular slot in the vector of parse results. /// /// This may be a marginally long-running operation (parses are relatively quick, only one file needs to be parsed) - member GetParseResultsForFile : CompilationThreadToken * filename:string -> Cancellable + member GetParseResultsForFile : CompilationThreadToken * filename:string -> Cancellable - static member TryCreateBackgroundBuilderForProjectOptions : CompilationThreadToken * ReferenceResolver.Resolver * defaultFSharpBinariesDir: string * FrameworkImportsCache * scriptClosureOptions:LoadClosure option * sourceFiles:string list * commandLineArgs:string list * projectReferences: IProjectReference list * projectDirectory:string * useScriptResolutionRules:bool * keepAssemblyContents: bool * keepAllBackgroundResolutions: bool * maxTimeShareMilliseconds: int64 * tryGetMetadataSnapshot: ILBinaryReader.ILReaderTryGetMetadataSnapshot -> Cancellable + static member TryCreateBackgroundBuilderForProjectOptions : CompilationThreadToken * ReferenceResolver.Resolver * defaultFSharpBinariesDir: string * FrameworkImportsCache * scriptClosureOptions:LoadClosure option * sourceFiles:string list * commandLineArgs:string list * projectReferences: IProjectReference list * projectDirectory:string * useScriptResolutionRules:bool * keepAssemblyContents: bool * keepAllBackgroundResolutions: bool * maxTimeShareMilliseconds: int64 * tryGetMetadataSnapshot: ILBinaryReader.ILReaderTryGetMetadataSnapshot -> Cancellable /// Increment the usage count on the IncrementalBuilder by 1. This initial usage count is 0 so immediately after creation /// a call to KeepBuilderAlive should be made. The returns an IDisposable which will diff --git a/src/fsharp/service/ServiceAnalysis.fs b/src/fsharp/service/ServiceAnalysis.fs index b34fce7997..69624c252a 100644 --- a/src/fsharp/service/ServiceAnalysis.fs +++ b/src/fsharp/service/ServiceAnalysis.fs @@ -76,10 +76,10 @@ module UnusedOpens = AppliedScope: range } /// Gets the open statements, their scopes and their resolutions - let getOpenStatements (openDeclarations: FSharpOpenDeclaration list) : OpenStatement list = + let getOpenStatements (openDeclarations: FSharpOpenDeclaration[]) : OpenStatement[] = openDeclarations - |> List.filter (fun x -> not x.IsOwnNamespace) - |> List.choose (fun openDecl -> + |> Array.filter (fun x -> not x.IsOwnNamespace) + |> Array.choose (fun openDecl -> match openDecl.LongId, openDecl.Range with | firstId :: _, Some range -> if firstId.idText = MangledGlobalName then @@ -191,7 +191,7 @@ module UnusedOpens = /// Async to allow cancellation. let filterOpenStatements symbolUses openStatements = async { - let! results = filterOpenStatementsIncremental symbolUses openStatements [] [] + let! results = filterOpenStatementsIncremental symbolUses (List.ofArray openStatements) [] [] return results |> List.map (fun os -> os.Range) } diff --git a/src/fsharp/service/service.fs b/src/fsharp/service/service.fs index 615b8aecdf..f5f4a64025 100644 --- a/src/fsharp/service/service.fs +++ b/src/fsharp/service/service.fs @@ -166,8 +166,8 @@ type TypeCheckInfo reactorOps : IReactorOperations, checkAlive : (unit -> bool), textSnapshotInfo:obj option, - implementationFiles: TypedImplFile list, - openDeclarations: OpenDeclaration list) = + implFileOpt: TypedImplFile option, + openDeclarations: OpenDeclaration[]) = let textSnapshotInfo = defaultArg textSnapshotInfo null let (|CNR|) (cnr:CapturedNameResolution) = @@ -1394,7 +1394,7 @@ type TypeCheckInfo /// The assembly being analyzed member __.ThisCcu = thisCcu - member __.ImplementationFiles = implementationFiles + member __.ImplementationFile = implFileOpt /// All open declarations in the file, including auto open modules member __.OpenDeclarations = openDeclarations @@ -1602,7 +1602,7 @@ module internal Parser = tcState: TcState, loadClosure: LoadClosure option, // These are the errors and warnings seen by the background compiler for the entire antecedent - backgroundDiagnostics: (PhasedDiagnostic * FSharpErrorSeverity) list, + backgroundDiagnostics: (PhasedDiagnostic * FSharpErrorSeverity)[], reactorOps: IReactorOperations, // Used by 'FSharpDeclarationListInfo' to check the IncrementalBuilder is still alive. checkAlive : (unit -> bool), @@ -1652,7 +1652,7 @@ module internal Parser = let hashLoadBackgroundDiagnostics, otherBackgroundDiagnostics = backgroundDiagnostics - |> List.partition (fun backgroundError -> + |> Array.partition (fun backgroundError -> hashLoadsInFile |> List.exists (fst >> sameFile (fileOfBackgroundError backgroundError))) @@ -1660,17 +1660,17 @@ module internal Parser = // Group errors and warnings by file name. let hashLoadBackgroundDiagnosticsGroupedByFileName = hashLoadBackgroundDiagnostics - |> List.map(fun err -> fileOfBackgroundError err,err) - |> List.groupByFirst // fileWithErrors, error list + |> Array.map(fun err -> fileOfBackgroundError err,err) + |> Array.groupBy fst // fileWithErrors, error list // Join the sets and report errors. // It is by-design that these messages are only present in the language service. A true build would report the errors at their // spots in the individual source files. for (fileOfHashLoad, rangesOfHashLoad) in hashLoadsInFile do - for errorGroupedByFileName in hashLoadBackgroundDiagnosticsGroupedByFileName do - if sameFile (fst errorGroupedByFileName) fileOfHashLoad then + for (file, errorGroupedByFileName) in hashLoadBackgroundDiagnosticsGroupedByFileName do + if sameFile file fileOfHashLoad then for rangeOfHashLoad in rangesOfHashLoad do // Handle the case of two #loads of the same file - let diagnostics = snd errorGroupedByFileName |> List.map(fun (pe,f)->pe.Exception,f) // Strip the build phase here. It will be replaced, in total, with TypeCheck + let diagnostics = errorGroupedByFileName |> Array.map(fun (_,(pe,f)) -> pe.Exception,f) // Strip the build phase here. It will be replaced, in total, with TypeCheck let errors = [ for (err,sev) in diagnostics do if sev = FSharpErrorSeverity.Error then yield err ] let warnings = [ for (err,sev) in diagnostics do if sev = FSharpErrorSeverity.Warning then yield err ] @@ -1729,25 +1729,25 @@ module internal Parser = let errors = errHandler.CollectedDiagnostics match tcEnvAtEndOpt with - | Some (tcEnvAtEnd, typedImplFiles, tcState) -> + | Some (tcEnvAtEnd, implFiles, tcState) -> let scope = TypeCheckInfo(tcConfig, tcGlobals, - tcState.PartialAssemblySignature, - tcState.Ccu, - tcImports, - tcEnvAtEnd.AccessRights, - //typedImplFiles, - projectFileName, - mainInputFileName, - sink.GetResolutions(), - sink.GetSymbolUses(), - tcEnvAtEnd.NameEnv, - loadClosure, - reactorOps, - checkAlive, - textSnapshotInfo, - typedImplFiles, - sink.OpenDeclarations) + tcState.PartialAssemblySignature, + tcState.Ccu, + tcImports, + tcEnvAtEnd.AccessRights, + //typedImplFiles, + projectFileName, + mainInputFileName, + sink.GetResolutions(), + sink.GetSymbolUses(), + tcEnvAtEnd.NameEnv, + loadClosure, + reactorOps, + checkAlive, + textSnapshotInfo, + List.tryHead implFiles, + sink.GetOpenDeclarations()) return errors, TypeCheckAborted.No scope | None -> return errors, TypeCheckAborted.Yes @@ -2094,25 +2094,26 @@ type FSharpCheckFileResults(filename: string, errors: FSharpErrorInfo[], scopeOp RequireCompilationThread ctok scope.IsRelativeNameResolvableFromSymbol(pos, plid, symbol)) - member info.ImplementationFiles = + member info.ImplementationFile = if not keepAssemblyContents then invalidOp "The 'keepAssemblyContents' flag must be set to true on the FSharpChecker in order to access the checked contents of assemblies" scopeOptX |> Option.map (fun scope -> let cenv = Impl.cenv(scope.TcGlobals, scope.ThisCcu, scope.TcImports) - [ for mimpl in scope.ImplementationFiles -> FSharpImplementationFileContents(cenv, mimpl)]) + scope.ImplementationFile |> Option.map (fun implFile -> FSharpImplementationFileContents(cenv, implFile))) + |> Option.defaultValue None member info.OpenDeclarations = scopeOptX |> Option.map (fun scope -> let cenv = Impl.cenv(scope.TcGlobals, scope.ThisCcu, scope.TcImports) - scope.OpenDeclarations |> List.map (fun x -> + scope.OpenDeclarations |> Array.map (fun x -> { LongId = x.LongId Range = x.Range Modules = x.Modules |> List.map (fun x -> FSharpEntity(cenv, x)) AppliedScope = x.AppliedScope IsOwnNamespace = x.IsOwnNamespace } : FSharpOpenDeclaration )) - |> Option.defaultValue [] + |> Option.defaultValue [| |] override info.ToString() = "FSharpCheckFileResults(" + filename + ")" @@ -2377,7 +2378,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC // /// Cache of builds keyed by options. let incrementalBuildersCache = - MruCache + MruCache (keepStrongly=projectCacheSize, keepMax=projectCacheSize, areSame = FSharpProjectOptions.AreSameForChecking, areSimilar = FSharpProjectOptions.UseSameProjectFileName, @@ -2436,7 +2437,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC static let mutable foregroundTypeCheckCount = 0 let MakeCheckFileResultsEmpty(filename, creationErrors) = - FSharpCheckFileResults (filename, Array.ofList creationErrors, None, [| |], None, reactorOps, keepAssemblyContents) + FSharpCheckFileResults (filename, creationErrors, None, [| |], None, reactorOps, keepAssemblyContents) let MakeCheckFileResults(filename, options:FSharpProjectOptions, builder, scope, dependencyFiles, creationErrors, parseErrors, tcErrors) = let errors = @@ -2488,7 +2489,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC let! builderOpt, creationErrors, decrement = getOrCreateBuilderAndKeepAlive (ctok, options, userOpName) use _unwind = decrement match builderOpt with - | None -> return FSharpParseFileResults(List.toArray creationErrors, None, true, [| |]) + | None -> return FSharpParseFileResults(creationErrors, None, true, [| |]) | Some builder -> let! parseTreeOpt,_,_,parseErrors = builder.GetParseResultsForFile (ctok, filename) let errors = [| yield! creationErrors; yield! ErrorHelpers.CreateErrorInfos (builder.TcConfig.errorSeverityOptions, false, filename, parseErrors) |] @@ -2530,11 +2531,11 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC source: string, fileName: string, options: FSharpProjectOptions, - textSnapshotInfo : obj option, - fileVersion : int, - builder : IncrementalBuilder, - tcPrior : PartialCheckResults, - creationErrors : FSharpErrorInfo list, + textSnapshotInfo: obj option, + fileVersion: int, + builder: IncrementalBuilder, + tcPrior: PartialCheckResults, + creationErrors: FSharpErrorInfo[], userOpName: string) = async { @@ -2555,7 +2556,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC let loadClosure = scriptClosureCacheLock.AcquireLock (fun ltok -> scriptClosureCache.TryGet (ltok, options)) let! tcErrors, tcFileResult = Parser.CheckOneFile(parseResults, source, fileName, options.ProjectFileName, tcPrior.TcConfig, tcPrior.TcGlobals, tcPrior.TcImports, - tcPrior.TcState, loadClosure, tcPrior.Errors, reactorOps, (fun () -> builder.IsAlive), textSnapshotInfo, userOpName) + tcPrior.TcState, loadClosure, tcPrior.TcErrors, reactorOps, (fun () -> builder.IsAlive), textSnapshotInfo, userOpName) let parsingOptions = FSharpParsingOptions.FromTcConfig(tcPrior.TcConfig, Array.ofList builder.SourceFiles, options.UseScriptResolutionRules) let checkAnswer = MakeCheckFileAnswer(fileName, tcFileResult, options, builder, Array.ofList tcPrior.TcDependencyFiles, creationErrors, parseResults.Errors, tcErrors) bc.RecordTypeCheckFileInProjectResults(fileName, options, parsingOptions, parseResults, fileVersion, tcPrior.TimeStamp, Some checkAnswer, source) @@ -2655,7 +2656,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC use _unwind = decrement match builderOpt with | None -> - let parseResults = FSharpParseFileResults(List.toArray creationErrors, None, true, [| |]) + let parseResults = FSharpParseFileResults(creationErrors, None, true, [| |]) return (parseResults, FSharpCheckFileAnswer.Aborted) | Some builder -> @@ -2688,7 +2689,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC use _unwind = decrement match builderOpt with | None -> - let parseResults = FSharpParseFileResults(Array.ofList creationErrors, None, true, [| |]) + let parseResults = FSharpParseFileResults(creationErrors, None, true, [| |]) let typedResults = MakeCheckFileResultsEmpty(filename, creationErrors) return (parseResults, typedResults) | Some builder -> @@ -2696,18 +2697,18 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC let! tcProj = builder.GetCheckResultsAfterFileInProject (ctok, filename) let errorOptions = builder.TcConfig.errorSeverityOptions let untypedErrors = [| yield! creationErrors; yield! ErrorHelpers.CreateErrorInfos (errorOptions, false, filename, untypedErrors) |] - let tcErrors = [| yield! creationErrors; yield! ErrorHelpers.CreateErrorInfos (errorOptions, false, filename, tcProj.Errors) |] + let tcErrors = [| yield! creationErrors; yield! ErrorHelpers.CreateErrorInfos (errorOptions, false, filename, tcProj.TcErrors) |] let parseResults = FSharpParseFileResults(errors = untypedErrors, input = parseTreeOpt, parseHadErrors = false, dependencyFiles = builder.AllDependenciesDeprecated) let loadClosure = scriptClosureCacheLock.AcquireLock (fun ltok -> scriptClosureCache.TryGet (ltok, options) ) let scope = TypeCheckInfo(tcProj.TcConfig, tcProj.TcGlobals, tcProj.TcState.PartialAssemblySignature, tcProj.TcState.Ccu, tcProj.TcImports, tcProj.TcEnvAtEnd.AccessRights, options.ProjectFileName, filename, - List.last tcProj.TcResolutions, - List.last tcProj.TcSymbolUses, + List.head tcProj.TcResolutionsRev, + List.head tcProj.TcSymbolUsesRev, tcProj.TcEnvAtEnd.NameEnv, loadClosure, reactorOps, (fun () -> builder.IsAlive), None, - tcProj.ImplementationFiles, - tcProj.TcOpenDeclarations) + tcProj.LatestImplementationFile, + List.head tcProj.TcOpenDeclarationsRev) let typedResults = MakeCheckFileResults(filename, options, builder, scope, Array.ofList tcProj.TcDependencyFiles, creationErrors, parseResults.Errors, tcErrors) return (parseResults, typedResults) }) @@ -2730,12 +2731,12 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC use _unwind = decrement match builderOpt with | None -> - return FSharpCheckProjectResults (options.ProjectFileName, None, keepAssemblyContents, Array.ofList creationErrors, None, reactorOps) + return FSharpCheckProjectResults (options.ProjectFileName, None, keepAssemblyContents, creationErrors, None, reactorOps) | Some builder -> let! (tcProj, ilAssemRef, tcAssemblyDataOpt, tcAssemblyExprOpt) = builder.GetCheckResultsAndImplementationsForProject(ctok) let errorOptions = tcProj.TcConfig.errorSeverityOptions let fileName = TcGlobals.DummyFileNameForRangesWithoutASpecificLocation - let errors = [| yield! creationErrors; yield! ErrorHelpers.CreateErrorInfos (errorOptions, true, fileName, tcProj.Errors) |] + let errors = [| yield! creationErrors; yield! ErrorHelpers.CreateErrorInfos (errorOptions, true, fileName, tcProj.TcErrors) |] return FSharpCheckProjectResults (options.ProjectFileName, Some tcProj.TcConfig, keepAssemblyContents, errors, Some(tcProj.TcGlobals, tcProj.TcImports, tcProj.TcState.Ccu, tcProj.TcState.PartialAssemblySignature, tcProj.TcSymbolUses, tcProj.TopAttribs, tcAssemblyDataOpt, ilAssemRef, tcProj.TcEnvAtEnd.AccessRights, tcAssemblyExprOpt, Array.ofList tcProj.TcDependencyFiles), reactorOps) } @@ -3253,7 +3254,7 @@ type FsiInteractiveChecker(legacyReferenceResolver, reactorOps: IReactorOperatio let dependencyFiles = [| |] // interactions have no dependencies let parseResults = FSharpParseFileResults(parseErrors, parseTreeOpt, parseHadErrors = anyErrors, dependencyFiles = dependencyFiles) - let backgroundDiagnostics = [] + let backgroundDiagnostics = [| |] let reduceMemoryUsage = ReduceMemoryFlag.Yes let assumeDotNetFramework = true diff --git a/src/fsharp/service/service.fsi b/src/fsharp/service/service.fsi index 594f9a2da8..072d2813b8 100755 --- a/src/fsharp/service/service.fsi +++ b/src/fsharp/service/service.fsi @@ -248,11 +248,11 @@ type public FSharpCheckFileResults = /// An optional string used for tracing compiler operations associated with this request. member IsRelativeNameResolvableFromSymbol: cursorPos : pos * plid : string list * symbol: FSharpSymbol * ?userOpName: string -> Async - /// Represents complete typechecked implementation files, including thier typechecked signatures if any. - member ImplementationFiles: FSharpImplementationFileContents list option + /// Represents complete typechecked implementation file, including its typechecked signatures if any. + member ImplementationFile: FSharpImplementationFileContents option /// Open declarations in the file, including auto open modules. - member OpenDeclarations: FSharpOpenDeclaration list + member OpenDeclarations: FSharpOpenDeclaration[] /// A handle to the results of CheckFileInProject. [] diff --git a/src/fsharp/symbols/SymbolHelpers.fs b/src/fsharp/symbols/SymbolHelpers.fs index a2997654b7..2e04170ad0 100644 --- a/src/fsharp/symbols/SymbolHelpers.fs +++ b/src/fsharp/symbols/SymbolHelpers.fs @@ -157,7 +157,7 @@ type internal CompilationErrorLogger (debugName: string, options: FSharpErrorSev override x.ErrorCount = errorCount - member x.GetErrors() = List.ofSeq diagnostics + member x.GetErrors() = diagnostics.ToArray() /// This represents the global state established as each task function runs as part of the build. diff --git a/src/fsharp/symbols/SymbolHelpers.fsi b/src/fsharp/symbols/SymbolHelpers.fsi index 4e95e23a3b..065c28335d 100755 --- a/src/fsharp/symbols/SymbolHelpers.fsi +++ b/src/fsharp/symbols/SymbolHelpers.fsi @@ -188,7 +188,7 @@ type internal CompilationErrorLogger = new: debugName:string * options: FSharpErrorSeverityOptions -> CompilationErrorLogger /// Get the captured errors - member GetErrors: unit -> (PhasedDiagnostic * FSharpErrorSeverity) list + member GetErrors: unit -> (PhasedDiagnostic * FSharpErrorSeverity)[] /// This represents the global state established as each task function runs as part of the build. /// diff --git a/tests/service/ProjectAnalysisTests.fs b/tests/service/ProjectAnalysisTests.fs index d7eb1a801f..8586fd2cd8 100644 --- a/tests/service/ProjectAnalysisTests.fs +++ b/tests/service/ProjectAnalysisTests.fs @@ -5175,12 +5175,12 @@ type A(i:int) = | _ -> failwithf "Parsing aborted unexpectedly..." let declarations = - match fileCheckResults.ImplementationFiles with - | Some (implFile :: _) -> + match fileCheckResults.ImplementationFile with + | Some implFile -> match implFile.Declarations |> List.tryHead with | Some (FSharpImplementationFileDeclaration.Entity (_, subDecls)) -> subDecls | _ -> failwith "unexpected declaration" - | Some [] | None -> failwith "File check results does not contain any `ImplementationFile`s" + | None -> failwith "File check results does not contain any `ImplementationFile`s" match declarations |> List.tryHead with | Some (FSharpImplementationFileDeclaration.Entity(entity, [])) -> diff --git a/vsintegration/src/FSharp.Editor/LanguageService/IProjectSite.fs b/vsintegration/src/FSharp.Editor/LanguageService/IProjectSite.fs index 71d53fe406..0b3f65d362 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/IProjectSite.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/IProjectSite.fs @@ -22,7 +22,7 @@ and internal IProjectSite = abstract CompilationOptions : string[] /// The normalized '-r:' assembly references, without the '-r:' - abstract CompilationReferences : string [] + abstract CompilationReferences : string[] /// The '-o:' output bin path, without the '-o:' abstract CompilationBinOutputPath : string option From a6b72a4378475637b2bbb6165155d89fc673c825 Mon Sep 17 00:00:00 2001 From: John Wostenberg Date: Thu, 22 Mar 2018 18:00:57 -0500 Subject: [PATCH 142/147] Enum match warning (#4522) * Add compiler warning for enum matches * Refactor * Make incomplete enum match warning only show itself when the pattern match covers all known enum values * small change * Update xlf * Update xlf (take 2) * Fix xlf format mistake * Add green test * Remove leftover printfn and register test * Attempt to make enum warning work in more cases * Fix inverted logic mistake * Update tests * Fix enum match warning not producing locations * New items should use translation state "new" * Update a test * Update another test * Undo changes out of the scope of this PR * Undo more whitespace --- src/fsharp/CompileOps.fs | 12 ++++ src/fsharp/FSStrings.resx | 3 + src/fsharp/PatternMatchCompilation.fs | 70 ++++++++++++------- src/fsharp/PatternMatchCompilation.fsi | 1 + src/fsharp/xlf/FSStrings.cs.xlf | 5 ++ src/fsharp/xlf/FSStrings.de.xlf | 5 ++ src/fsharp/xlf/FSStrings.en.xlf | 5 ++ src/fsharp/xlf/FSStrings.es.xlf | 5 ++ src/fsharp/xlf/FSStrings.fr.xlf | 5 ++ src/fsharp/xlf/FSStrings.it.xlf | 5 ++ src/fsharp/xlf/FSStrings.ja.xlf | 5 ++ src/fsharp/xlf/FSStrings.ko.xlf | 5 ++ src/fsharp/xlf/FSStrings.pl.xlf | 5 ++ src/fsharp/xlf/FSStrings.pt-BR.xlf | 5 ++ src/fsharp/xlf/FSStrings.ru.xlf | 5 ++ src/fsharp/xlf/FSStrings.tr.xlf | 5 ++ src/fsharp/xlf/FSStrings.zh-Hans.xlf | 5 ++ src/fsharp/xlf/FSStrings.zh-Hant.xlf | 5 ++ tests/fsharp/tests.fs | 3 + tests/fsharp/typecheck/sigs/neg102.bsl | 10 +++ tests/fsharp/typecheck/sigs/neg102.fs | 27 +++++++ .../Expression/W_CounterExampleWithEnum02.fs | 2 +- .../Simple/E_namedLiberal01.fs | 5 +- 23 files changed, 175 insertions(+), 28 deletions(-) create mode 100644 tests/fsharp/typecheck/sigs/neg102.bsl create mode 100644 tests/fsharp/typecheck/sigs/neg102.fs diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs index 8ecde4fe13..2e249cebff 100644 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -154,6 +154,7 @@ let GetRangeOfDiagnostic(err:PhasedDiagnostic) = | InterfaceNotRevealed(_, _, m) | WrappedError (_, m) | PatternMatchCompilation.MatchIncomplete (_, _, m) + | PatternMatchCompilation.EnumMatchIncomplete (_, _, m) | PatternMatchCompilation.RuleNeverMatched m | ValNotMutable(_, _, m) | ValNotLocal(_, _, m) @@ -355,6 +356,7 @@ let GetDiagnosticNumber(err:PhasedDiagnostic) = | ExtensionTyping.ProvidedTypeResolutionNoRange _ | ExtensionTyping.ProvidedTypeResolution _ -> 103 #endif + | PatternMatchCompilation.EnumMatchIncomplete _ -> 104 (* DO NOT CHANGE THE NUMBERS *) // Strip TargetInvocationException wrappers @@ -560,6 +562,7 @@ let MatchIncomplete2E() = DeclareResourceString("MatchIncomplete2", "%s") let MatchIncomplete3E() = DeclareResourceString("MatchIncomplete3", "%s") let MatchIncomplete4E() = DeclareResourceString("MatchIncomplete4", "") let RuleNeverMatchedE() = DeclareResourceString("RuleNeverMatched", "") +let EnumMatchIncomplete1E() = DeclareResourceString("EnumMatchIncomplete1", "") let ValNotMutableE() = DeclareResourceString("ValNotMutable", "%s") let ValNotLocalE() = DeclareResourceString("ValNotLocal", "") let Obsolete1E() = DeclareResourceString("Obsolete1", "") @@ -1402,6 +1405,15 @@ let OutputPhasedErrorR (os:StringBuilder) (err:PhasedDiagnostic) = if isComp then os.Append(MatchIncomplete4E().Format) |> ignore + | PatternMatchCompilation.EnumMatchIncomplete (isComp, cexOpt, _) -> + os.Append(EnumMatchIncomplete1E().Format) |> ignore + match cexOpt with + | None -> () + | Some (cex, false) -> os.Append(MatchIncomplete2E().Format cex) |> ignore + | Some (cex, true) -> os.Append(MatchIncomplete3E().Format cex) |> ignore + if isComp then + os.Append(MatchIncomplete4E().Format) |> ignore + | PatternMatchCompilation.RuleNeverMatched _ -> os.Append(RuleNeverMatchedE().Format) |> ignore | ValNotMutable(_, valRef, _) -> os.Append(ValNotMutableE().Format(valRef.DisplayName)) |> ignore diff --git a/src/fsharp/FSStrings.resx b/src/fsharp/FSStrings.resx index eb8a8f975c..bdbe391db2 100644 --- a/src/fsharp/FSStrings.resx +++ b/src/fsharp/FSStrings.resx @@ -969,6 +969,9 @@ Unmatched elements will be ignored. + + Enums may take values outside known cases. + This rule will never be matched diff --git a/src/fsharp/PatternMatchCompilation.fs b/src/fsharp/PatternMatchCompilation.fs index a40292a356..c2e0c6376d 100644 --- a/src/fsharp/PatternMatchCompilation.fs +++ b/src/fsharp/PatternMatchCompilation.fs @@ -19,6 +19,7 @@ open Microsoft.FSharp.Compiler.Lib exception MatchIncomplete of bool * (string * bool) option * range exception RuleNeverMatched of range +exception EnumMatchIncomplete of bool * (string * bool) option * range type ActionOnFailure = | ThrowIncompleteMatchException @@ -177,33 +178,37 @@ let RefuteDiscrimSet g m path discrims = | PathConj (p,_j) -> go p tm | PathTuple (p,tys,j) -> - go p (fun _ -> mkRefTupled g m (mkOneKnown tm j tys) tys) + let k, eCoversVals = mkOneKnown tm j tys + go p (fun _ -> mkRefTupled g m k tys, eCoversVals) | PathRecd (p,tcref,tinst,j) -> - let flds = tcref |> actualTysOfInstanceRecdFields (mkTyconRefInst tcref tinst) |> mkOneKnown tm j - go p (fun _ -> Expr.Op(TOp.Recd(RecdExpr, tcref),tinst, flds,m)) + let flds, eCoversVals = tcref |> actualTysOfInstanceRecdFields (mkTyconRefInst tcref tinst) |> mkOneKnown tm j + go p (fun _ -> Expr.Op(TOp.Recd(RecdExpr, tcref),tinst, flds,m), eCoversVals) | PathUnionConstr (p,ucref,tinst,j) -> - let flds = ucref |> actualTysOfUnionCaseFields (mkTyconRefInst ucref.TyconRef tinst)|> mkOneKnown tm j - go p (fun _ -> Expr.Op(TOp.UnionCase(ucref),tinst, flds,m)) + let flds, eCoversVals = ucref |> actualTysOfUnionCaseFields (mkTyconRefInst ucref.TyconRef tinst)|> mkOneKnown tm j + go p (fun _ -> Expr.Op(TOp.UnionCase(ucref),tinst, flds,m), eCoversVals) | PathArray (p,ty,len,n) -> - go p (fun _ -> Expr.Op(TOp.Array,[ty], mkOneKnown tm n (List.replicate len ty) ,m)) + let flds, eCoversVals = mkOneKnown tm n (List.replicate len ty) + go p (fun _ -> Expr.Op(TOp.Array,[ty], flds ,m), eCoversVals) | PathExnConstr (p,ecref,n) -> - let flds = ecref |> recdFieldTysOfExnDefRef |> mkOneKnown tm n - go p (fun _ -> Expr.Op(TOp.ExnConstr(ecref),[], flds,m)) + let flds, eCoversVals = ecref |> recdFieldTysOfExnDefRef |> mkOneKnown tm n + go p (fun _ -> Expr.Op(TOp.ExnConstr(ecref),[], flds,m), eCoversVals) | PathEmpty(ty) -> tm ty - and mkOneKnown tm n tys = List.mapi (fun i ty -> if i = n then tm ty else mkUnknown ty) tys - and mkUnknowns tys = List.map mkUnknown tys + and mkOneKnown tm n tys = + let flds = List.mapi (fun i ty -> if i = n then tm ty else (mkUnknown ty, false)) tys + List.map fst flds, List.fold (fun acc (_, eCoversVals) -> eCoversVals || acc) false flds + and mkUnknowns tys = List.map (fun x -> mkUnknown x) tys let tm ty = match discrims with | [DecisionTreeTest.IsNull] -> - snd(mkCompGenLocal m notNullText ty) + snd(mkCompGenLocal m notNullText ty), false | [DecisionTreeTest.IsInst (_,_)] -> - snd(mkCompGenLocal m otherSubtypeText ty) + snd(mkCompGenLocal m otherSubtypeText ty), false | (DecisionTreeTest.Const c :: rest) -> let consts = Set.ofList (c :: List.choose (function DecisionTreeTest.Const(c) -> Some c | _ -> None) rest) let c' = @@ -227,12 +232,23 @@ let RefuteDiscrimSet g m path discrims = | Const.Decimal _ -> seq { 1 .. System.Int32.MaxValue } |> Seq.map (fun v -> Const.Decimal(decimal v)) | _ -> raise CannotRefute) + + let coversKnownEnumValues = + match tryDestAppTy g ty with + | Some tcref when tcref.IsEnumTycon -> + let knownValues = + tcref.AllFieldsArray |> Array.choose (fun f -> + match f.rfield_const, f.rfield_static with + | Some value, true -> Some value + | _, _ -> None) + Array.forall (fun ev -> consts.Contains ev) knownValues + | _ -> false (* REVIEW: we could return a better enumeration literal field here if a field matches one of the enumeration cases *) match c' with | None -> raise CannotRefute - | Some c -> Expr.Const(c,m,ty) + | Some c -> Expr.Const(c,m,ty), coversKnownEnumValues | (DecisionTreeTest.UnionCase (ucref1,tinst) :: rest) -> let ucrefs = ucref1 :: List.choose (function DecisionTreeTest.UnionCase(ucref,_) -> Some ucref | _ -> None) rest @@ -246,10 +262,10 @@ let RefuteDiscrimSet g m path discrims = | [] -> raise CannotRefute | ucref2 :: _ -> let flds = ucref2 |> actualTysOfUnionCaseFields (mkTyconRefInst tcref tinst) |> mkUnknowns - Expr.Op(TOp.UnionCase(ucref2),tinst, flds,m) + Expr.Op(TOp.UnionCase(ucref2),tinst, flds,m), false | [DecisionTreeTest.ArrayLength (n,ty)] -> - Expr.Op(TOp.Array,[ty], mkUnknowns (List.replicate (n+1) ty) ,m) + Expr.Op(TOp.Array,[ty], mkUnknowns (List.replicate (n+1) ty) ,m), false | _ -> raise CannotRefute @@ -302,15 +318,16 @@ let rec CombineRefutations g r1 r2 = let ShowCounterExample g denv m refuted = try let refutations = refuted |> List.collect (function RefutedWhenClause -> [] | (RefutedInvestigation(path,discrim)) -> [RefuteDiscrimSet g m path discrim]) - let counterExample = + let counterExample, enumCoversKnown = match refutations with | [] -> raise CannotRefute - | h :: t -> - if verbose then dprintf "h = %s\n" (Layout.showL (exprL h)) - List.fold (CombineRefutations g) h t + | (r, eck) :: t -> + if verbose then dprintf "r = %s (enumCoversKnownValue = %b)\n" (Layout.showL (exprL r)) eck + List.fold (fun (rAcc, eckAcc) (r, eck) -> + CombineRefutations g rAcc r, eckAcc || eck) (r, eck) t let text = Layout.showL (NicePrint.dataExprL denv counterExample) let failingWhenClause = refuted |> List.exists (function RefutedWhenClause -> true | _ -> false) - Some(text,failingWhenClause) + Some(text,failingWhenClause,enumCoversKnown) with | CannotRefute -> @@ -689,10 +706,15 @@ let CompilePatternBasic (* Emit the incomplete match warning *) if warnOnIncomplete then match actionOnFailure with - | ThrowIncompleteMatchException -> - warning (MatchIncomplete (false,ShowCounterExample g denv matchm refuted, matchm)) - | IgnoreWithWarning -> - warning (MatchIncomplete (true,ShowCounterExample g denv matchm refuted, matchm)) + | ThrowIncompleteMatchException | IgnoreWithWarning -> + let ignoreWithWarning = (actionOnFailure = IgnoreWithWarning) + match ShowCounterExample g denv matchm refuted with + | Some(text,failingWhenClause,true) -> + warning (EnumMatchIncomplete(ignoreWithWarning, Some(text,failingWhenClause), matchm)) + | Some(text,failingWhenClause,false) -> + warning (MatchIncomplete(ignoreWithWarning, Some(text,failingWhenClause), matchm)) + | None -> + warning (MatchIncomplete(ignoreWithWarning, None, matchm)) | _ -> () diff --git a/src/fsharp/PatternMatchCompilation.fsi b/src/fsharp/PatternMatchCompilation.fsi index f2cbce1e99..160396caf0 100644 --- a/src/fsharp/PatternMatchCompilation.fsi +++ b/src/fsharp/PatternMatchCompilation.fsi @@ -67,3 +67,4 @@ val internal CompilePattern : exception internal MatchIncomplete of bool * (string * bool) option * range exception internal RuleNeverMatched of range +exception internal EnumMatchIncomplete of bool * (string * bool) option * range \ No newline at end of file diff --git a/src/fsharp/xlf/FSStrings.cs.xlf b/src/fsharp/xlf/FSStrings.cs.xlf index 90e272e863..67c7b73457 100644 --- a/src/fsharp/xlf/FSStrings.cs.xlf +++ b/src/fsharp/xlf/FSStrings.cs.xlf @@ -1422,6 +1422,11 @@ Nespárované prvky se budou ignorovat. + + Enums may take values outside known cases. + Enums may take values outside known cases. + + This rule will never be matched Pro toto pravidlo nebude nikdy existovat shoda. diff --git a/src/fsharp/xlf/FSStrings.de.xlf b/src/fsharp/xlf/FSStrings.de.xlf index 1c98a1cdb0..e29b2908ab 100644 --- a/src/fsharp/xlf/FSStrings.de.xlf +++ b/src/fsharp/xlf/FSStrings.de.xlf @@ -1422,6 +1422,11 @@ Nicht zugeordnete Elemente werden ignoriert. + + Enums may take values outside known cases. + Enums may take values outside known cases. + + This rule will never be matched Für diese Regel wird niemals eine Übereinstimmung gefunden. diff --git a/src/fsharp/xlf/FSStrings.en.xlf b/src/fsharp/xlf/FSStrings.en.xlf index 03bc088774..af9ffda10a 100644 --- a/src/fsharp/xlf/FSStrings.en.xlf +++ b/src/fsharp/xlf/FSStrings.en.xlf @@ -1422,6 +1422,11 @@ Unmatched elements will be ignored. + + Enums may take values outside known cases. + Enums may take values outside known cases. + + This rule will never be matched This rule will never be matched diff --git a/src/fsharp/xlf/FSStrings.es.xlf b/src/fsharp/xlf/FSStrings.es.xlf index 986deafbc5..806ff3fdc4 100644 --- a/src/fsharp/xlf/FSStrings.es.xlf +++ b/src/fsharp/xlf/FSStrings.es.xlf @@ -1422,6 +1422,11 @@ Los elementos que no coinciden se omitirán. + + Enums may take values outside known cases. + Enums may take values outside known cases. + + This rule will never be matched Nunca se buscarán coincidencias con esta regla. diff --git a/src/fsharp/xlf/FSStrings.fr.xlf b/src/fsharp/xlf/FSStrings.fr.xlf index 4d4cccb39f..5697902a66 100644 --- a/src/fsharp/xlf/FSStrings.fr.xlf +++ b/src/fsharp/xlf/FSStrings.fr.xlf @@ -1422,6 +1422,11 @@ Les éléments non appariés seront ignorés. + + Enums may take values outside known cases. + Enums may take values outside known cases. + + This rule will never be matched Cette règle n'aura aucune correspondance diff --git a/src/fsharp/xlf/FSStrings.it.xlf b/src/fsharp/xlf/FSStrings.it.xlf index e26f38b327..f3413f1ec3 100644 --- a/src/fsharp/xlf/FSStrings.it.xlf +++ b/src/fsharp/xlf/FSStrings.it.xlf @@ -1422,6 +1422,11 @@ Gli elementi senza corrispondenza verranno ignorati. + + Enums may take values outside known cases. + Enums may take values outside known cases. + + This rule will never be matched Questa regola non avrà mai alcuna corrispondenza diff --git a/src/fsharp/xlf/FSStrings.ja.xlf b/src/fsharp/xlf/FSStrings.ja.xlf index 7256d1b1a4..a56e6c210f 100644 --- a/src/fsharp/xlf/FSStrings.ja.xlf +++ b/src/fsharp/xlf/FSStrings.ja.xlf @@ -1422,6 +1422,11 @@ 一致しない要素は無視されます。 + + Enums may take values outside known cases. + Enums may take values outside known cases. + + This rule will never be matched この規則には一致しません diff --git a/src/fsharp/xlf/FSStrings.ko.xlf b/src/fsharp/xlf/FSStrings.ko.xlf index 2ba29ac430..2d5c7a3e1c 100644 --- a/src/fsharp/xlf/FSStrings.ko.xlf +++ b/src/fsharp/xlf/FSStrings.ko.xlf @@ -1422,6 +1422,11 @@ 일치하지 않는 요소는 무시됩니다. + + Enums may take values outside known cases. + Enums may take values outside known cases. + + This rule will never be matched 이 규칙은 일치시킬 수 없습니다. diff --git a/src/fsharp/xlf/FSStrings.pl.xlf b/src/fsharp/xlf/FSStrings.pl.xlf index d544bdcc32..3ad66dba41 100644 --- a/src/fsharp/xlf/FSStrings.pl.xlf +++ b/src/fsharp/xlf/FSStrings.pl.xlf @@ -1422,6 +1422,11 @@ Niedopasowane elementy zostaną zignorowane. + + Enums may take values outside known cases. + Enums may take values outside known cases. + + This rule will never be matched Ta reguła nigdy nie zostanie dopasowana diff --git a/src/fsharp/xlf/FSStrings.pt-BR.xlf b/src/fsharp/xlf/FSStrings.pt-BR.xlf index b1dccf3db1..7a747c6f86 100644 --- a/src/fsharp/xlf/FSStrings.pt-BR.xlf +++ b/src/fsharp/xlf/FSStrings.pt-BR.xlf @@ -1422,6 +1422,11 @@ Elementos incompatíveis serão ignorados. + + Enums may take values outside known cases. + Enums may take values outside known cases. + + This rule will never be matched Esta regra nunca será correspondida diff --git a/src/fsharp/xlf/FSStrings.ru.xlf b/src/fsharp/xlf/FSStrings.ru.xlf index bd45c8d8ee..9c8a69c516 100644 --- a/src/fsharp/xlf/FSStrings.ru.xlf +++ b/src/fsharp/xlf/FSStrings.ru.xlf @@ -1422,6 +1422,11 @@ Элементы без соответствий будут проигнорированы. + + Enums may take values outside known cases. + Enums may take values outside known cases. + + This rule will never be matched Данное правило никогда не будет сопоставлено diff --git a/src/fsharp/xlf/FSStrings.tr.xlf b/src/fsharp/xlf/FSStrings.tr.xlf index 6ce85a3cc4..3e13a11f72 100644 --- a/src/fsharp/xlf/FSStrings.tr.xlf +++ b/src/fsharp/xlf/FSStrings.tr.xlf @@ -1422,6 +1422,11 @@ Eşleşmeyen öğeler yok sayılacak. + + Enums may take values outside known cases. + Enums may take values outside known cases. + + This rule will never be matched Bu kural hiçbir zaman eşleştirilmeyecek diff --git a/src/fsharp/xlf/FSStrings.zh-Hans.xlf b/src/fsharp/xlf/FSStrings.zh-Hans.xlf index 235affe46b..2101fdbe00 100644 --- a/src/fsharp/xlf/FSStrings.zh-Hans.xlf +++ b/src/fsharp/xlf/FSStrings.zh-Hans.xlf @@ -1422,6 +1422,11 @@ 将忽略不匹配的元素。 + + Enums may take values outside known cases. + Enums may take values outside known cases. + + This rule will never be matched 从不与此规则匹配 diff --git a/src/fsharp/xlf/FSStrings.zh-Hant.xlf b/src/fsharp/xlf/FSStrings.zh-Hant.xlf index 90c5a5a806..05a07e93b9 100644 --- a/src/fsharp/xlf/FSStrings.zh-Hant.xlf +++ b/src/fsharp/xlf/FSStrings.zh-Hant.xlf @@ -1422,6 +1422,11 @@ 無對應的項目將會被忽略。 + + Enums may take values outside known cases. + Enums may take values outside known cases. + + This rule will never be matched 這個規則絕不會比對到 diff --git a/tests/fsharp/tests.fs b/tests/fsharp/tests.fs index ef09425a21..55574b058e 100644 --- a/tests/fsharp/tests.fs +++ b/tests/fsharp/tests.fs @@ -2168,6 +2168,9 @@ module TypecheckTests = [] let ``type check neg101`` () = singleNegTest (testConfig "typecheck/sigs") "neg101" + [] + let ``type check neg102`` () = singleNegTest (testConfig "typecheck/sigs") "neg102" + [] let ``type check neg_issue_3752`` () = singleNegTest (testConfig "typecheck/sigs") "neg_issue_3752" diff --git a/tests/fsharp/typecheck/sigs/neg102.bsl b/tests/fsharp/typecheck/sigs/neg102.bsl new file mode 100644 index 0000000000..2ef6680cd0 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg102.bsl @@ -0,0 +1,10 @@ + +neg102.fs(8,14,8,22): typecheck error FS0025: Incomplete pattern matches on this expression. For example, the value 'enum (1)' may indicate a case not covered by the pattern(s). + +neg102.fs(11,14,11,22): typecheck error FS0025: Incomplete pattern matches on this expression. For example, the value 'B' may indicate a case not covered by the pattern(s). + +neg102.fs(14,14,14,22): typecheck error FS0025: Incomplete pattern matches on this expression. For example, the value '0' may indicate a case not covered by the pattern(s). + +neg102.fs(20,14,20,22): typecheck error FS0104: Enums may take values outside known cases. For example, the value 'enum (2)' may indicate a case not covered by the pattern(s). + +neg102.fs(24,14,24,22): typecheck error FS0104: Enums may take values outside known cases. For example, the value 'Some (enum (2))' may indicate a case not covered by the pattern(s). diff --git a/tests/fsharp/typecheck/sigs/neg102.fs b/tests/fsharp/typecheck/sigs/neg102.fs new file mode 100644 index 0000000000..7efb917176 --- /dev/null +++ b/tests/fsharp/typecheck/sigs/neg102.fs @@ -0,0 +1,27 @@ +module M +type EnumAB = A = 0 | B = 1 +type UnionAB = A | B + +module FS0025 = + // All of these should emit warning FS0025 ("Incomplete pattern match....") + + let f1 = function + | EnumAB.A -> "A" + + let f2 = function + | UnionAB.A -> "A" + + let f3 = function + | 42 -> "forty-two" + +module FS0104 = + // These should emit warning FS0104 ("Enums may take values outside of known cases....") + + let f1 = function + | EnumAB.A -> "A" + | EnumAB.B -> "B" + + let f2 = function + | Some(EnumAB.A) -> "A" + | Some(EnumAB.B) -> "B" + | None -> "none" \ No newline at end of file diff --git a/tests/fsharpqa/Source/Conformance/PatternMatching/Expression/W_CounterExampleWithEnum02.fs b/tests/fsharpqa/Source/Conformance/PatternMatching/Expression/W_CounterExampleWithEnum02.fs index 0fcb3e090d..cb0e64ccf8 100644 --- a/tests/fsharpqa/Source/Conformance/PatternMatching/Expression/W_CounterExampleWithEnum02.fs +++ b/tests/fsharpqa/Source/Conformance/PatternMatching/Expression/W_CounterExampleWithEnum02.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #PatternMatching // Regression test for DevDiv:198999 ("Warning messages for incomplete matches involving enum types are wrong") -//Incomplete pattern matches on this expression\. For example, the value 'enum \(2\)' may indicate a case not covered by the pattern\(s\)\.$ +//Enums may take values outside known cases\. For example, the value 'enum \(2\)' may indicate a case not covered by the pattern\(s\)\.$ //Incomplete pattern matches on this expression\. For example, the value 'enum \(1\)' may indicate a case not covered by the pattern\(s\)\.$ //Incomplete pattern matches on this expression\. For example, the value 'enum \(1\)' may indicate a case not covered by the pattern\(s\)\.$ //Incomplete pattern matches on this expression\. For example, the value 'enum \(1\)' may indicate a case not covered by the pattern\(s\)\.$ diff --git a/tests/fsharpqa/Source/Conformance/PatternMatching/Simple/E_namedLiberal01.fs b/tests/fsharpqa/Source/Conformance/PatternMatching/Simple/E_namedLiberal01.fs index d306ece633..2f3ba74085 100644 --- a/tests/fsharpqa/Source/Conformance/PatternMatching/Simple/E_namedLiberal01.fs +++ b/tests/fsharpqa/Source/Conformance/PatternMatching/Simple/E_namedLiberal01.fs @@ -1,8 +1,7 @@ // #Regression #Conformance #PatternMatching -// Match warning when using enum for incomplete match. -// (Even if you use every possible value. +// Match warning when covering all defined values of an enum -//Incomplete pattern matches on this expression +//Enums may take values outside known cases. open System From 707e712c23a3c804b567f3a1c09cb90ccf061dd8 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 23 Mar 2018 00:32:10 +0000 Subject: [PATCH 143/147] fix 4604 - assembly level attributes aren't returned by FCS (#4611) * fix 4604 * fix build * fix attributes of F# assemblies --- src/fsharp/CompileOps.fs | 26 ++++++++++---------------- src/fsharp/CompileOps.fsi | 8 +------- src/fsharp/CompileOptions.fs | 6 +++--- src/fsharp/fsc.fs | 18 ++++++++---------- src/fsharp/import.fs | 11 ++++++----- src/fsharp/service/IncrementalBuild.fs | 2 +- src/fsharp/symbols/Symbols.fs | 24 +++++++++++++++++++----- src/fsharp/tast.fs | 7 +++++++ tests/service/ProjectAnalysisTests.fs | 12 ++++++++++++ 9 files changed, 67 insertions(+), 47 deletions(-) diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs index 2e249cebff..7c0c6220f1 100644 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -2096,7 +2096,7 @@ type IRawFSharpAssemblyData = abstract GetInternalsVisibleToAttributes : ILGlobals -> string list /// The raw IL module definition in the assembly, if any. This is not present for cross-project references /// in the language service - abstract TryGetRawILModule : unit -> ILModuleDef option + abstract TryGetILModuleDef : unit -> ILModuleDef option /// The raw F# signature data in the assembly, if any abstract GetRawFSharpSignatureData : range * ilShortAssemName: string * fileName: string -> (string * byte[]) list /// The raw F# optimization data in the assembly, if any @@ -2334,9 +2334,6 @@ type TcConfigBuilder = isInvalidationSupported : bool /// used to log sqm data - mutable sqmSessionGuid : System.Guid option - mutable sqmNumOfSourceFiles : int - sqmSessionStartedTime : int64 /// if true - every expression in quotations will be augmented with full debug info (filename, location in file) mutable emitDebugInfoInQuotations : bool @@ -2484,9 +2481,6 @@ type TcConfigBuilder = noDebugData = false isInteractive = false isInvalidationSupported = false - sqmSessionGuid = None - sqmNumOfSourceFiles = 0 - sqmSessionStartedTime = System.DateTime.UtcNow.Ticks emitDebugInfoInQuotations = false exename = None copyFSharpCore = CopyFSharpCoreFlag.No @@ -2955,9 +2949,6 @@ type TcConfig private (data : TcConfigBuilder, validate:bool) = member x.isInteractive = data.isInteractive member x.isInvalidationSupported = data.isInvalidationSupported member x.emitDebugInfoInQuotations = data.emitDebugInfoInQuotations - member x.sqmSessionGuid = data.sqmSessionGuid - member x.sqmNumOfSourceFiles = data.sqmNumOfSourceFiles - member x.sqmSessionStartedTime = data.sqmSessionStartedTime member x.copyFSharpCore = data.copyFSharpCore member x.shadowCopyReferences = data.shadowCopyReferences member x.tryGetMetadataSnapshot = data.tryGetMetadataSnapshot @@ -3834,7 +3825,7 @@ type RawFSharpAssemblyDataBackedByFileOnDisk (ilModule: ILModuleDef, ilAssemblyR interface IRawFSharpAssemblyData with member __.GetAutoOpenAttributes(ilg) = GetAutoOpenAttributes ilg ilModule member __.GetInternalsVisibleToAttributes(ilg) = GetInternalsVisibleToAttributes ilg ilModule - member __.TryGetRawILModule() = Some ilModule + member __.TryGetILModuleDef() = Some ilModule member __.GetRawFSharpSignatureData(m, ilShortAssemName, filename) = let resources = ilModule.Resources.AsList let sigDataReaders = @@ -4102,6 +4093,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti FileName = Some fileName MemberSignatureEquality = (fun ty1 ty2 -> Tastops.typeEquivAux EraseAll g ty1 ty2) ImportProvidedType = (fun ty -> Import.ImportProvidedType (tcImports.GetImportMap()) m ty) + TryGetILModuleDef = (fun () -> Some ilModule) TypeForwarders = Map.empty } let ccu = CcuThunk.Create(ilShortAssemName, ccuData) @@ -4404,8 +4396,8 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti member tcImports.PrepareToImportReferencedILAssembly (ctok, m, filename, dllinfo:ImportedBinary) = CheckDisposed() let tcConfig = tcConfigP.Get(ctok) - assert dllinfo.RawMetadata.TryGetRawILModule().IsSome - let ilModule = dllinfo.RawMetadata.TryGetRawILModule().Value + assert dllinfo.RawMetadata.TryGetILModuleDef().IsSome + let ilModule = dllinfo.RawMetadata.TryGetILModuleDef().Value let ilScopeRef = dllinfo.ILScopeRef let aref = match ilScopeRef with @@ -4453,7 +4445,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti let ccuRawDataAndInfos = ilModule.GetRawFSharpSignatureData(m, ilShortAssemName, filename) |> List.map (fun (ccuName, sigDataReader) -> - let data = GetSignatureData (filename, ilScopeRef, ilModule.TryGetRawILModule(), sigDataReader) + let data = GetSignatureData (filename, ilScopeRef, ilModule.TryGetILModuleDef(), sigDataReader) let optDatas = Map.ofList optDataReaders @@ -4478,6 +4470,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti IsProviderGenerated = false ImportProvidedType = (fun ty -> Import.ImportProvidedType (tcImports.GetImportMap()) m ty) #endif + TryGetILModuleDef = ilModule.TryGetILModuleDef UsesFSharp20PlusQuotations = minfo.usesQuotations MemberSignatureEquality= (fun ty1 ty2 -> Tastops.typeEquivAux EraseAll (tcImports.GetTcGlobals()) ty1 ty2) TypeForwarders = ImportILAssemblyTypeForwarders(tcImports.GetImportMap, m, ilModule.GetRawTypeForwarders()) } @@ -4491,7 +4484,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti if verbose then dprintf "*** no optimization data for CCU %s, was DLL compiled with --no-optimization-data??\n" ccuName None | Some info -> - let data = GetOptimizationData (filename, ilScopeRef, ilModule.TryGetRawILModule(), info) + let data = GetOptimizationData (filename, ilScopeRef, ilModule.TryGetILModuleDef(), info) let res = data.OptionalFixup(fun nm -> availableToOptionalCcu(tcImports.FindCcu(ctok, m, nm, lookupOnly=false))) if verbose then dprintf "found optimization data for CCU %s\n" ccuName Some res) @@ -4508,7 +4501,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti ILScopeRef = ilScopeRef } let phase2() = #if !NO_EXTENSIONTYPING - match ilModule.TryGetRawILModule() with + match ilModule.TryGetILModuleDef() with | None -> () // no type providers can be used without a real IL Module present | Some ilModule -> ccuinfo.TypeProviders <- tcImports.ImportTypeProviderExtensions (ctok, tcConfig, filename, ilScopeRef, ilModule.ManifestOfAssembly.CustomAttrs.AsList, ccu.Contents, invalidateCcu, m) @@ -5376,6 +5369,7 @@ let GetInitialTcState(m, ccuName, tcConfig:TcConfig, tcGlobals, tcImports:TcImpo IsProviderGenerated = false ImportProvidedType = (fun ty -> Import.ImportProvidedType (tcImports.GetImportMap()) m ty) #endif + TryGetILModuleDef = (fun () -> None) FileName=None Stamp = newStamp() QualifiedName= None diff --git a/src/fsharp/CompileOps.fsi b/src/fsharp/CompileOps.fsi index d749739f18..0b40471266 100755 --- a/src/fsharp/CompileOps.fsi +++ b/src/fsharp/CompileOps.fsi @@ -145,7 +145,7 @@ type IRawFSharpAssemblyData = abstract GetInternalsVisibleToAttributes: ILGlobals -> string list /// The raw IL module definition in the assembly, if any. This is not present for cross-project references /// in the language service - abstract TryGetRawILModule: unit -> ILModuleDef option + abstract TryGetILModuleDef: unit -> ILModuleDef option abstract HasAnyFSharpSignatureDataAttribute: bool abstract HasMatchingFSharpSignatureDataAttribute: ILGlobals -> bool /// The raw F# signature data in the assembly, if any @@ -355,9 +355,6 @@ type TcConfigBuilder = /// If true, indicates all type checking and code generation is in the context of fsi.exe isInteractive: bool isInvalidationSupported: bool - mutable sqmSessionGuid: System.Guid option - mutable sqmNumOfSourceFiles: int - sqmSessionStartedTime: int64 mutable emitDebugInfoInQuotations: bool mutable exename: string option mutable copyFSharpCore: CopyFSharpCoreFlag @@ -524,9 +521,6 @@ type TcConfig = /// File system query based on TcConfig settings member MakePathAbsolute: string -> string - member sqmSessionGuid: System.Guid option - member sqmNumOfSourceFiles: int - member sqmSessionStartedTime: int64 member copyFSharpCore: CopyFSharpCoreFlag member shadowCopyReferences: bool static member Create: TcConfigBuilder * validate: bool -> TcConfig diff --git a/src/fsharp/CompileOptions.fs b/src/fsharp/CompileOptions.fs index 871eb5ea17..5969e38fc8 100644 --- a/src/fsharp/CompileOptions.fs +++ b/src/fsharp/CompileOptions.fs @@ -851,16 +851,16 @@ let testFlag tcConfigB = let vsSpecificFlags (tcConfigB: TcConfigBuilder) = [ CompilerOption("vserrors", tagNone, OptionUnit (fun () -> tcConfigB.errorStyle <- ErrorStyle.VSErrors), None, None) CompilerOption("validate-type-providers", tagNone, OptionUnit (id), None, None) // preserved for compatibility's sake, no longer has any effect - CompilerOption("LCID", tagInt, OptionInt (fun _n -> ()), None, None) + CompilerOption("LCID", tagInt, OptionInt ignore, None, None) CompilerOption("flaterrors", tagNone, OptionUnit (fun () -> tcConfigB.flatErrors <- true), None, None) - CompilerOption("sqmsessionguid", tagNone, OptionString (fun s -> tcConfigB.sqmSessionGuid <- try System.Guid(s) |> Some with e -> None), None, None) + CompilerOption("sqmsessionguid", tagNone, OptionString ignore, None, None) CompilerOption("gccerrors", tagNone, OptionUnit (fun () -> tcConfigB.errorStyle <- ErrorStyle.GccErrors), None, None) CompilerOption("exename", tagNone, OptionString (fun s -> tcConfigB.exename <- Some(s)), None, None) CompilerOption("maxerrors", tagInt, OptionInt (fun n -> tcConfigB.maxErrors <- n), None, None) ] let internalFlags (tcConfigB:TcConfigBuilder) = [ - CompilerOption("stamps", tagNone, OptionUnit (fun () -> ()), Some(InternalCommandLineOption("--stamps", rangeCmdArgs)), None) + CompilerOption("stamps", tagNone, OptionUnit ignore, Some(InternalCommandLineOption("--stamps", rangeCmdArgs)), None) CompilerOption("ranges", tagNone, OptionSet Tastops.DebugPrint.layoutRanges, Some(InternalCommandLineOption("--ranges", rangeCmdArgs)), None) CompilerOption("terms" , tagNone, OptionUnit (fun () -> tcConfigB.showTerms <- true), Some(InternalCommandLineOption("--terms", rangeCmdArgs)), None) CompilerOption("termsfile" , tagNone, OptionUnit (fun () -> tcConfigB.writeTermsToFiles <- true), Some(InternalCommandLineOption("--termsfile", rangeCmdArgs)), None) diff --git a/src/fsharp/fsc.fs b/src/fsharp/fsc.fs index 333a1d30a6..c4c9357ed6 100644 --- a/src/fsharp/fsc.fs +++ b/src/fsharp/fsc.fs @@ -168,10 +168,6 @@ type DisposablesTracker() = try i.Dispose() with _ -> () -//---------------------------------------------------------------------------- -// TypeCheck, AdjustForScriptCompile -//---------------------------------------------------------------------------- - let TypeCheck (ctok, tcConfig, tcImports, tcGlobals, errorLogger:ErrorLogger, assemblyName, niceNameGen, tcEnv0, inputs, exiter: Exiter) = try if isNil inputs then error(Error(FSComp.SR.fscNoImplementationFiles(), Range.rangeStartup)) @@ -1346,7 +1342,7 @@ module StaticLinker = | ResolvedCcu ccu -> Some ccu | UnresolvedCcu(_ccuName) -> None - let modul = dllInfo.RawMetadata.TryGetRawILModule().Value + let modul = dllInfo.RawMetadata.TryGetILModuleDef().Value yield (ccu, dllInfo.ILScopeRef, modul), (ilAssemRef.Name, provAssemStaticLinkInfo) | None -> () ] @@ -1714,7 +1710,6 @@ let main0(ctok, argv, legacyReferenceResolver, bannerAlreadyPrinted, reduceMemor delayForFlagsLogger.ForwardDelayedDiagnostics(tcConfigB) exiter.Exit 1 - tcConfigB.sqmNumOfSourceFiles <- sourceFiles.Length tcConfigB.conditionalCompilationDefines <- "COMPILED" :: tcConfigB.conditionalCompilationDefines displayBannerIfNeeded tcConfigB @@ -1823,10 +1818,12 @@ let main0(ctok, argv, legacyReferenceResolver, bannerAlreadyPrinted, reduceMemor Args (ctok, tcGlobals, tcImports, frameworkTcImports, tcState.Ccu, typedAssembly, topAttrs, tcConfig, outfile, pdbfile, assemblyName, errorLogger, exiter) -let main1(Args (ctok, tcGlobals, tcImports: TcImports, frameworkTcImports, generatedCcu, typedImplFiles, topAttrs, tcConfig: TcConfig, outfile, pdbfile, assemblyName, errorLogger, exiter: Exiter)) = +let main1(Args (ctok, tcGlobals, tcImports: TcImports, frameworkTcImports, generatedCcu: CcuThunk, typedImplFiles, topAttrs, tcConfig: TcConfig, outfile, pdbfile, assemblyName, errorLogger, exiter: Exiter)) = if tcConfig.typeCheckOnly then exiter.Exit 0 + generatedCcu.Contents.SetAttribs(generatedCcu.Contents.Attribs @ topAttrs.assemblyAttrs) + use unwindPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.CodeGen let signingInfo = ValidateKeySigningAttributes (tcConfig, tcGlobals, topAttrs) @@ -1872,7 +1869,8 @@ let main1(Args (ctok, tcGlobals, tcImports: TcImports, frameworkTcImports, gener Args (ctok, tcConfig, tcImports, frameworkTcImports, tcGlobals, errorLogger, generatedCcu, outfile, typedImplFiles, topAttrs, pdbfile, assemblyName, assemVerFromAttrib, signingInfo, exiter) -// set up typecheck for given AST without parsing any command line parameters +// This is for the compile-from-AST feature of FCS. +// TODO: consider removing this feature from FCS, which as far as I know is not used by anyone. let main1OfAst (ctok, legacyReferenceResolver, reduceMemoryUsage, assemblyName, target, outfile, pdbFile, dllReferences, noframework, exiter, errorLoggerProvider: ErrorLoggerProvider, inputs : ParsedInput list) = let tryGetMetadataSnapshot = (fun _ -> None) @@ -1893,7 +1891,6 @@ let main1OfAst (ctok, legacyReferenceResolver, reduceMemoryUsage, assemblyName, | None -> OptionSwitch.Off) SetTailcallSwitch tcConfigB OptionSwitch.On tcConfigB.target <- target - tcConfigB.sqmNumOfSourceFiles <- 1 let errorLogger = errorLoggerProvider.CreateErrorLoggerUpToMaxErrors (tcConfigB, exiter) @@ -1930,6 +1927,7 @@ let main1OfAst (ctok, legacyReferenceResolver, reduceMemoryUsage, assemblyName, TypeCheck(ctok, tcConfig, tcImports, tcGlobals, errorLogger, assemblyName, NiceNameGenerator(), tcEnv0, inputs,exiter) let generatedCcu = tcState.Ccu + generatedCcu.Contents.SetAttribs(generatedCcu.Contents.Attribs @ topAttrs.assemblyAttrs) use unwindPhase = PushThreadBuildPhaseUntilUnwind (BuildPhase.CodeGen) let signingInfo = ValidateKeySigningAttributes (tcConfig, tcGlobals, topAttrs) @@ -1972,7 +1970,7 @@ let main2a(Args (ctok, tcConfig, tcImports, frameworkTcImports: TcImports, tcGlo let metadataVersion = match tcConfig.metadataVersion with | Some v -> v - | _ -> match (frameworkTcImports.DllTable.TryFind tcConfig.primaryAssembly.Name) with | Some ib -> ib.RawMetadata.TryGetRawILModule().Value.MetadataVersion | _ -> "" + | _ -> match (frameworkTcImports.DllTable.TryFind tcConfig.primaryAssembly.Name) with | Some ib -> ib.RawMetadata.TryGetILModuleDef().Value.MetadataVersion | _ -> "" let optimizedImpls, optimizationData, _ = ApplyAllOptimizations (tcConfig, tcGlobals, (LightweightTcValForUsingInBuildMethodCall tcGlobals), outfile, importMap, false, optEnv0, generatedCcu, typedImplFiles) AbortOnError(errorLogger, exiter) diff --git a/src/fsharp/import.fs b/src/fsharp/import.fs index 41c27fd289..f4471be002 100644 --- a/src/fsharp/import.fs +++ b/src/fsharp/import.fs @@ -553,10 +553,10 @@ let ImportILAssemblyTypeForwarders (amap, m, exportedTypes:ILExportedTypesAndFor /// Import an IL assembly as a new TAST CCU -let ImportILAssembly(amap:(unit -> ImportMap),m,auxModuleLoader,sref,sourceDir,filename,ilModule:ILModuleDef,invalidateCcu:IEvent) = +let ImportILAssembly(amap:(unit -> ImportMap), m, auxModuleLoader, ilScopeRef, sourceDir, filename, ilModule:ILModuleDef, invalidateCcu:IEvent) = invalidateCcu |> ignore let aref = - match sref with + match ilScopeRef with | ILScopeRef.Assembly aref -> aref | _ -> error(InternalError("ImportILAssembly: cannot reference .NET netmodules directly, reference the containing assembly instead",m)) let nm = aref.Name @@ -569,13 +569,14 @@ let ImportILAssembly(amap:(unit -> ImportMap),m,auxModuleLoader,sref,sourceDir,f IsProviderGenerated = false ImportProvidedType = (fun ty -> ImportProvidedType (amap()) m ty) #endif - QualifiedName= Some sref.QualifiedName - Contents = NewCcuContents sref m nm mty - ILScopeRef = sref + QualifiedName= Some ilScopeRef.QualifiedName + Contents = NewCcuContents ilScopeRef m nm mty + ILScopeRef = ilScopeRef Stamp = newStamp() SourceCodeDirectory = sourceDir // note: not an accurate value, but IL assemblies don't give us this information in any attributes. FileName = filename MemberSignatureEquality= (fun ty1 ty2 -> Tastops.typeEquivAux EraseAll (amap()).g ty1 ty2) + TryGetILModuleDef = (fun () -> Some ilModule) TypeForwarders = (match ilModule.Manifest with | None -> Map.empty diff --git a/src/fsharp/service/IncrementalBuild.fs b/src/fsharp/service/IncrementalBuild.fs index 6f794fef9b..f1977599a2 100755 --- a/src/fsharp/service/IncrementalBuild.fs +++ b/src/fsharp/service/IncrementalBuild.fs @@ -1176,7 +1176,7 @@ type RawFSharpAssemblyDataBackedByLanguageService (tcConfig, tcGlobals, tcState: interface IRawFSharpAssemblyData with member __.GetAutoOpenAttributes(_ilg) = autoOpenAttrs member __.GetInternalsVisibleToAttributes(_ilg) = ivtAttrs - member __.TryGetRawILModule() = None + member __.TryGetILModuleDef() = None member __.GetRawFSharpSignatureData(_m, _ilShortAssemName, _filename) = sigData member __.GetRawFSharpOptimizationData(_m, _ilShortAssemName, _filename) = [ ] member __.GetRawTypeForwarders() = mkILExportedTypes [] // TODO: cross-project references with type forwarders diff --git a/src/fsharp/symbols/Symbols.fs b/src/fsharp/symbols/Symbols.fs index e48f116b92..a21b26650b 100644 --- a/src/fsharp/symbols/Symbols.fs +++ b/src/fsharp/symbols/Symbols.fs @@ -2173,11 +2173,25 @@ and FSharpAssemblySignature private (cenv, topAttribs: TypeChecker.TopAttribs op loop mtyp |> makeReadOnlyCollection member __.Attributes = - match topAttribs with - | None -> makeReadOnlyCollection [] - | Some tA -> - tA.assemblyAttrs - |> List.map (fun a -> FSharpAttribute(cenv, AttribInfo.FSAttribInfo(cenv.g, a))) |> makeReadOnlyCollection + [ match optViewedCcu with + | Some ccu -> + match ccu.TryGetILModuleDef() with + | Some ilModule -> + match ilModule.Manifest with + | None -> () + | Some manifest -> + for a in AttribInfosOfIL cenv.g cenv.amap cenv.thisCcu.ILScopeRef range0 manifest.CustomAttrs do + yield FSharpAttribute(cenv, a) + | None -> + // If no module is available, then look in the CCU contents. + if ccu.IsFSharp then + for a in ccu.Contents.Attribs do + yield FSharpAttribute(cenv, FSAttribInfo (cenv.g, a)) + | None -> + match topAttribs with + | None -> () + | Some tA -> for a in tA.assemblyAttrs do yield FSharpAttribute(cenv, AttribInfo.FSAttribInfo(cenv.g, a)) ] + |> makeReadOnlyCollection member __.FindEntityByPath path = let inline findNested name = function diff --git a/src/fsharp/tast.fs b/src/fsharp/tast.fs index dce289d26d..cca16b60a4 100755 --- a/src/fsharp/tast.fs +++ b/src/fsharp/tast.fs @@ -3693,6 +3693,10 @@ and // NOTE: may contain transient state during typechecking mutable Contents: ModuleOrNamespace + /// A helper function used to link method signatures using type equality. This is effectively a forward call to the type equality + /// logic in tastops.fs + TryGetILModuleDef: (unit -> ILModuleDef option) + /// A helper function used to link method signatures using type equality. This is effectively a forward call to the type equality /// logic in tastops.fs MemberSignatureEquality : (TType -> TType -> bool) @@ -3765,6 +3769,9 @@ and CcuThunk = /// Holds the filename for the DLL, if any member ccu.FileName = ccu.Deref.FileName + /// Try to get the .NET Assembly, if known. May not be present for `IsFSharp` for in-memory cross-project references + member ccu.TryGetILModuleDef() = ccu.Deref.TryGetILModuleDef() + #if !NO_EXTENSIONTYPING /// Is the CCu an EST injected assembly member ccu.IsProviderGenerated = ccu.Deref.IsProviderGenerated diff --git a/tests/service/ProjectAnalysisTests.fs b/tests/service/ProjectAnalysisTests.fs index 8586fd2cd8..15435406b9 100644 --- a/tests/service/ProjectAnalysisTests.fs +++ b/tests/service/ProjectAnalysisTests.fs @@ -4726,6 +4726,18 @@ let ``Test project37 typeof and arrays in attribute constructor arguments`` () = |> Seq.map (fun a -> a.AttributeType.CompiledName) |> Array.ofSeq |> shouldEqual [| "AttrTestAttribute"; "AttrTest2Attribute" |] + wholeProjectResults.ProjectContext.GetReferencedAssemblies() + |> Seq.find (fun a -> a.SimpleName = "mscorlib") + |> fun a -> + printfn "Attributes found in mscorlib: %A" a.Contents.Attributes + shouldEqual (a.Contents.Attributes.Count > 0) true + + wholeProjectResults.ProjectContext.GetReferencedAssemblies() + |> Seq.find (fun a -> a.SimpleName = "FSharp.Core") + |> fun a -> + printfn "Attributes found in FSharp.Core: %A" a.Contents.Attributes + shouldEqual (a.Contents.Attributes.Count > 0) true + //----------------------------------------------------------- From 0a4ed8dd4e21dab331d1a68e417858cec97a9106 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 23 Mar 2018 15:08:23 +0000 Subject: [PATCH 144/147] fix build --- NuGet.config | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 NuGet.config diff --git a/NuGet.config b/NuGet.config new file mode 100644 index 0000000000..f4c19635b0 --- /dev/null +++ b/NuGet.config @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file From df35c9126597d587c2c7d8e56d82a86a777b695c Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 23 Mar 2018 15:20:16 +0000 Subject: [PATCH 145/147] bump version --- fcs/README.md | 6 +++--- fcs/RELEASE_NOTES.md | 4 ++++ fcs/build.fsx | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/fcs/README.md b/fcs/README.md index d297185ee6..290012d34e 100644 --- a/fcs/README.md +++ b/fcs/README.md @@ -60,9 +60,9 @@ which does things like: Yu can push the packages if you have permissions, either automatically using ``build Release`` or manually set APIKEY=... - .nuget\nuget.exe push release\fcs\FSharp.Compiler.Service.21.0.1.nupkg %APIKEY% -Source https://nuget.org - .nuget\nuget.exe push release\fcs\FSharp.Compiler.Service.MSBuild.v12.21.0.1.nupkg %APIKEY% -Source https://nuget.org - .nuget\nuget.exe push release\fcs\FSharp.Compiler.Service.ProjectCracker.21.0.1.nupkg %APIKEY% -Source https://nuget.org + .nuget\nuget.exe push release\fcs\FSharp.Compiler.Service.22.0.1.nupkg %APIKEY% -Source https://nuget.org + .nuget\nuget.exe push release\fcs\FSharp.Compiler.Service.MSBuild.v12.22.0.1.nupkg %APIKEY% -Source https://nuget.org + .nuget\nuget.exe push release\fcs\FSharp.Compiler.Service.ProjectCracker.22.0.1.nupkg %APIKEY% -Source https://nuget.org ### Use of Paket and FAKE diff --git a/fcs/RELEASE_NOTES.md b/fcs/RELEASE_NOTES.md index 4708e1f2b8..0d83971b13 100644 --- a/fcs/RELEASE_NOTES.md +++ b/fcs/RELEASE_NOTES.md @@ -1,3 +1,7 @@ +#### 22.0.1 + * Integrate visualfsharp master + * Includes recent memory usage reduction work for ByteFile and ILAttributes + #### 21.0.1 * Use new .NET SDK project files * FSharp.Compiler.Service nuget now uses net45 and netstandard2.0 diff --git a/fcs/build.fsx b/fcs/build.fsx index 12a7940393..79c214683c 100644 --- a/fcs/build.fsx +++ b/fcs/build.fsx @@ -21,7 +21,7 @@ let isMono = false #endif -let dotnetExePath = DotNetCli.InstallDotNetSDK "2.1.100" +let dotnetExePath = DotNetCli.InstallDotNetSDK "2.1.102" let runDotnet workingDir args = let result = From f66ae1a27c99da62eab2cbd531b190082387ffaa Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 23 Mar 2018 15:43:39 +0000 Subject: [PATCH 146/147] fix build --- fcs/fcs.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fcs/fcs.props b/fcs/fcs.props index c3e2198b38..646b8ccbf9 100644 --- a/fcs/fcs.props +++ b/fcs/fcs.props @@ -3,7 +3,7 @@ - 21.0.1 + 22.0.1 $(FSharpSourcesRoot)\..\packages\FSharp.Compiler.Tools.4.1.27\tools From 2c55887c7dec01eb4351964fc33ffccafe37f162 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 23 Mar 2018 16:28:33 +0000 Subject: [PATCH 147/147] fix capitalization --- NuGet.config => NuGet.Config | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename NuGet.config => NuGet.Config (100%) diff --git a/NuGet.config b/NuGet.Config similarity index 100% rename from NuGet.config rename to NuGet.Config