From f2be9e4303b87363fbde8f670699a634ec9a9cc7 Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Fri, 29 Mar 2019 03:56:46 +0300 Subject: [PATCH 001/159] Move SourceText: Microsoft.FSharp -> FSharp (#6356) --- fcs/samples/EditorService/Program.fs | 2 +- fcs/samples/UntypedTree/Program.fs | 2 +- src/fsharp/CompileOps.fs | 3 +-- src/fsharp/CompileOps.fsi | 2 +- src/fsharp/NameResolution.fs | 2 +- src/fsharp/NameResolution.fsi | 2 +- src/fsharp/UnicodeLexing.fsi | 2 +- src/fsharp/fsi/fsi.fs | 2 +- src/fsharp/service/ServiceXmlDocParser.fs | 2 +- src/fsharp/service/ServiceXmlDocParser.fsi | 2 +- src/fsharp/service/service.fs | 2 +- src/fsharp/service/service.fsi | 2 +- src/utils/prim-lexing.fs | 4 ++-- src/utils/prim-lexing.fsi | 4 ++-- tests/FSharp.Compiler.UnitTests/Compiler.fs | 2 +- .../SourceTextTests.fs | 2 +- tests/service/AssemblyContentProviderTests.fs | 2 +- tests/service/AssemblyReaderShim.fs | 2 +- tests/service/Common.fs | 12 +++++----- tests/service/EditorTests.fs | 4 ++-- tests/service/MultiProjectAnalysisTests.fs | 4 ++-- tests/service/PerfTests.fs | 2 +- tests/service/ProjectAnalysisTests.fs | 22 +++++++++---------- tests/service/ProjectOptionsTests.fs | 6 ++--- .../Utils/LanguageServiceProfiling/Program.fs | 2 +- .../CodeFix/ReplaceWithSuggestion.fs | 1 - .../src/FSharp.Editor/Common/Extensions.fs | 2 +- .../BackgroundRequests.fs | 2 +- .../FSharp.LanguageService/FSharpSource.fs | 2 +- vsintegration/tests/Salsa/salsa.fs | 2 +- .../tests/UnitTests/RoslynSourceTextTests.fs | 2 +- .../tests/UnitTests/UnusedOpensTests.fs | 2 +- 32 files changed, 52 insertions(+), 54 deletions(-) diff --git a/fcs/samples/EditorService/Program.fs b/fcs/samples/EditorService/Program.fs index 9b78407545..e3ab70185c 100644 --- a/fcs/samples/EditorService/Program.fs +++ b/fcs/samples/EditorService/Program.fs @@ -8,7 +8,7 @@ open FSharp.Compiler.QuickParse let checker = FSharpChecker.Create() let parseWithTypeInfo (file, input) = - let input = Microsoft.FSharp.Compiler.Text.SourceText.ofString input + let input = FSharp.Compiler.Text.SourceText.ofString input let checkOptions, _errors = checker.GetProjectOptionsFromScript(file, input) |> Async.RunSynchronously let parsingOptions, _errors = checker.GetParsingOptionsFromProjectOptions(checkOptions) let untypedRes = checker.ParseFile(file, input, parsingOptions) |> Async.RunSynchronously diff --git a/fcs/samples/UntypedTree/Program.fs b/fcs/samples/UntypedTree/Program.fs index 064f22b5ab..ba6afb2dd2 100644 --- a/fcs/samples/UntypedTree/Program.fs +++ b/fcs/samples/UntypedTree/Program.fs @@ -11,7 +11,7 @@ let checker = FSharpChecker.Create() // Get untyped tree for a specified input let getUntypedTree (file, input) = let parsingOptions = { FSharpParsingOptions.Default with SourceFiles = [| file |] } - let untypedRes = checker.ParseFile(file, Microsoft.FSharp.Compiler.Text.SourceText.ofString input, parsingOptions) |> Async.RunSynchronously + let untypedRes = checker.ParseFile(file, FSharp.Compiler.Text.SourceText.ofString input, parsingOptions) |> Async.RunSynchronously match untypedRes.ParseTree with | Some tree -> tree | None -> failwith "Something went wrong during parsing!" diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs index 4a525b9597..7744d7d820 100644 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -44,8 +44,7 @@ open FSharp.Compiler.TypeChecker open FSharp.Compiler.Tast open FSharp.Compiler.Tastops open FSharp.Compiler.TcGlobals - -open Microsoft.FSharp.Compiler.Text +open FSharp.Compiler.Text #if !NO_EXTENSIONTYPING open FSharp.Compiler.ExtensionTyping diff --git a/src/fsharp/CompileOps.fsi b/src/fsharp/CompileOps.fsi index d8e05b2d7e..c3d88bb4a1 100755 --- a/src/fsharp/CompileOps.fsi +++ b/src/fsharp/CompileOps.fsi @@ -17,7 +17,7 @@ open FSharp.Compiler.Ast open FSharp.Compiler.ErrorLogger open FSharp.Compiler.Tast open FSharp.Compiler.TcGlobals -open Microsoft.FSharp.Compiler.Text +open FSharp.Compiler.Text open Microsoft.FSharp.Core.CompilerServices #if !NO_EXTENSIONTYPING open FSharp.Compiler.ExtensionTyping diff --git a/src/fsharp/NameResolution.fs b/src/fsharp/NameResolution.fs index f179c42099..8e4932d599 100644 --- a/src/fsharp/NameResolution.fs +++ b/src/fsharp/NameResolution.fs @@ -23,7 +23,7 @@ open FSharp.Compiler.AccessibilityLogic open FSharp.Compiler.AttributeChecking open FSharp.Compiler.InfoReader open FSharp.Compiler.PrettyNaming -open Microsoft.FSharp.Compiler.Text +open FSharp.Compiler.Text open System.Collections.Generic #if !NO_EXTENSIONTYPING diff --git a/src/fsharp/NameResolution.fsi b/src/fsharp/NameResolution.fsi index 7fe26f4ad6..4eff7f1563 100755 --- a/src/fsharp/NameResolution.fsi +++ b/src/fsharp/NameResolution.fsi @@ -14,7 +14,7 @@ open FSharp.Compiler.Tastops open FSharp.Compiler.TcGlobals open FSharp.Compiler.AbstractIL.Internal.Library open FSharp.Compiler.PrettyNaming -open Microsoft.FSharp.Compiler.Text +open FSharp.Compiler.Text /// A NameResolver is a context for name resolution. It primarily holds an InfoReader. type NameResolver = diff --git a/src/fsharp/UnicodeLexing.fsi b/src/fsharp/UnicodeLexing.fsi index 6eda4ea8ae..7c0f0fb68d 100644 --- a/src/fsharp/UnicodeLexing.fsi +++ b/src/fsharp/UnicodeLexing.fsi @@ -2,7 +2,7 @@ module internal FSharp.Compiler.UnicodeLexing -open Microsoft.FSharp.Compiler.Text +open FSharp.Compiler.Text open Microsoft.FSharp.Text open Internal.Utilities.Text.Lexing diff --git a/src/fsharp/fsi/fsi.fs b/src/fsharp/fsi/fsi.fs index 1652eb079f..42238dd006 100644 --- a/src/fsharp/fsi/fsi.fs +++ b/src/fsharp/fsi/fsi.fs @@ -50,7 +50,7 @@ open FSharp.Compiler.Tastops open FSharp.Compiler.TcGlobals open FSharp.Compiler.SourceCodeServices open FSharp.Compiler.ReferenceResolver -open Microsoft.FSharp.Compiler.Text +open FSharp.Compiler.Text open Internal.Utilities open Internal.Utilities.Collections diff --git a/src/fsharp/service/ServiceXmlDocParser.fs b/src/fsharp/service/ServiceXmlDocParser.fs index ec4c0672bb..7152dd0c13 100644 --- a/src/fsharp/service/ServiceXmlDocParser.fs +++ b/src/fsharp/service/ServiceXmlDocParser.fs @@ -4,7 +4,7 @@ namespace FSharp.Compiler.SourceCodeServices open FSharp.Compiler open FSharp.Compiler.AbstractIL.Internal.Library -open Microsoft.FSharp.Compiler.Text +open FSharp.Compiler.Text /// Represent an Xml documentation block in source code type XmlDocable = diff --git a/src/fsharp/service/ServiceXmlDocParser.fsi b/src/fsharp/service/ServiceXmlDocParser.fsi index c2f8a2f0ee..03a36a7d24 100644 --- a/src/fsharp/service/ServiceXmlDocParser.fsi +++ b/src/fsharp/service/ServiceXmlDocParser.fsi @@ -5,7 +5,7 @@ namespace FSharp.Compiler.SourceCodeServices open FSharp.Compiler open FSharp.Compiler.Range open FSharp.Compiler.Ast -open Microsoft.FSharp.Compiler.Text +open FSharp.Compiler.Text /// Represent an Xml documentation block in source code type public XmlDocable = diff --git a/src/fsharp/service/service.fs b/src/fsharp/service/service.fs index 6dbb35f499..5d772f134e 100644 --- a/src/fsharp/service/service.fs +++ b/src/fsharp/service/service.fs @@ -41,8 +41,8 @@ open FSharp.Compiler.Infos open FSharp.Compiler.InfoReader open FSharp.Compiler.NameResolution open FSharp.Compiler.TypeChecker +open FSharp.Compiler.Text open FSharp.Compiler.SourceCodeServices.SymbolHelpers -open Microsoft.FSharp.Compiler.Text open Internal.Utilities open Internal.Utilities.Collections diff --git a/src/fsharp/service/service.fsi b/src/fsharp/service/service.fsi index 3447c006c0..4547068b51 100755 --- a/src/fsharp/service/service.fsi +++ b/src/fsharp/service/service.fsi @@ -26,7 +26,7 @@ open FSharp.Compiler.Infos open FSharp.Compiler.InfoReader open FSharp.Compiler.Tast open FSharp.Compiler.Tastops -open Microsoft.FSharp.Compiler.Text +open FSharp.Compiler.Text /// Represents the reason why the GetDeclarationLocation operation failed. [] diff --git a/src/utils/prim-lexing.fs b/src/utils/prim-lexing.fs index 938d556c2c..c397257b46 100644 --- a/src/utils/prim-lexing.fs +++ b/src/utils/prim-lexing.fs @@ -2,7 +2,7 @@ #nowarn "47" // recursive initialization of LexBuffer -namespace Microsoft.FSharp.Compiler.Text +namespace FSharp.Compiler.Text open System open System.IO @@ -103,8 +103,8 @@ module SourceText = namespace Internal.Utilities.Text.Lexing + open FSharp.Compiler.Text open Microsoft.FSharp.Core - open Microsoft.FSharp.Compiler.Text open Microsoft.FSharp.Collections open System.Collections.Generic diff --git a/src/utils/prim-lexing.fsi b/src/utils/prim-lexing.fsi index 0544adc340..4b4fd58717 100644 --- a/src/utils/prim-lexing.fsi +++ b/src/utils/prim-lexing.fsi @@ -3,7 +3,7 @@ // LexBuffers are for use with automatically generated lexical analyzers, // in particular those produced by 'fslex'. -namespace Microsoft.FSharp.Compiler.Text +namespace FSharp.Compiler.Text type ISourceText = @@ -36,7 +36,7 @@ module SourceText = namespace Internal.Utilities.Text.Lexing open System.Collections.Generic -open Microsoft.FSharp.Compiler.Text +open FSharp.Compiler.Text open Microsoft.FSharp.Core open Microsoft.FSharp.Control diff --git a/tests/FSharp.Compiler.UnitTests/Compiler.fs b/tests/FSharp.Compiler.UnitTests/Compiler.fs index 9e5e055562..d85aef5b40 100644 --- a/tests/FSharp.Compiler.UnitTests/Compiler.fs +++ b/tests/FSharp.Compiler.UnitTests/Compiler.fs @@ -3,7 +3,7 @@ namespace FSharp.Compiler.UnitTests open System -open Microsoft.FSharp.Compiler.Text +open FSharp.Compiler.Text open FSharp.Compiler.SourceCodeServices open NUnit.Framework diff --git a/tests/FSharp.Compiler.UnitTests/SourceTextTests.fs b/tests/FSharp.Compiler.UnitTests/SourceTextTests.fs index 3754e75ae2..e32647195b 100644 --- a/tests/FSharp.Compiler.UnitTests/SourceTextTests.fs +++ b/tests/FSharp.Compiler.UnitTests/SourceTextTests.fs @@ -5,7 +5,7 @@ namespace FSharp.Compiler.UnitTests open System open NUnit.Framework -open Microsoft.FSharp.Compiler.Text +open FSharp.Compiler.Text [] module SourceTextTests = diff --git a/tests/service/AssemblyContentProviderTests.fs b/tests/service/AssemblyContentProviderTests.fs index 171f558a80..0c0d757907 100644 --- a/tests/service/AssemblyContentProviderTests.fs +++ b/tests/service/AssemblyContentProviderTests.fs @@ -43,7 +43,7 @@ let (=>) (source: string) (expected: string list) = // http://stackoverflow.com/questions/19365404/stringreader-omits-trailing-linebreak yield "" |] - let _, checkFileAnswer = checker.ParseAndCheckFileInProject(filePath, 0, Microsoft.FSharp.Compiler.Text.SourceText.ofString source, projectOptions) |> Async.RunSynchronously + let _, checkFileAnswer = checker.ParseAndCheckFileInProject(filePath, 0, FSharp.Compiler.Text.SourceText.ofString source, projectOptions) |> Async.RunSynchronously let checkFileResults = match checkFileAnswer with diff --git a/tests/service/AssemblyReaderShim.fs b/tests/service/AssemblyReaderShim.fs index faa9963cea..e3512178f0 100644 --- a/tests/service/AssemblyReaderShim.fs +++ b/tests/service/AssemblyReaderShim.fs @@ -29,5 +29,5 @@ let x = 123 """ let fileName, options = Common.mkTestFileAndOptions source [| |] - Common.checker.ParseAndCheckFileInProject(fileName, 0, Microsoft.FSharp.Compiler.Text.SourceText.ofString source, options) |> Async.RunSynchronously |> ignore + Common.checker.ParseAndCheckFileInProject(fileName, 0, FSharp.Compiler.Text.SourceText.ofString source, options) |> Async.RunSynchronously |> ignore gotRequest |> should be True diff --git a/tests/service/Common.fs b/tests/service/Common.fs index f6a2f4a6ad..0ec9aa2ab3 100644 --- a/tests/service/Common.fs +++ b/tests/service/Common.fs @@ -57,13 +57,13 @@ type TempFile(ext, contents) = let getBackgroundParseResultsForScriptText (input) = use file = new TempFile("fsx", input) - let checkOptions, _diagnostics = checker.GetProjectOptionsFromScript(file.Name, Microsoft.FSharp.Compiler.Text.SourceText.ofString input) |> Async.RunSynchronously + let checkOptions, _diagnostics = checker.GetProjectOptionsFromScript(file.Name, FSharp.Compiler.Text.SourceText.ofString input) |> Async.RunSynchronously checker.GetBackgroundParseResultsForFileInProject(file.Name, checkOptions) |> Async.RunSynchronously let getBackgroundCheckResultsForScriptText (input) = use file = new TempFile("fsx", input) - let checkOptions, _diagnostics = checker.GetProjectOptionsFromScript(file.Name, Microsoft.FSharp.Compiler.Text.SourceText.ofString input) |> Async.RunSynchronously + let checkOptions, _diagnostics = checker.GetProjectOptionsFromScript(file.Name, FSharp.Compiler.Text.SourceText.ofString input) |> Async.RunSynchronously checker.GetBackgroundCheckResultsForFileInProject(file.Name, checkOptions) |> Async.RunSynchronously @@ -167,7 +167,7 @@ let mkTestFileAndOptions source additionalArgs = fileName, options let parseAndCheckFile fileName source options = - match checker.ParseAndCheckFileInProject(fileName, 0, Microsoft.FSharp.Compiler.Text.SourceText.ofString source, options) |> Async.RunSynchronously with + match checker.ParseAndCheckFileInProject(fileName, 0, FSharp.Compiler.Text.SourceText.ofString source, options) |> Async.RunSynchronously with | parseResults, FSharpCheckFileAnswer.Succeeded(checkResults) -> parseResults, checkResults | _ -> failwithf "Parsing aborted unexpectedly..." @@ -181,11 +181,11 @@ let parseAndCheckScript (file, input) = let projectOptions = checker.GetProjectOptionsFromCommandLineArgs (projName, args) #else - let projectOptions, _diagnostics = checker.GetProjectOptionsFromScript(file, Microsoft.FSharp.Compiler.Text.SourceText.ofString input) |> Async.RunSynchronously + let projectOptions, _diagnostics = checker.GetProjectOptionsFromScript(file, FSharp.Compiler.Text.SourceText.ofString input) |> Async.RunSynchronously printfn "projectOptions = %A" projectOptions #endif - let parseResult, typedRes = checker.ParseAndCheckFileInProject(file, 0, Microsoft.FSharp.Compiler.Text.SourceText.ofString input, projectOptions) |> Async.RunSynchronously + let parseResult, typedRes = checker.ParseAndCheckFileInProject(file, 0, FSharp.Compiler.Text.SourceText.ofString input, projectOptions) |> Async.RunSynchronously // if parseResult.Errors.Length > 0 then // printfn "---> Parse Input = %A" input @@ -203,7 +203,7 @@ let parseSourceCode (name: string, code: string) = let dllPath = Path.Combine(location, name + ".dll") let args = mkProjectCommandLineArgs(dllPath, [filePath]) let options, errors = checker.GetParsingOptionsFromCommandLineArgs(List.ofArray args) - let parseResults = checker.ParseFile(filePath, Microsoft.FSharp.Compiler.Text.SourceText.ofString code, options) |> Async.RunSynchronously + let parseResults = checker.ParseFile(filePath, FSharp.Compiler.Text.SourceText.ofString code, options) |> Async.RunSynchronously parseResults.ParseTree /// Extract range info diff --git a/tests/service/EditorTests.fs b/tests/service/EditorTests.fs index fad47bd0d8..949040441f 100644 --- a/tests/service/EditorTests.fs +++ b/tests/service/EditorTests.fs @@ -122,8 +122,8 @@ let ``Basic cancellation test`` () = let file = "/home/user/Test.fsx" async { checker.ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients() - let! checkOptions, _diagnostics = checker.GetProjectOptionsFromScript(file, Microsoft.FSharp.Compiler.Text.SourceText.ofString input) - let! parseResult, typedRes = checker.ParseAndCheckFileInProject(file, 0, Microsoft.FSharp.Compiler.Text.SourceText.ofString input, checkOptions) + let! checkOptions, _diagnostics = checker.GetProjectOptionsFromScript(file, FSharp.Compiler.Text.SourceText.ofString input) + let! parseResult, typedRes = checker.ParseAndCheckFileInProject(file, 0, FSharp.Compiler.Text.SourceText.ofString input, checkOptions) return parseResult, typedRes } |> Async.RunSynchronously |> ignore diff --git a/tests/service/MultiProjectAnalysisTests.fs b/tests/service/MultiProjectAnalysisTests.fs index 1fe2efb8e0..51c06808eb 100644 --- a/tests/service/MultiProjectAnalysisTests.fs +++ b/tests/service/MultiProjectAnalysisTests.fs @@ -913,7 +913,7 @@ let ``Type provider project references should not throw exceptions`` () = //printfn "options: %A" options let fileName = __SOURCE_DIRECTORY__ + @"/data/TypeProviderConsole/Program.fs" let fileSource = File.ReadAllText(fileName) - let fileParseResults, fileCheckAnswer = checker.ParseAndCheckFileInProject(fileName, 0, Microsoft.FSharp.Compiler.Text.SourceText.ofString fileSource, options) |> Async.RunSynchronously + let fileParseResults, fileCheckAnswer = checker.ParseAndCheckFileInProject(fileName, 0, FSharp.Compiler.Text.SourceText.ofString fileSource, options) |> Async.RunSynchronously let fileCheckResults = match fileCheckAnswer with | FSharpCheckFileAnswer.Succeeded(res) -> res @@ -1010,7 +1010,7 @@ let ``Projects creating generated types should not utilize cross-project-referen //printfn "options: %A" options let fileName = __SOURCE_DIRECTORY__ + @"/data/TypeProvidersBug/TestConsole/Program.fs" let fileSource = File.ReadAllText(fileName) - let fileParseResults, fileCheckAnswer = checker.ParseAndCheckFileInProject(fileName, 0, Microsoft.FSharp.Compiler.Text.SourceText.ofString fileSource, options) |> Async.RunSynchronously + let fileParseResults, fileCheckAnswer = checker.ParseAndCheckFileInProject(fileName, 0, FSharp.Compiler.Text.SourceText.ofString fileSource, options) |> Async.RunSynchronously let fileCheckResults = match fileCheckAnswer with | FSharpCheckFileAnswer.Succeeded(res) -> res diff --git a/tests/service/PerfTests.fs b/tests/service/PerfTests.fs index c5bd78f340..7e97f92398 100644 --- a/tests/service/PerfTests.fs +++ b/tests/service/PerfTests.fs @@ -31,7 +31,7 @@ module internal Project1 = let projFileName = Path.ChangeExtension(base2, ".fsproj") let fileSources = [ for (i,f) in fileNamesI -> (f, "module M" + string i) ] for (f,text) in fileSources do File.WriteAllText(f, text) - let fileSources2 = [ for (i,f) in fileSources -> Microsoft.FSharp.Compiler.Text.SourceText.ofString f ] + let fileSources2 = [ for (i,f) in fileSources -> FSharp.Compiler.Text.SourceText.ofString f ] let fileNames = [ for (_,f) in fileNamesI -> f ] let args = mkProjectCommandLineArgs (dllName, fileNames) diff --git a/tests/service/ProjectAnalysisTests.fs b/tests/service/ProjectAnalysisTests.fs index afcb05ee83..37bef3c9c2 100644 --- a/tests/service/ProjectAnalysisTests.fs +++ b/tests/service/ProjectAnalysisTests.fs @@ -39,7 +39,7 @@ let fff () = xxx + xxx type CAbbrev = C """ - let fileSource1 = Microsoft.FSharp.Compiler.Text.SourceText.ofString fileSource1Text + let fileSource1 = FSharp.Compiler.Text.SourceText.ofString fileSource1Text File.WriteAllText(fileName1, fileSource1Text) let fileSource2Text = """ @@ -84,7 +84,7 @@ let mmmm1 : M.C = new M.C() // note, these don't count as uses of CA let mmmm2 : M.CAbbrev = new M.CAbbrev() // note, these don't count as uses of C """ - let fileSource2 = Microsoft.FSharp.Compiler.Text.SourceText.ofString fileSource2Text + let fileSource2 = FSharp.Compiler.Text.SourceText.ofString fileSource2Text File.WriteAllText(fileName2, fileSource2Text) let fileNames = [fileName1; fileName2] @@ -2429,7 +2429,7 @@ and F = { Field1 : int; Field2 : int } and G = Case1 | Case2 of int """ - let fileSource1 = Microsoft.FSharp.Compiler.Text.SourceText.ofString fileSource1Text + let fileSource1 = FSharp.Compiler.Text.SourceText.ofString fileSource1Text File.WriteAllText(fileName1, fileSource1Text) let sigFileSource1Text = """ @@ -2451,7 +2451,7 @@ and F = { Field1 : int; Field2 : int } and G = Case1 | Case2 of int """ - let sigFileSource1 = Microsoft.FSharp.Compiler.Text.SourceText.ofString sigFileSource1Text + let sigFileSource1 = FSharp.Compiler.Text.SourceText.ofString sigFileSource1Text File.WriteAllText(sigFileName1, sigFileSource1Text) let cleanFileName a = if a = fileName1 then "file1" elif a = sigFileName1 then "sig1" else "??" @@ -4514,7 +4514,7 @@ module internal Project35b = #r "System.dll" #r "notexist.dll" """ - let fileSource1 = Microsoft.FSharp.Compiler.Text.SourceText.ofString fileSource1Text + let fileSource1 = FSharp.Compiler.Text.SourceText.ofString fileSource1Text File.WriteAllText(fileName1, fileSource1Text) let cleanFileName a = if a = fileName1 then "file1" else "??" @@ -5158,7 +5158,7 @@ module internal ProjectBig = let projFileName = Path.ChangeExtension(base2, ".fsproj") let fileSources = [ for (i,f) in fileNamesI -> (f, "module M" + string i) ] for (f,text) in fileSources do File.WriteAllText(f, text) - let fileSources2 = [ for (i,f) in fileSources -> Microsoft.FSharp.Compiler.Text.SourceText.ofString f ] + let fileSources2 = [ for (i,f) in fileSources -> FSharp.Compiler.Text.SourceText.ofString f ] let fileNames = [ for (_,f) in fileNamesI -> f ] let args = mkProjectCommandLineArgs (dllName, fileNames) @@ -5246,7 +5246,7 @@ module M # 10 "Test.fsy" let x = (1 = 3.0) """ - let fileSource1 = Microsoft.FSharp.Compiler.Text.SourceText.ofString fileSource1Text + let fileSource1 = FSharp.Compiler.Text.SourceText.ofString fileSource1Text File.WriteAllText(fileName1, fileSource1Text) let fileNames = [fileName1] let args = mkProjectCommandLineArgs (dllName, fileNames) @@ -5287,7 +5287,7 @@ let ``ParseAndCheckFileResults contains ImplFile list if FSharpChecker is create type A(i:int) = member x.Value = i """ - let fileSource1 = Microsoft.FSharp.Compiler.Text.SourceText.ofString fileSource1Text + let fileSource1 = FSharp.Compiler.Text.SourceText.ofString fileSource1Text File.WriteAllText(fileName1, fileSource1Text) let fileNames = [fileName1] @@ -5378,7 +5378,7 @@ type UseTheThings(i:int) = member x.UseSomeUsedModuleContainingExtensionMember() = (3).Q member x.UseSomeUsedModuleContainingUnion() = A """ - let fileSource1 = Microsoft.FSharp.Compiler.Text.SourceText.ofString fileSource1Text + let fileSource1 = FSharp.Compiler.Text.SourceText.ofString fileSource1Text File.WriteAllText(fileName1, fileSource1Text) let fileNames = [fileName1] @@ -5451,7 +5451,7 @@ type UseTheThings(i:int) = member x.UseSomeUsedModuleContainingExtensionMember() = (3).Q member x.UseSomeUsedModuleContainingUnion() = A """ - let fileSource1 = Microsoft.FSharp.Compiler.Text.SourceText.ofString fileSource1Text + let fileSource1 = FSharp.Compiler.Text.SourceText.ofString fileSource1Text File.WriteAllText(fileName1, fileSource1Text) let fileNames = [fileName1] @@ -5524,7 +5524,7 @@ type UseTheThings(i:int) = member x.UseSomeUsedModuleContainingExtensionMember() = (3).Q member x.UseSomeUsedModuleContainingUnion() = A """ - let fileSource1 = Microsoft.FSharp.Compiler.Text.SourceText.ofString fileSource1Text + let fileSource1 = FSharp.Compiler.Text.SourceText.ofString fileSource1Text File.WriteAllText(fileName1, fileSource1Text) let fileNames = [fileName1] diff --git a/tests/service/ProjectOptionsTests.fs b/tests/service/ProjectOptionsTests.fs index e00550742a..141c33be92 100644 --- a/tests/service/ProjectOptionsTests.fs +++ b/tests/service/ProjectOptionsTests.fs @@ -508,7 +508,7 @@ let ``Test SourceFiles order for GetProjectOptionsFromScript`` () = // See #594 let scriptPath = __SOURCE_DIRECTORY__ + @"/data/ScriptProject/" + scriptName + ".fsx" let scriptSource = File.ReadAllText scriptPath let projOpts, _diagnostics = - checker.GetProjectOptionsFromScript(scriptPath, Microsoft.FSharp.Compiler.Text.SourceText.ofString scriptSource) + checker.GetProjectOptionsFromScript(scriptPath, FSharp.Compiler.Text.SourceText.ofString scriptSource) |> Async.RunSynchronously projOpts.SourceFiles |> Array.map Path.GetFileNameWithoutExtension @@ -534,12 +534,12 @@ module ImplFile let x = 42 #endif """ - let fileSource1 = Microsoft.FSharp.Compiler.Text.SourceText.ofString fileSource1Text + let fileSource1 = FSharp.Compiler.Text.SourceText.ofString fileSource1Text let fileSource2Text = """ #load "Impl.fs" ImplFile.x """ - let fileSource2 = Microsoft.FSharp.Compiler.Text.SourceText.ofString fileSource2Text + let fileSource2 = FSharp.Compiler.Text.SourceText.ofString fileSource2Text File.WriteAllText(fileName1, fileSource1Text) File.WriteAllText(fileName2, fileSource2Text) diff --git a/vsintegration/Utils/LanguageServiceProfiling/Program.fs b/vsintegration/Utils/LanguageServiceProfiling/Program.fs index 2b49b8f754..521c3b9020 100644 --- a/vsintegration/Utils/LanguageServiceProfiling/Program.fs +++ b/vsintegration/Utils/LanguageServiceProfiling/Program.fs @@ -42,7 +42,7 @@ Results look like this: *) open FSharp.Compiler -open Microsoft.FSharp.Compiler.Text +open FSharp.Compiler.Text open FSharp.Compiler.SourceCodeServices open System open System.IO diff --git a/vsintegration/src/FSharp.Editor/CodeFix/ReplaceWithSuggestion.fs b/vsintegration/src/FSharp.Editor/CodeFix/ReplaceWithSuggestion.fs index fcf8ba5655..dd52a71312 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/ReplaceWithSuggestion.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/ReplaceWithSuggestion.fs @@ -12,7 +12,6 @@ open FSharp.Compiler open FSharp.Compiler.SourceCodeServices open FSharp.Compiler.Range open Microsoft.FSharp.Compiler.SourceCodeServices -open Microsoft.FSharp.Compiler.Text [] type internal FSharpReplaceWithSuggestionCodeFixProvider diff --git a/vsintegration/src/FSharp.Editor/Common/Extensions.fs b/vsintegration/src/FSharp.Editor/Common/Extensions.fs index 612f618ade..694d3a401a 100644 --- a/vsintegration/src/FSharp.Editor/Common/Extensions.fs +++ b/vsintegration/src/FSharp.Editor/Common/Extensions.fs @@ -8,7 +8,7 @@ open System.IO open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.Host -open Microsoft.FSharp.Compiler.Text +open FSharp.Compiler.Text open FSharp.Compiler.Ast open FSharp.Compiler.SourceCodeServices diff --git a/vsintegration/src/FSharp.LanguageService/BackgroundRequests.fs b/vsintegration/src/FSharp.LanguageService/BackgroundRequests.fs index cb7c1462ba..10cd776b0d 100644 --- a/vsintegration/src/FSharp.LanguageService/BackgroundRequests.fs +++ b/vsintegration/src/FSharp.LanguageService/BackgroundRequests.fs @@ -94,7 +94,7 @@ type internal FSharpLanguageServiceBackgroundRequests_DEPRECATED lazy // This portion is executed on the language service thread let timestamp = if source=null then System.DateTime(2000,1,1) else source.OpenedTime // source is null in unit tests let checker = getInteractiveChecker() - let checkOptions, _diagnostics = checker.GetProjectOptionsFromScript(fileName, Microsoft.FSharp.Compiler.Text.SourceText.ofString sourceText, timestamp, [| |]) |> Async.RunSynchronously + let checkOptions, _diagnostics = checker.GetProjectOptionsFromScript(fileName, FSharp.Compiler.Text.SourceText.ofString sourceText, timestamp, [| |]) |> Async.RunSynchronously let referencedProjectFileNames = [| |] let projectSite = ProjectSitesAndFiles.CreateProjectSiteForScript(fileName, referencedProjectFileNames, checkOptions) { ProjectSite = projectSite diff --git a/vsintegration/src/FSharp.LanguageService/FSharpSource.fs b/vsintegration/src/FSharp.LanguageService/FSharpSource.fs index 3f4ca4dfa4..446fcfffb7 100644 --- a/vsintegration/src/FSharp.LanguageService/FSharpSource.fs +++ b/vsintegration/src/FSharp.LanguageService/FSharpSource.fs @@ -371,7 +371,7 @@ type internal FSharpSource_DEPRECATED(service:LanguageService_DEPRECATED, textLi Stamp = None } |> ic.GetParsingOptionsFromProjectOptions - ic.ParseFile(fileName, Microsoft.FSharp.Compiler.Text.SourceText.ofString (source.GetText()), co) |> Async.RunSynchronously + ic.ParseFile(fileName, FSharp.Compiler.Text.SourceText.ofString (source.GetText()), co) |> Async.RunSynchronously override source.GetCommentFormat() = let mutable info = new CommentInfo() diff --git a/vsintegration/tests/Salsa/salsa.fs b/vsintegration/tests/Salsa/salsa.fs index a0a20cada6..e2d00e6268 100644 --- a/vsintegration/tests/Salsa/salsa.fs +++ b/vsintegration/tests/Salsa/salsa.fs @@ -1101,7 +1101,7 @@ module internal Salsa = member file.GetFileName() = filename member file.GetProjectOptionsOfScript() = - project.Solution.Vs.LanguageService.FSharpChecker.GetProjectOptionsFromScript(filename, Microsoft.FSharp.Compiler.Text.SourceText.ofString file.CombinedLines, System.DateTime(2000,1,1), [| |]) + project.Solution.Vs.LanguageService.FSharpChecker.GetProjectOptionsFromScript(filename, FSharp.Compiler.Text.SourceText.ofString file.CombinedLines, System.DateTime(2000,1,1), [| |]) |> Async.RunSynchronously |> fst // drop diagnostics diff --git a/vsintegration/tests/UnitTests/RoslynSourceTextTests.fs b/vsintegration/tests/UnitTests/RoslynSourceTextTests.fs index 23b1e6702a..9a817df977 100644 --- a/vsintegration/tests/UnitTests/RoslynSourceTextTests.fs +++ b/vsintegration/tests/UnitTests/RoslynSourceTextTests.fs @@ -6,7 +6,7 @@ open System open NUnit.Framework open Microsoft.VisualStudio.FSharp.Editor -open Microsoft.FSharp.Compiler.Text +open FSharp.Compiler.Text open Microsoft.CodeAnalysis.Text [] diff --git a/vsintegration/tests/UnitTests/UnusedOpensTests.fs b/vsintegration/tests/UnitTests/UnusedOpensTests.fs index 04eb51e6e8..097e583fe6 100644 --- a/vsintegration/tests/UnitTests/UnusedOpensTests.fs +++ b/vsintegration/tests/UnitTests/UnusedOpensTests.fs @@ -29,7 +29,7 @@ let private checker = FSharpChecker.Create() let (=>) (source: string) (expectedRanges: ((*line*)int * ((*start column*)int * (*end column*)int)) list) = let sourceLines = source.Split ([|"\r\n"; "\n"; "\r"|], StringSplitOptions.None) - let _, checkFileAnswer = checker.ParseAndCheckFileInProject(filePath, 0, Microsoft.FSharp.Compiler.Text.SourceText.ofString source, projectOptions) |> Async.RunSynchronously + let _, checkFileAnswer = checker.ParseAndCheckFileInProject(filePath, 0, FSharp.Compiler.Text.SourceText.ofString source, projectOptions) |> Async.RunSynchronously let checkFileResults = match checkFileAnswer with From f4bd2211d871ce82c4ea3a6355f63d6a14da4aa8 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 29 Mar 2019 23:55:45 +0000 Subject: [PATCH 002/159] use proto on mac and linux --- .vsts-pr.yaml | 6 ++--- FSharpBuild.Directory.Build.props | 4 +-- FSharpTests.Directory.Build.props | 4 +++ eng/Build.ps1 | 2 +- eng/build-utils.ps1 | 4 --- eng/build.sh | 43 ++++++++++++++++++++++++------- fcs/Directory.Build.props | 6 +---- fcs/build.fsx | 10 ++++--- proto.proj | 2 +- src/buildtools/buildtools.proj | 13 +++++----- 10 files changed, 59 insertions(+), 35 deletions(-) diff --git a/.vsts-pr.yaml b/.vsts-pr.yaml index b7d3862888..b0186db4e1 100644 --- a/.vsts-pr.yaml +++ b/.vsts-pr.yaml @@ -11,7 +11,7 @@ jobs: _configuration: Release _testKind: testcoreclr steps: - - script: ./eng/cibuild.sh --configuration $(_configuration) --$(_testKind) + - script: ./eng/cibuild.sh --configuration $(_configuration) --$(_testKind) --verbosity normal - task: PublishBuildArtifacts@1 displayName: Publish Build Logs inputs: @@ -55,7 +55,7 @@ jobs: _configuration: Release _testKind: testcoreclr steps: - - script: ./eng/cibuild.sh --configuration $(_configuration) --$(_testKind) + - script: ./eng/cibuild.sh --configuration $(_configuration) --$(_testKind) --verbosity normal - task: PublishBuildArtifacts@1 displayName: Publish Build Logs inputs: @@ -108,7 +108,7 @@ jobs: _configuration: Release _testKind: testVs steps: - - script: eng\CIBuild.cmd -configuration $(_configuration) -$(_testKind) + - script: eng\CIBuild.cmd -configuration $(_configuration) -$(_testKind) -verbosity normal - task: PublishBuildArtifacts@1 displayName: Publish Build Logs inputs: diff --git a/FSharpBuild.Directory.Build.props b/FSharpBuild.Directory.Build.props index 31d2430129..9d1161037b 100644 --- a/FSharpBuild.Directory.Build.props +++ b/FSharpBuild.Directory.Build.props @@ -12,7 +12,7 @@ $(RepoRoot)src $(ArtifactsDir)\SymStore $(ArtifactsDir)\Bootstrap - $(ArtifactsDir)/fsc/Proto/netcoreapp2.1 + $(ArtifactsDir)/bin/fsc/Proto/netcoreapp2.1 4.4.0 1182;0025;$(WarningsAsErrors) @@ -80,7 +80,7 @@ - + $(ProtoOutputPath)\Microsoft.FSharp.Targets $(ProtoOutputPath)\Microsoft.FSharp.NetSdk.props $(ProtoOutputPath)\Microsoft.FSharp.NetSdk.targets diff --git a/FSharpTests.Directory.Build.props b/FSharpTests.Directory.Build.props index 6c298fe442..d62503cea9 100644 --- a/FSharpTests.Directory.Build.props +++ b/FSharpTests.Directory.Build.props @@ -35,6 +35,10 @@ <_FSharpBuildTargetFramework Condition="'$(FSharpTestCompilerVersion)' == 'net40'">net46 <_FSharpBuildTargetFramework Condition="'$(FSharpTestCompilerVersion)' == 'coreclr'">netstandard2.0 <_FSharpBuildBinPath>$(MSBuildThisFileDirectory)artifacts\bin\FSharp.Build\$(Configuration)\$(_FSharpBuildTargetFramework) + $(_FSharpBuildBinPath)\FSharp.Build.dll diff --git a/eng/Build.ps1 b/eng/Build.ps1 index 865cf23157..e93d735e44 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -155,10 +155,10 @@ function BuildSolution() { /p:Publish=$publish ` /p:ContinuousIntegrationBuild=$ci ` /p:OfficialBuildId=$officialBuildId ` - /p:BootstrapBuildPath=$bootstrapDir ` /p:QuietRestore=$quietRestore ` /p:QuietRestoreBinaryLog=$binaryLog ` /p:TestTargetFrameworks=$testTargetFrameworks ` + /v:$verbosity ` $suppressExtensionDeployment ` @properties } diff --git a/eng/build-utils.ps1 b/eng/build-utils.ps1 index 304eac5a3e..26b0c0ad8a 100644 --- a/eng/build-utils.ps1 +++ b/eng/build-utils.ps1 @@ -216,10 +216,6 @@ function Run-MSBuild([string]$projectFilePath, [string]$buildArgs = "", [string] $args += " /p:ContinuousIntegrationBuild=true" } - if ($bootstrapDir -ne "") { - $args += " /p:BootstrapBuildPath=$bootstrapDir" - } - $args += " $buildArgs" $args += " $projectFilePath" $args += " $properties" diff --git a/eng/build.sh b/eng/build.sh index d814dcd04d..43803435b5 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -13,6 +13,7 @@ usage() echo " --binaryLog Create MSBuild binary log (short: -bl)" echo "" echo "Actions:" + echo " --bootstrap Force the build of the bootstrap compiler" echo " --restore Restore projects required to build (short: -r)" echo " --build Build all projects (short: -b)" echo " --rebuild Rebuild all projects" @@ -44,7 +45,7 @@ while [[ -h "$source" ]]; do done scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" -restore=false +restore=true build=false rebuild=false pack=false @@ -54,6 +55,7 @@ test_core_clr=false configuration="Debug" verbosity='minimal' binary_log=false +force_bootstrap=false ci=false skip_analyzers=false prepare_machine=false @@ -88,6 +90,9 @@ while [[ $# > 0 ]]; do --binarylog|-bl) binary_log=true ;; + --bootstrap) + force_bootstrap=true + ;; --restore|-r) restore=true ;; @@ -204,22 +209,42 @@ function BuildSolution { if [[ "$ci" != true ]]; then quiet_restore=true fi + fslexyacc_target_framework=netcoreapp2.0 + + # Node reuse fails because multiple different versions of FSharp.Build.dll get loaded into MSBuild nodes + node_reuse=false # build bootstrap tools bootstrap_config=Proto - MSBuild "$repo_root/src/buildtools/buildtools.proj" \ - /restore \ - /p:Configuration=$bootstrap_config \ - /t:Build - bootstrap_dir=$artifacts_dir/Bootstrap - mkdir -p "$bootstrap_dir" - cp $artifacts_dir/bin/fslex/$bootstrap_config/netcoreapp2.0/* $bootstrap_dir - cp $artifacts_dir/bin/fsyacc/$bootstrap_config/netcoreapp2.0/* $bootstrap_dir + if [[ "$force_bootstrap" == true ]]; then + rm -fr $bootstrap_dir + fi + if [ ! -f "$bootstrap_dir/fslex.dll" ]; then + MSBuild "$repo_root/src/buildtools/buildtools.proj" \ + /restore \ + /v:$verbosity \ + /p:Configuration=$bootstrap_config \ + /t:Build + + mkdir -p "$bootstrap_dir" + cp $artifacts_dir/bin/fslex/$bootstrap_config/$fslexyacc_target_framework/* $bootstrap_dir + cp $artifacts_dir/bin/fsyacc/$bootstrap_config/$fslexyacc_target_framework/* $bootstrap_dir + fi + if [ ! -f "$bootstrap_dir/fsc.exe" ]; then + MSBuild "$repo_root/proto.proj" \ + /restore \ + /v:$verbosity \ + /p:Configuration=$bootstrap_config \ + /t:Build + + cp $artifacts_dir/bin/fsc/$bootstrap_config/netcoreapp2.1/* $bootstrap_dir + fi # do real build MSBuild $toolset_build_proj \ $bl \ + /v:$verbosity \ /p:Configuration=$configuration \ /p:Projects="$projects" \ /p:RepoRoot="$repo_root" \ diff --git a/fcs/Directory.Build.props b/fcs/Directory.Build.props index 3179fe221f..e09dc41a67 100644 --- a/fcs/Directory.Build.props +++ b/fcs/Directory.Build.props @@ -17,11 +17,7 @@ $(ArtifactsDir)\obj $(ArtifactsBinDir)\fcs $(ArtifactsObjDir)\fcs - true + true - - - $(ArtifactsBinDir)\FSharp.Build\Proto\net46 - diff --git a/fcs/build.fsx b/fcs/build.fsx index d1d575c4f7..d03f9664fe 100644 --- a/fcs/build.fsx +++ b/fcs/build.fsx @@ -24,6 +24,8 @@ let isMono = false // Utilities // -------------------------------------------------------------------------------------- +let fslexyaccTargetFramework = "netcoreapp2.0" + let dotnetExePath = // Build.cmd normally downloads a dotnet cli to: \artifacts\toolset\dotnet // check if there is one there to avoid downloading an additional one here @@ -92,14 +94,14 @@ Target "BuildVersion" (fun _ -> Target "Build" (fun _ -> runDotnet __SOURCE_DIRECTORY__ "build ../src/buildtools/buildtools.proj -v n -c Proto" - let fslexPath = __SOURCE_DIRECTORY__ + "/../artifacts/bin/fslex/Proto/netcoreapp2.0/fslex.dll" - let fsyaccPath = __SOURCE_DIRECTORY__ + "/../artifacts/bin/fsyacc/Proto/netcoreapp2.0/fsyacc.dll" + let fslexPath = __SOURCE_DIRECTORY__ + "/../artifacts/bin/fslex/Proto/" + fslexyaccTargetFramework + "/fslex.dll" + let fsyaccPath = __SOURCE_DIRECTORY__ + "/../artifacts/bin/fsyacc/Proto/" + fslexyaccTargetFramework + "/fsyacc.dll" runDotnet __SOURCE_DIRECTORY__ (sprintf "build FSharp.Compiler.Service.sln -v n -c Release /p:FsLexPath=%s /p:FsYaccPath=%s" fslexPath fsyaccPath) ) Target "Test" (fun _ -> - // This project file is used for the netcoreapp2.0 tests to work out reference sets - runDotnet __SOURCE_DIRECTORY__ "build ../tests/projects/Sample_NETCoreSDK_FSharp_Library_netstandard2_0/Sample_NETCoreSDK_FSharp_Library_netstandard2_0.fsproj -v n /restore /p:DisableCompilerRedirection=true" + // This project file is used for the tests to work out reference sets + runDotnet __SOURCE_DIRECTORY__ "build ../tests/projects/Sample_NETCoreSDK_FSharp_Library_netstandard2_0/Sample_NETCoreSDK_FSharp_Library_netstandard2_0.fsproj -v n /restore /p:DisableProtoCompiler=true" // Now run the tests let logFilePath = Path.Combine(__SOURCE_DIRECTORY__, "..", "artifacts", "TestResults", "Release", "FSharp.Compiler.Service.Test.xml") diff --git a/proto.proj b/proto.proj index bbad2c34cc..b0bff16a28 100644 --- a/proto.proj +++ b/proto.proj @@ -8,7 +8,7 @@ TargetFramework=net46 - TargetFramework=netcoreapp2.1 + TargetFramework=netstandard2.0 TargetFramework=net46 diff --git a/src/buildtools/buildtools.proj b/src/buildtools/buildtools.proj index 593f086dd0..d96cf6a8d8 100644 --- a/src/buildtools/buildtools.proj +++ b/src/buildtools/buildtools.proj @@ -2,7 +2,8 @@ Debug - + true + @@ -10,23 +11,23 @@ - + - + - + - + - + From 8a4baf313be5834a729b26c843bdcac647e3e100 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Sat, 30 Mar 2019 12:21:44 +0000 Subject: [PATCH 003/159] reduce diff --- FSharpBuild.Directory.Build.props | 2 +- fcs/Directory.Build.props | 2 +- fcs/build.fsx | 2 +- src/buildtools/buildtools.proj | 12 ++++++------ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/FSharpBuild.Directory.Build.props b/FSharpBuild.Directory.Build.props index 9d1161037b..93b66901c8 100644 --- a/FSharpBuild.Directory.Build.props +++ b/FSharpBuild.Directory.Build.props @@ -80,7 +80,7 @@ - + $(ProtoOutputPath)\Microsoft.FSharp.Targets $(ProtoOutputPath)\Microsoft.FSharp.NetSdk.props $(ProtoOutputPath)\Microsoft.FSharp.NetSdk.targets diff --git a/fcs/Directory.Build.props b/fcs/Directory.Build.props index e09dc41a67..99ac310b2a 100644 --- a/fcs/Directory.Build.props +++ b/fcs/Directory.Build.props @@ -17,7 +17,7 @@ $(ArtifactsDir)\obj $(ArtifactsBinDir)\fcs $(ArtifactsObjDir)\fcs - true + true diff --git a/fcs/build.fsx b/fcs/build.fsx index d03f9664fe..39fb3070e7 100644 --- a/fcs/build.fsx +++ b/fcs/build.fsx @@ -101,7 +101,7 @@ Target "Build" (fun _ -> Target "Test" (fun _ -> // This project file is used for the tests to work out reference sets - runDotnet __SOURCE_DIRECTORY__ "build ../tests/projects/Sample_NETCoreSDK_FSharp_Library_netstandard2_0/Sample_NETCoreSDK_FSharp_Library_netstandard2_0.fsproj -v n /restore /p:DisableProtoCompiler=true" + runDotnet __SOURCE_DIRECTORY__ "build ../tests/projects/Sample_NETCoreSDK_FSharp_Library_netstandard2_0/Sample_NETCoreSDK_FSharp_Library_netstandard2_0.fsproj -v n /restore /p:DisableCompilerRedirection=true" // Now run the tests let logFilePath = Path.Combine(__SOURCE_DIRECTORY__, "..", "artifacts", "TestResults", "Release", "FSharp.Compiler.Service.Test.xml") diff --git a/src/buildtools/buildtools.proj b/src/buildtools/buildtools.proj index d96cf6a8d8..630bb67856 100644 --- a/src/buildtools/buildtools.proj +++ b/src/buildtools/buildtools.proj @@ -2,7 +2,7 @@ Debug - true + true @@ -11,23 +11,23 @@ - + - + - + - + - + From 0474a23faf73ef71fc4ddb2313613dc480d9a3e0 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Sat, 30 Mar 2019 12:24:30 +0000 Subject: [PATCH 004/159] reduce diff --- fcs/Directory.Build.props | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fcs/Directory.Build.props b/fcs/Directory.Build.props index 99ac310b2a..3179fe221f 100644 --- a/fcs/Directory.Build.props +++ b/fcs/Directory.Build.props @@ -20,4 +20,8 @@ true + + + $(ArtifactsBinDir)\FSharp.Build\Proto\net46 + From b96120e417c7131ac93fb46305a6770f5d5d2d75 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Sat, 30 Mar 2019 12:25:25 +0000 Subject: [PATCH 005/159] reduce diff --- fcs/build.fsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fcs/build.fsx b/fcs/build.fsx index 39fb3070e7..dd5d3c64fc 100644 --- a/fcs/build.fsx +++ b/fcs/build.fsx @@ -24,8 +24,6 @@ let isMono = false // Utilities // -------------------------------------------------------------------------------------- -let fslexyaccTargetFramework = "netcoreapp2.0" - let dotnetExePath = // Build.cmd normally downloads a dotnet cli to: \artifacts\toolset\dotnet // check if there is one there to avoid downloading an additional one here @@ -94,8 +92,8 @@ Target "BuildVersion" (fun _ -> Target "Build" (fun _ -> runDotnet __SOURCE_DIRECTORY__ "build ../src/buildtools/buildtools.proj -v n -c Proto" - let fslexPath = __SOURCE_DIRECTORY__ + "/../artifacts/bin/fslex/Proto/" + fslexyaccTargetFramework + "/fslex.dll" - let fsyaccPath = __SOURCE_DIRECTORY__ + "/../artifacts/bin/fsyacc/Proto/" + fslexyaccTargetFramework + "/fsyacc.dll" + let fslexPath = __SOURCE_DIRECTORY__ + "/../artifacts/bin/fslex/Proto/netcoreapp2.0/fslex.dll" + let fsyaccPath = __SOURCE_DIRECTORY__ + "/../artifacts/bin/fsyacc/Proto/netcoreapp2.0/fsyacc.dll" runDotnet __SOURCE_DIRECTORY__ (sprintf "build FSharp.Compiler.Service.sln -v n -c Release /p:FsLexPath=%s /p:FsYaccPath=%s" fslexPath fsyaccPath) ) From cf9147bd2dd42febdea9e37082ff46fa34f0ed64 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Sat, 30 Mar 2019 12:26:18 +0000 Subject: [PATCH 006/159] reduce diff --- FSharpTests.Directory.Build.props | 4 ---- 1 file changed, 4 deletions(-) diff --git a/FSharpTests.Directory.Build.props b/FSharpTests.Directory.Build.props index d62503cea9..6c298fe442 100644 --- a/FSharpTests.Directory.Build.props +++ b/FSharpTests.Directory.Build.props @@ -35,10 +35,6 @@ <_FSharpBuildTargetFramework Condition="'$(FSharpTestCompilerVersion)' == 'net40'">net46 <_FSharpBuildTargetFramework Condition="'$(FSharpTestCompilerVersion)' == 'coreclr'">netstandard2.0 <_FSharpBuildBinPath>$(MSBuildThisFileDirectory)artifacts\bin\FSharp.Build\$(Configuration)\$(_FSharpBuildTargetFramework) - $(_FSharpBuildBinPath)\FSharp.Build.dll From 286c336d7b0fe6e783edd42c2d02ac99cae083d9 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Sat, 30 Mar 2019 12:26:48 +0000 Subject: [PATCH 007/159] reduce diff --- fcs/build.fsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fcs/build.fsx b/fcs/build.fsx index dd5d3c64fc..d1d575c4f7 100644 --- a/fcs/build.fsx +++ b/fcs/build.fsx @@ -98,7 +98,7 @@ Target "Build" (fun _ -> ) Target "Test" (fun _ -> - // This project file is used for the tests to work out reference sets + // This project file is used for the netcoreapp2.0 tests to work out reference sets runDotnet __SOURCE_DIRECTORY__ "build ../tests/projects/Sample_NETCoreSDK_FSharp_Library_netstandard2_0/Sample_NETCoreSDK_FSharp_Library_netstandard2_0.fsproj -v n /restore /p:DisableCompilerRedirection=true" // Now run the tests From 7a6448eda01bfe982c942b707c1110ac4a767d20 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Sat, 30 Mar 2019 13:00:00 +0000 Subject: [PATCH 008/159] reduce diff --- FSharpBuild.Directory.Build.props | 2 +- eng/Build.ps1 | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/FSharpBuild.Directory.Build.props b/FSharpBuild.Directory.Build.props index 93b66901c8..1d456ec2d7 100644 --- a/FSharpBuild.Directory.Build.props +++ b/FSharpBuild.Directory.Build.props @@ -80,7 +80,7 @@ - + $(ProtoOutputPath)\Microsoft.FSharp.Targets $(ProtoOutputPath)\Microsoft.FSharp.NetSdk.props $(ProtoOutputPath)\Microsoft.FSharp.NetSdk.targets diff --git a/eng/Build.ps1 b/eng/Build.ps1 index e93d735e44..0acdb67cdb 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -99,6 +99,7 @@ function Process-Arguments() { Print-Usage exit 0 } + $script:nodeReuse = $False; if ($testAll) { $script:testDesktop = $True From 1a0d385c84d66dd42b241d08895cd534f7f7c24d Mon Sep 17 00:00:00 2001 From: Will Smith Date: Sat, 30 Mar 2019 20:10:29 -0700 Subject: [PATCH 009/159] Making ILVersionInfo a struct (#6392) * Making ILVersionInfo a struct * Fixing tests --- src/absil/il.fs | 37 ++++++++------ src/absil/il.fsi | 10 +++- src/absil/ilprint.fs | 10 ++-- src/absil/ilread.fs | 14 +++--- src/absil/ilreflect.fs | 4 +- src/absil/ilwrite.fs | 23 ++++----- src/fsharp/TastOps.fs | 12 ++--- src/fsharp/TastPickle.fs | 6 ++- src/fsharp/fsc.fs | 14 +++--- .../ProductVersion.fs | 50 +++++++++---------- 10 files changed, 99 insertions(+), 81 deletions(-) diff --git a/src/absil/il.fs b/src/absil/il.fs index 012a238592..6a5714125b 100644 --- a/src/absil/il.fs +++ b/src/absil/il.fs @@ -320,7 +320,16 @@ let sha1HashInt64 s = SHA1.sha1HashInt64 s // // -------------------------------------------------------------------- -type ILVersionInfo = uint16 * uint16 * uint16 * uint16 +[] +type ILVersionInfo = + + val Major: uint16 + val Minor: uint16 + val Build: uint16 + val Revision: uint16 + + new(major, minor, build, revision) = + { Major = major; Minor = minor; Build = build; Revision = revision } type Locale = string @@ -411,7 +420,7 @@ type ILAssemblyRef(data) = let version = match aname.Version with | null -> None - | v -> Some (uint16 v.Major, uint16 v.Minor, uint16 v.Build, uint16 v.Revision) + | v -> Some (ILVersionInfo (uint16 v.Major, uint16 v.Minor, uint16 v.Build, uint16 v.Revision)) let retargetable = aname.Flags = System.Reflection.AssemblyNameFlags.Retargetable @@ -424,15 +433,15 @@ type ILAssemblyRef(data) = add(aref.Name) match aref.Version with | None -> () - | Some (a, b, c, d) -> + | Some (version) -> add ", Version=" - add (string (int a)) + add (string (int version.Major)) add "." - add (string (int b)) + add (string (int version.Minor)) add "." - add (string (int c)) + add (string (int version.Build)) add "." - add (string (int d)) + add (string (int version.Revision)) add ", Culture=" match aref.Locale with | None -> add "neutral" @@ -3560,7 +3569,7 @@ let et_MVAR = 0x1Euy let et_CMOD_REQD = 0x1Fuy let et_CMOD_OPT = 0x20uy -let formatILVersion ((a, b, c, d):ILVersionInfo) = sprintf "%d.%d.%d.%d" (int a) (int b) (int c) (int d) +let formatILVersion (version: ILVersionInfo) = sprintf "%d.%d.%d.%d" (int version.Major) (int version.Minor) (int version.Build) (int version.Revision) let encodeCustomAttrString s = let arr = string_as_utf8_bytes s @@ -4241,17 +4250,17 @@ let parseILVersion (vstr : string) = 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) + ILVersionInfo(zero32 version.Major, zero32 version.Minor, zero32 version.Build, minorRevision) -let compareILVersions (a1, a2, a3, a4) ((b1, b2, b3, b4) : ILVersionInfo) = - let c = compare a1 b1 +let compareILVersions (version1 : ILVersionInfo) (version2 : ILVersionInfo) = + let c = compare version1.Major version2.Major if c <> 0 then c else - let c = compare a2 b2 + let c = compare version1.Minor version2.Minor if c <> 0 then c else - let c = compare a3 b3 + let c = compare version1.Build version2.Build if c <> 0 then c else - let c = compare a4 b4 + let c = compare version1.Revision version2.Revision if c <> 0 then c else 0 diff --git a/src/absil/il.fsi b/src/absil/il.fsi index 81ea562251..87fd66932a 100644 --- a/src/absil/il.fsi +++ b/src/absil/il.fsi @@ -53,7 +53,15 @@ type PublicKey = member KeyToken: byte[] static member KeyAsToken: byte[] -> PublicKey -type ILVersionInfo = uint16 * uint16 * uint16 * uint16 +[] +type ILVersionInfo = + + val Major: uint16 + val Minor: uint16 + val Build: uint16 + val Revision: uint16 + + new : major: uint16 * minor: uint16 * build: uint16 * revision: uint16 -> ILVersionInfo [] type ILAssemblyRef = diff --git a/src/absil/ilprint.fs b/src/absil/ilprint.fs index f9f7fb7af1..2e8cbc0acf 100644 --- a/src/absil/ilprint.fs +++ b/src/absil/ilprint.fs @@ -963,15 +963,15 @@ and goutput_lambdas env os lambdas = 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) = +let output_ver os (version: ILVersionInfo) = output_string os " .ver " - output_u16 os a + output_u16 os version.Major output_string os " : " - output_u16 os b + output_u16 os version.Minor output_string os " : " - output_u16 os c + output_u16 os version.Build output_string os " : " - output_u16 os d + output_u16 os version.Revision 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 b7130c44ba..9732e543b3 100644 --- a/src/absil/ilread.fs +++ b/src/absil/ilread.fs @@ -1667,7 +1667,7 @@ and seekReadAssemblyManifest (ctxt: ILMetadataReader) pectxt idx = AuxModuleHashAlgorithm=hash SecurityDeclsStored= ctxt.securityDeclsReader_Assembly PublicKey= pubkey - Version= Some (v1, v2, v3, v4) + Version= Some (ILVersionInfo (v1, v2, v3, v4)) Locale= readStringHeapOption ctxt localeIdx CustomAttrsStored = ctxt.customAttrsReader_Assembly MetadataIndex = idx @@ -1700,12 +1700,12 @@ and seekReadAssemblyRefUncached ctxtH idx = | Some blob -> Some (if (flags &&& 0x0001) <> 0x0 then PublicKey blob else PublicKeyToken blob) ILAssemblyRef.Create - (name=nm, - hash=readBlobHeapOption ctxt hashValueIdx, - publicKey=publicKey, - retargetable=((flags &&& 0x0100) <> 0x0), - version=Some(v1, v2, v3, v4), - locale=readStringHeapOption ctxt localeIdx) + (name = nm, + hash = readBlobHeapOption ctxt hashValueIdx, + publicKey = publicKey, + retargetable = ((flags &&& 0x0100) <> 0x0), + version = Some (ILVersionInfo (v1, v2, v3, v4)), + locale = readStringHeapOption ctxt localeIdx) and seekReadModuleRef (ctxt: ILMetadataReader) mdv idx = let (nameIdx) = seekReadModuleRefRow ctxt mdv idx diff --git a/src/absil/ilreflect.fs b/src/absil/ilreflect.fs index 1381efd591..f97f6fca42 100644 --- a/src/absil/ilreflect.fs +++ b/src/absil/ilreflect.fs @@ -310,8 +310,8 @@ let convAssemblyRef (aref:ILAssemblyRef) = | None -> () | Some (PublicKey bytes) -> asmName.SetPublicKey(bytes) | Some (PublicKeyToken bytes) -> asmName.SetPublicKeyToken(bytes)) - let setVersion (major, minor, build, rev) = - asmName.Version <- System.Version (int32 major, int32 minor, int32 build, int32 rev) + let setVersion (version: ILVersionInfo) = + asmName.Version <- System.Version (int32 version.Major, int32 version.Minor, int32 version.Build, int32 version.Revision) Option.iter setVersion aref.Version // asmName.ProcessorArchitecture <- System.Reflection.ProcessorArchitecture.MSIL #if !FX_RESHAPED_GLOBALIZATION diff --git a/src/absil/ilwrite.fs b/src/absil/ilwrite.fs index a3a4d61f7f..5dc02390aa 100644 --- a/src/absil/ilwrite.fs +++ b/src/absil/ilwrite.fs @@ -709,10 +709,10 @@ let rec GetIdxForTypeDef cenv key = let rec GetAssemblyRefAsRow cenv (aref:ILAssemblyRef) = AssemblyRefRow - ((match aref.Version with None -> 0us | Some (x, _, _, _) -> x), - (match aref.Version with None -> 0us | Some (_, y, _, _) -> y), - (match aref.Version with None -> 0us | Some (_, _, z, _) -> z), - (match aref.Version with None -> 0us | Some (_, _, _, w) -> w), + ((match aref.Version with None -> 0us | Some (version) -> version.Major), + (match aref.Version with None -> 0us | Some (version) -> version.Minor), + (match aref.Version with None -> 0us | Some (version) -> version.Build), + (match aref.Version with None -> 0us | Some (version) -> version.Revision), ((match aref.PublicKey with Some (PublicKey _) -> 0x0001 | _ -> 0x0000) ||| (if aref.Retargetable then 0x0100 else 0x0000)), BlobIndex (match aref.PublicKey with @@ -2822,10 +2822,10 @@ and GenExportedTypesPass3 cenv (ce: ILExportedTypesAndForwarders) = and GetManifsetAsAssemblyRow cenv m = UnsharedRow [|ULong m.AuxModuleHashAlgorithm - UShort (match m.Version with None -> 0us | Some (x, _, _, _) -> x) - UShort (match m.Version with None -> 0us | Some (_, y, _, _) -> y) - UShort (match m.Version with None -> 0us | Some (_, _, z, _) -> z) - UShort (match m.Version with None -> 0us | Some (_, _, _, w) -> w) + UShort (match m.Version with None -> 0us | Some (version) -> version.Major) + UShort (match m.Version with None -> 0us | Some (version) -> version.Minor) + UShort (match m.Version with None -> 0us | Some (version) -> version.Build) + UShort (match m.Version with None -> 0us | Some (version) -> version.Revision) ULong ( (match m.AssemblyLongevity with | ILAssemblyLongevity.Unspecified -> 0x0000 @@ -3091,9 +3091,8 @@ let writeILMetadataAndCode (generatePdb, desiredMetadataVersion, ilg, emitTailca let (mdtableVersionMajor, mdtableVersionMinor) = metadataSchemaVersionSupportedByCLRVersion desiredMetadataVersion - let version = - let (a, b, c, _) = desiredMetadataVersion - System.Text.Encoding.UTF8.GetBytes (sprintf "v%d.%d.%d" a b c) + let version = + System.Text.Encoding.UTF8.GetBytes (sprintf "v%d.%d.%d" desiredMetadataVersion.Major desiredMetadataVersion.Minor desiredMetadataVersion.Build) let paddedVersionLength = align 0x4 (Array.length version) @@ -3634,7 +3633,7 @@ let writeBinaryAndReportMappings (outfile, | ILScopeRef.Module(_) -> failwith "Expected mscorlib to be ILScopeRef.Assembly was ILScopeRef.Module" | ILScopeRef.Assembly(aref) -> match aref.Version with - | Some (2us, _, _, _) -> parseILVersion "2.0.50727.0" + | Some (version) when version.Major = 2us -> parseILVersion "2.0.50727.0" | Some v -> v | None -> failwith "Expected msorlib to have a version number" diff --git a/src/fsharp/TastOps.fs b/src/fsharp/TastOps.fs index 8d659f54ae..e0760e3526 100644 --- a/src/fsharp/TastOps.fs +++ b/src/fsharp/TastOps.fs @@ -7004,13 +7004,13 @@ let tnames_SignatureDataVersionAttr = splitILTypeName tname_SignatureDataVersion let tref_SignatureDataVersionAttr () = mkILTyRef(IlxSettings.ilxFsharpCoreLibScopeRef (), tname_SignatureDataVersionAttr) -let mkSignatureDataVersionAttr (g:TcGlobals) ((v1, v2, v3, _) : ILVersionInfo) = +let mkSignatureDataVersionAttr (g: TcGlobals) (version: ILVersionInfo) = mkILCustomAttribute g.ilg (tref_SignatureDataVersionAttr(), [g.ilg.typ_Int32;g.ilg.typ_Int32;g.ilg.typ_Int32], - [ILAttribElem.Int32 (int32 v1) - ILAttribElem.Int32 (int32 v2) - ILAttribElem.Int32 (int32 v3)], []) + [ILAttribElem.Int32 (int32 version.Major) + ILAttribElem.Int32 (int32 version.Minor) + ILAttribElem.Int32 (int32 version.Build)], []) let tname_AutoOpenAttr = FSharpLib.Core + ".AutoOpenAttribute" @@ -7040,11 +7040,11 @@ let TryFindInternalsVisibleToAttr ilg cattr = else None -let IsMatchingSignatureDataVersionAttr ilg ((v1, v2, v3, _) : ILVersionInfo) cattr = +let IsMatchingSignatureDataVersionAttr ilg (version: ILVersionInfo) cattr = IsSignatureDataVersionAttr cattr && match decodeILAttribData ilg cattr with | [ILAttribElem.Int32 u1; ILAttribElem.Int32 u2;ILAttribElem.Int32 u3 ], _ -> - (v1 = uint16 u1) && (v2 = uint16 u2) && (v3 = uint16 u3) + (version.Major = uint16 u1) && (version.Minor = uint16 u2) && (version.Build = uint16 u3) | _ -> warning(Failure(FSComp.SR.tastUnexpectedDecodeOfInterfaceDataVersionAttribute())) false diff --git a/src/fsharp/TastPickle.fs b/src/fsharp/TastPickle.fs index c988d3b338..a8763a8793 100644 --- a/src/fsharp/TastPickle.fs +++ b/src/fsharp/TastPickle.fs @@ -906,7 +906,7 @@ let p_ILPublicKey x st = | PublicKey b -> p_byte 0 st; p_bytes b st | PublicKeyToken b -> p_byte 1 st; p_bytes b st -let p_ILVersion x st = p_tup4 p_uint16 p_uint16 p_uint16 p_uint16 x st +let p_ILVersion (x: ILVersionInfo) st = p_tup4 p_uint16 p_uint16 p_uint16 p_uint16 (x.Major, x.Minor, x.Build, x.Revision) st let p_ILModuleRef (x:ILModuleRef) st = p_tup3 p_string p_bool (p_option p_bytes) (x.Name, x.HasMetadata, x.Hash) st @@ -929,7 +929,9 @@ let u_ILPublicKey st = | 1 -> u_bytes st |> PublicKeyToken | _ -> ufailwith st "u_ILPublicKey" -let u_ILVersion st = u_tup4 u_uint16 u_uint16 u_uint16 u_uint16 st +let u_ILVersion st = + let (major, minor, build, revision) = u_tup4 u_uint16 u_uint16 u_uint16 u_uint16 st + ILVersionInfo(major, minor, build, revision) let u_ILModuleRef st = let (a, b, c) = u_tup3 u_string u_bool (u_option u_bytes) st diff --git a/src/fsharp/fsc.fs b/src/fsharp/fsc.fs index 29701c86e8..9471ca9d64 100644 --- a/src/fsharp/fsc.fs +++ b/src/fsharp/fsc.fs @@ -533,18 +533,18 @@ module VersionResourceFormat = for child in children do yield! child |] - let Version((v1, v2, v3, v4):ILVersionInfo) = + let Version(version: ILVersionInfo) = [| // DWORD dwFileVersionMS // Specifies the most significant 32 bits of the file's binary // version number. This member is used with dwFileVersionLS to form a 64-bit value used // for numeric comparisons. - yield! i32 (int32 v1 <<< 16 ||| int32 v2) + yield! i32 (int32 version.Major <<< 16 ||| int32 version.Minor) // DWORD dwFileVersionLS // Specifies the least significant 32 bits of the file's binary // version number. This member is used with dwFileVersionMS to form a 64-bit value used // for numeric comparisons. - yield! i32 (int32 v3 <<< 16 ||| int32 v4) + yield! i32 (int32 version.Build <<< 16 ||| int32 version.Revision) |] let String(string, value) = @@ -824,7 +824,7 @@ module MainModuleBuilder = let productVersion findStringAttr (fileVersion: ILVersionInfo) = let attrName = "System.Reflection.AssemblyInformationalVersionAttribute" - let toDotted (v1, v2, v3, v4) = sprintf "%d.%d.%d.%d" v1 v2 v3 v4 + let toDotted (version: ILVersionInfo) = sprintf "%d.%d.%d.%d" version.Major version.Minor version.Build version.Revision match findStringAttr attrName with | None | Some "" -> fileVersion |> toDotted | Some (AttributeHelpers.ILVersion(v)) -> v |> toDotted @@ -840,7 +840,7 @@ module MainModuleBuilder = |> Seq.takeWhile ((<>) 0us) |> Seq.toList match validParts @ [0us; 0us; 0us; 0us] with - | major :: minor :: build :: rev :: _ -> (major, minor, build, rev) + | major :: minor :: build :: rev :: _ -> ILVersionInfo(major, minor, build, rev) | x -> failwithf "error converting product version '%s' to binary, tried '%A' " version x @@ -986,8 +986,8 @@ module MainModuleBuilder = // specify the major language, and the high-order 6 bits specify the sublanguage. // For a table of valid identifiers see Language Identifiers. // // see e.g. http://msdn.microsoft.com/en-us/library/aa912040.aspx 0000 is neutral and 04b0(hex)=1252(dec) is the code page. - [ ("000004b0", [ yield ("Assembly Version", (let v1, v2, v3, v4 = assemblyVersion in sprintf "%d.%d.%d.%d" v1 v2 v3 v4)) - yield ("FileVersion", (let v1, v2, v3, v4 = fileVersionInfo in sprintf "%d.%d.%d.%d" v1 v2 v3 v4)) + [ ("000004b0", [ yield ("Assembly Version", (sprintf "%d.%d.%d.%d" assemblyVersion.Major assemblyVersion.Minor assemblyVersion.Build assemblyVersion.Revision)) + yield ("FileVersion", (sprintf "%d.%d.%d.%d" fileVersionInfo.Major fileVersionInfo.Minor fileVersionInfo.Build fileVersionInfo.Revision)) yield ("ProductVersion", productVersionString) match tcConfig.outputFile with | Some f -> yield ("OriginalFilename", Path.GetFileName(f)) diff --git a/tests/FSharp.Compiler.UnitTests/ProductVersion.fs b/tests/FSharp.Compiler.UnitTests/ProductVersion.fs index de528d3329..84d05f43e3 100644 --- a/tests/FSharp.Compiler.UnitTests/ProductVersion.fs +++ b/tests/FSharp.Compiler.UnitTests/ProductVersion.fs @@ -16,23 +16,23 @@ module FileVersionTest = [] let parseILVersion () = - "0.0.0.0" |> parseILVersion |> Assert.areEqual (0us,0us,0us,0us) - "1.2.3.4" |> parseILVersion |> Assert.areEqual (1us,2us,3us,4us) + "0.0.0.0" |> parseILVersion |> Assert.areEqual (ILVersionInfo(0us,0us,0us,0us)) + "1.2.3.4" |> parseILVersion |> Assert.areEqual (ILVersionInfo(1us,2us,3us,4us)) [] let ``should use AssemblyFileVersionAttribute if set`` () = let findStringAttr n = n |> Assert.areEqual fileVersionAttrName; Some "1.2.3.4" - fileVersion findStringAttr (1us,0us,0us,0us) |> Assert.areEqual (1us,2us,3us,4us) + fileVersion findStringAttr (ILVersionInfo(1us,0us,0us,0us)) |> Assert.areEqual (ILVersionInfo(1us,2us,3us,4us)) [] let ``should fallback if AssemblyFileVersionAttribute is not a valid version`` () = - fileVersion (fun _ -> Some "1.2a.3.3") (3us,7us,8us,6us) - |> Assert.areEqual (3us,7us,8us,6us) + fileVersion (fun _ -> Some "1.2a.3.3") (ILVersionInfo(3us,7us,8us,6us)) + |> Assert.areEqual (ILVersionInfo(3us,7us,8us,6us)) [] let ``should fallback to assemblyVersion if AssemblyFileVersionAttribute not set`` () = let findStringAttr n = n |> Assert.areEqual fileVersionAttrName; None; - fileVersion findStringAttr (1us,0us,0us,4us) |> Assert.areEqual (1us,0us,0us,4us) + fileVersion findStringAttr (ILVersionInfo(1us,0us,0us,4us)) |> Assert.areEqual (ILVersionInfo(1us,0us,0us,4us)) module ProductVersionTest = @@ -43,25 +43,25 @@ module ProductVersionTest = let ``should use AssemblyInformationalVersionAttribute if set`` () = let mutable args = [] let findStrAttr x = args <- List.append args [x]; Some "12.34.56.78" - productVersion findStrAttr (1us,0us,0us,6us) |> Assert.areEqual "12.34.56.78" + productVersion findStrAttr (ILVersionInfo(1us,0us,0us,6us)) |> Assert.areEqual "12.34.56.78" args |> Assert.areEqual [ informationalVersionAttrName ] [] let ``should fallback if AssemblyInformationalVersionAttribute is not a valid version`` () = - productVersion (fun _ -> Some "1.2.3-main (build #12)") (1us,0us,0us,6us) + productVersion (fun _ -> Some "1.2.3-main (build #12)") (ILVersionInfo(1us,0us,0us,6us)) |> Assert.areEqual "1.2.3-main (build #12)" [] let ``should fallback to fileVersion if AssemblyInformationalVersionAttribute not set or empty`` () = - productVersion (fun _ -> None) (3us,2us,1us,0us) |> Assert.areEqual "3.2.1.0" - productVersion (fun _ -> Some "") (3us,2us,1us,0us) |> Assert.areEqual "3.2.1.0" + productVersion (fun _ -> None) (ILVersionInfo(3us,2us,1us,0us)) |> Assert.areEqual "3.2.1.0" + productVersion (fun _ -> Some "") (ILVersionInfo(3us,2us,1us,0us)) |> Assert.areEqual "3.2.1.0" let validValues () = let max = System.UInt16.MaxValue - [ "1.2.3.4", (1us,2us,3us,4us) - "0.0.0.0", (0us,0us,0us,0us) - "3213.57843.32382.59493", (3213us,57843us,32382us,59493us) - (sprintf "%d.%d.%d.%d" max max max max), (max,max,max,max) ] + [ "1.2.3.4", ILVersionInfo(1us,2us,3us,4us) + "0.0.0.0", ILVersionInfo(0us,0us,0us,0us) + "3213.57843.32382.59493", ILVersionInfo(3213us,57843us,32382us,59493us) + (sprintf "%d.%d.%d.%d" max max max max), ILVersionInfo(max,max,max,max) ] [] let ``should use values if valid major.minor.revision.build version format`` () = @@ -69,17 +69,17 @@ module ProductVersionTest = v |> productVersionToILVersionInfo |> Assert.areEqual expected let invalidValues () = - [ "1.2.3.4", (1us,2us,3us,4us) - "1.2.3.4a", (1us,2us,3us,0us) - "1.2.c3.4", (1us,2us,0us,0us) - "1.2-d.3.4", (1us,0us,0us,0us) - "1dd.2.3.4", (0us,0us,0us,0us) - "1dd.2da.d3hj.dd4ds", (0us,0us,0us,0us) - "1.5.6.7.dasd", (1us,5us,6us,7us) - "9.3", (9us,3us,0us,0us) - "", (0us,0us,0us,0us) - "70000.80000.90000.100000", (0us,0us,0us,0us) - (sprintf "%d.70000.80000.90000" System.UInt16.MaxValue), (System.UInt16.MaxValue,0us,0us,0us) ] + [ "1.2.3.4", ILVersionInfo(1us,2us,3us,4us) + "1.2.3.4a", ILVersionInfo(1us,2us,3us,0us) + "1.2.c3.4", ILVersionInfo(1us,2us,0us,0us) + "1.2-d.3.4", ILVersionInfo(1us,0us,0us,0us) + "1dd.2.3.4", ILVersionInfo(0us,0us,0us,0us) + "1dd.2da.d3hj.dd4ds", ILVersionInfo(0us,0us,0us,0us) + "1.5.6.7.dasd", ILVersionInfo(1us,5us,6us,7us) + "9.3", ILVersionInfo(9us,3us,0us,0us) + "", ILVersionInfo(0us,0us,0us,0us) + "70000.80000.90000.100000", ILVersionInfo(0us,0us,0us,0us) + (sprintf "%d.70000.80000.90000" System.UInt16.MaxValue), ILVersionInfo(System.UInt16.MaxValue,0us,0us,0us) ] [] let ``should zero starting from first invalid version part`` () = From 2b46085333a5ce513f352dcd4611d507c640c66a Mon Sep 17 00:00:00 2001 From: Will Smith Date: Tue, 2 Apr 2019 19:11:06 -0700 Subject: [PATCH 010/159] When a solution becomes unloaded, we should clear F#'s cache (#6420) --- .../LanguageService/LanguageService.fs | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index 426236543f..da7ae84baf 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -73,6 +73,33 @@ type internal FSharpCheckerWorkspaceServiceFactory member this.Checker = checkerProvider.Checker member this.FSharpProjectOptionsManager = projectInfoManager } +[] +type private FSharpSolutionEvents(projectManager: FSharpProjectOptionsManager) = + + interface IVsSolutionEvents with + + member __.OnAfterCloseSolution(_) = + projectManager.Checker.ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients() + VSConstants.S_OK + + member __.OnAfterLoadProject(_, _) = VSConstants.E_NOTIMPL + + member __.OnAfterOpenProject(_, _) = VSConstants.E_NOTIMPL + + member __.OnAfterOpenSolution(_, _) = VSConstants.E_NOTIMPL + + member __.OnBeforeCloseProject(_, _) = VSConstants.E_NOTIMPL + + member __.OnBeforeCloseSolution(_) = VSConstants.E_NOTIMPL + + member __.OnBeforeUnloadProject(_, _) = VSConstants.E_NOTIMPL + + member __.OnQueryCloseProject(_, _, _) = VSConstants.E_NOTIMPL + + member __.OnQueryCloseSolution(_, _) = VSConstants.E_NOTIMPL + + member __.OnQueryUnloadProject(_, _) = VSConstants.E_NOTIMPL + [, Microsoft.CodeAnalysis.Host.Mef.ServiceLayer.Default)>] type internal FSharpSettingsFactory [] (settings: EditorOptions) = @@ -143,6 +170,8 @@ type internal FSharpPackage() as this = vfsiToolWindow <- this.FindToolWindow(typeof, 0, true) :?> Microsoft.VisualStudio.FSharp.Interactive.FsiToolWindow vfsiToolWindow :> Microsoft.VisualStudio.FSharp.Interactive.ITestVFSI + let mutable solutionEventsOpt = None + // FSI-LINKAGE-POINT: unsited init do Microsoft.VisualStudio.FSharp.Interactive.Hooks.fsiConsoleWindowPackageCtorUnsited (this :> Package) @@ -165,9 +194,13 @@ type internal FSharpPackage() as this = let projectInfoManager = this.ComponentModel.DefaultExportProvider.GetExport().Value let solution = this.GetServiceAsync(typeof).Result let solution = solution :?> IVsSolution + let solutionEvents = FSharpSolutionEvents(projectInfoManager) let rdt = this.GetServiceAsync(typeof).Result let rdt = rdt :?> IVsRunningDocumentTable + solutionEventsOpt <- Some(solutionEvents) + solution.AdviseSolutionEvents(solutionEvents) |> ignore + let projectContextFactory = this.ComponentModel.GetService() let workspace = this.ComponentModel.GetService() let miscFilesWorkspace = this.ComponentModel.GetService() From aed6752ecc08695a95f50ef87286ae0f27d01a41 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Sun, 14 Apr 2019 18:15:55 +0100 Subject: [PATCH 011/159] fix build --- .vsts-pr.yaml | 4 ++-- eng/build.sh | 3 ++- proto.proj | 2 +- src/fsharp/FSharp.Build/FSharp.Build.fsproj | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.vsts-pr.yaml b/.vsts-pr.yaml index d33bdae439..57446ed1e8 100644 --- a/.vsts-pr.yaml +++ b/.vsts-pr.yaml @@ -11,7 +11,7 @@ jobs: _configuration: Release _testKind: testcoreclr steps: - - script: ./eng/cibuild.sh --configuration $(_configuration) --$(_testKind) --verbosity normal + - script: ./eng/cibuild.sh --configuration $(_configuration) --$(_testKind) - task: PublishBuildArtifacts@1 displayName: Publish Build Logs inputs: @@ -55,7 +55,7 @@ jobs: _configuration: Release _testKind: testcoreclr steps: - - script: ./eng/cibuild.sh --configuration $(_configuration) --$(_testKind) --verbosity normal + - script: ./eng/cibuild.sh --configuration $(_configuration) --$(_testKind) - task: PublishBuildArtifacts@1 displayName: Publish Build Logs inputs: diff --git a/eng/build.sh b/eng/build.sh index b874fb842d..ea44f9e923 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -15,6 +15,7 @@ usage() echo "Actions:" echo " --bootstrap Force the build of the bootstrap compiler" echo " --restore Restore projects required to build (short: -r)" + echo " --norestore Don't restore projects required to build (short: -r)" echo " --build Build all projects (short: -b)" echo " --rebuild Rebuild all projects" echo " --pack Build nuget packages" @@ -45,7 +46,7 @@ while [[ -h "$source" ]]; do done scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" -restore=true +restore=false build=false rebuild=false pack=false diff --git a/proto.proj b/proto.proj index e6f7a4f8cc..84103f6fdf 100644 --- a/proto.proj +++ b/proto.proj @@ -8,7 +8,7 @@ TargetFramework=net472 - TargetFramework=netstandard2.0 + TargetFramework=netcoreapp2.1 TargetFramework=net472 diff --git a/src/fsharp/FSharp.Build/FSharp.Build.fsproj b/src/fsharp/FSharp.Build/FSharp.Build.fsproj index f5f297bda7..0dad55058b 100644 --- a/src/fsharp/FSharp.Build/FSharp.Build.fsproj +++ b/src/fsharp/FSharp.Build/FSharp.Build.fsproj @@ -4,8 +4,8 @@ Library - net472;netstandard2.0 - netstandard2.0 + net472;netcoreapp2.1 + netcoreapp2.1 FSharp.Build $(NoWarn);45;55;62;75;1204 true From bb78e5f53dbbf6addf82829cfad9f5614b36fb06 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Sun, 14 Apr 2019 18:18:27 +0100 Subject: [PATCH 012/159] fix build --- .vsts-pr.yaml | 2 +- eng/Build.ps1 | 1 + eng/build.sh | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.vsts-pr.yaml b/.vsts-pr.yaml index 57446ed1e8..eeebe57d08 100644 --- a/.vsts-pr.yaml +++ b/.vsts-pr.yaml @@ -108,7 +108,7 @@ jobs: _configuration: Release _testKind: testVs steps: - - script: eng\CIBuild.cmd -configuration $(_configuration) -$(_testKind) -verbosity normal + - script: eng\CIBuild.cmd -configuration $(_configuration) -$(_testKind) - task: PublishBuildArtifacts@1 displayName: Publish Build Logs inputs: diff --git a/eng/Build.ps1 b/eng/Build.ps1 index 352fd9e058..993adc1d1e 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -65,6 +65,7 @@ function Print-Usage() { Write-Host "" Write-Host "Actions:" Write-Host " -restore Restore packages (short: -r)" + Write-Host " -norestore Don't restore packages" Write-Host " -build Build main solution (short: -b)" Write-Host " -rebuild Rebuild main solution" Write-Host " -pack Build NuGet packages, VS insertion manifests and installer" diff --git a/eng/build.sh b/eng/build.sh index ea44f9e923..6b0ddf324b 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -15,7 +15,7 @@ usage() echo "Actions:" echo " --bootstrap Force the build of the bootstrap compiler" echo " --restore Restore projects required to build (short: -r)" - echo " --norestore Don't restore projects required to build (short: -r)" + echo " --norestore Don't restore projects required to build" echo " --build Build all projects (short: -b)" echo " --rebuild Rebuild all projects" echo " --pack Build nuget packages" From 1aa6a410178ba7f250372dfe170a1958b886ee27 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Mon, 15 Apr 2019 22:34:31 +0100 Subject: [PATCH 013/159] load right FSHarp.Build --- FSharpTests.Directory.Build.props | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/FSharpTests.Directory.Build.props b/FSharpTests.Directory.Build.props index 7c00805dda..8a7a832a43 100644 --- a/FSharpTests.Directory.Build.props +++ b/FSharpTests.Directory.Build.props @@ -32,9 +32,9 @@ - <_FSharpBuildTargetFramework Condition="'$(FSharpTestCompilerVersion)' == 'net40'">net472 - <_FSharpBuildTargetFramework Condition="'$(FSharpTestCompilerVersion)' == 'coreclr'">netcoreapp2.1 - <_FSharpBuildBinPath>$(MSBuildThisFileDirectory)artifacts\bin\FSharp.Build\$(Configuration)\$(_FSharpBuildTargetFramework) + <_FSharpBuildTargetFramework Condition="'$(MSBuildRuntimeType)'!='Core'">net472 + <_FSharpBuildTargetFramework Condition="'$(MSBuildRuntimeType)'=='Core'">netcoreapp2.1 + <_FSharpBuildBinPath>$(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\$(_FSharpBuildTargetFramework) $(_FSharpBuildBinPath)\FSharp.Build.dll From 058bdc9a5a5ab6d9906c80618ae6486dc739434a Mon Sep 17 00:00:00 2001 From: Don Syme Date: Mon, 15 Apr 2019 23:01:00 +0100 Subject: [PATCH 014/159] publish proto apps --- FSharpBuild.Directory.Build.props | 11 +++++------ FSharpTests.Directory.Build.props | 10 +++++----- eng/Build.ps1 | 2 +- eng/build-utils.ps1 | 12 ++++++------ eng/build.sh | 10 +++++----- fcs/Directory.Build.props | 5 ----- proto.proj | 4 ++++ src/buildtools/buildtools.targets | 4 ++-- 8 files changed, 28 insertions(+), 30 deletions(-) diff --git a/FSharpBuild.Directory.Build.props b/FSharpBuild.Directory.Build.props index 905ea66544..515de9bbdc 100644 --- a/FSharpBuild.Directory.Build.props +++ b/FSharpBuild.Directory.Build.props @@ -11,8 +11,7 @@ $(RepoRoot)src $(ArtifactsDir)\SymStore - $(ArtifactsDir)\Bootstrap - $(ArtifactsDir)/bin/fsc/Proto/netcoreapp2.1 + $(ArtifactsDir)\Bootstrap 4.4.0 1182;0025;$(WarningsAsErrors) @@ -96,10 +95,10 @@ - $(ProtoOutputPath)\Microsoft.FSharp.Targets - $(ProtoOutputPath)\Microsoft.FSharp.NetSdk.props - $(ProtoOutputPath)\Microsoft.FSharp.NetSdk.targets - $(ProtoOutputPath)\Microsoft.FSharp.Overrides.NetSdk.targets + $(ProtoOutputPath)\fsc\Microsoft.FSharp.Targets + $(ProtoOutputPath)\fsc\Microsoft.FSharp.NetSdk.props + $(ProtoOutputPath)\fsc\Microsoft.FSharp.NetSdk.targets + $(ProtoOutputPath)\fsc\Microsoft.FSharp.Overrides.NetSdk.targets diff --git a/FSharpTests.Directory.Build.props b/FSharpTests.Directory.Build.props index 8a7a832a43..9ad765f036 100644 --- a/FSharpTests.Directory.Build.props +++ b/FSharpTests.Directory.Build.props @@ -7,11 +7,11 @@ true - $(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\net472 + $(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\net472\publish fsc.exe - $(MSBuildThisFileDirectory)artifacts\bin\fsi\$(Configuration)\net472 + $(MSBuildThisFileDirectory)artifacts\bin\fsi\$(Configuration)\net472\publish fsi.exe @@ -22,19 +22,19 @@ $([System.IO.Path]::GetDirectoryName('$(DOTNET_HOST_PATH)')) dotnet.exe dotnet - $(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\netcoreapp2.1\fsc.exe + $(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\netcoreapp2.1\publish\fsc.exe $([System.IO.Path]::GetDirectoryName('$(DOTNET_HOST_PATH)')) dotnet.exe dotnet - $(MSBuildThisFileDirectory)artifacts\bin\fsi\$(Configuration)\netcoreapp2.1\fsi.exe + $(MSBuildThisFileDirectory)artifacts\bin\fsi\$(Configuration)\netcoreapp2.1\publish\fsi.exe <_FSharpBuildTargetFramework Condition="'$(MSBuildRuntimeType)'!='Core'">net472 <_FSharpBuildTargetFramework Condition="'$(MSBuildRuntimeType)'=='Core'">netcoreapp2.1 - <_FSharpBuildBinPath>$(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\$(_FSharpBuildTargetFramework) + <_FSharpBuildBinPath>$(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\$(_FSharpBuildTargetFramework)\publish $(_FSharpBuildBinPath)\FSharp.Build.dll diff --git a/eng/Build.ps1 b/eng/Build.ps1 index 993adc1d1e..30ef852db7 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -196,7 +196,7 @@ function UpdatePath() { } function VerifyAssemblyVersions() { - $fsiPath = Join-Path $ArtifactsDir "bin\fsi\Proto\net472\fsi.exe" + $fsiPath = Join-Path $ArtifactsDir "bin\fsi\Proto\net472\publish\fsi.exe" # Only verify versions on CI or official build if ($ci -or $official) { diff --git a/eng/build-utils.ps1 b/eng/build-utils.ps1 index 9c626f7c8f..c16e31ebfc 100644 --- a/eng/build-utils.ps1 +++ b/eng/build-utils.ps1 @@ -237,15 +237,15 @@ function Make-BootstrapBuild() { Create-Directory $dir # prepare FsLex and Fsyacc - Run-MSBuild "$RepoRoot\src\buildtools\buildtools.proj" "/restore /t:Build" -logFileName "BuildTools" -configuration $bootstrapConfiguration - Copy-Item "$ArtifactsDir\bin\fslex\$bootstrapConfiguration\netcoreapp2.1\*" -Destination $dir - Copy-Item "$ArtifactsDir\bin\fsyacc\$bootstrapConfiguration\netcoreapp2.1\*" -Destination $dir + Run-MSBuild "$RepoRoot\src\buildtools\buildtools.proj" "/restore /t:Publish" -logFileName "BuildTools" -configuration $bootstrapConfiguration + Copy-Item "$ArtifactsDir\bin\fslex\$bootstrapConfiguration\netcoreapp2.1\publish" -Destination "$dir\fslex" -Force -Recurse + Copy-Item "$ArtifactsDir\bin\fsyacc\$bootstrapConfiguration\netcoreapp2.1\publish" -Destination "$dir\fsyacc" -Force -Recurse # prepare compiler $projectPath = "$RepoRoot\proto.proj" - Run-MSBuild $projectPath "/restore /t:Build" -logFileName "Bootstrap" -configuration $bootstrapConfiguration - Copy-Item "$ArtifactsDir\bin\fsc\$bootstrapConfiguration\$bootstrapTfm\*" -Destination $dir - Copy-Item "$ArtifactsDir\bin\fsi\$bootstrapConfiguration\$bootstrapTfm\*" -Destination $dir + Run-MSBuild $projectPath "/restore /t:Publish" -logFileName "Bootstrap" -configuration $bootstrapConfiguration + Copy-Item "$ArtifactsDir\bin\fsc\$bootstrapConfiguration\$bootstrapTfm\publish" -Destination "$dir\fsc" -Force -Recurse + Copy-Item "$ArtifactsDir\bin\fsi\$bootstrapConfiguration\$bootstrapTfm\publish" -Destination "$dir\fsi" -Force -Recurse return $dir } diff --git a/eng/build.sh b/eng/build.sh index 6b0ddf324b..8a236373f3 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -225,20 +225,20 @@ function BuildSolution { /restore \ /v:$verbosity \ /p:Configuration=$bootstrap_config \ - /t:Build + /t:Publish mkdir -p "$bootstrap_dir" - cp $artifacts_dir/bin/fslex/$bootstrap_config/netcoreapp2.1/* $bootstrap_dir - cp $artifacts_dir/bin/fsyacc/$bootstrap_config/netcoreapp2.1/* $bootstrap_dir + cp -pr $artifacts_dir/bin/fslex/$bootstrap_config/netcoreapp2.1/publish $bootstrap_dir/fslex + cp -pr $artifacts_dir/bin/fsyacc/$bootstrap_config/netcoreapp2.1/publish $bootstrap_dir/fsyacc fi if [ ! -f "$bootstrap_dir/fsc.exe" ]; then MSBuild "$repo_root/proto.proj" \ /restore \ /v:$verbosity \ /p:Configuration=$bootstrap_config \ - /t:Build + /t:Publish - cp $artifacts_dir/bin/fsc/$bootstrap_config/netcoreapp2.1/* $bootstrap_dir + cp -pr $artifacts_dir/bin/fsc/$bootstrap_config/netcoreapp2.1/publish $bootstrap_dir/fsc fi # do real build diff --git a/fcs/Directory.Build.props b/fcs/Directory.Build.props index 596b06c071..4c8aac0a5b 100644 --- a/fcs/Directory.Build.props +++ b/fcs/Directory.Build.props @@ -20,9 +20,4 @@ $(ArtifactsObjDir)\fcs true - - - - $(ArtifactsBinDir)\FSharp.Build\Proto\net472 - diff --git a/proto.proj b/proto.proj index 84103f6fdf..b0ee288977 100644 --- a/proto.proj +++ b/proto.proj @@ -28,6 +28,10 @@ + + + + diff --git a/src/buildtools/buildtools.targets b/src/buildtools/buildtools.targets index 303ab00825..185fd4d059 100644 --- a/src/buildtools/buildtools.targets +++ b/src/buildtools/buildtools.targets @@ -20,7 +20,7 @@ BeforeTargets="CoreCompile"> - $(ArtifactsDir)\Bootstrap\fslex.dll + $(ArtifactsDir)\Bootstrap\fslex\fslex.dll @@ -43,7 +43,7 @@ BeforeTargets="CoreCompile"> - $(ArtifactsDir)\Bootstrap\fsyacc.dll + $(ArtifactsDir)\Bootstrap\fsyacc\fsyacc.dll From 688850f47922d2b9134331d7d4d3c2cf5a04a7e7 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 16 Apr 2019 00:13:17 +0100 Subject: [PATCH 015/159] revert test env changes --- FSharpTests.Directory.Build.props | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/FSharpTests.Directory.Build.props b/FSharpTests.Directory.Build.props index 9ad765f036..7b9242dc0d 100644 --- a/FSharpTests.Directory.Build.props +++ b/FSharpTests.Directory.Build.props @@ -22,19 +22,19 @@ $([System.IO.Path]::GetDirectoryName('$(DOTNET_HOST_PATH)')) dotnet.exe dotnet - $(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\netcoreapp2.1\publish\fsc.exe + $(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\netcoreapp2.1\fsc.exe $([System.IO.Path]::GetDirectoryName('$(DOTNET_HOST_PATH)')) dotnet.exe dotnet - $(MSBuildThisFileDirectory)artifacts\bin\fsi\$(Configuration)\netcoreapp2.1\publish\fsi.exe + $(MSBuildThisFileDirectory)artifacts\bin\fsi\$(Configuration)\netcoreapp2.1\fsi.exe <_FSharpBuildTargetFramework Condition="'$(MSBuildRuntimeType)'!='Core'">net472 <_FSharpBuildTargetFramework Condition="'$(MSBuildRuntimeType)'=='Core'">netcoreapp2.1 - <_FSharpBuildBinPath>$(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\$(_FSharpBuildTargetFramework)\publish + <_FSharpBuildBinPath>$(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\$(_FSharpBuildTargetFramework) $(_FSharpBuildBinPath)\FSharp.Build.dll From c2c7213ed66f7d415db2c1a53249a325b74986bf Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 16 Apr 2019 01:27:25 +0100 Subject: [PATCH 016/159] revert testing changes --- FSharpTests.Directory.Build.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FSharpTests.Directory.Build.props b/FSharpTests.Directory.Build.props index 7b9242dc0d..8a7a832a43 100644 --- a/FSharpTests.Directory.Build.props +++ b/FSharpTests.Directory.Build.props @@ -7,11 +7,11 @@ true - $(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\net472\publish + $(MSBuildThisFileDirectory)artifacts\bin\fsc\$(Configuration)\net472 fsc.exe - $(MSBuildThisFileDirectory)artifacts\bin\fsi\$(Configuration)\net472\publish + $(MSBuildThisFileDirectory)artifacts\bin\fsi\$(Configuration)\net472 fsi.exe From e46dcd5681fdcf52b889c145799dc96a668613ee Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 16 Apr 2019 15:19:09 +0100 Subject: [PATCH 017/159] don't repeat bootstrap --- eng/Build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Build.ps1 b/eng/Build.ps1 index 30ef852db7..04bee5a40d 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -128,7 +128,7 @@ function Process-Arguments() { } function Update-Arguments() { - if (-Not (Test-Path "$ArtifactsDir\Bootstrap\fsc.exe")) { + if (-Not (Test-Path "$ArtifactsDir\Bootstrap\fsc\fsc.exe")) { $script:bootstrap = $True } } From 75e9cc3f7baa083aa3717a0a54bfa61ce0671bfc Mon Sep 17 00:00:00 2001 From: Don Syme Date: Wed, 17 Apr 2019 13:23:04 +0100 Subject: [PATCH 018/159] be systematic about verbosity --- eng/build-utils.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/build-utils.ps1 b/eng/build-utils.ps1 index c16e31ebfc..f85a900729 100644 --- a/eng/build-utils.ps1 +++ b/eng/build-utils.ps1 @@ -178,7 +178,7 @@ function Get-PackageDir([string]$name, [string]$version = "") { return $p } -function Run-MSBuild([string]$projectFilePath, [string]$buildArgs = "", [string]$logFileName = "", [switch]$parallel = $true, [switch]$summary = $true, [switch]$warnAsError = $true, [string]$configuration = $script:configuration) { +function Run-MSBuild([string]$projectFilePath, [string]$buildArgs = "", [string]$logFileName = "", [switch]$parallel = $true, [switch]$summary = $true, [switch]$warnAsError = $true, [string]$configuration = $script:configuration, [string]$verbosity = $script:verbosity) { # Because we override the C#/VB toolset to build against our LKG package, it is important # that we do not reuse MSBuild nodes from other jobs/builds on the machine. Otherwise, # we'll run into issues such as https://github.com/dotnet/roslyn/issues/6211. @@ -190,9 +190,9 @@ function Run-MSBuild([string]$projectFilePath, [string]$buildArgs = "", [string] } if ($summary) { - $args += " /consoleloggerparameters:Verbosity=minimal;summary" + $args += " /consoleloggerparameters:Verbosity=$verbosity;summary" } else { - $args += " /consoleloggerparameters:Verbosity=minimal" + $args += " /consoleloggerparameters:Verbosity=$verbosity" } if ($parallel) { @@ -237,13 +237,13 @@ function Make-BootstrapBuild() { Create-Directory $dir # prepare FsLex and Fsyacc - Run-MSBuild "$RepoRoot\src\buildtools\buildtools.proj" "/restore /t:Publish" -logFileName "BuildTools" -configuration $bootstrapConfiguration + Run-MSBuild "$RepoRoot\src\buildtools\buildtools.proj" "/restore /t:Publish" -logFileName "BuildTools" -configuration $bootstrapConfiguration -verbosity $verbosity Copy-Item "$ArtifactsDir\bin\fslex\$bootstrapConfiguration\netcoreapp2.1\publish" -Destination "$dir\fslex" -Force -Recurse Copy-Item "$ArtifactsDir\bin\fsyacc\$bootstrapConfiguration\netcoreapp2.1\publish" -Destination "$dir\fsyacc" -Force -Recurse # prepare compiler $projectPath = "$RepoRoot\proto.proj" - Run-MSBuild $projectPath "/restore /t:Publish" -logFileName "Bootstrap" -configuration $bootstrapConfiguration + Run-MSBuild $projectPath "/restore /t:Publish" -logFileName "Bootstrap" -configuration $bootstrapConfiguration -verbosity $verbosity Copy-Item "$ArtifactsDir\bin\fsc\$bootstrapConfiguration\$bootstrapTfm\publish" -Destination "$dir\fsc" -Force -Recurse Copy-Item "$ArtifactsDir\bin\fsi\$bootstrapConfiguration\$bootstrapTfm\publish" -Destination "$dir\fsi" -Force -Recurse From 69539f2458a69edbf839afbb71bee04ab00e20a8 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Mon, 22 Apr 2019 15:36:56 -0700 Subject: [PATCH 019/159] hard-code FSharp.Core that ships with legacy project templates (#6611) --- eng/targets/NuGet.targets | 12 ------------ .../VisualFSharpTemplates.csproj | 12 +++++++----- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/eng/targets/NuGet.targets b/eng/targets/NuGet.targets index c2db06b6c1..dc8f32e24d 100644 --- a/eng/targets/NuGet.targets +++ b/eng/targets/NuGet.targets @@ -5,16 +5,4 @@ - - - - - - - - - diff --git a/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj b/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj index b3a4769278..0f3774974e 100644 --- a/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj +++ b/vsintegration/Vsix/VisualFSharpTemplates/VisualFSharpTemplates.csproj @@ -15,17 +15,19 @@ packages\System.ValueTuple.4.4.0.nupkg true + + PreserveNewest + packages\FSharp.Core.4.6.2.nupkg + true + Designer - - packages - PackOutputGroup%3b - false - + + From a5510fb603e5014e8515e4e53ec558b40e415f7c Mon Sep 17 00:00:00 2001 From: Will Smith Date: Tue, 23 Apr 2019 16:54:06 -0700 Subject: [PATCH 020/159] Roslyn Shim - First Phase (#6498) * Trying to use shim * Removed contenttypelangservice, it's in externalaccess now * Added namespace * Added diagnosticanalyzerservice shim * Using Brace matching from external access * Using VSWorkspace extensions * More apis * Using shim for IEditorFormattingService * More apis * More shims * Updating shim * Update VisualFSharp.UnitTests.fsproj * Fixed api call * Fix debugging * Fixed unit test fsproj, find all refs shimmed * Change analyserservice * Fixed build * Updating shim with FSharp prefixes * Fixing glyph helpers * Fixing typemap * Update fsi.fsproj * Update Versions.props * Update RoslynPackageVersion.txt * Update prim-lexing.fs * Update prim-lexing.fs * Update fsi.fsproj * Update fsi.fsproj * Update VisualFSharp.UnitTests.fsproj * Update CompletionProvider.fs * Fixed package --- RoslynPackageVersion.txt | 2 +- eng/Versions.props | 1 + .../Classification/ClassificationService.fs | 5 ++-- .../CodeLens/CodeLensProvider.fs | 3 ++- .../CodeLens/FSharpCodeLensService.fs | 7 ++++-- .../src/FSharp.Editor/Common/ContentType.fs | 9 +------- .../src/FSharp.Editor/Common/Extensions.fs | 4 ++++ .../src/FSharp.Editor/Common/RoslynHelpers.fs | 3 ++- .../Completion/CompletionProvider.fs | 4 ++-- .../Completion/FileSystemCompletion.fs | 3 ++- .../Debugging/BreakpointResolutionService.fs | 14 +++++------ .../Debugging/LanguageDebugInfoService.fs | 16 ++++++------- .../Diagnostics/DocumentDiagnosticAnalyzer.fs | 1 + .../SimplifyNameDiagnosticAnalyzer.fs | 3 ++- .../Diagnostics/UnusedDeclarationsAnalyzer.fs | 3 ++- .../UnusedOpensDiagnosticAnalyzer.fs | 3 ++- .../src/FSharp.Editor/FSharp.Editor.fsproj | 1 + .../Formatting/BraceMatchingService.fs | 7 +++--- .../Formatting/EditorFormattingService.fs | 6 ++--- .../Formatting/IndentationService.fs | 10 ++++---- .../LanguageService/FSharpCheckerProvider.fs | 9 ++++---- .../FSharpProjectOptionsManager.fs | 16 ++++++------- .../LanguageService/LanguageService.fs | 3 ++- .../LanguageService/Tokenizer.fs | 5 ++++ .../Navigation/FindUsagesService.fs | 23 +++++++++---------- .../Navigation/NavigationBarItemService.fs | 4 ++-- .../UnitTests/VisualFSharp.UnitTests.fsproj | 3 +-- 27 files changed, 92 insertions(+), 76 deletions(-) diff --git a/RoslynPackageVersion.txt b/RoslynPackageVersion.txt index f0add9e081..fd1d6f6d9b 100644 --- a/RoslynPackageVersion.txt +++ b/RoslynPackageVersion.txt @@ -1 +1 @@ -3.0.0-beta4-19170-01 +3.1.0-beta3-19222-02 diff --git a/eng/Versions.props b/eng/Versions.props index 35407337ee..3e989e6aa6 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -51,6 +51,7 @@ https://api.nuget.org/v3/index.json; https://dotnet.myget.org/F/roslyn/api/v3/index.json; https://dotnet.myget.org/F/symreader-converter/api/v3/index.json; + https://dotnet.myget.org/F/interactive-window/api/v3/index.json; https://myget.org/F/vs-devcore/api/v3/index.json; https://myget.org/F/vs-editor/api/v3/index.json; https://vside.myget.org/F/vssdk/api/v3/index.json; diff --git a/vsintegration/src/FSharp.Editor/Classification/ClassificationService.fs b/vsintegration/src/FSharp.Editor/Classification/ClassificationService.fs index a9ef2395db..d950a0abbf 100644 --- a/vsintegration/src/FSharp.Editor/Classification/ClassificationService.fs +++ b/vsintegration/src/FSharp.Editor/Classification/ClassificationService.fs @@ -13,6 +13,7 @@ open Microsoft.CodeAnalysis.Classification open Microsoft.CodeAnalysis.Editor open Microsoft.CodeAnalysis.Host.Mef open Microsoft.CodeAnalysis.Text +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Classification // 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 @@ -21,7 +22,7 @@ open Microsoft.CodeAnalysis.Text open FSharp.Compiler.SourceCodeServices -[, FSharpConstants.FSharpLanguageName)>] +[)>] type internal FSharpClassificationService [] ( @@ -30,7 +31,7 @@ type internal FSharpClassificationService ) = static let userOpName = "SemanticColorization" - interface IEditorClassificationService with + interface IFSharpClassificationService with // Do not perform classification if we don't have project options (#defines matter) member __.AddLexicalClassifications(_: SourceText, _: TextSpan, _: List, _: CancellationToken) = () diff --git a/vsintegration/src/FSharp.Editor/CodeLens/CodeLensProvider.fs b/vsintegration/src/FSharp.Editor/CodeLens/CodeLensProvider.fs index 415f9e5fa6..10c7f14ab9 100644 --- a/vsintegration/src/FSharp.Editor/CodeLens/CodeLensProvider.fs +++ b/vsintegration/src/FSharp.Editor/CodeLens/CodeLensProvider.fs @@ -19,6 +19,7 @@ open Microsoft.VisualStudio.Text.Classification open Microsoft.VisualStudio.ComponentModelHost open System.Threading open Microsoft.VisualStudio.FSharp.Editor.Logging +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor.Shared.Utilities [)>] [)>] @@ -32,7 +33,7 @@ type internal CodeLensProvider textDocumentFactory: ITextDocumentFactoryService, checkerProvider: FSharpCheckerProvider, projectInfoManager: FSharpProjectOptionsManager, - typeMap : ClassificationTypeMap Lazy, + typeMap : FSharpClassificationTypeMap Lazy, settings: EditorOptions ) = diff --git a/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs b/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs index f7248253fd..44e9322dff 100644 --- a/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs +++ b/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs @@ -15,6 +15,7 @@ open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Editor.Shared.Extensions open Microsoft.CodeAnalysis.Editor.Shared.Utilities open Microsoft.CodeAnalysis.Classification +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Classification open FSharp.Compiler open FSharp.Compiler.Ast @@ -31,6 +32,8 @@ open Microsoft.VisualStudio.Text.Formatting open Internal.Utilities.StructuredFormat +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor.Shared.Utilities + type internal CodeLens(taggedText, computed, fullTypeSignature, uiElement) = member val TaggedText: Async<(ResizeArray * QuickInfoNavigation) option> = taggedText member val Computed: bool = computed with get, set @@ -46,7 +49,7 @@ type internal FSharpCodeLensService checker: FSharpChecker, projectInfoManager: FSharpProjectOptionsManager, classificationFormatMapService: IClassificationFormatMapService, - typeMap: Lazy, + typeMap: Lazy, codeLens : CodeLensDisplayService, settings: EditorOptions ) as self = @@ -78,7 +81,7 @@ type internal FSharpCodeLensService let layoutTagToFormatting (layoutTag: LayoutTag) = layoutTag |> RoslynHelpers.roslynTag - |> ClassificationTags.GetClassificationTypeName + |> FSharpClassificationTags.GetClassificationTypeName |> typeMap.Value.GetClassificationType |> formatMap.Value.GetTextProperties diff --git a/vsintegration/src/FSharp.Editor/Common/ContentType.fs b/vsintegration/src/FSharp.Editor/Common/ContentType.fs index 71391080b3..2e92332ccb 100644 --- a/vsintegration/src/FSharp.Editor/Common/ContentType.fs +++ b/vsintegration/src/FSharp.Editor/Common/ContentType.fs @@ -6,6 +6,7 @@ open System.ComponentModel.Composition open Microsoft.CodeAnalysis.Editor open Microsoft.VisualStudio.Utilities +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor module FSharpStaticTypeDefinitions = [] @@ -17,11 +18,3 @@ module FSharpStaticTypeDefinitions = [] [] let FSharpSignatureHelpContentTypeDefinition = ContentTypeDefinition() - -[] -type FSharpContentType [](contentTypeRegistry : IContentTypeRegistryService) = - member this.contentTypeRegistryService = contentTypeRegistry - - interface IContentTypeLanguageService with - member this.GetDefaultContentType() = - this.contentTypeRegistryService.GetContentType(FSharpConstants.FSharpContentTypeName) diff --git a/vsintegration/src/FSharp.Editor/Common/Extensions.fs b/vsintegration/src/FSharp.Editor/Common/Extensions.fs index 694d3a401a..222f4b5f09 100644 --- a/vsintegration/src/FSharp.Editor/Common/Extensions.fs +++ b/vsintegration/src/FSharp.Editor/Common/Extensions.fs @@ -11,6 +11,10 @@ open Microsoft.CodeAnalysis.Host open FSharp.Compiler.Text open FSharp.Compiler.Ast open FSharp.Compiler.SourceCodeServices +open Microsoft.CodeAnalysis.ExternalAccess.FSharp + +type private FSharpGlyph = FSharp.Compiler.SourceCodeServices.FSharpGlyph +type private Glyph = Microsoft.CodeAnalysis.ExternalAccess.FSharp.FSharpGlyph type Path with diff --git a/vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs b/vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs index 38d1214267..4d66d133b7 100644 --- a/vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs +++ b/vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs @@ -15,6 +15,7 @@ open FSharp.Compiler.Layout open FSharp.Compiler.SourceCodeServices open FSharp.Compiler.Range open Microsoft.VisualStudio.FSharp.Editor.Logging +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics [] module internal RoslynHelpers = @@ -149,7 +150,7 @@ module internal RoslynHelpers = let severity = if error.Severity = FSharpErrorSeverity.Error then DiagnosticSeverity.Error else DiagnosticSeverity.Warning let customTags = match error.ErrorNumber with - | 1182 -> DiagnosticCustomTags.Unnecessary + | 1182 -> FSharpDiagnosticCustomTags.Unnecessary | _ -> null let descriptor = new DiagnosticDescriptor(id, emptyString, description, error.Subcategory, severity, true, emptyString, String.Empty, customTags) Diagnostic.Create(descriptor, location) diff --git a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs index 4b80da5700..bac38b14a0 100644 --- a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs +++ b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs @@ -156,7 +156,7 @@ type internal FSharpCompletionProvider | _, idents -> Array.last idents let completionItem = - CommonCompletionItem.Create(name, null, glyph = Nullable glyph, rules = getRules intellisenseOptions.ShowAfterCharIsTyped, filterText = filterText) + CommonCompletionItem.Create(name, null, rules = getRules intellisenseOptions.ShowAfterCharIsTyped, glyph = Nullable (Microsoft.CodeAnalysis.ExternalAccess.FSharp.FSharpGlyphHelpersObsolete.Convert(glyph)), filterText = filterText) .AddProperty(FullNamePropName, declarationItem.FullName) let completionItem = @@ -303,4 +303,4 @@ type internal FSharpCompletionProvider } |> Async.map (Option.defaultValue (CompletionChange.Create(TextChange(item.Span, nameInCode)))) - } |> RoslynHelpers.StartAsyncAsTask cancellationToken \ No newline at end of file + } |> RoslynHelpers.StartAsyncAsTask cancellationToken diff --git a/vsintegration/src/FSharp.Editor/Completion/FileSystemCompletion.fs b/vsintegration/src/FSharp.Editor/Completion/FileSystemCompletion.fs index c3dba0e5c8..e92caa22d4 100644 --- a/vsintegration/src/FSharp.Editor/Completion/FileSystemCompletion.fs +++ b/vsintegration/src/FSharp.Editor/Completion/FileSystemCompletion.fs @@ -129,7 +129,8 @@ type internal HashDirectiveCompletionProvider(workspace: Workspace, projectInfoM rules) let pathThroughLastSlash = getPathThroughLastSlash(text, position, quotedPathGroup) - context.AddItems(helper.GetItems(pathThroughLastSlash, ct)) + let! items = helper.GetItemsAsync(pathThroughLastSlash, ct) |> Async.AwaitTask |> liftAsync + context.AddItems(items) } |> Async.Ignore |> RoslynHelpers.StartAsyncUnitAsTask context.CancellationToken diff --git a/vsintegration/src/FSharp.Editor/Debugging/BreakpointResolutionService.fs b/vsintegration/src/FSharp.Editor/Debugging/BreakpointResolutionService.fs index bb55414b10..42bd5f9282 100644 --- a/vsintegration/src/FSharp.Editor/Debugging/BreakpointResolutionService.fs +++ b/vsintegration/src/FSharp.Editor/Debugging/BreakpointResolutionService.fs @@ -13,12 +13,12 @@ open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Editor.Implementation.Debugging open Microsoft.CodeAnalysis.Host.Mef open Microsoft.CodeAnalysis.Text +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor.Implementation.Debugging open FSharp.Compiler.SourceCodeServices open FSharp.Compiler.Range -[] -[, FSharpConstants.FSharpLanguageName)>] +[)>] type internal FSharpBreakpointResolutionService [] ( @@ -41,18 +41,18 @@ type internal FSharpBreakpointResolutionService return parseResults.ValidateBreakpointLocation(mkPos fcsTextLineNumber textLineColumn) } - interface IBreakpointResolutionService with - member this.ResolveBreakpointAsync(document: Document, textSpan: TextSpan, cancellationToken: CancellationToken): Task = + interface IFSharpBreakpointResolutionService with + member this.ResolveBreakpointAsync(document: Document, textSpan: TextSpan, cancellationToken: CancellationToken): Task = asyncMaybe { let! parsingOptions, _options = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document, cancellationToken) let! sourceText = document.GetTextAsync(cancellationToken) let! range = FSharpBreakpointResolutionService.GetBreakpointLocation(checkerProvider.Checker, sourceText, document.Name, textSpan, parsingOptions) let! span = RoslynHelpers.TryFSharpRangeToTextSpan(sourceText, range) - return BreakpointResolutionResult.CreateSpanResult(document, span) + return FSharpBreakpointResolutionResult.CreateSpanResult(document, span) } |> Async.map Option.toObj |> RoslynHelpers.StartAsyncAsTask cancellationToken // FSROSLYNTODO: enable placing breakpoints by when user supplies fully-qualified function names - member this.ResolveBreakpointsAsync(_, _, _): Task> = - Task.FromResult(Enumerable.Empty()) \ No newline at end of file + member this.ResolveBreakpointsAsync(_, _, _): Task> = + Task.FromResult(Enumerable.Empty()) \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/Debugging/LanguageDebugInfoService.fs b/vsintegration/src/FSharp.Editor/Debugging/LanguageDebugInfoService.fs index 62ee7cac94..cf37cf08aa 100644 --- a/vsintegration/src/FSharp.Editor/Debugging/LanguageDebugInfoService.fs +++ b/vsintegration/src/FSharp.Editor/Debugging/LanguageDebugInfoService.fs @@ -13,11 +13,11 @@ open Microsoft.CodeAnalysis.Classification open Microsoft.CodeAnalysis.Editor.Implementation.Debugging open Microsoft.CodeAnalysis.Host.Mef open Microsoft.CodeAnalysis.Text +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor.Implementation.Debugging open FSharp.Compiler -[] -[, FSharpConstants.FSharpLanguageName)>] +[)>] type internal FSharpLanguageDebugInfoService [](projectInfoManager: FSharpProjectOptionsManager) = static member GetDataTipInformation(sourceText: SourceText, position: int, tokens: List): TextSpan option = @@ -44,13 +44,13 @@ type internal FSharpLanguageDebugInfoService [](projectInf | _ -> None - interface ILanguageDebugInfoService with + interface IFSharpLanguageDebugInfoService with // FSROSLYNTODO: This is used to get function names in breakpoint window. It should return fully qualified function name and line offset from the start of the function. - member this.GetLocationInfoAsync(_, _, _): Task = - Task.FromResult(Unchecked.defaultof) + member this.GetLocationInfoAsync(_, _, _): Task = + Task.FromResult(Unchecked.defaultof) - member this.GetDataTipInfoAsync(document: Document, position: int, cancellationToken: CancellationToken): Task = + member this.GetDataTipInfoAsync(document: Document, position: int, cancellationToken: CancellationToken): Task = async { let defines = projectInfoManager.GetCompilationDefinesForEditingDocument(document) let! cancellationToken = Async.CancellationToken @@ -59,8 +59,8 @@ type internal FSharpLanguageDebugInfoService [](projectInf let classifiedSpans = Tokenizer.getClassifiedSpans(document.Id, sourceText, textSpan, Some(document.Name), defines, cancellationToken) let result = match FSharpLanguageDebugInfoService.GetDataTipInformation(sourceText, position, classifiedSpans) with - | None -> DebugDataTipInfo() - | Some textSpan -> DebugDataTipInfo(textSpan, sourceText.GetSubText(textSpan).ToString()) + | None -> FSharpDebugDataTipInfo() + | Some textSpan -> FSharpDebugDataTipInfo(textSpan, sourceText.GetSubText(textSpan).ToString()) return result } |> RoslynHelpers.StartAsyncAsTask(cancellationToken) diff --git a/vsintegration/src/FSharp.Editor/Diagnostics/DocumentDiagnosticAnalyzer.fs b/vsintegration/src/FSharp.Editor/Diagnostics/DocumentDiagnosticAnalyzer.fs index ff3b557985..44b9480595 100644 --- a/vsintegration/src/FSharp.Editor/Diagnostics/DocumentDiagnosticAnalyzer.fs +++ b/vsintegration/src/FSharp.Editor/Diagnostics/DocumentDiagnosticAnalyzer.fs @@ -11,6 +11,7 @@ open System.Threading.Tasks open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Diagnostics open Microsoft.CodeAnalysis.Text +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics open FSharp.Compiler open FSharp.Compiler.SourceCodeServices diff --git a/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs b/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs index fe52ce0b6f..53556c97e7 100644 --- a/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs +++ b/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs @@ -15,6 +15,7 @@ open FSharp.Compiler open FSharp.Compiler.Range open FSharp.Compiler.SourceCodeServices open System.Runtime.Caching +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics type private TextVersionHash = int type private PerDocumentSavedData = { Hash: int; Diagnostics: ImmutableArray } @@ -39,7 +40,7 @@ type internal SimplifyNameDiagnosticAnalyzer() = category = DiagnosticCategory.Style, defaultSeverity = DiagnosticSeverity.Hidden, isEnabledByDefault = true, - customTags = DiagnosticCustomTags.Unnecessary) + customTags = FSharpDiagnosticCustomTags.Unnecessary) static member LongIdentPropertyKey = "FullName" override __.Priority = 100 // Default = 50 diff --git a/vsintegration/src/FSharp.Editor/Diagnostics/UnusedDeclarationsAnalyzer.fs b/vsintegration/src/FSharp.Editor/Diagnostics/UnusedDeclarationsAnalyzer.fs index 082b83444e..58b1b139ff 100644 --- a/vsintegration/src/FSharp.Editor/Diagnostics/UnusedDeclarationsAnalyzer.fs +++ b/vsintegration/src/FSharp.Editor/Diagnostics/UnusedDeclarationsAnalyzer.fs @@ -11,6 +11,7 @@ open System.Threading.Tasks open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Diagnostics open FSharp.Compiler.SourceCodeServices +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics [] type internal UnusedDeclarationsAnalyzer() = @@ -29,7 +30,7 @@ type internal UnusedDeclarationsAnalyzer() = category = DiagnosticCategory.Style, defaultSeverity = DiagnosticSeverity.Hidden, isEnabledByDefault = true, - customTags = DiagnosticCustomTags.Unnecessary) + customTags = FSharpDiagnosticCustomTags.Unnecessary) let isPotentiallyUnusedDeclaration (symbol: FSharpSymbol) : bool = match symbol with diff --git a/vsintegration/src/FSharp.Editor/Diagnostics/UnusedOpensDiagnosticAnalyzer.fs b/vsintegration/src/FSharp.Editor/Diagnostics/UnusedOpensDiagnosticAnalyzer.fs index f530a0fa58..b94f0ca09a 100644 --- a/vsintegration/src/FSharp.Editor/Diagnostics/UnusedOpensDiagnosticAnalyzer.fs +++ b/vsintegration/src/FSharp.Editor/Diagnostics/UnusedOpensDiagnosticAnalyzer.fs @@ -16,6 +16,7 @@ open FSharp.Compiler.Ast open FSharp.Compiler.Range open FSharp.Compiler.SourceCodeServices open Microsoft.VisualStudio.FSharp.Editor.Symbols +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics [] type internal UnusedOpensDiagnosticAnalyzer() = @@ -33,7 +34,7 @@ type internal UnusedOpensDiagnosticAnalyzer() = category = DiagnosticCategory.Style, defaultSeverity = DiagnosticSeverity.Hidden, isEnabledByDefault = true, - customTags = DiagnosticCustomTags.Unnecessary) + customTags = FSharpDiagnosticCustomTags.Unnecessary) override __.Priority = 90 // Default = 50 override __.SupportedDiagnostics = ImmutableArray.Create Descriptor diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index 5f78b10980..d6b712757b 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -136,6 +136,7 @@ + diff --git a/vsintegration/src/FSharp.Editor/Formatting/BraceMatchingService.fs b/vsintegration/src/FSharp.Editor/Formatting/BraceMatchingService.fs index a5e6332cb0..794fd5de36 100644 --- a/vsintegration/src/FSharp.Editor/Formatting/BraceMatchingService.fs +++ b/vsintegration/src/FSharp.Editor/Formatting/BraceMatchingService.fs @@ -7,8 +7,9 @@ open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.Editor open FSharp.Compiler.SourceCodeServices open System.Runtime.InteropServices +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor -[] +[)>] type internal FSharpBraceMatchingService [] ( @@ -33,7 +34,7 @@ type internal FSharpBraceMatchingService return matchedBraces |> Array.tryFind(fun (left, right) -> isPositionInRange left || isPositionInRange right) } - interface IBraceMatcher with + interface IFSharpBraceMatcher with member this.FindBracesAsync(document, position, cancellationToken) = asyncMaybe { let! parsingOptions, _options = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document, cancellationToken) @@ -41,7 +42,7 @@ type internal FSharpBraceMatchingService let! (left, right) = FSharpBraceMatchingService.GetBraceMatchingResult(checkerProvider.Checker, sourceText, document.Name, parsingOptions, position, defaultUserOpName) let! leftSpan = RoslynHelpers.TryFSharpRangeToTextSpan(sourceText, left) let! rightSpan = RoslynHelpers.TryFSharpRangeToTextSpan(sourceText, right) - return BraceMatchingResult(leftSpan, rightSpan) + return FSharpBraceMatchingResult(leftSpan, rightSpan) } |> Async.map Option.toNullable |> RoslynHelpers.StartAsyncAsTask cancellationToken diff --git a/vsintegration/src/FSharp.Editor/Formatting/EditorFormattingService.fs b/vsintegration/src/FSharp.Editor/Formatting/EditorFormattingService.fs index 25f3038da5..4cc4b10c5a 100644 --- a/vsintegration/src/FSharp.Editor/Formatting/EditorFormattingService.fs +++ b/vsintegration/src/FSharp.Editor/Formatting/EditorFormattingService.fs @@ -10,13 +10,13 @@ open Microsoft.CodeAnalysis.Editor open Microsoft.CodeAnalysis.Formatting open Microsoft.CodeAnalysis.Host.Mef open Microsoft.CodeAnalysis.Text +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor open FSharp.Compiler.SourceCodeServices open System.Threading open System.Windows.Forms -[] -[, FSharpConstants.FSharpLanguageName)>] +[)>] type internal FSharpEditorFormattingService [] ( @@ -170,7 +170,7 @@ type internal FSharpEditorFormattingService return toIList Seq.empty } - interface IEditorFormattingService with + interface IFSharpEditorFormattingService with member val SupportsFormatDocument = false member val SupportsFormatSelection = false member val SupportsFormatOnPaste = true diff --git a/vsintegration/src/FSharp.Editor/Formatting/IndentationService.fs b/vsintegration/src/FSharp.Editor/Formatting/IndentationService.fs index 0426832ce3..a888518523 100644 --- a/vsintegration/src/FSharp.Editor/Formatting/IndentationService.fs +++ b/vsintegration/src/FSharp.Editor/Formatting/IndentationService.fs @@ -11,11 +11,11 @@ open Microsoft.CodeAnalysis.Editor open Microsoft.CodeAnalysis.Formatting open Microsoft.CodeAnalysis.Host.Mef open Microsoft.CodeAnalysis.Text +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor open FSharp.Compiler.SourceCodeServices -[] -[, FSharpConstants.FSharpLanguageName)>] +[)>] type internal FSharpIndentationService [] (projectInfoManager: FSharpProjectOptionsManager) = @@ -92,8 +92,8 @@ type internal FSharpIndentationService lastIndent } - interface ISynchronousIndentationService with - member this.GetDesiredIndentation(document: Document, lineNumber: int, cancellationToken: CancellationToken): Nullable = + interface IFSharpSynchronousIndentationService with + member this.GetDesiredIndentation(document: Document, lineNumber: int, cancellationToken: CancellationToken): Nullable = async { let! cancellationToken = Async.CancellationToken let! sourceText = document.GetTextAsync(cancellationToken) |> Async.AwaitTask @@ -105,5 +105,5 @@ type internal FSharpIndentationService return match indent with | None -> Nullable() - | Some(indentation) -> Nullable(IndentationResult(sourceText.Lines.[lineNumber].Start, indentation)) + | Some(indentation) -> Nullable(FSharpIndentationResult(sourceText.Lines.[lineNumber].Start, indentation)) } |> (fun c -> Async.RunSynchronously(c,cancellationToken=cancellationToken)) diff --git a/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerProvider.fs b/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerProvider.fs index b0af16b99f..b43e5caf14 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerProvider.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerProvider.fs @@ -13,6 +13,8 @@ open Microsoft.VisualStudio.FSharp.Editor open Microsoft.VisualStudio.LanguageServices open Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem open FSharp.NativeInterop +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.LanguageServices +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics #nowarn "9" // NativePtr.toNativeInt @@ -21,15 +23,14 @@ open FSharp.NativeInterop type internal FSharpCheckerProvider [] ( - analyzerService: IDiagnosticAnalyzerService, - [)>] workspace: VisualStudioWorkspaceImpl, + analyzerService: IFSharpDiagnosticAnalyzerService, + [)>] workspace: VisualStudioWorkspace, settings: EditorOptions ) = let tryGetMetadataSnapshot (path, timeStamp) = try - let metadataReferenceProvider = workspace.Services.GetService() - let md = metadataReferenceProvider.GetMetadata(path, timeStamp) + let md = Microsoft.CodeAnalysis.ExternalAccess.FSharp.LanguageServices.FSharpVisualStudioWorkspaceExtensions.GetMetadata(workspace, path, timeStamp) let amd = (md :?> AssemblyMetadata) let mmd = amd.GetModules().[0] let mmr = mmd.GetMetadataReader() diff --git a/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs b/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs index a14ef35873..9d9542087a 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs @@ -20,11 +20,12 @@ open Microsoft.VisualStudio.Shell open System.Threading open Microsoft.VisualStudio.Shell.Interop open Microsoft.VisualStudio.LanguageServices.Implementation.TaskList +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.LanguageServices [] module private FSharpProjectOptionsHelpers = - let mapCpsProjectToSite(workspace:VisualStudioWorkspaceImpl, project:Project, serviceProvider:System.IServiceProvider, cpsCommandLineOptions: IDictionary) = + let mapCpsProjectToSite(workspace:VisualStudioWorkspace, project:Project, serviceProvider:System.IServiceProvider, cpsCommandLineOptions: IDictionary) = let hier = workspace.GetHierarchy(project.Id) let sourcePaths, referencePaths, options = match cpsCommandLineOptions.TryGetValue(project.Id) with @@ -108,7 +109,7 @@ type private FSharpProjectOptionsMessage = | ClearSingleFileOptionsCache of DocumentId [] -type private FSharpProjectOptionsReactor (workspace: VisualStudioWorkspaceImpl, settings: EditorOptions, serviceProvider, checkerProvider: FSharpCheckerProvider) = +type private FSharpProjectOptionsReactor (workspace: VisualStudioWorkspace, settings: EditorOptions, serviceProvider, checkerProvider: FSharpCheckerProvider) = let cancellationTokenSource = new CancellationTokenSource() // Hack to store command line options from HandleCommandLineChanges @@ -322,7 +323,7 @@ type internal FSharpProjectOptionsManager [] ( checkerProvider: FSharpCheckerProvider, - [)>] workspace: VisualStudioWorkspaceImpl, + [)>] workspace: VisualStudioWorkspace, [)>] serviceProvider: System.IServiceProvider, settings: EditorOptions ) = @@ -387,11 +388,10 @@ type internal FSharpProjectOptionsManager use _logBlock = Logger.LogBlock(LogEditorFunctionId.LanguageService_HandleCommandLineArgs) 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 + match Microsoft.CodeAnalysis.ExternalAccess.FSharp.LanguageServices.FSharpVisualStudioWorkspaceExtensions.TryGetProjectIdByBinPath(workspace, path) with + | true, projectId -> projectId + | false, _ -> Microsoft.CodeAnalysis.ExternalAccess.FSharp.LanguageServices.FSharpVisualStudioWorkspaceExtensions.GetOrCreateProjectIdForPath(workspace, path, projectDisplayNameOf path) + let path = Microsoft.CodeAnalysis.ExternalAccess.FSharp.LanguageServices.FSharpVisualStudioWorkspaceExtensions.GetProjectFilePath(workspace, projectId); let fullPath p = if Path.IsPathRooted(p) || path = null then p else Path.Combine(Path.GetDirectoryName(path), p) diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index da7ae84baf..c568091aea 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -37,6 +37,7 @@ open Microsoft.VisualStudio.Shell.Interop open Microsoft.VisualStudio.ComponentModelHost open Microsoft.VisualStudio.Text.Outlining open FSharp.NativeInterop +open Microsoft.CodeAnalysis.ExternalAccess.FSharp #nowarn "9" // NativePtr.toNativeInt @@ -236,7 +237,7 @@ type internal FSharpLanguageService(package : FSharpPackage) = override this.Initialize() = base.Initialize() - this.Workspace.Options <- this.Workspace.Options.WithChangedOption(Completion.CompletionOptions.BlockForCompletionItems, FSharpConstants.FSharpLanguageName, false) + this.Workspace.Options <- this.Workspace.Options.WithChangedOption(Completion.FSharpCompletionOptions.BlockForCompletionItems, FSharpConstants.FSharpLanguageName, false) this.Workspace.Options <- this.Workspace.Options.WithChangedOption(Shared.Options.ServiceFeatureOnOffOptions.ClosedFileDiagnostic, FSharpConstants.FSharpLanguageName, Nullable false) let theme = package.ComponentModel.DefaultExportProvider.GetExport().Value diff --git a/vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs b/vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs index 66a3a22a63..bb2ce53559 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs @@ -20,6 +20,11 @@ open FSharp.Compiler.SourceCodeServices open Microsoft.VisualStudio.Core.Imaging open Microsoft.VisualStudio.Imaging +open Microsoft.CodeAnalysis.ExternalAccess.FSharp + +type private FSharpGlyph = FSharp.Compiler.SourceCodeServices.FSharpGlyph +type private Glyph = Microsoft.CodeAnalysis.ExternalAccess.FSharp.FSharpGlyph + [] type internal LexerSymbolKind = | Ident = 0 diff --git a/vsintegration/src/FSharp.Editor/Navigation/FindUsagesService.fs b/vsintegration/src/FSharp.Editor/Navigation/FindUsagesService.fs index 584c6217c4..2286cd0644 100644 --- a/vsintegration/src/FSharp.Editor/Navigation/FindUsagesService.fs +++ b/vsintegration/src/FSharp.Editor/Navigation/FindUsagesService.fs @@ -7,15 +7,14 @@ open System.Collections.Immutable open System.Composition open Microsoft.CodeAnalysis -open Microsoft.CodeAnalysis.Completion -open Microsoft.CodeAnalysis.Host.Mef -open Microsoft.CodeAnalysis.Editor.FindUsages -open Microsoft.CodeAnalysis.FindUsages +open Microsoft.CodeAnalysis.ExternalAccess.FSharp +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.FindUsages +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor.FindUsages open FSharp.Compiler.Range open FSharp.Compiler.SourceCodeServices -[, FSharpConstants.FSharpLanguageName); Shared>] +[)>] type internal FSharpFindUsagesService [] ( @@ -40,14 +39,14 @@ type internal FSharpFindUsagesService match RoslynHelpers.TryFSharpRangeToTextSpan(sourceText, range) with | Some span -> let span = Tokenizer.fixupSpan(sourceText, span) - return Some (DocumentSpan(doc, span)) + return Some (FSharpDocumentSpan(doc, span)) | None -> return None }) |> Async.Parallel return spans |> Array.choose id |> Array.toList } - let findReferencedSymbolsAsync(document: Document, position: int, context: IFindUsagesContext, allReferences: bool, userOpName: string) : Async = + let findReferencedSymbolsAsync(document: Document, position: int, context: IFSharpFindUsagesContext, allReferences: bool, userOpName: string) : Async = asyncMaybe { let! sourceText = document.GetTextAsync(context.CancellationToken) |> Async.AwaitTask |> liftAsync let checker = checkerProvider.Checker @@ -60,7 +59,7 @@ type internal FSharpFindUsagesService let! symbol = Tokenizer.getSymbolAtPosition(document.Id, sourceText, position, document.FilePath, defines, SymbolLookupKind.Greedy, false) let! symbolUse = checkFileResults.GetSymbolUseAtLocation(lineNumber, symbol.Ident.idRange.EndColumn, textLine, symbol.FullIsland, userOpName=userOpName) let! declaration = checkFileResults.GetDeclarationLocation (lineNumber, symbol.Ident.idRange.EndColumn, textLine, symbol.FullIsland, false, userOpName=userOpName) |> liftAsync - let tags = GlyphTags.GetTags(Tokenizer.GetGlyphForSymbol (symbolUse.Symbol, symbol.Kind)) + let tags = GlyphTags.GetTags(Microsoft.CodeAnalysis.ExternalAccess.FSharp.FSharpGlyphHelpersObsolete.Convert(Tokenizer.GetGlyphForSymbol (symbolUse.Symbol, symbol.Kind))) let declarationRange = match declaration with @@ -77,14 +76,14 @@ type internal FSharpFindUsagesService return match declarationSpans with | [] -> - [ DefinitionItem.CreateNonNavigableItem( + [ FSharpDefinitionItem.CreateNonNavigableItem( tags, ImmutableArray.Create(TaggedText(TextTags.Text, symbol.Ident.idText)), ImmutableArray.Create(TaggedText(TextTags.Assembly, symbolUse.Symbol.Assembly.SimpleName))) ] | _ -> declarationSpans |> List.map (fun span -> - DefinitionItem.Create(tags, ImmutableArray.Create(TaggedText(TextTags.Text, symbol.Ident.idText)), span)) + FSharpDefinitionItem.Create(tags, ImmutableArray.Create(TaggedText(TextTags.Text, symbol.Ident.idText)), span)) } |> liftAsync for definitionItem in definitionItems do @@ -121,13 +120,13 @@ type internal FSharpFindUsagesService | _ -> for referenceDocSpan in referenceDocSpans do for definitionItem in definitionItems do - let referenceItem = SourceReferenceItem(definitionItem, referenceDocSpan, true) // defaulting to `true` until we can officially determine if this usage is a write + let referenceItem = FSharpSourceReferenceItem(definitionItem, referenceDocSpan) do! context.OnReferenceFoundAsync(referenceItem) |> Async.AwaitTask |> liftAsync () } |> Async.Ignore - interface IFindUsagesService with + interface IFSharpFindUsagesService with member __.FindReferencesAsync(document, position, context) = findReferencedSymbolsAsync(document, position, context, true, userOpName) |> RoslynHelpers.StartAsyncUnitAsTask(context.CancellationToken) diff --git a/vsintegration/src/FSharp.Editor/Navigation/NavigationBarItemService.fs b/vsintegration/src/FSharp.Editor/Navigation/NavigationBarItemService.fs index f80d10422d..42d5820d19 100644 --- a/vsintegration/src/FSharp.Editor/Navigation/NavigationBarItemService.fs +++ b/vsintegration/src/FSharp.Editor/Navigation/NavigationBarItemService.fs @@ -47,9 +47,9 @@ type internal FSharpNavigationBarItemService |> Array.choose (fun decl -> rangeToTextSpan(decl.Range) |> Option.map(fun textSpan -> - NavigationBarSymbolItem(decl.Name, decl.RoslynGlyph, [| textSpan |], null) :> NavigationBarItem)) + NavigationBarSymbolItem(decl.Name, Microsoft.CodeAnalysis.ExternalAccess.FSharp.FSharpGlyphHelpersObsolete.Convert(decl.RoslynGlyph), [| textSpan |], null) :> NavigationBarItem)) - NavigationBarSymbolItem(topLevelDecl.Declaration.Name, topLevelDecl.Declaration.RoslynGlyph, [| topLevelTextSpan |], childItems) + NavigationBarSymbolItem(topLevelDecl.Declaration.Name, Microsoft.CodeAnalysis.ExternalAccess.FSharp.FSharpGlyphHelpersObsolete.Convert(topLevelDecl.Declaration.RoslynGlyph), [| topLevelTextSpan |], childItems) :> NavigationBarItem)) :> IList<_> } |> Async.map (Option.defaultValue emptyResult) diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj index 8810e56d67..413e40c118 100644 --- a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj @@ -165,8 +165,6 @@ Roslyn\DocumentHighlightsServiceTests.fs - - PreserveNewest @@ -252,6 +250,7 @@ + From e3e148c795356e7a55059c5b09e03e82645d625b Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Mon, 29 Apr 2019 11:37:46 -0700 Subject: [PATCH 021/159] update vs minor version (#6649) --- eng/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index 3e989e6aa6..e80315e3e4 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -25,7 +25,7 @@ 16 - 1 + 2 $(VSMajorVersion).0 $(VSMajorVersion).$(VSMinorVersion).0 $(VSAssemblyVersionPrefix).0 From 42526fe359672a05fd562dc16a91a43d0fe047a7 Mon Sep 17 00:00:00 2001 From: v-mdriml Date: Fri, 3 May 2019 18:38:15 +0200 Subject: [PATCH 022/159] LOC CHECKIN | Microsoft/visualfsharp dev16.1 | 20190503 (#6676) --- src/fsharp/fsi/xlf/FSIstrings.txt.cs.xlf | 4 +- src/fsharp/fsi/xlf/FSIstrings.txt.de.xlf | 2 +- src/fsharp/fsi/xlf/FSIstrings.txt.es.xlf | 4 +- src/fsharp/fsi/xlf/FSIstrings.txt.ja.xlf | 8 +- src/fsharp/fsi/xlf/FSIstrings.txt.tr.xlf | 10 +- src/fsharp/fsi/xlf/FSIstrings.txt.zh-Hans.xlf | 12 +- src/fsharp/xlf/FSComp.txt.cs.xlf | 14 +- src/fsharp/xlf/FSComp.txt.de.xlf | 20 +-- src/fsharp/xlf/FSComp.txt.es.xlf | 16 +-- src/fsharp/xlf/FSComp.txt.fr.xlf | 12 +- src/fsharp/xlf/FSComp.txt.it.xlf | 26 ++-- src/fsharp/xlf/FSComp.txt.ja.xlf | 10 +- src/fsharp/xlf/FSComp.txt.ko.xlf | 10 +- src/fsharp/xlf/FSComp.txt.pl.xlf | 14 +- src/fsharp/xlf/FSComp.txt.pt-BR.xlf | 10 +- src/fsharp/xlf/FSComp.txt.ru.xlf | 12 +- src/fsharp/xlf/FSComp.txt.tr.xlf | 12 +- src/fsharp/xlf/FSComp.txt.zh-Hans.xlf | 124 +++++++++--------- src/fsharp/xlf/FSComp.txt.zh-Hant.xlf | 10 +- src/fsharp/xlf/FSStrings.cs.xlf | 2 +- src/fsharp/xlf/FSStrings.es.xlf | 2 +- src/fsharp/xlf/FSStrings.fr.xlf | 2 +- src/fsharp/xlf/FSStrings.it.xlf | 2 +- src/fsharp/xlf/FSStrings.ko.xlf | 2 +- src/fsharp/xlf/FSStrings.pl.xlf | 2 +- src/fsharp/xlf/FSStrings.tr.xlf | 2 +- src/fsharp/xlf/FSStrings.zh-Hans.xlf | 6 +- .../Template/xlf/Tutorial.fsx.cs.xlf | 2 +- .../Template/xlf/Tutorial.fsx.de.xlf | 2 +- .../Template/xlf/Tutorial.fsx.it.xlf | 4 +- .../Template/xlf/Tutorial.fsx.pl.xlf | 6 +- .../Template/xlf/Tutorial.fsx.tr.xlf | 6 +- .../Template/xlf/Tutorial.fsx.zh-Hans.xlf | 10 +- ...rosoft.VisualStudio.Package.Project.cs.xlf | 4 +- ...rosoft.VisualStudio.Package.Project.de.xlf | 2 +- ...rosoft.VisualStudio.Package.Project.it.xlf | 6 +- .../xlf/MenusAndCommands.vsct.ja.xlf | 14 +- .../xlf/MenusAndCommands.vsct.tr.xlf | 8 +- .../xlf/MenusAndCommands.vsct.zh-Hans.xlf | 6 +- .../xlf/VSPackage.cs.xlf | 2 +- .../xlf/VSPackage.de.xlf | 10 +- .../xlf/VSPackage.es.xlf | 4 +- .../xlf/VSPackage.ja.xlf | 6 +- .../xlf/VSPackage.ko.xlf | 2 +- .../xlf/VSPackage.tr.xlf | 6 +- .../xlf/VSPackage.zh-Hans.xlf | 14 +- .../xlf/VSPackage.zh-Hant.xlf | 2 +- .../xlf/ApplicationPropPage.zh-Hans.xlf | 8 +- .../xlf/BuildEventsPropPage.zh-Hans.xlf | 4 +- .../PropertyPages/xlf/BuildPropPage.cs.xlf | 4 +- .../PropertyPages/xlf/BuildPropPage.es.xlf | 2 +- .../xlf/ReferencePathsPropPage.it.xlf | 2 +- ...osoft.VisualStudio.Editors.Designer.cs.xlf | 5 +- ...osoft.VisualStudio.Editors.Designer.de.xlf | 1 - ...osoft.VisualStudio.Editors.Designer.es.xlf | 3 +- ...osoft.VisualStudio.Editors.Designer.fr.xlf | 5 +- ...osoft.VisualStudio.Editors.Designer.it.xlf | 9 +- ...osoft.VisualStudio.Editors.Designer.ja.xlf | 3 +- ...osoft.VisualStudio.Editors.Designer.ko.xlf | 5 +- ...osoft.VisualStudio.Editors.Designer.pl.xlf | 7 +- ...ft.VisualStudio.Editors.Designer.pt-BR.xlf | 1 - ...osoft.VisualStudio.Editors.Designer.ru.xlf | 1 - ...osoft.VisualStudio.Editors.Designer.tr.xlf | 5 +- ....VisualStudio.Editors.Designer.zh-Hans.xlf | 25 ++-- ....VisualStudio.Editors.Designer.zh-Hant.xlf | 1 - .../src/FSharp.UIResources/xlf/Strings.it.xlf | 2 +- .../xlf/Strings.zh-Hans.xlf | 2 +- .../src/FSharp.VS.FSI/xlf/Properties.cs.xlf | 4 +- .../src/FSharp.VS.FSI/xlf/Properties.de.xlf | 2 +- .../src/FSharp.VS.FSI/xlf/Properties.ja.xlf | 6 +- .../src/FSharp.VS.FSI/xlf/Properties.tr.xlf | 6 +- .../FSharp.VS.FSI/xlf/Properties.zh-Hans.xlf | 6 +- .../FSharp.VS.FSI/xlf/VFSIstrings.txt.ja.xlf | 4 +- .../FSharp.VS.FSI/xlf/VFSIstrings.txt.tr.xlf | 4 +- .../xlf/VFSIstrings.txt.zh-Hans.xlf | 4 +- 75 files changed, 292 insertions(+), 305 deletions(-) diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.cs.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.cs.xlf index 2567d3f26f..c43178fe80 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.cs.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.cs.xlf @@ -99,7 +99,7 @@ A problem occurred starting the F# Interactive process. This may be due to a known problem with background process console support for Unicode-enabled applications on some Windows systems. Try selecting Tools->Options->F# Interactive for Visual Studio and enter '--fsi-server-no-unicode'. - Při spuštění procesu F# Interactive se vyskytl problém. Ten mohly způsobit známé potíže s podporou konzoly procesu na pozadí pro aplikace umožňující kódování Unicode v některých systémech Windows. V případě Visual Studia zkuste vybrat Nástroje->Možnosti->F# Interactive a zadat: --fsi-server-no-unicode. + Při spuštění procesu F# Interactive se vyskytl problém. Ten mohly způsobit známé potíže s podporou konzoly procesu na pozadí pro aplikace umožňující kódování Unicode v některých systémech Windows. V případě sady Visual Studio zkuste vybrat Nástroje->Možnosti->F# Interactive a zadat: --fsi-server-no-unicode. @@ -264,7 +264,7 @@ Prevents references from being locked by the F# Interactive process - Znemožňuje zamknutí referencí interaktivním procesem jazyka F#. + Znemožňuje zamknutí referencí procesem F# Interactive. diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.de.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.de.xlf index 6c4abe48cc..404171af9a 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.de.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.de.xlf @@ -264,7 +264,7 @@ Prevents references from being locked by the F# Interactive process - Verhindert, dass Verweise vom interaktiven Prozess F# gesperrt werden + Verhindert, dass Verweise vom F# Interactive-Prozess gesperrt werden. diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.es.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.es.xlf index a43b278bb1..0ba7ef163b 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.es.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.es.xlf @@ -139,7 +139,7 @@ F# Interactive directives: - Directivas de F#: + Directivas de F# interactivo: @@ -259,7 +259,7 @@ F# Interactive for F# {0} - F# Interactive para F# {0} + F# interactivo para F# {0} diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.ja.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.ja.xlf index 060deb1247..0751b4601e 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.ja.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.ja.xlf @@ -99,7 +99,7 @@ A problem occurred starting the F# Interactive process. This may be due to a known problem with background process console support for Unicode-enabled applications on some Windows systems. Try selecting Tools->Options->F# Interactive for Visual Studio and enter '--fsi-server-no-unicode'. - F# Interactive のプロセスの開始中に問題が発生しました。この原因は、一部の Windows システム上での Unicode 対応アプリケーションのバックグラウンド プロセス コンソールのサポートに関する既知の問題にある可能性があります。[ツール]5D; の [オプション]5D; から [F# Interactive for Visual Studio]5D; を選択し、「--fsi-server-no-unicode」と入力してください。 + F# インタラクティブのプロセスの開始中に問題が発生しました。この原因は、一部の Windows システム上での Unicode 対応アプリケーションのバックグラウンド プロセス コンソールのサポートに関する既知の問題にある可能性があります。[ツール]5D; の [オプション]5D; から [F# Interactive for Visual Studio]5D; を選択し、「--fsi-server-no-unicode」と入力してください。 @@ -214,7 +214,7 @@ --> Referenced '{0}' (file may be locked by F# Interactive process) - --> '{0}' を参照しました (ファイルが F# Interactive のプロセスによってロックされている可能性があります) + --> '{0}' を参照しました (ファイルが F# インタラクティブのプロセスによってロックされている可能性があります) @@ -259,12 +259,12 @@ F# Interactive for F# {0} - F# {0} の F# Interactive + F# {0} の F# インタラクティブ Prevents references from being locked by the F# Interactive process - 参照が F# 対話型プロセスによってロックされないようにします。 + 参照が F# インタラクティブ プロセスによってロックされないようにします。 diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.tr.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.tr.xlf index 2a499f85b8..61fb0cee68 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.tr.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.tr.xlf @@ -99,7 +99,7 @@ A problem occurred starting the F# Interactive process. This may be due to a known problem with background process console support for Unicode-enabled applications on some Windows systems. Try selecting Tools->Options->F# Interactive for Visual Studio and enter '--fsi-server-no-unicode'. - F# Interactive işlemi başlatılırken bir sorun oluştu. Bu durum, bazı Windows sistemlerindeki Unicode kullanan uygulamalara yönelik arka plan işlemi konsol desteğinde bilinen bir soruna bağlı olabilir. Visual Studio için Araçlar->Seçenekler->F# Interactive'i seçmeyi deneyin ve '--fsi-server-no-unicode' girin. + F# Etkileşimli işlemi başlatılırken bir sorun oluştu. Bu durum, bazı Windows sistemlerindeki Unicode kullanan uygulamalara yönelik arka plan işlemi konsol desteğinde bilinen bir soruna bağlı olabilir. Visual Studio için Araçlar->Seçenekler->F# Etkileşimli'yi seçmeyi deneyin ve '--fsi-server-no-unicode' girin. @@ -139,7 +139,7 @@ F# Interactive directives: - F# Interactive yönergeleri: + F# Etkileşimli yönergeleri: @@ -214,7 +214,7 @@ --> Referenced '{0}' (file may be locked by F# Interactive process) - --> '{0}' öğesine başvuruldu (dosya F# Interactive işlemi tarafından kilitlenmiş olabilir) + --> '{0}' öğesine başvuruldu (dosya F# Etkileşimli işlemi tarafından kilitlenmiş olabilir) @@ -254,12 +254,12 @@ Microsoft (R) F# Interactive version {0} - Microsoft (R) F# Interactive sürüm {0} + Microsoft (R) F# Etkileşimli sürüm {0} F# Interactive for F# {0} - F# {0} için F# Interactive + F# {0} için F# Etkileşimli diff --git a/src/fsharp/fsi/xlf/FSIstrings.txt.zh-Hans.xlf b/src/fsharp/fsi/xlf/FSIstrings.txt.zh-Hans.xlf index 5d81aa592b..4a8085973e 100644 --- a/src/fsharp/fsi/xlf/FSIstrings.txt.zh-Hans.xlf +++ b/src/fsharp/fsi/xlf/FSIstrings.txt.zh-Hans.xlf @@ -99,7 +99,7 @@ A problem occurred starting the F# Interactive process. This may be due to a known problem with background process console support for Unicode-enabled applications on some Windows systems. Try selecting Tools->Options->F# Interactive for Visual Studio and enter '--fsi-server-no-unicode'. - 启动 F# 交互进程时发生问题。此情况可能是由一个已知问题导致的,即某些 Windows 系统上的后台进程控制台不支持启用了 Unicode 的应用程序。请尝试选择“工具”->“选项”->“F# 交互 for Visual Studio”,然后输入“--fsi-server-no-unicode”。 + 启动 F# 交互窗口进程时发生问题。此情况可能是由一个已知问题导致的,即某些 Windows 系统上的后台进程控制台不支持启用了 Unicode 的应用程序。请尝试选择“工具”->“选项”->“Visual Studio 的 F# 交互窗口”,然后输入“--fsi-server-no-unicode”。 @@ -139,7 +139,7 @@ F# Interactive directives: - F# 交互窗口指令: + F# 交互窗口指令: @@ -174,7 +174,7 @@ F# Interactive command line options: - F# 交互命令行选项: + F# 交互窗口命令行选项: @@ -214,7 +214,7 @@ --> Referenced '{0}' (file may be locked by F# Interactive process) - --> 已引用“{0}”(文件可能由 F# 交互进程锁定) + --> 已引用“{0}”(文件可能由 F# 交互窗口进程锁定) @@ -254,7 +254,7 @@ Microsoft (R) F# Interactive version {0} - Microsoft(R) F# 交互版本 {0} + Microsoft(R) F# 交互窗口版本 {0} @@ -264,7 +264,7 @@ Prevents references from being locked by the F# Interactive process - 防止引用被 F# 交互式进程锁定 + 防止引用被 F# 交互窗口进程锁定 diff --git a/src/fsharp/xlf/FSComp.txt.cs.xlf b/src/fsharp/xlf/FSComp.txt.cs.xlf index faca9cae45..0cfb2d98ab 100644 --- a/src/fsharp/xlf/FSComp.txt.cs.xlf +++ b/src/fsharp/xlf/FSComp.txt.cs.xlf @@ -314,7 +314,7 @@ An implementation of file or module '{0}' has already been given. Compilation order is significant in F# because of type inference. You may need to adjust the order of your files to place the signature file before the implementation. In Visual Studio files are type-checked in the order they appear in the project file, which can be edited manually or adjusted using the solution explorer. - Implementace souboru nebo modulu {0} už je zadaná. V F# záleží na pořadí kompilace, a to kvůli odvození typů proměnných. Pořadí souborů můžete upravit a podpisový soubor umístit před implementaci. Ve Visual Studiu se typ souborů kontroluje v tom pořadí, ve kterém se soubory objeví v souboru projektu, který se dá upravit ručně nebo pomocí Průzkumníka řešení. + Implementace souboru nebo modulu {0} už je zadaná. V F# záleží na pořadí kompilace, a to kvůli odvození typů proměnných. Pořadí souborů můžete upravit a podpisový soubor umístit před implementaci. V sadě Visual Studio se typ souborů kontroluje v tom pořadí, ve kterém se soubory objeví v souboru projektu, který se dá upravit ručně nebo pomocí Průzkumníka řešení. @@ -4459,7 +4459,7 @@ Specify target framework profile of this assembly. Valid values are mscorlib, netcore or netstandard. Default - mscorlib - Zadejte profil cílového rozhraní tohoto sestavení. Platné hodnoty jsou mscorlib, netcore nebo netstandard. Výchozí je mscorlib. + Zadejte profil cílové architektury tohoto sestavení. Platné hodnoty jsou mscorlib, netcore nebo netstandard. Výchozí je mscorlib. @@ -6834,7 +6834,7 @@ Used instead of let for values that implement IDisposable - Používá se místo výrazu let u hodnot, které k uvolnění prostředků vyžadují volání funkce Dispose. + Používá se místo let pro hodnoty, které implementují IDisposable. @@ -7134,22 +7134,22 @@ No implementation was given for those members: {0} - No implementation was given for those members: {0} + Následující členy nemají žádnou implementaci: {0} No implementation was given for those members: {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - No implementation was given for those members: {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. + Následující členy nemají žádnou implementaci: {0} Všechny členy rozhraní je potřeba implementovat a uvést pod příslušnou deklarací interface, třeba takto: interface ... with member ... No implementation was given for those members (some results omitted): {0} - No implementation was given for those members (some results omitted): {0} + Následující členy nemají žádnou implementaci (některé výsledky jsou vynechané): {0} No implementation was given for those members (some results omitted): {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - No implementation was given for those members (some results omitted): {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. + Následující členy nemají žádnou implementaci (některé výsledky jsou vynechané): {0} Všechny členy rozhraní je potřeba implementovat a uvést pod příslušnou deklarací interface, třeba takto: interface ... with member ... diff --git a/src/fsharp/xlf/FSComp.txt.de.xlf b/src/fsharp/xlf/FSComp.txt.de.xlf index 8bb6848ede..04982fb19a 100644 --- a/src/fsharp/xlf/FSComp.txt.de.xlf +++ b/src/fsharp/xlf/FSComp.txt.de.xlf @@ -2794,7 +2794,7 @@ Syntax error - unexpected '?' symbol - Syntaxfehler - unerwartetes Symbol "?". + Syntaxfehler – unerwartetes Symbol "?". @@ -4414,7 +4414,7 @@ Unknown --test argument: '{0}' - Unbekannt - Testargument: '{0}' + Unbekannt – Testargument: '{0}' @@ -5444,7 +5444,7 @@ Code in this assembly makes uses of quotation literals. Static linking may not include components that make use of quotation literals unless all assemblies are compiled with at least F# 4.0. - Der Code in dieser Assembly verwendet Quotation-Literale. Statische Verknüpfungen schließen unter Umständen Komponenten nicht ein, die Quotation-Literale verwenden, sofern nicht alle Assemblys mindestens mit F# kompiliert sind. + Der Code in dieser Assembly verwendet Quotation-Literale. Statische Verknüpfungen schließen unter Umständen Komponenten nicht ein, die Quotation-Literale verwenden, sofern nicht alle Assemblys mindestens mit F# 4.0 kompiliert sind. @@ -6599,7 +6599,7 @@ Used to convert to a type that is lower in the inheritance chain. - Wird zum Konvertieren in einen Typ verwendet, der in Vererbungskette niedriger ist. + Wird zum Konvertieren in einen Typ verwendet, der in Vererbungskette höher ist. @@ -6829,12 +6829,12 @@ Used to convert to a type that is higher in the inheritance chain. - Wird zum Konvertieren in einen Typ verwendet, der in Vererbungskette höher ist. + Wird zum Konvertieren in einen Typ verwendet, der in Vererbungskette niedriger ist. Used instead of let for values that implement IDisposable - Wird anstelle von "let" für Werte verwendet, bei denen die "Dispose" zum Freigeben von Ressourcen erforderlich ist. + Wird anstelle von "let" für Werte verwendet, die die IDisposable-Schnittstelle implementieren @@ -7134,22 +7134,22 @@ No implementation was given for those members: {0} - No implementation was given for those members: {0} + Für folgende Member wurde keine Implementierung angegeben: {0} No implementation was given for those members: {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - No implementation was given for those members: {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. + Für folgende Member wurde keine Implementierung angegeben: {0} Beachten Sie, dass alle Schnittstellenmember implementiert und in einer entsprechenden interface-Deklaration aufgeführt werden müssen, z.B. "interface ... with member ...". No implementation was given for those members (some results omitted): {0} - No implementation was given for those members (some results omitted): {0} + Für folgende Member wurde keine Implementierung angegeben (einige Ergebnisse ausgelassen): {0} No implementation was given for those members (some results omitted): {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - No implementation was given for those members (some results omitted): {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. + Für folgende Member wurde keine Implementierung angegeben (einige Ergebnisse ausgelassen): {0} Beachten Sie, dass alle Schnittstellenmember implementiert und in einer entsprechenden interface-Deklaration aufgeführt werden müssen, z.B. "interface ... with member ...". diff --git a/src/fsharp/xlf/FSComp.txt.es.xlf b/src/fsharp/xlf/FSComp.txt.es.xlf index 87e9fb2e57..42394fcf56 100644 --- a/src/fsharp/xlf/FSComp.txt.es.xlf +++ b/src/fsharp/xlf/FSComp.txt.es.xlf @@ -2209,7 +2209,7 @@ The syntax '(typ,...,typ) ident' is not used in F# code. Consider using 'ident<typ,...,typ>' instead - La sintaxis "(typ,..., typ) ident" no se utiliza en código de F #. Considere el uso de "ident<typ,...,typ>" en lugar + La sintaxis "(typ,..., typ) ident" no se utiliza en código de F#. Considere el uso de "ident<typ,...,typ>" en lugar @@ -4614,7 +4614,7 @@ The event '{0}' has a non-standard type. If this event is declared in another CLI language, you may need to access this event using the explicit {1} and {2} methods for the event. If this event is declared in F#, make the type of the event an instantiation of either 'IDelegateEvent<_>' or 'IEvent<_,_>'. - El evento "{0}" tiene un tipo no estándar. Si este evento se declara en otro lenguaje CLI, puede que necesite acceder a este evento con los métodos {1} y {2} explícitos para el evento. Si este evento se declara en F #, cree instancias del evento de "IDelegateEvent<_>" o "IEvent<_,_>". + El evento "{0}" tiene un tipo no estándar. Si este evento se declara en otro lenguaje CLI, puede que necesite acceder a este evento con los métodos {1} y {2} explícitos para el evento. Si este evento se declara en F#, cree instancias del evento de "IDelegateEvent<_>" o "IEvent<_,_>". @@ -6834,7 +6834,7 @@ Used instead of let for values that implement IDisposable - Se usa en lugar de let para los valores que requieren que se llame a Dispose para liberar recursos. + Utilizado en lugar de let para valores que implementan IDisposable @@ -6994,7 +6994,7 @@ A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. - La referencia de un puntero byref devuelto por una función o un método se elimina implícitamente a partir de F # 4.5. Para adquirir el valor de retorno como un puntero, use el operador address-of, por ejemplo, "&f(x)' or '&obj.Method(arg1, arg2)". + La referencia de un puntero byref devuelto por una función o un método se elimina implícitamente a partir de F# 4.5. Para adquirir el valor de retorno como un puntero, use el operador address-of, por ejemplo, "&f(x)' or '&obj.Method(arg1, arg2)". @@ -7134,22 +7134,22 @@ No implementation was given for those members: {0} - No implementation was given for those members: {0} + No se ha proporcionado ninguna implementación para esos miembros: {0} No implementation was given for those members: {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - No implementation was given for those members: {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. + No se ha proporcionado ninguna implementación para esos miembros: {0}Tenga en cuenta que todos los miembros de la interfaz deben implementarse y enumerarse en una declaracón "interface" adecuada; por ejemplo, "interface ... with member ...". No implementation was given for those members (some results omitted): {0} - No implementation was given for those members (some results omitted): {0} + No se ofreció ninguna implementación para esos miembros (se omitieron algunos resultados): {0} No implementation was given for those members (some results omitted): {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - No implementation was given for those members (some results omitted): {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. + No se ofreció ninguna implementación para esos miembros (se omitieron algunos resultados): {0} Tenga en cuenta que todos los miembros de la interfaz deben implementarse y enumerarse bajo una declaración de "interface" apropiada; por ejemplo, "interface ... with member ...". diff --git a/src/fsharp/xlf/FSComp.txt.fr.xlf b/src/fsharp/xlf/FSComp.txt.fr.xlf index 839d65654b..29de56bc3c 100644 --- a/src/fsharp/xlf/FSComp.txt.fr.xlf +++ b/src/fsharp/xlf/FSComp.txt.fr.xlf @@ -6834,7 +6834,7 @@ Used instead of let for values that implement IDisposable - Utilisé à la place de let pour les valeurs qui nécessitent l'appel de Dispose pour libérer des ressources. + Utilisé au lieu de let pour les valeurs qui implémentent IDisposable @@ -7064,7 +7064,7 @@ The exception '{0}' does not have a field named '{1}'. - L'exception '{0}' n'a pas pas de champ nommé '{1}'. + L'exception '{0}' n'a pas de champ nommé '{1}'. @@ -7134,22 +7134,22 @@ No implementation was given for those members: {0} - No implementation was given for those members: {0} + Aucune implémentation pour ces membres : {0} No implementation was given for those members: {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - No implementation was given for those members: {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. + Aucune implémentation pour ces membres : {0} Notez que tous les membres d'interface doivent être implémentés et listés sous une déclaration 'interface' appropriée, par ex., 'interface ... with member ...'. No implementation was given for those members (some results omitted): {0} - No implementation was given for those members (some results omitted): {0} + Aucune implémentation pour ces membres (certains résultats sont omis) : {0} No implementation was given for those members (some results omitted): {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - No implementation was given for those members (some results omitted): {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. + Aucune implémentation pour ces membres (certains résultats sont omis) : {0} Notez que tous les membres d'interface doivent être implémentés et listés sous une déclaration 'interface' appropriée, par ex., 'interface ... with member ... '. diff --git a/src/fsharp/xlf/FSComp.txt.it.xlf b/src/fsharp/xlf/FSComp.txt.it.xlf index b0fe478b71..895e05abab 100644 --- a/src/fsharp/xlf/FSComp.txt.it.xlf +++ b/src/fsharp/xlf/FSComp.txt.it.xlf @@ -564,7 +564,7 @@ Module '{0}' contains\n {1} \nbut its signature specifies\n {2} \nOne is a constructor/property and the other is not - Il modulo '{0}' contiene\n {1} \ntuttavia la relativa firma specifica\n {2} \nUno è un costruttore o una proprietà, l'altro no. + Il modulo '{0}' contiene\n {1} \nma la relativa firma specifica\n {2} \nUno è un costruttore o una proprietà, l'altro no @@ -1879,7 +1879,7 @@ Only '#' compiler directives may occur prior to the first 'namespace' declaration - Prima della prima dichiarazione 'namespace' possono essere presenti solo direttive '#' del compilatore. + Prima della prima dichiarazione 'namespace' possono essere presenti solo direttive '#' del compilatore @@ -2929,7 +2929,7 @@ It is recommended that objects supporting the IDisposable interface are created using the syntax 'new Type(args)', rather than 'Type(args)' or 'Type' as a function value representing the constructor, to indicate that resources may be owned by the generated value - Per indicare che le risorse possono essere di proprietà del valore generato, è consigliabile usare la sintassi 'new Type(args)', invece di 'Type(args)' o di 'Type' come valore della funzione che rappresenta il costruttore, per creare oggetti che supportano l'interfaccia IDisposable. + Per indicare che le risorse possono essere di proprietà del valore generato, è consigliabile usare la sintassi 'new Type(args)', invece di 'Type(args)' o di 'Type' come valore della funzione che rappresenta il costruttore, per creare oggetti che supportano l'interfaccia IDisposable @@ -4104,7 +4104,7 @@ Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed - Firma pubblicamente l'assembly usando solo la parte pubblica della chiave con nome sicuro e contrassegna l'assembly come firmato. + Firma pubblicamente l'assembly usando solo la parte pubblica della chiave con nome sicuro e contrassegna l'assembly come firmato @@ -4524,7 +4524,7 @@ property - Proprietà. + proprietà @@ -5329,7 +5329,7 @@ Unmatched '<'. Expected closing '>' - '<' non corrispondente. È previsto '>' di chiusura + '<' senza corrispondenza. È previsto '>' di chiusura @@ -5954,7 +5954,7 @@ Unmatched '[<'. Expected closing '>]' - [<' non corrispondente. È previsto '>]' di chiusura + '[<' senza corrispondenza. È previsto '>]' di chiusura @@ -6139,7 +6139,7 @@ In queries, use the form 'for x in n .. m do ...' for ranging over integers - Nelle query utilizzare il formato 'for x in n .. m do ...' per gestire interi + Nelle query usare il formato 'for x in n .. m do ...' per gestire interi @@ -6834,7 +6834,7 @@ Used instead of let for values that implement IDisposable - Usata al posto di let per valori con i quali è necessario chiamare Dispose per liberare risorse. + Usata al posto di let per valori che implementano IDisposable @@ -7134,22 +7134,22 @@ No implementation was given for those members: {0} - No implementation was given for those members: {0} + Non è stata specificata alcuna implementazione per tali membri: {0} No implementation was given for those members: {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - No implementation was given for those members: {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. + Non è stata specificata alcuna implementazione per tali membri: {0}. Si noti che tutti i membri dell'interfaccia devono essere implementati ed elencati in una dichiarazione 'interface' appropriata, ad esempio 'interface ... with member ...'. No implementation was given for those members (some results omitted): {0} - No implementation was given for those members (some results omitted): {0} + Non è stata specificata alcuna implementazione per tali membri (alcuni risultati sono stati omessi): {0} No implementation was given for those members (some results omitted): {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - No implementation was given for those members (some results omitted): {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. + Non è stata specificata alcuna implementazione per tali membri (alcuni risultati sono stati omessi): {0}. Si noti che tutti i membri dell'interfaccia devono essere implementati ed elencati in una dichiarazione 'interface' appropriata, ad esempio 'interface ... with member ...'. diff --git a/src/fsharp/xlf/FSComp.txt.ja.xlf b/src/fsharp/xlf/FSComp.txt.ja.xlf index 2d65a31b30..0098b70599 100644 --- a/src/fsharp/xlf/FSComp.txt.ja.xlf +++ b/src/fsharp/xlf/FSComp.txt.ja.xlf @@ -6836,7 +6836,7 @@ Used instead of let for values that implement IDisposable - Dispose を呼び出してリソースを解放する必要のある値に対して、let の代わりに使用します。 + IDisposable を実装する値に対して let の代わりに使用します @@ -7136,22 +7136,22 @@ No implementation was given for those members: {0} - No implementation was given for those members: {0} + これらのメンバーに実装が指定されていません: {0} No implementation was given for those members: {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - No implementation was given for those members: {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. + これらのメンバーに実装が指定されていません: {0} すべてのインターフェイス メンバーは実装され、適切な 'interface' 宣言でリストされている必要があります。例: 'interface ... with member ...'。 No implementation was given for those members (some results omitted): {0} - No implementation was given for those members (some results omitted): {0} + これらのメンバーに実装が指定されていません (一部の結果が省略されました): {0} No implementation was given for those members (some results omitted): {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - No implementation was given for those members (some results omitted): {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. + これらのメンバーに実装が指定されていません (一部の結果が省略されました): {0} すべてのインターフェイス メンバーは実装され、適切な 'interface' 宣言でリストされている必要があります。例: 'interface ... with member ...'。 diff --git a/src/fsharp/xlf/FSComp.txt.ko.xlf b/src/fsharp/xlf/FSComp.txt.ko.xlf index 1bb2aea5e3..b0407a28c8 100644 --- a/src/fsharp/xlf/FSComp.txt.ko.xlf +++ b/src/fsharp/xlf/FSComp.txt.ko.xlf @@ -6834,7 +6834,7 @@ Used instead of let for values that implement IDisposable - 무료 리소스로 호출하기 위해 Dispose가 필요한 값에 대해 let 대신 사용됩니다. + IDisposable을 구현하는 값에 let 대신 사용되었습니다. @@ -7134,22 +7134,22 @@ No implementation was given for those members: {0} - No implementation was given for those members: {0} + 멤버 {0}에 지정된 구현이 없습니다. No implementation was given for those members: {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - No implementation was given for those members: {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. + 멤버 {0}에 지정된 구현이 없습니다. 모든 인터페이스 멤버가 구현되어 적절한 'interface' 선언에 나열되어야 합니다(예: 'interface ... with member ...'). No implementation was given for those members (some results omitted): {0} - No implementation was given for those members (some results omitted): {0} + 멤버 {0}에 지정된 구현이 없습니다(일부 결과는 생략됨). No implementation was given for those members (some results omitted): {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - No implementation was given for those members (some results omitted): {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. + 멤버 {0}에 지정된 구현이 없습니다(일부 결과는 생략됨). 모든 인터페이스 멤버가 구현되어 적절한 'interface' 선언에 나열되어야 합니다(예: 'interface ... with member ...'). diff --git a/src/fsharp/xlf/FSComp.txt.pl.xlf b/src/fsharp/xlf/FSComp.txt.pl.xlf index 17011e1f05..2ad815fba0 100644 --- a/src/fsharp/xlf/FSComp.txt.pl.xlf +++ b/src/fsharp/xlf/FSComp.txt.pl.xlf @@ -4799,7 +4799,7 @@ Unexpected empty long identifier - Nieoczekiwany pusty, długi identyfikator + Nieoczekiwany pusty długi identyfikator @@ -6184,7 +6184,7 @@ Too many static parameters. Expected at most {0} parameters, but got {1} unnamed and {2} named parameters. - Zbyt wiele parametrów statycznych. Oczekiwano co najwyżej następującej liczby parametrów: {0}, ale uzyskano następującą liczbę parametrów nienazwanych i nazwanych: {1} i {2} . + Zbyt wiele parametrów statycznych. Oczekiwano co najwyżej następującej liczby parametrów: {0}, ale uzyskano następującą liczbę parametrów nienazwanych i nazwanych: {1} i {2}. @@ -6834,7 +6834,7 @@ Used instead of let for values that implement IDisposable - Używane zamiast instrukcji let na potrzeby wartości, które wymagają wywołania operacji Dispose w celu zwolnienia zasobów. + Używane zamiast powiązania let dla wartości implementujących interfejs IDisposable @@ -7134,22 +7134,22 @@ No implementation was given for those members: {0} - No implementation was given for those members: {0} + Nie podano implementacji dla tych składowych: {0} No implementation was given for those members: {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - No implementation was given for those members: {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. + Nie podano implementacji dla tych składowych: {0}Pamiętaj, że wszystkie składowe interfejsu muszą być zaimplementowane i wymienione w ramach odpowiedniej deklaracji „interface”, np. „interface ... with member ...”. No implementation was given for those members (some results omitted): {0} - No implementation was given for those members (some results omitted): {0} + Nie podano implementacji dla tych składowych (niektóre wyniki zostały pominięte): {0} No implementation was given for those members (some results omitted): {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - No implementation was given for those members (some results omitted): {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. + Nie podano implementacji dla tych składowych (niektóre wyniki zostały pominięte): {0}Pamiętaj, że wszystkie składowe interfejsów muszą być zaimplementowane i wymienione w ramach odpowiedniej deklaracji „interface” np. „interface ... with member ...”. diff --git a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf index c76d196107..c115ac1ca7 100644 --- a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf +++ b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf @@ -6834,7 +6834,7 @@ Used instead of let for values that implement IDisposable - Usado ao invés de let para valores que necessitam que Dispose seja chamado para liberar recursos. + Used em vez de let para valores que implementam IDisposable @@ -7134,22 +7134,22 @@ No implementation was given for those members: {0} - No implementation was given for those members: {0} + Implementação não foi concedida para os membros: {0} No implementation was given for those members: {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - No implementation was given for those members: {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. + Implementação não concedida para os membros: {0} Todos os membros de interface devem ser implementados e listados em uma declaração de 'interface' apropriada, por exemplo, 'interface ... com membro ...'. No implementation was given for those members (some results omitted): {0} - No implementation was given for those members (some results omitted): {0} + Implementação não concedida para os membros (alguns resultados omitidos): {0} No implementation was given for those members (some results omitted): {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - No implementation was given for those members (some results omitted): {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. + Implementação não concedida para os membros (alguns resultados omitidos): {0} Todos os membros de interface devem ser implementados e listados em uma declaração de 'interface' apropriada, por exemplo, 'interface ... com o membro...'. diff --git a/src/fsharp/xlf/FSComp.txt.ru.xlf b/src/fsharp/xlf/FSComp.txt.ru.xlf index 49a5c38261..3e2c3bcb0c 100644 --- a/src/fsharp/xlf/FSComp.txt.ru.xlf +++ b/src/fsharp/xlf/FSComp.txt.ru.xlf @@ -2759,7 +2759,7 @@ This union case expects {0} arguments in tupled form - Для данного случая объединения требуется {0} аргументов в форме кортежа + Для данного случая объединения требуется {0} аргументов в форме кортежа @@ -6834,7 +6834,7 @@ Used instead of let for values that implement IDisposable - Используется вместо let для значений, требующих вызова Dispose для освобождения ресурсов. + Используется вместо let для значений, которые реализуют IDisposable @@ -7134,22 +7134,22 @@ No implementation was given for those members: {0} - No implementation was given for those members: {0} + Реализация для этих членов отсутствует: {0} No implementation was given for those members: {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - No implementation was given for those members: {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. + Реализация для этих членов отсутствует: {0}Обратите внимание, что каждый член интерфейса должен быть реализован и указан в соответствующем объявлении "interface", например, "интерфейс ... с членом ...". No implementation was given for those members (some results omitted): {0} - No implementation was given for those members (some results omitted): {0} + Реализация для этих членов отсутствует (некоторые результаты опущены): {0} No implementation was given for those members (some results omitted): {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - No implementation was given for those members (some results omitted): {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. + Реализация для этих членов отсутствует (некоторые результаты опущены): {0}Обратите внимание, что каждый член интерфейса должен быть реализован и указан в соответствующем объявлении "interface", например, "интерфейс ... с членом ...". diff --git a/src/fsharp/xlf/FSComp.txt.tr.xlf b/src/fsharp/xlf/FSComp.txt.tr.xlf index f302bb7137..0a8b20d966 100644 --- a/src/fsharp/xlf/FSComp.txt.tr.xlf +++ b/src/fsharp/xlf/FSComp.txt.tr.xlf @@ -1944,7 +1944,7 @@ Syntax error - sözdizimi hatası + Söz dizimi hatası @@ -6834,7 +6834,7 @@ Used instead of let for values that implement IDisposable - Dispose'un boş kaynaklara çağrılmasını gerektiren değerler için let yerine kullanılır. + IDisposable uygulayan değerler için let yerine kullanılır @@ -7134,22 +7134,22 @@ No implementation was given for those members: {0} - No implementation was given for those members: {0} + Bu üyelere uygulama verilmedi: {0} No implementation was given for those members: {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - No implementation was given for those members: {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. + Bu üyelere uygulama verilmedi: {0}Tüm arabirim üyelerinin uygulanması ve uygun bir "arabirim" bildirimi (ör. "arabirim ... ile üye ..." kapsamında listelenmesi gerektiğini unutmayın. No implementation was given for those members (some results omitted): {0} - No implementation was given for those members (some results omitted): {0} + Bu üyelere uygulama verilmedi (bazı sonuçlar atlandı): {0} No implementation was given for those members (some results omitted): {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - No implementation was given for those members (some results omitted): {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. + Bu üyelere uygulama verilmedi (bazı sonuçlar atlandı): {0}Tüm arabirim üyelerinin uygulanması ve uygun bir "arabirim" bildirimi (ör. "arabirim ... ile üye ..." kapsamında listelenmesi gerektiğini unutmayın. diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf index 1626b50c11..b4ec2dadff 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf @@ -209,7 +209,7 @@ Unrecognized privacy setting '{0}' for managed resource, valid options are 'public' and 'private' - 无法识别的托管资源隐私设置“{0}”,有效的选项为“public”和“private” + 无法识别的受管理资源隐私设置“{0}”,有效的选项为 "public" 和 "private" @@ -229,12 +229,12 @@ The declarations in this file will be placed in an implicit module '{0}' based on the file name '{1}'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. - 此文件中的声明将置于基于文件名“{1}”的隐式模块“{0}”中。但由于这不是一个有效的 F# 标识符,因此将无法从其他文件访问该内容。请考虑重命名此文件或在文件的顶部添加“module”或“namespace”声明。 + 此文件中的声明将置于基于文件名“{1}”的隐式模块“{0}”中。但由于这不是一个有效的 F# 标识符,因此将无法从其他文件访问该内容。请考虑重命名此文件或在文件的顶部添加 "module" 或 "namespace" 声明。 Files in libraries or multiple-file applications must begin with a namespace or module declaration, e.g. 'namespace SomeNamespace.SubNamespace' or 'module SomeNamespace.SomeModule'. Only the last source file of an application may omit such a declaration. - 库或多文件应用程序中的文件必须以命名空间或模块声明开头,例如 “namespace SomeNamespace.SubNamespace”或“module SomeNamespace.SomeModule”。仅应用程序的最后一个源文件可以忽略此类声明。 + 库或多文件应用程序中的文件必须以命名空间或模块声明开头,例如 "namespace SomeNamespace.SubNamespace" 或 "module SomeNamespace.SomeModule"。仅应用程序的最后一个源文件可以忽略此类声明。 @@ -244,7 +244,7 @@ This file contains multiple declarations of the form 'module SomeNamespace.SomeModule'. Only one declaration of this form is permitted in a file. Change your file to use an initial namespace declaration and/or use 'module ModuleName = ...' to define your modules. - 此文件包含形式为“module SomeNamespace.SomeModule”的多个声明。一个文件中只能有一个此形式的声明。将您的文件更改为使用初始命名空间声明并且/或者使用“module ModuleName = ...”定义模块。 + 此文件包含形式为 "module SomeNamespace.SomeModule" 的多个声明。一个文件中只能有一个此形式的声明。将您的文件更改为使用初始命名空间声明并且/或者使用 "module ModuleName = ..." 定义模块。 @@ -264,12 +264,12 @@ Could not resolve assembly '{0}' - 未能解析程序集“{0}” + 无法解析程序集“{0}” Could not resolve assembly '{0}' required by '{1}' - 未能解析“{1}”所需的程序集“{0}” + 无法解析“{1}”所需的程序集“{0}” @@ -299,7 +299,7 @@ Invalid directive. Expected '#time', '#time \"on\"' or '#time \"off\"'. - 指令无效。应为“#time”、“#time \"on\"”或“#time \"off\"”。 + 指令无效。应为 '#time'、'#time \"on\"' 或 '#time \"off\"'。 @@ -324,7 +324,7 @@ The signature file '{0}' does not have a corresponding implementation file. If an implementation file exists then check the 'module' and 'namespace' declarations in the signature and implementation files match. - 签名文件“{0}”没有相应的实现文件。如果存在实现文件,则检查签名文件和实现文件中的“module”和“namespace”声明是否匹配。 + 签名文件“{0}”没有相应的实现文件。如果存在实现文件,则检查签名文件和实现文件中的 "module" 和 "namespace" 声明是否匹配。 @@ -349,7 +349,7 @@ Error reading/writing metadata for the F# compiled DLL '{0}'. Was the DLL compiled with an earlier version of the F# compiler? (error: '{1}'). - 读取/写入 F# 编译的 DLL“{0}”时出错。是否使用了早期版本的 F# 编译器编译 DLL? (错误: “{1}”)。 + 读取/写入 F# 编译的 DLL“{0}”的元数据时出错。是否使用了早期版本的 F# 编译器编译 DLL? (错误: “{1}”)。 @@ -409,7 +409,7 @@ Invalid mutation of a constant expression. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...'. - 常数表达式的变化无效。请考虑将该表达式复制一个可变的本地变量,例如“let mutable x = ...”。 + 常数表达式的变化无效。请考虑将该表达式复制一个可变的本地变量,例如 "let mutable x = ..."。 @@ -769,17 +769,17 @@ The module contains the field\n {0} \nbut its signature specifies\n {1} \nThe 'static' modifiers differ - 该模块包含字段\n {0} \n而其签名指定\n {1} \n“static”修饰符不同 + 该模块包含字段\n {0} \n而其签名指定\n {1} \n"static" 修饰符不同 The module contains the field\n {0} \nbut its signature specifies\n {1} \nThe 'mutable' modifiers differ - 该模块包含字段\n {0} \n而其签名指定\n {1} \n“mutable”修饰符不同 + 该模块包含字段\n {0} \n而其签名指定\n {1} \n"mutable" 修饰符不同 The module contains the field\n {0} \nbut its signature specifies\n {1} \nThe 'literal' modifiers differ - 该模块包含字段\n {0} \n而其签名指定\n {1} \n“literal”修饰符不同 + 该模块包含字段\n {0} \n而其签名指定\n {1} \n"literal" 修饰符不同 @@ -794,17 +794,17 @@ Could not resolve the ambiguity inherent in the use of a 'printf'-style format string - 未能解析使用“printf”样式的格式字符串所产生的固有多义性 + 未能解析使用 "printf" 样式的格式字符串所产生的固有多义性 Could not resolve the ambiguity in the use of a generic construct with an 'enum' constraint at or near this position - 未能解析在此位置或其附近使用带“enum”约束的泛型构造所产生的多义性 + 未能解析在此位置或其附近使用带 "enum" 约束的泛型构造所产生的多义性 Could not resolve the ambiguity in the use of a generic construct with a 'delegate' constraint at or near this position - 未能解析在此位置或其附近使用带“delegate”约束的泛型构造所产生的多义性 + 未能解析在此位置或其附近使用带 "delegate" 约束的泛型构造所产生的多义性 @@ -834,27 +834,27 @@ The type '{0}' implements 'System.IComparable'. Consider also adding an explicit override for 'Object.Equals' - 类型“{0}”实现“System.IComparable”。请考虑同时添加“Object.Equals”的显式重写 + 类型“{0}”实现 "System.IComparable"。请考虑同时添加 "Object.Equals" 的显式重写 The type '{0}' implements 'System.IComparable' explicitly but provides no corresponding override for 'Object.Equals'. An implementation of 'Object.Equals' has been automatically provided, implemented via 'System.IComparable'. Consider implementing the override 'Object.Equals' explicitly - 类型“{0}”显式实现“System.IComparable”,但未提供相对应的“Object.Equals”的重写。已自动提供“Object.Equals”的实现(通过“System.IComparable”实现)。请考虑显式实现重写“Object.Equals” + 类型“{0}”显式实现 "System.IComparable",但未提供相对应的 "Object.Equals" 的重写。已自动提供 "Object.Equals " 的实现(通过 "System.IComparable" 实现)。请考虑显式实现重写 "Object.Equals" The struct, record or union type '{0}' has an explicit implementation of 'Object.GetHashCode' or 'Object.Equals'. You must apply the 'CustomEquality' attribute to the type - 结构、记录或联合类型“{0}”具有“Object.GetHashCode”或“Object.Equals”的显式实现。您必须将“CustomEquality”特性应用于该类型 + 结构、记录或联合类型“{0}”具有 "Object.GetHashCode" 或 "Object.Equals" 的显式实现。您必须将 "CustomEquality" 特性应用于该类型 The struct, record or union type '{0}' has an explicit implementation of 'Object.GetHashCode'. Consider implementing a matching override for 'Object.Equals(obj)' - 结构、记录或联合类型“{0}”具有“Object.GetHashCode”的显式实现。请考虑为“Object.Equals(obj)”实现匹配的重写 + 结构、记录或联合类型“{0}”具有 "Object.GetHashCode" 的显式实现。请考虑为 "Object.Equals(obj)" 实现匹配的重写 The struct, record or union type '{0}' has an explicit implementation of 'Object.Equals'. Consider implementing a matching override for 'Object.GetHashCode()' - 结构、记录或联合类型“{0}”具有“Object.Equals”的显式实现。请考虑为“Object.GetHashCode()”实现匹配的重写 + 结构、记录或联合类型“{0}”具有 "Object.Equals" 的显式实现。请考虑为 "Object.GetHashCode()" 实现匹配的重写 @@ -954,7 +954,7 @@ No implementation was given for '{0}'. Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - 未为“{0}”给定任何实现。请注意,必须在适当的“interface”声明下实现并列出所有接口成员,例如“interface ... with member ...”。 + 未为“{0}”给定任何实现。请注意,必须在适当的 "interface" 声明下实现并列出所有接口成员,例如 "interface ... with member ..."。 @@ -999,37 +999,37 @@ The 'ReferenceEquality' attribute cannot be used on structs. Consider using the 'StructuralEquality' attribute instead, or implement an override for 'System.Object.Equals(obj)'. - 不能对结构使用“ReferenceEquality”特性。请考虑改用“StructuralEquality”特性,或实现对“System.Object.Equals(obj)”的重写。 + 不能对结构使用 "ReferenceEquality" 特性。请考虑改用 "StructuralEquality" 特性,或实现对 "System.Object.Equals(obj)" 的重写。 This type uses an invalid mix of the attributes 'NoEquality', 'ReferenceEquality', 'StructuralEquality', 'NoComparison' and 'StructuralComparison' - 此类型使用的“NoEquality”、“ReferenceEquality”、“StructuralEquality”、“NoComparison”和“StructuralComparison”特性组合无效 + 此类型使用的 "NoEquality"、"ReferenceEquality"、"StructuralEquality"、"NoComparison" 和 "StructuralComparison" 特性组合无效 The 'NoEquality' attribute must be used in conjunction with the 'NoComparison' attribute - “NoEquality”特性必须与“NoComparison”特性结合使用 + "NoEquality" 特性必须与 "NoComparison" 特性结合使用 The 'StructuralComparison' attribute must be used in conjunction with the 'StructuralEquality' attribute - “StructuralComparison”特性必须与“StructuralEquality”特性结合使用 + "StructuralComparison" 特性必须与 "StructuralEquality" 特性结合使用 The 'StructuralEquality' attribute must be used in conjunction with the 'NoComparison' or 'StructuralComparison' attributes - “StructuralEquality”特性必须与“NoComparison”或“StructuralComparison”特性结合使用 + "StructuralEquality" 特性必须与 "NoComparison" 或 "StructuralComparison" 特性结合使用 A type cannot have both the 'ReferenceEquality' and 'StructuralEquality' or 'StructuralComparison' attributes - 一个类型不能同时具有“ReferenceEquality”特性和“StructuralEquality”或“StructuralComparison”特性 + 一个类型不能同时具有 "ReferenceEquality" 特性和 "StructuralEquality" 或 "StructuralComparison" 特性 Only record, union, exception and struct types may be augmented with the 'ReferenceEquality', 'StructuralEquality' and 'StructuralComparison' attributes - 只可以利用“ReferenceEquality”、“StructuralEquality”和“StructuralComparison”特性来扩大记录、联合、异常和结构类型 + 只可以利用 "ReferenceEquality"、"StructuralEquality" 和 "StructuralComparison" 特性来扩大记录、联合、异常和结构类型 @@ -1044,12 +1044,12 @@ A type with attribute 'CustomComparison' must have an explicit implementation of at least one of 'System.IComparable' or 'System.Collections.IStructuralComparable' - 具有特性“CustomComparison”的类型必须至少显式实现“System.IComparable”或“System.Collections.IStructuralComparable”中的一个 + 具有特性 "CustomComparison" 的类型必须至少显式实现 "System.IComparable" 或 "System.Collections.IStructuralComparable" 中的一个 A type with attribute 'NoEquality' should not usually have an explicit implementation of 'Object.Equals(obj)'. Disable this warning if this is intentional for interoperability purposes - 具有特性“NoEquality”通常不应显式实现“Object.Equals(obj)”。如果这是为了实现互操作性而特意这样做的,请禁用此警告 + 具有特性 "NoEquality" 通常不应显式实现 "Object.Equals(obj)"。如果这是为了实现互操作性而特意这样做的,请禁用此警告 @@ -1059,7 +1059,7 @@ The 'CustomEquality' attribute must be used in conjunction with the 'NoComparison' or 'CustomComparison' attributes - “CustomEquality”特性必须与“NoComparison”或“CustomComparison”特性结合使用 + "CustomEquality" 特性必须与 "NoComparison" 或 "CustomComparison" 特性结合使用 @@ -1079,7 +1079,7 @@ Prefix flag (' ' or '+') set twice - 前缀标志(“ ”或“+”)设置了两次 + 前缀标志(" " 或 "+")设置了两次 @@ -1104,7 +1104,7 @@ Precision missing after the '.' - “.”后缺少精度 + "." 后缺少精度 @@ -1119,7 +1119,7 @@ The 'l' or 'L' in this format specifier is unnecessary. In F# code you can use %d, %x, %o or %u instead, which are overloaded to work with all basic integer types. - 此格式说明符中不需要“l”或“L”。在 F# 代码中,可以改用 %d、%x、%o 或 %u,这些项将被重载以用于所有基本整数类型。 + 此格式说明符中不需要 "l" 或 "L"。在 F# 代码中,可以改用 %d、%x、%o 或 %u,这些项将被重载以用于所有基本整数类型。 @@ -1149,7 +1149,7 @@ A protected member is called or 'base' is being used. This is only allowed in the direct implementation of members since they could escape their object scope. - 调用了受保护的成员或正在使用“base”。只能在对成员的直接实现中这样做,因为它们可能会超出其对象范围。 + 调用了受保护的成员或正在使用 "base"。只能在对成员的直接实现中这样做,因为它们可能会超出其对象范围。 @@ -1159,7 +1159,7 @@ The 'base' keyword is used in an invalid way. Base calls cannot be used in closures. Consider using a private member to make base calls. - “base”关键字的使用方式无效。在闭包中不能使用 base 调用。请考虑使用私有成员进行 base 调用。 + "base" 关键字的使用方式无效。在闭包中不能使用 base 调用。请考虑使用私有成员进行 base 调用。 @@ -1184,7 +1184,7 @@ Calls to 'reraise' may only occur directly in a handler of a try-with - 只可以在 try-with 的处理程序中直接调用“reraise” + 只可以在 try-with 的处理程序中直接调用 "reraise" @@ -1204,7 +1204,7 @@ First-class uses of the 'reraise' function is not permitted - 不允许优先使用“reraise”函数 + 不允许优先使用 "reraise" 函数 @@ -1214,12 +1214,12 @@ 'base' values may only be used to make direct calls to the base implementations of overridden members - “base”值只能用于直接调用重写成员的基实现 + "base" 值只能用于直接调用重写成员的基实现 Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL. - 在初始化对象之前,对象构造函数不能直接使用 try/with 和 try/finally。这包括像“for x in ...”这样详细说明其构造使用方式的构造。这是由通用 IL 设定的限制。 + 在初始化对象之前,对象构造函数不能直接使用 try/with 和 try/finally。这包括像 "for x in ..." 这样详细说明其构造使用方式的构造。这是由通用 IL 设定的限制。 @@ -1359,7 +1359,7 @@ The type of a field using the 'DefaultValue' attribute must admit default initialization, i.e. have 'null' as a proper value or be a struct type whose fields all admit default initialization. You can use 'DefaultValue(false)' to disable this check - 使用“DefaultValue”特性的字段的类型必须承认默认初始化,也就是说,此类型将“null”用作适当的值,或者此类型是一个结构类型,其中的所有字段均承认默认初始化。可以使用“DefaultValue(false)”禁用此检查 + 使用 "DefaultValue" 特性的字段的类型必须承认默认初始化,也就是说,此类型将 "null" 用作适当的值,或者此类型是一个结构类型,其中的所有字段均承认默认初始化。可以使用 "DefaultValue(false)" 禁用此检查 @@ -2634,7 +2634,7 @@ This property has an invalid type. Properties taking multiple indexer arguments should have types of the form 'ty1 * ty2 -> ty3'. Properties returning functions should have types of the form '(ty1 -> ty2)'. - 此属性的类型无效。采用多个索引器参数的属性应具有 "ty1 * ty1-& gt; ty1" 形式的类型。返回函数的属性应具有 "(ty1 -> ty2)" 形式的类型。 + 此属性的类型无效。采用多个索引器参数的属性应具有 "ty1 * ty2 -> ty3" 形式的类型。返回函数的属性应具有 "(ty1 -> ty2)" 形式的类型。 @@ -3379,7 +3379,7 @@ 'use' bindings must be of the form 'use <var> = <expr>' - "use" 绑定必须采用 "use <var> = <expr>" 形式。 + "use" 绑定必须采用 "use <var> = <expr>" 形式 @@ -3449,7 +3449,7 @@ Interfaces cannot contain definitions of member overrides - 接口不能包含成员重写的定义。 + 接口不能包含成员重写的定义 @@ -3494,7 +3494,7 @@ A declaration may only be the [<Literal>] attribute if a constant value is also given, e.g. 'val x : int = 1' - 如果还给定了常量值,则声明只能是 [<Literal>] 属性,例如 "val x : int = 1"。 + 如果还给定了常量值,则声明只能是 [<Literal>] 属性,例如 "val x : int = 1" @@ -3519,7 +3519,7 @@ Static 'val' fields in types must be mutable, private and marked with the '[<DefaultValue>]' attribute. They are initialized to the 'null' or 'zero' value for their type. Consider also using a 'static let mutable' binding in a class type. - 类型中的静态 "val" 字段必须是可变的和私有的,并标记了 "[<DefaultValue>]" 属性。这些字段将初始化为各自类型的 "null" 或“零”值。请考虑在类类型中也使用 "static let mutable" 绑定 + 类型中的静态 "val" 字段必须是可变的和私有的,并标记了 "[<DefaultValue>]" 属性。这些字段将初始化为各自类型的 "null" 或“零”值。请考虑在类类型中也使用 "static let mutable" 绑定。 @@ -4179,12 +4179,12 @@ --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - #NAME? + --仅在发出可移植 PDB 时才支持嵌入开关(--debug:portable or --debug:embedded) --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - #NAME? + --仅在发出可移植 PDB 时才支持源链接开关(--debug:portable or --debug:embedded) @@ -4194,7 +4194,7 @@ Embed the specified managed resource - 嵌入指定的托管资源 + 嵌入指定的受管理资源 @@ -5129,7 +5129,7 @@ The use of the type syntax 'int C' and 'C <int>' is not permitted here. Consider adjusting this type to be written in the form 'C<int>' - 此处不允许使用类型语法 "int C" 和 "C <int>"。请考虑调整此类型,使其按 "C<int>" 形式进行编写。 + 此处不允许使用类型语法 "int C" 和 "C <int>"。请考虑调整此类型,使其按 "C<int>" 形式进行编写 @@ -5294,7 +5294,7 @@ 'use!' bindings must be of the form 'use! <var> = <expr>' - "use!" 绑定必须采用 "use! <var> = <expr>" 形式。 + "use!" 绑定必须采用 "use! <var> = <expr>" 形式 @@ -5764,7 +5764,7 @@ This type test or downcast will erase the provided type '{0}' to the type '{1}' - 此类型测试或向下转换会将提供的类型“{0}”清除为类型“{1}”。 + 此类型测试或向下转换会将提供的类型“{0}”清除为类型“{1}” @@ -5914,7 +5914,7 @@ {0} var in collection {1} (outerKey = innerKey) into group. Note that parentheses are required after '{2}' - 集合 {1} (outerKey = innerKey) 中的 {0} var 到组中。请注意, 在 "{2}" 之后需要圆括号 + {0} var in collection {1} (outerKey = innerKey) into group。请注意,“{2}”后需使用括号 @@ -6279,7 +6279,7 @@ Infix operator member '{0}' has {1} initial argument(s). Expected a tuple of 3 arguments - 中缀运算符成员“{0}”具有 {1} 个初始参数。需要一个由 3 个参数构成的元组。 + 中缀运算符成员“{0}”具有 {1} 个初始参数。需要一个由 3 个参数构成的元组 @@ -6834,7 +6834,7 @@ Used instead of let for values that implement IDisposable - 用于替代 let,以便要求 Dispose 的值可调用到免费资源。 + 代替 let 用于实现 IDisposable 的值 @@ -6899,12 +6899,12 @@ Delimits a typed code quotation. - 分隔泛型代码引用。 + 分隔类型化代码引用。 Delimits a untyped code quotation. - 分隔泛型代码引用。 + 分隔非类型化代码引用。 @@ -7134,22 +7134,22 @@ No implementation was given for those members: {0} - No implementation was given for those members: {0} + 没有为这些成员提供实现: {0} No implementation was given for those members: {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - No implementation was given for those members: {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. + 没有为这些成员提供实现: {0}请注意,必须实现所有接口成员,并在适当的 "interface" 声明下将其列出,例如 "interface ... with member ..."。 No implementation was given for those members (some results omitted): {0} - No implementation was given for those members (some results omitted): {0} + 没有为这些成员提供实现 (省略了一些结果): {0} No implementation was given for those members (some results omitted): {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - No implementation was given for those members (some results omitted): {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. + 没有为这些成员提供实现 (省略了一些结果): {0}请注意,必须实现所有接口成员,并在适当的 "interface" 声明下列出,例如 "interface ... with member ..."。 diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf index 9f0a87c0f3..67425946e7 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf @@ -6834,7 +6834,7 @@ Used instead of let for values that implement IDisposable - 用來對需要 Dispose 才能呼叫以釋放資源的值取代 let。 + 對於實作 IDisposable 的值,會使用此項而非 let @@ -7134,22 +7134,22 @@ No implementation was given for those members: {0} - No implementation was given for those members: {0} + 未提供任何實作給這些成員: {0} No implementation was given for those members: {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - No implementation was given for those members: {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. + 未提供任何實作給這些成員: {0}請注意,所有介面成員都必須經過實作,並列於適當的 'interface' 宣告下,例如 'interface ... with member ...'。 No implementation was given for those members (some results omitted): {0} - No implementation was given for those members (some results omitted): {0} + 未提供任何實作給這些成員 (部分結果已省略): {0} No implementation was given for those members (some results omitted): {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - No implementation was given for those members (some results omitted): {0}Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. + 未提供任何實作給這些成員 (部分結果已省略): {0}請注意,所有介面成員都必須經過實作,並列於適當的 'interface' 宣告下,例如 'interface ... with member ...'。 diff --git a/src/fsharp/xlf/FSStrings.cs.xlf b/src/fsharp/xlf/FSStrings.cs.xlf index e75473b43c..91a4ac37be 100644 --- a/src/fsharp/xlf/FSStrings.cs.xlf +++ b/src/fsharp/xlf/FSStrings.cs.xlf @@ -1174,7 +1174,7 @@ keyword - Klíčové slovo + klíčové slovo diff --git a/src/fsharp/xlf/FSStrings.es.xlf b/src/fsharp/xlf/FSStrings.es.xlf index 0c4041f9b9..a23054dec2 100644 --- a/src/fsharp/xlf/FSStrings.es.xlf +++ b/src/fsharp/xlf/FSStrings.es.xlf @@ -1174,7 +1174,7 @@ keyword - Palabra clave + palabra clave diff --git a/src/fsharp/xlf/FSStrings.fr.xlf b/src/fsharp/xlf/FSStrings.fr.xlf index 76dacd3c0f..b17a66de85 100644 --- a/src/fsharp/xlf/FSStrings.fr.xlf +++ b/src/fsharp/xlf/FSStrings.fr.xlf @@ -1174,7 +1174,7 @@ keyword - Mot clé + mot clé diff --git a/src/fsharp/xlf/FSStrings.it.xlf b/src/fsharp/xlf/FSStrings.it.xlf index 11890ea924..a1ead8b3ad 100644 --- a/src/fsharp/xlf/FSStrings.it.xlf +++ b/src/fsharp/xlf/FSStrings.it.xlf @@ -1174,7 +1174,7 @@ keyword - Parola chiave + parola chiave diff --git a/src/fsharp/xlf/FSStrings.ko.xlf b/src/fsharp/xlf/FSStrings.ko.xlf index f99c95b524..8242499042 100644 --- a/src/fsharp/xlf/FSStrings.ko.xlf +++ b/src/fsharp/xlf/FSStrings.ko.xlf @@ -1174,7 +1174,7 @@ keyword - 키워드 + 키워드 diff --git a/src/fsharp/xlf/FSStrings.pl.xlf b/src/fsharp/xlf/FSStrings.pl.xlf index 346dc96260..354f7aec8d 100644 --- a/src/fsharp/xlf/FSStrings.pl.xlf +++ b/src/fsharp/xlf/FSStrings.pl.xlf @@ -1174,7 +1174,7 @@ keyword - Słowo kluczowe + słowo kluczowe diff --git a/src/fsharp/xlf/FSStrings.tr.xlf b/src/fsharp/xlf/FSStrings.tr.xlf index f4cba2f121..1d5eca8822 100644 --- a/src/fsharp/xlf/FSStrings.tr.xlf +++ b/src/fsharp/xlf/FSStrings.tr.xlf @@ -1174,7 +1174,7 @@ keyword - Anahtar Sözcük + anahtar sözcük diff --git a/src/fsharp/xlf/FSStrings.zh-Hans.xlf b/src/fsharp/xlf/FSStrings.zh-Hans.xlf index 506c6ad115..16e798e089 100644 --- a/src/fsharp/xlf/FSStrings.zh-Hans.xlf +++ b/src/fsharp/xlf/FSStrings.zh-Hans.xlf @@ -424,7 +424,7 @@ symbol # - 意外的 + 符号 # @@ -984,7 +984,7 @@ string literal - 字符串 + 字符串文本 @@ -1344,7 +1344,7 @@ Recursive references to the object being defined will be checked for initialization soundness at runtime through the use of a delayed reference. Consider placing self-references in members or within a trailing expression of the form '<ctor-expr> then <expr>'. - 将检查对要定义的对象的递归引用,以查看其在运行时能否通过使用延迟的引用来完整地进行初始化 。请考虑在成员中或 "<ctor-expr> then <expr>" 格式的尾随表达式中放置自引用。 + 将检查对要定义的对象的递归引用,以查看其在运行时能否通过使用延迟的引用来完整地进行初始化。请考虑在成员中或 "<ctor-expr> then <expr>" 格式的尾随表达式中放置自引用。 diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.cs.xlf b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.cs.xlf index e7f408b7ac..6de826791a 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.cs.xlf +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.cs.xlf @@ -44,7 +44,7 @@ For additional templates to use with F#, see the 'Online Templates' in Visual Studio, - Další šablony, které můžete používat s F#, najdete tak, že ve Visual Studiu vyberete Online šablony, + Další šablony, které můžete používat s F#, najdete tak, že v sadě Visual Studio vyberete Online šablony, diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.de.xlf b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.de.xlf index 89f6fcb68f..5fbb27634d 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.de.xlf +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.de.xlf @@ -1529,7 +1529,7 @@ To learn more, see: https://docs.microsoft.com/en-us/dotnet/articles/fsharp/language-reference/interfaces - Weitere Informationen finden Sie unter:: https://docs.microsoft.com/de-de/dotnet/articles/fsharp/language-reference/interfaces + Weitere Informationen finden Sie unter: https://docs.microsoft.com/de-de/dotnet/articles/fsharp/language-reference/interfaces diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.it.xlf b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.it.xlf index 0c26932910..ecd508e58b 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.it.xlf +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.it.xlf @@ -1324,7 +1324,7 @@ Next, define an interface type that represents an object to compute the shipping zone for the customer's zip code, - Definire quindi un tipo di interfaccia che rappresenta un oggetto per calcolare l'area di spedizione per il codice postale del cliente, + Definire quindi un tipo di interfaccia che rappresenta un oggetto per calcolare la zona di spedizione per il codice postale del cliente, @@ -1334,7 +1334,7 @@ Next, calculate a shipping zone for a customer using a calculator instance. - Calcolare quindi un'area di spedizione per un cliente usando un'istanza della calcolatrice. + Calcolare quindi una zona di spedizione per un cliente usando un'istanza della calcolatrice. diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.pl.xlf b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.pl.xlf index 3b4b512cd2..9ee0ae09ae 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.pl.xlf +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.pl.xlf @@ -624,7 +624,7 @@ This is a list with 3 elements. ';' is used to separate elements on the same line. - Jest to lista z trzema elementami. Znak „;” oddziela elementy w tym samym wierszu. + Jest to lista z 3 elementami. Znak „;” oddziela elementy w tym samym wierszu. @@ -649,7 +649,7 @@ Print the first 5 elements of 'daysList' using 'List.take'. - Wydrukuj pięć pierwszych elementów listy „daysList” przy użyciu wyrażenia „List.take”. + Wydrukuj 5 pierwszych elementów listy „daysList” przy użyciu wyrażenia „List.take”. @@ -1214,7 +1214,7 @@ A Discriminated Union of 3 different kinds of employees - Unia rozłączna trzech różnych rodzajów pracowników + Unia rozłączna 3 różnych rodzajów pracowników diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.tr.xlf b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.tr.xlf index e41d20b7fa..2fcd8d0f2c 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.tr.xlf +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.tr.xlf @@ -9,7 +9,7 @@ To execute the code in F# Interactive, highlight a section of code and press Alt-Enter or right-click - Kodu Etkileşimli F#'da yürütmek için kodun bir bölümünü vurgulayın ve Alt-Enter'a basın veya sağ tıklatın + Kodu F# Etkileşimli’de yürütmek için kodun bir bölümünü vurgulayın ve Alt-Enter'a basın veya sağ tıklatın @@ -589,7 +589,7 @@ use Partial Application and the input and output types of each data processing operation match - ve her bir veri işleme işleminin giriş ve çıkış türleri kullandığımız işlevlerin imzaları ile eşleştiği için + ve her bir bilgi işlem işleminin giriş ve çıkış türleri kullandığımız işlevlerin imzaları ile eşleştiği için @@ -694,7 +694,7 @@ Although they are similar to Lists (they support enumeration and have similar combinators for data processing), - Lists'e benzer olsalar da (numaralandırmayı desteklerler ve veri işleme için benzer birleştiricilere sahiptirler) + Lists'e benzer olsalar da (numaralandırmayı desteklerler ve bilgi işlem için benzer birleştiricilere sahiptirler) diff --git a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.zh-Hans.xlf b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.zh-Hans.xlf index 23e13e7938..cb0a1983af 100644 --- a/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.zh-Hans.xlf +++ b/vsintegration/ProjectTemplates/TutorialProject/Template/xlf/Tutorial.fsx.zh-Hans.xlf @@ -44,7 +44,7 @@ For additional templates to use with F#, see the 'Online Templates' in Visual Studio, - 有关要用于 F# 的其他模板,请参见 Visual Studio 中的“联机模板”。 + 有关要用于 F# 的其他模板,请参见 Visual Studio 中的“联机模板”, @@ -89,7 +89,7 @@ To learn more, see: https://docs.microsoft.com/en-us/dotnet/articles/fsharp/language-reference/xml-documentation - 有关详细信息,请参阅: https://docs.microsoft.com/en-us/dotnet/articles/fsharp/language-reference/xml-documentation + 有关详细信息,请参阅: https://docs.microsoft.com/zh-cn/dotnet/articles/fsharp/language-reference/xml-documentation @@ -99,7 +99,7 @@ To learn more, see: https://docs.microsoft.com/en-us/dotnet/articles/fsharp/language-reference/import-declarations-the-open-keyword - 有关详细信息,请参阅: https://docs.microsoft.com/en-us/dotnet/articles/fsharp/language-reference/import-declarations-the-open-keyword + 有关详细信息,请参阅: https://docs.microsoft.com/zh-cn/dotnet/articles/fsharp/language-reference/import-declarations-the-open-keyword @@ -114,7 +114,7 @@ To learn more, see: https://docs.microsoft.com/en-us/dotnet/articles/fsharp/language-reference/modules - 有关详细信息,请参阅: https://docs.microsoft.com/en-us/dotnet/articles/fsharp/language-reference/modules + 有关详细信息,请参阅: https://docs.microsoft.com/zh-cn/dotnet/articles/fsharp/language-reference/modules @@ -479,7 +479,7 @@ Given a list of integers, it filters out the even numbers, - 如果是整数列表,它会筛选出偶数。 + 如果是整数列表,它会筛选出偶数, diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.cs.xlf b/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.cs.xlf index 97941503b9..f47dbb2363 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.cs.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.cs.xlf @@ -727,7 +727,7 @@ The project '{0}' is targeting '{1}'; however, the target framework is not installed on the machine. - Projekt {0} je zaměřený na {1}. Cílová verze rozhraní .NET Framework ale na tomto počítači není nainstalovaná. + Projekt {0} je zaměřený na {1}. Cílová verze architektury .NET Framework ale na tomto počítači není nainstalovaná. @@ -737,7 +737,7 @@ The referenced project '{0}' is targeting a higher framework version ({1}) than this project’s current target framework version ({2}). This may lead to build failures if types from assemblies outside this project’s target framework are used by any project in the dependency chain. - Odkazovaný projekt {0} je cílený na vyšší verzi rozhraní .NET Framework ({1}), než je aktuální cílová verze rozhraní .NET Framework tohoto projektu ({2}). Pokud se budou typy ze sestavení mimo cílovou verzi rozhraní .NET Framework tohoto projektu používat kdekoliv ve struktuře závislostí projektů, může to vést k chybám sestavení. + Odkazovaný projekt {0} je cílený na vyšší verzi rozhraní .NET Framework ({1}), než je aktuální verze cílové architektury tohoto projektu ({2}). Pokud se budou typy ze sestavení mimo verzi cílové architektury tohoto projektu používat kdekoliv ve struktuře závislostí projektů, může to vést k chybám sestavení. diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.de.xlf b/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.de.xlf index 8c8f5b67d2..b9b597b8d5 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.de.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.de.xlf @@ -282,7 +282,7 @@ Project - Projekt + Projekt diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.it.xlf b/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.it.xlf index d31d62e478..ce42e4ef50 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.it.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/xlf/Microsoft.VisualStudio.Package.Project.it.xlf @@ -242,7 +242,7 @@ Cannot save '{0}' outside the project directory. Linked items are not supported. - Impossibile salvare '{0}' all'esterno della directory del progetto. Gli elementi collegati non sono supportati. + Non è possibile salvare '{0}' all'esterno della directory del progetto. Gli elementi collegati non sono supportati. @@ -252,7 +252,7 @@ Minimal - minimal + Minima @@ -492,7 +492,7 @@ Custom Tool Namespace - Spazio dei nomi strumento personalizzato + Spazio dei nomi dello strumento personalizzato diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.ja.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.ja.xlf index 181e3e1d41..4266774b23 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.ja.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.ja.xlf @@ -49,7 +49,7 @@ F# Interactive - F# Interactive + F# インタラクティブ @@ -84,12 +84,12 @@ &Send to F# Interactive - F# Interactive に送信(&S) + F# インタラクティブに送信(&S) &Send to F# Interactive - F# Interactive に送信(&S) + F# インタラクティブに送信(&S) @@ -99,12 +99,12 @@ &Send References to F# Interactive - 参照を F# Interactive に送信(&S) + 参照を F# インタラクティブに送信(&S) &Send References to F# Interactive - 参照を F# Interactive に送信(&S) + 参照を F# インタラクティブに送信(&S) @@ -114,12 +114,12 @@ &Send Project Output to F# Interactive - プロジェクト出力を F# Interactive に送信(&S) + プロジェクト出力を F# インタラクティブに送信(&S) &Send Project Output to F# Interactive - プロジェクト出力を F# Interactive に送信(&S) + プロジェクト出力を F# インタラクティブに送信(&S) diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.tr.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.tr.xlf index 31179940b6..4ac66f5451 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.tr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.tr.xlf @@ -99,12 +99,12 @@ &Send References to F# Interactive - &Başvuruları F# Interactive'e Gönder + &Başvuruları F# Etkileşimli'ye Gönder &Send References to F# Interactive - &Başvuruları F# Interactive'e Gönder + &Başvuruları F# Etkileşimli'ye Gönder @@ -114,12 +114,12 @@ &Send Project Output to F# Interactive - &Proje Çıkışını F# Interactive'e Gönder + &Proje Çıkışını F# Etkileşimli'ye Gönder &Send Project Output to F# Interactive - &Proje Çıkışını F# Interactive'e Gönder + &Proje Çıkışını F# Etkileşimli'ye Gönder diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.zh-Hans.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.zh-Hans.xlf index 6456eeba61..853138f9a5 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.zh-Hans.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/MenusAndCommands.vsct.zh-Hans.xlf @@ -49,7 +49,7 @@ F# Interactive - F# 交互 + F# 交互窗口 @@ -114,12 +114,12 @@ &Send Project Output to F# Interactive - 将项目输出发送到 F# 交互(&S) + 将项目输出发送到 F# 交互窗口(&S) &Send Project Output to F# Interactive - 将项目输出发送到 F# 交互(&S) + 将项目输出发送到 F# 交互窗口(&S) diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.cs.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.cs.xlf index 4b75bf2cdd..34cc71a6cf 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.cs.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.cs.xlf @@ -499,7 +499,7 @@ Changing the Target Framework requires that the current project be closed and then reopened.\nAny unsaved changes within the project will be automatically saved.\n\nChanging Target Framework may require manual modification of project files in order to build.\n\nAre you sure you want to change the Target Framework for this project? - Změna cílového rámce vyžaduje zavření a opětovné otevření aktuálního projektu. \nJakékoliv neuložené změny v rámci projektu budou automaticky uloženy.\n\nZměna cílového rámce může vyžadovat ruční úpravy souborů projektu, aby mohlo být provedeno sestavení.\n\nJste si jisti, že chcete změnit cílový rámec tohoto projektu? + Změna cílové architektury vyžaduje zavření a opětovné otevření aktuálního projektu. \nJakékoliv neuložené změny v rámci projektu budou automaticky uloženy.\n\nZměna cílové architektury může vyžadovat ruční úpravy souborů projektu, aby mohlo být provedeno sestavení.\n\nJste si jisti, že chcete změnit cílovou architekturu tohoto projektu? diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf index 4701919726..57e31224de 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.de.xlf @@ -69,7 +69,7 @@ Project - Projekt + Projekt @@ -404,7 +404,7 @@ F# Tools - F#-Tools + F# Tools @@ -434,12 +434,12 @@ Microsoft Visual F# Tools 10.4 for F# 4.6 - Microsoft Visual F#-Tools 10.4 für f# 4.6 + Microsoft Visual F# Tools 10.4 für f# 4.6 Microsoft Visual F# Tools 10.4 for F# 4.6 - Microsoft Visual F#-Tools 10.4 für f# 4.6 + Microsoft Visual F# Tools 10.4 für f# 4.6 @@ -454,7 +454,7 @@ Visual F# Tools 10.4 for F# 4.6 - Visual F#-Tools 10.4 für F# 4.6 + Visual F# Tools 10.4 für F# 4.6 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.es.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.es.xlf index 531c011c8d..2ff3a9663b 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.4 for F# 4.6 - Microsoft Visual F# Tools 10.4 para F# 4.6 + Herramientas de Microsoft Visual F# 10.4 para F# 4.6 Microsoft Visual F# Tools 10.4 for F# 4.6 - Microsoft Visual F# Tools 10.4 para F# 4.6 + Herramientas de Microsoft Visual F# 10.4 para F# 4.6 diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf index e99787c301..0e69ee238b 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ja.xlf @@ -409,7 +409,7 @@ F# Interactive - F# Interactive + F# インタラクティブ @@ -459,7 +459,7 @@ F# Interactive - F# Interactive + F# インタラクティブ @@ -509,7 +509,7 @@ Change path and command line arguments passed to the F# Interactive - F# Interactive に渡されるパスとコマンド ライン引数を変更します + F# インタラクティブに渡されるパスとコマンド ライン引数を変更します diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf index ba33a418cb..4133f5ea29 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.ko.xlf @@ -414,7 +414,7 @@ F# Project Files (*.fsproj);*.fsproj - F# 프로젝트 파일 (*.fsproj);*.fsproj + F# 프로젝트 파일(*.fsproj);*.fsproj diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf index a9ccec095c..b435f62c81 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.tr.xlf @@ -389,7 +389,7 @@ A project for creating an F# library (.dll) that can run on .NET Framework 4.5, Windows Store, Windows Phone 8.1, Windows Phone Silverlight 8, Xamarin.iOS, Xamarin.Android and Xamarin.iOS(Classic). Profile 259 - ..NET Framework 4.5, Windows Mağazası, Windows Phone 8.1, Windows Phone 8 Silverlight, Xamarin.iOS, Xamarin.Android ve Xamarin.iOS(Classic)'ta çalışabilen bir F# kitaplığı (.dll) oluşturma projesi. Profil 259 + .NET Framework 4.5, Windows Mağazası, Windows Phone 8.1, Windows Phone 8 Silverlight, Xamarin.iOS, Xamarin.Android ve Xamarin.iOS(Classic)'ta çalışabilen bir F# kitaplığı (.dll) oluşturma projesi. Profil 259 @@ -434,12 +434,12 @@ Microsoft Visual F# Tools 10.4 for F# 4.6 - Microsoft Visual F# Tools 10.4 for F# 4.6 + F# 4.6 için Microsoft Visual F# Tools 10.4 Microsoft Visual F# Tools 10.4 for F# 4.6 - F# 4.6 için Microsoft Visual F# Araçları 10.4 + F# 4.6 için Microsoft Visual F# Tools 10.4 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 4cf2c86043..24e4048ae2 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hans.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hans.xlf @@ -309,7 +309,7 @@ A project for creating an F# library (.dll) that can run on .NET Framework 4.5, Windows Store, Silverlight 5, Xamarin.iOS, Xamarin.Android and Xamarin.iOS(Classic). Profile 47 - 一个用于创建可在以下对象上运行的 F# 库(.dll) 的项目:.NET Framework 4.5、Windows 应用商店、Silverlight 5、Xamarin.iOS、Xamarin.Android 和 Xamarin.iOS(Classic)。配置文件 47) + 一个用于创建可在以下对象上运行的 F# 库(.dll) 的项目: .NET Framework 4.5、Windows 应用商店、Silverlight 5、Xamarin.iOS、Xamarin.Android 和 Xamarin.iOS(Classic)。配置文件 47 @@ -329,7 +329,7 @@ A project item for consuming a .NET Managed Resources File (Resx) using ResxFile type provider. - 通过 ResxFile 类型提供程序使用 .NET 托管资源文件(Resx)的项目项。 + 通过 ResxFile 类型提供程序使用 .NET 受管理资源文件(Resx)的项目项。 @@ -369,7 +369,7 @@ A project for creating an F# library (.dll) that can run on .NET Framework 4.5, Windows Store, Xamarin.iOS, Xamarin.Android and Xamarin.iOS(Classic). Profile 7 - 一个用于创建可在以下对象上运行的 F# 库(.dll) 的项目:.NET Framework 4.5、Windows 应用商店、Xamarin.iOS、Xamarin.Android 和 Xamarin.iOS(Classic)。配置文件7) + 一个用于创建可在以下对象上运行的 F# 库(.dll) 的项目: .NET Framework 4.5、Windows 应用商店、Xamarin.iOS、Xamarin.Android 和 Xamarin.iOS(Classic)。配置文件7 @@ -379,7 +379,7 @@ A project for creating an F# library (.dll) that can run on .NET Framework 4.5, Windows Store, Windows Phone 8 Silverlight, Xamarin.iOS, Xamarin.Android and Xamarin.iOS(Classic). Profile 78 - 一个用于创建可在以下对象上运行的 F# 库(.dll) 的项目:.NET Framework 4.5、Windows 应用商店、Windows Phone 8 Silverlight、Xamarin.iOS、Xamarin.Android 和 Xamarin.iOS(Classic)。配置文件 78) + 一个用于创建可在以下对象上运行的 F# 库(.dll) 的项目: .NET Framework 4.5、Windows 应用商店、Windows Phone 8 Silverlight、Xamarin.iOS、Xamarin.Android 和 Xamarin.iOS(Classic)。配置文件 78 @@ -389,7 +389,7 @@ A project for creating an F# library (.dll) that can run on .NET Framework 4.5, Windows Store, Windows Phone 8.1, Windows Phone Silverlight 8, Xamarin.iOS, Xamarin.Android and Xamarin.iOS(Classic). Profile 259 - 一个用于创建可在以下对象上运行的 F# 库(.dll) 的项目:.NET Framework 4.5、Windows 应用商店、Windows Phone 8.1、Windows Phone Silverlight 8、Xamarin.iOS、Xamarin.Android 和 Xamarin.iOS(Classic)。配置文件 259) + 一个用于创建可在以下对象上运行的 F# 库(.dll) 的项目: .NET Framework 4.5、Windows 应用商店、Windows Phone 8.1、Windows Phone Silverlight 8、Xamarin.iOS、Xamarin.Android 和 Xamarin.iOS(Classic)。配置文件 259 @@ -409,7 +409,7 @@ F# Interactive - F# 交互 + F# 交互窗口 @@ -459,7 +459,7 @@ F# Interactive - F# 交互 + F# 交互窗口 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 9f6a7ebc5a..6b452390e2 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hant.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/xlf/VSPackage.zh-Hant.xlf @@ -439,7 +439,7 @@ Microsoft Visual F# Tools 10.4 for F# 4.6 - 適用於 F# 4.6 的 Microsoft Visual F# Tools + 適用於 F# 4.6 的 Microsoft Visual F# Tools 10.4 diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.zh-Hans.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.zh-Hans.xlf index 34c2cbcdca..907f66b718 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.zh-Hans.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ApplicationPropPage.zh-Hans.xlf @@ -14,12 +14,12 @@ Specify how application resources will be managed: - 指定应用程序资源的管理方式: + 指定应用程序资源的管理方式: &Resource File: - 资源文件(&R): + 资源文件(&R): @@ -39,12 +39,12 @@ Tar&get Framework: - 目标框架(&G): + 目标框架(&G): Target F# runtime: - 目标 F# 运行时: + 目标 f# 运行时: diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.zh-Hans.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.zh-Hans.xlf index a59ec76dfd..14c8b46de5 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.zh-Hans.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildEventsPropPage.zh-Hans.xlf @@ -24,7 +24,7 @@ P&ost-build event command line: - 生成后事件命令行(&O): + 生成后事件命令行(&O): @@ -49,7 +49,7 @@ Always - 总是 + 始终 diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.cs.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.cs.xlf index db4345b987..4a2b2c992f 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.cs.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.cs.xlf @@ -44,7 +44,7 @@ &Output path: - &Cesta výstupu: + &Výstupní cesta: @@ -129,7 +129,7 @@ Define DEB&UG constant - Definovat konstantu DEB&UG + Definovat konstant&u DEBUG diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.es.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.es.xlf index 7ae2f22857..7e091065de 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.es.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/BuildPropPage.es.xlf @@ -9,7 +9,7 @@ &Prefer 32-bit - &Preferencia de 32 bits + &Preferir 32 bits diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.it.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.it.xlf index 9ee4b7f053..36cb07c84e 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.it.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/PropertyPages/xlf/ReferencePathsPropPage.it.xlf @@ -14,7 +14,7 @@ Reference &paths: - &Percorsi del riferimento: + &Percorsi dei riferimenti: diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.cs.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.cs.xlf index 96c40e377d..a678a4bcfe 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.cs.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.cs.xlf @@ -88,7 +88,7 @@ The application may throw security exceptions when it attempts to perform action Click OK to ignore and continue. Click CANCEL to choose a different output path. Cesta výstupu není důvěryhodná. Při pokusech o provedení akcí vyžadujících úplný vztah důvěryhodnosti může v aplikaci docházet k bezpečnostním výjimkám. -Pokud chcete tento stav ignorovat a pokračovat v operaci , klikněte na OK. Pokud chcete vybrat jinou cestu výstupu, klikněte na Zrušit. +Pokud chcete tento stav ignorovat a pokračovat v operaci, klikněte na OK. Pokud chcete vybrat jinou cestu výstupu, klikněte na Zrušit. @@ -1830,7 +1830,6 @@ CONSIDER: get this from CodeDom {0} x {1} {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" @@ -2840,7 +2839,7 @@ Chcete aktualizovat hodnotu v souboru .settings? To enable client application services, you must set the Target Framework for your application to .NET Framework 3.5 or later. In C#, you can do this on the Application property page. In Visual Basic, you can do this one the Compile property page by clicking Advanced Compile Options. - Abyste mohli povolit klientské aplikační služby, musíte pro cílové rozhraní .NET Framework vaší aplikace vybrat .NET Framework 3.5 nebo novější. V jazyce C# to můžete udělat na stránce Vlastnosti aplikace. Ve Visual Basicu zase kliknutím na Další možnosti kompilace na stránce Vlastnosti kompilace. + Abyste mohli povolit klientské aplikační služby, musíte jako cílovou architekturu vaší aplikace vybrat .NET Framework 3.5 nebo novější. V jazyce C# to můžete udělat na stránce Vlastnosti aplikace. Ve Visual Basicu zase kliknutím na Další možnosti kompilace na stránce Vlastnosti kompilace. diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.de.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.de.xlf index 5af4039514..662133483e 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.de.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.de.xlf @@ -1830,7 +1830,6 @@ CONSIDER: get this from CodeDom {0} x {1} {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.es.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.es.xlf index 40d73cd4e8..41dbc88f0b 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.es.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.es.xlf @@ -108,7 +108,7 @@ Haga clic en ACEPTAR para pasar esto por alto y continuar. Haga clic en CANCELAR <Browse...> - <Examinar... > + <Examinar...> @@ -1830,7 +1830,6 @@ CONSIDER: get this from CodeDom {0} x {1} {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.fr.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.fr.xlf index 83a941758a..0f1e16e95f 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.fr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.fr.xlf @@ -49,7 +49,7 @@ Database - Base de données  + Base de données @@ -1830,7 +1830,6 @@ CONSIDER: get this from CodeDom {0} x {1} {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" @@ -2840,7 +2839,7 @@ Voulez-vous mettre à jour la valeur dans le fichier .settings ? To enable client application services, you must set the Target Framework for your application to .NET Framework 3.5 or later. In C#, you can do this on the Application property page. In Visual Basic, you can do this one the Compile property page by clicking Advanced Compile Options. - Pour activer les services d'application cliente, vous devez définir le Framework cible pour votre application à .NET Framework 3.5 ou version ultérieure. En C#, vous le faites sur la page de propriétés Application. En Visual Basic, vous le faites sur le page de propriétés Compiler en cliquant sur Options avancées de compilation. + Pour activer les services d'application cliente, vous devez définir le Framework cible pour votre application sur .NET Framework 3.5 ou version ultérieure. En C#, vous le faites sur la page de propriétés Application. En Visual Basic, vous le faites sur le page de propriétés Compiler en cliquant sur Options avancées de compilation. diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.it.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.it.xlf index fd7d41daa5..8902030751 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.it.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.it.xlf @@ -507,7 +507,7 @@ Se si modifica questa impostazione, verranno ripristinate le impostazioni in tut (Zone Default) - (Predefinita dell'area) + (Predefinita della zona) @@ -522,7 +522,7 @@ Se si modifica questa impostazione, verranno ripristinate le impostazioni in tut The application will require elevated permissions to run in the selected zone. Click the help link above for more info. - Per eseguire l'applicazione nell'area selezionata, sono necessarie autorizzazioni elevate. Per altre informazioni, fare clic sul precedente collegamento della Guida. + Per eseguire l'applicazione nella zona selezionata, sono necessarie autorizzazioni elevate. Per altre informazioni, fare clic sul collegamento della Guida indicato sopra. @@ -562,7 +562,7 @@ Se si modifica questa impostazione, verranno ripristinate le impostazioni in tut The SecurityPermission must be included in your application with the Execute flag set or your application will not run. Mark this permission as "Zone Default" or "Include." - Per eseguire l'applicazione, SecurityPermission deve essere incluso nell'applicazione con il flag impostato su Execute. Contrassegnare l'autorizzazione come "Predefinita dell'area" o "Includi". + Per eseguire l'applicazione, SecurityPermission deve essere incluso nell'applicazione con il flag impostato su Execute. Contrassegnare l'autorizzazione come "Predefinita della zona" o "Includi". @@ -1830,7 +1830,6 @@ CONSIDER: get this from CodeDom {0} x {1} {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" @@ -2930,7 +2929,7 @@ Aggiornare il valore nel file .settings? The application will fail to run in the selected zone because of this requested elevated permission. Click the help link above for more info. - Non è possibile eseguire l'applicazione nell'area selezionata perché è richiesta un'autorizzazione elevata. Per altre informazioni, fare clic sul precedente collegamento della Guida. + Non è possibile eseguire l'applicazione nella zona selezionata perché è richiesta un'autorizzazione elevata. Per altre informazioni, fare clic sul collegamento della Guida indicato sopra. diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ja.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ja.xlf index cd4de3e846..a39e49dfa0 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ja.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ja.xlf @@ -1642,7 +1642,7 @@ Error: The current object is auto-generated and only supports renaming through the Managed Resources Editor. - 現在のオブジェクトは自動生成されていて、マネージ リソース エディターによる名前の変更のみサポートしています。 + 現在のオブジェクトは自動生成されていて、マネージド リソース エディターによる名前の変更のみサポートしています。 @@ -1830,7 +1830,6 @@ CONSIDER: get this from CodeDom {0} x {1} {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ko.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ko.xlf index 8951b09f12..e7191ac3c4 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ko.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ko.xlf @@ -567,7 +567,7 @@ Changing this setting will reset the settings in all configurations. The SecurityPermission must be included in your application with the Execute flag set or your application will not run. The Execute flag has been added to the SecurityPermission in your manifest. - 애플리케이션에 Execute 플래그가 설정된 SecurityPermission이 포함되지 않으면 애플리케이션이 실행되지 않습니다. 이 사용 권한을 "영역 기본값" 또는 "포함"으로 표시하세요. + 애플리케이션에 Execute 플래그가 설정된 SecurityPermission이 포함되지 않으면 애플리케이션이 실행되지 않습니다. Execute 플래그는 사용자 매니페스트의 SecurityPermission에 추가되었습니다. @@ -1830,7 +1830,6 @@ CONSIDER: get this from CodeDom {0} x {1} {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" @@ -2371,7 +2370,7 @@ CONSIDER: get this from CodeDom Type '{0}' is not defined. - {0}' 형식이 정의되지 않았습니다. + '{0}' 형식이 정의되지 않았습니다. diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pl.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pl.xlf index e75adbf369..d0675bd2fc 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pl.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pl.xlf @@ -704,7 +704,7 @@ Błąd: Certificate Files - Certyfikuj pliki + Pliki certyfikatów @@ -1642,7 +1642,7 @@ Błąd: The current object is auto-generated and only supports renaming through the Managed Resources Editor. - Bieżący obiekt został wygenerowany automatycznie i obsługuje zmianę nazwy poprzez edytor zarządzanych zasobów. + Bieżący obiekt został wygenerowany automatycznie i obsługuje zmianę nazwy poprzez edytor zasobów zarządzanych. @@ -1830,7 +1830,6 @@ CONSIDER: get this from CodeDom {0} x {1} {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" @@ -2123,7 +2122,7 @@ CONSIDER: get this from CodeDom Managed Resources Editor - Edytor zarządzanych zasobów + Edytor zasobów zarządzanych diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pt-BR.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pt-BR.xlf index 3cd5702720..acfade8884 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pt-BR.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pt-BR.xlf @@ -1830,7 +1830,6 @@ CONSIDER: get this from CodeDom {0} x {1} {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ru.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ru.xlf index 94a58397fe..355d363084 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ru.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ru.xlf @@ -1830,7 +1830,6 @@ CONSIDER: get this from CodeDom {0} x {1} {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.tr.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.tr.xlf index 84703a61bd..86ac32f4b3 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.tr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.tr.xlf @@ -1830,7 +1830,6 @@ CONSIDER: get this from CodeDom {0} x {1} {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" @@ -2810,7 +2809,7 @@ app.config dosyasındaki yeni değer: '{1}' Disabling application services will clear the default services for Authentication, Roles, and Settings. Click OK to disable application services. - Uygulama hizmetlerini devre dışı bırakmak, Kimlik Doğrulama, Roller ve Ayarlar için varsayılan hizmetleri temizleyecek. Uygulama hizmetlerini devre dışı bırakmak için Tamam'a tıklayın. + Uygulama hizmetlerini devre dışı bırakmak, Kimlik Doğrulaması, Roller ve Ayarlar için varsayılan hizmetleri temizleyecek. Uygulama hizmetlerini devre dışı bırakmak için Tamam'a tıklayın. @@ -2860,7 +2859,7 @@ app.config dosyasındaki yeni değer: '{1}' Authentication, Roles and Web Settings providers have been configured via the Application configuration file such that they do not share a common connection string. - Kimlik Doğrulama, Roller ve Web Ayarları sağlayıcıları, Uygulama yapılandırma dosyası kullanılarak ortak bağlantı dizesini paylaşmayacak şekilde yapılandırıldı. + Kimlik Doğrulaması, Roller ve Web Ayarları sağlayıcıları, Uygulama yapılandırma dosyası kullanılarak ortak bağlantı dizesini paylaşmayacak şekilde yapılandırıldı. diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hans.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hans.xlf index ccdc1a1939..0537632d5f 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hans.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hans.xlf @@ -315,12 +315,12 @@ Please select a valid folder path. Startup f&orm: - 启动窗体(&O) + 启动窗体(&O): The following events are available for MyApplication: - 以下事件可用于 MyApplication: + 以下事件可用于 MyApplication: @@ -784,7 +784,7 @@ Error: Enter &password to open file {0} - 输入密码以打开文件 {0}(&P) + 输入密码打开文件 {0}(&P) @@ -851,7 +851,7 @@ Error: Adding or removing '{0}' as a project import failed because of an unexpected error from the project system. The error returned was: '{1}'. - 由于项目系统中发生意外错误,未能将“{0}”作为项目导入进行添加或删除。返回的错误为:“{1}” + 由于项目系统中发生意外错误,未能将“{0}”作为项目导入进行添加或删除。返回的错误为:“{1}”。 @@ -985,7 +985,7 @@ Error: Base address must be a hexadecimal number with less than or equal to 8 digits, for example, &H11000000. - 基址必须是小于或等于 8 位数字的十六进制数字,例如 &H11000000。 + 基址必须是十六进制数,位数小于或等于 8,如 &H11000000。 @@ -1112,7 +1112,7 @@ Error: Start Browser With URL - 使用 URL启动浏览器 + 使用 URL 启动浏览器 @@ -1642,7 +1642,7 @@ Error: The current object is auto-generated and only supports renaming through the Managed Resources Editor. - 当前对象是自动生成的,只支持通过托管资源编辑器重命名。 + 当前对象是自动生成的,只支持通过受管理资源编辑器重命名。 @@ -1830,7 +1830,6 @@ CONSIDER: get this from CodeDom {0} x {1} {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" @@ -1934,7 +1933,7 @@ CONSIDER: get this from CodeDom New I&con... - 新图标(&C)... + 新建图标(&C)... Menu items under the "Add" button @@ -2123,7 +2122,7 @@ CONSIDER: get this from CodeDom Managed Resources Editor - 托管资源编辑器 + 受管理资源编辑器 @@ -2537,7 +2536,7 @@ app.config 文件中的新值为“{1}” This class allows you to handle specific events on the settings class: - 通过此类可以处理设置类的特定事件: + 通过此类可以处理设置类的特定事件: Comments for user part of extending generated settings class @@ -2562,7 +2561,7 @@ app.config 文件中的新值为“{1}” To add event handlers for saving and changing settings, uncomment the lines below: - 若要为保存和更改设置添加事件处理程序,请取消注释下列行: + 若要为保存和更改设置添加事件处理程序,请取消注释下列行: @@ -2720,7 +2719,7 @@ app.config 文件中的新值为“{1}” Startup &URI: - 启动和 URI: + 启动 URI (&U): diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hant.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hant.xlf index 11c81c6df1..17c64ffefb 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hant.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hant.xlf @@ -1830,7 +1830,6 @@ CONSIDER: get this from CodeDom {0} x {1} {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf index ecf110592c..d2573be1ea 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf @@ -109,7 +109,7 @@ Analyze and suggest fixes for unused values - Analizar y sugerir correcciones para valores no utilizados + Analizza e suggerisci correzioni per valori inutilizzati diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf index 17f3090936..546048846d 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf @@ -49,7 +49,7 @@ D_ash underline - 短线下划线(_A) + 短线下划线(_A) diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.cs.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.cs.xlf index 88082b432a..33f237c69b 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.cs.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.cs.xlf @@ -19,7 +19,7 @@ Additional command line arguments passed to the F# Interactive executable by Visual Studio. (optimization and debug flags are ignored if script debugging is enabled) - Další argumenty příkazového řádku předané F# Interactive a spustitelné ve Visual Studiu. (Pokud se povolí ladění skriptů, ignorují se příznaky optimalizace a ladění.) + Další argumenty příkazového řádku předané F# Interactive a spustitelné v sadě Visual Studio. (Pokud se povolí ladění skriptů, ignorují se příznaky optimalizace a ladění.) @@ -34,7 +34,7 @@ Prevents referenced assemblies from being locked by the F# Interactive process. - Znemožňuje zamknutí odkazovaných sestavení interaktivním procesem jazyka F#. + Znemožňuje zamknutí odkazovaných sestavení procesem F# Interactive. diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.de.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.de.xlf index da02ba8a88..7178a91c60 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.de.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.de.xlf @@ -34,7 +34,7 @@ Prevents referenced assemblies from being locked by the F# Interactive process. - Verhindert, dass referenzierte Assemblys vom interaktiven F#-Prozess gesperrt werden. + Verhindert, dass referenzierte Assemblys vom F# Interactive-Prozess gesperrt werden. diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.ja.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.ja.xlf index ff7eac6cb5..1b938bc2d4 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.ja.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.ja.xlf @@ -9,7 +9,7 @@ If set to true, and the current machine is 64-bit, then run F# Interactive as a 64-bit process. (Otherwise, F# Interactive is a 32-bit process.) - true に設定されていて、現在のコンピューターが 64 ビットである場合は、F# Interactive を 64 ビット プロセスで実行してください (そうしないと、F# Interactive は 32 ビット プロセスになります)。 + true に設定されていて、現在のコンピューターが 64 ビットである場合は、F# インタラクティブを 64 ビット プロセスで実行してください (そうしないと、F# インタラクティブは 32 ビット プロセスになります)。 @@ -19,7 +19,7 @@ Additional command line arguments passed to the F# Interactive executable by Visual Studio. (optimization and debug flags are ignored if script debugging is enabled) - 追加のコマンド ライン引数が Visual Studio によって F# Interactive 実行可能ファイルに渡されました。(スクリプト デバッグが有効な場合、最適化とデバッグのフラグは無視されます) + 追加のコマンド ライン引数が Visual Studio によって F# インタラクティブ実行可能ファイルに渡されました。(スクリプト デバッグが有効な場合、最適化とデバッグのフラグは無視されます) @@ -34,7 +34,7 @@ Prevents referenced assemblies from being locked by the F# Interactive process. - 参照アセンブリを F# 対話型プロセスによってロックされないようにします。 + 参照アセンブリを F# インタラクティブ プロセスによってロックされないようにします。 diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.tr.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.tr.xlf index 6c10979e7b..5fef942b6e 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.tr.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.tr.xlf @@ -4,7 +4,7 @@ 64-bit F# Interactive - 64 bit F# Interactive + 64 bit F# Etkileşimli @@ -19,7 +19,7 @@ Additional command line arguments passed to the F# Interactive executable by Visual Studio. (optimization and debug flags are ignored if script debugging is enabled) - Visual Studio tarafından çalıştırılabilen F# Interactive'e geçirilmiş ek komut satırı bağımsız değişkenleri. (Betik hata ayıklaması etkinleştirilmişse en iyi duruma getirme ve hata ayıklama bayrakları yok sayılır.) + Visual Studio tarafından çalıştırılabilen F# Etkileşimli'ye geçirilmiş ek komut satırı bağımsız değişkenleri. (Betik hata ayıklaması etkinleştirilmişse en iyi duruma getirme ve hata ayıklama bayrakları yok sayılır.) @@ -44,7 +44,7 @@ Enable debugging of F# scripts (may impact script performance, requires reset of F# Interactive) - F# betiklerinde hata ayıklamayı etkinleştir (betik performansını etkileyebilir, F# Interactive'in sıfırlanmasını gerektirir) + F# betiklerinde hata ayıklamayı etkinleştir (betik performansını etkileyebilir, F# Etkileşimli'nin sıfırlanmasını gerektirir) diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.zh-Hans.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.zh-Hans.xlf index ac090694c6..fa1db48b94 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/Properties.zh-Hans.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/Properties.zh-Hans.xlf @@ -4,12 +4,12 @@ 64-bit F# Interactive - 64 位 F# 交互 + 64 位 F# 交互窗口 If set to true, and the current machine is 64-bit, then run F# Interactive as a 64-bit process. (Otherwise, F# Interactive is a 32-bit process.) - 如果设为 true,且当前计算机是 64 位的,则将 F# 交互作为 64 位进程运行。(否则,F# 交互为 32 位进程。) + 如果设为 true,且当前计算机是 64 位的,则将 F# 交互窗口作为 64 位进程运行。(否则,F# 交互为 32 位进程。) @@ -44,7 +44,7 @@ Enable debugging of F# scripts (may impact script performance, requires reset of F# Interactive) - 启用 F# 脚本的调试(可能会影响脚本性能,需要重置 F# 交互) + 启用 F# 脚本的调试(可能会影响脚本性能,需要重置 F# 交互窗口) diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.ja.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.ja.xlf index 23f522980d..34c5ae7317 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.ja.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.ja.xlf @@ -4,7 +4,7 @@ Cannot create window F# Interactive ToolWindow - F# Interactive ToolWindow ウィンドウを作成できません + F# インタラクティブ ToolWindow ウィンドウを作成できません @@ -29,7 +29,7 @@ F# Interactive - F# Interactive + F# インタラクティブ diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.tr.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.tr.xlf index 1eaca3b51c..6d80fb6bee 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.tr.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.tr.xlf @@ -4,7 +4,7 @@ Cannot create window F# Interactive ToolWindow - F# Interactive ToolWindow penceresi oluşturulamıyor + F# Etkileşimli ToolWindow penceresi oluşturulamıyor @@ -34,7 +34,7 @@ Could not find fsi.exe, the F# Interactive executable.\nThis file does not exist:\n\n{0}\n - F# Interactive çalıştırılabilir dosyası olan fsi.exe bulunamıyor.\nBu dosya yok:\n\n{0}\n + F# Etkileşimli çalıştırılabilir dosyası olan fsi.exe bulunamıyor.\nBu dosya yok:\n\n{0}\n diff --git a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.zh-Hans.xlf b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.zh-Hans.xlf index 9bc022caba..f4789a477c 100644 --- a/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.zh-Hans.xlf +++ b/vsintegration/src/FSharp.VS.FSI/xlf/VFSIstrings.txt.zh-Hans.xlf @@ -29,7 +29,7 @@ F# Interactive - F# 交互 + F# 交互窗口 @@ -44,7 +44,7 @@ The current F# Interactive session is not configured for debugging. For the best experience, enable debugging in F# Interactive settings, then reset the session.\n\nAttempt debugging with current settings? - 当前 F# 交互会话未进行调试配置。为实现最佳体验,请启用 F# 交互设置中的调试,然后重置会话。\n\n是否尝试用当前设置进行调试? + 当前 F# 交互窗口会话未进行调试配置。为实现最佳体验,请启用 F# 交互窗口设置中的调试,然后重置会话。\n\n是否尝试用当前设置进行调试? From 037fd95249a5e1e6aa496f89ccbee9173dbf4192 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Tue, 7 May 2019 00:55:13 -0700 Subject: [PATCH 023/159] remove redundant copyright (#6691) Remove copyright made redundant by dotnet/arcade#2635. --- eng/targets/Settings.props | 1 - 1 file changed, 1 deletion(-) diff --git a/eng/targets/Settings.props b/eng/targets/Settings.props index 0022b125e4..ae7833a18b 100644 --- a/eng/targets/Settings.props +++ b/eng/targets/Settings.props @@ -4,7 +4,6 @@ MIT Microsoft and F# Software Foundation Visual F# Compiler FSharp functional programming - $(CopyrightMicrosoft) $(ArtifactsBinDir) From 4034f5373223d618c3b54ddd98eb381dedc32b6f Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Tue, 7 May 2019 12:37:42 +0000 Subject: [PATCH 024/159] [master] Update dependencies from dotnet/arcade (#6686) * Update dependencies from https://github.com/dotnet/arcade build 20190503.8 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19253.8 * Update dependencies from https://github.com/dotnet/arcade build 20190504.1 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19254.1 * Update dependencies from https://github.com/dotnet/arcade build 20190505.2 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19255.2 --- eng/Version.Details.xml | 4 ++-- eng/common/build.ps1 | 2 +- eng/common/build.sh | 2 +- global.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 6833196a77..f9036d33d6 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - ed63a7faf2d119829dd971be91bb46b6ebaa1dd2 + 6a34948f7bdbc3ceb2fb16441b49f7748a462646 diff --git a/eng/common/build.ps1 b/eng/common/build.ps1 index ed9f754ea8..d7e3799ebd 100644 --- a/eng/common/build.ps1 +++ b/eng/common/build.ps1 @@ -122,7 +122,7 @@ try { . $configureToolsetScript } - if ($restore) { + if (($restore) -and ($null -eq $env:DisableNativeToolsetInstalls)) { InitializeNativeTools } diff --git a/eng/common/build.sh b/eng/common/build.sh index e14210632a..d038959ab4 100644 --- a/eng/common/build.sh +++ b/eng/common/build.sh @@ -218,7 +218,7 @@ if [[ -n "${useInstalledDotNetCli:-}" ]]; then use_installed_dotnet_cli="$useInstalledDotNetCli" fi -if [[ "$restore" == true ]]; then +if [[ "$restore" == true && -z ${DisableNativeToolsetInstalls:-} ]]; then InitializeNativeTools fi diff --git a/global.json b/global.json index 1ce2d8648e..5f68f54181 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19252.2", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19255.2", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From ef4d2a9a7b76dcf2f3ee1b15a456dc46f33c793d Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Thu, 9 May 2019 12:27:30 +0000 Subject: [PATCH 025/159] [master] Update dependencies from dotnet/arcade (#6693) * Update dependencies from https://github.com/dotnet/arcade build 20190506.12 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19256.12 * Update dependencies from https://github.com/dotnet/arcade build 20190507.7 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19257.7 --- eng/Version.Details.xml | 4 +- eng/common/build.sh | 18 +------ eng/common/cross/arm/sources.list.vivid | 11 ----- eng/common/cross/arm/sources.list.wily | 11 ----- eng/common/cross/arm64/sources.list.vivid | 11 ----- eng/common/cross/arm64/sources.list.wily | 11 ----- eng/common/cross/build-rootfs.sh | 58 ++++++++++++++--------- eng/common/cross/x86/sources.list.vivid | 11 ----- eng/common/cross/x86/sources.list.wily | 11 ----- eng/common/dotnet-install.cmd | 2 + eng/common/dotnet-install.ps1 | 22 +++++++++ eng/common/dotnet-install.sh | 49 +++++++++++++++++++ eng/common/templates/job/job.yml | 3 ++ eng/common/tools.ps1 | 27 ++++++++--- eng/common/tools.sh | 39 ++++++++++++--- global.json | 2 +- 16 files changed, 170 insertions(+), 120 deletions(-) delete mode 100644 eng/common/cross/arm/sources.list.vivid delete mode 100644 eng/common/cross/arm/sources.list.wily delete mode 100644 eng/common/cross/arm64/sources.list.vivid delete mode 100644 eng/common/cross/arm64/sources.list.wily delete mode 100644 eng/common/cross/x86/sources.list.vivid delete mode 100644 eng/common/cross/x86/sources.list.wily create mode 100644 eng/common/dotnet-install.cmd create mode 100644 eng/common/dotnet-install.ps1 create mode 100644 eng/common/dotnet-install.sh diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index f9036d33d6..bf0138e992 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - 6a34948f7bdbc3ceb2fb16441b49f7748a462646 + bda52d7619f9420de46f2c39ffc972864bbcab63 diff --git a/eng/common/build.sh b/eng/common/build.sh index d038959ab4..ce846d888d 100644 --- a/eng/common/build.sh +++ b/eng/common/build.sh @@ -35,7 +35,7 @@ usage() echo " --nodeReuse Sets nodereuse msbuild parameter ('true' or 'false')" echo " --warnAsError Sets warnaserror msbuild parameter ('true' or 'false')" echo "" - echo "Command line arguments starting with '/p:' are passed through to MSBuild." + echo "Command line arguments not listed above are passed thru to msbuild." echo "Arguments can also be passed in with a single hyphen." } @@ -137,22 +137,8 @@ while [[ $# > 0 ]]; do node_reuse=$2 shift ;; - -p:*|/p:*) - properties="$properties $1" - ;; - -m:*|/m:*) - properties="$properties $1" - ;; - -bl:*|/bl:*) - properties="$properties $1" - ;; - -dl:*|/dl:*) - properties="$properties $1" - ;; *) - echo "Invalid argument: $1" - usage - exit 1 + properties="$properties $1" ;; esac diff --git a/eng/common/cross/arm/sources.list.vivid b/eng/common/cross/arm/sources.list.vivid deleted file mode 100644 index 0b1215e475..0000000000 --- a/eng/common/cross/arm/sources.list.vivid +++ /dev/null @@ -1,11 +0,0 @@ -deb http://ports.ubuntu.com/ubuntu-ports/ vivid main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ vivid main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ vivid-updates main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ vivid-updates main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ vivid-backports main restricted -deb-src http://ports.ubuntu.com/ubuntu-ports/ vivid-backports main restricted - -deb http://ports.ubuntu.com/ubuntu-ports/ vivid-security main restricted universe multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports/ vivid-security main restricted universe multiverse \ No newline at end of file diff --git a/eng/common/cross/arm/sources.list.wily b/eng/common/cross/arm/sources.list.wily deleted file mode 100644 index e23d1e02a0..0000000000 --- a/eng/common/cross/arm/sources.list.wily +++ /dev/null @@ -1,11 +0,0 @@ -deb http://ports.ubuntu.com/ubuntu-ports/ wily main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ wily main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ wily-updates main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ wily-updates main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ wily-backports main restricted -deb-src http://ports.ubuntu.com/ubuntu-ports/ wily-backports main restricted - -deb http://ports.ubuntu.com/ubuntu-ports/ wily-security main restricted universe multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports/ wily-security main restricted universe multiverse \ No newline at end of file diff --git a/eng/common/cross/arm64/sources.list.vivid b/eng/common/cross/arm64/sources.list.vivid deleted file mode 100644 index 0b1215e475..0000000000 --- a/eng/common/cross/arm64/sources.list.vivid +++ /dev/null @@ -1,11 +0,0 @@ -deb http://ports.ubuntu.com/ubuntu-ports/ vivid main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ vivid main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ vivid-updates main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ vivid-updates main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ vivid-backports main restricted -deb-src http://ports.ubuntu.com/ubuntu-ports/ vivid-backports main restricted - -deb http://ports.ubuntu.com/ubuntu-ports/ vivid-security main restricted universe multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports/ vivid-security main restricted universe multiverse \ No newline at end of file diff --git a/eng/common/cross/arm64/sources.list.wily b/eng/common/cross/arm64/sources.list.wily deleted file mode 100644 index e23d1e02a0..0000000000 --- a/eng/common/cross/arm64/sources.list.wily +++ /dev/null @@ -1,11 +0,0 @@ -deb http://ports.ubuntu.com/ubuntu-ports/ wily main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ wily main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ wily-updates main restricted universe -deb-src http://ports.ubuntu.com/ubuntu-ports/ wily-updates main restricted universe - -deb http://ports.ubuntu.com/ubuntu-ports/ wily-backports main restricted -deb-src http://ports.ubuntu.com/ubuntu-ports/ wily-backports main restricted - -deb http://ports.ubuntu.com/ubuntu-ports/ wily-security main restricted universe multiverse -deb-src http://ports.ubuntu.com/ubuntu-ports/ wily-security main restricted universe multiverse \ No newline at end of file diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh index 805948ca83..83ec39195c 100644 --- a/eng/common/cross/build-rootfs.sh +++ b/eng/common/cross/build-rootfs.sh @@ -2,21 +2,21 @@ usage() { - echo "Usage: $0 [BuildArch] [LinuxCodeName] [lldbx.y] [--skipunmount]" + echo "Usage: $0 [BuildArch] [LinuxCodeName] [lldbx.y] [--skipunmount] --rootfs ]" echo "BuildArch can be: arm(default), armel, arm64, x86" - echo "LinuxCodeName - optional, Code name for Linux, can be: trusty(default), vivid, wily, xenial, zesty, bionic, alpine. If BuildArch is armel, LinuxCodeName is jessie(default) or tizen." - echo "lldbx.y - optional, LLDB version, can be: lldb3.6(default), lldb3.8, lldb3.9, lldb4.0, no-lldb. Ignored for alpine" + echo "LinuxCodeName - optional, Code name for Linux, can be: trusty, xenial(default), zesty, bionic, alpine. If BuildArch is armel, LinuxCodeName is jessie(default) or tizen." + echo "lldbx.y - optional, LLDB version, can be: lldb3.9(default), lldb4.0, lldb5.0, lldb6.0 no-lldb. Ignored for alpine" echo "--skipunmount - optional, will skip the unmount of rootfs folder." exit 1 } -__LinuxCodeName=trusty +__LinuxCodeName=xenial __CrossDir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) __InitialDir=$PWD __BuildArch=arm __UbuntuArch=armhf __UbuntuRepo="http://ports.ubuntu.com/" -__LLDB_Package="lldb-3.6-dev" +__LLDB_Package="liblldb-3.9-dev" __SkipUnmount=0 # base development support @@ -53,8 +53,12 @@ __AlpinePackages+=" openssl-dev" __AlpinePackages+=" zlib-dev" __UnprocessedBuildArgs= -for i in "$@" ; do - lowerI="$(echo $i | awk '{print tolower($0)}')" +while :; do + if [ $# -le 0 ]; then + break + fi + + lowerI="$(echo $1 | awk '{print tolower($0)}')" case $lowerI in -?|-h|--help) usage @@ -95,38 +99,40 @@ for i in "$@" ; do lldb4.0) __LLDB_Package="liblldb-4.0-dev" ;; + lldb5.0) + __LLDB_Package="liblldb-5.0-dev" + ;; + lldb6.0) + __LLDB_Package="liblldb-6.0-dev" + ;; no-lldb) unset __LLDB_Package ;; - vivid) - if [ "$__LinuxCodeName" != "jessie" ]; then - __LinuxCodeName=vivid - fi - ;; - wily) + trusty) # Ubuntu 14.04 if [ "$__LinuxCodeName" != "jessie" ]; then - __LinuxCodeName=wily + __LinuxCodeName=trusty fi ;; - xenial) + xenial) # Ubunry 16.04 if [ "$__LinuxCodeName" != "jessie" ]; then __LinuxCodeName=xenial fi ;; - zesty) + zesty) # Ununtu 17.04 if [ "$__LinuxCodeName" != "jessie" ]; then __LinuxCodeName=zesty fi ;; - bionic) + bionic) # Ubuntu 18.04 if [ "$__LinuxCodeName" != "jessie" ]; then __LinuxCodeName=bionic fi ;; - jessie) + jessie) # Debian 8 __LinuxCodeName=jessie __UbuntuRepo="http://ftp.debian.org/debian/" ;; + # TBD Stretch -> Debian 9, Buster -> Debian 10 tizen) if [ "$__BuildArch" != "armel" ]; then echo "Tizen is available only for armel." @@ -144,10 +150,16 @@ for i in "$@" ; do --skipunmount) __SkipUnmount=1 ;; + --rootfsdir|-rootfsdir) + shift + __RootfsDir=$1 + ;; *) - __UnprocessedBuildArgs="$__UnprocessedBuildArgs $i" + __UnprocessedBuildArgs="$__UnprocessedBuildArgs $1" ;; esac + + shift done if [ "$__BuildArch" == "armel" ]; then @@ -155,12 +167,14 @@ if [ "$__BuildArch" == "armel" ]; then fi __UbuntuPackages+=" ${__LLDB_Package:-}" -__RootfsDir="$__CrossDir/rootfs/$__BuildArch" - -if [[ -n "$ROOTFS_DIR" ]]; then +if [ -z "$__RootfsDir" ] && [ ! -z "$ROOTFS_DIR" ]; then __RootfsDir=$ROOTFS_DIR fi +if [ -z "$__RootfsDir" ]; then + __RootfsDir="$__CrossDir/rootfs/$__BuildArch" +fi + if [ -d "$__RootfsDir" ]; then if [ $__SkipUnmount == 0 ]; then umount $__RootfsDir/* diff --git a/eng/common/cross/x86/sources.list.vivid b/eng/common/cross/x86/sources.list.vivid deleted file mode 100644 index 26d37b20fc..0000000000 --- a/eng/common/cross/x86/sources.list.vivid +++ /dev/null @@ -1,11 +0,0 @@ -deb http://archive.ubuntu.com/ubuntu/ vivid main restricted universe -deb-src http://archive.ubuntu.com/ubuntu/ vivid main restricted universe - -deb http://archive.ubuntu.com/ubuntu/ vivid-updates main restricted universe -deb-src http://archive.ubuntu.com/ubuntu/ vivid-updates main restricted universe - -deb http://archive.ubuntu.com/ubuntu/ vivid-backports main restricted -deb-src http://archive.ubuntu.com/ubuntu/ vivid-backports main restricted - -deb http://archive.ubuntu.com/ubuntu/ vivid-security main restricted universe multiverse -deb-src http://archive.ubuntu.com/ubuntu/ vivid-security main restricted universe multiverse diff --git a/eng/common/cross/x86/sources.list.wily b/eng/common/cross/x86/sources.list.wily deleted file mode 100644 index c4b0b442ab..0000000000 --- a/eng/common/cross/x86/sources.list.wily +++ /dev/null @@ -1,11 +0,0 @@ -deb http://archive.ubuntu.com/ubuntu/ wily main restricted universe -deb-src http://archive.ubuntu.com/ubuntu/ wily main restricted universe - -deb http://archive.ubuntu.com/ubuntu/ wily-updates main restricted universe -deb-src http://archive.ubuntu.com/ubuntu/ wily-updates main restricted universe - -deb http://archive.ubuntu.com/ubuntu/ wily-backports main restricted -deb-src http://archive.ubuntu.com/ubuntu/ wily-backports main restricted - -deb http://archive.ubuntu.com/ubuntu/ wily-security main restricted universe multiverse -deb-src http://archive.ubuntu.com/ubuntu/ wily-security main restricted universe multiverse diff --git a/eng/common/dotnet-install.cmd b/eng/common/dotnet-install.cmd new file mode 100644 index 0000000000..b1c2642e76 --- /dev/null +++ b/eng/common/dotnet-install.cmd @@ -0,0 +1,2 @@ +@echo off +powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0dotnet-install.ps1""" %*" \ No newline at end of file diff --git a/eng/common/dotnet-install.ps1 b/eng/common/dotnet-install.ps1 new file mode 100644 index 0000000000..5987943fd6 --- /dev/null +++ b/eng/common/dotnet-install.ps1 @@ -0,0 +1,22 @@ +[CmdletBinding(PositionalBinding=$false)] +Param( + [string] $verbosity = "minimal", + [string] $architecture = "", + [string] $version = "Latest", + [string] $runtime = "dotnet" +) + +. $PSScriptRoot\tools.ps1 + +try { + $dotnetRoot = Join-Path $RepoRoot ".dotnet" + InstallDotNet $dotnetRoot $version $architecture $runtime $true +} +catch { + Write-Host $_ + Write-Host $_.Exception + Write-Host $_.ScriptStackTrace + ExitWithExitCode 1 +} + +ExitWithExitCode 0 \ No newline at end of file diff --git a/eng/common/dotnet-install.sh b/eng/common/dotnet-install.sh new file mode 100644 index 0000000000..c3072c958a --- /dev/null +++ b/eng/common/dotnet-install.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash + +source="${BASH_SOURCE[0]}" +# resolve $source until the file is no longer a symlink +while [[ -h "$source" ]]; do + scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + source="$(readlink "$source")" + # if $source was a relative symlink, we need to resolve it relative to the path where the + # symlink file was located + [[ $source != /* ]] && source="$scriptroot/$source" +done +scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + +version='Latest' +architecture='' +runtime='dotnet' +while [[ $# > 0 ]]; do + opt="$(echo "$1" | awk '{print tolower($0)}')" + case "$opt" in + -version|-v) + shift + version="$1" + ;; + -architecture|-a) + shift + architecture="$1" + ;; + -runtime|-r) + shift + runtime="$1" + ;; + *) + echo "Invalid argument: $1" + usage + exit 1 + ;; + esac + shift +done + +. "$scriptroot/tools.sh" +dotnetRoot="$repo_root/.dotnet" +InstallDotNet $dotnetRoot $version "$architecture" $runtime true || { + local exit_code=$? + echo "dotnet-install.sh failed (exit code '$exit_code')." >&2 + ExitWithExitCode $exit_code +} + +ExitWithExitCode 0 diff --git a/eng/common/templates/job/job.yml b/eng/common/templates/job/job.yml index 7839b70bb7..1814e0ab61 100644 --- a/eng/common/templates/job/job.yml +++ b/eng/common/templates/job/job.yml @@ -90,6 +90,9 @@ jobs: timeoutInMinutes: ${{ parameters.timeoutInMinutes }} variables: + - ${{ if eq(parameters.enableTelemetry, 'true') }}: + - name: DOTNET_CLI_TELEMETRY_PROFILE + value: '$(Build.Repository.Uri)' - ${{ each variable in parameters.variables }}: # handle name-value variable syntax # example: diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index 09794dff83..d86eef1e3a 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -108,7 +108,7 @@ function InitializeDotNetCli([bool]$install) { } # Find the first path on %PATH% that contains the dotnet.exe - if ($useInstalledDotNetCli -and ($env:DOTNET_INSTALL_DIR -eq $null)) { + if ($useInstalledDotNetCli -and (-not $globalJsonHasRuntimes) -and ($env:DOTNET_INSTALL_DIR -eq $null)) { $dotnetCmd = Get-Command "dotnet.exe" -ErrorAction SilentlyContinue if ($dotnetCmd -ne $null) { $env:DOTNET_INSTALL_DIR = Split-Path $dotnetCmd.Path -Parent @@ -119,7 +119,7 @@ function InitializeDotNetCli([bool]$install) { # Use dotnet installation specified in DOTNET_INSTALL_DIR if it contains the required SDK version, # otherwise install the dotnet CLI and SDK to repo local .dotnet directory to avoid potential permission issues. - if (($env:DOTNET_INSTALL_DIR -ne $null) -and (Test-Path(Join-Path $env:DOTNET_INSTALL_DIR "sdk\$dotnetSdkVersion"))) { + if ((-not $globalJsonHasRuntimes) -and ($env:DOTNET_INSTALL_DIR -ne $null) -and (Test-Path(Join-Path $env:DOTNET_INSTALL_DIR "sdk\$dotnetSdkVersion"))) { $dotnetRoot = $env:DOTNET_INSTALL_DIR } else { $dotnetRoot = Join-Path $RepoRoot ".dotnet" @@ -152,7 +152,7 @@ function InitializeDotNetCli([bool]$install) { } function GetDotNetInstallScript([string] $dotnetRoot) { - $installScript = "$dotnetRoot\dotnet-install.ps1" + $installScript = Join-Path $dotnetRoot "dotnet-install.ps1" if (!(Test-Path $installScript)) { Create-Directory $dotnetRoot Invoke-WebRequest "https://dot.net/v1/dotnet-install.ps1" -OutFile $installScript @@ -162,9 +162,21 @@ function GetDotNetInstallScript([string] $dotnetRoot) { } function InstallDotNetSdk([string] $dotnetRoot, [string] $version, [string] $architecture = "") { + InstallDotNet $dotnetRoot $version $architecture +} + +function InstallDotNet([string] $dotnetRoot, [string] $version, [string] $architecture = "", [string] $runtime = "", [bool] $skipNonVersionedFiles = $false) { $installScript = GetDotNetInstallScript $dotnetRoot $installScript = GetDotNetInstallScript $dotnetRoot - $archArg = if ($architecture) { $architecture } else { "" } - & $installScript -Version $version -InstallDir $dotnetRoot -Architecture $archArg + $installParameters = @{ + Version = $version + InstallDir = $dotnetRoot + } + + if ($architecture) { $installParameters.Architecture = $architecture } + if ($runtime) { $installParameters.Runtime = $runtime } + if ($skipNonVersionedFiles) { $installParameters.SkipNonVersionedFiles = $skipNonVersionedFiles } + + & $installScript @installParameters if ($lastExitCode -ne 0) { Write-Host "Failed to install dotnet cli (exit code '$lastExitCode')." -ForegroundColor Red ExitWithExitCode $lastExitCode @@ -429,6 +441,7 @@ function InitializeToolset() { $bl = if ($binaryLog) { "/bl:" + (Join-Path $LogDir "ToolsetRestore.binlog") } else { "" } '' | Set-Content $proj + MSBuild $proj $bl /t:__WriteToolsetLocation /clp:ErrorsOnly`;NoSummary /p:__ToolsetLocationOutputFile=$toolsetLocationFile $path = Get-Content $toolsetLocationFile -TotalCount 1 @@ -522,6 +535,8 @@ $ToolsDir = Join-Path $RepoRoot ".tools" $LogDir = Join-Path (Join-Path $ArtifactsDir "log") $configuration $TempDir = Join-Path (Join-Path $ArtifactsDir "tmp") $configuration $GlobalJson = Get-Content -Raw -Path (Join-Path $RepoRoot "global.json") | ConvertFrom-Json +# true if global.json contains a "runtimes" section +$globalJsonHasRuntimes = if ($GlobalJson.tools.PSObject.Properties.Name -Match 'runtimes') { $true } else { $false } Create-Directory $ToolsetDir Create-Directory $TempDir @@ -534,4 +549,4 @@ if ($ci) { $env:TEMP = $TempDir $env:TMP = $TempDir -} +} \ No newline at end of file diff --git a/eng/common/tools.sh b/eng/common/tools.sh index 59f47c5fa9..9dc565e296 100644 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -101,7 +101,7 @@ function InitializeDotNetCli { fi # Find the first path on $PATH that contains the dotnet.exe - if [[ "$use_installed_dotnet_cli" == true && -z "${DOTNET_INSTALL_DIR:-}" ]]; then + if [[ "$use_installed_dotnet_cli" == true && $global_json_has_runtimes == false && -z "${DOTNET_INSTALL_DIR:-}" ]]; then local dotnet_path=`command -v dotnet` if [[ -n "$dotnet_path" ]]; then ResolvePath "$dotnet_path" @@ -115,10 +115,11 @@ function InitializeDotNetCli { # Use dotnet installation specified in DOTNET_INSTALL_DIR if it contains the required SDK version, # otherwise install the dotnet CLI and SDK to repo local .dotnet directory to avoid potential permission issues. - if [[ -n "${DOTNET_INSTALL_DIR:-}" && -d "$DOTNET_INSTALL_DIR/sdk/$dotnet_sdk_version" ]]; then + if [[ $global_json_has_runtimes == false && -n "${DOTNET_INSTALL_DIR:-}" && -d "$DOTNET_INSTALL_DIR/sdk/$dotnet_sdk_version" ]]; then dotnet_root="$DOTNET_INSTALL_DIR" else dotnet_root="$repo_root/.dotnet" + export DOTNET_INSTALL_DIR="$dotnet_root" if [[ ! -d "$DOTNET_INSTALL_DIR/sdk/$dotnet_sdk_version" ]]; then @@ -149,16 +150,34 @@ function InitializeDotNetCli { function InstallDotNetSdk { local root=$1 local version=$2 + local architecture="" + if [[ $# == 3 ]]; then + architecture=$3 + fi + InstallDotNet "$root" "$version" $architecture +} +function InstallDotNet { + local root=$1 + local version=$2 + GetDotNetInstallScript "$root" local install_script=$_GetDotNetInstallScript - local arch_arg="" - if [[ $# == 3 ]]; then - arch_arg="--architecture $3" + local archArg='' + if [[ "$#" -ge "3" ]]; then + archArg="--architecture $3" + fi + local runtimeArg='' + if [[ "$#" -ge "4" ]]; then + runtimeArg="--runtime $4" fi - bash "$install_script" --version $version --install-dir "$root" $arch_arg || { + local skipNonVersionedFilesArg="" + if [[ "$#" -ge "5" ]]; then + skipNonVersionedFilesArg="--skip-non-versioned-files" + fi + bash "$install_script" --version $version --install-dir "$root" $archArg $runtimeArg $skipNonVersionedFilesArg || { local exit_code=$? echo "Failed to install dotnet SDK (exit code '$exit_code')." >&2 ExitWithExitCode $exit_code @@ -323,6 +342,12 @@ log_dir="$artifacts_dir/log/$configuration" temp_dir="$artifacts_dir/tmp/$configuration" global_json_file="$repo_root/global.json" +# determine if global.json contains a "runtimes" entry +global_json_has_runtimes=false +dotnetlocal_key=`grep -m 1 "runtimes" "$global_json_file"` || true +if [[ -n "$dotnetlocal_key" ]]; then + global_json_has_runtimes=true +fi # HOME may not be defined in some scenarios, but it is required by NuGet if [[ -z $HOME ]]; then @@ -337,4 +362,4 @@ mkdir -p "$log_dir" if [[ $ci == true ]]; then export TEMP="$temp_dir" export TMP="$temp_dir" -fi +fi \ No newline at end of file diff --git a/global.json b/global.json index 5f68f54181..be2f7cb150 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19255.2", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19257.7", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From f9787ec17a2967f4a323fdb51806640a35f20b4a Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Fri, 10 May 2019 12:25:54 +0000 Subject: [PATCH 026/159] Update dependencies from https://github.com/dotnet/arcade build 20190508.5 (#6703) - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19258.5 --- eng/Version.Details.xml | 4 ++-- eng/common/tools.ps1 | 27 +++++++++++++++++++++++++-- global.json | 2 +- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index bf0138e992..2f5cd4a0aa 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - bda52d7619f9420de46f2c39ffc972864bbcab63 + 9005cee9510d23535c09bd9b6be7c426e526c067 diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index d86eef1e3a..b0e767e811 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -11,6 +11,12 @@ # Binary log must be enabled on CI. [bool]$binaryLog = if (Test-Path variable:binaryLog) { $binaryLog } else { $ci } +# Set to true to use the pipelines logger which will enable Azure logging output. +# https://github.com/Microsoft/azure-pipelines-tasks/blob/master/docs/authoring/commands.md +# This flag is meant as a temporary opt-opt for the feature while validate it across +# our consumers. It will be deleted in the future. +[bool]$pipelinesLog = if (Test-Path variable:pipelinesLog) { $pipelinesLog } else { $ci } + # Turns on machine preparation/clean up code that changes the machine state (e.g. kills build processes). [bool]$prepareMachine = if (Test-Path variable:prepareMachine) { $prepareMachine } else { $false } @@ -442,7 +448,7 @@ function InitializeToolset() { '' | Set-Content $proj - MSBuild $proj $bl /t:__WriteToolsetLocation /clp:ErrorsOnly`;NoSummary /p:__ToolsetLocationOutputFile=$toolsetLocationFile + MSBuild-Core $proj $bl /t:__WriteToolsetLocation /clp:ErrorsOnly`;NoSummary /p:__ToolsetLocationOutputFile=$toolsetLocationFile $path = Get-Content $toolsetLocationFile -TotalCount 1 if (!(Test-Path $path)) { @@ -472,6 +478,23 @@ function Stop-Processes() { # Terminates the script if the build fails. # function MSBuild() { + if ($pipelinesLog -and $msbuildEngine) { + $toolsetBuildProject = InitializeToolset + $tf = if ($msbuildEngine -eq "dotnet") { "netcoreapp2.1" } else { "net472" } + $path = Split-Path -parent $toolsetBuildProject + $path = Join-Path $path "$tf\Microsoft.DotNet.Arcade.Sdk.dll" + $args += "/logger:$path" + } + + MSBuild-Core @args +} + +# +# Executes msbuild (or 'dotnet msbuild') with arguments passed to the function. +# The arguments are automatically quoted. +# Terminates the script if the build fails. +# +function MSBuild-Core() { if ($ci) { if (!$binaryLog) { throw "Binary log must be enabled in CI build." @@ -549,4 +572,4 @@ if ($ci) { $env:TEMP = $TempDir $env:TMP = $TempDir -} \ No newline at end of file +} diff --git a/global.json b/global.json index be2f7cb150..3e4fcbfdf0 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19257.7", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19258.5", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From f8082fa677a3c84ab379b46e718dba428764bdac Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Sun, 12 May 2019 03:10:17 +0000 Subject: [PATCH 027/159] [master] Update dependencies from dotnet/arcade (#6707) * Update dependencies from https://github.com/dotnet/arcade build 20190509.9 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19259.9 * Update dependencies from https://github.com/dotnet/arcade build 20190510.2 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19260.2 --- eng/Version.Details.xml | 4 ++-- eng/common/tools.ps1 | 10 +++++----- eng/common/tools.sh | 4 ++-- global.json | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 2f5cd4a0aa..d89f383bc3 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - 9005cee9510d23535c09bd9b6be7c426e526c067 + 810920cf8a5fc183585304193f8b4e4e189497e9 diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index b0e767e811..9ca177b82a 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -358,7 +358,7 @@ function InitializeBuildTool() { ExitWithExitCode 1 } - $buildTool = @{ Path = Join-Path $dotnetRoot "dotnet.exe"; Command = "msbuild" } + $buildTool = @{ Path = Join-Path $dotnetRoot "dotnet.exe"; Command = "msbuild"; Tool = "dotnet"; Framework = "netcoreapp2.1" } } elseif ($msbuildEngine -eq "vs") { try { $msbuildPath = InitializeVisualStudioMSBuild -install:$restore @@ -367,7 +367,7 @@ function InitializeBuildTool() { ExitWithExitCode 1 } - $buildTool = @{ Path = $msbuildPath; Command = "" } + $buildTool = @{ Path = $msbuildPath; Command = ""; Tool = "vs"; Framework = "net472" } } else { Write-Host "Unexpected value of -msbuildEngine: '$msbuildEngine'." -ForegroundColor Red ExitWithExitCode 1 @@ -478,11 +478,11 @@ function Stop-Processes() { # Terminates the script if the build fails. # function MSBuild() { - if ($pipelinesLog -and $msbuildEngine) { + if ($pipelinesLog) { + $buildTool = InitializeBuildTool $toolsetBuildProject = InitializeToolset - $tf = if ($msbuildEngine -eq "dotnet") { "netcoreapp2.1" } else { "net472" } $path = Split-Path -parent $toolsetBuildProject - $path = Join-Path $path "$tf\Microsoft.DotNet.Arcade.Sdk.dll" + $path = Join-Path $path (Join-Path $buildTool.Framework "Microsoft.DotNet.Arcade.Sdk.dll") $args += "/logger:$path" } diff --git a/eng/common/tools.sh b/eng/common/tools.sh index 9dc565e296..df3eb8bce0 100644 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -165,11 +165,11 @@ function InstallDotNet { local install_script=$_GetDotNetInstallScript local archArg='' - if [[ "$#" -ge "3" ]]; then + if [[ -n "${3:-}" ]]; then archArg="--architecture $3" fi local runtimeArg='' - if [[ "$#" -ge "4" ]]; then + if [[ -n "${4:-}" ]]; then runtimeArg="--runtime $4" fi diff --git a/global.json b/global.json index 3e4fcbfdf0..671e475276 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19258.5", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19260.2", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From daa76ff7f76bb75b7dd2f7817c0aafbf70d68ddd Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Mon, 13 May 2019 10:12:34 -0700 Subject: [PATCH 028/159] Looking at match01 --- flakey test (#6673) * Start the wire up * Redo using less memory * Add asserts * indent typo --- .../FSharp.Compiler.Service.fsproj | 3 + src/fsharp/CompileOps.fs | 12 +- src/fsharp/CompileOps.fsi | 4 +- src/fsharp/CompileOptions.fs | 16 +- src/fsharp/CompilerGlobalState.fs | 96 +++++++++ src/fsharp/DetupleArgs.fs | 7 +- .../FSharp.Compiler.Private.fsproj | 3 + src/fsharp/IlxGen.fs | 172 ++++++++-------- src/fsharp/InnerLambdasToTopLevelFuncs.fs | 12 +- src/fsharp/MethodCalls.fs | 5 +- src/fsharp/Optimizer.fs | 3 +- src/fsharp/PatternMatchCompilation.fs | 1 + src/fsharp/PostInferenceChecks.fs | 12 +- src/fsharp/QuotationTranslator.fs | 8 +- src/fsharp/SignatureConformance.fs | 4 +- src/fsharp/TastOps.fs | 185 ++++++++++-------- src/fsharp/TastOps.fsi | 24 +-- src/fsharp/TastPickle.fsi | 2 +- src/fsharp/TcGlobals.fs | 27 ++- src/fsharp/TypeChecker.fs | 13 +- src/fsharp/ast.fs | 68 ------- src/fsharp/fsi/fsi.fs | 21 +- src/fsharp/service/IncrementalBuild.fs | 2 +- src/fsharp/service/ServiceDeclarationLists.fs | 2 +- src/fsharp/symbols/Exprs.fs | 10 +- src/fsharp/symbols/SymbolHelpers.fs | 22 +-- src/fsharp/symbols/Symbols.fs | 7 +- src/fsharp/tast.fs | 49 ++--- .../Source/Optimizations/Inlining/env.lst | 3 +- 29 files changed, 430 insertions(+), 363 deletions(-) create mode 100644 src/fsharp/CompilerGlobalState.fs diff --git a/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj b/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj index ef30acc7ef..81db7f54c5 100644 --- a/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj +++ b/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj @@ -353,6 +353,9 @@ TypedAST/QuotationPickler.fs + + TypedAST/CompilerGlobalState.fs + TypedAST/tast.fs diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs index 237b6ae70d..d95bf2d070 100644 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -4639,13 +4639,13 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu match scoref with | ILScopeRef.Assembly aref -> Some aref | ILScopeRef.Local | ILScopeRef.Module _ -> error(InternalError("not ILScopeRef.Assembly", rangeStartup))) - fslibCcuInfo.FSharpViewOfMetadata - + fslibCcuInfo.FSharpViewOfMetadata + // OK, now we have both mscorlib.dll and FSharp.Core.dll we can create TcGlobals - let tcGlobals = TcGlobals(tcConfig.compilingFslib, ilGlobals, fslibCcu, - tcConfig.implicitIncludeDir, tcConfig.mlCompatibility, - tcConfig.isInteractive, tryFindSysTypeCcu, tcConfig.emitDebugInfoInQuotations, - tcConfig.noDebugData, tcConfig.pathMap) + let tcGlobals = TcGlobals(tcConfig.compilingFslib, ilGlobals, fslibCcu, + tcConfig.implicitIncludeDir, tcConfig.mlCompatibility, + tcConfig.isInteractive, tryFindSysTypeCcu, tcConfig.emitDebugInfoInQuotations, + tcConfig.noDebugData, tcConfig.pathMap) #if DEBUG // the global_g reference cell is used only for debug printing diff --git a/src/fsharp/CompileOps.fsi b/src/fsharp/CompileOps.fsi index 94d9bf5371..3d08610670 100644 --- a/src/fsharp/CompileOps.fsi +++ b/src/fsharp/CompileOps.fsi @@ -708,7 +708,7 @@ val GetInitialTcEnv: assemblyName: string * range * TcConfig * TcImports * TcGlo [] /// Represents the incremental type checking state for a set of inputs type TcState = - member NiceNameGenerator: Ast.NiceNameGenerator + member NiceNameGenerator: NiceNameGenerator /// The CcuThunk for the current assembly being checked member Ccu: CcuThunk @@ -729,7 +729,7 @@ type TcState = /// Get the initial type checking state for a set of inputs val GetInitialTcState: - range * string * TcConfig * TcGlobals * TcImports * Ast.NiceNameGenerator * TcEnv -> TcState + range * string * TcConfig * TcGlobals * TcImports * NiceNameGenerator * TcEnv -> TcState /// Check one input, returned as an Eventually computation val TypeCheckOneInputEventually : diff --git a/src/fsharp/CompileOptions.fs b/src/fsharp/CompileOptions.fs index 3a30ed5007..0c385cc367 100644 --- a/src/fsharp/CompileOptions.fs +++ b/src/fsharp/CompileOptions.fs @@ -1572,17 +1572,17 @@ let ApplyCommandLineArgs(tcConfigB: TcConfigBuilder, sourceFiles: string list, c //---------------------------------------------------------------------------- let showTermFileCount = ref 0 -let PrintWholeAssemblyImplementation (tcConfig:TcConfig) outfile header expr = +let PrintWholeAssemblyImplementation g (tcConfig:TcConfig) outfile header expr = if tcConfig.showTerms then if tcConfig.writeTermsToFiles then let filename = outfile + ".terms" let n = !showTermFileCount showTermFileCount := n+1 use f = System.IO.File.CreateText (filename + "-" + string n + "-" + header) - Layout.outL f (Layout.squashTo 192 (DebugPrint.implFilesL expr)) + Layout.outL f (Layout.squashTo 192 (DebugPrint.implFilesL g expr)) else dprintf "\n------------------\nshowTerm: %s:\n" header - Layout.outL stderr (Layout.squashTo 192 (DebugPrint.implFilesL expr)) + Layout.outL stderr (Layout.squashTo 192 (DebugPrint.implFilesL g expr)) dprintf "\n------------------\n" //---------------------------------------------------------------------------- @@ -1680,13 +1680,13 @@ let ApplyAllOptimizations (tcConfig:TcConfig, tcGlobals, tcVal, outfile, importM // Always optimize once - the results of this step give the x-module optimization // info. Subsequent optimization steps choose representations etc. which we don't // want to save in the x-module info (i.e. x-module info is currently "high level"). - PrintWholeAssemblyImplementation tcConfig outfile "pass-start" implFiles + PrintWholeAssemblyImplementation tcGlobals tcConfig outfile "pass-start" implFiles #if DEBUG if tcConfig.showOptimizationData then - dprintf "Expression prior to optimization:\n%s\n" (Layout.showL (Layout.squashTo 192 (DebugPrint.implFilesL implFiles))) + dprintf "Expression prior to optimization:\n%s\n" (Layout.showL (Layout.squashTo 192 (DebugPrint.implFilesL tcGlobals implFiles))) if tcConfig.showOptimizationData then - dprintf "CCU prior to optimization:\n%s\n" (Layout.showL (Layout.squashTo 192 (DebugPrint.entityL ccu.Contents))) + dprintf "CCU prior to optimization:\n%s\n" (Layout.showL (Layout.squashTo 192 (DebugPrint.entityL tcGlobals ccu.Contents))) #endif let optEnv0 = optEnv @@ -1768,12 +1768,10 @@ let ApplyAllOptimizations (tcConfig:TcConfig, tcGlobals, tcVal, outfile, importM let implFiles, implFileOptDatas = List.unzip results let assemblyOptData = Optimizer.UnionOptimizationInfos implFileOptDatas let tassembly = TypedAssemblyAfterOptimization implFiles - PrintWholeAssemblyImplementation tcConfig outfile "pass-end" (List.map fst implFiles) + PrintWholeAssemblyImplementation tcGlobals tcConfig outfile "pass-end" (List.map fst implFiles) ReportTime tcConfig ("Ending Optimizations") - tassembly, assemblyOptData, optEnvFirstLoop - //---------------------------------------------------------------------------- // ILX generation //---------------------------------------------------------------------------- diff --git a/src/fsharp/CompilerGlobalState.fs b/src/fsharp/CompilerGlobalState.fs new file mode 100644 index 0000000000..1e857e7cad --- /dev/null +++ b/src/fsharp/CompilerGlobalState.fs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +/// Defines the global environment for all type checking. + +namespace FSharp.Compiler + +open System.Collections.Generic +open FSharp.Compiler.AbstractIL +open FSharp.Compiler.Range +open FSharp.Compiler.PrettyNaming + + +/// Generates compiler-generated names. Each name generated also includes the StartLine number of the range passed in +/// at the point of first generation. +/// +/// This type may be accessed concurrently, though in practice it is only used from the compilation thread. +/// It is made concurrency-safe since a global instance of the type is allocated in tast.fs, and it is good +/// policy to make all globally-allocated objects concurrency safe in case future versions of the compiler +/// are used to host multiple concurrent instances of compilation. +type NiceNameGenerator() = + + let lockObj = obj() + let basicNameCounts = new Dictionary(100) + + member x.FreshCompilerGeneratedName (name, m: range) = + lock lockObj (fun () -> + let basicName = GetBasicNameOfPossibleCompilerGeneratedName name + let n = + match basicNameCounts.TryGetValue basicName with + | true, count -> count + | _ -> 0 + let nm = CompilerGeneratedNameSuffix basicName (string m.StartLine + (match n with 0 -> "" | n -> "-" + string n)) + basicNameCounts.[basicName] <- n + 1 + nm) + + member x.Reset () = + lock lockObj (fun () -> + basicNameCounts.Clear() + ) + +/// Generates compiler-generated names marked up with a source code location, but if given the same unique value then +/// return precisely the same name. Each name generated also includes the StartLine number of the range passed in +/// at the point of first generation. +/// +/// This type may be accessed concurrently, though in practice it is only used from the compilation thread. +/// It is made concurrency-safe since a global instance of the type is allocated in tast.fs. +type StableNiceNameGenerator() = + + let lockObj = obj() + + let names = new Dictionary<(string * int64), string>(100) + let basicNameCounts = new Dictionary(100) + + member x.GetUniqueCompilerGeneratedName (name, m: range, uniq) = + lock lockObj (fun () -> + let basicName = GetBasicNameOfPossibleCompilerGeneratedName name + let key = basicName, uniq + match names.TryGetValue key with + | true, nm -> nm + | _ -> + let n = + match basicNameCounts.TryGetValue basicName with + | true, c -> c + | _ -> 0 + let nm = CompilerGeneratedNameSuffix basicName (string m.StartLine + (match n with 0 -> "" | n -> "-" + string n)) + names.[key] <- nm + basicNameCounts.[basicName] <- n + 1 + nm + ) + + member x.Reset () = + lock lockObj (fun () -> + basicNameCounts.Clear() + names.Clear() + ) + +type internal CompilerGlobalState () = + /// A global generator of compiler generated names + // ++GLOBAL MUTABLE STATE (concurrency safe by locking inside NiceNameGenerator) + let globalNng = NiceNameGenerator() + + + /// A global generator of stable compiler generated names + // MUTABLE STATE (concurrency safe by locking inside StableNiceNameGenerator) + let globalStableNameGenerator = StableNiceNameGenerator () + + /// A name generator used by IlxGen for static fields, some generated arguments and other things. + /// REVIEW: this will mean the hosted compiler service is not deterministic. We should at least create a new one + /// of these for each compilation. + let ilxgenGlobalNng = NiceNameGenerator () + + member __.NiceNameGenerator = globalNng + + member __.StableNameGenerator = globalStableNameGenerator + + member __.IlxGenNiceNameGenerator = ilxgenGlobalNng diff --git a/src/fsharp/DetupleArgs.fs b/src/fsharp/DetupleArgs.fs index 9af6d4f32a..8ae41acb31 100644 --- a/src/fsharp/DetupleArgs.fs +++ b/src/fsharp/DetupleArgs.fs @@ -484,8 +484,11 @@ let mkTransform g (f: Val) m tps x1Ntys rty (callPattern, tyfringes: (TType list let tys1r = List.collect fst tyfringes (* types for collapsed initial r args *) let tysrN = List.drop tyfringes.Length x1Ntys (* types for remaining args *) let argtys = tys1r @ tysrN - let fCty = mkLambdaTy tps argtys rty - let transformedVal = mkLocalVal f.Range (globalNng.FreshCompilerGeneratedName (f.LogicalName, f.Range)) fCty topValInfo + let fCty = mkLambdaTy tps argtys rty + let transformedVal = + // Ensure that we have an g.CompilerGlobalState + assert(g.CompilerGlobalState |> Option.isSome) + mkLocalVal f.Range (g.CompilerGlobalState.Value.NiceNameGenerator.FreshCompilerGeneratedName (f.LogicalName, f.Range)) fCty topValInfo { transformCallPattern = callPattern transformedFormals = transformedFormals transformedVal = transformedVal } diff --git a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj index b770a3cb61..578d12460b 100644 --- a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj +++ b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj @@ -366,6 +366,9 @@ TypedAST\QuotationPickler.fs + + TypedAST\CompilerGlobalState.fs + TypedAST\tast.fs diff --git a/src/fsharp/IlxGen.fs b/src/fsharp/IlxGen.fs index 09750c4f32..c188b54807 100644 --- a/src/fsharp/IlxGen.fs +++ b/src/fsharp/IlxGen.fs @@ -101,11 +101,6 @@ let ChooseFreeVarNames takenNames ts = let ts, _names = List.mapFold chooseName names tns ts -/// +++GLOBAL STATE: a name generator used by IlxGen for static fields, some generated arguments and other things. -/// REVIEW: this will mean the hosted compiler service is not deterministic. We should at least create a new one -/// of these for each compilation. -let ilxgenGlobalNng = NiceNameGenerator () - /// We can't tailcall to methods taking byrefs. This helper helps search for them let IsILTypeByref = function ILType.Byref _ -> true | _ -> false @@ -649,11 +644,14 @@ and GenTypePermitVoidAux amap m tyenv ty = GenTypeAux amap m tyenv VoidOK PtrTyp // - For interactive code, we always place fields in their type/module with an accurate name let GenFieldSpecForStaticField (isInteractive, g, ilContainerTy, vspec: Val, nm, m, cloc, ilTy) = if isInteractive || HasFSharpAttribute g g.attrib_LiteralAttribute vspec.Attribs then - let fieldName = vspec.CompiledName + let fieldName = vspec.CompiledName g.CompilerGlobalState let fieldName = if isInteractive then CompilerGeneratedName fieldName else fieldName mkILFieldSpecInTy (ilContainerTy, fieldName, ilTy) else - let fieldName = ilxgenGlobalNng.FreshCompilerGeneratedName (nm, m) + let fieldName = + // Ensure that we have an g.CompilerGlobalState + assert(g.CompilerGlobalState |> Option.isSome) + g.CompilerGlobalState.Value.IlxGenNiceNameGenerator.FreshCompilerGeneratedName (nm, m) let ilFieldContainerTy = mkILTyForCompLoc (CompLocForInitClass cloc) mkILFieldSpecInTy (ilFieldContainerTy, fieldName, ilTy) @@ -884,16 +882,16 @@ let AddStorageForLocalVals g vals eenv = List.foldBack (fun (v, s) acc -> AddSto // Lookup eenv //-------------------------------------------------------------------------- -let StorageForVal m v eenv = +let StorageForVal g m v eenv = let v = try eenv.valsInScope.[v] with :? KeyNotFoundException -> assert false - errorR(Error(FSComp.SR.ilUndefinedValue(showL(valAtBindL v)), m)) + errorR(Error(FSComp.SR.ilUndefinedValue(showL(valAtBindL g v)), m)) notlazy (Arg 668(* random value for post-hoc diagnostic analysis on generated tree *) ) v.Force() -let StorageForValRef m (v: ValRef) eenv = StorageForVal m v.Deref eenv +let StorageForValRef g m (v: ValRef) eenv = StorageForVal g m v.Deref eenv let IsValRefIsDllImport g (vref: ValRef) = vref.Attribs |> HasFSharpAttributeOpt g g.attrib_DllImportAttribute @@ -948,15 +946,15 @@ let GetMethodSpecForMemberVal amap g (memberInfo: ValMemberInfo) (vref: ValRef) let isSlotSig = memberInfo.MemberFlags.IsDispatchSlot || memberInfo.MemberFlags.IsOverrideOrExplicitImpl let ilMethodArgTys = GenParamTypes amap m tyenvUnderTypars isSlotSig methodArgTys let ilMethodInst = GenTypeArgs amap m tyenvUnderTypars (List.map mkTyparTy mtps) - let mspec = mkILInstanceMethSpecInTy (ilTy, vref.CompiledName, ilMethodArgTys, ilActualRetTy, ilMethodInst) - + let mspec = mkILInstanceMethSpecInTy (ilTy, vref.CompiledName g.CompilerGlobalState, ilMethodArgTys, ilActualRetTy, ilMethodInst) + mspec, ctps, mtps, paramInfos, retInfo, methodArgTys else let methodArgTys, paramInfos = List.unzip flatArgInfos let ilMethodArgTys = GenParamTypes amap m tyenvUnderTypars false methodArgTys let ilMethodInst = GenTypeArgs amap m tyenvUnderTypars (List.map mkTyparTy mtps) - let mspec = mkILStaticMethSpecInTy (ilTy, vref.CompiledName, ilMethodArgTys, ilActualRetTy, ilMethodInst) - + let mspec = mkILStaticMethSpecInTy (ilTy, vref.CompiledName g.CompilerGlobalState , ilMethodArgTys, ilActualRetTy, ilMethodInst) + mspec, ctps, mtps, paramInfos, retInfo, methodArgTys /// Determine how a top-level value is represented, when representing as a field, by computing an ILFieldSpec @@ -979,8 +977,8 @@ let ComputeFieldSpecForVal(optIntraAssemblyInfo: IlxGenIntraAssemblyInfo option, /// Compute the representation information for an F#-declared value (not a member nor a function). /// Mutable and literal static fields must have stable names and live in the "public" location -let ComputeStorageForFSharpValue amap g cloc optIntraAssemblyInfo optShadowLocal isInteractive returnTy (vref: ValRef) m = - let nm = vref.CompiledName +let ComputeStorageForFSharpValue amap (g:TcGlobals) cloc optIntraAssemblyInfo optShadowLocal isInteractive returnTy (vref: ValRef) m = + let nm = vref.CompiledName g.CompilerGlobalState let vspec = vref.Deref let ilTy = GenType amap m TypeReprEnv.Empty returnTy (* TypeReprEnv.Empty ok: not a field in a generic class *) let ilTyForProperty = mkILTyForCompLoc cloc @@ -1000,8 +998,8 @@ let ComputeStorageForFSharpMember amap g topValInfo memberInfo (vref: ValRef) m /// Compute the representation information for an F#-declared function in a module or an F#-decalared extension member. /// Note, there is considerable overlap with ComputeStorageForFSharpMember/GetMethodSpecForMemberVal and these could be /// rationalized. -let ComputeStorageForFSharpFunctionOrFSharpExtensionMember amap g cloc topValInfo (vref: ValRef) m = - let nm = vref.CompiledName +let ComputeStorageForFSharpFunctionOrFSharpExtensionMember amap (g:TcGlobals) cloc topValInfo (vref: ValRef) m = + let nm = vref.CompiledName g.CompilerGlobalState let (tps, curriedArgInfos, returnTy, retInfo) = GetTopValTypeInCompiledForm g topValInfo vref.Type m let tyenvUnderTypars = TypeReprEnv.ForTypars tps let (methodArgTys, paramInfos) = curriedArgInfos |> List.concat |> List.unzip @@ -1039,7 +1037,7 @@ let ComputeStorageForTopVal (amap, g, optIntraAssemblyInfo: IlxGenIntraAssemblyI | Some a -> a let m = vref.Range - let nm = vref.CompiledName + let nm = vref.CompiledName g.CompilerGlobalState if vref.Deref.IsCompiledAsStaticPropertyWithoutField then let nm = "get_"+nm @@ -1537,7 +1535,7 @@ type AssemblyBuilder(cenv: cenv, anonTypeTable: AnonTypeGenerationTable) as mgbu member __.AddReflectedDefinition (vspec: Tast.Val, expr) = // preserve order by storing index of item let n = reflectedDefinitions.Count - reflectedDefinitions.Add(vspec, (vspec.CompiledName, n, expr)) + reflectedDefinitions.Add(vspec, (vspec.CompiledName cenv.g.CompilerGlobalState, n, expr)) member __.ReplaceNameOfReflectedDefinition (vspec, newName) = match reflectedDefinitions.TryGetValue vspec with @@ -2188,7 +2186,7 @@ let rec GenExpr (cenv: cenv) (cgbuf: CodeGenBuffer) eenv sp expr sequel = List.forall (isMeasureTy g) tyargs && ( // inline only values that are stored in local variables - match StorageForValRef m vref eenv with + match StorageForValRef g m vref eenv with | ValStorage.Local _ -> true | _ -> false ) -> @@ -2948,7 +2946,7 @@ and GenApp cenv cgbuf eenv (f, fty, tyargs, args, m) sequel = // where f is an F# function value or F# method | Expr.Lambda (_, _, _, _, Expr.App (OptionalCoerce(OptionalTyapp(Expr.Val (vref, _, _))), _, _, _, _), _, _) -> - let storage = StorageForValRef m vref eenv + let storage = StorageForValRef g m vref eenv match storage with | Method (_, _, mspec, _, _, _, _) -> CG.EmitInstr cgbuf (pop 0) (Push [g.iltyp_RuntimeMethodHandle]) (I_ldtoken (ILToken.ILMethod mspec)) @@ -2975,7 +2973,7 @@ and GenApp cenv cgbuf eenv (f, fty, tyargs, args, m) sequel = // Optimize calls to top methods when given "enough" arguments. | Expr.Val (vref, valUseFlags, _), _, _ when - (let storage = StorageForValRef m vref eenv + (let storage = StorageForValRef g m vref eenv match storage with | Method (topValInfo, vref, _, _, _, _, _) -> (let tps, argtys, _, _ = GetTopValTypeInFSharpForm g topValInfo vref.Type m @@ -2983,7 +2981,7 @@ and GenApp cenv cgbuf eenv (f, fty, tyargs, args, m) sequel = argtys.Length <= args.Length) | _ -> false) -> - let storage = StorageForValRef m vref eenv + let storage = StorageForValRef g m vref eenv match storage with | Method (topValInfo, vref, mspec, _, _, _, _) -> let nowArgs, laterArgs = @@ -3059,7 +3057,10 @@ and GenApp cenv cgbuf eenv (f, fty, tyargs, args, m) sequel = // Only save arguments that have effects if Optimizer.ExprHasEffect g laterArg then let ilTy = laterArg |> tyOfExpr g |> GenType cenv.amap m eenv.tyenv - let locName = ilxgenGlobalNng.FreshCompilerGeneratedName ("arg", m), ilTy, false + let locName = + // Ensure that we have an g.CompilerGlobalState + assert(g.CompilerGlobalState |> Option.isSome) + g.CompilerGlobalState.Value.IlxGenNiceNameGenerator.FreshCompilerGeneratedName ("arg", m), ilTy, false let loc, _realloc, eenv = AllocLocal cenv cgbuf eenv true locName scopeMarks GenExpr cenv cgbuf eenv SPSuppress laterArg Continue EmitSetLocal cgbuf loc @@ -3222,7 +3223,9 @@ and GenTry cenv cgbuf eenv scopeMarks (e1, m, resty, spTry) = let ilResultTy = GenType cenv.amap m eenvinner.tyenv resty let whereToSave, _realloc, eenvinner = - AllocLocal cenv cgbuf eenvinner true (ilxgenGlobalNng.FreshCompilerGeneratedName ("tryres", m), ilResultTy, false) (startTryMark, endTryMark) + // Ensure that we have an g.CompilerGlobalState + assert(cenv.g.CompilerGlobalState |> Option.isSome) + AllocLocal cenv cgbuf eenvinner true (cenv.g.CompilerGlobalState.Value.IlxGenNiceNameGenerator.FreshCompilerGeneratedName ("tryres", m), ilResultTy, false) (startTryMark, endTryMark) // Generate the body of the try. In the normal case (SequencePointAtTry) we generate a sequence point // both on the 'try' keyword and on the start of the expression in the 'try'. For inlined code and @@ -3267,7 +3270,7 @@ and GenTryCatch cenv cgbuf eenv (e1, vf: Val, ef, vh: Val, eh, m, resty, spTry, let _, eenvinner = AllocLocalVal cenv cgbuf vf eenvinner None (startOfFilter, afterFilter) CG.EmitInstr cgbuf (pop 1) (Push [g.iltyp_Exception]) (I_castclass g.iltyp_Exception) - GenStoreVal cgbuf eenvinner vf.Range vf + GenStoreVal cenv cgbuf eenvinner vf.Range vf // Why SPSuppress? Because we do not emit a sequence point at the start of the List.filter - we've already put one on // the 'with' keyword above @@ -3285,7 +3288,7 @@ and GenTryCatch cenv cgbuf eenv (e1, vf: Val, ef, vh: Val, eh, m, resty, spTry, CG.SetStack cgbuf [g.ilg.typ_Object] let _, eenvinner = AllocLocalVal cenv cgbuf vh eenvinner None (startOfHandler, afterHandler) CG.EmitInstr cgbuf (pop 1) (Push [g.iltyp_Exception]) (I_castclass g.iltyp_Exception) - GenStoreVal cgbuf eenvinner vh.Range vh + GenStoreVal cenv cgbuf eenvinner vh.Range vh GenExpr cenv cgbuf eenvinner SPAlways eh (LeaveHandler (false, whereToSave, afterHandler)) end @@ -3303,7 +3306,7 @@ and GenTryCatch cenv cgbuf eenv (e1, vf: Val, ef, vh: Val, eh, m, resty, spTry, let _, eenvinner = AllocLocalVal cenv cgbuf vh eenvinner None (startOfHandler, afterHandler) CG.EmitInstr cgbuf (pop 1) (Push [g.iltyp_Exception]) (I_castclass g.iltyp_Exception) - GenStoreVal cgbuf eenvinner m vh + GenStoreVal cenv cgbuf eenvinner m vh GenExpr cenv cgbuf eenvinner SPAlways eh (LeaveHandler (false, whereToSave, afterHandler)) end @@ -3386,7 +3389,9 @@ and GenForLoop cenv cgbuf eenv (spFor, v, e1, dir, e2, loopBody, m) sequel = let finishIdx, eenvinner = if isFSharpStyle then - let v, _realloc, eenvinner = AllocLocal cenv cgbuf eenvinner true (ilxgenGlobalNng.FreshCompilerGeneratedName ("endLoop", m), g.ilg.typ_Int32, false) (start, finish) + // Ensure that we have an g.CompilerGlobalState + assert(g.CompilerGlobalState |> Option.isSome) + let v, _realloc, eenvinner = AllocLocal cenv cgbuf eenvinner true (g.CompilerGlobalState.Value.IlxGenNiceNameGenerator.FreshCompilerGeneratedName ("endLoop", m), g.ilg.typ_Int32, false) (start, finish) v, eenvinner else -1, eenvinner @@ -3397,7 +3402,7 @@ and GenForLoop cenv cgbuf eenv (spFor, v, e1, dir, e2, loopBody, m) sequel = | NoSequencePointAtForLoop -> () GenExpr cenv cgbuf eenv SPSuppress e1 Continue - GenStoreVal cgbuf eenvinner m v + GenStoreVal cenv cgbuf eenvinner m v if isFSharpStyle then GenExpr cenv cgbuf eenvinner SPSuppress e2 Continue EmitSetLocal cgbuf finishIdx @@ -3417,7 +3422,7 @@ and GenForLoop cenv cgbuf eenv (spFor, v, e1, dir, e2, loopBody, m) sequel = CG.EmitInstr cgbuf (pop 0) (Push [g.ilg.typ_Int32]) (mkLdcInt32 1) CG.EmitInstr cgbuf (pop 1) Push0 (if isUp then AI_add else AI_sub) - GenStoreVal cgbuf eenvinner m v + GenStoreVal cenv cgbuf eenvinner m v // .text CG.SetMarkToHere cgbuf test @@ -3780,7 +3785,7 @@ and GenGetAddrOfRefCellField cenv cgbuf eenv (e, ty, m) sequel = and GenGetValAddr cenv cgbuf eenv (v: ValRef, m) sequel = let vspec = v.Deref let ilTy = GenTypeOfVal cenv eenv vspec - let storage = StorageForValRef m v eenv + let storage = StorageForValRef cenv.g m v eenv match storage with | Local (idx, _, None) -> @@ -3842,7 +3847,10 @@ and GenDefaultValue cenv cgbuf eenv (ty, m) = | _ -> let ilTy = GenType cenv.amap m eenv.tyenv ty LocalScope "ilzero" cgbuf (fun scopeMarks -> - let locIdx, realloc, _ = AllocLocal cenv cgbuf eenv true (ilxgenGlobalNng.FreshCompilerGeneratedName ("default", m), ilTy, false) scopeMarks + let locIdx, realloc, _ = + // Ensure that we have an g.CompilerGlobalState + assert(g.CompilerGlobalState |> Option.isSome) + AllocLocal cenv cgbuf eenv true (g.CompilerGlobalState.Value.IlxGenNiceNameGenerator.FreshCompilerGeneratedName ("default", m), ilTy, false) scopeMarks // "initobj" (Generated by EmitInitLocal) doesn't work on byref types // But ilzero(&ty) only gets generated in the built-in get-address function so // we can just rely on zeroinit of all IL locals. @@ -4316,7 +4324,7 @@ and GenTypeOfVal cenv eenv (v: Val) = and GenFreevar cenv m eenvouter tyenvinner (fv: Val) = let g = cenv.g - match StorageForVal m fv eenvouter with + match StorageForVal cenv.g m fv eenvouter with // Local type functions | Local(_, _, Some _) | Env(_, _, _, Some _) -> g.ilg.typ_Object #if DEBUG @@ -4332,7 +4340,7 @@ and GetIlxClosureFreeVars cenv m selfv eenvouter takenNames expr = let basename = let boundv = eenvouter.letBoundVars |> List.tryFind (fun v -> not v.IsCompilerGenerated) match boundv with - | Some v -> v.CompiledName + | Some v -> v.CompiledName cenv.g.CompilerGlobalState | None -> "clo" // Get a unique stamp for the closure. This must be stable for things that can be part of a let rec. @@ -4348,7 +4356,10 @@ and GetIlxClosureFreeVars cenv m selfv eenvouter takenNames expr = // FSharp 1.0 bug 3404: System.Reflection doesn't like '.' and '`' in type names let basenameSafeForUseAsTypename = CleanUpGeneratedTypeName basename let suffixmark = expr.Range - let cloName = globalStableNameGenerator.GetUniqueCompilerGeneratedName(basenameSafeForUseAsTypename, suffixmark, uniq) + let cloName = + // Ensure that we have an g.CompilerGlobalState + assert(g.CompilerGlobalState |> Option.isSome) + g.CompilerGlobalState.Value.StableNameGenerator.GetUniqueCompilerGeneratedName(basenameSafeForUseAsTypename, suffixmark, uniq) NestedTypeRefForCompLoc eenvouter.cloc cloName // Collect the free variables of the closure @@ -4361,7 +4372,7 @@ and GetIlxClosureFreeVars cenv m selfv eenvouter takenNames expr = cloFreeVarResults.FreeLocals |> Zset.elements |> List.filter (fun fv -> - match StorageForVal m fv eenvouter with + match StorageForVal cenv.g m fv eenvouter with | (StaticField _ | StaticProperty _ | Method _ | Null) -> false | _ -> match selfv with @@ -4406,7 +4417,7 @@ and GetIlxClosureFreeVars cenv m selfv eenvouter takenNames expr = let ilCloFreeVarStorage = (cloFreeVars, ilCloFreeVars) ||> List.mapi2 (fun i v fv -> let localCloInfo = - match StorageForVal m v eenvouter with + match StorageForVal g m v eenvouter with | Local(_, _, localCloInfo) | Env(_, _, _, localCloInfo) -> localCloInfo | _ -> None @@ -4444,7 +4455,7 @@ and GetIlxClosureInfo cenv m isLocalTypeFunc selfv eenvouter expr = (List.rev tvacc, List.rev vacc, e, ety) getCallStructure [] [] (expr, returnTy) - let takenNames = vs |> List.map (fun v -> v.CompiledName) + let takenNames = vs |> List.map (fun v -> v.CompiledName g.CompilerGlobalState) // Get the free variables and the information about the closure, add the free variables to the environment let (cloAttribs, cloInternalFreeTyvars, cloContractFreeTyvars, _, cloFreeVars, ilCloTypeRef, ilCloFreeVars, eenvinner) = GetIlxClosureFreeVars cenv m selfv eenvouter takenNames expr @@ -4458,7 +4469,7 @@ and GetIlxClosureInfo cenv m isLocalTypeFunc selfv eenvouter expr = let lambdas = (tvs, l) ||> List.foldBack (fun tv sofar -> Lambdas_forall(GenGenericParam cenv eenv tv, sofar)) lambdas, eenv | [], v :: rest -> - let nm = v.CompiledName + let nm = v.CompiledName g.CompilerGlobalState let l, eenv = let eenv = AddStorageForVal g (v, notlazy (Arg ntmargs)) eenv getClosureArgs eenv (ntmargs+1) [] rest @@ -4817,7 +4828,7 @@ and GenDecisionTreeSuccess cenv cgbuf inplabOpt stackAtTargets eenv es targetIdx // However not all targets are currently postponed (we only postpone in debug code), pending further testing of the performance // impact of postponing. (vs, es) ||> List.iter2 (GenBindingRhs cenv cgbuf eenv SPSuppress) - vs |> List.rev |> List.iter (fun v -> GenStoreVal cgbuf eenvAtTarget v.Range v) + vs |> List.rev |> List.iter (fun v -> GenStoreVal cenv cgbuf eenvAtTarget v.Range v) CG.EmitInstr cgbuf (pop 0) Push0 (I_br targetMarkAfterBinds.CodeLabel) targetInfos @@ -5075,7 +5086,7 @@ and GenLetRecBindings cenv (cgbuf: CodeGenBuffer) eenv (allBinds: Bindings, m) = // Fix up recursion for non-toplevel recursive bindings let bindsPossiblyRequiringFixup = allBinds |> List.filter (fun b -> - match (StorageForVal m b.Var eenv) with + match (StorageForVal cenv.g m b.Var eenv) with | StaticProperty _ | Method _ // Note: Recursive data stored in static fields may require fixups e.g. let x = C(x) @@ -5091,7 +5102,7 @@ and GenLetRecBindings cenv (cgbuf: CodeGenBuffer) eenv (allBinds: Bindings, m) = let clo, _, eenvclo = GetIlxClosureInfo cenv m isLocalTypeFunc selfv {eenv with letBoundVars=(mkLocalValRef boundv) :: eenv.letBoundVars} e clo.cloFreeVars |> List.iter (fun fv -> if Zset.contains fv forwardReferenceSet then - match StorageForVal m fv eenvclo with + match StorageForVal cenv.g m fv eenvclo with | Env (_, _, ilField, _) -> fixups := (boundv, fv, (fun () -> GenLetRecFixup cenv cgbuf eenv (clo.cloSpec, access, ilField, exprForVal m fv, m))) :: !fixups | _ -> error (InternalError("GenLetRec: " + fv.LogicalName + " was not in the environment", m)) ) @@ -5175,14 +5186,14 @@ and GenBindingAfterSequencePoint cenv cgbuf eenv sp (TBind(vspec, rhsExpr, _)) s // Workaround for .NET and Visual Studio restriction w.r.t debugger type proxys // Mark internal constructors in internal classes as public. let access = - if access = ILMemberAccess.Assembly && vspec.IsConstructor && IsHiddenTycon eenv.sigToImplRemapInfo vspec.MemberApparentEntity.Deref then + if access = ILMemberAccess.Assembly && vspec.IsConstructor && IsHiddenTycon g eenv.sigToImplRemapInfo vspec.MemberApparentEntity.Deref then ILMemberAccess.Public else access let m = vspec.Range - match StorageForVal m vspec eenv with + match StorageForVal cenv.g m vspec eenv with | Null -> GenExpr cenv cgbuf eenv SPSuppress rhsExpr discard @@ -5311,7 +5322,7 @@ and GenBindingAfterSequencePoint cenv cgbuf eenv sp (TBind(vspec, rhsExpr, _)) s GenSetStorage m cgbuf storage | _ -> - let storage = StorageForVal m vspec eenv + let storage = StorageForVal cenv.g m vspec eenv match storage, rhsExpr with // locals are zero-init, no need to initialize them | Local (_, realloc, _), Expr.Const (Const.Zero, _, _) when not realloc -> @@ -5319,7 +5330,7 @@ and GenBindingAfterSequencePoint cenv cgbuf eenv sp (TBind(vspec, rhsExpr, _)) s | _ -> GenBindingRhs cenv cgbuf eenv SPSuppress vspec rhsExpr CommitStartScope cgbuf startScopeMarkOpt - GenStoreVal cgbuf eenv vspec.Range vspec + GenStoreVal cenv cgbuf eenv vspec.Range vspec //------------------------------------------------------------------------- // Generate method bindings @@ -5492,7 +5503,7 @@ and GenParams cenv eenv (mspec: ILMethodSpec) (attribs: ArgReprInfo list) method (Set.empty, List.zip methodArgTys argInfosAndTypes) ||> List.mapFold (fun takenNames (methodArgTy, ((ilArgTy, topArgInfo), implValOpt)) -> let inFlag, outFlag, optionalFlag, defaultParamValue, Marshal, attribs = GenParamAttribs cenv methodArgTy topArgInfo.Attribs - + let idOpt = (match topArgInfo.Name with | Some v -> Some v | None -> match implValOpt with @@ -5502,14 +5513,19 @@ and GenParams cenv eenv (mspec: ILMethodSpec) (attribs: ArgReprInfo list) method let nmOpt, takenNames = match idOpt with | Some id -> - let nm = if takenNames.Contains(id.idText) then globalNng.FreshCompilerGeneratedName (id.idText, id.idRange) else id.idText + let nm = + if takenNames.Contains(id.idText) then + // Ensure that we have an g.CompilerGlobalState + assert(g.CompilerGlobalState |> Option.isSome) + g.CompilerGlobalState.Value.NiceNameGenerator.FreshCompilerGeneratedName (id.idText, id.idRange) + else + id.idText Some nm, takenNames.Add nm | None -> None, takenNames - let ilAttribs = GenAttrs cenv eenv attribs - + let ilAttribs = match GenReadOnlyAttributeIfNecessary g methodArgTy with | Some attr -> ilAttribs @ [attr] @@ -5681,7 +5697,7 @@ and GenMethodForBinding match TryFindFSharpAttributeOpt g g.attrib_DllImportAttribute v.Attribs with | Some (Attrib(_, _, [ AttribStringArg dll ], namedArgs, _, _, m)) -> if not (isNil tps) then error(Error(FSComp.SR.ilSignatureForExternalFunctionContainsTypeParameters(), m)) - let hasPreserveSigNamedArg, mbody = GenPInvokeMethod (v.CompiledName, dll, namedArgs) + let hasPreserveSigNamedArg, mbody = GenPInvokeMethod (v.CompiledName g.CompilerGlobalState, dll, namedArgs) hasPreserveSigNamedArg, mbody, true | Some (Attrib(_, _, _, _, _, _, m)) -> @@ -5692,7 +5708,7 @@ and GenMethodForBinding // However still generate the code for reflection etc. let bodyExpr = if HasFSharpAttribute g g.attrib_NoDynamicInvocationAttribute v.Attribs then - let exnArg = mkString g m (FSComp.SR.ilDynamicInvocationNotSupported(v.CompiledName)) + let exnArg = mkString g m (FSComp.SR.ilDynamicInvocationNotSupported(v.CompiledName g.CompilerGlobalState)) let exnExpr = MakeNotSupportedExnExpr cenv eenv (exnArg, m) mkThrow m returnTy exnExpr else @@ -5791,20 +5807,20 @@ and GenMethodForBinding else let mdef = if not compileAsInstance then - mkILStaticMethod (ilMethTypars, v.CompiledName, access, ilParams, ilReturn, ilMethodBody) + mkILStaticMethod (ilMethTypars, v.CompiledName g.CompilerGlobalState, access, ilParams, ilReturn, ilMethodBody) elif (memberInfo.MemberFlags.IsDispatchSlot && memberInfo.IsImplemented) || memberInfo.MemberFlags.IsOverrideOrExplicitImpl then let flagFixups = ComputeFlagFixupsForMemberBinding cenv (v, memberInfo) - let mdef = mkILGenericVirtualMethod (v.CompiledName, ILMemberAccess.Public, ilMethTypars, ilParams, ilReturn, ilMethodBody) + let mdef = mkILGenericVirtualMethod (v.CompiledName g.CompilerGlobalState, ILMemberAccess.Public, ilMethTypars, ilParams, ilReturn, ilMethodBody) let mdef = List.fold (fun mdef f -> f mdef) mdef flagFixups // fixup can potentially change name of reflected definition that was already recorded - patch it if necessary cgbuf.mgbuf.ReplaceNameOfReflectedDefinition(v, mdef.Name) mdef else - mkILGenericNonVirtualMethod (v.CompiledName, access, ilMethTypars, ilParams, ilReturn, ilMethodBody) + mkILGenericNonVirtualMethod (v.CompiledName g.CompilerGlobalState, access, ilMethTypars, ilParams, ilReturn, ilMethodBody) let isAbstract = memberInfo.MemberFlags.IsDispatchSlot && @@ -5898,7 +5914,7 @@ and GenBindings cenv cgbuf eenv binds = List.iter (GenBinding cenv cgbuf eenv) b //------------------------------------------------------------------------- and GenSetVal cenv cgbuf eenv (vref, e, m) sequel = - let storage = StorageForValRef m vref eenv + let storage = StorageForValRef cenv.g m vref eenv match storage with | Env (ilCloTy, _, _, _) -> CG.EmitInstr cgbuf (pop 0) (Push [ilCloTy]) mkLdarg0 @@ -5910,7 +5926,7 @@ and GenSetVal cenv cgbuf eenv (vref, e, m) sequel = and GenGetValRefAndSequel cenv cgbuf eenv m (v: ValRef) fetchSequel = let ty = v.Type - GenGetStorageAndSequel cenv cgbuf eenv m (ty, GenType cenv.amap m eenv.tyenv ty) (StorageForValRef m v eenv) fetchSequel + GenGetStorageAndSequel cenv cgbuf eenv m (ty, GenType cenv.amap m eenv.tyenv ty) (StorageForValRef cenv.g m v eenv) fetchSequel and GenGetVal cenv cgbuf eenv (v: ValRef, m) sequel = GenGetValRefAndSequel cenv cgbuf eenv m v None @@ -5926,7 +5942,7 @@ and GenBindingRhs cenv cgbuf eenv sp (vspec: Val) e = | Expr.TyLambda (_, tyargs, body, _, ttype) when ( tyargs |> List.forall (fun tp -> tp.IsErased) && - (match StorageForVal vspec.Range vspec eenv with Local _ -> true | _ -> false) && + (match StorageForVal g vspec.Range vspec eenv with Local _ -> true | _ -> false) && (isLocalTypeFunc || (match ttype with TType_var typar -> match typar.Solution with Some(TType_app(t, _))-> t.IsStructOrEnumTycon | _ -> false @@ -6050,13 +6066,13 @@ and GenGetLocalVals cenv cgbuf eenvouter m fvs = List.iter (fun v -> GenGetLocalVal cenv cgbuf eenvouter m v None) fvs and GenGetLocalVal cenv cgbuf eenv m (vspec: Val) fetchSequel = - GenGetStorageAndSequel cenv cgbuf eenv m (vspec.Type, GenTypeOfVal cenv eenv vspec) (StorageForVal m vspec eenv) fetchSequel + GenGetStorageAndSequel cenv cgbuf eenv m (vspec.Type, GenTypeOfVal cenv eenv vspec) (StorageForVal cenv.g m vspec eenv) fetchSequel and GenGetLocalVRef cenv cgbuf eenv m (vref: ValRef) fetchSequel = - GenGetStorageAndSequel cenv cgbuf eenv m (vref.Type, GenTypeOfVal cenv eenv vref.Deref) (StorageForValRef m vref eenv) fetchSequel + GenGetStorageAndSequel cenv cgbuf eenv m (vref.Type, GenTypeOfVal cenv eenv vref.Deref) (StorageForValRef cenv.g m vref eenv) fetchSequel -and GenStoreVal cgbuf eenv m (vspec: Val) = - GenSetStorage vspec.Range cgbuf (StorageForVal m vspec eenv) +and GenStoreVal cenv cgbuf eenv m (vspec: Val) = + GenSetStorage vspec.Range cgbuf (StorageForVal cenv.g m vspec eenv) /// Allocate IL locals and AllocLocal cenv cgbuf eenv compgen (v, ty, isFixed) (scopeMarks: Mark * Mark) = @@ -6087,11 +6103,11 @@ and AllocLocalVal cenv cgbuf v eenv repr scopeMarks = let cloinfo, _, _ = GetIlxClosureInfo cenv v.Range true None eenvinner (Option.get repr) cloinfo - let idx, realloc, eenv = AllocLocal cenv cgbuf eenv v.IsCompilerGenerated (v.CompiledName, g.ilg.typ_Object, false) scopeMarks + let idx, realloc, eenv = AllocLocal cenv cgbuf eenv v.IsCompilerGenerated (v.CompiledName g.CompilerGlobalState, g.ilg.typ_Object, false) scopeMarks Local (idx, realloc, Some(ref (NamedLocalIlxClosureInfoGenerator cloinfoGenerate))), eenv | _ -> // normal local - let idx, realloc, eenv = AllocLocal cenv cgbuf eenv v.IsCompilerGenerated (v.CompiledName, GenTypeOfVal cenv eenv v, v.IsFixed) scopeMarks + let idx, realloc, eenv = AllocLocal cenv cgbuf eenv v.IsCompilerGenerated (v.CompiledName g.CompilerGlobalState, GenTypeOfVal cenv eenv v, v.IsFixed) scopeMarks Local (idx, realloc, None), eenv let eenv = AddStorageForVal g (v, notlazy repr) eenv Some repr, eenv @@ -6144,7 +6160,6 @@ and AllocTopValWithinExpr cenv cgbuf cloc scopeMarks v eenv = match storageOpt with | None -> NoShadowLocal, eenv | Some storage -> ShadowLocal storage, eenv - else NoShadowLocal, eenv @@ -6161,7 +6176,10 @@ and EmitSaveStack cenv cgbuf eenv m scopeMarks = let savedStack = (cgbuf.GetCurrentStack()) let savedStackLocals, eenvinner = (eenv, savedStack) ||> List.mapFold (fun eenv ty -> - let idx, _realloc, eenv = AllocLocal cenv cgbuf eenv true (ilxgenGlobalNng.FreshCompilerGeneratedName ("spill", m), ty, false) scopeMarks + let idx, _realloc, eenv = + // Ensure that we have an g.CompilerGlobalState + assert(cenv.g.CompilerGlobalState |> Option.isSome) + AllocLocal cenv cgbuf eenv true (cenv.g.CompilerGlobalState.Value.IlxGenNiceNameGenerator.FreshCompilerGeneratedName ("spill", m), ty, false) scopeMarks idx, eenv) List.iter (EmitSetLocal cgbuf) savedStackLocals cgbuf.AssertEmptyStack() @@ -6177,9 +6195,9 @@ and EmitRestoreStack cgbuf (savedStack, savedStackLocals) = //------------------------------------------------------------------------- and GenAttribArg amap g eenv x (ilArgTy: ILType) = + let exprL expr = exprL g expr match x, ilArgTy with - // Detect 'null' used for an array argument | Expr.Const (Const.Zero, _, _), ILType.Array _ -> ILAttribElem.Null @@ -6377,7 +6395,7 @@ and GenModuleBinding cenv (cgbuf: CodeGenBuffer) (qname: QualifiedNameOfFile) la GenLetRecBindings cenv cgbuf eenv ([bind], m) | ModuleOrNamespaceBinding.Module (mspec, mdef) -> - let hidden = IsHiddenTycon eenv.sigToImplRemapInfo mspec + let hidden = IsHiddenTycon cenv.g eenv.sigToImplRemapInfo mspec let eenvinner = if mspec.IsNamespace then eenv else @@ -6616,7 +6634,7 @@ and GenAbstractBinding cenv eenv tref (vref: ValRef) = let ilParams = GenParams cenv eenvForMeth mspec argInfos methodArgTys None let compileAsInstance = ValRefIsCompiledAsInstanceMember g vref - let mdef = mkILGenericVirtualMethod (vref.CompiledName, ILMemberAccess.Public, ilMethTypars, ilParams, ilReturn, MethodBody.Abstract) + let mdef = mkILGenericVirtualMethod (vref.CompiledName g.CompilerGlobalState, ILMemberAccess.Public, ilMethTypars, ilParams, ilReturn, MethodBody.Abstract) let mdef = fixupVirtualSlotFlags mdef let mdef = @@ -6716,8 +6734,8 @@ and GenTypeDef cenv mgbuf lazyInitInfo eenv m (tycon: Tycon) = let ilIntfTys = tycon.ImmediateInterfaceTypesOfFSharpTycon |> List.map (GenType cenv.amap m eenvinner.tyenv) let ilTypeName = tref.Name - let hidden = IsHiddenTycon eenv.sigToImplRemapInfo tycon - let hiddenRepr = hidden || IsHiddenTyconRepr eenv.sigToImplRemapInfo tycon + let hidden = IsHiddenTycon g eenv.sigToImplRemapInfo tycon + let hiddenRepr = hidden || IsHiddenTyconRepr g eenv.sigToImplRemapInfo tycon let access = ComputeTypeAccess tref hidden // The implicit augmentation doesn't actually create CompareTo(object) or Object.Equals @@ -7300,7 +7318,7 @@ and GenExnDef cenv mgbuf eenv m (exnc: Tycon) = | TExnFresh _ -> let ilThisTy = GenExnType cenv.amap m eenv.tyenv exncref let tref = ilThisTy.TypeRef - let isHidden = IsHiddenTycon eenv.sigToImplRemapInfo exnc + let isHidden = IsHiddenTycon g eenv.sigToImplRemapInfo exnc let access = ComputeTypeAccess tref isHidden let reprAccess = ComputeMemberAccess isHidden let fspecs = exnc.TrueInstanceFieldsAsList @@ -7563,7 +7581,7 @@ let LookupGeneratedValue (amap: ImportMap) (ctxt: ExecutionContext) eenv (v: Val let ilTy = GenType amap v.Range TypeReprEnv.Empty v.Type (* TypeReprEnv.Empty ok, not expecting typars *) ctxt.LookupType ilTy // Lookup the compiled v value (as an object). - match StorageForVal v.Range v eenv with + match StorageForVal amap.g v.Range v eenv with | StaticField (fspec, _, hasLiteralAttr, ilContainerTy, _, _, ilGetterMethRef, _, _) -> let obj = if hasLiteralAttr then @@ -7603,9 +7621,9 @@ let LookupGeneratedValue (amap: ImportMap) (ctxt: ExecutionContext) eenv (v: Val None // Invoke the set_Foo method for a declaration with a default/null value. Used to release storage in fsi.exe -let ClearGeneratedValue (ctxt: ExecutionContext) (_g: TcGlobals) eenv (v: Val) = +let ClearGeneratedValue (ctxt: ExecutionContext) (g: TcGlobals) eenv (v: Val) = try - match StorageForVal v.Range v eenv with + match StorageForVal g v.Range v eenv with | StaticField (fspec, _, hasLiteralAttr, _, _, _, _ilGetterMethRef, ilSetterMethRef, _) -> if not hasLiteralAttr && v.IsMutable then let staticTy = ctxt.LookupTypeRef ilSetterMethRef.DeclaringTypeRef diff --git a/src/fsharp/InnerLambdasToTopLevelFuncs.fs b/src/fsharp/InnerLambdasToTopLevelFuncs.fs index 1ff7ed3c7c..fabd5583c2 100644 --- a/src/fsharp/InnerLambdasToTopLevelFuncs.fs +++ b/src/fsharp/InnerLambdasToTopLevelFuncs.fs @@ -771,6 +771,8 @@ let FlatEnvPacks g fclassM topValS declist (reqdItemsMap: Zmap Option.isSome) + g.CompilerGlobalState.Value.NiceNameGenerator.FreshCompilerGeneratedName(name, m) let fHat = mkLocalNameTypeArity f.IsCompilerGenerated m fHatName fHatTy (Some fHatArity) fHat diff --git a/src/fsharp/MethodCalls.fs b/src/fsharp/MethodCalls.fs index 912a403528..5a8d66c875 100644 --- a/src/fsharp/MethodCalls.fs +++ b/src/fsharp/MethodCalls.fs @@ -654,7 +654,8 @@ let BuildObjCtorCall (g: TcGlobals) m = let BuildFSharpMethodApp g m (vref: ValRef) vexp vexprty (args: Exprs) = let arities = (arityOfVal vref.Deref).AritiesOfArgs - let args3, (leftover, retTy) = + let args3, (leftover, retTy) = + let exprL expr = exprL g expr ((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) @@ -728,7 +729,7 @@ let TryImportProvidedMethodBaseAsLibraryIntrinsic (amap: Import.ImportMap, m: ra match amap.g.knownFSharpCoreModules.TryGetValue declaringEntity.LogicalName with | true, modRef -> modRef.ModuleOrNamespaceType.AllValsByLogicalName - |> Seq.tryPick (fun (KeyValue(_, v)) -> if v.CompiledName = methodName then Some (mkNestedValRef modRef v) else None) + |> Seq.tryPick (fun (KeyValue(_, v)) -> if (v.CompiledName amap.g.CompilerGlobalState) = methodName then Some (mkNestedValRef modRef v) else None) | _ -> None else None diff --git a/src/fsharp/Optimizer.fs b/src/fsharp/Optimizer.fs index 2eea2ef8db..ecc24b9131 100644 --- a/src/fsharp/Optimizer.fs +++ b/src/fsharp/Optimizer.fs @@ -172,7 +172,8 @@ let braceL x = leftL (tagText "{") ^^ x ^^ rightL (tagText "}") let seqL xL xs = Seq.fold (fun z x -> z @@ xL x) emptyL xs let namemapL xL xmap = NameMap.foldBack (fun nm x z -> xL nm x @@ z) xmap emptyL -let rec exprValueInfoL g exprVal = +let rec exprValueInfoL g exprVal = + let exprL expr = exprL g expr match exprVal with | ConstValue (x, ty) -> NicePrint.layoutConst g ty x | UnknownValue -> wordL (tagText "?") diff --git a/src/fsharp/PatternMatchCompilation.fs b/src/fsharp/PatternMatchCompilation.fs index 41135afed5..03718e8fe5 100644 --- a/src/fsharp/PatternMatchCompilation.fs +++ b/src/fsharp/PatternMatchCompilation.fs @@ -348,6 +348,7 @@ let rec CombineRefutations g r1 r2 = let ShowCounterExample g denv m refuted = try + let exprL expr = exprL g expr let refutations = refuted |> List.collect (function RefutedWhenClause -> [] | (RefutedInvestigation(path, discrim)) -> [RefuteDiscrimSet g m path discrim]) let counterExample, enumCoversKnown = match refutations with diff --git a/src/fsharp/PostInferenceChecks.fs b/src/fsharp/PostInferenceChecks.fs index ddbad8f09e..b6a286c5d7 100644 --- a/src/fsharp/PostInferenceChecks.fs +++ b/src/fsharp/PostInferenceChecks.fs @@ -1733,7 +1733,7 @@ and CheckBinding cenv env alwaysCheckNoReraise context (TBind(v, bindRhs, _) as let _, _, argExprs = qscope.Close() if not (isNil argExprs) then errorR(Error(FSComp.SR.chkReflectedDefCantSplice(), v.Range)) - QuotationTranslator.ConvMethodBase qscope env (v.CompiledName, v) |> ignore + QuotationTranslator.ConvMethodBase qscope env (v.CompiledName g.CompilerGlobalState, v) |> ignore with | QuotationTranslator.InvalidQuotedTerm e -> errorR e @@ -1855,12 +1855,12 @@ let CheckModuleBinding cenv env (TBind(v, e, _) as bind) = check false v.CoreDisplayName check false v.DisplayName - check false v.CompiledName + check false (v.CompiledName cenv.g.CompilerGlobalState) // Check if an F# extension member clashes if v.IsExtensionMember then tcref.ModuleOrNamespaceType.AllValsAndMembersByLogicalNameUncached.[v.LogicalName] |> List.iter (fun v2 -> - if v2.IsExtensionMember && not (valEq v v2) && v.CompiledName = v2.CompiledName then + if v2.IsExtensionMember && not (valEq v v2) && (v.CompiledName cenv.g.CompilerGlobalState) = (v2.CompiledName cenv.g.CompilerGlobalState) then let minfo1 = FSMeth(g, generalizedTyconRef tcref, mkLocalValRef v, Some 0UL) let minfo2 = FSMeth(g, generalizedTyconRef tcref, mkLocalValRef v2, Some 0UL) if tyconRefEq g v.MemberApparentEntity v2.MemberApparentEntity && @@ -1896,8 +1896,8 @@ let CheckRecdField isUnion cenv env (tycon: Tycon) (rfield: RecdField) = let m = rfield.Range let fieldTy = stripTyEqns cenv.g rfield.FormalType let isHidden = - IsHiddenTycon env.sigToImplRemapInfo tycon || - IsHiddenTyconRepr env.sigToImplRemapInfo tycon || + IsHiddenTycon cenv.g env.sigToImplRemapInfo tycon || + IsHiddenTyconRepr cenv.g env.sigToImplRemapInfo tycon || (not isUnion && IsHiddenRecdField env.sigToImplRemapInfo (tcref.MakeNestedRecdFieldRef rfield)) let access = AdjustAccess isHidden (fun () -> tycon.CompilationPath) rfield.Accessibility CheckTypeForAccess cenv env (fun () -> rfield.Name) access m fieldTy @@ -2159,7 +2159,7 @@ let CheckEntityDefn cenv env (tycon: Entity) = uc.RecdFieldsArray |> Array.iter (CheckRecdField true cenv env tycon)) // Access checks - let access = AdjustAccess (IsHiddenTycon env.sigToImplRemapInfo tycon) (fun () -> tycon.CompilationPath) tycon.Accessibility + let access = AdjustAccess (IsHiddenTycon g env.sigToImplRemapInfo tycon) (fun () -> tycon.CompilationPath) tycon.Accessibility let visitType ty = CheckTypeForAccess cenv env (fun () -> tycon.DisplayNameWithStaticParametersAndUnderscoreTypars) access tycon.Range ty abstractSlotValsOfTycons [tycon] |> List.iter (typeOfVal >> visitType) diff --git a/src/fsharp/QuotationTranslator.fs b/src/fsharp/QuotationTranslator.fs index ecbe10d5ad..cf4e4e1745 100644 --- a/src/fsharp/QuotationTranslator.fs +++ b/src/fsharp/QuotationTranslator.fs @@ -314,7 +314,7 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. let argTys = curriedArgInfos |> List.concat |> List.map fst let methArgTypesR = ConvTypes cenv envinner m argTys let methRetTypeR = ConvReturnType cenv envinner m retTy - let methName = vref.CompiledName + let methName = vref.CompiledName cenv.g.CompilerGlobalState let numGenericArgs = tyargs.Length - numEnclTypeArgs ConvObjectModelCall cenv env m (isPropGet, isPropSet, isNewObj, parentTyconR, methArgTypesR, methRetTypeR, methName, tyargs, numGenericArgs, callArgs) else @@ -551,7 +551,7 @@ and private ConvExprCore cenv (env : QuotationTranslationEnv) (expr: Expr) : QP. match vref.DeclaringEntity with | Parent tcref when IsCompiledAsStaticProperty cenv.g vref.Deref -> let parentTyconR = ConvTyconRef cenv tcref m - let propName = vref.CompiledName + let propName = vref.CompiledName cenv.g.CompilerGlobalState let propTy = ConvType cenv env m vref.Type QP.mkPropSet( (parentTyconR, propName, propTy, []), [], [ConvExpr cenv env e]) | _ -> @@ -742,7 +742,7 @@ and ConvModuleValueAppCore cenv env m (vref: ValRef) tyargs (args: Expr list lis let isProperty = IsCompiledAsStaticProperty cenv.g vref.Deref let tcrefR = ConvTyconRef cenv tcref m let tyargsR = ConvTypes cenv env m tyargs - let nm = vref.CompiledName + let nm = vref.CompiledName cenv.g.CompilerGlobalState let argsR = List.map (ConvExprs cenv env) args QP.mkModuleValueApp(tcrefR, nm, isProperty, tyargsR, argsR) @@ -796,7 +796,7 @@ and ConvRecdFieldRef cenv (rfref: RecdFieldRef) m = and ConvVal cenv env (v: Val) = let tyR = ConvType cenv env v.Range v.Type - QP.freshVar (v.CompiledName, tyR, v.IsMutable) + QP.freshVar (v.CompiledName cenv.g.CompilerGlobalState, tyR, v.IsMutable) and ConvTyparRef cenv env m (tp: Typar) = match env.tyvs.TryFind tp.Stamp with diff --git a/src/fsharp/SignatureConformance.fs b/src/fsharp/SignatureConformance.fs index 6ba6dad410..b367987e17 100644 --- a/src/fsharp/SignatureConformance.fs +++ b/src/fsharp/SignatureConformance.fs @@ -305,7 +305,7 @@ type Checker(g, amap, denv, remapInfo: SignatureRepackageInfo, checkingSig) = let m = implVal.Range if implVal.IsMutable <> sigVal.IsMutable then (err denv FSComp.SR.ValueNotContainedMutabilityAttributesDiffer) elif implVal.LogicalName <> sigVal.LogicalName then (err denv FSComp.SR.ValueNotContainedMutabilityNamesDiffer) - elif implVal.CompiledName <> sigVal.CompiledName then (err denv FSComp.SR.ValueNotContainedMutabilityCompiledNamesDiffer) + elif (implVal.CompiledName g.CompilerGlobalState) <> (sigVal.CompiledName g.CompilerGlobalState) then (err denv FSComp.SR.ValueNotContainedMutabilityCompiledNamesDiffer) elif implVal.DisplayName <> sigVal.DisplayName then (err denv FSComp.SR.ValueNotContainedMutabilityDisplayNamesDiffer) elif isLessAccessible implVal.Accessibility sigVal.Accessibility then (err denv FSComp.SR.ValueNotContainedMutabilityAccessibilityMore) elif implVal.MustInline <> sigVal.MustInline then (err denv FSComp.SR.ValueNotContainedMutabilityInlineFlagsDiffer) @@ -369,7 +369,7 @@ type Checker(g, amap, denv, remapInfo: SignatureRepackageInfo, checkingSig) = match implMemberInfo, sigMemberInfo with | None, None -> true | Some implMembInfo, Some sigMembInfo -> - if not (implVal.CompiledName = sigVal.CompiledName) then + if not ((implVal.CompiledName g.CompilerGlobalState) = (sigVal.CompiledName g.CompilerGlobalState)) then err(FSComp.SR.ValueNotContainedMutabilityDotNetNamesDiffer) elif not (implMembInfo.MemberFlags.IsInstance = sigMembInfo.MemberFlags.IsInstance) then err(FSComp.SR.ValueNotContainedMutabilityStaticsDiffer) diff --git a/src/fsharp/TastOps.fs b/src/fsharp/TastOps.fs index 4743ff03df..00fb9a0827 100644 --- a/src/fsharp/TastOps.fs +++ b/src/fsharp/TastOps.fs @@ -3234,7 +3234,6 @@ let (|TypeDefOfExpr|_|) g expr = //-------------------------------------------------------------------------- // DEBUG layout //--------------------------------------------------------------------------- - module DebugPrint = let layoutRanges = ref false @@ -3468,14 +3467,13 @@ module DebugPrint = | ILAttrib ilmeth -> wordL (tagText ilmeth.Name) | FSAttrib vref -> valRefL vref) ^^ rightL (tagText ">]") - + let layoutAttribs attribs = aboveListL (List.map layoutAttrib attribs) let arityInfoL (ValReprInfo (tpNames, _, _) as tvd) = let ns = tvd.AritiesOfArgs in leftL (tagText "arity<") ^^ intL tpNames.Length ^^ sepL (tagText ">[") ^^ commaListL (List.map intL ns) ^^ rightL (tagText "]") - let valL (v: Val) = let vsL = wordL (tagText (DecompileOpName v.LogicalName)) |> stampL v.Stamp let vsL = vsL -- layoutAttribs (v.Attribs) @@ -3511,18 +3509,18 @@ module DebugPrint = wordL(tagText "slotsig") #endif - let rec memberL (v: Val) (membInfo: ValMemberInfo) = + let rec memberL (g:TcGlobals) (v: Val) (membInfo: ValMemberInfo) = aboveListL - [ wordL(tagText "compiled_name! = ") ^^ wordL (tagText v.CompiledName) + [ wordL(tagText "compiled_name! = ") ^^ wordL (tagText (v.CompiledName g.CompilerGlobalState)) wordL(tagText "membInfo-slotsig! = ") ^^ listL slotSigL membInfo.ImplementedSlotSigs ] - and valAtBindL v = + and valAtBindL g v = let vL = valL v let mutL = (if v.IsMutable then wordL(tagText "mutable") ++ vL else vL) mutL --- aboveListL [ yield wordL(tagText ":") ^^ typeL v.Type - match v.MemberInfo with None -> () | Some mem_info -> yield wordL(tagText "!") ^^ memberL v mem_info + match v.MemberInfo with None -> () | Some mem_info -> yield wordL(tagText "!") ^^ memberL g v mem_info match v.ValReprInfo with None -> () | Some arity_info -> yield wordL(tagText "#") ^^ arityInfoL arity_info] let unionCaseRefL (ucr: UnionCaseRef) = wordL (tagText ucr.CaseName) @@ -3563,9 +3561,9 @@ module DebugPrint = | Const.Zero -> "default" wordL (tagText str) - let rec tyconL (tycon: Tycon) = - if tycon.IsModuleOrNamespace then entityL tycon else - + let rec tyconL g (tycon: Tycon) = + if tycon.IsModuleOrNamespace then entityL g tycon else + let lhsL = wordL (tagText (match tycon.TypeOrMeasureKind with TyparKind.Measure -> "[] type" | TyparKind.Type -> "type")) ^^ wordL (tagText tycon.DisplayName) ^^ layoutTyparDecls tycon.TyparsNoRange let lhsL = lhsL --- layoutAttribs tycon.Attribs let memberLs = @@ -3585,7 +3583,7 @@ module DebugPrint = emptyL else let iimplsLs = iimpls |> List.map (fun (ty, _, _) -> wordL(tagText "interface") --- typeL ty) - let adhocLs = adhoc |> List.map (fun vref -> valAtBindL vref.Deref) + let adhocLs = adhoc |> List.map (fun vref -> valAtBindL g vref.Deref) (wordL(tagText "with") @@-- aboveListL (iimplsLs @ adhocLs)) @@ wordL(tagText "end") let layoutUnionCaseArgTypes argtys = sepListL (wordL(tagText "*")) (List.map typeL argtys) @@ -3632,7 +3630,7 @@ module DebugPrint = let vsprs = tycon.MembersOfFSharpTyconSorted |> List.filter (fun v -> v.IsDispatchSlot) - |> List.map (fun vref -> valAtBindL vref.Deref) + |> List.map (fun vref -> valAtBindL g vref.Deref) let vals = tycon.TrueFieldsAsList |> List.map (fun f -> (if f.IsStatic then wordL(tagText "static") else emptyL) ^^ wordL(tagText "val") ^^ layoutRecdField f) let alldecls = inherits @ vsprs @ vals let emptyMeasure = match tycon.TypeOrMeasureKind with TyparKind.Measure -> isNil alldecls | _ -> false @@ -3658,25 +3656,31 @@ module DebugPrint = (lhsL ^^ wordL(tagText "=")) @@-- rhsL reprL - and bindingL (TBind(v, repr, _)) = - valAtBindL v --- (wordL(tagText "=") ^^ exprL repr) + and bindingL g (TBind(v, repr, _)) = + valAtBindL g v --- (wordL(tagText "=") ^^ exprL g repr) - and exprL expr = exprWrapL false expr + and exprL g expr = exprWrapL g false expr - and atomL expr = exprWrapL true expr // true means bracket if needed to be atomic expr + and atomL g expr = exprWrapL g true expr // true means bracket if needed to be atomic expr - and letRecL binds bodyL = + and letRecL g binds bodyL = let eqnsL = binds - |> List.mapHeadTail (fun bind -> wordL(tagText "rec") ^^ bindingL bind ^^ wordL(tagText "in")) - (fun bind -> wordL(tagText "and") ^^ bindingL bind ^^ wordL(tagText "in")) + |> List.mapHeadTail (fun bind -> wordL(tagText "rec") ^^ bindingL g bind ^^ wordL(tagText "in")) + (fun bind -> wordL(tagText "and") ^^ bindingL g bind ^^ wordL(tagText "in")) (aboveListL eqnsL @@ bodyL) - and letL bind bodyL = - let eqnL = wordL(tagText "let") ^^ bindingL bind ^^ wordL(tagText "in") + and letL g bind bodyL = + let eqnL = wordL(tagText "let") ^^ bindingL g bind ^^ wordL(tagText "in") (eqnL @@ bodyL) - and exprWrapL isAtomic expr = + and exprWrapL g isAtomic expr = + let atomL args = atomL g args + let exprL expr = exprL g expr + let iimplL iimpls = iimplL g iimpls + let valAtBindL v = valAtBindL g v + let overrideL tmeth = overrideL g tmeth + let targetL targets = targetL g targets let wrap = bracketIfL isAtomic // wrap iff require atomic expr let lay = match expr with @@ -3710,15 +3714,15 @@ module DebugPrint = ((wordL(tagText "CHOOSE") ^^ spaceListL (List.map typarL argtyvs) ^^ rightL(tagText ".")) ++ exprL body) |> wrap | Expr.App (f, _, tys, argtys, _) -> let flayout = atomL f - appL flayout tys argtys |> wrap + appL g flayout tys argtys |> wrap | Expr.LetRec (binds, body, _, _) -> - letRecL binds (exprL body) |> wrap + letRecL g binds (exprL body) |> wrap | Expr.Let (bind, body, _, _) -> - letL bind (exprL body) |> wrap + letL g bind (exprL body) |> wrap | Expr.Link rX -> (wordL(tagText "RecLink") --- atomL (!rX)) |> wrap | Expr.Match (_, _, dtree, targets, _, _) -> - leftL(tagText "[") ^^ (decisionTreeL dtree @@ aboveListL (List.mapi targetL (targets |> Array.toList)) ^^ rightL(tagText "]")) + leftL(tagText "[") ^^ (decisionTreeL g dtree @@ aboveListL (List.mapi targetL (targets |> Array.toList)) ^^ rightL(tagText "]")) | Expr.Op (TOp.UnionCase c, _, args, _) -> (unionCaseRefL c ++ spaceListL (List.map atomL args)) |> wrap | Expr.Op (TOp.ExnConstr ecref, _, args, _) -> @@ -3762,7 +3766,7 @@ module DebugPrint = | Expr.Op (TOp.ILAsm (a, tys), tyargs, args, _) -> let instrs = a |> List.map (sprintf "%+A" >> tagText >> wordL) |> spaceListL // %+A has + since instrs are from an "internal" type let instrs = leftL(tagText "(#") ^^ instrs ^^ rightL(tagText "#)") - (appL instrs tyargs args --- + (appL g instrs tyargs args --- wordL(tagText ":") ^^ spaceListL (List.map typeAtomL tys)) |> wrap | Expr.Op (TOp.LValueOp (lvop, vr), _, args, _) -> (lvalopL lvop ^^ valRefL vr --- bracketL (commaListL (List.map atomL args))) |> wrap @@ -3814,92 +3818,104 @@ module DebugPrint = then leftL(tagText "{") ^^ (rangeL expr.Range ^^ rightL(tagText ":")) ++ lay ^^ rightL(tagText "}") else lay - and implFilesL implFiles = + and implFilesL g implFiles = + let implFileL implFiles = implFileL g implFiles aboveListL (List.map implFileL implFiles) - and appL flayout tys args = + and appL g flayout tys args = + let atomL args = atomL g args let z = flayout let z = z ^^ instL typeL tys let z = z --- sepL(tagText "`") --- (spaceListL (List.map atomL args)) z - - and implFileL (TImplFile (_, _, mexpr, _, _, _)) = - aboveListL [(wordL(tagText "top implementation ")) @@-- mexprL mexpr] - and mexprL x = + and implFileL g (TImplFile (_, _, mexpr, _, _, _)) = + aboveListL [(wordL(tagText "top implementation ")) @@-- mexprL g mexpr] + + and mexprL g x = match x with - | ModuleOrNamespaceExprWithSig(mtyp, defs, _) -> mdefL defs @@- (wordL(tagText ":") @@- entityTypeL mtyp) + | ModuleOrNamespaceExprWithSig(mtyp, defs, _) -> mdefL g defs @@- (wordL(tagText ":") @@- entityTypeL g mtyp) - and mdefsL defs = wordL(tagText "Module Defs") @@-- aboveListL(List.map mdefL defs) + and mdefsL g defs = + let mdefL x = mdefL g x + wordL(tagText "Module Defs") @@-- aboveListL(List.map mdefL defs) - and mdefL x = - match x with + and mdefL g x = + let tyconL tycon = tyconL g tycon + let mbindL x = mbindL g x + match x with | TMDefRec(_, tycons, mbinds, _) -> aboveListL ((tycons |> List.map tyconL) @ List.map mbindL mbinds) - | TMDefLet(bind, _) -> letL bind emptyL - | TMDefDo(e, _) -> exprL e - | TMDefs defs -> mdefsL defs - | TMAbstract mexpr -> mexprL mexpr - - and mbindL x = - match x with - | ModuleOrNamespaceBinding.Binding bind -> letL bind emptyL + | TMDefLet(bind, _) -> letL g bind emptyL + | TMDefDo(e, _) -> exprL g e + | TMDefs defs -> mdefsL g defs + | TMAbstract mexpr -> mexprL g mexpr + + and mbindL g x = + match x with + | ModuleOrNamespaceBinding.Binding bind -> letL g bind emptyL | ModuleOrNamespaceBinding.Module(mspec, rhs) -> - (wordL (tagText (if mspec.IsNamespace then "namespace" else "module")) ^^ (wordL (tagText mspec.DemangledModuleOrNamespaceName) |> stampL mspec.Stamp)) @@-- mdefL rhs + (wordL (tagText (if mspec.IsNamespace then "namespace" else "module")) ^^ (wordL (tagText mspec.DemangledModuleOrNamespaceName) |> stampL mspec.Stamp)) @@-- mdefL g rhs - and entityTypeL (mtyp: ModuleOrNamespaceType) = + and entityTypeL g (mtyp: ModuleOrNamespaceType) = + let tyconL tycon = tyconL g tycon aboveListL [jlistL typeOfValL mtyp.AllValsAndMembers - jlistL tyconL mtyp.AllEntities;] + jlistL tyconL mtyp.AllEntities] - and entityL (ms: ModuleOrNamespace) = + and entityL g (ms: ModuleOrNamespace) = let header = wordL(tagText "module") ^^ (wordL (tagText ms.DemangledModuleOrNamespaceName) |> stampL ms.Stamp) ^^ wordL(tagText ":") let footer = wordL(tagText "end") - let body = entityTypeL ms.ModuleOrNamespaceType + let body = entityTypeL g ms.ModuleOrNamespaceType (header @@-- body) @@ footer - and ccuL (ccu: CcuThunk) = entityL ccu.Contents + and ccuL g (ccu: CcuThunk) = entityL g ccu.Contents - and decisionTreeL x = + and decisionTreeL g x = + let exprL expr = exprL g expr + let dcaseL dcases = dcaseL g dcases match x with | TDBind (bind, body) -> - let bind = wordL(tagText "let") ^^ bindingL bind ^^ wordL(tagText "in") - (bind @@ decisionTreeL body) + let bind = wordL(tagText "let") ^^ bindingL g bind ^^ wordL(tagText "in") + (bind @@ decisionTreeL g body) | TDSuccess (args, n) -> wordL(tagText "Success") ^^ leftL(tagText "T") ^^ intL n ^^ tupleL (args |> List.map exprL) - | TDSwitch (test, dcases, dflt, _) -> + | TDSwitch (test, dcases, dflt, _) -> (wordL(tagText "Switch") --- exprL test) @@-- (aboveListL (List.map dcaseL dcases) @@ match dflt with | None -> emptyL - | Some dtree -> wordL(tagText "dflt:") --- decisionTreeL dtree) + | Some dtree -> wordL(tagText "dflt:") --- decisionTreeL g dtree) - and dcaseL (TCase (test, dtree)) = (dtestL test ^^ wordL(tagText "//")) --- decisionTreeL dtree + and dcaseL g (TCase (test, dtree)) = (dtestL g test ^^ wordL(tagText "//")) --- decisionTreeL g dtree - and dtestL x = + and dtestL g x = match x with | (DecisionTreeTest.UnionCase (c, tinst)) -> wordL(tagText "is") ^^ unionCaseRefL c ^^ instL typeL tinst | (DecisionTreeTest.ArrayLength (n, ty)) -> wordL(tagText "length") ^^ intL n ^^ typeL ty | (DecisionTreeTest.Const c) -> wordL(tagText "is") ^^ constL c | (DecisionTreeTest.IsNull ) -> wordL(tagText "isnull") | (DecisionTreeTest.IsInst (_, ty)) -> wordL(tagText "isinst") ^^ typeL ty - | (DecisionTreeTest.ActivePatternCase (exp, _, _, _, _)) -> wordL(tagText "query") ^^ exprL exp + | (DecisionTreeTest.ActivePatternCase (exp, _, _, _, _)) -> wordL(tagText "query") ^^ exprL g exp - and targetL i (TTarget (argvs, body, _)) = leftL(tagText "T") ^^ intL i ^^ tupleL (flatValsL argvs) ^^ rightL(tagText ":") --- exprL body + and targetL g i (TTarget (argvs, body, _)) = leftL(tagText "T") ^^ intL i ^^ tupleL (flatValsL argvs) ^^ rightL(tagText ":") --- exprL g body and flatValsL vs = vs |> List.map valL - and tmethodL (TObjExprMethod(TSlotSig(nm, _, _, _, _, _), _, tps, vs, e, _)) = + and tmethodL g (TObjExprMethod(TSlotSig(nm, _, _, _, _, _), _, tps, vs, e, _)) = + let valAtBindL v = valAtBindL g v (wordL(tagText "TObjExprMethod") --- (wordL (tagText nm)) ^^ wordL(tagText "=")) -- (wordL(tagText "METH-LAM") --- angleBracketListL (List.map typarL tps) ^^ rightL(tagText ".")) --- (wordL(tagText "meth-lam") --- tupleL (List.map (List.map valAtBindL >> tupleL) vs) ^^ rightL(tagText ".")) --- - (atomL e) + (atomL g e) - and overrideL tmeth = wordL(tagText "with") ^^ tmethodL tmeth + and overrideL g tmeth = wordL(tagText "with") ^^ tmethodL g tmeth - and iimplL (ty, tmeths) = wordL(tagText "impl") ^^ aboveListL (typeL ty :: List.map tmethodL tmeths) + and iimplL g (ty, tmeths) = + let tmethodL p = tmethodL g p + wordL(tagText "impl") ^^ aboveListL (typeL ty :: List.map tmethodL tmeths) let showType x = Layout.showL (typeL x) - let showExpr x = Layout.showL (exprL x) + let showExpr g x = Layout.showL (exprL g x) let traitL x = auxTraitL SimplifyTypes.typeSimplificationInfo0 x @@ -4198,9 +4214,13 @@ let IsHidden setF accessF remapF debugF = let res = check mrmi x if verbose then dprintf "IsHidden, #mrmi = %d, %s = %b\n" mrmi.Length (showL (debugF x)) res res - -let IsHiddenTycon mrmi x = IsHidden (fun mhi -> mhi.HiddenTycons) (fun tc -> tc.Accessibility) (fun rpi x -> (remapTyconRef rpi.tyconRefRemap (mkLocalTyconRef x)).Deref) DebugPrint.tyconL mrmi x -let IsHiddenTyconRepr mrmi x = IsHidden (fun mhi -> mhi.HiddenTyconReprs) (fun v -> v.TypeReprAccessibility) (fun rpi x -> (remapTyconRef rpi.tyconRefRemap (mkLocalTyconRef x)).Deref) DebugPrint.tyconL mrmi x + +let IsHiddenTycon g mrmi x = + let debugPrint x = DebugPrint.tyconL g x + IsHidden (fun mhi -> mhi.HiddenTycons) (fun tc -> tc.Accessibility) (fun rpi x -> (remapTyconRef rpi.tyconRefRemap (mkLocalTyconRef x)).Deref) debugPrint mrmi x +let IsHiddenTyconRepr g mrmi x = + let debugPrint x = DebugPrint.tyconL g x + IsHidden (fun mhi -> mhi.HiddenTyconReprs) (fun v -> v.TypeReprAccessibility) (fun rpi x -> (remapTyconRef rpi.tyconRefRemap (mkLocalTyconRef x)).Deref) debugPrint mrmi x let IsHiddenVal mrmi x = IsHidden (fun mhi -> mhi.HiddenVals) (fun v -> v.Accessibility) (fun rpi x -> (remapValRef rpi (mkLocalValRef x)).Deref) DebugPrint.valL mrmi x let IsHiddenRecdField mrmi x = IsHidden (fun mhi -> mhi.HiddenRecdFields) (fun rfref -> rfref.RecdField.Accessibility) (fun rpi x -> remapRecdFieldRef rpi.tyconRefRemap x) DebugPrint.recdFieldRefL mrmi x @@ -5278,16 +5298,16 @@ and copyAndRemapAndBindModTy g compgen tmenv mty = let _, _, tmenvinner = copyAndRemapAndBindTyconsAndVals g compgen tmenv tycons vs remapModTy g compgen tmenvinner mty, tmenvinner -and remapModTy _g _compgen tmenv mty = - mapImmediateValsAndTycons (renameTycon tmenv) (renameVal tmenv) mty +and remapModTy g _compgen tmenv mty = + mapImmediateValsAndTycons (renameTycon g tmenv) (renameVal tmenv) mty -and renameTycon tyenv x = +and renameTycon g tyenv x = let tcref = - try + try let res = tyenv.tyconRefRemap.[mkLocalTyconRef x] res with :? KeyNotFoundException -> - errorR(InternalError("couldn't remap internal tycon " + showL(DebugPrint.tyconL x), x.Range)) + errorR(InternalError("couldn't remap internal tycon " + showL(DebugPrint.tyconL g x), x.Range)) mkLocalTyconRef x tcref.Deref @@ -5323,17 +5343,17 @@ and copyAndRemapAndBindTyconsAndVals g compgen tmenv tycons vs = mkLocalValRef v vref.Deref - let lookupTycon tycon = + let lookupTycon g tycon = let tcref = try let res = tmenvinner.tyconRefRemap.[mkLocalTyconRef tycon] res with :? KeyNotFoundException -> - errorR(InternalError("couldn't remap internal tycon " + showL(DebugPrint.tyconL tycon), tycon.Range)) + errorR(InternalError("couldn't remap internal tycon " + showL(DebugPrint.tyconL g tycon), tycon.Range)) mkLocalTyconRef tycon tcref.Deref - - (tycons, tycons') ||> List.iter2 (fun tcd tcd' -> + (tycons, tycons') ||> List.iter2 (fun tcd tcd' -> + let lookupTycon tycon = lookupTycon g tycon 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 @@ -5415,7 +5435,7 @@ and remapAndRenameModDef g compgen tmenv mdef = match mdef with | TMDefRec(isRec, tycons, mbinds, m) -> // Abstract (virtual) vslots in the tycons at TMDefRec nodes are binders. They also need to be copied and renamed. - let tycons = tycons |> List.map (renameTycon tmenv) + let tycons = tycons |> List.map (renameTycon g tmenv) let mbinds = mbinds |> List.map (remapAndRenameModBind g compgen tmenv) TMDefRec(isRec, tycons, mbinds, m) | TMDefLet(bind, m) -> @@ -5439,7 +5459,7 @@ and remapAndRenameModBind g compgen tmenv x = let bind2 = remapAndRenameBind g compgen tmenv bind v2 ModuleOrNamespaceBinding.Binding bind2 | ModuleOrNamespaceBinding.Module(mspec, def) -> - let mspec = renameTycon tmenv mspec + let mspec = renameTycon g tmenv mspec let def = remapAndRenameModDef g compgen tmenv def ModuleOrNamespaceBinding.Module(mspec, def) @@ -7781,7 +7801,7 @@ let XmlDocSigOfVal g path (v: Val) = match membInfo.MemberFlags.MemberKind with | MemberKind.ClassConstructor | MemberKind.Constructor -> "M:", "#ctor" - | MemberKind.Member -> "M:", v.CompiledName + | MemberKind.Member -> "M:", v.CompiledName g.CompilerGlobalState | MemberKind.PropertyGetSet | MemberKind.PropertySet | MemberKind.PropertyGet -> "P:", v.PropertyName @@ -7795,7 +7815,7 @@ let XmlDocSigOfVal g path (v: Val) = // Regular F# values and extension members let w = arityOfVal v let tps, argInfos, _, _ = GetTopValTypeInCompiledForm g w v.Type v.Range - let name = v.CompiledName + let name = v.CompiledName g.CompilerGlobalState let prefix = if w.NumCurriedArgs = 0 && isNil tps then "P:" else "M:" @@ -8897,7 +8917,6 @@ let BindUnitVars g (mvs: Val list, paramInfos: ArgReprInfo list, body) = [], mkLet NoSequencePointAtInvisibleBinding v.Range v (mkUnit g v.Range) body | _ -> mvs, body - let isThreadOrContextStatic g attrs = HasFSharpAttributeOpt g g.attrib_ThreadStaticAttribute attrs || HasFSharpAttributeOpt g g.attrib_ContextStaticAttribute attrs @@ -8905,5 +8924,3 @@ let isThreadOrContextStatic g attrs = let mkUnitDelayLambda (g: TcGlobals) m e = let uv, _ = mkCompGenLocal m "unitVar" g.unit_ty mkLambda m uv (e, tyOfExpr g e) - - diff --git a/src/fsharp/TastOps.fsi b/src/fsharp/TastOps.fsi index f9011081bb..8c71736a84 100755 --- a/src/fsharp/TastOps.fsi +++ b/src/fsharp/TastOps.fsi @@ -1205,10 +1205,10 @@ val MakeExportRemapping : CcuThunk -> ModuleOrNamespace -> Remap val ApplyExportRemappingToEntity : TcGlobals -> Remap -> ModuleOrNamespace -> ModuleOrNamespace /// Determine if a type definition is hidden by a signature -val IsHiddenTycon : (Remap * SignatureHidingInfo) list -> Tycon -> bool +val IsHiddenTycon : TcGlobals -> (Remap * SignatureHidingInfo) list -> Tycon -> bool /// Determine if the representation of a type definition is hidden by a signature -val IsHiddenTyconRepr : (Remap * SignatureHidingInfo) list -> Tycon -> bool +val IsHiddenTyconRepr : TcGlobals -> (Remap * SignatureHidingInfo) list -> Tycon -> bool /// Determine if a member, function or value is hidden by a signature val IsHiddenVal : (Remap * SignatureHidingInfo) list -> Val -> bool @@ -1290,7 +1290,7 @@ module DebugPrint = val showType : TType -> string /// Convert an expression to a string for debugging purposes - val showExpr : Expr -> string + val showExpr : TcGlobals -> Expr -> string /// Debug layout for a reference to a value val valRefL : ValRef -> layout @@ -1299,7 +1299,7 @@ module DebugPrint = val unionCaseRefL : UnionCaseRef -> layout /// Debug layout for an value definition at its binding site - val valAtBindL : Val -> layout + val valAtBindL : TcGlobals -> Val -> layout /// Debug layout for an integer val intL : int -> layout @@ -1326,31 +1326,31 @@ module DebugPrint = val slotSigL : SlotSig -> layout /// Debug layout for the type signature of a module or namespace definition - val entityTypeL : ModuleOrNamespaceType -> layout + val entityTypeL : TcGlobals -> ModuleOrNamespaceType -> layout /// Debug layout for a module or namespace definition - val entityL : ModuleOrNamespace -> layout + val entityL : TcGlobals -> ModuleOrNamespace -> layout /// Debug layout for the type of a value val typeOfValL : Val -> layout /// Debug layout for a binding of an expression to a value - val bindingL : Binding -> layout + val bindingL : TcGlobals -> Binding -> layout /// Debug layout for an expression - val exprL : Expr -> layout + val exprL : TcGlobals -> Expr -> layout /// Debug layout for a type definition - val tyconL : Tycon -> layout + val tyconL : TcGlobals -> Tycon -> layout /// Debug layout for a decision tree - val decisionTreeL : DecisionTree -> layout + val decisionTreeL : TcGlobals -> DecisionTree -> layout /// Debug layout for an implementation file - val implFileL : TypedImplFile -> layout + val implFileL : TcGlobals -> TypedImplFile -> layout /// Debug layout for a list of implementation files - val implFilesL : TypedImplFile list -> layout + val implFilesL : TcGlobals -> TypedImplFile list -> layout /// Debug layout for class and record fields val recdFieldRefL : RecdFieldRef -> layout diff --git a/src/fsharp/TastPickle.fsi b/src/fsharp/TastPickle.fsi index 9f1000580a..2b659b0598 100644 --- a/src/fsharp/TastPickle.fsi +++ b/src/fsharp/TastPickle.fsi @@ -142,7 +142,7 @@ val internal u_ty : unpickler val internal unpickleCcuInfo : ReaderState -> PickledCcuInfo /// Deserialize an arbitrary object which may have holes referring to other compilation units -val internal unpickleObjWithDanglingCcus : file:string -> viewedScope:ILScopeRef -> ilModule:ILModuleDef option -> ('T unpickler) -> byte[] -> PickledDataWithReferences<'T> +val internal unpickleObjWithDanglingCcus : file:string -> viewedScope:ILScopeRef -> ilModule:ILModuleDef option -> ('T unpickler) -> byte[] -> PickledDataWithReferences<'T> diff --git a/src/fsharp/TcGlobals.fs b/src/fsharp/TcGlobals.fs index 337205632e..1aa14c5794 100755 --- a/src/fsharp/TcGlobals.fs +++ b/src/fsharp/TcGlobals.fs @@ -652,13 +652,13 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d let v_hash_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "hash" , None , Some "Hash" , [vara], ([[varaTy]], v_int_ty)) let v_box_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "box" , None , Some "Box" , [vara], ([[varaTy]], v_obj_ty)) let v_isnull_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "isNull" , None , Some "IsNull" , [vara], ([[varaTy]], v_bool_ty)) - let v_isnotnull_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "isNotNull" , None , Some "IsNotNull" , [vara], ([[varaTy]], v_bool_ty)) + let v_isnotnull_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "isNotNull" , None , Some "IsNotNull" , [vara], ([[varaTy]], v_bool_ty)) let v_raise_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "raise" , None , Some "Raise" , [vara], ([[mkSysNonGenericTy sys "Exception"]], varaTy)) - let v_failwith_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "failwith" , None , Some "FailWith" , [vara], ([[v_string_ty]], varaTy)) - let v_invalid_arg_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "invalidArg" , None , Some "InvalidArg" , [vara], ([[v_string_ty]; [v_string_ty]], varaTy)) - let v_null_arg_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "nullArg" , None , Some "NullArg" , [vara], ([[v_string_ty]], varaTy)) - let v_invalid_op_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "invalidOp" , None , Some "InvalidOp" , [vara], ([[v_string_ty]], varaTy)) - let v_failwithf_info = makeIntrinsicValRef(fslib_MFExtraTopLevelOperators_nleref, "failwithf" , None, Some "PrintFormatToStringThenFail" , [vara;varb], ([[mk_format4_ty varaTy v_unit_ty v_string_ty v_string_ty]], varaTy)) + let v_failwith_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "failwith" , None , Some "FailWith" , [vara], ([[v_string_ty]], varaTy)) + let v_invalid_arg_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "invalidArg" , None , Some "InvalidArg" , [vara], ([[v_string_ty]; [v_string_ty]], varaTy)) + let v_null_arg_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "nullArg" , None , Some "NullArg" , [vara], ([[v_string_ty]], varaTy)) + let v_invalid_op_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "invalidOp" , None , Some "InvalidOp" , [vara], ([[v_string_ty]], varaTy)) + let v_failwithf_info = makeIntrinsicValRef(fslib_MFExtraTopLevelOperators_nleref, "failwithf" , None , Some "PrintFormatToStringThenFail" , [vara;varb], ([[mk_format4_ty varaTy v_unit_ty v_string_ty v_string_ty]], varaTy)) let v_reraise_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "reraise" , None , Some "Reraise", [vara], ([[v_unit_ty]], varaTy)) let v_typeof_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "typeof" , None , Some "TypeOf" , [vara], ([], v_system_Type_ty)) @@ -697,9 +697,7 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d let v_seq_empty_info = makeIntrinsicValRef(fslib_MFSeqModule_nleref, "empty" , None , Some "Empty" , [vara], ([], mkSeqTy varaTy)) let v_new_format_info = makeIntrinsicValRef(fslib_MFCore_nleref, ".ctor" , Some "PrintfFormat`5", None , [vara;varb;varc;vard;vare], ([[v_string_ty]], mkPrintfFormatTy varaTy varbTy varcTy vardTy vareTy)) let v_sprintf_info = makeIntrinsicValRef(fslib_MFExtraTopLevelOperators_nleref, "sprintf" , None , Some "PrintFormatToStringThen", [vara], ([[mk_format4_ty varaTy v_unit_ty v_string_ty v_string_ty]], varaTy)) - let v_lazy_force_info = - // Lazy\Value for > 4.0 - makeIntrinsicValRef(fslib_MFLazyExtensions_nleref, "Force" , Some "Lazy`1" , None , [vara], ([[mkLazyTy varaTy]; []], varaTy)) + let v_lazy_force_info = makeIntrinsicValRef(fslib_MFLazyExtensions_nleref, "Force" , Some "Lazy`1" , None , [vara], ([[mkLazyTy varaTy]; []], varaTy)) let v_lazy_create_info = makeIntrinsicValRef(fslib_MFLazyExtensions_nleref, "Create" , Some "Lazy`1" , None , [vara], ([[v_unit_ty --> varaTy]], mkLazyTy varaTy)) let v_seq_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "seq" , None , Some "CreateSequence" , [vara], ([[mkSeqTy varaTy]], mkSeqTy varaTy)) @@ -737,6 +735,7 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d let mutable debuggerBrowsableNeverAttributeCache = None let mkDebuggerNonUserCodeAttribute() = mkILCustomAttribute ilg (findSysILTypeRef tname_DebuggerNonUserCodeAttribute, [], [], []) let mkCompilerGeneratedAttribute () = mkILCustomAttribute ilg (tref_CompilerGeneratedAttribute, [], [], []) + let compilerGlobalState = CompilerGlobalState() // Requests attributes to be added to compiler generated methods. let addGeneratedAttrs (attrs: ILAttributes) = @@ -1475,17 +1474,17 @@ type public TcGlobals(compilingFslib: bool, ilg:ILGlobals, fslibCcu: CcuThunk, d (if enableEnC then 4 else 0) let tref_DebuggableAttribute_DebuggingModes = mkILTyRefInTyRef (tref_DebuggableAttribute, tname_DebuggableAttribute_DebuggingModes) mkILCustomAttribute ilg - (tref_DebuggableAttribute, [mkILNonGenericValueTy tref_DebuggableAttribute_DebuggingModes], + (tref_DebuggableAttribute, [mkILNonGenericValueTy tref_DebuggableAttribute_DebuggingModes], (* See System.Diagnostics.DebuggableAttribute.DebuggingModes *) [ILAttribElem.Int32( debuggingMode )], []) - member __.CompilerGeneratedAttribute = mkCompilerGeneratedAttribute () - - member __.eraseClassUnionDef = EraseUnions.mkClassUnionDef (addMethodGeneratedAttrs, addPropertyGeneratedAttrs, addPropertyNeverAttrs, addFieldGeneratedAttrs, addFieldNeverAttrs, mkDebuggerTypeProxyAttribute) ilg + member internal __.CompilerGlobalState = Some compilerGlobalState + + member __.CompilerGeneratedAttribute = mkCompilerGeneratedAttribute () + member __.eraseClassUnionDef = EraseUnions.mkClassUnionDef (addMethodGeneratedAttrs, addPropertyGeneratedAttrs, addPropertyNeverAttrs, addFieldGeneratedAttrs, addFieldNeverAttrs, mkDebuggerTypeProxyAttribute) ilg #if DEBUG // This global is only used during debug output let global_g = ref (None : TcGlobals option) #endif - diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index 66267dbe14..485b367aed 100644 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -1559,7 +1559,10 @@ let InstanceMembersNeedSafeInitCheck cenv m thisTy = thisTy let MakeSafeInitField (g: TcGlobals) env m isStatic = - let id = ident(globalNng.FreshCompilerGeneratedName("init", m), m) + let id = + // Ensure that we have an g.CompilerGlobalState + assert(g.CompilerGlobalState |> Option.isSome) + ident(g.CompilerGlobalState.Value.NiceNameGenerator.FreshCompilerGeneratedName("init", m), m) let taccess = TAccess [env.eAccessPath] NewRecdField isStatic None id false g.int_ty true true [] [] XmlDoc.Empty taccess true @@ -3436,7 +3439,7 @@ let ConvertArbitraryExprToEnumerable cenv ty (env: TcEnv) (expr: Expr) = let expr = mkCompGenLet m enumerableVar expr - (mkCallSeqOfFunctions cenv.g m retTypeOfGetEnumerator enumElemTy + (mkCallSeqOfFunctions cenv.g m retTypeOfGetEnumerator enumElemTy (mkUnitDelayLambda cenv.g m getEnumExpr) (mkLambda m enumeratorVar (guardExpr, guardTy)) (mkLambda m enumeratorVar (betterCurrentExpr, enumElemTy))) @@ -7241,7 +7244,7 @@ and TcForEachExpr cenv overallTy env tpenv (pat, enumSynExpr, bodySynExpr, mWhol let elemAddrTy = if isReadOnlySpan then mkInByrefTy cenv.g elemTy else mkByrefTy cenv.g elemTy // Evaluate the span index lookup - let bodyExprFixup elemVar bodyExpr = + let bodyExprFixup elemVar bodyExpr = let elemAddrVar, _ = mkCompGenLocal mForLoopStart "addr" elemAddrTy let e = mkCompGenLet mForLoopStart elemVar (mkAddrGet mForLoopStart (mkLocalValRef elemAddrVar)) bodyExpr let getItemCallExpr, _ = BuildMethodCall tcVal cenv.g cenv.amap PossiblyMutates mWholeExpr true getItemMethInfo ValUseFlag.NormalValUse [] [ spanExpr ] [ idxExpr ] @@ -7251,7 +7254,7 @@ and TcForEachExpr cenv overallTy env tpenv (pat, enumSynExpr, bodySynExpr, mWhol let overallExprFixup overallExpr = mkCompGenLet mForLoopStart spanVar enumExpr overallExpr let getLengthCallExpr, _ = BuildMethodCall tcVal cenv.g cenv.amap PossiblyMutates mWholeExpr true getLengthMethInfo ValUseFlag.NormalValUse [] [ spanExpr ] [] - + // Ask for a loop over integers for the given range (elemTy, bodyExprFixup, overallExprFixup, Choice2Of3 (idxVar, mkZero cenv.g mForLoopStart, mkDecr cenv.g mForLoopStart getLengthCallExpr)) @@ -13311,7 +13314,7 @@ module IncrClassChecking = let takenFieldNames = [ for b in memberBinds do - yield b.Var.CompiledName + yield b.Var.CompiledName cenv.g.CompilerGlobalState yield b.Var.DisplayName yield b.Var.CoreDisplayName yield b.Var.LogicalName ] diff --git a/src/fsharp/ast.fs b/src/fsharp/ast.fs index 09e46ba338..94f4022621 100644 --- a/src/fsharp/ast.fs +++ b/src/fsharp/ast.fs @@ -2456,74 +2456,6 @@ module LexbufLocalXmlDocStore = | _ -> PreXmlDoc.Empty - - -/// Generates compiler-generated names. Each name generated also includes the StartLine number of the range passed in -/// at the point of first generation. -/// -/// This type may be accessed concurrently, though in practice it is only used from the compilation thread. -/// It is made concurrency-safe since a global instance of the type is allocated in tast.fs, and it is good -/// policy to make all globally-allocated objects concurrency safe in case future versions of the compiler -/// are used to host multiple concurrent instances of compilation. -type NiceNameGenerator() = - - let lockObj = obj() - let basicNameCounts = new Dictionary(100) - - member x.FreshCompilerGeneratedName (name, m: range) = - lock lockObj (fun () -> - let basicName = GetBasicNameOfPossibleCompilerGeneratedName name - let n = - match basicNameCounts.TryGetValue basicName with - | true, count -> count - | _ -> 0 - let nm = CompilerGeneratedNameSuffix basicName (string m.StartLine + (match n with 0 -> "" | n -> "-" + string n)) - basicNameCounts.[basicName] <- n + 1 - nm) - - member x.Reset () = - lock lockObj (fun () -> - basicNameCounts.Clear() - ) - - - -/// Generates compiler-generated names marked up with a source code location, but if given the same unique value then -/// return precisely the same name. Each name generated also includes the StartLine number of the range passed in -/// at the point of first generation. -/// -/// This type may be accessed concurrently, though in practice it is only used from the compilation thread. -/// It is made concurrency-safe since a global instance of the type is allocated in tast.fs. -type StableNiceNameGenerator() = - - let lockObj = obj() - - let names = new Dictionary<(string * int64), string>(100) - let basicNameCounts = new Dictionary(100) - - member x.GetUniqueCompilerGeneratedName (name, m: range, uniq) = - lock lockObj (fun () -> - let basicName = GetBasicNameOfPossibleCompilerGeneratedName name - let key = basicName, uniq - match names.TryGetValue key with - | true, nm -> nm - | _ -> - let n = - match basicNameCounts.TryGetValue basicName with - | true, c -> c - | _ -> 0 - let nm = CompilerGeneratedNameSuffix basicName (string m.StartLine + (match n with 0 -> "" | n -> "-" + string n)) - names.[key] <- nm - basicNameCounts.[basicName] <- n + 1 - nm - ) - - member x.Reset () = - lock lockObj (fun () -> - basicNameCounts.Clear() - names.Clear() - ) - let rec synExprContainsError inpExpr = let rec walkBind (Binding(_, _, _, _, _, _, _, _, _, synExpr, _, _)) = walkExpr synExpr and walkExprs es = es |> List.exists walkExpr diff --git a/src/fsharp/fsi/fsi.fs b/src/fsharp/fsi/fsi.fs index 4660b2e481..aa1a55f949 100644 --- a/src/fsharp/fsi/fsi.fs +++ b/src/fsharp/fsi/fsi.fs @@ -953,13 +953,14 @@ type internal FsiDynamicCompiler outWriter: TextWriter, tcImports: TcImports, tcGlobals: TcGlobals, - ilGlobals: ILGlobals, fsiOptions : FsiCommandLineOptions, fsiConsoleOutput : FsiConsoleOutput, fsiCollectible: bool, niceNameGen, resolveAssemblyRef) = + let ilGlobals = tcGlobals.ilg + let outfile = "TMPFSCI.exe" let assemblyName = "FSI-ASSEMBLY" @@ -2512,8 +2513,6 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i with e -> stopProcessingRecovery e range0; failwithf "Error creating evaluation session: %A" e - let ilGlobals = tcGlobals.ilg - let niceNameGen = NiceNameGenerator() // Share intern'd strings across all lexing/parsing @@ -2534,21 +2533,21 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i match tcImports.TryFindExistingFullyQualifiedPathByExactAssemblyRef (ctok, aref) with | Some resolvedPath -> Some (Choice1Of2 resolvedPath) | None -> None - - let fsiDynamicCompiler = FsiDynamicCompiler(fsi, timeReporter, tcConfigB, tcLockObject, outWriter, tcImports, tcGlobals, ilGlobals, fsiOptions, fsiConsoleOutput, fsiCollectible, niceNameGen, resolveAssemblyRef) - - let fsiInterruptController = FsiInterruptController(fsiOptions, fsiConsoleOutput) - + + let fsiDynamicCompiler = FsiDynamicCompiler(fsi, timeReporter, tcConfigB, tcLockObject, outWriter, tcImports, tcGlobals, fsiOptions, fsiConsoleOutput, fsiCollectible, niceNameGen, resolveAssemblyRef) + + let fsiInterruptController = FsiInterruptController(fsiOptions, fsiConsoleOutput) + let uninstallMagicAssemblyResolution = MagicAssemblyResolution.Install(tcConfigB, tcImports, fsiDynamicCompiler, fsiConsoleOutput) - - /// This reference cell holds the most recent interactive state + + /// This reference cell holds the most recent interactive state let initialInteractiveState = fsiDynamicCompiler.GetInitialInteractiveState () let fsiStdinLexerProvider = FsiStdinLexerProvider(tcConfigB, fsiStdinSyphon, fsiConsoleInput, fsiConsoleOutput, fsiOptions, lexResourceManager) let fsiInteractionProcessor = FsiInteractionProcessor(fsi, tcConfigB, fsiOptions, fsiDynamicCompiler, fsiConsolePrompt, fsiConsoleOutput, fsiInterruptController, fsiStdinLexerProvider, lexResourceManager, initialInteractiveState) - let commitResult res = + let commitResult res = match res with | Choice1Of2 r -> r | Choice2Of2 None -> failwith "Operation failed. The error text has been printed in the error stream. To return the corresponding FSharpErrorInfo use the EvalInteractionNonThrowing, EvalScriptNonThrowing or EvalExpressionNonThrowing" diff --git a/src/fsharp/service/IncrementalBuild.fs b/src/fsharp/service/IncrementalBuild.fs index 69d416f992..24769360ae 100755 --- a/src/fsharp/service/IncrementalBuild.fs +++ b/src/fsharp/service/IncrementalBuild.fs @@ -1206,7 +1206,7 @@ type RawFSharpAssemblyDataBackedByLanguageService (tcConfig, tcGlobals, tcState: /// Manages an incremental build graph for the build of a single F# project type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInputs, nonFrameworkResolutions, unresolvedReferences, tcConfig: TcConfig, projectDirectory, outfile, - assemblyName, niceNameGen: Ast.NiceNameGenerator, lexResourceManager, + assemblyName, niceNameGen: NiceNameGenerator, lexResourceManager, sourceFiles, loadClosureOpt: LoadClosure option, keepAssemblyContents, keepAllBackgroundResolutions, maxTimeShareMilliseconds) = diff --git a/src/fsharp/service/ServiceDeclarationLists.fs b/src/fsharp/service/ServiceDeclarationLists.fs index b706a3835a..f06fc56ca2 100644 --- a/src/fsharp/service/ServiceDeclarationLists.fs +++ b/src/fsharp/service/ServiceDeclarationLists.fs @@ -630,7 +630,7 @@ type FSharpDeclarationListInfo(declarations: FSharpDeclarationListItem[], isForT let isActivePatternItem (items: CompletionItem list) = match items |> List.map (fun x -> x.Item) with - | [Item.Value vref] -> IsActivePatternName vref.CompiledName + | [Item.Value vref] -> IsActivePatternName (vref.CompiledName infoReader.g.CompilerGlobalState) | _ -> false items |> List.filter (fun (displayName, items) -> diff --git a/src/fsharp/symbols/Exprs.fs b/src/fsharp/symbols/Exprs.fs index e09e1d4df3..7941a6be57 100644 --- a/src/fsharp/symbols/Exprs.fs +++ b/src/fsharp/symbols/Exprs.fs @@ -915,7 +915,7 @@ module FSharpExprConvert = let ccu = nlr.EnclosingEntity.nlr.Ccu let vName = nlr.ItemKey.PartialKey.LogicalName // this is actually compiled name let findByName = - enclosingEntity.MembersOfFSharpTyconSorted |> List.filter (fun v -> v.CompiledName = vName) + enclosingEntity.MembersOfFSharpTyconSorted |> List.filter (fun v -> (v.CompiledName cenv.g.CompilerGlobalState) = vName) match findByName with | [v] -> makeFSCall isMember v @@ -925,7 +925,7 @@ module FSharpExprConvert = let findModuleMemberByName = enclosingEntity.ModuleOrNamespaceType.AllValsAndMembers |> Seq.filter (fun v -> - v.CompiledName = vName && + (v.CompiledName cenv.g.CompilerGlobalState) = vName && match v.DeclaringEntity with | Parent p -> p.PublicPath = enclosingEntity.PublicPath | _ -> false @@ -941,7 +941,7 @@ module FSharpExprConvert = let name = PrettyNaming.ChopPropertyName vName let findByName = enclosingEntity.ModuleOrNamespaceType.AllValsAndMembers - |> Seq.filter (fun v -> v.CompiledName = name) + |> Seq.filter (fun v -> (v.CompiledName cenv.g.CompilerGlobalState) = name) |> List.ofSeq match findByName with | [ v ] -> @@ -989,14 +989,14 @@ module FSharpExprConvert = match subClass with | Some name -> let ucref = UCRef(tcref, name) - let mkR = ConvUnionCaseRef cenv ucref + let mkR = ConvUnionCaseRef cenv ucref let objR = ConvLValueExpr cenv env callArgs.Head let projR = FSharpField(cenv, ucref, ucref.Index) E.UnionCaseGet(objR, typR, mkR, projR) | _ -> failwith "Failed to recognize union type member" else - let names = enclosingEntity.MembersOfFSharpTyconSorted |> List.map (fun v -> v.CompiledName) |> String.concat ", " + let names = enclosingEntity.MembersOfFSharpTyconSorted |> List.map (fun v -> v.CompiledName cenv.g.CompilerGlobalState) |> String.concat ", " failwithf "Member '%s' not found in type %s, found: %s" vName enclosingEntity.DisplayName names | _ -> // member is overloaded match nlr.ItemKey.TypeForLinkage with diff --git a/src/fsharp/symbols/SymbolHelpers.fs b/src/fsharp/symbols/SymbolHelpers.fs index 0547f759df..1440eef5a4 100644 --- a/src/fsharp/symbols/SymbolHelpers.fs +++ b/src/fsharp/symbols/SymbolHelpers.fs @@ -1302,14 +1302,14 @@ module internal SymbolHelpers = #endif /// Get the "F1 Keyword" associated with an item, for looking up documentatio help indexes on the web - let rec GetF1Keyword g item = + let rec GetF1Keyword (g: TcGlobals) item = let getKeywordForMethInfo (minfo : MethInfo) = match minfo with | FSMeth(_, _, vref, _) -> match vref.DeclaringEntity with | Parent tcref -> - (tcref |> ticksAndArgCountTextOfTyconRef)+"."+vref.CompiledName|> Some + (tcref |> ticksAndArgCountTextOfTyconRef) + "." + vref.CompiledName g.CompilerGlobalState |> Some | ParentNone -> None | ILMeth (_, minfo, _) -> @@ -1334,25 +1334,25 @@ module internal SymbolHelpers = | [] -> "" | l -> "``"+(List.length l).ToString() - sprintf "%s.%s%s" (tyconRef |> ticksAndArgCountTextOfTyconRef) v.CompiledName paramsString |> Some + sprintf "%s.%s%s" (tyconRef |> ticksAndArgCountTextOfTyconRef) (v.CompiledName g.CompilerGlobalState) paramsString |> Some else None - | Item.ActivePatternCase apref -> + | Item.ActivePatternCase apref -> GetF1Keyword g (Item.Value apref.ActivePatternVal) - | Item.UnionCase(ucinfo, _) -> - (ucinfo.TyconRef |> ticksAndArgCountTextOfTyconRef)+"."+ucinfo.Name |> Some + | Item.UnionCase(ucinfo, _) -> + (ucinfo.TyconRef |> ticksAndArgCountTextOfTyconRef) + "."+ucinfo.Name |> Some - | Item.RecdField rfi -> - (rfi.TyconRef |> ticksAndArgCountTextOfTyconRef)+"."+rfi.Name |> Some + | Item.RecdField rfi -> + (rfi.TyconRef |> ticksAndArgCountTextOfTyconRef) + "." + rfi.Name |> Some - | Item.AnonRecdField _ -> None + | Item.AnonRecdField _ -> None - | Item.ILField finfo -> + | Item.ILField finfo -> match finfo with | ILFieldInfo(tinfo, fdef) -> - (tinfo.TyconRefOfRawMetadata |> ticksAndArgCountTextOfTyconRef)+"."+fdef.Name |> Some + (tinfo.TyconRefOfRawMetadata |> ticksAndArgCountTextOfTyconRef) + "." + fdef.Name |> Some #if !NO_EXTENSIONTYPING | ProvidedField _ -> None #endif diff --git a/src/fsharp/symbols/Symbols.fs b/src/fsharp/symbols/Symbols.fs index 50368c3ca2..afc2f2e4b2 100644 --- a/src/fsharp/symbols/Symbols.fs +++ b/src/fsharp/symbols/Symbols.fs @@ -814,12 +814,11 @@ and FSharpUnionCase(cenv, v: UnionCaseRef) = match other with | :? FSharpUnionCase as uc -> v === uc.V | _ -> false - + override x.GetHashCode() = hash v.CaseName override x.ToString() = x.CompiledName - and FSharpFieldData = | AnonField of AnonRecdTypeInfo * TTypes * int * range | ILField of ILFieldInfo @@ -1740,7 +1739,7 @@ and FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) = member x.CompiledName = checkIsResolved() match fsharpInfo() with - | Some v -> v.CompiledName + | Some v -> v.CompiledName cenv.g.CompilerGlobalState | None -> x.LogicalName member __.LogicalName = @@ -2007,7 +2006,7 @@ and FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) = override x.ToString() = try let prefix = (if x.IsEvent then "event " elif x.IsProperty then "property " elif x.IsMember then "member " else "val ") - prefix + x.LogicalName + prefix + x.LogicalName with _ -> "??" member x.FormatLayout (denv:FSharpDisplayContext) = diff --git a/src/fsharp/tast.fs b/src/fsharp/tast.fs index 98a8710afb..dd8f0506f7 100644 --- a/src/fsharp/tast.fs +++ b/src/fsharp/tast.fs @@ -44,14 +44,6 @@ type Stamp = int64 //++GLOBAL MUTABLE STATE (concurrency-safe) let newStamp = let i = ref 0L in fun () -> System.Threading.Interlocked.Increment i -/// A global generator of compiler generated names -// ++GLOBAL MUTABLE STATE (concurrency safe by locking inside NiceNameGenerator) -let globalNng = NiceNameGenerator() - -/// A global generator of stable compiler generated names -// ++GLOBAL MUTABLE STATE (concurrency safe by locking inside StableNiceNameGenerator) -let globalStableNameGenerator = StableNiceNameGenerator () - type StampMap<'T> = Map //------------------------------------------------------------------------- @@ -2543,8 +2535,7 @@ and and ValData = Val and [] Val = - { - /// Mutable for unpickle linkage + { /// Mutable for unpickle linkage mutable val_logical_name: string /// Mutable for unpickle linkage @@ -2555,12 +2546,12 @@ and [] /// Mutable for unpickle linkage mutable val_stamp: Stamp - /// See vflags section further below for encoding/decodings here + /// See vflags section further below for encoding/decodings here mutable val_flags: ValFlags - - mutable val_opt_data: ValOptionalData option } - static member NewEmptyValOptData() = + mutable val_opt_data: ValOptionalData option } + + static member NewEmptyValOptData() = { val_compiled_name = None val_other_range = None val_const = None @@ -2888,7 +2879,7 @@ and [] /// - If this is an implementation of an abstract slot then this may be a mangled name /// - If this is an extension member then this will be a mangled name /// - If this is an operator then this is 'op_Addition' - member x.CompiledName = + member x.CompiledName (compilerGlobalState:CompilerGlobalState option) = let givenName = match x.val_opt_data with | Some { val_compiled_name = Some n } -> n @@ -2907,10 +2898,10 @@ and [] // let dt = System.DateTime.Now - System.DateTime.Now // IsMemberOrModuleBinding = false, IsCompiledAsTopLevel = true, IsMember = false, CompilerGenerated=true // // However we don't need this for CompilerGenerated members such as the implementations of IComparable - if x.IsCompiledAsTopLevel && not x.IsMember && (x.IsCompilerGenerated || not x.IsMemberOrModuleBinding) then - globalStableNameGenerator.GetUniqueCompilerGeneratedName(givenName, x.Range, x.Stamp) - else - givenName + match compilerGlobalState with + | Some state when x.IsCompiledAsTopLevel && not x.IsMember && (x.IsCompilerGenerated || not x.IsMemberOrModuleBinding) -> + state.StableNameGenerator.GetUniqueCompilerGeneratedName(givenName, x.Range, x.Stamp) + | _ -> givenName /// The name of the property. /// - If this is a property then this is 'Foo' @@ -4561,7 +4552,7 @@ and [] member x.DebugText = x.ToString() - override x.ToString() = sprintf "TBind(%s, ...)" x.Var.CompiledName + override x.ToString() = sprintf "TBind(%s, ...)" (x.Var.CompiledName None) /// Represents a reference to an active pattern element. The /// integer indicates which choice in the target set is being selected by this item. @@ -5764,16 +5755,16 @@ 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 = + konst, actualParent) : Val = let stamp = newStamp() - Val.New - { 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 = + Val.New { + 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 | _ -> @@ -5788,11 +5779,9 @@ let NewVal val_attribs = attribs } } - /// Create the new contents of an overall assembly let NewCcuContents sref m nm mty = NewModuleOrNamespace (Some(CompPath(sref, []))) taccessPublic (ident(nm, m)) XmlDoc.Empty [] (MaybeLazy.Strict mty) - //-------------------------------------------------------------------------- // Cloning and adjusting diff --git a/tests/fsharpqa/Source/Optimizations/Inlining/env.lst b/tests/fsharpqa/Source/Optimizations/Inlining/env.lst index 9e92d0998c..9c95c7c654 100644 --- a/tests/fsharpqa/Source/Optimizations/Inlining/env.lst +++ b/tests/fsharpqa/Source/Optimizations/Inlining/env.lst @@ -1,4 +1,3 @@ -# flaky test: https://github.com/Microsoft/visualfsharp/issues/6657 -#NoMT SOURCE=Match01.fs SCFLAGS="-a --optimize+" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Match01.dll" # Match01.fs +NoMT SOURCE=Match01.fs SCFLAGS="-a --optimize+" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Match01.dll" # Match01.fs NoMT SOURCE=Match02.fs SCFLAGS="-a --optimize+" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Match02.dll" # Match02.fs NoMT SOURCE=StructUnion01.fs SCFLAGS="-a --optimize+" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd StructUnion01.dll" # StructUnion01.fs From db261ec9e21084a5b19fc12d872a8438b6b8d9e3 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" Date: Mon, 13 May 2019 17:54:15 +0000 Subject: [PATCH 029/159] [master] Update dependencies from dotnet/arcade (#6714) * Update dependencies from https://github.com/dotnet/arcade build 20190511.1 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19261.1 * Update dependencies from https://github.com/dotnet/arcade build 20190512.1 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19262.1 --- eng/Version.Details.xml | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index d89f383bc3..5620d06606 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - 810920cf8a5fc183585304193f8b4e4e189497e9 + 30682cda0dd7ca1765463749dd91ec3cfec75eb9 diff --git a/global.json b/global.json index 671e475276..bd5bb77530 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19260.2", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19262.1", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 8d4f1507e04aaea8db734a12913e800c6d82405f Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Mon, 13 May 2019 22:26:53 +0300 Subject: [PATCH 030/159] Check constructor in FSharpMemberOrFunctionOrValue..ctor(cenv, minfo) (#6710) --- src/fsharp/symbols/Symbols.fs | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/fsharp/symbols/Symbols.fs b/src/fsharp/symbols/Symbols.fs index afc2f2e4b2..d80beda39c 100644 --- a/src/fsharp/symbols/Symbols.fs +++ b/src/fsharp/symbols/Symbols.fs @@ -1,4 +1,4 @@ -// 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. namespace FSharp.Compiler.SourceCodeServices @@ -1393,7 +1393,12 @@ and FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) = let mkEventSym einfo = FSharpMemberOrFunctionOrValue(cenv, E einfo, Item.Event einfo) new (cenv, vref) = FSharpMemberFunctionOrValue(cenv, V vref, Item.Value vref) - new (cenv, minfo) = FSharpMemberFunctionOrValue(cenv, M minfo, Item.MethodGroup(minfo.LogicalName, [minfo], None)) + + new (cenv, minfo: MethInfo) = + if minfo.IsConstructor || minfo.IsClassConstructor then + FSharpMemberFunctionOrValue(cenv, C minfo, Item.CtorGroup(minfo.LogicalName, [minfo])) + else + FSharpMemberFunctionOrValue(cenv, M minfo, Item.MethodGroup(minfo.LogicalName, [minfo], None)) member __.IsUnresolved = isUnresolved() @@ -1407,16 +1412,22 @@ and FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) = member x.Overloads matchParameterNumber = checkIsResolved() match d with - | M m -> + | M m | C m -> match item with - | Item.MethodGroup (_name, methodInfos, _) -> + | Item.MethodGroup (_, methodInfos, _) + | Item.CtorGroup (_, methodInfos) -> + let isConstructor = x.IsConstructor let methods = if matchParameterNumber then methodInfos |> List.filter (fun methodInfo -> not (methodInfo.NumArgs = m.NumArgs) ) else methodInfos methods - |> List.map (fun mi -> FSharpMemberOrFunctionOrValue(cenv, M mi, item)) + |> List.map (fun mi -> + if isConstructor then + FSharpMemberOrFunctionOrValue(cenv, C mi, item) + else + FSharpMemberOrFunctionOrValue(cenv, M mi, item)) |> makeReadOnlyCollection |> Some | _ -> None @@ -1997,7 +2008,8 @@ and FSharpMemberOrFunctionOrValue(cenv, d:FSharpMemberOrValData, item) = match d, other.Data with | E evt1, E evt2 -> EventInfo.EventInfosUseIdenticalDefintions evt1 evt2 | P p1, P p2 -> PropInfo.PropInfosUseIdenticalDefinitions p1 p2 - | M m1, M m2 -> MethInfo.MethInfosUseIdenticalDefinitions m1 m2 + | M m1, M m2 + | C m1, C m2 -> MethInfo.MethInfosUseIdenticalDefinitions m1 m2 | V v1, V v2 -> valRefEq cenv.g v1 v2 | _ -> false | _ -> false From 4a169348ed03f6184d8278c69d01dce7ef0dbf43 Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Tue, 14 May 2019 06:19:39 +0300 Subject: [PATCH 031/159] Add Debug/Release configuration subfolders for FCS outputs (#6722) --- fcs/Directory.Build.props | 4 ++-- .../FSharp.Compiler.Service.ProjectCracker.fsproj | 4 ++-- fcs/build.fsx | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fcs/Directory.Build.props b/fcs/Directory.Build.props index 50e4c3e67b..c56fd7cba6 100644 --- a/fcs/Directory.Build.props +++ b/fcs/Directory.Build.props @@ -16,8 +16,8 @@ $(MSBuildThisFileDirectory)..\artifacts $(ArtifactsDir)\bin $(ArtifactsDir)\obj - $(ArtifactsBinDir)\fcs - $(ArtifactsObjDir)\fcs + $(ArtifactsBinDir)\fcs\$(Configuration) + $(ArtifactsObjDir)\fcs\$(Configuration) true 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 a9cb30ba0f..1a4171e13a 100644 --- a/fcs/FSharp.Compiler.Service.ProjectCracker/FSharp.Compiler.Service.ProjectCracker.fsproj +++ b/fcs/FSharp.Compiler.Service.ProjectCracker/FSharp.Compiler.Service.ProjectCracker.fsproj @@ -20,8 +20,8 @@ - - + + diff --git a/fcs/build.fsx b/fcs/build.fsx index 5ecc9cd2bb..ec53ced9c2 100644 --- a/fcs/build.fsx +++ b/fcs/build.fsx @@ -61,7 +61,7 @@ let runCmdIn workDir (exe:string) = Printf.ksprintf (fun (args:string) -> // The rest of the code is standard F# build script // -------------------------------------------------------------------------------------- -let releaseDir = Path.Combine(__SOURCE_DIRECTORY__, "../artifacts/bin/fcs") +let releaseDir = Path.Combine(__SOURCE_DIRECTORY__, "../artifacts/bin/fcs/Release") // Read release notes & version info from RELEASE_NOTES.md let release = LoadReleaseNotes (__SOURCE_DIRECTORY__ + "/RELEASE_NOTES.md") From d5f2e193397b65268e1daf7e34a6a6a83f69d28f Mon Sep 17 00:00:00 2001 From: dotnet-maestro <@dotnet-maestro> Date: Tue, 14 May 2019 12:24:24 +0000 Subject: [PATCH 032/159] Update dependencies from https://github.com/dotnet/arcade build 20190513.3 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19263.3 --- eng/Version.Details.xml | 4 ++-- eng/common/darc-init.ps1 | 4 ++-- eng/common/darc-init.sh | 4 ++-- global.json | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 5620d06606..bd7139dc18 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - 30682cda0dd7ca1765463749dd91ec3cfec75eb9 + e6712584bba6e2f0e35a3704793c459ff97c09af diff --git a/eng/common/darc-init.ps1 b/eng/common/darc-init.ps1 index 81ffd16779..823d72a372 100644 --- a/eng/common/darc-init.ps1 +++ b/eng/common/darc-init.ps1 @@ -19,10 +19,10 @@ function InstallDarcCli ($darcVersion) { # Until we can anonymously query the BAR API for the latest arcade-services # build applied to the PROD channel, this is hardcoded. if (-not $darcVersion) { - $darcVersion = '1.1.0-beta.19205.4' + $darcVersion = '1.1.0-beta.19258.3' } - $arcadeServicesSource = 'https://dotnetfeed.blob.core.windows.net/dotnet-arcade/index.json' + $arcadeServicesSource = 'https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json' Write-Host "Installing Darc CLI version $darcVersion..." Write-Host "You may need to restart your command window if this is the first dotnet tool you have installed." diff --git a/eng/common/darc-init.sh b/eng/common/darc-init.sh index bd7eb46398..36d675738b 100644 --- a/eng/common/darc-init.sh +++ b/eng/common/darc-init.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash source="${BASH_SOURCE[0]}" -darcVersion="1.1.0-beta.19205.4" +darcVersion="1.1.0-beta.19258.3" while [[ $# > 0 ]]; do opt="$(echo "$1" | awk '{print tolower($0)}')" @@ -45,7 +45,7 @@ function InstallDarcCli { echo $($dotnet_root/dotnet tool uninstall $darc_cli_package_name -g) fi - local arcadeServicesSource="https://dotnetfeed.blob.core.windows.net/dotnet-arcade/index.json" + local arcadeServicesSource="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" echo "Installing Darc CLI version $toolset_version..." echo "You may need to restart your command shell if this is the first dotnet tool you have installed." diff --git a/global.json b/global.json index bd5bb77530..39ca4e6981 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19262.1", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19263.3", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 0d13f598fe7251d2986dfc4bdc4c5267f0613316 Mon Sep 17 00:00:00 2001 From: Will Smith Date: Tue, 14 May 2019 13:26:44 -0700 Subject: [PATCH 033/159] Changed cancellation strategy for project options (#6723) * Trying to fix script performance * Changed cancellation strategy * Added back cancellationToken --- src/fsharp/service/service.fs | 4 +- .../FSharpProjectOptionsManager.fs | 91 ++++++++++--------- 2 files changed, 49 insertions(+), 46 deletions(-) diff --git a/src/fsharp/service/service.fs b/src/fsharp/service/service.fs index ea4de105c7..3ca4f8a248 100644 --- a/src/fsharp/service/service.fs +++ b/src/fsharp/service/service.fs @@ -2431,11 +2431,11 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC RequireCompilationThread ctok match incrementalBuildersCache.TryGet (ctok, options) with | Some (builderOpt,creationErrors,_) -> - Logger.Log LogCompilerFunctionId.Service_IncrementalBuildersCache_BuildingNewCache + Logger.Log LogCompilerFunctionId.Service_IncrementalBuildersCache_GettingCache let decrement = IncrementalBuilder.KeepBuilderAlive builderOpt return builderOpt,creationErrors, decrement | None -> - Logger.Log LogCompilerFunctionId.Service_IncrementalBuildersCache_GettingCache + Logger.Log LogCompilerFunctionId.Service_IncrementalBuildersCache_BuildingNewCache let! (builderOpt,creationErrors,_) as info = CreateOneIncrementalBuilder (ctok, options, userOpName) incrementalBuildersCache.Set (ctok, options, info) let decrement = IncrementalBuilder.KeepBuilderAlive builderOpt diff --git a/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs b/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs index a14ef35873..288f2a4dca 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs @@ -115,16 +115,15 @@ type private FSharpProjectOptionsReactor (workspace: VisualStudioWorkspaceImpl, let cpsCommandLineOptions = new ConcurrentDictionary() let cache = Dictionary() - let singleFileCache = Dictionary() + let singleFileCache = Dictionary() - let rec tryComputeOptionsByFile (document: Document) cancellationToken (loadTime: DateTime option) = + let rec tryComputeOptionsByFile (document: Document) (ct: CancellationToken) = async { - let! fileStamp = document.GetTextVersionAsync(cancellationToken) |> Async.AwaitTask + let! fileStamp = document.GetTextVersionAsync(ct) |> Async.AwaitTask match singleFileCache.TryGetValue(document.Id) with | false, _ -> - let! sourceText = document.GetTextAsync(cancellationToken) |> Async.AwaitTask - let loadTime = defaultArg loadTime DateTime.Now - let! scriptProjectOptions, _ = checkerProvider.Checker.GetProjectOptionsFromScript(document.FilePath, sourceText.ToFSharpSourceText(), loadTime) + let! sourceText = document.GetTextAsync(ct) |> Async.AwaitTask + let! scriptProjectOptions, _ = checkerProvider.Checker.GetProjectOptionsFromScript(document.FilePath, sourceText.ToFSharpSourceText()) let projectOptions = if isScriptFile document.FilePath then scriptProjectOptions @@ -144,25 +143,23 @@ type private FSharpProjectOptionsReactor (workspace: VisualStudioWorkspaceImpl, Stamp = Some(int64 (fileStamp.GetHashCode())) } - cancellationToken.ThrowIfCancellationRequested() - checkerProvider.Checker.CheckProjectInBackground(projectOptions, userOpName="checkOptions") let parsingOptions, _ = checkerProvider.Checker.GetParsingOptionsFromProjectOptions(projectOptions) - singleFileCache.[document.Id] <- (fileStamp, loadTime, parsingOptions, projectOptions) + singleFileCache.[document.Id] <- (fileStamp, parsingOptions, projectOptions) return Some(parsingOptions, projectOptions) - | true, (fileStamp2, loadTime2, parsingOptions, projectOptions) -> + | true, (fileStamp2, parsingOptions, projectOptions) -> if fileStamp <> fileStamp2 then singleFileCache.Remove(document.Id) |> ignore - return! tryComputeOptionsByFile document cancellationToken (Some loadTime2) + return! tryComputeOptionsByFile document ct else return Some(parsingOptions, projectOptions) } - let rec tryComputeOptions (project: Project) (cancellationToken: CancellationToken) = + let rec tryComputeOptions (project: Project) = async { let projectId = project.Id match cache.TryGetValue(projectId) with @@ -178,7 +175,7 @@ type private FSharpProjectOptionsReactor (workspace: VisualStudioWorkspaceImpl, for projectReference in project.ProjectReferences do let referencedProject = project.Solution.GetProject(projectReference.ProjectId) if referencedProject.Language = FSharpConstants.FSharpLanguageName then - match! tryComputeOptions referencedProject cancellationToken with + match! tryComputeOptions referencedProject with | None -> canBail <- true | Some(_, projectOptions) -> referencedProjects.Add(referencedProject.OutputFilePath, projectOptions) @@ -228,8 +225,6 @@ type private FSharpProjectOptionsReactor (workspace: VisualStudioWorkspaceImpl, Stamp = Some(int64 (project.Version.GetHashCode())) } - cancellationToken.ThrowIfCancellationRequested() - // This can happen if we didn't receive the callback from HandleCommandLineChanges yet. if Array.isEmpty projectOptions.SourceFiles then return None @@ -245,7 +240,7 @@ type private FSharpProjectOptionsReactor (workspace: VisualStudioWorkspaceImpl, | true, (oldProject, parsingOptions, projectOptions) -> if isProjectInvalidated oldProject project settings then cache.Remove(projectId) |> ignore - return! tryComputeOptions project cancellationToken + return! tryComputeOptions project else return Some(parsingOptions, projectOptions) } @@ -254,30 +249,38 @@ type private FSharpProjectOptionsReactor (workspace: VisualStudioWorkspaceImpl, async { while true do match! agent.Receive() with - | FSharpProjectOptionsMessage.TryGetOptionsByDocument(document, reply, cancellationToken) -> - try - // For now, disallow miscellaneous workspace since we are using the hacky F# miscellaneous files project. - if document.Project.Solution.Workspace.Kind = WorkspaceKind.MiscellaneousFiles then - reply.Reply(None) - elif document.Project.Name = FSharpConstants.FSharpMiscellaneousFilesName then - let! options = tryComputeOptionsByFile document cancellationToken None - reply.Reply(options) - else - let! options = tryComputeOptions document.Project cancellationToken - reply.Reply(options) - with - | _ -> - reply.Reply(None) - | FSharpProjectOptionsMessage.TryGetOptionsByProject(project, reply, cancellationToken) -> - try - if project.Solution.Workspace.Kind = WorkspaceKind.MiscellaneousFiles || project.Name = FSharpConstants.FSharpMiscellaneousFilesName then - reply.Reply(None) - else - let! options = tryComputeOptions project cancellationToken - reply.Reply(options) - with - | _ -> - reply.Reply(None) + | FSharpProjectOptionsMessage.TryGetOptionsByDocument(document, reply, ct) -> + if ct.IsCancellationRequested then + reply.Reply None + else + try + // For now, disallow miscellaneous workspace since we are using the hacky F# miscellaneous files project. + if document.Project.Solution.Workspace.Kind = WorkspaceKind.MiscellaneousFiles then + reply.Reply None + elif document.Project.Name = FSharpConstants.FSharpMiscellaneousFilesName then + let! options = tryComputeOptionsByFile document ct + reply.Reply options + else + let! options = tryComputeOptions document.Project + reply.Reply options + with + | _ -> + reply.Reply None + + | FSharpProjectOptionsMessage.TryGetOptionsByProject(project, reply, ct) -> + if ct.IsCancellationRequested then + reply.Reply None + else + try + if project.Solution.Workspace.Kind = WorkspaceKind.MiscellaneousFiles || project.Name = FSharpConstants.FSharpMiscellaneousFilesName then + reply.Reply None + else + let! options = tryComputeOptions project + reply.Reply options + with + | _ -> + reply.Reply None + | FSharpProjectOptionsMessage.ClearOptions(projectId) -> cache.Remove(projectId) |> ignore | FSharpProjectOptionsMessage.ClearSingleFileOptionsCache(documentId) -> @@ -286,11 +289,11 @@ type private FSharpProjectOptionsReactor (workspace: VisualStudioWorkspaceImpl, let agent = MailboxProcessor.Start((fun agent -> loop agent), cancellationToken = cancellationTokenSource.Token) - member __.TryGetOptionsByProjectAsync(project, cancellationToken) = - agent.PostAndAsyncReply(fun reply -> FSharpProjectOptionsMessage.TryGetOptionsByProject(project, reply, cancellationToken)) + member __.TryGetOptionsByProjectAsync(project, ct) = + agent.PostAndAsyncReply(fun reply -> FSharpProjectOptionsMessage.TryGetOptionsByProject(project, reply, ct)) - member __.TryGetOptionsByDocumentAsync(document, cancellationToken) = - agent.PostAndAsyncReply(fun reply -> FSharpProjectOptionsMessage.TryGetOptionsByDocument(document, reply, cancellationToken)) + member __.TryGetOptionsByDocumentAsync(document, ct) = + agent.PostAndAsyncReply(fun reply -> FSharpProjectOptionsMessage.TryGetOptionsByDocument(document, reply, ct)) member __.ClearOptionsByProjectId(projectId) = agent.Post(FSharpProjectOptionsMessage.ClearOptions(projectId)) From 68f766fe209b562864b6cc608afb376cf1ea3753 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Tue, 14 May 2019 14:16:38 -0700 Subject: [PATCH 034/159] normalize package version variables (#6733) --- .../CompilerServiceBenchmarks.fsproj | 2 +- eng/Versions.props | 196 +++++++++--------- .../Microsoft.FSharp.Compiler.MSBuild.csproj | 4 +- src/fsharp/FSharp.Build/FSharp.Build.fsproj | 12 +- ...Sharp.Compiler.Interactive.Settings.fsproj | 2 +- .../FSharp.Compiler.Private.fsproj | 48 ++--- src/fsharp/FSharp.Core/FSharp.Core.fsproj | 10 +- src/fsharp/fsc/fsc.fsproj | 10 +- src/fsharp/fsi/fsi.fsproj | 16 +- tests/Directory.Build.targets | 8 +- .../FSharp.Build.UnitTests.fsproj | 12 +- .../FSharp.Core.UnitTests.fsproj | 2 +- tests/fsharp/FSharpSuite.Tests.fsproj | 12 +- vsintegration/Directory.Build.targets | 16 +- .../LanguageServiceProfiling.fsproj | 2 +- .../VisualFSharpFull/VisualFSharpFull.csproj | 6 +- .../src/FSharp.Editor/FSharp.Editor.fsproj | 58 +++--- .../FSharp.LanguageService.Base.csproj | 32 +-- .../FSharp.LanguageService.fsproj | 46 ++-- .../Project/ProjectBase.files | 12 +- .../Project/ProjectSystem.Base.csproj | 34 +-- .../ProjectSystem.fsproj | 38 ++-- .../FSharp.PropertiesPages.vbproj | 30 +-- .../src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj | 36 ++-- .../GetTypesVS.UnitTests.fsproj | 8 +- .../tests/Salsa/VisualFSharp.Salsa.fsproj | 36 ++-- .../UnitTests/VisualFSharp.UnitTests.fsproj | 68 +++--- 27 files changed, 378 insertions(+), 378 deletions(-) diff --git a/benchmarks/CompilerServiceBenchmarks/CompilerServiceBenchmarks.fsproj b/benchmarks/CompilerServiceBenchmarks/CompilerServiceBenchmarks.fsproj index 513ff0d4ec..2fb509e4c1 100644 --- a/benchmarks/CompilerServiceBenchmarks/CompilerServiceBenchmarks.fsproj +++ b/benchmarks/CompilerServiceBenchmarks/CompilerServiceBenchmarks.fsproj @@ -9,7 +9,7 @@ net472 true true - $(SystemValueTuplePackageVersion) + $(SystemValueTupleVersion) diff --git a/eng/Versions.props b/eng/Versions.props index e8a90e3946..b7706f695e 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -74,114 +74,114 @@ https://vside.myget.org/F/devcore/api/v3/index.json; - $([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)..\RoslynPackageVersion.txt').Trim()) + $([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)..\RoslynPackageVersion.txt').Trim()) - 1.5.0 - 4.3.0 - 4.0.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.5.2 - 4.3.0 - 4.3.0 - 4.3.0 - 1.6.0 - 4.3.0 - 1.5.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.3.0 - 4.4.0 + 1.5.0 + 4.3.0 + 4.0.0 + 4.3.0 + 4.3.0 + 4.3.0 + 4.3.0 + 4.3.0 + 4.5.2 + 4.3.0 + 4.3.0 + 4.3.0 + 1.6.0 + 4.3.0 + 1.5.0 + 4.3.0 + 4.3.0 + 4.3.0 + 4.3.0 + 4.3.0 + 4.3.0 + 4.3.0 + 4.3.0 + 4.3.0 + 4.3.0 + 4.4.0 - $(RoslynPackageVersion) - $(RoslynPackageVersion) - $(RoslynPackageVersion) - $(RoslynPackageVersion) - $(RoslynPackageVersion) + $(RoslynVersion) + $(RoslynVersion) + $(RoslynVersion) + $(RoslynVersion) + $(RoslynVersion) 16.0.461 - $(MicrosoftBuildOverallPackagesVersion) - $(MicrosoftBuildOverallPackagesVersion) - $(MicrosoftBuildOverallPackagesVersion) - $(MicrosoftBuildOverallPackagesVersion) + $(MicrosoftBuildOverallPackagesVersion) + $(MicrosoftBuildOverallPackagesVersion) + $(MicrosoftBuildOverallPackagesVersion) + $(MicrosoftBuildOverallPackagesVersion) - 8.0.1 - 14.0.25420 - 16.0.467 - 16.0.467 - 1.1.4322 - 16.0.467 - 16.0.28727 - 16.0.28729 - 16.0.467 - 16.0.467 - 16.0.467 - 8.0.50728 - 7.10.6071 - 16.0.28729 - 8.0.50728 + 8.0.1 + 14.0.25420 + 16.0.467 + 16.0.467 + 1.1.4322 + 16.0.467 + 16.0.28727 + 16.0.28729 + 16.0.467 + 16.0.467 + 16.0.467 + 8.0.50728 + 7.10.6071 + 16.0.28729 + 8.0.50728 16.0.201-pre-g7d366164d0 2.3.6152103 - 14.3.25407 - 16.0.28729 - 16.0.28729 - 16.0.28729 - 10.0.30319 - 11.0.50727 - 15.0.25123-Dev15Preview - 7.10.6072 - 8.0.50728 - 9.0.30730 - 10.0.30320 - 11.0.61031 - 12.0.30111 - 16.0.467 - 7.10.6071 - 8.0.50728 - 10.0.30320 - 12.0.30112 - 16.0.467 - 16.0.467 - 16.0.102 - 16.0.28729 - 15.3.58 - 9.0.30729 + 14.3.25407 + 16.0.28729 + 16.0.28729 + 16.0.28729 + 10.0.30319 + 11.0.50727 + 15.0.25123-Dev15Preview + 7.10.6072 + 8.0.50728 + 9.0.30730 + 10.0.30320 + 11.0.61031 + 12.0.30111 + 16.0.467 + 7.10.6071 + 8.0.50728 + 10.0.30320 + 12.0.30112 + 16.0.467 + 16.0.467 + 16.0.102 + 16.0.28729 + 15.3.58 + 9.0.30729 16.0.2264 - 12.0.4 - 7.0.4 - 8.0.4 - 11.0.4 - 7.0.4 + 12.0.4 + 7.0.4 + 8.0.4 + 11.0.4 + 7.0.4 - 0.2.0 - 1.0.0 - 1.0.147 + 0.2.0 + 1.0.0 + 1.0.147 - 3.0.0-alpha4 + 3.0.0-alpha4 4.3.0.0 - 1.0.30 - 8.0.0-alpha - 2.7.0 - 2.0.3 - 15.8.0 - 1.0.0 - 4.3.0 - 9.0.1 - 3.11.0 - 3.11.2 - 3.11.0 - 2.1.36 - 1.0.0-beta2-dev3 - 5.22.2.1 + 1.0.30 + 8.0.0-alpha + 2.7.0 + 2.0.3 + 15.8.0 + 1.0.0 + 4.3.0 + 9.0.1 + 3.11.0 + 3.11.2 + 3.11.0 + 2.1.36 + 1.0.0-beta2-dev3 + 5.22.2.1 diff --git a/setup/Swix/Microsoft.FSharp.Compiler.MSBuild/Microsoft.FSharp.Compiler.MSBuild.csproj b/setup/Swix/Microsoft.FSharp.Compiler.MSBuild/Microsoft.FSharp.Compiler.MSBuild.csproj index a702f82771..cc9d75a288 100644 --- a/setup/Swix/Microsoft.FSharp.Compiler.MSBuild/Microsoft.FSharp.Compiler.MSBuild.csproj +++ b/setup/Swix/Microsoft.FSharp.Compiler.MSBuild/Microsoft.FSharp.Compiler.MSBuild.csproj @@ -16,7 +16,7 @@ - + diff --git a/src/fsharp/fsc/fsc.fsproj b/src/fsharp/fsc/fsc.fsproj index 8ddb082c56..9cec3fb314 100644 --- a/src/fsharp/fsc/fsc.fsproj +++ b/src/fsharp/fsc/fsc.fsproj @@ -35,11 +35,11 @@ - - - - - + + + + + diff --git a/src/fsharp/fsi/fsi.fsproj b/src/fsharp/fsi/fsi.fsproj index a7bafddfde..4b92a354ab 100644 --- a/src/fsharp/fsi/fsi.fsproj +++ b/src/fsharp/fsi/fsi.fsproj @@ -43,14 +43,14 @@ - - - - - - - - + + + + + + + + diff --git a/tests/Directory.Build.targets b/tests/Directory.Build.targets index 4bf59eb4aa..e28338a5d4 100644 --- a/tests/Directory.Build.targets +++ b/tests/Directory.Build.targets @@ -3,10 +3,10 @@ - - - - + + + + diff --git a/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj b/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj index cc43c8810f..7c6ea79b38 100644 --- a/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj +++ b/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj @@ -20,15 +20,15 @@ - + - - - - - + + + + + diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj b/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj index 9724cf930c..24a2132e9c 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj +++ b/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj @@ -90,7 +90,7 @@ - + diff --git a/tests/fsharp/FSharpSuite.Tests.fsproj b/tests/fsharp/FSharpSuite.Tests.fsproj index 44645a569b..56240b466b 100644 --- a/tests/fsharp/FSharpSuite.Tests.fsproj +++ b/tests/fsharp/FSharpSuite.Tests.fsproj @@ -51,12 +51,12 @@ - - - - - - + + + + + + diff --git a/vsintegration/Directory.Build.targets b/vsintegration/Directory.Build.targets index af547ce3c0..bc5c6d7195 100644 --- a/vsintegration/Directory.Build.targets +++ b/vsintegration/Directory.Build.targets @@ -7,17 +7,17 @@ - - - - - + + + + + - - - + + + diff --git a/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj b/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj index a61ba873ce..1b2f4b81dd 100644 --- a/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj +++ b/vsintegration/Utils/LanguageServiceProfiling/LanguageServiceProfiling.fsproj @@ -5,7 +5,7 @@ Exe true true - $(SystemValueTuplePackageVersion) + $(SystemValueTupleVersion) true diff --git a/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj b/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj index dc670ae39f..cfe668403c 100644 --- a/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj +++ b/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj @@ -23,7 +23,7 @@ License.txt true - + PreserveNewest FSharp.Data.TypeProviders.dll true @@ -259,8 +259,8 @@ - - + + diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index 5f78b10980..575f038d01 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -8,7 +8,7 @@ $(NoWarn);44 true true - $(SystemValueTuplePackageVersion) + $(SystemValueTupleVersion) $(OtherFlags) --warnon:1182 --subsystemversion:6.00 false @@ -131,36 +131,36 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj b/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj index 58115e56eb..9396c8c41b 100644 --- a/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj +++ b/vsintegration/src/FSharp.LanguageService.Base/FSharp.LanguageService.Base.csproj @@ -46,22 +46,22 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj index 77dfb2dcc1..cf72f55216 100644 --- a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj +++ b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj @@ -8,7 +8,7 @@ $(NoWarn);44 true true - $(SystemValueTuplePackageVersion) + $(SystemValueTupleVersion) $(OtherFlags) --warnon:1182 --subsystemversion:6.00 false @@ -59,28 +59,28 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectBase.files b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectBase.files index 09bea264a0..4343af2f32 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectBase.files +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectBase.files @@ -16,22 +16,22 @@ global - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Framework.$(MicrosoftBuildFrameworkPackageVersion)\lib\net46\Microsoft.Build.Framework.dll + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Framework.$(MicrosoftBuildFrameworkVersion)\lib\net46\Microsoft.Build.Framework.dll - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.$(MicrosoftBuildPackageVersion)\lib\net46\Microsoft.Build.dll + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.$(MicrosoftBuildVersion)\lib\net46\Microsoft.Build.dll - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Utilities.Core.$(MicrosoftBuildUtilitiesCorePackageVersion)\lib\net46\Microsoft.Build.Utilities.Core.dll + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Utilities.Core.$(MicrosoftBuildUtilitiesCoreVersion)\lib\net46\Microsoft.Build.Utilities.Core.dll - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Tasks.Core.$(MicrosoftBuildTasksCorePackageVersion)\lib\net46\Microsoft.Build.Tasks.Core.dll + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Tasks.Core.$(MicrosoftBuildTasksCoreVersion)\lib\net46\Microsoft.Build.Tasks.Core.dll - $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Tasks.Core.$(MicrosoftBuildTasksCorePackageVersion)\lib\net46\Microsoft.Build.Tasks.Core.dll + $(FSharpSourcesRoot)\..\packages\Microsoft.Build.Tasks.Core.$(MicrosoftBuildTasksCoreVersion)\lib\net46\Microsoft.Build.Tasks.Core.dll - $(FSharpSourcesRoot)\..\packages\System.IO.Compression.$(SystemIoCompressionPackageVersion)\lib\net46\System.IO.Compression.dll + $(FSharpSourcesRoot)\..\packages\System.IO.Compression.$(SystemIoCompressionVersion)\lib\net46\System.IO.Compression.dll diff --git a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj index 9e3ebadbb0..1604a94f3b 100644 --- a/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj +++ b/vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj @@ -44,23 +44,23 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj b/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj index 6c2b609140..a161faab96 100644 --- a/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj +++ b/vsintegration/src/FSharp.ProjectSystem.FSharp/ProjectSystem.fsproj @@ -8,7 +8,7 @@ $(NoWarn);52;62;75 true true - $(SystemValueTuplePackageVersion) + $(SystemValueTupleVersion) $(OtherFlags) --warnon:1182 --subsystemversion:6.00 false @@ -104,24 +104,24 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj index 62f44ba24d..e192cccbf9 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj @@ -42,21 +42,21 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj index f6deaa32da..28e4f314f5 100644 --- a/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj +++ b/vsintegration/src/FSharp.VS.FSI/FSharp.VS.FSI.fsproj @@ -7,7 +7,7 @@ $(NoWarn);47;75 true true - $(SystemValueTuplePackageVersion) + $(SystemValueTupleVersion) $(OtherFlags) --subsystemversion:6.00 false @@ -57,23 +57,23 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/vsintegration/tests/GetTypesVS.UnitTests/GetTypesVS.UnitTests.fsproj b/vsintegration/tests/GetTypesVS.UnitTests/GetTypesVS.UnitTests.fsproj index 546c29c18c..d44b41fab3 100644 --- a/vsintegration/tests/GetTypesVS.UnitTests/GetTypesVS.UnitTests.fsproj +++ b/vsintegration/tests/GetTypesVS.UnitTests/GetTypesVS.UnitTests.fsproj @@ -20,10 +20,10 @@ - - - - + + + + diff --git a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj index ee8cd6a9d3..f7eea70d97 100644 --- a/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj +++ b/vsintegration/tests/Salsa/VisualFSharp.Salsa.fsproj @@ -7,7 +7,7 @@ $(NoWarn);45;47;52;58;75 true true - $(SystemValueTuplePackageVersion) + $(SystemValueTupleVersion) true false @@ -49,23 +49,23 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj index c317a7a2e7..e67623fd9f 100644 --- a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj @@ -10,7 +10,7 @@ NO_PROJECTCRACKER;$(DefineConstants) true true - $(SystemValueTuplePackageVersion) + $(SystemValueTupleVersion) true true false @@ -221,39 +221,39 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 52c75b395f0f0680048d430ad28a9b9c474593e3 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Tue, 14 May 2019 15:07:08 -0700 Subject: [PATCH 035/159] Update Versions.props --- eng/Versions.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/Versions.props b/eng/Versions.props index 1d1a5679df..c2c31d5f6a 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -18,8 +18,8 @@ $(FSCoreVersionPrefix).0 - 10.4 - $(FSPackageMajorVersion).3 + 10.5 + $(FSPackageMajorVersion).0 $(FSPackageVersion) $(FSPackageVersion).0 From 5d700e622bf21dc1365e9fd5d6ef34aa8a737e7a Mon Sep 17 00:00:00 2001 From: dotnet-maestro <@dotnet-maestro> Date: Wed, 15 May 2019 12:26:59 +0000 Subject: [PATCH 036/159] Update dependencies from https://github.com/dotnet/arcade build 20190514.13 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19264.13 --- eng/Version.Details.xml | 4 ++-- eng/common/PublishToPackageFeed.proj | 1 + eng/common/cross/arm64/sources.list.buster | 11 +++++++++++ eng/common/cross/arm64/sources.list.stretch | 12 ++++++++++++ eng/common/cross/build-rootfs.sh | 17 +++++++++++++---- eng/common/darc-init.ps1 | 9 +++++---- eng/common/darc-init.sh | 13 +++++++++++-- global.json | 4 ++-- 8 files changed, 57 insertions(+), 14 deletions(-) create mode 100644 eng/common/cross/arm64/sources.list.buster create mode 100644 eng/common/cross/arm64/sources.list.stretch diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index bd7139dc18..dcd15fa1e8 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - e6712584bba6e2f0e35a3704793c459ff97c09af + 670f6ee1a619a2a7c84cfdfe2a1c84fbe94e1c6b diff --git a/eng/common/PublishToPackageFeed.proj b/eng/common/PublishToPackageFeed.proj index e17f72644e..9120b2d212 100644 --- a/eng/common/PublishToPackageFeed.proj +++ b/eng/common/PublishToPackageFeed.proj @@ -53,6 +53,7 @@ https://dotnetfeed.blob.core.windows.net/dotnet-toolset/index.json https://dotnetfeed.blob.core.windows.net/dotnet-windowsdesktop/index.json https://dotnetfeed.blob.core.windows.net/nuget-nugetclient/index.json + https://dotnetfeed.blob.core.windows.net/aspnet-entityframework6/index.json ]" + echo "Usage: $0 [BuildArch] [LinuxCodeName] [lldbx.y] [--skipunmount] --rootfsdir ]" echo "BuildArch can be: arm(default), armel, arm64, x86" echo "LinuxCodeName - optional, Code name for Linux, can be: trusty, xenial(default), zesty, bionic, alpine. If BuildArch is armel, LinuxCodeName is jessie(default) or tizen." echo "lldbx.y - optional, LLDB version, can be: lldb3.9(default), lldb4.0, lldb5.0, lldb6.0 no-lldb. Ignored for alpine" @@ -113,12 +113,12 @@ while :; do __LinuxCodeName=trusty fi ;; - xenial) # Ubunry 16.04 + xenial) # Ubuntu 16.04 if [ "$__LinuxCodeName" != "jessie" ]; then __LinuxCodeName=xenial fi ;; - zesty) # Ununtu 17.04 + zesty) # Ubuntu 17.04 if [ "$__LinuxCodeName" != "jessie" ]; then __LinuxCodeName=zesty fi @@ -132,7 +132,16 @@ while :; do __LinuxCodeName=jessie __UbuntuRepo="http://ftp.debian.org/debian/" ;; - # TBD Stretch -> Debian 9, Buster -> Debian 10 + stretch) # Debian 9 + __LinuxCodeName=stretch + __UbuntuRepo="http://ftp.debian.org/debian/" + __LLDB_Package="liblldb-6.0-dev" + ;; + buster) # Debian 10 + __LinuxCodeName=buster + __UbuntuRepo="http://ftp.debian.org/debian/" + __LLDB_Package="liblldb-6.0-dev" + ;; tizen) if [ "$__BuildArch" != "armel" ]; then echo "Tizen is available only for armel." diff --git a/eng/common/darc-init.ps1 b/eng/common/darc-init.ps1 index 823d72a372..dea7cdd903 100644 --- a/eng/common/darc-init.ps1 +++ b/eng/common/darc-init.ps1 @@ -1,5 +1,6 @@ param ( - $darcVersion = $null + $darcVersion = $null, + $versionEndpoint = "https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16" ) $verbosity = "m" @@ -16,10 +17,10 @@ function InstallDarcCli ($darcVersion) { Invoke-Expression "& `"$dotnet`" tool uninstall $darcCliPackageName -g" } - # Until we can anonymously query the BAR API for the latest arcade-services - # build applied to the PROD channel, this is hardcoded. + # If the user didn't explicitly specify the darc version, + # query the Maestro API for the correct version of darc to install. if (-not $darcVersion) { - $darcVersion = '1.1.0-beta.19258.3' + $darcVersion = $(Invoke-WebRequest -Uri $versionEndpoint -UseBasicParsing).Content } $arcadeServicesSource = 'https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json' diff --git a/eng/common/darc-init.sh b/eng/common/darc-init.sh index 36d675738b..abdd0bc05a 100644 --- a/eng/common/darc-init.sh +++ b/eng/common/darc-init.sh @@ -1,7 +1,8 @@ #!/usr/bin/env bash source="${BASH_SOURCE[0]}" -darcVersion="1.1.0-beta.19258.3" +darcVersion='' +versionEndpoint="https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16" while [[ $# > 0 ]]; do opt="$(echo "$1" | awk '{print tolower($0)}')" @@ -10,6 +11,10 @@ while [[ $# > 0 ]]; do darcVersion=$2 shift ;; + --versionendpoint) + versionEndpoint=$2 + shift + ;; *) echo "Invalid argument: $1" usage @@ -33,6 +38,10 @@ verbosity=m . "$scriptroot/tools.sh" +if [ -z "$darcVersion" ]; then + darcVersion=$(curl -X GET "$versionEndpoint" -H "accept: text/plain") +fi + function InstallDarcCli { local darc_cli_package_name="microsoft.dotnet.darc" @@ -47,7 +56,7 @@ function InstallDarcCli { local arcadeServicesSource="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" - echo "Installing Darc CLI version $toolset_version..." + echo "Installing Darc CLI version $darcVersion..." echo "You may need to restart your command shell if this is the first dotnet tool you have installed." echo $($dotnet_root/dotnet tool install $darc_cli_package_name --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity -g) } diff --git a/global.json b/global.json index 39ca4e6981..6d63a523a7 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "tools": { - "dotnet": "2.2.203", + "dotnet": "3.0.100-preview5-011568", "vs": { "version": "16.0", "components": [ @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19263.3", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19264.13", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 6be164c9dbc95f53e0e0dfbe8b8eed934f8da2f3 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Wed, 15 May 2019 18:12:30 +0200 Subject: [PATCH 037/159] fix typo (#6739) * fix typo * fix typo --- src/fsharp/PatternMatchCompilation.fs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fsharp/PatternMatchCompilation.fs b/src/fsharp/PatternMatchCompilation.fs index 03718e8fe5..ddd8fc129c 100644 --- a/src/fsharp/PatternMatchCompilation.fs +++ b/src/fsharp/PatternMatchCompilation.fs @@ -589,7 +589,7 @@ let rec BuildSwitch inpExprOpt g expr edges dflt m = // All these should also always have default cases | (TCase(DecisionTreeTest.Const ConstNeedsDefaultCase, _) :: _), None -> - error(InternalError("inexhaustive match - need a default cases!", m)) + error(InternalError("inexhaustive match - need a default case!", m)) // Split string, float, uint64, int64, unativeint, nativeint matches into serial equality tests | TCase((DecisionTreeTest.ArrayLength _ | DecisionTreeTest.Const (Const.Single _ | Const.Double _ | Const.String _ | Const.Decimal _ | Const.Int64 _ | Const.UInt64 _ | Const.IntPtr _ | Const.UIntPtr _)), _) :: _, Some dflt -> @@ -1063,7 +1063,7 @@ let CompilePatternBasic // Project a successful edge through the frontiers. let investigation = Investigation(i', discrim, path) - let frontiers = frontiers |> List.collect (GenerateNewFrontiersAfterSucccessfulInvestigation inpExprOpt resPostBindOpt investigation) + let frontiers = frontiers |> List.collect (GenerateNewFrontiersAfterSuccessfulInvestigation inpExprOpt resPostBindOpt investigation) let tree = InvestigateFrontiers refuted frontiers // Bind the resVar for the union case, if we have one let tree = @@ -1104,7 +1104,7 @@ let CompilePatternBasic // Build a new frontier that represents the result of a successful investigation // at rule point (i', discrim, path) - and GenerateNewFrontiersAfterSucccessfulInvestigation inpExprOpt resPostBindOpt (Investigation(i', discrim, path)) (Frontier (i, active, valMap) as frontier) = + and GenerateNewFrontiersAfterSuccessfulInvestigation inpExprOpt resPostBindOpt (Investigation(i', discrim, path)) (Frontier (i, active, valMap) as frontier) = if (isMemOfActives path active) then let (SubExpr(accessf, ve)), pat = lookupActive path active @@ -1238,7 +1238,7 @@ let CompilePatternBasic | _ -> [frontier] - | _ -> failwith "pattern compilation: GenerateNewFrontiersAfterSucccessfulInvestigation" + | _ -> failwith "pattern compilation: GenerateNewFrontiersAfterSuccessfulInvestigation" else [frontier] and BindProjectionPattern (Active(path, subExpr, p) as inp) ((accActive, accValMap) as s) = From e609391fad5132fd6af2f7f358910e3f6bec00e7 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Wed, 15 May 2019 13:14:18 -0700 Subject: [PATCH 038/159] add common ci control file (#6741) --- azure-pipelines.yml | 192 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 192 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000000..0774ed4a77 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,192 @@ +# CI and PR triggers +trigger: +- master +- dev16.1 +- release/* +pr: +- master +- dev16.1 +- release/* + +variables: + - name: _TeamName + value: FSharp + - name: _BuildConfig + value: Release + - name: _PublishUsingPipelines + value: true + - name: _DotNetArtifactsCategory + value: .NETCore + - name: VisualStudioDropName + value: Products/$(System.TeamProject)/$(Build.Repository.Name)/$(Build.SourceBranchName)/$(Build.BuildNumber) + +jobs: +- template: /eng/common/templates/jobs/jobs.yml + parameters: + enableMicrobuild: true + enablePublishBuildArtifacts: true + enablePublishTestResults: false + enablePublishBuildAssets: true + enablePublishUsingPipelines: $(_PublishUsingPipelines) + enableTelemetry: true + helixRepo: microsoft/visualfsharp + jobs: + # Full-signed internal build + - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + - job: Full_Signed + pool: + name: NetCoreInternal-Pool + queue: buildpool.windows.10.amd64.vs2017 + variables: + - group: DotNet-Blob-Feed + - group: DotNet-Symbol-Server-Pats + - name: _SignType + value: Real + - name: _DotNetPublishToBlobFeed + value: true + steps: + - checkout: self + clean: true + - script: eng\CIBuild.cmd + -configuration $(_BuildConfig) + -prepareMachine + -testAll + -warnaserror:0 + /p:SignType=$(_SignType) + /p:DotNetSignType=$(_SignType) + /p:MicroBuild_SigningEnabled=true + /p:OverridePackageSource=https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json + /p:TeamName=$(_TeamName) + /p:DotNetPublishBlobFeedKey=$(dotnetfeed-storage-access-key-1) + /p:DotNetPublishBlobFeedUrl=https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json + /p:DotNetPublishToBlobFeed=true + /p:DotNetPublishUsingPipelines=$(_PublishUsingPipelines) + /p:DotNetArtifactsCategory=$(_DotNetArtifactsCategory) + /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) + /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) + /p:OfficialBuildId=$(BUILD.BUILDNUMBER) + /p:PublishToSymbolServer=true + /p:VisualStudioDropName=$(VisualStudioDropName) + + #-----------------------------------------------------------------------------------------------------------------# + # PR builds # + #-----------------------------------------------------------------------------------------------------------------# + + # Windows + - ${{ if eq(variables['System.TeamProject'], 'public') }}: + - job: Windows + pool: + vmImage: windows-2019 + timeoutInMinutes: 120 + strategy: + maxParallel: 4 + matrix: + desktop_release: + _configuration: Release + _testKind: testDesktop + coreclr_release: + _configuration: Release + _testKind: testCoreclr + fsharpqa_release: + _configuration: Release + _testKind: testFSharpQA + vs_release: + _configuration: Release + _testKind: testVs + steps: + - checkout: self + clean: true + - script: eng\CIBuild.cmd -configuration $(_configuration) -$(_testKind) + displayName: Build / Test + + # Windows FCS + - ${{ if eq(variables['System.TeamProject'], 'public') }}: + - job: Windows_FCS + pool: + vmImage: windows-2019 + variables: + - name: _SignType + value: Test + steps: + - checkout: self + clean: true + - script: fcs\build.cmd TestAndNuget + displayName: Build / Test + + # Linux + - ${{ if eq(variables['System.TeamProject'], 'public') }}: + - job: Linux + pool: + vmImage: ubuntu-16.04 + variables: + - name: _SignType + value: Test + steps: + - checkout: self + clean: true + - script: ./eng/cibuild.sh --configuration $(_BuildConfig) --testcoreclr + displayName: Build / Test + + # Linux FCS + - ${{ if eq(variables['System.TeamProject'], 'public') }}: + - job: Linux_FCS + pool: + vmImage: ubuntu-16.04 + variables: + - name: _SignType + value: Test + steps: + - checkout: self + clean: true + - script: ./fcs/build.sh Build + displayName: Build + + # MacOS + - ${{ if eq(variables['System.TeamProject'], 'public') }}: + - job: MacOS + pool: + vmImage: macOS-10.13 + variables: + - name: _SignType + value: Test + steps: + - checkout: self + clean: true + - script: ./eng/cibuild.sh --configuration $(_BuildConfig) --testcoreclr + displayName: Build / Test + + # MacOS FCS + - ${{ if eq(variables['System.TeamProject'], 'public') }}: + - job: MacOS_FCS + pool: + vmImage: macOS-10.13 + variables: + - name: _SignType + value: Test + steps: + - checkout: self + clean: true + - script: ./fcs/build.sh Build + displayName: Build + + # Source Build Linux + - ${{ if eq(variables['System.TeamProject'], 'public') }}: + - job: SourceBuild_Linux + pool: + vmImage: ubuntu-16.04 + steps: + - checkout: self + clean: true + - script: ./eng/cibuild.sh --configuration Release /p:DotNetBuildFromSource=true /p:FSharpSourceBuild=true + displayName: Build + + # Source Build Windows + - ${{ if eq(variables['System.TeamProject'], 'public') }}: + - job: SourceBuild_Windows + pool: + vmImage: windows-2019 + steps: + - checkout: self + clean: true + - script: eng\CIBuild.cmd -configuration Release -noSign /p:DotNetBuildFromSource=true /p:FSharpSourceBuild=true + displayName: Build From 1c24d6bd42fb187ef834183229d7298d69d21cc5 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Wed, 15 May 2019 14:53:18 -0700 Subject: [PATCH 039/159] refactor new build definitions (#6742) --- azure-pipelines.yml | 132 +++++++++++++++++++++++++------------------- 1 file changed, 75 insertions(+), 57 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0774ed4a77..750cd0b5db 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -21,18 +21,21 @@ variables: value: Products/$(System.TeamProject)/$(Build.Repository.Name)/$(Build.SourceBranchName)/$(Build.BuildNumber) jobs: -- template: /eng/common/templates/jobs/jobs.yml - parameters: - enableMicrobuild: true - enablePublishBuildArtifacts: true - enablePublishTestResults: false - enablePublishBuildAssets: true - enablePublishUsingPipelines: $(_PublishUsingPipelines) - enableTelemetry: true - helixRepo: microsoft/visualfsharp - jobs: - # Full-signed internal build - - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + +#---------------------------------------------------------------------------------------------------------------------# +# Signed build # +#---------------------------------------------------------------------------------------------------------------------# +- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + - template: /eng/common/templates/jobs/jobs.yml + parameters: + enableMicrobuild: true + enablePublishBuildArtifacts: true + enablePublishTestResults: false + enablePublishBuildAssets: true + enablePublishUsingPipelines: $(_PublishUsingPipelines) + enableTelemetry: true + helixRepo: dotnet/fsharp + jobs: - job: Full_Signed pool: name: NetCoreInternal-Pool @@ -68,12 +71,22 @@ jobs: /p:PublishToSymbolServer=true /p:VisualStudioDropName=$(VisualStudioDropName) - #-----------------------------------------------------------------------------------------------------------------# - # PR builds # - #-----------------------------------------------------------------------------------------------------------------# +#---------------------------------------------------------------------------------------------------------------------# +# PR builds # +#---------------------------------------------------------------------------------------------------------------------# +- ${{ if eq(variables['System.TeamProject'], 'public') }}: + - template: /eng/common/templates/jobs/jobs.yml + parameters: + enableMicrobuild: true + enablePublishBuildArtifacts: true + enablePublishTestResults: false + enablePublishBuildAssets: true + enablePublishUsingPipelines: $(_PublishUsingPipelines) + enableTelemetry: true + helixRepo: dotnet/fsharp + jobs: - # Windows - - ${{ if eq(variables['System.TeamProject'], 'public') }}: + # Windows - job: Windows pool: vmImage: windows-2019 @@ -99,25 +112,23 @@ jobs: - script: eng\CIBuild.cmd -configuration $(_configuration) -$(_testKind) displayName: Build / Test - # Windows FCS - - ${{ if eq(variables['System.TeamProject'], 'public') }}: - - job: Windows_FCS + # Linux + - job: Linux pool: - vmImage: windows-2019 + vmImage: ubuntu-16.04 variables: - name: _SignType value: Test steps: - checkout: self clean: true - - script: fcs\build.cmd TestAndNuget + - script: ./eng/cibuild.sh --configuration $(_BuildConfig) --testcoreclr displayName: Build / Test - # Linux - - ${{ if eq(variables['System.TeamProject'], 'public') }}: - - job: Linux + # MacOS + - job: MacOS pool: - vmImage: ubuntu-16.04 + vmImage: macOS-10.13 variables: - name: _SignType value: Test @@ -127,66 +138,73 @@ jobs: - script: ./eng/cibuild.sh --configuration $(_BuildConfig) --testcoreclr displayName: Build / Test - # Linux FCS - - ${{ if eq(variables['System.TeamProject'], 'public') }}: - - job: Linux_FCS + # Source Build Linux + - job: SourceBuild_Linux pool: vmImage: ubuntu-16.04 - variables: - - name: _SignType - value: Test steps: - checkout: self clean: true - - script: ./fcs/build.sh Build + - script: ./eng/cibuild.sh --configuration Release /p:DotNetBuildFromSource=true /p:FSharpSourceBuild=true displayName: Build - # MacOS - - ${{ if eq(variables['System.TeamProject'], 'public') }}: - - job: MacOS + # Source Build Windows + - job: SourceBuild_Windows pool: - vmImage: macOS-10.13 - variables: - - name: _SignType - value: Test + vmImage: windows-2019 steps: - checkout: self clean: true - - script: ./eng/cibuild.sh --configuration $(_BuildConfig) --testcoreclr - displayName: Build / Test + - script: eng\CIBuild.cmd -configuration Release -noSign /p:DotNetBuildFromSource=true /p:FSharpSourceBuild=true + displayName: Build - # MacOS FCS - - ${{ if eq(variables['System.TeamProject'], 'public') }}: - - job: MacOS_FCS +#---------------------------------------------------------------------------------------------------------------------# +# FCS builds # +#---------------------------------------------------------------------------------------------------------------------# + +- ${{ if eq(variables['System.TeamProject'], 'public') }}: + - template: /eng/common/templates/jobs/jobs.yml + parameters: + enableMicrobuild: true + enablePublishTestResults: false + enablePublishBuildAssets: true + enablePublishUsingPipelines: false + enableTelemetry: true + helixRepo: dotnet/fsharp + jobs: + + - job: Windows_FCS pool: - vmImage: macOS-10.13 + vmImage: windows-2019 variables: - name: _SignType value: Test steps: - checkout: self clean: true - - script: ./fcs/build.sh Build - displayName: Build + - script: fcs\build.cmd TestAndNuget + displayName: Build / Test - # Source Build Linux - - ${{ if eq(variables['System.TeamProject'], 'public') }}: - - job: SourceBuild_Linux + - job: Linux_FCS pool: vmImage: ubuntu-16.04 + variables: + - name: _SignType + value: Test steps: - checkout: self clean: true - - script: ./eng/cibuild.sh --configuration Release /p:DotNetBuildFromSource=true /p:FSharpSourceBuild=true + - script: ./fcs/build.sh Build displayName: Build - # Source Build Windows - - ${{ if eq(variables['System.TeamProject'], 'public') }}: - - job: SourceBuild_Windows + - job: MacOS_FCS pool: - vmImage: windows-2019 + vmImage: macOS-10.13 + variables: + - name: _SignType + value: Test steps: - checkout: self clean: true - - script: eng\CIBuild.cmd -configuration Release -noSign /p:DotNetBuildFromSource=true /p:FSharpSourceBuild=true + - script: ./fcs/build.sh Build displayName: Build From 56033fee1b5bc3d1e1af07ff075b321c63575882 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Wed, 15 May 2019 14:55:18 -0700 Subject: [PATCH 040/159] delete old CI control file PRs are now handled by `azure-pipelines.yml`. --- .vsts-pr.yaml | 172 -------------------------------------------------- 1 file changed, 172 deletions(-) delete mode 100644 .vsts-pr.yaml diff --git a/.vsts-pr.yaml b/.vsts-pr.yaml deleted file mode 100644 index eeebe57d08..0000000000 --- a/.vsts-pr.yaml +++ /dev/null @@ -1,172 +0,0 @@ -jobs: - -- job: Linux - pool: - vmImage: ubuntu-16.04 - timeoutInMinutes: 90 - strategy: - maxParallel: 3 - matrix: - coreclr_release: - _configuration: Release - _testKind: testcoreclr - steps: - - script: ./eng/cibuild.sh --configuration $(_configuration) --$(_testKind) - - task: PublishBuildArtifacts@1 - displayName: Publish Build Logs - inputs: - PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/$(_configuration)' - ArtifactName: 'Linux $(_configuration) $(_testKind) build log' - publishLocation: Container - continueOnError: true - condition: not(succeeded()) - - task: PublishBuildArtifacts@1 - displayName: Publish Test Results - inputs: - PathtoPublish: '$(Build.SourcesDirectory)/artifacts/TestResults' - ArtifactName: 'Linux $(_configuration) $(_testKind)' - publishLocation: Container - continueOnError: true - condition: not(succeeded()) - -- job: Linux_FCS - pool: - vmImage: ubuntu-16.04 - timeoutInMinutes: 90 - steps: - - script: ./fcs/build.sh Build - - task: PublishBuildArtifacts@1 - displayName: Publish Test Results - inputs: - PathtoPublish: '$(Build.SourcesDirectory)/artifacts/TestResults' - ArtifactName: 'Linux FCS test results' - publishLocation: Container - continueOnError: true - condition: not(succeeded()) - -- job: MacOS - pool: - vmImage: macOS-10.13 - timeoutInMinutes: 90 - strategy: - maxParallel: 3 - matrix: - coreclr_release: - _configuration: Release - _testKind: testcoreclr - steps: - - script: ./eng/cibuild.sh --configuration $(_configuration) --$(_testKind) - - task: PublishBuildArtifacts@1 - displayName: Publish Build Logs - inputs: - PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/$(_configuration)' - ArtifactName: 'MacOS $(_configuration) $(_testKind) build log' - publishLocation: Container - continueOnError: true - condition: not(succeeded()) - - task: PublishBuildArtifacts@1 - displayName: Publish Test Results - inputs: - PathtoPublish: '$(Build.SourcesDirectory)/artifacts/TestResults' - ArtifactName: 'MacOS $(_configuration) $(_testKind)' - publishLocation: Container - continueOnError: true - condition: not(succeeded()) - -- job: MacOS_FCS - pool: - vmImage: macOS-10.13 - timeoutInMinutes: 90 - steps: - - script: ./fcs/build.sh Build - - task: PublishBuildArtifacts@1 - displayName: Publish Test Results - inputs: - PathtoPublish: '$(Build.SourcesDirectory)/artifacts/TestResults' - ArtifactName: 'MacOS FCS test results' - publishLocation: Container - continueOnError: true - condition: not(succeeded()) - -- job: Windows - pool: - vmImage: windows-2019 - timeoutInMinutes: 120 - strategy: - maxParallel: 4 - matrix: - desktop_release: - _configuration: Release - _testKind: testDesktop - coreclr_release: - _configuration: Release - _testKind: testCoreclr - fsharpqa_release: - _configuration: Release - _testKind: testFSharpQA - vs_release: - _configuration: Release - _testKind: testVs - steps: - - script: eng\CIBuild.cmd -configuration $(_configuration) -$(_testKind) - - task: PublishBuildArtifacts@1 - displayName: Publish Build Logs - inputs: - PathtoPublish: '$(Build.SourcesDirectory)\artifacts\log\$(_configuration)' - ArtifactName: 'Windows $(_configuration) $(_testKind) build log' - publishLocation: Container - continueOnError: true - condition: not(succeeded()) - - task: PublishBuildArtifacts@1 - displayName: Publish Test Results - inputs: - PathtoPublish: '$(Build.SourcesDirectory)\artifacts\TestResults' - ArtifactName: 'Windows $(_configuration) $(_testKind) test results' - publishLocation: Container - continueOnError: true - condition: not(succeeded()) - -- job: Windows_FCS - pool: - vmImage: windows-2019 - timeoutInMinutes: 120 - steps: - - script: fcs\build.cmd TestAndNuget - - task: PublishBuildArtifacts@1 - displayName: Publish Test Results - inputs: - PathtoPublish: '$(Build.SourcesDirectory)\artifacts\TestResults' - ArtifactName: 'Windows FCS test results' - publishLocation: Container - continueOnError: true - condition: not(succeeded()) - -- job: SourceBuild_Linux - pool: - vmImage: ubuntu-16.04 - timeoutInMinutes: 90 - steps: - - script: ./eng/cibuild.sh --configuration Release /p:DotNetBuildFromSource=true /p:FSharpSourceBuild=true - - task: PublishBuildArtifacts@1 - displayName: Publish Build Logs - inputs: - PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/Release' - ArtifactName: 'SourceBuild_Linux build log' - publishLocation: Container - continueOnError: true - condition: not(succeeded()) - -- job: SourceBuild_Windows - pool: - vmImage: windows-2019 - timeoutInMinutes: 90 - steps: - - script: eng\CIBuild.cmd -configuration Release -noSign /p:DotNetBuildFromSource=true /p:FSharpSourceBuild=true - - task: PublishBuildArtifacts@1 - displayName: Publish Build Logs - inputs: - PathtoPublish: '$(Build.SourcesDirectory)\artifacts\log\Release' - ArtifactName: 'SourceBuild_Windows build log' - publishLocation: Container - continueOnError: true - condition: not(succeeded()) From 2046609d307e5616f8288cf9b4d0a2c04a4c17ef Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Wed, 15 May 2019 15:13:38 -0700 Subject: [PATCH 041/159] update build status badge --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index f1f56bba12..2eaa73a983 100644 --- a/README.md +++ b/README.md @@ -36,9 +36,7 @@ Even if you find a single-character typo, we're happy to take the change! Althou | Branch | Status | |:------:|:------:| -|master|[![Build Status](https://dnceng.visualstudio.com/_apis/public/build/definitions/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/106/badge?branchname=master)](https://dnceng.visualstudio.com/public/public%20Team/_build?definitionId=106&_a=history)| -|dev15.9|[![Build Status](https://dnceng.visualstudio.com/_apis/public/build/definitions/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/106/badge?branchname=dev15.9)](https://dnceng.visualstudio.com/public/public%20Team/_build?definitionId=106&_a=history)| -|dev16.0|[![Build Status](https://dnceng.visualstudio.com/_apis/public/build/definitions/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/106/badge?branchname=dev16.0)](https://dnceng.visualstudio.com/public/public%20Team/_build?definitionId=106&_a=history)| +|master|[![Build Status](https://dev.azure.com/dnceng/public/_apis/build/status/dotnet/fsharp/fsharp-ci?branchName=master)](https://dev.azure.com/dnceng/public/_build/latest?definitionId=496&branchName=master)| ## Using nightly releases in Visual Studio From ff79cc7083a90dc96df1c2bcfed047d57cb4e05f Mon Sep 17 00:00:00 2001 From: Nat Elkins Date: Thu, 16 May 2019 12:56:22 -0400 Subject: [PATCH 042/159] Fixing the DEVGUIDE link. (#6751) --- DEVGUIDE.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/DEVGUIDE.md b/DEVGUIDE.md index 303ef89c2e..237b906a9c 100644 --- a/DEVGUIDE.md +++ b/DEVGUIDE.md @@ -17,8 +17,7 @@ This will remove any files that are not under version control. This is necessary 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 F# Compiler (Linux/macOS)](#developing-the-f-compiler-linuxmacos) - [Developing the Visual F# IDE Tools (Windows Only)](#developing-the-visual-f-ide-tools-windows-only) - [Notes and Resources](#notes) From dff9f13f25295436e72707df875546c0a5928d67 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Thu, 16 May 2019 20:31:23 -0700 Subject: [PATCH 043/159] remove old source-build vestiges (#6756) --- src/buildfromsource/FSharp.Build/FSBuild.fs | 125 - .../FSInteractiveSettings.fs | 121 - .../FSharp.Compiler.Private/FSComp.fs | 5833 ----------------- .../FSharp.Compiler.Private/FSIstrings.fs | 333 - 4 files changed, 6412 deletions(-) delete mode 100644 src/buildfromsource/FSharp.Build/FSBuild.fs delete mode 100644 src/buildfromsource/FSharp.Compiler.Interactive.Settings/FSInteractiveSettings.fs delete mode 100644 src/buildfromsource/FSharp.Compiler.Private/FSComp.fs delete mode 100644 src/buildfromsource/FSharp.Compiler.Private/FSIstrings.fs diff --git a/src/buildfromsource/FSharp.Build/FSBuild.fs b/src/buildfromsource/FSharp.Build/FSBuild.fs deleted file mode 100644 index 5fa78b54eb..0000000000 --- a/src/buildfromsource/FSharp.Build/FSBuild.fs +++ /dev/null @@ -1,125 +0,0 @@ -// This is a generated file; the original input is 'FSBuild.txt' -namespace FSBuild - -open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators -open Microsoft.FSharp.Reflection -open System.Reflection -// (namespaces below for specific case of using the tool to compile FSharp.Core itself) -open Microsoft.FSharp.Core -open Microsoft.FSharp.Core.Operators -open Microsoft.FSharp.Text -open Microsoft.FSharp.Collections -open Printf - -type internal SR private() = - - // BEGIN BOILERPLATE - - static let getCurrentAssembly () = - #if FX_RESHAPED_REFLECTION - typeof.GetTypeInfo().Assembly - #else - System.Reflection.Assembly.GetExecutingAssembly() - #endif - - static let getTypeInfo (t: System.Type) = - #if FX_RESHAPED_REFLECTION - t.GetTypeInfo() - #else - t - #endif - - static let resources = lazy (new System.Resources.ResourceManager("FSBuild", getCurrentAssembly())) - - static let GetString(name:string) = - let s = resources.Value.GetString(name, System.Globalization.CultureInfo.CurrentUICulture) - #if DEBUG - if null = s then - System.Diagnostics.Debug.Assert(false, sprintf "**RESOURCE ERROR**: Resource token %s does not exist!" name) - #endif - s - - static let mkFunctionValue (tys: System.Type[]) (impl:obj->obj) = - FSharpValue.MakeFunction(FSharpType.MakeFunctionType(tys.[0],tys.[1]), impl) - - static let funTyC = typeof<(obj -> obj)>.GetGenericTypeDefinition() - - static let isNamedType(ty:System.Type) = not (ty.IsArray || ty.IsByRef || ty.IsPointer) - static let isFunctionType (ty1:System.Type) = - isNamedType(ty1) && getTypeInfo(ty1).IsGenericType && (ty1.GetGenericTypeDefinition()).Equals(funTyC) - - static let rec destFunTy (ty:System.Type) = - if isFunctionType ty then - ty, ty.GetGenericArguments() - else - match getTypeInfo(ty).BaseType with - | null -> failwith "destFunTy: not a function type" - | b -> destFunTy b - - static let buildFunctionForOneArgPat (ty: System.Type) impl = - let _,tys = destFunTy ty - let rty = tys.[1] - // PERF: this technique is a bit slow (e.g. in simple cases, like 'sprintf "%x"') - mkFunctionValue tys (fun inp -> impl rty inp) - - static let capture1 (fmt:string) i args ty (go : obj list -> System.Type -> int -> obj) : obj = - match fmt.[i] with - | '%' -> go args ty (i+1) - | 'd' - | 'f' - | 's' -> buildFunctionForOneArgPat ty (fun rty n -> go (n :: args) rty (i+1)) - | _ -> failwith "bad format specifier" - - // newlines and tabs get converted to strings when read from a resource file - // this will preserve their original intention - static let postProcessString (s : string) = - s.Replace("\\n","\n").Replace("\\t","\t").Replace("\\r","\r").Replace("\\\"", "\"") - - static let createMessageString (messageString : string) (fmt : Printf.StringFormat<'T>) : 'T = - let fmt = fmt.Value // here, we use the actual error string, as opposed to the one stored as fmt - let len = fmt.Length - - /// Function to capture the arguments and then run. - let rec capture args ty i = - if i >= len || (fmt.[i] = '%' && i+1 >= len) then - let b = new System.Text.StringBuilder() - b.AppendFormat(messageString, [| for x in List.rev args -> x |]) |> ignore - box(b.ToString()) - // REVIEW: For these purposes, this should be a nop, but I'm leaving it - // in incase we ever decide to support labels for the error format string - // E.g., "%s%d" - elif System.Char.IsSurrogatePair(fmt,i) then - capture args ty (i+2) - else - match fmt.[i] with - | '%' -> - let i = i+1 - capture1 fmt i args ty capture - | _ -> - capture args ty (i+1) - - (unbox (capture [] (typeof<'T>) 0) : 'T) - - static let mutable swallowResourceText = false - - static let GetStringFunc((messageID : string),(fmt : Printf.StringFormat<'T>)) : 'T = - if swallowResourceText then - sprintf fmt - else - let mutable messageString = GetString(messageID) - messageString <- postProcessString messageString - createMessageString messageString fmt - - /// If set to true, then all error messages will just return the filled 'holes' delimited by ',,,'s - this is for language-neutral testing (e.g. localization-invariant baselines). - static member SwallowResourceText with get () = swallowResourceText - and set (b) = swallowResourceText <- b - // END BOILERPLATE - - /// ToolPath is unknown; specify the path to fsc.exe as the ToolPath property. - /// (Originally from FSBuild.txt:2) - static member toolpathUnknown() = (GetStringFunc("toolpathUnknown",",,,") ) - - /// Call this method once to validate that all known resources are valid; throws if not - static member RunStartupValidation() = - ignore(GetString("toolpathUnknown")) - () diff --git a/src/buildfromsource/FSharp.Compiler.Interactive.Settings/FSInteractiveSettings.fs b/src/buildfromsource/FSharp.Compiler.Interactive.Settings/FSInteractiveSettings.fs deleted file mode 100644 index c2b9492761..0000000000 --- a/src/buildfromsource/FSharp.Compiler.Interactive.Settings/FSInteractiveSettings.fs +++ /dev/null @@ -1,121 +0,0 @@ -// This is a generated file; the original input is '..\FSInteractiveSettings.txt' -namespace FSInteractiveSettings - -open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators -open Microsoft.FSharp.Reflection -open System.Reflection -// (namespaces below for specific case of using the tool to compile FSharp.Core itself) -open Microsoft.FSharp.Core -open Microsoft.FSharp.Core.Operators -open Microsoft.FSharp.Text -open Microsoft.FSharp.Collections -open Printf - -type internal SR private() = - - // BEGIN BOILERPLATE - - static let getCurrentAssembly () = - #if FX_RESHAPED_REFLECTION - typeof.GetTypeInfo().Assembly - #else - System.Reflection.Assembly.GetExecutingAssembly() - #endif - - static let getTypeInfo (t: System.Type) = - #if FX_RESHAPED_REFLECTION - t.GetTypeInfo() - #else - t - #endif - - static let resources = lazy (new System.Resources.ResourceManager("FSInteractiveSettings", getCurrentAssembly())) - - static let GetString(name:string) = - let s = resources.Value.GetString(name, System.Globalization.CultureInfo.CurrentUICulture) - #if DEBUG - if null = s then - System.Diagnostics.Debug.Assert(false, sprintf "**RESOURCE ERROR**: Resource token %s does not exist!" name) - #endif - s - - static let mkFunctionValue (tys: System.Type[]) (impl:obj->obj) = - FSharpValue.MakeFunction(FSharpType.MakeFunctionType(tys.[0],tys.[1]), impl) - - static let funTyC = typeof<(obj -> obj)>.GetGenericTypeDefinition() - - static let isNamedType(ty:System.Type) = not (ty.IsArray || ty.IsByRef || ty.IsPointer) - static let isFunctionType (ty1:System.Type) = - isNamedType(ty1) && getTypeInfo(ty1).IsGenericType && (ty1.GetGenericTypeDefinition()).Equals(funTyC) - - static let rec destFunTy (ty:System.Type) = - if isFunctionType ty then - ty, ty.GetGenericArguments() - else - match getTypeInfo(ty).BaseType with - | null -> failwith "destFunTy: not a function type" - | b -> destFunTy b - - static let buildFunctionForOneArgPat (ty: System.Type) impl = - let _,tys = destFunTy ty - let rty = tys.[1] - // PERF: this technique is a bit slow (e.g. in simple cases, like 'sprintf "%x"') - mkFunctionValue tys (fun inp -> impl rty inp) - - static let capture1 (fmt:string) i args ty (go : obj list -> System.Type -> int -> obj) : obj = - match fmt.[i] with - | '%' -> go args ty (i+1) - | 'd' - | 'f' - | 's' -> buildFunctionForOneArgPat ty (fun rty n -> go (n :: args) rty (i+1)) - | _ -> failwith "bad format specifier" - - // newlines and tabs get converted to strings when read from a resource file - // this will preserve their original intention - static let postProcessString (s : string) = - s.Replace("\\n","\n").Replace("\\t","\t").Replace("\\r","\r").Replace("\\\"", "\"") - - static let createMessageString (messageString : string) (fmt : Printf.StringFormat<'T>) : 'T = - let fmt = fmt.Value // here, we use the actual error string, as opposed to the one stored as fmt - let len = fmt.Length - - /// Function to capture the arguments and then run. - let rec capture args ty i = - if i >= len || (fmt.[i] = '%' && i+1 >= len) then - let b = new System.Text.StringBuilder() - b.AppendFormat(messageString, [| for x in List.rev args -> x |]) |> ignore - box(b.ToString()) - // REVIEW: For these purposes, this should be a nop, but I'm leaving it - // in incase we ever decide to support labels for the error format string - // E.g., "%s%d" - elif System.Char.IsSurrogatePair(fmt,i) then - capture args ty (i+2) - else - match fmt.[i] with - | '%' -> - let i = i+1 - capture1 fmt i args ty capture - | _ -> - capture args ty (i+1) - - (unbox (capture [] (typeof<'T>) 0) : 'T) - - static let mutable swallowResourceText = false - - static let GetStringFunc((messageID : string),(fmt : Printf.StringFormat<'T>)) : 'T = - if swallowResourceText then - sprintf fmt - else - let mutable messageString = GetString(messageID) - messageString <- postProcessString messageString - createMessageString messageString fmt - - /// If set to true, then all error messages will just return the filled 'holes' delimited by ',,,'s - this is for language-neutral testing (e.g. localization-invariant baselines). - static member SwallowResourceText with get () = swallowResourceText - and set (b) = swallowResourceText <- b - // END BOILERPLATE - - - /// Call this method once to validate that all known resources are valid; throws if not - static member RunStartupValidation() = - () diff --git a/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs b/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs deleted file mode 100644 index a9a079598a..0000000000 --- a/src/buildfromsource/FSharp.Compiler.Private/FSComp.fs +++ /dev/null @@ -1,5833 +0,0 @@ -// This is a generated file; the original input is '..\FSComp.txt' -namespace FSComp - -open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators -open Microsoft.FSharp.Reflection -open System.Reflection -// (namespaces below for specific case of using the tool to compile FSharp.Core itself) -open Microsoft.FSharp.Core -open Microsoft.FSharp.Core.Operators -open Microsoft.FSharp.Text -open Microsoft.FSharp.Collections -open Printf - -type internal SR private() = - - // BEGIN BOILERPLATE - - static let getCurrentAssembly () = - #if FX_RESHAPED_REFLECTION - typeof.GetTypeInfo().Assembly - #else - System.Reflection.Assembly.GetExecutingAssembly() - #endif - - static let getTypeInfo (t: System.Type) = - #if FX_RESHAPED_REFLECTION - t.GetTypeInfo() - #else - t - #endif - - static let resources = lazy (new System.Resources.ResourceManager("FSComp", getCurrentAssembly())) - - static let GetString(name:string) = - let s = resources.Value.GetString(name, System.Globalization.CultureInfo.CurrentUICulture) - #if DEBUG - if null = s then - System.Diagnostics.Debug.Assert(false, sprintf "**RESOURCE ERROR**: Resource token %s does not exist!" name) - #endif - s - - static let mkFunctionValue (tys: System.Type[]) (impl:obj->obj) = - FSharpValue.MakeFunction(FSharpType.MakeFunctionType(tys.[0],tys.[1]), impl) - - static let funTyC = typeof<(obj -> obj)>.GetGenericTypeDefinition() - - static let isNamedType(ty:System.Type) = not (ty.IsArray || ty.IsByRef || ty.IsPointer) - static let isFunctionType (ty1:System.Type) = - isNamedType(ty1) && getTypeInfo(ty1).IsGenericType && (ty1.GetGenericTypeDefinition()).Equals(funTyC) - - static let rec destFunTy (ty:System.Type) = - if isFunctionType ty then - ty, ty.GetGenericArguments() - else - match getTypeInfo(ty).BaseType with - | null -> failwith "destFunTy: not a function type" - | b -> destFunTy b - - static let buildFunctionForOneArgPat (ty: System.Type) impl = - let _,tys = destFunTy ty - let rty = tys.[1] - // PERF: this technique is a bit slow (e.g. in simple cases, like 'sprintf "%x"') - mkFunctionValue tys (fun inp -> impl rty inp) - - static let capture1 (fmt:string) i args ty (go : obj list -> System.Type -> int -> obj) : obj = - match fmt.[i] with - | '%' -> go args ty (i+1) - | 'd' - | 'f' - | 's' -> buildFunctionForOneArgPat ty (fun rty n -> go (n :: args) rty (i+1)) - | _ -> failwith "bad format specifier" - - // newlines and tabs get converted to strings when read from a resource file - // this will preserve their original intention - static let postProcessString (s : string) = - s.Replace("\\n","\n").Replace("\\t","\t").Replace("\\r","\r").Replace("\\\"", "\"") - - static let createMessageString (messageString : string) (fmt : Printf.StringFormat<'T>) : 'T = - let fmt = fmt.Value // here, we use the actual error string, as opposed to the one stored as fmt - let len = fmt.Length - - /// Function to capture the arguments and then run. - let rec capture args ty i = - if i >= len || (fmt.[i] = '%' && i+1 >= len) then - let b = new System.Text.StringBuilder() - b.AppendFormat(messageString, [| for x in List.rev args -> x |]) |> ignore - box(b.ToString()) - // REVIEW: For these purposes, this should be a nop, but I'm leaving it - // in incase we ever decide to support labels for the error format string - // E.g., "%s%d" - elif System.Char.IsSurrogatePair(fmt,i) then - capture args ty (i+2) - else - match fmt.[i] with - | '%' -> - let i = i+1 - capture1 fmt i args ty capture - | _ -> - capture args ty (i+1) - - (unbox (capture [] (typeof<'T>) 0) : 'T) - - static let mutable swallowResourceText = false - - static let GetStringFunc((messageID : string),(fmt : Printf.StringFormat<'T>)) : 'T = - if swallowResourceText then - sprintf fmt - else - let mutable messageString = GetString(messageID) - messageString <- postProcessString messageString - createMessageString messageString fmt - - /// If set to true, then all error messages will just return the filled 'holes' delimited by ',,,'s - this is for language-neutral testing (e.g. localization-invariant baselines). - static member SwallowResourceText with get () = swallowResourceText - and set (b) = swallowResourceText <- b - // END BOILERPLATE - - /// The namespace '%s' is not defined. - /// (Originally from ..\FSComp.txt:4) - static member undefinedNameNamespace(a0 : System.String) = (GetStringFunc("undefinedNameNamespace",",,,%s,,,") a0) - /// The namespace or module '%s' is not defined. - /// (Originally from ..\FSComp.txt:5) - static member undefinedNameNamespaceOrModule(a0 : System.String) = (GetStringFunc("undefinedNameNamespaceOrModule",",,,%s,,,") a0) - /// The field, constructor or member '%s' is not defined. - /// (Originally from ..\FSComp.txt:6) - static member undefinedNameFieldConstructorOrMember(a0 : System.String) = (GetStringFunc("undefinedNameFieldConstructorOrMember",",,,%s,,,") a0) - /// The value, constructor, namespace or type '%s' is not defined. - /// (Originally from ..\FSComp.txt:7) - static member undefinedNameValueConstructorNamespaceOrType(a0 : System.String) = (GetStringFunc("undefinedNameValueConstructorNamespaceOrType",",,,%s,,,") a0) - /// The value or constructor '%s' is not defined. - /// (Originally from ..\FSComp.txt:8) - static member undefinedNameValueOfConstructor(a0 : System.String) = (GetStringFunc("undefinedNameValueOfConstructor",",,,%s,,,") a0) - /// The value, namespace, type or module '%s' is not defined. - /// (Originally from ..\FSComp.txt:9) - static member undefinedNameValueNamespaceTypeOrModule(a0 : System.String) = (GetStringFunc("undefinedNameValueNamespaceTypeOrModule",",,,%s,,,") a0) - /// The constructor, module or namespace '%s' is not defined. - /// (Originally from ..\FSComp.txt:10) - static member undefinedNameConstructorModuleOrNamespace(a0 : System.String) = (GetStringFunc("undefinedNameConstructorModuleOrNamespace",",,,%s,,,") a0) - /// The type '%s' is not defined. - /// (Originally from ..\FSComp.txt:11) - static member undefinedNameType(a0 : System.String) = (GetStringFunc("undefinedNameType",",,,%s,,,") a0) - /// The type '%s' is not defined in '%s'. - /// (Originally from ..\FSComp.txt:12) - static member undefinedNameTypeIn(a0 : System.String, a1 : System.String) = (GetStringFunc("undefinedNameTypeIn",",,,%s,,,%s,,,") a0 a1) - /// The record label or namespace '%s' is not defined. - /// (Originally from ..\FSComp.txt:13) - static member undefinedNameRecordLabelOrNamespace(a0 : System.String) = (GetStringFunc("undefinedNameRecordLabelOrNamespace",",,,%s,,,") a0) - /// The record label '%s' is not defined. - /// (Originally from ..\FSComp.txt:14) - static member undefinedNameRecordLabel(a0 : System.String) = (GetStringFunc("undefinedNameRecordLabel",",,,%s,,,") a0) - /// Maybe you want one of the following: - /// (Originally from ..\FSComp.txt:15) - static member undefinedNameSuggestionsIntro() = (GetStringFunc("undefinedNameSuggestionsIntro",",,,") ) - /// The type parameter %s is not defined. - /// (Originally from ..\FSComp.txt:16) - static member undefinedNameTypeParameter(a0 : System.String) = (GetStringFunc("undefinedNameTypeParameter",",,,%s,,,") a0) - /// The pattern discriminator '%s' is not defined. - /// (Originally from ..\FSComp.txt:17) - static member undefinedNamePatternDiscriminator(a0 : System.String) = (GetStringFunc("undefinedNamePatternDiscriminator",",,,%s,,,") a0) - /// Replace with '%s' - /// (Originally from ..\FSComp.txt:18) - static member replaceWithSuggestion(a0 : System.String) = (GetStringFunc("replaceWithSuggestion",",,,%s,,,") a0) - /// Add . for indexer access. - /// (Originally from ..\FSComp.txt:19) - static member addIndexerDot() = (GetStringFunc("addIndexerDot",",,,") ) - /// All elements of a list must be of the same type as the first element, which here is '%s'. This element has type '%s'. - /// (Originally from ..\FSComp.txt:20) - static member listElementHasWrongType(a0 : System.String, a1 : System.String) = (GetStringFunc("listElementHasWrongType",",,,%s,,,%s,,,") a0 a1) - /// All elements of an array must be of the same type as the first element, which here is '%s'. This element has type '%s'. - /// (Originally from ..\FSComp.txt:21) - static member arrayElementHasWrongType(a0 : System.String, a1 : System.String) = (GetStringFunc("arrayElementHasWrongType",",,,%s,,,%s,,,") a0 a1) - /// This 'if' expression is missing an 'else' branch. Because 'if' is an expression, and not a statement, add an 'else' branch which also returns a value of type '%s'. - /// (Originally from ..\FSComp.txt:22) - static member missingElseBranch(a0 : System.String) = (GetStringFunc("missingElseBranch",",,,%s,,,") a0) - /// The 'if' expression needs to have type '%s' to satisfy context type requirements. It currently has type '%s'. - /// (Originally from ..\FSComp.txt:23) - static member ifExpression(a0 : System.String, a1 : System.String) = (GetStringFunc("ifExpression",",,,%s,,,%s,,,") a0 a1) - /// All branches of an 'if' expression must return values of the same type as the first branch, which here is '%s'. This branch returns a value of type '%s'. - /// (Originally from ..\FSComp.txt:24) - static member elseBranchHasWrongType(a0 : System.String, a1 : System.String) = (GetStringFunc("elseBranchHasWrongType",",,,%s,,,%s,,,") a0 a1) - /// All branches of a pattern match expression must return values of the same type as the first branch, which here is '%s'. This branch returns a value of type '%s'. - /// (Originally from ..\FSComp.txt:25) - static member followingPatternMatchClauseHasWrongType(a0 : System.String, a1 : System.String) = (GetStringFunc("followingPatternMatchClauseHasWrongType",",,,%s,,,%s,,,") a0 a1) - /// A pattern match guard must be of type 'bool', but this 'when' expression is of type '%s'. - /// (Originally from ..\FSComp.txt:26) - static member patternMatchGuardIsNotBool(a0 : System.String) = (GetStringFunc("patternMatchGuardIsNotBool",",,,%s,,,") a0) - /// A ';' is used to separate field values in records. Consider replacing ',' with ';'. - /// (Originally from ..\FSComp.txt:27) - static member commaInsteadOfSemicolonInRecord() = (GetStringFunc("commaInsteadOfSemicolonInRecord",",,,") ) - /// The '!' operator is used to dereference a ref cell. Consider using 'not expr' here. - /// (Originally from ..\FSComp.txt:28) - static member derefInsteadOfNot() = (GetStringFunc("derefInsteadOfNot",",,,") ) - /// The non-generic type '%s' does not expect any type arguments, but here is given %d type argument(s) - /// (Originally from ..\FSComp.txt:29) - static member buildUnexpectedTypeArgs(a0 : System.String, a1 : System.Int32) = (GetStringFunc("buildUnexpectedTypeArgs",",,,%s,,,%d,,,") a0 a1) - /// Consider using 'return!' instead of 'return'. - /// (Originally from ..\FSComp.txt:30) - static member returnUsedInsteadOfReturnBang() = (GetStringFunc("returnUsedInsteadOfReturnBang",",,,") ) - /// Consider using 'yield!' instead of 'yield'. - /// (Originally from ..\FSComp.txt:31) - static member yieldUsedInsteadOfYieldBang() = (GetStringFunc("yieldUsedInsteadOfYieldBang",",,,") ) - /// \nA tuple type is required for one or more arguments. Consider wrapping the given arguments in additional parentheses or review the definition of the interface. - /// (Originally from ..\FSComp.txt:32) - static member tupleRequiredInAbstractMethod() = (GetStringFunc("tupleRequiredInAbstractMethod",",,,") ) - /// Invalid warning number '%s' - /// (Originally from ..\FSComp.txt:33) - static member buildInvalidWarningNumber(a0 : System.String) = (203, GetStringFunc("buildInvalidWarningNumber",",,,%s,,,") a0) - /// Invalid version string '%s' - /// (Originally from ..\FSComp.txt:34) - static member buildInvalidVersionString(a0 : System.String) = (204, GetStringFunc("buildInvalidVersionString",",,,%s,,,") a0) - /// Invalid version file '%s' - /// (Originally from ..\FSComp.txt:35) - static member buildInvalidVersionFile(a0 : System.String) = (205, GetStringFunc("buildInvalidVersionFile",",,,%s,,,") a0) - /// Microsoft (R) F# Compiler version %s - /// (Originally from ..\FSComp.txt:36) - static member buildProductName(a0 : System.String) = (GetStringFunc("buildProductName",",,,%s,,,") a0) - /// F# Compiler for F# %s - /// (Originally from ..\FSComp.txt:37) - static member buildProductNameCommunity(a0 : System.String) = (GetStringFunc("buildProductNameCommunity",",,,%s,,,") a0) - /// Problem with filename '%s': %s - /// (Originally from ..\FSComp.txt:38) - static member buildProblemWithFilename(a0 : System.String, a1 : System.String) = (206, GetStringFunc("buildProblemWithFilename",",,,%s,,,%s,,,") a0 a1) - /// No inputs specified - /// (Originally from ..\FSComp.txt:39) - static member buildNoInputsSpecified() = (207, GetStringFunc("buildNoInputsSpecified",",,,") ) - /// The '--pdb' option requires the '--debug' option to be used - /// (Originally from ..\FSComp.txt:40) - static member buildPdbRequiresDebug() = (209, GetStringFunc("buildPdbRequiresDebug",",,,") ) - /// The search directory '%s' is invalid - /// (Originally from ..\FSComp.txt:41) - static member buildInvalidSearchDirectory(a0 : System.String) = (210, GetStringFunc("buildInvalidSearchDirectory",",,,%s,,,") a0) - /// The search directory '%s' could not be found - /// (Originally from ..\FSComp.txt:42) - static member buildSearchDirectoryNotFound(a0 : System.String) = (211, GetStringFunc("buildSearchDirectoryNotFound",",,,%s,,,") a0) - /// '%s' is not a valid filename - /// (Originally from ..\FSComp.txt:43) - static member buildInvalidFilename(a0 : System.String) = (212, GetStringFunc("buildInvalidFilename",",,,%s,,,") a0) - /// '%s' is not a valid assembly name - /// (Originally from ..\FSComp.txt:44) - static member buildInvalidAssemblyName(a0 : System.String) = (213, GetStringFunc("buildInvalidAssemblyName",",,,%s,,,") a0) - /// Unrecognized privacy setting '%s' for managed resource, valid options are 'public' and 'private' - /// (Originally from ..\FSComp.txt:45) - static member buildInvalidPrivacy(a0 : System.String) = (214, GetStringFunc("buildInvalidPrivacy",",,,%s,,,") a0) - /// Multiple references to '%s.dll' are not permitted - /// (Originally from ..\FSComp.txt:46) - static member buildMultipleReferencesNotAllowed(a0 : System.String) = (215, GetStringFunc("buildMultipleReferencesNotAllowed",",,,%s,,,") a0) - /// Could not read version from mscorlib.dll - /// (Originally from ..\FSComp.txt:47) - static member buildCouldNotReadVersionInfoFromMscorlib() = (GetStringFunc("buildCouldNotReadVersionInfoFromMscorlib",",,,") ) - /// Unable to read assembly '%s' - /// (Originally from ..\FSComp.txt:48) - static member buildCannotReadAssembly(a0 : System.String) = (218, GetStringFunc("buildCannotReadAssembly",",,,%s,,,") a0) - /// Assembly resolution failure at or near this location - /// (Originally from ..\FSComp.txt:49) - static member buildAssemblyResolutionFailed() = (220, GetStringFunc("buildAssemblyResolutionFailed",",,,") ) - /// The declarations in this file will be placed in an implicit module '%s' based on the file name '%s'. However this is not a valid F# identifier, so the contents will not be accessible from other files. Consider renaming the file or adding a 'module' or 'namespace' declaration at the top of the file. - /// (Originally from ..\FSComp.txt:50) - static member buildImplicitModuleIsNotLegalIdentifier(a0 : System.String, a1 : System.String) = (221, GetStringFunc("buildImplicitModuleIsNotLegalIdentifier",",,,%s,,,%s,,,") a0 a1) - /// Files in libraries or multiple-file applications must begin with a namespace or module declaration, e.g. 'namespace SomeNamespace.SubNamespace' or 'module SomeNamespace.SomeModule'. Only the last source file of an application may omit such a declaration. - /// (Originally from ..\FSComp.txt:51) - static member buildMultiFileRequiresNamespaceOrModule() = (222, GetStringFunc("buildMultiFileRequiresNamespaceOrModule",",,,") ) - /// Files in libraries or multiple-file applications must begin with a namespace or module declaration. When using a module declaration at the start of a file the '=' sign is not allowed. If this is a top-level module, consider removing the = to resolve this error. - /// (Originally from ..\FSComp.txt:52) - static member noEqualSignAfterModule() = (222, GetStringFunc("noEqualSignAfterModule",",,,") ) - /// This file contains multiple declarations of the form 'module SomeNamespace.SomeModule'. Only one declaration of this form is permitted in a file. Change your file to use an initial namespace declaration and/or use 'module ModuleName = ...' to define your modules. - /// (Originally from ..\FSComp.txt:53) - static member buildMultipleToplevelModules() = (223, GetStringFunc("buildMultipleToplevelModules",",,,") ) - /// Option requires parameter: %s - /// (Originally from ..\FSComp.txt:54) - static member buildOptionRequiresParameter(a0 : System.String) = (224, GetStringFunc("buildOptionRequiresParameter",",,,%s,,,") a0) - /// Source file '%s' could not be found - /// (Originally from ..\FSComp.txt:55) - static member buildCouldNotFindSourceFile(a0 : System.String) = (225, GetStringFunc("buildCouldNotFindSourceFile",",,,%s,,,") a0) - /// The file extension of '%s' is not recognized. Source files must have extension .fs, .fsi, .fsx, .fsscript, .ml or .mli. - /// (Originally from ..\FSComp.txt:56) - static member buildInvalidSourceFileExtension(a0 : System.String) = (226, GetStringFunc("buildInvalidSourceFileExtension",",,,%s,,,") a0) - /// Could not resolve assembly '%s' - /// (Originally from ..\FSComp.txt:57) - static member buildCouldNotResolveAssembly(a0 : System.String) = (227, GetStringFunc("buildCouldNotResolveAssembly",",,,%s,,,") a0) - /// Could not resolve assembly '%s' required by '%s' - /// (Originally from ..\FSComp.txt:58) - static member buildCouldNotResolveAssemblyRequiredByFile(a0 : System.String, a1 : System.String) = (228, GetStringFunc("buildCouldNotResolveAssemblyRequiredByFile",",,,%s,,,%s,,,") a0 a1) - /// Error opening binary file '%s': %s - /// (Originally from ..\FSComp.txt:59) - static member buildErrorOpeningBinaryFile(a0 : System.String, a1 : System.String) = (229, GetStringFunc("buildErrorOpeningBinaryFile",",,,%s,,,%s,,,") a0 a1) - /// The F#-compiled DLL '%s' needs to be recompiled to be used with this version of F# - /// (Originally from ..\FSComp.txt:60) - static member buildDifferentVersionMustRecompile(a0 : System.String) = (231, GetStringFunc("buildDifferentVersionMustRecompile",",,,%s,,,") a0) - /// Invalid directive. Expected '#I \"\"'. - /// (Originally from ..\FSComp.txt:61) - static member buildInvalidHashIDirective() = (232, GetStringFunc("buildInvalidHashIDirective",",,,") ) - /// Invalid directive. Expected '#r \"\"'. - /// (Originally from ..\FSComp.txt:62) - static member buildInvalidHashrDirective() = (233, GetStringFunc("buildInvalidHashrDirective",",,,") ) - /// Invalid directive. Expected '#load \"\" ... \"\"'. - /// (Originally from ..\FSComp.txt:63) - static member buildInvalidHashloadDirective() = (234, GetStringFunc("buildInvalidHashloadDirective",",,,") ) - /// Invalid directive. Expected '#time', '#time \"on\"' or '#time \"off\"'. - /// (Originally from ..\FSComp.txt:64) - static member buildInvalidHashtimeDirective() = (235, GetStringFunc("buildInvalidHashtimeDirective",",,,") ) - /// Directives inside modules are ignored - /// (Originally from ..\FSComp.txt:65) - static member buildDirectivesInModulesAreIgnored() = (236, GetStringFunc("buildDirectivesInModulesAreIgnored",",,,") ) - /// A signature for the file or module '%s' has already been specified - /// (Originally from ..\FSComp.txt:66) - static member buildSignatureAlreadySpecified(a0 : System.String) = (237, GetStringFunc("buildSignatureAlreadySpecified",",,,%s,,,") a0) - /// An implementation of file or module '%s' has already been given. Compilation order is significant in F# because of type inference. You may need to adjust the order of your files to place the signature file before the implementation. In Visual Studio files are type-checked in the order they appear in the project file, which can be edited manually or adjusted using the solution explorer. - /// (Originally from ..\FSComp.txt:67) - static member buildImplementationAlreadyGivenDetail(a0 : System.String) = (238, GetStringFunc("buildImplementationAlreadyGivenDetail",",,,%s,,,") a0) - /// An implementation of the file or module '%s' has already been given - /// (Originally from ..\FSComp.txt:68) - static member buildImplementationAlreadyGiven(a0 : System.String) = (239, GetStringFunc("buildImplementationAlreadyGiven",",,,%s,,,") a0) - /// The signature file '%s' does not have a corresponding implementation file. If an implementation file exists then check the 'module' and 'namespace' declarations in the signature and implementation files match. - /// (Originally from ..\FSComp.txt:69) - static member buildSignatureWithoutImplementation(a0 : System.String) = (240, GetStringFunc("buildSignatureWithoutImplementation",",,,%s,,,") a0) - /// '%s' is not a valid integer argument - /// (Originally from ..\FSComp.txt:70) - static member buildArgInvalidInt(a0 : System.String) = (241, GetStringFunc("buildArgInvalidInt",",,,%s,,,") a0) - /// '%s' is not a valid floating point argument - /// (Originally from ..\FSComp.txt:71) - static member buildArgInvalidFloat(a0 : System.String) = (242, GetStringFunc("buildArgInvalidFloat",",,,%s,,,") a0) - /// Unrecognized option: '%s' - /// (Originally from ..\FSComp.txt:72) - static member buildUnrecognizedOption(a0 : System.String) = (243, GetStringFunc("buildUnrecognizedOption",",,,%s,,,") a0) - /// Invalid module or namespace name - /// (Originally from ..\FSComp.txt:73) - static member buildInvalidModuleOrNamespaceName() = (244, GetStringFunc("buildInvalidModuleOrNamespaceName",",,,") ) - /// Error reading/writing metadata for the F# compiled DLL '%s'. Was the DLL compiled with an earlier version of the F# compiler? (error: '%s'). - /// (Originally from ..\FSComp.txt:74) - static member pickleErrorReadingWritingMetadata(a0 : System.String, a1 : System.String) = (GetStringFunc("pickleErrorReadingWritingMetadata",",,,%s,,,%s,,,") a0 a1) - /// The type/module '%s' is not a concrete module or type - /// (Originally from ..\FSComp.txt:75) - static member tastTypeOrModuleNotConcrete(a0 : System.String) = (245, GetStringFunc("tastTypeOrModuleNotConcrete",",,,%s,,,") a0) - /// The type '%s' has an inline assembly code representation - /// (Originally from ..\FSComp.txt:76) - static member tastTypeHasAssemblyCodeRepresentation(a0 : System.String) = (GetStringFunc("tastTypeHasAssemblyCodeRepresentation",",,,%s,,,") a0) - /// A namespace and a module named '%s' both occur in two parts of this assembly - /// (Originally from ..\FSComp.txt:77) - static member tastNamespaceAndModuleWithSameNameInAssembly(a0 : System.String) = (247, GetStringFunc("tastNamespaceAndModuleWithSameNameInAssembly",",,,%s,,,") a0) - /// Two modules named '%s' occur in two parts of this assembly - /// (Originally from ..\FSComp.txt:78) - static member tastTwoModulesWithSameNameInAssembly(a0 : System.String) = (248, GetStringFunc("tastTwoModulesWithSameNameInAssembly",",,,%s,,,") a0) - /// Two type definitions named '%s' occur in namespace '%s' in two parts of this assembly - /// (Originally from ..\FSComp.txt:79) - static member tastDuplicateTypeDefinitionInAssembly(a0 : System.String, a1 : System.String) = (249, GetStringFunc("tastDuplicateTypeDefinitionInAssembly",",,,%s,,,%s,,,") a0 a1) - /// A module and a type definition named '%s' occur in namespace '%s' in two parts of this assembly - /// (Originally from ..\FSComp.txt:80) - static member tastConflictingModuleAndTypeDefinitionInAssembly(a0 : System.String, a1 : System.String) = (250, GetStringFunc("tastConflictingModuleAndTypeDefinitionInAssembly",",,,%s,,,%s,,,") a0 a1) - /// Invalid member signature encountered because of an earlier error - /// (Originally from ..\FSComp.txt:81) - static member tastInvalidMemberSignature() = (251, GetStringFunc("tastInvalidMemberSignature",",,,") ) - /// This value does not have a valid property setter type - /// (Originally from ..\FSComp.txt:82) - static member tastValueDoesNotHaveSetterType() = (252, GetStringFunc("tastValueDoesNotHaveSetterType",",,,") ) - /// Invalid form for a property getter. At least one '()' argument is required when using the explicit syntax. - /// (Originally from ..\FSComp.txt:83) - static member tastInvalidFormForPropertyGetter() = (253, GetStringFunc("tastInvalidFormForPropertyGetter",",,,") ) - /// Invalid form for a property setter. At least one argument is required. - /// (Originally from ..\FSComp.txt:84) - static member tastInvalidFormForPropertySetter() = (254, GetStringFunc("tastInvalidFormForPropertySetter",",,,") ) - /// Unexpected use of a byref-typed variable - /// (Originally from ..\FSComp.txt:85) - static member tastUnexpectedByRef() = (255, GetStringFunc("tastUnexpectedByRef",",,,") ) - /// A value must be mutable in order to mutate the contents or take the address of a value type, e.g. 'let mutable x = ...' - /// (Originally from ..\FSComp.txt:86) - static member tastValueMustBeMutable() = (256, GetStringFunc("tastValueMustBeMutable",",,,") ) - /// Invalid mutation of a constant expression. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...'. - /// (Originally from ..\FSComp.txt:87) - static member tastInvalidMutationOfConstant() = (257, GetStringFunc("tastInvalidMutationOfConstant",",,,") ) - /// The value has been copied to ensure the original is not mutated by this operation or because the copy is implicit when returning a struct from a member and another member is then accessed - /// (Originally from ..\FSComp.txt:88) - static member tastValueHasBeenCopied() = (GetStringFunc("tastValueHasBeenCopied",",,,") ) - /// Recursively defined values cannot appear directly as part of the construction of a tuple value within a recursive binding - /// (Originally from ..\FSComp.txt:89) - static member tastRecursiveValuesMayNotBeInConstructionOfTuple() = (259, GetStringFunc("tastRecursiveValuesMayNotBeInConstructionOfTuple",",,,") ) - /// Recursive values cannot appear directly as a construction of the type '%s' within a recursive binding. This feature has been removed from the F# language. Consider using a record instead. - /// (Originally from ..\FSComp.txt:90) - static member tastRecursiveValuesMayNotAppearInConstructionOfType(a0 : System.String) = (260, GetStringFunc("tastRecursiveValuesMayNotAppearInConstructionOfType",",,,%s,,,") a0) - /// Recursive values cannot be directly assigned to the non-mutable field '%s' of the type '%s' within a recursive binding. Consider using a mutable field instead. - /// (Originally from ..\FSComp.txt:91) - static member tastRecursiveValuesMayNotBeAssignedToNonMutableField(a0 : System.String, a1 : System.String) = (261, GetStringFunc("tastRecursiveValuesMayNotBeAssignedToNonMutableField",",,,%s,,,%s,,,") a0 a1) - /// Unexpected decode of AutoOpenAttribute - /// (Originally from ..\FSComp.txt:92) - static member tastUnexpectedDecodeOfAutoOpenAttribute() = (GetStringFunc("tastUnexpectedDecodeOfAutoOpenAttribute",",,,") ) - /// Unexpected decode of InternalsVisibleToAttribute - /// (Originally from ..\FSComp.txt:93) - static member tastUnexpectedDecodeOfInternalsVisibleToAttribute() = (GetStringFunc("tastUnexpectedDecodeOfInternalsVisibleToAttribute",",,,") ) - /// Unexpected decode of InterfaceDataVersionAttribute - /// (Originally from ..\FSComp.txt:94) - static member tastUnexpectedDecodeOfInterfaceDataVersionAttribute() = (GetStringFunc("tastUnexpectedDecodeOfInterfaceDataVersionAttribute",",,,") ) - /// Active patterns cannot return more than 7 possibilities - /// (Originally from ..\FSComp.txt:95) - static member tastActivePatternsLimitedToSeven() = (265, GetStringFunc("tastActivePatternsLimitedToSeven",",,,") ) - /// This is not a valid constant expression or custom attribute value - /// (Originally from ..\FSComp.txt:96) - static member tastNotAConstantExpression() = (267, GetStringFunc("tastNotAConstantExpression",",,,") ) - /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe mutability attributes differ - /// (Originally from ..\FSComp.txt:97) - static member ValueNotContainedMutabilityAttributesDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityAttributesDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe names differ - /// (Originally from ..\FSComp.txt:98) - static member ValueNotContainedMutabilityNamesDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityNamesDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe compiled names differ - /// (Originally from ..\FSComp.txt:99) - static member ValueNotContainedMutabilityCompiledNamesDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityCompiledNamesDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe display names differ - /// (Originally from ..\FSComp.txt:100) - static member ValueNotContainedMutabilityDisplayNamesDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityDisplayNamesDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe accessibility specified in the signature is more than that specified in the implementation - /// (Originally from ..\FSComp.txt:101) - static member ValueNotContainedMutabilityAccessibilityMore(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityAccessibilityMore",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe inline flags differ - /// (Originally from ..\FSComp.txt:102) - static member ValueNotContainedMutabilityInlineFlagsDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityInlineFlagsDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe literal constant values and/or attributes differ - /// (Originally from ..\FSComp.txt:103) - static member ValueNotContainedMutabilityLiteralConstantValuesDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityLiteralConstantValuesDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nOne is a type function and the other is not. The signature requires explicit type parameters if they are present in the implementation. - /// (Originally from ..\FSComp.txt:104) - static member ValueNotContainedMutabilityOneIsTypeFunction(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityOneIsTypeFunction",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe respective type parameter counts differ - /// (Originally from ..\FSComp.txt:105) - static member ValueNotContainedMutabilityParameterCountsDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityParameterCountsDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe types differ - /// (Originally from ..\FSComp.txt:106) - static member ValueNotContainedMutabilityTypesDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityTypesDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nOne is an extension member and the other is not - /// (Originally from ..\FSComp.txt:107) - static member ValueNotContainedMutabilityExtensionsDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityExtensionsDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nAn arity was not inferred for this value - /// (Originally from ..\FSComp.txt:108) - static member ValueNotContainedMutabilityArityNotInferred(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityArityNotInferred",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe number of generic parameters in the signature and implementation differ (the signature declares %s but the implementation declares %s - /// (Originally from ..\FSComp.txt:109) - static member ValueNotContainedMutabilityGenericParametersDiffer(a0 : System.String, a1 : System.String, a2 : System.String, a3 : System.String, a4 : System.String) = (GetStringFunc("ValueNotContainedMutabilityGenericParametersDiffer",",,,%s,,,%s,,,%s,,,%s,,,%s,,,") a0 a1 a2 a3 a4) - /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe generic parameters in the signature and implementation have different kinds. Perhaps there is a missing [] attribute. - /// (Originally from ..\FSComp.txt:110) - static member ValueNotContainedMutabilityGenericParametersAreDifferentKinds(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityGenericParametersAreDifferentKinds",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe arities in the signature and implementation differ. The signature specifies that '%s' is function definition or lambda expression accepting at least %s argument(s), but the implementation is a computed function value. To declare that a computed function value is a permitted implementation simply parenthesize its type in the signature, e.g.\n\tval %s: int -> (int -> int)\ninstead of\n\tval %s: int -> int -> int. - /// (Originally from ..\FSComp.txt:111) - static member ValueNotContainedMutabilityAritiesDiffer(a0 : System.String, a1 : System.String, a2 : System.String, a3 : System.String, a4 : System.String, a5 : System.String, a6 : System.String) = (GetStringFunc("ValueNotContainedMutabilityAritiesDiffer",",,,%s,,,%s,,,%s,,,%s,,,%s,,,%s,,,%s,,,") a0 a1 a2 a3 a4 a5 a6) - /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe CLI member names differ - /// (Originally from ..\FSComp.txt:112) - static member ValueNotContainedMutabilityDotNetNamesDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityDotNetNamesDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nOne is static and the other isn't - /// (Originally from ..\FSComp.txt:113) - static member ValueNotContainedMutabilityStaticsDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityStaticsDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nOne is virtual and the other isn't - /// (Originally from ..\FSComp.txt:114) - static member ValueNotContainedMutabilityVirtualsDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityVirtualsDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nOne is abstract and the other isn't - /// (Originally from ..\FSComp.txt:115) - static member ValueNotContainedMutabilityAbstractsDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityAbstractsDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nOne is final and the other isn't - /// (Originally from ..\FSComp.txt:116) - static member ValueNotContainedMutabilityFinalsDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityFinalsDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nOne is marked as an override and the other isn't - /// (Originally from ..\FSComp.txt:117) - static member ValueNotContainedMutabilityOverridesDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityOverridesDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nOne is a constructor/property and the other is not - /// (Originally from ..\FSComp.txt:118) - static member ValueNotContainedMutabilityOneIsConstructor(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityOneIsConstructor",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe compiled representation of this method is as a static member but the signature indicates its compiled representation is as an instance member - /// (Originally from ..\FSComp.txt:119) - static member ValueNotContainedMutabilityStaticButInstance(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityStaticButInstance",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// Module '%s' contains\n %s \nbut its signature specifies\n %s \nThe compiled representation of this method is as an instance member, but the signature indicates its compiled representation is as a static member - /// (Originally from ..\FSComp.txt:120) - static member ValueNotContainedMutabilityInstanceButStatic(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ValueNotContainedMutabilityInstanceButStatic",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// The %s definitions in the signature and implementation are not compatible because the names differ. The type is called '%s' in the signature file but '%s' in implementation. - /// (Originally from ..\FSComp.txt:121) - static member DefinitionsInSigAndImplNotCompatibleNamesDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (290, GetStringFunc("DefinitionsInSigAndImplNotCompatibleNamesDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// The %s definitions for type '%s' in the signature and implementation are not compatible because the respective type parameter counts differ - /// (Originally from ..\FSComp.txt:122) - static member DefinitionsInSigAndImplNotCompatibleParameterCountsDiffer(a0 : System.String, a1 : System.String) = (291, GetStringFunc("DefinitionsInSigAndImplNotCompatibleParameterCountsDiffer",",,,%s,,,%s,,,") a0 a1) - /// The %s definitions for type '%s' in the signature and implementation are not compatible because the accessibility specified in the signature is more than that specified in the implementation - /// (Originally from ..\FSComp.txt:123) - static member DefinitionsInSigAndImplNotCompatibleAccessibilityDiffer(a0 : System.String, a1 : System.String) = (292, GetStringFunc("DefinitionsInSigAndImplNotCompatibleAccessibilityDiffer",",,,%s,,,%s,,,") a0 a1) - /// The %s definitions for type '%s' in the signature and implementation are not compatible because the signature requires that the type supports the interface %s but the interface has not been implemented - /// (Originally from ..\FSComp.txt:124) - static member DefinitionsInSigAndImplNotCompatibleMissingInterface(a0 : System.String, a1 : System.String, a2 : System.String) = (293, GetStringFunc("DefinitionsInSigAndImplNotCompatibleMissingInterface",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// The %s definitions for type '%s' in the signature and implementation are not compatible because the implementation says this type may use nulls as a representation but the signature does not - /// (Originally from ..\FSComp.txt:125) - static member DefinitionsInSigAndImplNotCompatibleImplementationSaysNull(a0 : System.String, a1 : System.String) = (294, GetStringFunc("DefinitionsInSigAndImplNotCompatibleImplementationSaysNull",",,,%s,,,%s,,,") a0 a1) - /// The %s definitions for type '%s' in the signature and implementation are not compatible because the implementation says this type may use nulls as an extra value but the signature does not - /// (Originally from ..\FSComp.txt:126) - static member DefinitionsInSigAndImplNotCompatibleImplementationSaysNull2(a0 : System.String, a1 : System.String) = (294, GetStringFunc("DefinitionsInSigAndImplNotCompatibleImplementationSaysNull2",",,,%s,,,%s,,,") a0 a1) - /// The %s definitions for type '%s' in the signature and implementation are not compatible because the signature says this type may use nulls as a representation but the implementation does not - /// (Originally from ..\FSComp.txt:127) - static member DefinitionsInSigAndImplNotCompatibleSignatureSaysNull(a0 : System.String, a1 : System.String) = (295, GetStringFunc("DefinitionsInSigAndImplNotCompatibleSignatureSaysNull",",,,%s,,,%s,,,") a0 a1) - /// The %s definitions for type '%s' in the signature and implementation are not compatible because the signature says this type may use nulls as an extra value but the implementation does not - /// (Originally from ..\FSComp.txt:128) - static member DefinitionsInSigAndImplNotCompatibleSignatureSaysNull2(a0 : System.String, a1 : System.String) = (295, GetStringFunc("DefinitionsInSigAndImplNotCompatibleSignatureSaysNull2",",,,%s,,,%s,,,") a0 a1) - /// The %s definitions for type '%s' in the signature and implementation are not compatible because the implementation type is sealed but the signature implies it is not. Consider adding the [] attribute to the signature. - /// (Originally from ..\FSComp.txt:129) - static member DefinitionsInSigAndImplNotCompatibleImplementationSealed(a0 : System.String, a1 : System.String) = (296, GetStringFunc("DefinitionsInSigAndImplNotCompatibleImplementationSealed",",,,%s,,,%s,,,") a0 a1) - /// The %s definitions for type '%s' in the signature and implementation are not compatible because the implementation type is not sealed but signature implies it is. Consider adding the [] attribute to the implementation. - /// (Originally from ..\FSComp.txt:130) - static member DefinitionsInSigAndImplNotCompatibleImplementationIsNotSealed(a0 : System.String, a1 : System.String) = (297, GetStringFunc("DefinitionsInSigAndImplNotCompatibleImplementationIsNotSealed",",,,%s,,,%s,,,") a0 a1) - /// The %s definitions for type '%s' in the signature and implementation are not compatible because the implementation is an abstract class but the signature is not. Consider adding the [] attribute to the signature. - /// (Originally from ..\FSComp.txt:131) - static member DefinitionsInSigAndImplNotCompatibleImplementationIsAbstract(a0 : System.String, a1 : System.String) = (298, GetStringFunc("DefinitionsInSigAndImplNotCompatibleImplementationIsAbstract",",,,%s,,,%s,,,") a0 a1) - /// The %s definitions for type '%s' in the signature and implementation are not compatible because the signature is an abstract class but the implementation is not. Consider adding the [] attribute to the implementation. - /// (Originally from ..\FSComp.txt:132) - static member DefinitionsInSigAndImplNotCompatibleSignatureIsAbstract(a0 : System.String, a1 : System.String) = (299, GetStringFunc("DefinitionsInSigAndImplNotCompatibleSignatureIsAbstract",",,,%s,,,%s,,,") a0 a1) - /// The %s definitions for type '%s' in the signature and implementation are not compatible because the types have different base types - /// (Originally from ..\FSComp.txt:133) - static member DefinitionsInSigAndImplNotCompatibleTypesHaveDifferentBaseTypes(a0 : System.String, a1 : System.String) = (300, GetStringFunc("DefinitionsInSigAndImplNotCompatibleTypesHaveDifferentBaseTypes",",,,%s,,,%s,,,") a0 a1) - /// The %s definitions for type '%s' in the signature and implementation are not compatible because the number of %ss differ - /// (Originally from ..\FSComp.txt:134) - static member DefinitionsInSigAndImplNotCompatibleNumbersDiffer(a0 : System.String, a1 : System.String, a2 : System.String) = (301, GetStringFunc("DefinitionsInSigAndImplNotCompatibleNumbersDiffer",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// The %s definitions for type '%s' in the signature and implementation are not compatible because the signature defines the %s '%s' but the implementation does not (or does, but not in the same order) - /// (Originally from ..\FSComp.txt:135) - static member DefinitionsInSigAndImplNotCompatibleSignatureDefinesButImplDoesNot(a0 : System.String, a1 : System.String, a2 : System.String, a3 : System.String) = (302, GetStringFunc("DefinitionsInSigAndImplNotCompatibleSignatureDefinesButImplDoesNot",",,,%s,,,%s,,,%s,,,%s,,,") a0 a1 a2 a3) - /// The %s definitions for type '%s' in the signature and implementation are not compatible because the implementation defines the %s '%s' but the signature does not (or does, but not in the same order) - /// (Originally from ..\FSComp.txt:136) - static member DefinitionsInSigAndImplNotCompatibleImplDefinesButSignatureDoesNot(a0 : System.String, a1 : System.String, a2 : System.String, a3 : System.String) = (303, GetStringFunc("DefinitionsInSigAndImplNotCompatibleImplDefinesButSignatureDoesNot",",,,%s,,,%s,,,%s,,,%s,,,") a0 a1 a2 a3) - /// The %s definitions for type '%s' in the signature and implementation are not compatible because the implementation defines a struct but the signature defines a type with a hidden representation - /// (Originally from ..\FSComp.txt:137) - static member DefinitionsInSigAndImplNotCompatibleImplDefinesStruct(a0 : System.String, a1 : System.String) = (304, GetStringFunc("DefinitionsInSigAndImplNotCompatibleImplDefinesStruct",",,,%s,,,%s,,,") a0 a1) - /// The %s definitions for type '%s' in the signature and implementation are not compatible because a CLI type representation is being hidden by a signature - /// (Originally from ..\FSComp.txt:138) - static member DefinitionsInSigAndImplNotCompatibleDotNetTypeRepresentationIsHidden(a0 : System.String, a1 : System.String) = (305, GetStringFunc("DefinitionsInSigAndImplNotCompatibleDotNetTypeRepresentationIsHidden",",,,%s,,,%s,,,") a0 a1) - /// The %s definitions for type '%s' in the signature and implementation are not compatible because a type representation is being hidden by a signature - /// (Originally from ..\FSComp.txt:139) - static member DefinitionsInSigAndImplNotCompatibleTypeIsHidden(a0 : System.String, a1 : System.String) = (306, GetStringFunc("DefinitionsInSigAndImplNotCompatibleTypeIsHidden",",,,%s,,,%s,,,") a0 a1) - /// The %s definitions for type '%s' in the signature and implementation are not compatible because the types are of different kinds - /// (Originally from ..\FSComp.txt:140) - static member DefinitionsInSigAndImplNotCompatibleTypeIsDifferentKind(a0 : System.String, a1 : System.String) = (307, GetStringFunc("DefinitionsInSigAndImplNotCompatibleTypeIsDifferentKind",",,,%s,,,%s,,,") a0 a1) - /// The %s definitions for type '%s' in the signature and implementation are not compatible because the IL representations differ - /// (Originally from ..\FSComp.txt:141) - static member DefinitionsInSigAndImplNotCompatibleILDiffer(a0 : System.String, a1 : System.String) = (308, GetStringFunc("DefinitionsInSigAndImplNotCompatibleILDiffer",",,,%s,,,%s,,,") a0 a1) - /// The %s definitions for type '%s' in the signature and implementation are not compatible because the representations differ - /// (Originally from ..\FSComp.txt:142) - static member DefinitionsInSigAndImplNotCompatibleRepresentationsDiffer(a0 : System.String, a1 : System.String) = (309, GetStringFunc("DefinitionsInSigAndImplNotCompatibleRepresentationsDiffer",",,,%s,,,%s,,,") a0 a1) - /// The %s definitions for type '%s' in the signature and implementation are not compatible because the field %s was present in the implementation but not in the signature - /// (Originally from ..\FSComp.txt:143) - static member DefinitionsInSigAndImplNotCompatibleFieldWasPresent(a0 : System.String, a1 : System.String, a2 : System.String) = (311, GetStringFunc("DefinitionsInSigAndImplNotCompatibleFieldWasPresent",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// The %s definitions for type '%s' in the signature and implementation are not compatible because the order of the fields is different in the signature and implementation - /// (Originally from ..\FSComp.txt:144) - static member DefinitionsInSigAndImplNotCompatibleFieldOrderDiffer(a0 : System.String, a1 : System.String) = (312, GetStringFunc("DefinitionsInSigAndImplNotCompatibleFieldOrderDiffer",",,,%s,,,%s,,,") a0 a1) - /// The %s definitions for type '%s' in the signature and implementation are not compatible because the field %s was required by the signature but was not specified by the implementation - /// (Originally from ..\FSComp.txt:145) - static member DefinitionsInSigAndImplNotCompatibleFieldRequiredButNotSpecified(a0 : System.String, a1 : System.String, a2 : System.String) = (313, GetStringFunc("DefinitionsInSigAndImplNotCompatibleFieldRequiredButNotSpecified",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// The %s definitions for type '%s' in the signature and implementation are not compatible because the field '%s' was present in the implementation but not in the signature. Struct types must now reveal their fields in the signature for the type, though the fields may still be labelled 'private' or 'internal'. - /// (Originally from ..\FSComp.txt:146) - static member DefinitionsInSigAndImplNotCompatibleFieldIsInImplButNotSig(a0 : System.String, a1 : System.String, a2 : System.String) = (314, GetStringFunc("DefinitionsInSigAndImplNotCompatibleFieldIsInImplButNotSig",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// The %s definitions for type '%s' in the signature and implementation are not compatible because the abstract member '%s' was required by the signature but was not specified by the implementation - /// (Originally from ..\FSComp.txt:147) - static member DefinitionsInSigAndImplNotCompatibleAbstractMemberMissingInImpl(a0 : System.String, a1 : System.String, a2 : System.String) = (315, GetStringFunc("DefinitionsInSigAndImplNotCompatibleAbstractMemberMissingInImpl",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// The %s definitions for type '%s' in the signature and implementation are not compatible because the abstract member '%s' was present in the implementation but not in the signature - /// (Originally from ..\FSComp.txt:148) - static member DefinitionsInSigAndImplNotCompatibleAbstractMemberMissingInSig(a0 : System.String, a1 : System.String, a2 : System.String) = (316, GetStringFunc("DefinitionsInSigAndImplNotCompatibleAbstractMemberMissingInSig",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// The %s definitions for type '%s' in the signature and implementation are not compatible because the signature declares a %s while the implementation declares a %s - /// (Originally from ..\FSComp.txt:149) - static member DefinitionsInSigAndImplNotCompatibleSignatureDeclaresDiffer(a0 : System.String, a1 : System.String, a2 : System.String, a3 : System.String) = (317, GetStringFunc("DefinitionsInSigAndImplNotCompatibleSignatureDeclaresDiffer",",,,%s,,,%s,,,%s,,,%s,,,") a0 a1 a2 a3) - /// The %s definitions for type '%s' in the signature and implementation are not compatible because the abbreviations differ: %s versus %s - /// (Originally from ..\FSComp.txt:150) - static member DefinitionsInSigAndImplNotCompatibleAbbreviationsDiffer(a0 : System.String, a1 : System.String, a2 : System.String, a3 : System.String) = (318, GetStringFunc("DefinitionsInSigAndImplNotCompatibleAbbreviationsDiffer",",,,%s,,,%s,,,%s,,,%s,,,") a0 a1 a2 a3) - /// The %s definitions for type '%s' in the signature and implementation are not compatible because an abbreviation is being hidden by a signature. The abbreviation must be visible to other CLI languages. Consider making the abbreviation visible in the signature. - /// (Originally from ..\FSComp.txt:151) - static member DefinitionsInSigAndImplNotCompatibleAbbreviationHiddenBySig(a0 : System.String, a1 : System.String) = (319, GetStringFunc("DefinitionsInSigAndImplNotCompatibleAbbreviationHiddenBySig",",,,%s,,,%s,,,") a0 a1) - /// The %s definitions for type '%s' in the signature and implementation are not compatible because the signature has an abbreviation while the implementation does not - /// (Originally from ..\FSComp.txt:152) - static member DefinitionsInSigAndImplNotCompatibleSigHasAbbreviation(a0 : System.String, a1 : System.String) = (320, GetStringFunc("DefinitionsInSigAndImplNotCompatibleSigHasAbbreviation",",,,%s,,,%s,,,") a0 a1) - /// The module contains the constructor\n %s \nbut its signature specifies\n %s \nThe names differ - /// (Originally from ..\FSComp.txt:153) - static member ModuleContainsConstructorButNamesDiffer(a0 : System.String, a1 : System.String) = (GetStringFunc("ModuleContainsConstructorButNamesDiffer",",,,%s,,,%s,,,") a0 a1) - /// The module contains the constructor\n %s \nbut its signature specifies\n %s \nThe respective number of data fields differ - /// (Originally from ..\FSComp.txt:154) - static member ModuleContainsConstructorButDataFieldsDiffer(a0 : System.String, a1 : System.String) = (GetStringFunc("ModuleContainsConstructorButDataFieldsDiffer",",,,%s,,,%s,,,") a0 a1) - /// The module contains the constructor\n %s \nbut its signature specifies\n %s \nThe types of the fields differ - /// (Originally from ..\FSComp.txt:155) - static member ModuleContainsConstructorButTypesOfFieldsDiffer(a0 : System.String, a1 : System.String) = (GetStringFunc("ModuleContainsConstructorButTypesOfFieldsDiffer",",,,%s,,,%s,,,") a0 a1) - /// The module contains the constructor\n %s \nbut its signature specifies\n %s \nthe accessibility specified in the signature is more than that specified in the implementation - /// (Originally from ..\FSComp.txt:156) - static member ModuleContainsConstructorButAccessibilityDiffers(a0 : System.String, a1 : System.String) = (GetStringFunc("ModuleContainsConstructorButAccessibilityDiffers",",,,%s,,,%s,,,") a0 a1) - /// The module contains the field\n %s \nbut its signature specifies\n %s \nThe names differ - /// (Originally from ..\FSComp.txt:157) - static member FieldNotContainedNamesDiffer(a0 : System.String, a1 : System.String) = (GetStringFunc("FieldNotContainedNamesDiffer",",,,%s,,,%s,,,") a0 a1) - /// The module contains the field\n %s \nbut its signature specifies\n %s \nthe accessibility specified in the signature is more than that specified in the implementation - /// (Originally from ..\FSComp.txt:158) - static member FieldNotContainedAccessibilitiesDiffer(a0 : System.String, a1 : System.String) = (GetStringFunc("FieldNotContainedAccessibilitiesDiffer",",,,%s,,,%s,,,") a0 a1) - /// The module contains the field\n %s \nbut its signature specifies\n %s \nThe 'static' modifiers differ - /// (Originally from ..\FSComp.txt:159) - static member FieldNotContainedStaticsDiffer(a0 : System.String, a1 : System.String) = (GetStringFunc("FieldNotContainedStaticsDiffer",",,,%s,,,%s,,,") a0 a1) - /// The module contains the field\n %s \nbut its signature specifies\n %s \nThe 'mutable' modifiers differ - /// (Originally from ..\FSComp.txt:160) - static member FieldNotContainedMutablesDiffer(a0 : System.String, a1 : System.String) = (GetStringFunc("FieldNotContainedMutablesDiffer",",,,%s,,,%s,,,") a0 a1) - /// The module contains the field\n %s \nbut its signature specifies\n %s \nThe 'literal' modifiers differ - /// (Originally from ..\FSComp.txt:161) - static member FieldNotContainedLiteralsDiffer(a0 : System.String, a1 : System.String) = (GetStringFunc("FieldNotContainedLiteralsDiffer",",,,%s,,,%s,,,") a0 a1) - /// The module contains the field\n %s \nbut its signature specifies\n %s \nThe types differ - /// (Originally from ..\FSComp.txt:162) - static member FieldNotContainedTypesDiffer(a0 : System.String, a1 : System.String) = (GetStringFunc("FieldNotContainedTypesDiffer",",,,%s,,,%s,,,") a0 a1) - /// The implicit instantiation of a generic construct at or near this point could not be resolved because it could resolve to multiple unrelated types, e.g. '%s' and '%s'. Consider using type annotations to resolve the ambiguity - /// (Originally from ..\FSComp.txt:163) - static member typrelCannotResolveImplicitGenericInstantiation(a0 : System.String, a1 : System.String) = (331, GetStringFunc("typrelCannotResolveImplicitGenericInstantiation",",,,%s,,,%s,,,") a0 a1) - /// Could not resolve the ambiguity inherent in the use of a 'printf'-style format string - /// (Originally from ..\FSComp.txt:164) - static member typrelCannotResolveAmbiguityInPrintf() = (333, GetStringFunc("typrelCannotResolveAmbiguityInPrintf",",,,") ) - /// Could not resolve the ambiguity in the use of a generic construct with an 'enum' constraint at or near this position - /// (Originally from ..\FSComp.txt:165) - static member typrelCannotResolveAmbiguityInEnum() = (334, GetStringFunc("typrelCannotResolveAmbiguityInEnum",",,,") ) - /// Could not resolve the ambiguity in the use of a generic construct with a 'delegate' constraint at or near this position - /// (Originally from ..\FSComp.txt:166) - static member typrelCannotResolveAmbiguityInDelegate() = (335, GetStringFunc("typrelCannotResolveAmbiguityInDelegate",",,,") ) - /// Invalid value - /// (Originally from ..\FSComp.txt:167) - static member typrelInvalidValue() = (337, GetStringFunc("typrelInvalidValue",",,,") ) - /// The signature and implementation are not compatible because the respective type parameter counts differ - /// (Originally from ..\FSComp.txt:168) - static member typrelSigImplNotCompatibleParamCountsDiffer() = (338, GetStringFunc("typrelSigImplNotCompatibleParamCountsDiffer",",,,") ) - /// The signature and implementation are not compatible because the type parameter in the class/signature has a different compile-time requirement to the one in the member/implementation - /// (Originally from ..\FSComp.txt:169) - static member typrelSigImplNotCompatibleCompileTimeRequirementsDiffer() = (339, GetStringFunc("typrelSigImplNotCompatibleCompileTimeRequirementsDiffer",",,,") ) - /// The signature and implementation are not compatible because the declaration of the type parameter '%s' requires a constraint of the form %s - /// (Originally from ..\FSComp.txt:170) - static member typrelSigImplNotCompatibleConstraintsDiffer(a0 : System.String, a1 : System.String) = (340, GetStringFunc("typrelSigImplNotCompatibleConstraintsDiffer",",,,%s,,,%s,,,") a0 a1) - /// The signature and implementation are not compatible because the type parameter '%s' has a constraint of the form %s but the implementation does not. Either remove this constraint from the signature or add it to the implementation. - /// (Originally from ..\FSComp.txt:171) - static member typrelSigImplNotCompatibleConstraintsDifferRemove(a0 : System.String, a1 : System.String) = (341, GetStringFunc("typrelSigImplNotCompatibleConstraintsDifferRemove",",,,%s,,,%s,,,") a0 a1) - /// The type '%s' implements 'System.IComparable'. Consider also adding an explicit override for 'Object.Equals' - /// (Originally from ..\FSComp.txt:172) - static member typrelTypeImplementsIComparableShouldOverrideObjectEquals(a0 : System.String) = (342, GetStringFunc("typrelTypeImplementsIComparableShouldOverrideObjectEquals",",,,%s,,,") a0) - /// The type '%s' implements 'System.IComparable' explicitly but provides no corresponding override for 'Object.Equals'. An implementation of 'Object.Equals' has been automatically provided, implemented via 'System.IComparable'. Consider implementing the override 'Object.Equals' explicitly - /// (Originally from ..\FSComp.txt:173) - static member typrelTypeImplementsIComparableDefaultObjectEqualsProvided(a0 : System.String) = (343, GetStringFunc("typrelTypeImplementsIComparableDefaultObjectEqualsProvided",",,,%s,,,") a0) - /// The struct, record or union type '%s' has an explicit implementation of 'Object.GetHashCode' or 'Object.Equals'. You must apply the 'CustomEquality' attribute to the type - /// (Originally from ..\FSComp.txt:174) - static member typrelExplicitImplementationOfGetHashCodeOrEquals(a0 : System.String) = (344, GetStringFunc("typrelExplicitImplementationOfGetHashCodeOrEquals",",,,%s,,,") a0) - /// The struct, record or union type '%s' has an explicit implementation of 'Object.GetHashCode'. Consider implementing a matching override for 'Object.Equals(obj)' - /// (Originally from ..\FSComp.txt:175) - static member typrelExplicitImplementationOfGetHashCode(a0 : System.String) = (345, GetStringFunc("typrelExplicitImplementationOfGetHashCode",",,,%s,,,") a0) - /// The struct, record or union type '%s' has an explicit implementation of 'Object.Equals'. Consider implementing a matching override for 'Object.GetHashCode()' - /// (Originally from ..\FSComp.txt:176) - static member typrelExplicitImplementationOfEquals(a0 : System.String) = (346, GetStringFunc("typrelExplicitImplementationOfEquals",",,,%s,,,") a0) - /// The exception definitions are not compatible because a CLI exception mapping is being hidden by a signature. The exception mapping must be visible to other modules. The module contains the exception definition\n %s \nbut its signature specifies\n\t%s - /// (Originally from ..\FSComp.txt:177) - static member ExceptionDefsNotCompatibleHiddenBySignature(a0 : System.String, a1 : System.String) = (GetStringFunc("ExceptionDefsNotCompatibleHiddenBySignature",",,,%s,,,%s,,,") a0 a1) - /// The exception definitions are not compatible because the CLI representations differ. The module contains the exception definition\n %s \nbut its signature specifies\n\t%s - /// (Originally from ..\FSComp.txt:178) - static member ExceptionDefsNotCompatibleDotNetRepresentationsDiffer(a0 : System.String, a1 : System.String) = (GetStringFunc("ExceptionDefsNotCompatibleDotNetRepresentationsDiffer",",,,%s,,,%s,,,") a0 a1) - /// The exception definitions are not compatible because the exception abbreviation is being hidden by the signature. The abbreviation must be visible to other CLI languages. Consider making the abbreviation visible in the signature. The module contains the exception definition\n %s \nbut its signature specifies\n\t%s. - /// (Originally from ..\FSComp.txt:179) - static member ExceptionDefsNotCompatibleAbbreviationHiddenBySignature(a0 : System.String, a1 : System.String) = (GetStringFunc("ExceptionDefsNotCompatibleAbbreviationHiddenBySignature",",,,%s,,,%s,,,") a0 a1) - /// The exception definitions are not compatible because the exception abbreviations in the signature and implementation differ. The module contains the exception definition\n %s \nbut its signature specifies\n\t%s. - /// (Originally from ..\FSComp.txt:180) - static member ExceptionDefsNotCompatibleSignaturesDiffer(a0 : System.String, a1 : System.String) = (GetStringFunc("ExceptionDefsNotCompatibleSignaturesDiffer",",,,%s,,,%s,,,") a0 a1) - /// The exception definitions are not compatible because the exception declarations differ. The module contains the exception definition\n %s \nbut its signature specifies\n\t%s. - /// (Originally from ..\FSComp.txt:181) - static member ExceptionDefsNotCompatibleExceptionDeclarationsDiffer(a0 : System.String, a1 : System.String) = (GetStringFunc("ExceptionDefsNotCompatibleExceptionDeclarationsDiffer",",,,%s,,,%s,,,") a0 a1) - /// The exception definitions are not compatible because the field '%s' was required by the signature but was not specified by the implementation. The module contains the exception definition\n %s \nbut its signature specifies\n\t%s. - /// (Originally from ..\FSComp.txt:182) - static member ExceptionDefsNotCompatibleFieldInSigButNotImpl(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ExceptionDefsNotCompatibleFieldInSigButNotImpl",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// The exception definitions are not compatible because the field '%s' was present in the implementation but not in the signature. The module contains the exception definition\n %s \nbut its signature specifies\n\t%s. - /// (Originally from ..\FSComp.txt:183) - static member ExceptionDefsNotCompatibleFieldInImplButNotSig(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("ExceptionDefsNotCompatibleFieldInImplButNotSig",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// The exception definitions are not compatible because the order of the fields is different in the signature and implementation. The module contains the exception definition\n %s \nbut its signature specifies\n\t%s. - /// (Originally from ..\FSComp.txt:184) - static member ExceptionDefsNotCompatibleFieldOrderDiffers(a0 : System.String, a1 : System.String) = (GetStringFunc("ExceptionDefsNotCompatibleFieldOrderDiffers",",,,%s,,,%s,,,") a0 a1) - /// The namespace or module attributes differ between signature and implementation - /// (Originally from ..\FSComp.txt:185) - static member typrelModuleNamespaceAttributesDifferInSigAndImpl() = (355, GetStringFunc("typrelModuleNamespaceAttributesDifferInSigAndImpl",",,,") ) - /// This method is over-constrained in its type parameters - /// (Originally from ..\FSComp.txt:186) - static member typrelMethodIsOverconstrained() = (356, GetStringFunc("typrelMethodIsOverconstrained",",,,") ) - /// No implementations of '%s' had the correct number of arguments and type parameters. The required signature is '%s'. - /// (Originally from ..\FSComp.txt:187) - static member typrelOverloadNotFound(a0 : System.String, a1 : System.String) = (357, GetStringFunc("typrelOverloadNotFound",",,,%s,,,%s,,,") a0 a1) - /// The override for '%s' was ambiguous - /// (Originally from ..\FSComp.txt:188) - static member typrelOverrideWasAmbiguous(a0 : System.String) = (358, GetStringFunc("typrelOverrideWasAmbiguous",",,,%s,,,") a0) - /// More than one override implements '%s' - /// (Originally from ..\FSComp.txt:189) - static member typrelMoreThenOneOverride(a0 : System.String) = (359, GetStringFunc("typrelMoreThenOneOverride",",,,%s,,,") a0) - /// The method '%s' is sealed and cannot be overridden - /// (Originally from ..\FSComp.txt:190) - static member typrelMethodIsSealed(a0 : System.String) = (360, GetStringFunc("typrelMethodIsSealed",",,,%s,,,") a0) - /// The override '%s' implements more than one abstract slot, e.g. '%s' and '%s' - /// (Originally from ..\FSComp.txt:191) - static member typrelOverrideImplementsMoreThenOneSlot(a0 : System.String, a1 : System.String, a2 : System.String) = (361, GetStringFunc("typrelOverrideImplementsMoreThenOneSlot",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// Duplicate or redundant interface - /// (Originally from ..\FSComp.txt:192) - static member typrelDuplicateInterface() = (362, GetStringFunc("typrelDuplicateInterface",",,,") ) - /// The interface '%s' is included in multiple explicitly implemented interface types. Add an explicit implementation of this interface. - /// (Originally from ..\FSComp.txt:193) - static member typrelNeedExplicitImplementation(a0 : System.String) = (363, GetStringFunc("typrelNeedExplicitImplementation",",,,%s,,,") a0) - /// A named argument has been assigned more than one value - /// (Originally from ..\FSComp.txt:194) - static member typrelNamedArgumentHasBeenAssignedMoreThenOnce() = (364, GetStringFunc("typrelNamedArgumentHasBeenAssignedMoreThenOnce",",,,") ) - /// No implementation was given for '%s' - /// (Originally from ..\FSComp.txt:195) - static member typrelNoImplementationGiven(a0 : System.String) = (365, GetStringFunc("typrelNoImplementationGiven",",,,%s,,,") a0) - /// No implementation was given for '%s'. Note that all interface members must be implemented and listed under an appropriate 'interface' declaration, e.g. 'interface ... with member ...'. - /// (Originally from ..\FSComp.txt:196) - static member typrelNoImplementationGivenWithSuggestion(a0 : System.String) = (366, GetStringFunc("typrelNoImplementationGivenWithSuggestion",",,,%s,,,") a0) - /// The member '%s' does not have the correct number of arguments. The required signature is '%s'. - /// (Originally from ..\FSComp.txt:197) - static member typrelMemberDoesNotHaveCorrectNumberOfArguments(a0 : System.String, a1 : System.String) = (367, GetStringFunc("typrelMemberDoesNotHaveCorrectNumberOfArguments",",,,%s,,,%s,,,") a0 a1) - /// The member '%s' does not have the correct number of method type parameters. The required signature is '%s'. - /// (Originally from ..\FSComp.txt:198) - static member typrelMemberDoesNotHaveCorrectNumberOfTypeParameters(a0 : System.String, a1 : System.String) = (368, GetStringFunc("typrelMemberDoesNotHaveCorrectNumberOfTypeParameters",",,,%s,,,%s,,,") a0 a1) - /// The member '%s' does not have the correct kinds of generic parameters. The required signature is '%s'. - /// (Originally from ..\FSComp.txt:199) - static member typrelMemberDoesNotHaveCorrectKindsOfGenericParameters(a0 : System.String, a1 : System.String) = (369, GetStringFunc("typrelMemberDoesNotHaveCorrectKindsOfGenericParameters",",,,%s,,,%s,,,") a0 a1) - /// The member '%s' cannot be used to implement '%s'. The required signature is '%s'. - /// (Originally from ..\FSComp.txt:200) - static member typrelMemberCannotImplement(a0 : System.String, a1 : System.String, a2 : System.String) = (370, GetStringFunc("typrelMemberCannotImplement",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// Error while parsing embedded IL - /// (Originally from ..\FSComp.txt:201) - static member astParseEmbeddedILError() = (371, GetStringFunc("astParseEmbeddedILError",",,,") ) - /// Error while parsing embedded IL type - /// (Originally from ..\FSComp.txt:202) - static member astParseEmbeddedILTypeError() = (372, GetStringFunc("astParseEmbeddedILTypeError",",,,") ) - /// This indexer notation has been removed from the F# language - /// (Originally from ..\FSComp.txt:203) - static member astDeprecatedIndexerNotation() = (GetStringFunc("astDeprecatedIndexerNotation",",,,") ) - /// Invalid expression on left of assignment - /// (Originally from ..\FSComp.txt:204) - static member astInvalidExprLeftHandOfAssignment() = (374, GetStringFunc("astInvalidExprLeftHandOfAssignment",",,,") ) - /// The 'ReferenceEquality' attribute cannot be used on structs. Consider using the 'StructuralEquality' attribute instead, or implement an override for 'System.Object.Equals(obj)'. - /// (Originally from ..\FSComp.txt:205) - static member augNoRefEqualsOnStruct() = (376, GetStringFunc("augNoRefEqualsOnStruct",",,,") ) - /// This type uses an invalid mix of the attributes 'NoEquality', 'ReferenceEquality', 'StructuralEquality', 'NoComparison' and 'StructuralComparison' - /// (Originally from ..\FSComp.txt:206) - static member augInvalidAttrs() = (377, GetStringFunc("augInvalidAttrs",",,,") ) - /// The 'NoEquality' attribute must be used in conjunction with the 'NoComparison' attribute - /// (Originally from ..\FSComp.txt:207) - static member augNoEqualityNeedsNoComparison() = (378, GetStringFunc("augNoEqualityNeedsNoComparison",",,,") ) - /// The 'StructuralComparison' attribute must be used in conjunction with the 'StructuralEquality' attribute - /// (Originally from ..\FSComp.txt:208) - static member augStructCompNeedsStructEquality() = (379, GetStringFunc("augStructCompNeedsStructEquality",",,,") ) - /// The 'StructuralEquality' attribute must be used in conjunction with the 'NoComparison' or 'StructuralComparison' attributes - /// (Originally from ..\FSComp.txt:209) - static member augStructEqNeedsNoCompOrStructComp() = (380, GetStringFunc("augStructEqNeedsNoCompOrStructComp",",,,") ) - /// A type cannot have both the 'ReferenceEquality' and 'StructuralEquality' or 'StructuralComparison' attributes - /// (Originally from ..\FSComp.txt:210) - static member augTypeCantHaveRefEqAndStructAttrs() = (381, GetStringFunc("augTypeCantHaveRefEqAndStructAttrs",",,,") ) - /// Only record, union, exception and struct types may be augmented with the 'ReferenceEquality', 'StructuralEquality' and 'StructuralComparison' attributes - /// (Originally from ..\FSComp.txt:211) - static member augOnlyCertainTypesCanHaveAttrs() = (382, GetStringFunc("augOnlyCertainTypesCanHaveAttrs",",,,") ) - /// A type with attribute 'ReferenceEquality' cannot have an explicit implementation of 'Object.Equals(obj)', 'System.IEquatable<_>' or 'System.Collections.IStructuralEquatable' - /// (Originally from ..\FSComp.txt:212) - static member augRefEqCantHaveObjEquals() = (383, GetStringFunc("augRefEqCantHaveObjEquals",",,,") ) - /// A type with attribute 'CustomEquality' must have an explicit implementation of at least one of 'Object.Equals(obj)', 'System.IEquatable<_>' or 'System.Collections.IStructuralEquatable' - /// (Originally from ..\FSComp.txt:213) - static member augCustomEqNeedsObjEquals() = (384, GetStringFunc("augCustomEqNeedsObjEquals",",,,") ) - /// A type with attribute 'CustomComparison' must have an explicit implementation of at least one of 'System.IComparable' or 'System.Collections.IStructuralComparable' - /// (Originally from ..\FSComp.txt:214) - static member augCustomCompareNeedsIComp() = (385, GetStringFunc("augCustomCompareNeedsIComp",",,,") ) - /// A type with attribute 'NoEquality' should not usually have an explicit implementation of 'Object.Equals(obj)'. Disable this warning if this is intentional for interoperability purposes - /// (Originally from ..\FSComp.txt:215) - static member augNoEqNeedsNoObjEquals() = (386, GetStringFunc("augNoEqNeedsNoObjEquals",",,,") ) - /// A type with attribute 'NoComparison' should not usually have an explicit implementation of 'System.IComparable', 'System.IComparable<_>' or 'System.Collections.IStructuralComparable'. Disable this warning if this is intentional for interoperability purposes - /// (Originally from ..\FSComp.txt:216) - static member augNoCompCantImpIComp() = (386, GetStringFunc("augNoCompCantImpIComp",",,,") ) - /// The 'CustomEquality' attribute must be used in conjunction with the 'NoComparison' or 'CustomComparison' attributes - /// (Originally from ..\FSComp.txt:217) - static member augCustomEqNeedsNoCompOrCustomComp() = (387, GetStringFunc("augCustomEqNeedsNoCompOrCustomComp",",,,") ) - /// Positional specifiers are not permitted in format strings - /// (Originally from ..\FSComp.txt:218) - static member forPositionalSpecifiersNotPermitted() = (GetStringFunc("forPositionalSpecifiersNotPermitted",",,,") ) - /// Missing format specifier - /// (Originally from ..\FSComp.txt:219) - static member forMissingFormatSpecifier() = (GetStringFunc("forMissingFormatSpecifier",",,,") ) - /// '%s' flag set twice - /// (Originally from ..\FSComp.txt:220) - static member forFlagSetTwice(a0 : System.String) = (GetStringFunc("forFlagSetTwice",",,,%s,,,") a0) - /// Prefix flag (' ' or '+') set twice - /// (Originally from ..\FSComp.txt:221) - static member forPrefixFlagSpacePlusSetTwice() = (GetStringFunc("forPrefixFlagSpacePlusSetTwice",",,,") ) - /// The # formatting modifier is invalid in F# - /// (Originally from ..\FSComp.txt:222) - static member forHashSpecifierIsInvalid() = (GetStringFunc("forHashSpecifierIsInvalid",",,,") ) - /// Bad precision in format specifier - /// (Originally from ..\FSComp.txt:223) - static member forBadPrecision() = (GetStringFunc("forBadPrecision",",,,") ) - /// Bad width in format specifier - /// (Originally from ..\FSComp.txt:224) - static member forBadWidth() = (GetStringFunc("forBadWidth",",,,") ) - /// '%s' format does not support '0' flag - /// (Originally from ..\FSComp.txt:225) - static member forDoesNotSupportZeroFlag(a0 : System.String) = (GetStringFunc("forDoesNotSupportZeroFlag",",,,%s,,,") a0) - /// Precision missing after the '.' - /// (Originally from ..\FSComp.txt:226) - static member forPrecisionMissingAfterDot() = (GetStringFunc("forPrecisionMissingAfterDot",",,,") ) - /// '%s' format does not support precision - /// (Originally from ..\FSComp.txt:227) - static member forFormatDoesntSupportPrecision(a0 : System.String) = (GetStringFunc("forFormatDoesntSupportPrecision",",,,%s,,,") a0) - /// Bad format specifier (after l or L): Expected ld,li,lo,lu,lx or lX. In F# code you can use %%d, %%x, %%o or %%u instead, which are overloaded to work with all basic integer types. - /// (Originally from ..\FSComp.txt:228) - static member forBadFormatSpecifier() = (GetStringFunc("forBadFormatSpecifier",",,,") ) - /// The 'l' or 'L' in this format specifier is unnecessary. In F# code you can use %%d, %%x, %%o or %%u instead, which are overloaded to work with all basic integer types. - /// (Originally from ..\FSComp.txt:229) - static member forLIsUnnecessary() = (GetStringFunc("forLIsUnnecessary",",,,") ) - /// The 'h' or 'H' in this format specifier is unnecessary. You can use %%d, %%x, %%o or %%u instead, which are overloaded to work with all basic integer types. - /// (Originally from ..\FSComp.txt:230) - static member forHIsUnnecessary() = (GetStringFunc("forHIsUnnecessary",",,,") ) - /// '%s' does not support prefix '%s' flag - /// (Originally from ..\FSComp.txt:231) - static member forDoesNotSupportPrefixFlag(a0 : System.String, a1 : System.String) = (GetStringFunc("forDoesNotSupportPrefixFlag",",,,%s,,,%s,,,") a0 a1) - /// Bad format specifier: '%s' - /// (Originally from ..\FSComp.txt:232) - static member forBadFormatSpecifierGeneral(a0 : System.String) = (GetStringFunc("forBadFormatSpecifierGeneral",",,,%s,,,") a0) - /// System.Environment.Exit did not exit - /// (Originally from ..\FSComp.txt:233) - static member elSysEnvExitDidntExit() = (GetStringFunc("elSysEnvExitDidntExit",",,,") ) - /// The treatment of this operator is now handled directly by the F# compiler and its meaning cannot be redefined - /// (Originally from ..\FSComp.txt:234) - static member elDeprecatedOperator() = (GetStringFunc("elDeprecatedOperator",",,,") ) - /// A protected member is called or 'base' is being used. This is only allowed in the direct implementation of members since they could escape their object scope. - /// (Originally from ..\FSComp.txt:235) - static member chkProtectedOrBaseCalled() = (405, GetStringFunc("chkProtectedOrBaseCalled",",,,") ) - /// The byref-typed variable '%s' is used in an invalid way. Byrefs cannot be captured by closures or passed to inner functions. - /// (Originally from ..\FSComp.txt:236) - static member chkByrefUsedInInvalidWay(a0 : System.String) = (406, GetStringFunc("chkByrefUsedInInvalidWay",",,,%s,,,") a0) - /// The 'base' keyword is used in an invalid way. Base calls cannot be used in closures. Consider using a private member to make base calls. - /// (Originally from ..\FSComp.txt:237) - static member chkBaseUsedInInvalidWay() = (408, GetStringFunc("chkBaseUsedInInvalidWay",",,,") ) - /// The variable '%s' is used in an invalid way - /// (Originally from ..\FSComp.txt:238) - static member chkVariableUsedInInvalidWay(a0 : System.String) = (GetStringFunc("chkVariableUsedInInvalidWay",",,,%s,,,") a0) - /// The type '%s' is less accessible than the value, member or type '%s' it is used in. - /// (Originally from ..\FSComp.txt:239) - static member chkTypeLessAccessibleThanType(a0 : System.String, a1 : System.String) = (410, GetStringFunc("chkTypeLessAccessibleThanType",",,,%s,,,%s,,,") a0 a1) - /// 'System.Void' can only be used as 'typeof' in F# - /// (Originally from ..\FSComp.txt:240) - static member chkSystemVoidOnlyInTypeof() = (411, GetStringFunc("chkSystemVoidOnlyInTypeof",",,,") ) - /// A type instantiation involves a byref type. This is not permitted by the rules of Common IL. - /// (Originally from ..\FSComp.txt:241) - static member chkErrorUseOfByref() = (412, GetStringFunc("chkErrorUseOfByref",",,,") ) - /// Calls to 'reraise' may only occur directly in a handler of a try-with - /// (Originally from ..\FSComp.txt:242) - static member chkErrorContainsCallToRethrow() = (413, GetStringFunc("chkErrorContainsCallToRethrow",",,,") ) - /// Expression-splicing operators may only be used within quotations - /// (Originally from ..\FSComp.txt:243) - static member chkSplicingOnlyInQuotations() = (414, GetStringFunc("chkSplicingOnlyInQuotations",",,,") ) - /// First-class uses of the expression-splicing operator are not permitted - /// (Originally from ..\FSComp.txt:244) - static member chkNoFirstClassSplicing() = (415, GetStringFunc("chkNoFirstClassSplicing",",,,") ) - /// First-class uses of the address-of operators are not permitted - /// (Originally from ..\FSComp.txt:245) - static member chkNoFirstClassAddressOf() = (416, GetStringFunc("chkNoFirstClassAddressOf",",,,") ) - /// First-class uses of the 'reraise' function is not permitted - /// (Originally from ..\FSComp.txt:246) - static member chkNoFirstClassRethrow() = (417, GetStringFunc("chkNoFirstClassRethrow",",,,") ) - /// The byref typed value '%s' cannot be used at this point - /// (Originally from ..\FSComp.txt:247) - static member chkNoByrefAtThisPoint(a0 : System.String) = (418, GetStringFunc("chkNoByrefAtThisPoint",",,,%s,,,") a0) - /// 'base' values may only be used to make direct calls to the base implementations of overridden members - /// (Originally from ..\FSComp.txt:248) - static member chkLimitationsOfBaseKeyword() = (419, GetStringFunc("chkLimitationsOfBaseKeyword",",,,") ) - /// Object constructors cannot directly use try/with and try/finally prior to the initialization of the object. This includes constructs such as 'for x in ...' that may elaborate to uses of these constructs. This is a limitation imposed by Common IL. - /// (Originally from ..\FSComp.txt:249) - static member chkObjCtorsCantUseExceptionHandling() = (420, GetStringFunc("chkObjCtorsCantUseExceptionHandling",",,,") ) - /// The address of the variable '%s' cannot be used at this point - /// (Originally from ..\FSComp.txt:250) - static member chkNoAddressOfAtThisPoint(a0 : System.String) = (421, GetStringFunc("chkNoAddressOfAtThisPoint",",,,%s,,,") a0) - /// The address of the static field '%s' cannot be used at this point - /// (Originally from ..\FSComp.txt:251) - static member chkNoAddressStaticFieldAtThisPoint(a0 : System.String) = (422, GetStringFunc("chkNoAddressStaticFieldAtThisPoint",",,,%s,,,") a0) - /// The address of the field '%s' cannot be used at this point - /// (Originally from ..\FSComp.txt:252) - static member chkNoAddressFieldAtThisPoint(a0 : System.String) = (423, GetStringFunc("chkNoAddressFieldAtThisPoint",",,,%s,,,") a0) - /// The address of an array element cannot be used at this point - /// (Originally from ..\FSComp.txt:253) - static member chkNoAddressOfArrayElementAtThisPoint() = (424, GetStringFunc("chkNoAddressOfArrayElementAtThisPoint",",,,") ) - /// The type of a first-class function cannot contain byrefs - /// (Originally from ..\FSComp.txt:254) - static member chkFirstClassFuncNoByref() = (425, GetStringFunc("chkFirstClassFuncNoByref",",,,") ) - /// A method return type would contain byrefs which is not permitted - /// (Originally from ..\FSComp.txt:255) - static member chkReturnTypeNoByref() = (426, GetStringFunc("chkReturnTypeNoByref",",,,") ) - /// Invalid custom attribute value (not a constant or literal) - /// (Originally from ..\FSComp.txt:256) - static member chkInvalidCustAttrVal() = (428, GetStringFunc("chkInvalidCustAttrVal",",,,") ) - /// The attribute type '%s' has 'AllowMultiple=false'. Multiple instances of this attribute cannot be attached to a single language element. - /// (Originally from ..\FSComp.txt:257) - static member chkAttrHasAllowMultiFalse(a0 : System.String) = (429, GetStringFunc("chkAttrHasAllowMultiFalse",",,,%s,,,") a0) - /// The member '%s' is used in an invalid way. A use of '%s' has been inferred prior to its definition at or near '%s'. This is an invalid forward reference. - /// (Originally from ..\FSComp.txt:258) - static member chkMemberUsedInInvalidWay(a0 : System.String, a1 : System.String, a2 : System.String) = (430, GetStringFunc("chkMemberUsedInInvalidWay",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// A byref typed value would be stored here. Top-level let-bound byref values are not permitted. - /// (Originally from ..\FSComp.txt:259) - static member chkNoByrefAsTopValue() = (431, GetStringFunc("chkNoByrefAsTopValue",",,,") ) - /// [] terms cannot contain uses of the prefix splice operator '%%' - /// (Originally from ..\FSComp.txt:260) - static member chkReflectedDefCantSplice() = (432, GetStringFunc("chkReflectedDefCantSplice",",,,") ) - /// A function labeled with the 'EntryPointAttribute' attribute must be the last declaration in the last file in the compilation sequence. - /// (Originally from ..\FSComp.txt:261) - static member chkEntryPointUsage() = (433, GetStringFunc("chkEntryPointUsage",",,,") ) - /// compiled form of the union case - /// (Originally from ..\FSComp.txt:262) - static member chkUnionCaseCompiledForm() = (GetStringFunc("chkUnionCaseCompiledForm",",,,") ) - /// default augmentation of the union case - /// (Originally from ..\FSComp.txt:263) - static member chkUnionCaseDefaultAugmentation() = (GetStringFunc("chkUnionCaseDefaultAugmentation",",,,") ) - /// The property '%s' has the same name as a method in type '%s'. - /// (Originally from ..\FSComp.txt:264) - static member chkPropertySameNameMethod(a0 : System.String, a1 : System.String) = (434, GetStringFunc("chkPropertySameNameMethod",",,,%s,,,%s,,,") a0 a1) - /// The property '%s' of type '%s' has a getter and a setter that do not match. If one is abstract then the other must be as well. - /// (Originally from ..\FSComp.txt:265) - static member chkGetterSetterDoNotMatchAbstract(a0 : System.String, a1 : System.String) = (435, GetStringFunc("chkGetterSetterDoNotMatchAbstract",",,,%s,,,%s,,,") a0 a1) - /// The property '%s' has the same name as another property in type '%s', but one takes indexer arguments and the other does not. You may be missing an indexer argument to one of your properties. - /// (Originally from ..\FSComp.txt:266) - static member chkPropertySameNameIndexer(a0 : System.String, a1 : System.String) = (436, GetStringFunc("chkPropertySameNameIndexer",",,,%s,,,%s,,,") a0 a1) - /// A type would store a byref typed value. This is not permitted by Common IL. - /// (Originally from ..\FSComp.txt:267) - static member chkCantStoreByrefValue() = (437, GetStringFunc("chkCantStoreByrefValue",",,,") ) - /// Duplicate method. The method '%s' has the same name and signature as another method in type '%s'. - /// (Originally from ..\FSComp.txt:269) - static member chkDuplicateMethod(a0 : System.String, a1 : System.String) = (438, GetStringFunc("chkDuplicateMethod",",,,%s,,,%s,,,") a0 a1) - /// Duplicate method. The method '%s' has the same name and signature as another method in type '%s' once tuples, functions, units of measure and/or provided types are erased. - /// (Originally from ..\FSComp.txt:270) - static member chkDuplicateMethodWithSuffix(a0 : System.String, a1 : System.String) = (438, GetStringFunc("chkDuplicateMethodWithSuffix",",,,%s,,,%s,,,") a0 a1) - /// The method '%s' has curried arguments but has the same name as another method in type '%s'. Methods with curried arguments cannot be overloaded. Consider using a method taking tupled arguments. - /// (Originally from ..\FSComp.txt:271) - static member chkDuplicateMethodCurried(a0 : System.String, a1 : System.String) = (439, GetStringFunc("chkDuplicateMethodCurried",",,,%s,,,%s,,,") a0 a1) - /// Methods with curried arguments cannot declare 'out', 'ParamArray', 'optional', 'ReflectedDefinition', 'byref', 'CallerLineNumber', 'CallerMemberName', or 'CallerFilePath' arguments - /// (Originally from ..\FSComp.txt:272) - static member chkCurriedMethodsCantHaveOutParams() = (440, GetStringFunc("chkCurriedMethodsCantHaveOutParams",",,,") ) - /// Duplicate property. The property '%s' has the same name and signature as another property in type '%s'. - /// (Originally from ..\FSComp.txt:273) - static member chkDuplicateProperty(a0 : System.String, a1 : System.String) = (441, GetStringFunc("chkDuplicateProperty",",,,%s,,,%s,,,") a0 a1) - /// Duplicate property. The property '%s' has the same name and signature as another property in type '%s' once tuples, functions, units of measure and/or provided types are erased. - /// (Originally from ..\FSComp.txt:274) - static member chkDuplicatePropertyWithSuffix(a0 : System.String, a1 : System.String) = (441, GetStringFunc("chkDuplicatePropertyWithSuffix",",,,%s,,,%s,,,") a0 a1) - /// Duplicate method. The abstract method '%s' has the same name and signature as an abstract method in an inherited type. - /// (Originally from ..\FSComp.txt:275) - static member chkDuplicateMethodInheritedType(a0 : System.String) = (442, GetStringFunc("chkDuplicateMethodInheritedType",",,,%s,,,") a0) - /// Duplicate method. The abstract method '%s' has the same name and signature as an abstract method in an inherited type once tuples, functions, units of measure and/or provided types are erased. - /// (Originally from ..\FSComp.txt:276) - static member chkDuplicateMethodInheritedTypeWithSuffix(a0 : System.String) = (442, GetStringFunc("chkDuplicateMethodInheritedTypeWithSuffix",",,,%s,,,") a0) - /// This type implements the same interface at different generic instantiations '%s' and '%s'. This is not permitted in this version of F#. - /// (Originally from ..\FSComp.txt:277) - static member chkMultipleGenericInterfaceInstantiations(a0 : System.String, a1 : System.String) = (443, GetStringFunc("chkMultipleGenericInterfaceInstantiations",",,,%s,,,%s,,,") a0 a1) - /// The type of a field using the 'DefaultValue' attribute must admit default initialization, i.e. have 'null' as a proper value or be a struct type whose fields all admit default initialization. You can use 'DefaultValue(false)' to disable this check - /// (Originally from ..\FSComp.txt:278) - static member chkValueWithDefaultValueMustHaveDefaultValue() = (444, GetStringFunc("chkValueWithDefaultValueMustHaveDefaultValue",",,,") ) - /// The type abbreviation contains byrefs. This is not permitted by F#. - /// (Originally from ..\FSComp.txt:279) - static member chkNoByrefInTypeAbbrev() = (445, GetStringFunc("chkNoByrefInTypeAbbrev",",,,") ) - /// The variable '%s' is bound in a quotation but is used as part of a spliced expression. This is not permitted since it may escape its scope. - /// (Originally from ..\FSComp.txt:280) - static member crefBoundVarUsedInSplice(a0 : System.String) = (446, GetStringFunc("crefBoundVarUsedInSplice",",,,%s,,,") a0) - /// Quotations cannot contain uses of generic expressions - /// (Originally from ..\FSComp.txt:281) - static member crefQuotationsCantContainGenericExprs() = (447, GetStringFunc("crefQuotationsCantContainGenericExprs",",,,") ) - /// Quotations cannot contain function definitions that are inferred or declared to be generic. Consider adding some type constraints to make this a valid quoted expression. - /// (Originally from ..\FSComp.txt:282) - static member crefQuotationsCantContainGenericFunctions() = (448, GetStringFunc("crefQuotationsCantContainGenericFunctions",",,,") ) - /// Quotations cannot contain object expressions - /// (Originally from ..\FSComp.txt:283) - static member crefQuotationsCantContainObjExprs() = (449, GetStringFunc("crefQuotationsCantContainObjExprs",",,,") ) - /// Quotations cannot contain expressions that take the address of a field - /// (Originally from ..\FSComp.txt:284) - static member crefQuotationsCantContainAddressOf() = (450, GetStringFunc("crefQuotationsCantContainAddressOf",",,,") ) - /// Quotations cannot contain expressions that fetch static fields - /// (Originally from ..\FSComp.txt:285) - static member crefQuotationsCantContainStaticFieldRef() = (451, GetStringFunc("crefQuotationsCantContainStaticFieldRef",",,,") ) - /// Quotations cannot contain inline assembly code or pattern matching on arrays - /// (Originally from ..\FSComp.txt:286) - static member crefQuotationsCantContainInlineIL() = (452, GetStringFunc("crefQuotationsCantContainInlineIL",",,,") ) - /// Quotations cannot contain descending for loops - /// (Originally from ..\FSComp.txt:287) - static member crefQuotationsCantContainDescendingForLoops() = (453, GetStringFunc("crefQuotationsCantContainDescendingForLoops",",,,") ) - /// Quotations cannot contain expressions that fetch union case indexes - /// (Originally from ..\FSComp.txt:288) - static member crefQuotationsCantFetchUnionIndexes() = (454, GetStringFunc("crefQuotationsCantFetchUnionIndexes",",,,") ) - /// Quotations cannot contain expressions that set union case fields - /// (Originally from ..\FSComp.txt:289) - static member crefQuotationsCantSetUnionFields() = (455, GetStringFunc("crefQuotationsCantSetUnionFields",",,,") ) - /// Quotations cannot contain expressions that set fields in exception values - /// (Originally from ..\FSComp.txt:290) - static member crefQuotationsCantSetExceptionFields() = (456, GetStringFunc("crefQuotationsCantSetExceptionFields",",,,") ) - /// Quotations cannot contain expressions that require byref pointers - /// (Originally from ..\FSComp.txt:291) - static member crefQuotationsCantRequireByref() = (457, GetStringFunc("crefQuotationsCantRequireByref",",,,") ) - /// Quotations cannot contain expressions that make member constraint calls, or uses of operators that implicitly resolve to a member constraint call - /// (Originally from ..\FSComp.txt:292) - static member crefQuotationsCantCallTraitMembers() = (458, GetStringFunc("crefQuotationsCantCallTraitMembers",",,,") ) - /// Quotations cannot contain this kind of constant - /// (Originally from ..\FSComp.txt:293) - static member crefQuotationsCantContainThisConstant() = (459, GetStringFunc("crefQuotationsCantContainThisConstant",",,,") ) - /// Quotations cannot contain this kind of pattern match - /// (Originally from ..\FSComp.txt:294) - static member crefQuotationsCantContainThisPatternMatch() = (460, GetStringFunc("crefQuotationsCantContainThisPatternMatch",",,,") ) - /// Quotations cannot contain array pattern matching - /// (Originally from ..\FSComp.txt:295) - static member crefQuotationsCantContainArrayPatternMatching() = (461, GetStringFunc("crefQuotationsCantContainArrayPatternMatching",",,,") ) - /// Quotations cannot contain this kind of type - /// (Originally from ..\FSComp.txt:296) - static member crefQuotationsCantContainThisType() = (462, GetStringFunc("crefQuotationsCantContainThisType",",,,") ) - /// The declared type parameter '%s' cannot be used here since the type parameter cannot be resolved at compile time - /// (Originally from ..\FSComp.txt:297) - static member csTypeCannotBeResolvedAtCompileTime(a0 : System.String) = (GetStringFunc("csTypeCannotBeResolvedAtCompileTime",",,,%s,,,") a0) - /// This code is less generic than indicated by its annotations. A unit-of-measure specified using '_' has been determined to be '1', i.e. dimensionless. Consider making the code generic, or removing the use of '_'. - /// (Originally from ..\FSComp.txt:298) - static member csCodeLessGeneric() = (464, GetStringFunc("csCodeLessGeneric",",,,") ) - /// Type inference problem too complicated (maximum iteration depth reached). Consider adding further type annotations. - /// (Originally from ..\FSComp.txt:299) - static member csTypeInferenceMaxDepth() = (465, GetStringFunc("csTypeInferenceMaxDepth",",,,") ) - /// Expected arguments to an instance member - /// (Originally from ..\FSComp.txt:300) - static member csExpectedArguments() = (GetStringFunc("csExpectedArguments",",,,") ) - /// This indexer expects %d arguments but is here given %d - /// (Originally from ..\FSComp.txt:301) - static member csIndexArgumentMismatch(a0 : System.Int32, a1 : System.Int32) = (GetStringFunc("csIndexArgumentMismatch",",,,%d,,,%d,,,") a0 a1) - /// Expecting a type supporting the operator '%s' but given a function type. You may be missing an argument to a function. - /// (Originally from ..\FSComp.txt:302) - static member csExpectTypeWithOperatorButGivenFunction(a0 : System.String) = (GetStringFunc("csExpectTypeWithOperatorButGivenFunction",",,,%s,,,") a0) - /// Expecting a type supporting the operator '%s' but given a tuple type - /// (Originally from ..\FSComp.txt:303) - static member csExpectTypeWithOperatorButGivenTuple(a0 : System.String) = (GetStringFunc("csExpectTypeWithOperatorButGivenTuple",",,,%s,,,") a0) - /// None of the types '%s' support the operator '%s' - /// (Originally from ..\FSComp.txt:304) - static member csTypesDoNotSupportOperator(a0 : System.String, a1 : System.String) = (GetStringFunc("csTypesDoNotSupportOperator",",,,%s,,,%s,,,") a0 a1) - /// The type '%s' does not support the operator '%s' - /// (Originally from ..\FSComp.txt:305) - static member csTypeDoesNotSupportOperator(a0 : System.String, a1 : System.String) = (GetStringFunc("csTypeDoesNotSupportOperator",",,,%s,,,%s,,,") a0 a1) - /// None of the types '%s' support the operator '%s'. Consider opening the module 'Microsoft.FSharp.Linq.NullableOperators'. - /// (Originally from ..\FSComp.txt:306) - static member csTypesDoNotSupportOperatorNullable(a0 : System.String, a1 : System.String) = (GetStringFunc("csTypesDoNotSupportOperatorNullable",",,,%s,,,%s,,,") a0 a1) - /// The type '%s' does not support the operator '%s'. Consider opening the module 'Microsoft.FSharp.Linq.NullableOperators'. - /// (Originally from ..\FSComp.txt:307) - static member csTypeDoesNotSupportOperatorNullable(a0 : System.String, a1 : System.String) = (GetStringFunc("csTypeDoesNotSupportOperatorNullable",",,,%s,,,%s,,,") a0 a1) - /// The type '%s' does not support a conversion to the type '%s' - /// (Originally from ..\FSComp.txt:308) - static member csTypeDoesNotSupportConversion(a0 : System.String, a1 : System.String) = (GetStringFunc("csTypeDoesNotSupportConversion",",,,%s,,,%s,,,") a0 a1) - /// The type '%s' has a method '%s' (full name '%s'), but the method is static - /// (Originally from ..\FSComp.txt:309) - static member csMethodFoundButIsStatic(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("csMethodFoundButIsStatic",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// The type '%s' has a method '%s' (full name '%s'), but the method is not static - /// (Originally from ..\FSComp.txt:310) - static member csMethodFoundButIsNotStatic(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("csMethodFoundButIsNotStatic",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// The constraints 'struct' and 'not struct' are inconsistent - /// (Originally from ..\FSComp.txt:311) - static member csStructConstraintInconsistent() = (472, GetStringFunc("csStructConstraintInconsistent",",,,") ) - /// The type '%s' does not have 'null' as a proper value - /// (Originally from ..\FSComp.txt:312) - static member csTypeDoesNotHaveNull(a0 : System.String) = (GetStringFunc("csTypeDoesNotHaveNull",",,,%s,,,") a0) - /// The type '%s' does not have 'null' as a proper value. To create a null value for a Nullable type use 'System.Nullable()'. - /// (Originally from ..\FSComp.txt:313) - static member csNullableTypeDoesNotHaveNull(a0 : System.String) = (GetStringFunc("csNullableTypeDoesNotHaveNull",",,,%s,,,") a0) - /// The type '%s' does not support the 'comparison' constraint because it has the 'NoComparison' attribute - /// (Originally from ..\FSComp.txt:314) - static member csTypeDoesNotSupportComparison1(a0 : System.String) = (GetStringFunc("csTypeDoesNotSupportComparison1",",,,%s,,,") a0) - /// The type '%s' does not support the 'comparison' constraint. For example, it does not support the 'System.IComparable' interface - /// (Originally from ..\FSComp.txt:315) - static member csTypeDoesNotSupportComparison2(a0 : System.String) = (GetStringFunc("csTypeDoesNotSupportComparison2",",,,%s,,,") a0) - /// The type '%s' does not support the 'comparison' constraint because it is a record, union or struct with one or more structural element types which do not support the 'comparison' constraint. Either avoid the use of comparison with this type, or add the 'StructuralComparison' attribute to the type to determine which field type does not support comparison - /// (Originally from ..\FSComp.txt:316) - static member csTypeDoesNotSupportComparison3(a0 : System.String) = (GetStringFunc("csTypeDoesNotSupportComparison3",",,,%s,,,") a0) - /// The type '%s' does not support the 'equality' constraint because it has the 'NoEquality' attribute - /// (Originally from ..\FSComp.txt:317) - static member csTypeDoesNotSupportEquality1(a0 : System.String) = (GetStringFunc("csTypeDoesNotSupportEquality1",",,,%s,,,") a0) - /// The type '%s' does not support the 'equality' constraint because it is a function type - /// (Originally from ..\FSComp.txt:318) - static member csTypeDoesNotSupportEquality2(a0 : System.String) = (GetStringFunc("csTypeDoesNotSupportEquality2",",,,%s,,,") a0) - /// The type '%s' does not support the 'equality' constraint because it is a record, union or struct with one or more structural element types which do not support the 'equality' constraint. Either avoid the use of equality with this type, or add the 'StructuralEquality' attribute to the type to determine which field type does not support equality - /// (Originally from ..\FSComp.txt:319) - static member csTypeDoesNotSupportEquality3(a0 : System.String) = (GetStringFunc("csTypeDoesNotSupportEquality3",",,,%s,,,") a0) - /// The type '%s' is not a CLI enum type - /// (Originally from ..\FSComp.txt:320) - static member csTypeIsNotEnumType(a0 : System.String) = (GetStringFunc("csTypeIsNotEnumType",",,,%s,,,") a0) - /// The type '%s' has a non-standard delegate type - /// (Originally from ..\FSComp.txt:321) - static member csTypeHasNonStandardDelegateType(a0 : System.String) = (GetStringFunc("csTypeHasNonStandardDelegateType",",,,%s,,,") a0) - /// The type '%s' is not a CLI delegate type - /// (Originally from ..\FSComp.txt:322) - static member csTypeIsNotDelegateType(a0 : System.String) = (GetStringFunc("csTypeIsNotDelegateType",",,,%s,,,") a0) - /// This type parameter cannot be instantiated to 'Nullable'. This is a restriction imposed in order to ensure the meaning of 'null' in some CLI languages is not confusing when used in conjunction with 'Nullable' values. - /// (Originally from ..\FSComp.txt:323) - static member csTypeParameterCannotBeNullable() = (GetStringFunc("csTypeParameterCannotBeNullable",",,,") ) - /// A generic construct requires that the type '%s' is a CLI or F# struct type - /// (Originally from ..\FSComp.txt:324) - static member csGenericConstructRequiresStructType(a0 : System.String) = (GetStringFunc("csGenericConstructRequiresStructType",",,,%s,,,") a0) - /// A generic construct requires that the type '%s' is an unmanaged type - /// (Originally from ..\FSComp.txt:325) - static member csGenericConstructRequiresUnmanagedType(a0 : System.String) = (GetStringFunc("csGenericConstructRequiresUnmanagedType",",,,%s,,,") a0) - /// The type '%s' is not compatible with any of the types %s, arising from the use of a printf-style format string - /// (Originally from ..\FSComp.txt:326) - static member csTypeNotCompatibleBecauseOfPrintf(a0 : System.String, a1 : System.String) = (GetStringFunc("csTypeNotCompatibleBecauseOfPrintf",",,,%s,,,%s,,,") a0 a1) - /// A generic construct requires that the type '%s' have reference semantics, but it does not, i.e. it is a struct - /// (Originally from ..\FSComp.txt:327) - static member csGenericConstructRequiresReferenceSemantics(a0 : System.String) = (GetStringFunc("csGenericConstructRequiresReferenceSemantics",",,,%s,,,") a0) - /// A generic construct requires that the type '%s' be non-abstract - /// (Originally from ..\FSComp.txt:328) - static member csGenericConstructRequiresNonAbstract(a0 : System.String) = (GetStringFunc("csGenericConstructRequiresNonAbstract",",,,%s,,,") a0) - /// A generic construct requires that the type '%s' have a public default constructor - /// (Originally from ..\FSComp.txt:329) - static member csGenericConstructRequiresPublicDefaultConstructor(a0 : System.String) = (GetStringFunc("csGenericConstructRequiresPublicDefaultConstructor",",,,%s,,,") a0) - /// Type instantiation length mismatch - /// (Originally from ..\FSComp.txt:330) - static member csTypeInstantiationLengthMismatch() = (483, GetStringFunc("csTypeInstantiationLengthMismatch",",,,") ) - /// Optional arguments not permitted here - /// (Originally from ..\FSComp.txt:331) - static member csOptionalArgumentNotPermittedHere() = (484, GetStringFunc("csOptionalArgumentNotPermittedHere",",,,") ) - /// %s is not a static member - /// (Originally from ..\FSComp.txt:332) - static member csMemberIsNotStatic(a0 : System.String) = (485, GetStringFunc("csMemberIsNotStatic",",,,%s,,,") a0) - /// %s is not an instance member - /// (Originally from ..\FSComp.txt:333) - static member csMemberIsNotInstance(a0 : System.String) = (486, GetStringFunc("csMemberIsNotInstance",",,,%s,,,") a0) - /// Argument length mismatch - /// (Originally from ..\FSComp.txt:334) - static member csArgumentLengthMismatch() = (487, GetStringFunc("csArgumentLengthMismatch",",,,") ) - /// The argument types don't match - /// (Originally from ..\FSComp.txt:335) - static member csArgumentTypesDoNotMatch() = (488, GetStringFunc("csArgumentTypesDoNotMatch",",,,") ) - /// This method expects a CLI 'params' parameter in this position. 'params' is a way of passing a variable number of arguments to a method in languages such as C#. Consider passing an array for this argument - /// (Originally from ..\FSComp.txt:336) - static member csMethodExpectsParams() = (489, GetStringFunc("csMethodExpectsParams",",,,") ) - /// The member or object constructor '%s' is not %s - /// (Originally from ..\FSComp.txt:337) - static member csMemberIsNotAccessible(a0 : System.String, a1 : System.String) = (490, GetStringFunc("csMemberIsNotAccessible",",,,%s,,,%s,,,") a0 a1) - /// The member or object constructor '%s' is not %s. 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. - /// (Originally from ..\FSComp.txt:338) - static member csMemberIsNotAccessible2(a0 : System.String, a1 : System.String) = (491, GetStringFunc("csMemberIsNotAccessible2",",,,%s,,,%s,,,") a0 a1) - /// %s is not a static method - /// (Originally from ..\FSComp.txt:339) - static member csMethodIsNotAStaticMethod(a0 : System.String) = (492, GetStringFunc("csMethodIsNotAStaticMethod",",,,%s,,,") a0) - /// %s is not an instance method - /// (Originally from ..\FSComp.txt:340) - static member csMethodIsNotAnInstanceMethod(a0 : System.String) = (493, GetStringFunc("csMethodIsNotAnInstanceMethod",",,,%s,,,") a0) - /// The member or object constructor '%s' has no argument or settable return property '%s'. %s. - /// (Originally from ..\FSComp.txt:341) - static member csMemberHasNoArgumentOrReturnProperty(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("csMemberHasNoArgumentOrReturnProperty",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// The object constructor '%s' has no argument or settable return property '%s'. %s. - /// (Originally from ..\FSComp.txt:342) - static member csCtorHasNoArgumentOrReturnProperty(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("csCtorHasNoArgumentOrReturnProperty",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// The required signature is %s - /// (Originally from ..\FSComp.txt:343) - static member csRequiredSignatureIs(a0 : System.String) = (495, GetStringFunc("csRequiredSignatureIs",",,,%s,,,") a0) - /// The member or object constructor '%s' requires %d argument(s). The required signature is '%s'. - /// (Originally from ..\FSComp.txt:344) - static member csMemberSignatureMismatch(a0 : System.String, a1 : System.Int32, a2 : System.String) = (496, GetStringFunc("csMemberSignatureMismatch",",,,%s,,,%d,,,%s,,,") a0 a1 a2) - /// The member or object constructor '%s' requires %d additional argument(s). The required signature is '%s'. - /// (Originally from ..\FSComp.txt:345) - static member csMemberSignatureMismatch2(a0 : System.String, a1 : System.Int32, a2 : System.String) = (497, GetStringFunc("csMemberSignatureMismatch2",",,,%s,,,%d,,,%s,,,") a0 a1 a2) - /// The member or object constructor '%s' requires %d argument(s). The required signature is '%s'. Some names for missing arguments are %s. - /// (Originally from ..\FSComp.txt:346) - static member csMemberSignatureMismatch3(a0 : System.String, a1 : System.Int32, a2 : System.String, a3 : System.String) = (498, GetStringFunc("csMemberSignatureMismatch3",",,,%s,,,%d,,,%s,,,%s,,,") a0 a1 a2 a3) - /// The member or object constructor '%s' requires %d additional argument(s). The required signature is '%s'. Some names for missing arguments are %s. - /// (Originally from ..\FSComp.txt:347) - static member csMemberSignatureMismatch4(a0 : System.String, a1 : System.Int32, a2 : System.String, a3 : System.String) = (499, GetStringFunc("csMemberSignatureMismatch4",",,,%s,,,%d,,,%s,,,%s,,,") a0 a1 a2 a3) - /// The member or object constructor '%s' requires %d argument(s) but is here given %d unnamed and %d named argument(s). The required signature is '%s'. - /// (Originally from ..\FSComp.txt:348) - static member csMemberSignatureMismatchArityNamed(a0 : System.String, a1 : System.Int32, a2 : System.Int32, a3 : System.Int32, a4 : System.String) = (500, GetStringFunc("csMemberSignatureMismatchArityNamed",",,,%s,,,%d,,,%d,,,%d,,,%s,,,") a0 a1 a2 a3 a4) - /// The member or object constructor '%s' takes %d argument(s) but is here given %d. The required signature is '%s'. - /// (Originally from ..\FSComp.txt:349) - static member csMemberSignatureMismatchArity(a0 : System.String, a1 : System.Int32, a2 : System.Int32, a3 : System.String) = (501, GetStringFunc("csMemberSignatureMismatchArity",",,,%s,,,%d,,,%d,,,%s,,,") a0 a1 a2 a3) - /// The object constructor '%s' takes %d argument(s) but is here given %d. The required signature is '%s'. - /// (Originally from ..\FSComp.txt:350) - static member csCtorSignatureMismatchArity(a0 : System.String, a1 : System.Int32, a2 : System.Int32, a3 : System.String) = (501, GetStringFunc("csCtorSignatureMismatchArity",",,,%s,,,%d,,,%d,,,%s,,,") a0 a1 a2 a3) - /// The object constructor '%s' takes %d argument(s) but is here given %d. The required signature is '%s'. If some of the arguments are meant to assign values to properties, consider separating those arguments with a comma (','). - /// (Originally from ..\FSComp.txt:351) - static member csCtorSignatureMismatchArityProp(a0 : System.String, a1 : System.Int32, a2 : System.Int32, a3 : System.String) = (501, GetStringFunc("csCtorSignatureMismatchArityProp",",,,%s,,,%d,,,%d,,,%s,,,") a0 a1 a2 a3) - /// The member or object constructor '%s' takes %d type argument(s) but is here given %d. The required signature is '%s'. - /// (Originally from ..\FSComp.txt:352) - static member csMemberSignatureMismatchArityType(a0 : System.String, a1 : System.Int32, a2 : System.Int32, a3 : System.String) = (502, GetStringFunc("csMemberSignatureMismatchArityType",",,,%s,,,%d,,,%d,,,%s,,,") a0 a1 a2 a3) - /// A member or object constructor '%s' taking %d arguments is not accessible from this code location. All accessible versions of method '%s' take %d arguments. - /// (Originally from ..\FSComp.txt:353) - static member csMemberNotAccessible(a0 : System.String, a1 : System.Int32, a2 : System.String, a3 : System.Int32) = (503, GetStringFunc("csMemberNotAccessible",",,,%s,,,%d,,,%s,,,%d,,,") a0 a1 a2 a3) - /// Incorrect generic instantiation. No %s member named '%s' takes %d generic arguments. - /// (Originally from ..\FSComp.txt:354) - static member csIncorrectGenericInstantiation(a0 : System.String, a1 : System.String, a2 : System.Int32) = (504, GetStringFunc("csIncorrectGenericInstantiation",",,,%s,,,%s,,,%d,,,") a0 a1 a2) - /// The member or object constructor '%s' does not take %d argument(s). An overload was found taking %d arguments. - /// (Originally from ..\FSComp.txt:355) - static member csMemberOverloadArityMismatch(a0 : System.String, a1 : System.Int32, a2 : System.Int32) = (505, GetStringFunc("csMemberOverloadArityMismatch",",,,%s,,,%d,,,%d,,,") a0 a1 a2) - /// No %s member or object constructor named '%s' takes %d arguments - /// (Originally from ..\FSComp.txt:356) - static member csNoMemberTakesTheseArguments(a0 : System.String, a1 : System.String, a2 : System.Int32) = (506, GetStringFunc("csNoMemberTakesTheseArguments",",,,%s,,,%s,,,%d,,,") a0 a1 a2) - /// No %s member or object constructor named '%s' takes %d arguments. Note the call to this member also provides %d named arguments. - /// (Originally from ..\FSComp.txt:357) - static member csNoMemberTakesTheseArguments2(a0 : System.String, a1 : System.String, a2 : System.Int32, a3 : System.Int32) = (507, GetStringFunc("csNoMemberTakesTheseArguments2",",,,%s,,,%s,,,%d,,,%d,,,") a0 a1 a2 a3) - /// No %s member or object constructor named '%s' takes %d arguments. The named argument '%s' doesn't correspond to any argument or settable return property for any overload. - /// (Originally from ..\FSComp.txt:358) - static member csNoMemberTakesTheseArguments3(a0 : System.String, a1 : System.String, a2 : System.Int32, a3 : System.String) = (508, GetStringFunc("csNoMemberTakesTheseArguments3",",,,%s,,,%s,,,%d,,,%s,,,") a0 a1 a2 a3) - /// Method or object constructor '%s' not found - /// (Originally from ..\FSComp.txt:359) - static member csMethodNotFound(a0 : System.String) = (509, GetStringFunc("csMethodNotFound",",,,%s,,,") a0) - /// No overloads match for method '%s'. - /// (Originally from ..\FSComp.txt:360) - static member csNoOverloadsFound(a0 : System.String) = (GetStringFunc("csNoOverloadsFound",",,,%s,,,") a0) - /// A unique overload for method '%s' could not be determined based on type information prior to this program point. A type annotation may be needed. - /// (Originally from ..\FSComp.txt:361) - static member csMethodIsOverloaded(a0 : System.String) = (GetStringFunc("csMethodIsOverloaded",",,,%s,,,") a0) - /// Candidates: %s - /// (Originally from ..\FSComp.txt:362) - static member csCandidates(a0 : System.String) = (GetStringFunc("csCandidates",",,,%s,,,") a0) - /// The available overloads are shown below. - /// (Originally from ..\FSComp.txt:363) - static member csSeeAvailableOverloads() = (GetStringFunc("csSeeAvailableOverloads",",,,") ) - /// Accessibility modifiers are not permitted on 'do' bindings, but '%s' was given. - /// (Originally from ..\FSComp.txt:364) - static member parsDoCannotHaveVisibilityDeclarations(a0 : System.String) = (512, GetStringFunc("parsDoCannotHaveVisibilityDeclarations",",,,%s,,,") a0) - /// End of file in #if section begun at or after here - /// (Originally from ..\FSComp.txt:365) - static member parsEofInHashIf() = (513, GetStringFunc("parsEofInHashIf",",,,") ) - /// End of file in string begun at or before here - /// (Originally from ..\FSComp.txt:366) - static member parsEofInString() = (514, GetStringFunc("parsEofInString",",,,") ) - /// End of file in verbatim string begun at or before here - /// (Originally from ..\FSComp.txt:367) - static member parsEofInVerbatimString() = (515, GetStringFunc("parsEofInVerbatimString",",,,") ) - /// End of file in comment begun at or before here - /// (Originally from ..\FSComp.txt:368) - static member parsEofInComment() = (516, GetStringFunc("parsEofInComment",",,,") ) - /// End of file in string embedded in comment begun at or before here - /// (Originally from ..\FSComp.txt:369) - static member parsEofInStringInComment() = (517, GetStringFunc("parsEofInStringInComment",",,,") ) - /// End of file in verbatim string embedded in comment begun at or before here - /// (Originally from ..\FSComp.txt:370) - static member parsEofInVerbatimStringInComment() = (518, GetStringFunc("parsEofInVerbatimStringInComment",",,,") ) - /// End of file in IF-OCAML section begun at or before here - /// (Originally from ..\FSComp.txt:371) - static member parsEofInIfOcaml() = (519, GetStringFunc("parsEofInIfOcaml",",,,") ) - /// End of file in directive begun at or before here - /// (Originally from ..\FSComp.txt:372) - static member parsEofInDirective() = (520, GetStringFunc("parsEofInDirective",",,,") ) - /// No #endif found for #if or #else - /// (Originally from ..\FSComp.txt:373) - static member parsNoHashEndIfFound() = (521, GetStringFunc("parsNoHashEndIfFound",",,,") ) - /// Attributes have been ignored in this construct - /// (Originally from ..\FSComp.txt:374) - static member parsAttributesIgnored() = (522, GetStringFunc("parsAttributesIgnored",",,,") ) - /// 'use' bindings are not permitted in primary constructors - /// (Originally from ..\FSComp.txt:375) - static member parsUseBindingsIllegalInImplicitClassConstructors() = (523, GetStringFunc("parsUseBindingsIllegalInImplicitClassConstructors",",,,") ) - /// 'use' bindings are not permitted in modules and are treated as 'let' bindings - /// (Originally from ..\FSComp.txt:376) - static member parsUseBindingsIllegalInModules() = (524, GetStringFunc("parsUseBindingsIllegalInModules",",,,") ) - /// An integer for loop must use a simple identifier - /// (Originally from ..\FSComp.txt:377) - static member parsIntegerForLoopRequiresSimpleIdentifier() = (525, GetStringFunc("parsIntegerForLoopRequiresSimpleIdentifier",",,,") ) - /// At most one 'with' augmentation is permitted - /// (Originally from ..\FSComp.txt:378) - static member parsOnlyOneWithAugmentationAllowed() = (526, GetStringFunc("parsOnlyOneWithAugmentationAllowed",",,,") ) - /// A semicolon is not expected at this point - /// (Originally from ..\FSComp.txt:379) - static member parsUnexpectedSemicolon() = (527, GetStringFunc("parsUnexpectedSemicolon",",,,") ) - /// Unexpected end of input - /// (Originally from ..\FSComp.txt:380) - static member parsUnexpectedEndOfFile() = (528, GetStringFunc("parsUnexpectedEndOfFile",",,,") ) - /// Accessibility modifiers are not permitted here, but '%s' was given. - /// (Originally from ..\FSComp.txt:381) - static member parsUnexpectedVisibilityDeclaration(a0 : System.String) = (529, GetStringFunc("parsUnexpectedVisibilityDeclaration",",,,%s,,,") a0) - /// Only '#' compiler directives may occur prior to the first 'namespace' declaration - /// (Originally from ..\FSComp.txt:382) - static member parsOnlyHashDirectivesAllowed() = (530, GetStringFunc("parsOnlyHashDirectivesAllowed",",,,") ) - /// Accessibility modifiers should come immediately prior to the identifier naming a construct - /// (Originally from ..\FSComp.txt:383) - static member parsVisibilityDeclarationsShouldComePriorToIdentifier() = (531, GetStringFunc("parsVisibilityDeclarationsShouldComePriorToIdentifier",",,,") ) - /// Files should begin with either a namespace or module declaration, e.g. 'namespace SomeNamespace.SubNamespace' or 'module SomeNamespace.SomeModule', but not both. To define a module within a namespace use 'module SomeModule = ...' - /// (Originally from ..\FSComp.txt:384) - static member parsNamespaceOrModuleNotBoth() = (532, GetStringFunc("parsNamespaceOrModuleNotBoth",",,,") ) - /// A module abbreviation must be a simple name, not a path - /// (Originally from ..\FSComp.txt:385) - static member parsModuleAbbreviationMustBeSimpleName() = (534, GetStringFunc("parsModuleAbbreviationMustBeSimpleName",",,,") ) - /// Ignoring attributes on module abbreviation - /// (Originally from ..\FSComp.txt:386) - static member parsIgnoreAttributesOnModuleAbbreviation() = (535, GetStringFunc("parsIgnoreAttributesOnModuleAbbreviation",",,,") ) - /// The '%s' accessibility attribute is not allowed on module abbreviation. Module abbreviations are always private. - /// (Originally from ..\FSComp.txt:387) - static member parsIgnoreAttributesOnModuleAbbreviationAlwaysPrivate(a0 : System.String) = (536, GetStringFunc("parsIgnoreAttributesOnModuleAbbreviationAlwaysPrivate",",,,%s,,,") a0) - /// The '%s' visibility attribute is not allowed on module abbreviation. Module abbreviations are always private. - /// (Originally from ..\FSComp.txt:388) - static member parsIgnoreVisibilityOnModuleAbbreviationAlwaysPrivate(a0 : System.String) = (537, GetStringFunc("parsIgnoreVisibilityOnModuleAbbreviationAlwaysPrivate",",,,%s,,,") a0) - /// Unclosed block - /// (Originally from ..\FSComp.txt:389) - static member parsUnClosedBlockInHashLight() = (538, GetStringFunc("parsUnClosedBlockInHashLight",",,,") ) - /// Unmatched 'begin' or 'struct' - /// (Originally from ..\FSComp.txt:390) - static member parsUnmatchedBeginOrStruct() = (539, GetStringFunc("parsUnmatchedBeginOrStruct",",,,") ) - /// A module name must be a simple name, not a path - /// (Originally from ..\FSComp.txt:391) - static member parsModuleDefnMustBeSimpleName() = (541, GetStringFunc("parsModuleDefnMustBeSimpleName",",,,") ) - /// Unexpected empty type moduleDefn list - /// (Originally from ..\FSComp.txt:392) - static member parsUnexpectedEmptyModuleDefn() = (542, GetStringFunc("parsUnexpectedEmptyModuleDefn",",,,") ) - /// Attributes should be placed before 'val' - /// (Originally from ..\FSComp.txt:393) - static member parsAttributesMustComeBeforeVal() = (GetStringFunc("parsAttributesMustComeBeforeVal",",,,") ) - /// Attributes are not permitted on interface implementations - /// (Originally from ..\FSComp.txt:394) - static member parsAttributesAreNotPermittedOnInterfaceImplementations() = (543, GetStringFunc("parsAttributesAreNotPermittedOnInterfaceImplementations",",,,") ) - /// Syntax error - /// (Originally from ..\FSComp.txt:395) - static member parsSyntaxError() = (544, GetStringFunc("parsSyntaxError",",,,") ) - /// Augmentations are not permitted on delegate type moduleDefns - /// (Originally from ..\FSComp.txt:396) - static member parsAugmentationsIllegalOnDelegateType() = (545, GetStringFunc("parsAugmentationsIllegalOnDelegateType",",,,") ) - /// Unmatched 'class', 'interface' or 'struct' - /// (Originally from ..\FSComp.txt:397) - static member parsUnmatchedClassInterfaceOrStruct() = (546, GetStringFunc("parsUnmatchedClassInterfaceOrStruct",",,,") ) - /// A type definition requires one or more members or other declarations. If you intend to define an empty class, struct or interface, then use 'type ... = class end', 'interface end' or 'struct end'. - /// (Originally from ..\FSComp.txt:398) - static member parsEmptyTypeDefinition() = (547, GetStringFunc("parsEmptyTypeDefinition",",,,") ) - /// Unmatched 'with' or badly formatted 'with' block - /// (Originally from ..\FSComp.txt:399) - static member parsUnmatchedWith() = (550, GetStringFunc("parsUnmatchedWith",",,,") ) - /// 'get', 'set' or 'get,set' required - /// (Originally from ..\FSComp.txt:400) - static member parsGetOrSetRequired() = (551, GetStringFunc("parsGetOrSetRequired",",,,") ) - /// Only class types may take value arguments - /// (Originally from ..\FSComp.txt:401) - static member parsOnlyClassCanTakeValueArguments() = (552, GetStringFunc("parsOnlyClassCanTakeValueArguments",",,,") ) - /// Unmatched 'begin' - /// (Originally from ..\FSComp.txt:402) - static member parsUnmatchedBegin() = (553, GetStringFunc("parsUnmatchedBegin",",,,") ) - /// Invalid declaration syntax - /// (Originally from ..\FSComp.txt:403) - static member parsInvalidDeclarationSyntax() = (554, GetStringFunc("parsInvalidDeclarationSyntax",",,,") ) - /// 'get' and/or 'set' required - /// (Originally from ..\FSComp.txt:404) - static member parsGetAndOrSetRequired() = (555, GetStringFunc("parsGetAndOrSetRequired",",,,") ) - /// Type annotations on property getters and setters must be given after the 'get()' or 'set(v)', e.g. 'with get() : string = ...' - /// (Originally from ..\FSComp.txt:405) - static member parsTypeAnnotationsOnGetSet() = (556, GetStringFunc("parsTypeAnnotationsOnGetSet",",,,") ) - /// A getter property is expected to be a function, e.g. 'get() = ...' or 'get(index) = ...' - /// (Originally from ..\FSComp.txt:406) - static member parsGetterMustHaveAtLeastOneArgument() = (557, GetStringFunc("parsGetterMustHaveAtLeastOneArgument",",,,") ) - /// Multiple accessibilities given for property getter or setter - /// (Originally from ..\FSComp.txt:407) - static member parsMultipleAccessibilitiesForGetSet() = (558, GetStringFunc("parsMultipleAccessibilitiesForGetSet",",,,") ) - /// Property setters must be defined using 'set value = ', 'set idx value = ' or 'set (idx1,...,idxN) value = ... ' - /// (Originally from ..\FSComp.txt:408) - static member parsSetSyntax() = (559, GetStringFunc("parsSetSyntax",",,,") ) - /// Interfaces always have the same visibility as the enclosing type - /// (Originally from ..\FSComp.txt:409) - static member parsInterfacesHaveSameVisibilityAsEnclosingType() = (560, GetStringFunc("parsInterfacesHaveSameVisibilityAsEnclosingType",",,,") ) - /// Accessibility modifiers are not allowed on this member. Abstract slots always have the same visibility as the enclosing type. - /// (Originally from ..\FSComp.txt:410) - static member parsAccessibilityModsIllegalForAbstract() = (561, GetStringFunc("parsAccessibilityModsIllegalForAbstract",",,,") ) - /// Attributes are not permitted on 'inherit' declarations - /// (Originally from ..\FSComp.txt:411) - static member parsAttributesIllegalOnInherit() = (562, GetStringFunc("parsAttributesIllegalOnInherit",",,,") ) - /// Accessibility modifiers are not permitted on an 'inherits' declaration - /// (Originally from ..\FSComp.txt:412) - static member parsVisibilityIllegalOnInherit() = (563, GetStringFunc("parsVisibilityIllegalOnInherit",",,,") ) - /// 'inherit' declarations cannot have 'as' bindings. To access members of the base class when overriding a method, the syntax 'base.SomeMember' may be used; 'base' is a keyword. Remove this 'as' binding. - /// (Originally from ..\FSComp.txt:413) - static member parsInheritDeclarationsCannotHaveAsBindings() = (564, GetStringFunc("parsInheritDeclarationsCannotHaveAsBindings",",,,") ) - /// Attributes are not allowed here - /// (Originally from ..\FSComp.txt:414) - static member parsAttributesIllegalHere() = (565, GetStringFunc("parsAttributesIllegalHere",",,,") ) - /// Accessibility modifiers are not permitted in this position for type abbreviations - /// (Originally from ..\FSComp.txt:415) - static member parsTypeAbbreviationsCannotHaveVisibilityDeclarations() = (566, GetStringFunc("parsTypeAbbreviationsCannotHaveVisibilityDeclarations",",,,") ) - /// Accessibility modifiers are not permitted in this position for enum types - /// (Originally from ..\FSComp.txt:416) - static member parsEnumTypesCannotHaveVisibilityDeclarations() = (567, GetStringFunc("parsEnumTypesCannotHaveVisibilityDeclarations",",,,") ) - /// All enum fields must be given values - /// (Originally from ..\FSComp.txt:417) - static member parsAllEnumFieldsRequireValues() = (568, GetStringFunc("parsAllEnumFieldsRequireValues",",,,") ) - /// Accessibility modifiers are not permitted on inline assembly code types - /// (Originally from ..\FSComp.txt:418) - static member parsInlineAssemblyCannotHaveVisibilityDeclarations() = (569, GetStringFunc("parsInlineAssemblyCannotHaveVisibilityDeclarations",",,,") ) - /// Unexpected identifier: '%s' - /// (Originally from ..\FSComp.txt:419) - static member parsUnexpectedIdentifier(a0 : System.String) = (571, GetStringFunc("parsUnexpectedIdentifier",",,,%s,,,") a0) - /// Accessibility modifiers are not permitted on union cases. Use 'type U = internal ...' or 'type U = private ...' to give an accessibility to the whole representation. - /// (Originally from ..\FSComp.txt:420) - static member parsUnionCasesCannotHaveVisibilityDeclarations() = (572, GetStringFunc("parsUnionCasesCannotHaveVisibilityDeclarations",",,,") ) - /// Accessibility modifiers are not permitted on enumeration fields - /// (Originally from ..\FSComp.txt:421) - static member parsEnumFieldsCannotHaveVisibilityDeclarations() = (573, GetStringFunc("parsEnumFieldsCannotHaveVisibilityDeclarations",",,,") ) - /// Consider using a separate record type instead - /// (Originally from ..\FSComp.txt:422) - static member parsConsiderUsingSeparateRecordType() = (GetStringFunc("parsConsiderUsingSeparateRecordType",",,,") ) - /// Accessibility modifiers are not permitted on record fields. Use 'type R = internal ...' or 'type R = private ...' to give an accessibility to the whole representation. - /// (Originally from ..\FSComp.txt:423) - static member parsRecordFieldsCannotHaveVisibilityDeclarations() = (575, GetStringFunc("parsRecordFieldsCannotHaveVisibilityDeclarations",",,,") ) - /// The declaration form 'let ... and ...' for non-recursive bindings is not used in F# code. Consider using a sequence of 'let' bindings - /// (Originally from ..\FSComp.txt:424) - static member parsLetAndForNonRecBindings() = (576, GetStringFunc("parsLetAndForNonRecBindings",",,,") ) - /// Unmatched '(' - /// (Originally from ..\FSComp.txt:425) - static member parsUnmatchedParen() = (583, GetStringFunc("parsUnmatchedParen",",,,") ) - /// Successive patterns should be separated by spaces or tupled - /// (Originally from ..\FSComp.txt:426) - static member parsSuccessivePatternsShouldBeSpacedOrTupled() = (584, GetStringFunc("parsSuccessivePatternsShouldBeSpacedOrTupled",",,,") ) - /// No matching 'in' found for this 'let' - /// (Originally from ..\FSComp.txt:427) - static member parsNoMatchingInForLet() = (586, GetStringFunc("parsNoMatchingInForLet",",,,") ) - /// Error in the return expression for this 'let'. Possible incorrect indentation. - /// (Originally from ..\FSComp.txt:428) - static member parsErrorInReturnForLetIncorrectIndentation() = (587, GetStringFunc("parsErrorInReturnForLetIncorrectIndentation",",,,") ) - /// The block following this '%s' is unfinished. Every code block is an expression and must have a result. '%s' cannot be the final code element in a block. Consider giving this block an explicit result. - /// (Originally from ..\FSComp.txt:429) - static member parsExpectedExpressionAfterLet(a0 : System.String, a1 : System.String) = (588, GetStringFunc("parsExpectedExpressionAfterLet",",,,%s,,,%s,,,") a0 a1) - /// Incomplete conditional. Expected 'if then ' or 'if then else '. - /// (Originally from ..\FSComp.txt:430) - static member parsIncompleteIf() = (589, GetStringFunc("parsIncompleteIf",",,,") ) - /// 'assert' may not be used as a first class value. Use 'assert ' instead. - /// (Originally from ..\FSComp.txt:431) - static member parsAssertIsNotFirstClassValue() = (590, GetStringFunc("parsAssertIsNotFirstClassValue",",,,") ) - /// Identifier expected - /// (Originally from ..\FSComp.txt:432) - static member parsIdentifierExpected() = (594, GetStringFunc("parsIdentifierExpected",",,,") ) - /// 'in' or '=' expected - /// (Originally from ..\FSComp.txt:433) - static member parsInOrEqualExpected() = (595, GetStringFunc("parsInOrEqualExpected",",,,") ) - /// The use of '->' in sequence and computation expressions is limited to the form 'for pat in expr -> expr'. Use the syntax 'for ... in ... do ... yield...' to generate elements in more complex sequence expressions. - /// (Originally from ..\FSComp.txt:434) - static member parsArrowUseIsLimited() = (596, GetStringFunc("parsArrowUseIsLimited",",,,") ) - /// Successive arguments should be separated by spaces or tupled, and arguments involving function or method applications should be parenthesized - /// (Originally from ..\FSComp.txt:435) - static member parsSuccessiveArgsShouldBeSpacedOrTupled() = (597, GetStringFunc("parsSuccessiveArgsShouldBeSpacedOrTupled",",,,") ) - /// Unmatched '[' - /// (Originally from ..\FSComp.txt:436) - static member parsUnmatchedBracket() = (598, GetStringFunc("parsUnmatchedBracket",",,,") ) - /// Missing qualification after '.' - /// (Originally from ..\FSComp.txt:437) - static member parsMissingQualificationAfterDot() = (599, GetStringFunc("parsMissingQualificationAfterDot",",,,") ) - /// In F# code you may use 'expr.[expr]'. A type annotation may be required to indicate the first expression is an array - /// (Originally from ..\FSComp.txt:438) - static member parsParenFormIsForML() = (GetStringFunc("parsParenFormIsForML",",,,") ) - /// Mismatched quotation, beginning with '%s' - /// (Originally from ..\FSComp.txt:439) - static member parsMismatchedQuote(a0 : System.String) = (601, GetStringFunc("parsMismatchedQuote",",,,%s,,,") a0) - /// Unmatched '%s' - /// (Originally from ..\FSComp.txt:440) - static member parsUnmatched(a0 : System.String) = (602, GetStringFunc("parsUnmatched",",,,%s,,,") a0) - /// Unmatched '[|' - /// (Originally from ..\FSComp.txt:441) - static member parsUnmatchedBracketBar() = (603, GetStringFunc("parsUnmatchedBracketBar",",,,") ) - /// Unmatched '{' - /// (Originally from ..\FSComp.txt:442) - static member parsUnmatchedBrace() = (604, GetStringFunc("parsUnmatchedBrace",",,,") ) - /// Unmatched '{|' - /// (Originally from ..\FSComp.txt:443) - static member parsUnmatchedBraceBar() = (605, GetStringFunc("parsUnmatchedBraceBar",",,,") ) - /// Field bindings must have the form 'id = expr;' - /// (Originally from ..\FSComp.txt:444) - static member parsFieldBinding() = (609, GetStringFunc("parsFieldBinding",",,,") ) - /// This member is not permitted in an object implementation - /// (Originally from ..\FSComp.txt:445) - static member parsMemberIllegalInObjectImplementation() = (610, GetStringFunc("parsMemberIllegalInObjectImplementation",",,,") ) - /// Missing function body - /// (Originally from ..\FSComp.txt:446) - static member parsMissingFunctionBody() = (611, GetStringFunc("parsMissingFunctionBody",",,,") ) - /// Syntax error in labelled type argument - /// (Originally from ..\FSComp.txt:447) - static member parsSyntaxErrorInLabeledType() = (613, GetStringFunc("parsSyntaxErrorInLabeledType",",,,") ) - /// Unexpected infix operator in type expression - /// (Originally from ..\FSComp.txt:448) - static member parsUnexpectedInfixOperator() = (615, GetStringFunc("parsUnexpectedInfixOperator",",,,") ) - /// The syntax '(typ,...,typ) ident' is not used in F# code. Consider using 'ident' instead - /// (Originally from ..\FSComp.txt:449) - static member parsMultiArgumentGenericTypeFormDeprecated() = (GetStringFunc("parsMultiArgumentGenericTypeFormDeprecated",",,,") ) - /// Invalid literal in type - /// (Originally from ..\FSComp.txt:450) - static member parsInvalidLiteralInType() = (618, GetStringFunc("parsInvalidLiteralInType",",,,") ) - /// Unexpected infix operator in unit-of-measure expression. Legal operators are '*', '/' and '^'. - /// (Originally from ..\FSComp.txt:451) - static member parsUnexpectedOperatorForUnitOfMeasure() = (619, GetStringFunc("parsUnexpectedOperatorForUnitOfMeasure",",,,") ) - /// Unexpected integer literal in unit-of-measure expression - /// (Originally from ..\FSComp.txt:452) - static member parsUnexpectedIntegerLiteralForUnitOfMeasure() = (620, GetStringFunc("parsUnexpectedIntegerLiteralForUnitOfMeasure",",,,") ) - /// Syntax error: unexpected type parameter specification - /// (Originally from ..\FSComp.txt:453) - static member parsUnexpectedTypeParameter() = (621, GetStringFunc("parsUnexpectedTypeParameter",",,,") ) - /// Mismatched quotation operator name, beginning with '%s' - /// (Originally from ..\FSComp.txt:454) - static member parsMismatchedQuotationName(a0 : System.String) = (622, GetStringFunc("parsMismatchedQuotationName",",,,%s,,,") a0) - /// Active pattern case identifiers must begin with an uppercase letter - /// (Originally from ..\FSComp.txt:455) - static member parsActivePatternCaseMustBeginWithUpperCase() = (623, GetStringFunc("parsActivePatternCaseMustBeginWithUpperCase",",,,") ) - /// The '|' character is not permitted in active pattern case identifiers - /// (Originally from ..\FSComp.txt:456) - static member parsActivePatternCaseContainsPipe() = (624, GetStringFunc("parsActivePatternCaseContainsPipe",",,,") ) - /// Denominator must not be 0 in unit-of-measure exponent - /// (Originally from ..\FSComp.txt:457) - static member parsIllegalDenominatorForMeasureExponent() = (625, GetStringFunc("parsIllegalDenominatorForMeasureExponent",",,,") ) - /// No '=' symbol should follow a 'namespace' declaration - /// (Originally from ..\FSComp.txt:458) - static member parsNoEqualShouldFollowNamespace() = (GetStringFunc("parsNoEqualShouldFollowNamespace",",,,") ) - /// The syntax 'module ... = struct .. end' is not used in F# code. Consider using 'module ... = begin .. end' - /// (Originally from ..\FSComp.txt:459) - static member parsSyntaxModuleStructEndDeprecated() = (GetStringFunc("parsSyntaxModuleStructEndDeprecated",",,,") ) - /// The syntax 'module ... : sig .. end' is not used in F# code. Consider using 'module ... = begin .. end' - /// (Originally from ..\FSComp.txt:460) - static member parsSyntaxModuleSigEndDeprecated() = (GetStringFunc("parsSyntaxModuleSigEndDeprecated",",,,") ) - /// A static field was used where an instance field is expected - /// (Originally from ..\FSComp.txt:461) - static member tcStaticFieldUsedWhenInstanceFieldExpected() = (627, GetStringFunc("tcStaticFieldUsedWhenInstanceFieldExpected",",,,") ) - /// Method '%s' is not accessible from this code location - /// (Originally from ..\FSComp.txt:462) - static member tcMethodNotAccessible(a0 : System.String) = (629, GetStringFunc("tcMethodNotAccessible",",,,%s,,,") a0) - /// Implicit product of measures following / - /// (Originally from ..\FSComp.txt:464) - static member tcImplicitMeasureFollowingSlash() = (632, GetStringFunc("tcImplicitMeasureFollowingSlash",",,,") ) - /// Unexpected SynMeasure.Anon - /// (Originally from ..\FSComp.txt:465) - static member tcUnexpectedMeasureAnon() = (633, GetStringFunc("tcUnexpectedMeasureAnon",",,,") ) - /// Non-zero constants cannot have generic units. For generic zero, write 0.0<_>. - /// (Originally from ..\FSComp.txt:466) - static member tcNonZeroConstantCannotHaveGenericUnit() = (634, GetStringFunc("tcNonZeroConstantCannotHaveGenericUnit",",,,") ) - /// In sequence expressions, results are generated using 'yield' - /// (Originally from ..\FSComp.txt:467) - static member tcSeqResultsUseYield() = (635, GetStringFunc("tcSeqResultsUseYield",",,,") ) - /// Unexpected big rational constant - /// (Originally from ..\FSComp.txt:468) - static member tcUnexpectedBigRationalConstant() = (GetStringFunc("tcUnexpectedBigRationalConstant",",,,") ) - /// Units-of-measure supported only on float, float32, decimal and signed integer types - /// (Originally from ..\FSComp.txt:469) - static member tcInvalidTypeForUnitsOfMeasure() = (636, GetStringFunc("tcInvalidTypeForUnitsOfMeasure",",,,") ) - /// Unexpected Const_uint16array - /// (Originally from ..\FSComp.txt:470) - static member tcUnexpectedConstUint16Array() = (GetStringFunc("tcUnexpectedConstUint16Array",",,,") ) - /// Unexpected Const_bytearray - /// (Originally from ..\FSComp.txt:471) - static member tcUnexpectedConstByteArray() = (GetStringFunc("tcUnexpectedConstByteArray",",,,") ) - /// A parameter with attributes must also be given a name, e.g. '[] Name : Type' - /// (Originally from ..\FSComp.txt:472) - static member tcParameterRequiresName() = (640, GetStringFunc("tcParameterRequiresName",",,,") ) - /// Return values cannot have names - /// (Originally from ..\FSComp.txt:473) - static member tcReturnValuesCannotHaveNames() = (641, GetStringFunc("tcReturnValuesCannotHaveNames",",,,") ) - /// MemberKind.PropertyGetSet only expected in parse trees - /// (Originally from ..\FSComp.txt:474) - static member tcMemberKindPropertyGetSetNotExpected() = (GetStringFunc("tcMemberKindPropertyGetSetNotExpected",",,,") ) - /// Namespaces cannot contain values. Consider using a module to hold your value declarations. - /// (Originally from ..\FSComp.txt:475) - static member tcNamespaceCannotContainValues() = (201, GetStringFunc("tcNamespaceCannotContainValues",",,,") ) - /// Namespaces cannot contain extension members except in the same file and namespace declaration group where the type is defined. Consider using a module to hold declarations of extension members. - /// (Originally from ..\FSComp.txt:476) - static member tcNamespaceCannotContainExtensionMembers() = (644, GetStringFunc("tcNamespaceCannotContainExtensionMembers",",,,") ) - /// Multiple visibility attributes have been specified for this identifier - /// (Originally from ..\FSComp.txt:477) - static member tcMultipleVisibilityAttributes() = (645, GetStringFunc("tcMultipleVisibilityAttributes",",,,") ) - /// Multiple visibility attributes have been specified for this identifier. 'let' bindings in classes are always private, as are any 'let' bindings inside expressions. - /// (Originally from ..\FSComp.txt:478) - static member tcMultipleVisibilityAttributesWithLet() = (646, GetStringFunc("tcMultipleVisibilityAttributesWithLet",",,,") ) - /// The name '(%s)' should not be used as a member name. To define comparison semantics for a type, implement the 'System.IComparable' interface. If defining a static member for use from other CLI languages then use the name '%s' instead. - /// (Originally from ..\FSComp.txt:479) - static member tcInvalidMethodNameForRelationalOperator(a0 : System.String, a1 : System.String) = (GetStringFunc("tcInvalidMethodNameForRelationalOperator",",,,%s,,,%s,,,") a0 a1) - /// The name '(%s)' should not be used as a member name. To define equality semantics for a type, override the 'Object.Equals' member. If defining a static member for use from other CLI languages then use the name '%s' instead. - /// (Originally from ..\FSComp.txt:480) - static member tcInvalidMethodNameForEquality(a0 : System.String, a1 : System.String) = (GetStringFunc("tcInvalidMethodNameForEquality",",,,%s,,,%s,,,") a0 a1) - /// The name '(%s)' should not be used as a member name. If defining a static member for use from other CLI languages then use the name '%s' instead. - /// (Originally from ..\FSComp.txt:481) - static member tcInvalidMemberName(a0 : System.String, a1 : System.String) = (GetStringFunc("tcInvalidMemberName",",,,%s,,,%s,,,") a0 a1) - /// The name '(%s)' should not be used as a member name because it is given a standard definition in the F# library over fixed types - /// (Originally from ..\FSComp.txt:482) - static member tcInvalidMemberNameFixedTypes(a0 : System.String) = (GetStringFunc("tcInvalidMemberNameFixedTypes",",,,%s,,,") a0) - /// The '%s' operator should not normally be redefined. To define overloaded comparison semantics for a particular type, implement the 'System.IComparable' interface in the definition of that type. - /// (Originally from ..\FSComp.txt:483) - static member tcInvalidOperatorDefinitionRelational(a0 : System.String) = (GetStringFunc("tcInvalidOperatorDefinitionRelational",",,,%s,,,") a0) - /// The '%s' operator should not normally be redefined. To define equality semantics for a type, override the 'Object.Equals' member in the definition of that type. - /// (Originally from ..\FSComp.txt:484) - static member tcInvalidOperatorDefinitionEquality(a0 : System.String) = (GetStringFunc("tcInvalidOperatorDefinitionEquality",",,,%s,,,") a0) - /// The '%s' operator should not normally be redefined. Consider using a different operator name - /// (Originally from ..\FSComp.txt:485) - static member tcInvalidOperatorDefinition(a0 : System.String) = (GetStringFunc("tcInvalidOperatorDefinition",",,,%s,,,") a0) - /// The '%s' operator cannot be redefined. Consider using a different operator name - /// (Originally from ..\FSComp.txt:486) - static member tcInvalidIndexOperatorDefinition(a0 : System.String) = (GetStringFunc("tcInvalidIndexOperatorDefinition",",,,%s,,,") a0) - /// Expected module or namespace parent %s - /// (Originally from ..\FSComp.txt:487) - static member tcExpectModuleOrNamespaceParent(a0 : System.String) = (GetStringFunc("tcExpectModuleOrNamespaceParent",",,,%s,,,") a0) - /// The struct, record or union type '%s' implements the interface 'System.IComparable' explicitly. You must apply the 'CustomComparison' attribute to the type. - /// (Originally from ..\FSComp.txt:488) - static member tcImplementsIComparableExplicitly(a0 : System.String) = (647, GetStringFunc("tcImplementsIComparableExplicitly",",,,%s,,,") a0) - /// The struct, record or union type '%s' implements the interface 'System.IComparable<_>' explicitly. You must apply the 'CustomComparison' attribute to the type, and should also provide a consistent implementation of the non-generic interface System.IComparable. - /// (Originally from ..\FSComp.txt:489) - static member tcImplementsGenericIComparableExplicitly(a0 : System.String) = (648, GetStringFunc("tcImplementsGenericIComparableExplicitly",",,,%s,,,") a0) - /// The struct, record or union type '%s' implements the interface 'System.IStructuralComparable' explicitly. Apply the 'CustomComparison' attribute to the type. - /// (Originally from ..\FSComp.txt:490) - static member tcImplementsIStructuralComparableExplicitly(a0 : System.String) = (649, GetStringFunc("tcImplementsIStructuralComparableExplicitly",",,,%s,,,") a0) - /// This record contains fields from inconsistent types - /// (Originally from ..\FSComp.txt:491) - static member tcRecordFieldInconsistentTypes() = (656, GetStringFunc("tcRecordFieldInconsistentTypes",",,,") ) - /// DLLImport stubs cannot be inlined - /// (Originally from ..\FSComp.txt:492) - static member tcDllImportStubsCannotBeInlined() = (657, GetStringFunc("tcDllImportStubsCannotBeInlined",",,,") ) - /// Structs may only bind a 'this' parameter at member declarations - /// (Originally from ..\FSComp.txt:493) - static member tcStructsCanOnlyBindThisAtMemberDeclaration() = (658, GetStringFunc("tcStructsCanOnlyBindThisAtMemberDeclaration",",,,") ) - /// Unexpected expression at recursive inference point - /// (Originally from ..\FSComp.txt:494) - static member tcUnexpectedExprAtRecInfPoint() = (659, GetStringFunc("tcUnexpectedExprAtRecInfPoint",",,,") ) - /// This code is less generic than required by its annotations because the explicit type variable '%s' could not be generalized. It was constrained to be '%s'. - /// (Originally from ..\FSComp.txt:495) - static member tcLessGenericBecauseOfAnnotation(a0 : System.String, a1 : System.String) = (660, GetStringFunc("tcLessGenericBecauseOfAnnotation",",,,%s,,,%s,,,") a0 a1) - /// One or more of the explicit class or function type variables for this binding could not be generalized, because they were constrained to other types - /// (Originally from ..\FSComp.txt:496) - static member tcConstrainedTypeVariableCannotBeGeneralized() = (661, GetStringFunc("tcConstrainedTypeVariableCannotBeGeneralized",",,,") ) - /// A generic type parameter has been used in a way that constrains it to always be '%s' - /// (Originally from ..\FSComp.txt:497) - static member tcGenericParameterHasBeenConstrained(a0 : System.String) = (662, GetStringFunc("tcGenericParameterHasBeenConstrained",",,,%s,,,") a0) - /// This type parameter has been used in a way that constrains it to always be '%s' - /// (Originally from ..\FSComp.txt:498) - static member tcTypeParameterHasBeenConstrained(a0 : System.String) = (663, GetStringFunc("tcTypeParameterHasBeenConstrained",",,,%s,,,") a0) - /// The type parameters inferred for this value are not stable under the erasure of type abbreviations. This is due to the use of type abbreviations which drop or reorder type parameters, e.g. \n\ttype taggedInt<'a> = int or\n\ttype swap<'a,'b> = 'b * 'a.\nConsider declaring the type parameters for this value explicitly, e.g.\n\tlet f<'a,'b> ((x,y) : swap<'b,'a>) : swap<'a,'b> = (y,x). - /// (Originally from ..\FSComp.txt:499) - static member tcTypeParametersInferredAreNotStable() = (664, GetStringFunc("tcTypeParametersInferredAreNotStable",",,,") ) - /// Explicit type parameters may only be used on module or member bindings - /// (Originally from ..\FSComp.txt:500) - static member tcExplicitTypeParameterInvalid() = (665, GetStringFunc("tcExplicitTypeParameterInvalid",",,,") ) - /// You must explicitly declare either all or no type parameters when overriding a generic abstract method - /// (Originally from ..\FSComp.txt:501) - static member tcOverridingMethodRequiresAllOrNoTypeParameters() = (666, GetStringFunc("tcOverridingMethodRequiresAllOrNoTypeParameters",",,,") ) - /// The field labels and expected type of this record expression or pattern do not uniquely determine a corresponding record type - /// (Originally from ..\FSComp.txt:502) - static member tcFieldsDoNotDetermineUniqueRecordType() = (667, GetStringFunc("tcFieldsDoNotDetermineUniqueRecordType",",,,") ) - /// The field '%s' appears twice in this record expression or pattern - /// (Originally from ..\FSComp.txt:503) - static member tcFieldAppearsTwiceInRecord(a0 : System.String) = (668, GetStringFunc("tcFieldAppearsTwiceInRecord",",,,%s,,,") a0) - /// Unknown union case - /// (Originally from ..\FSComp.txt:504) - static member tcUnknownUnion() = (669, GetStringFunc("tcUnknownUnion",",,,") ) - /// This code is not sufficiently generic. The type variable %s could not be generalized because it would escape its scope. - /// (Originally from ..\FSComp.txt:505) - static member tcNotSufficientlyGenericBecauseOfScope(a0 : System.String) = (670, GetStringFunc("tcNotSufficientlyGenericBecauseOfScope",",,,%s,,,") a0) - /// A property cannot have explicit type parameters. Consider using a method instead. - /// (Originally from ..\FSComp.txt:506) - static member tcPropertyRequiresExplicitTypeParameters() = (671, GetStringFunc("tcPropertyRequiresExplicitTypeParameters",",,,") ) - /// A constructor cannot have explicit type parameters. Consider using a static construction method instead. - /// (Originally from ..\FSComp.txt:507) - static member tcConstructorCannotHaveTypeParameters() = (672, GetStringFunc("tcConstructorCannotHaveTypeParameters",",,,") ) - /// This instance member needs a parameter to represent the object being invoked. Make the member static or use the notation 'member x.Member(args) = ...'. - /// (Originally from ..\FSComp.txt:508) - static member tcInstanceMemberRequiresTarget() = (673, GetStringFunc("tcInstanceMemberRequiresTarget",",,,") ) - /// Unexpected source-level property specification in syntax tree - /// (Originally from ..\FSComp.txt:509) - static member tcUnexpectedPropertyInSyntaxTree() = (674, GetStringFunc("tcUnexpectedPropertyInSyntaxTree",",,,") ) - /// A static initializer requires an argument - /// (Originally from ..\FSComp.txt:510) - static member tcStaticInitializerRequiresArgument() = (675, GetStringFunc("tcStaticInitializerRequiresArgument",",,,") ) - /// An object constructor requires an argument - /// (Originally from ..\FSComp.txt:511) - static member tcObjectConstructorRequiresArgument() = (676, GetStringFunc("tcObjectConstructorRequiresArgument",",,,") ) - /// This static member should not have a 'this' parameter. Consider using the notation 'member Member(args) = ...'. - /// (Originally from ..\FSComp.txt:512) - static member tcStaticMemberShouldNotHaveThis() = (677, GetStringFunc("tcStaticMemberShouldNotHaveThis",",,,") ) - /// An explicit static initializer should use the syntax 'static new(args) = expr' - /// (Originally from ..\FSComp.txt:513) - static member tcExplicitStaticInitializerSyntax() = (678, GetStringFunc("tcExplicitStaticInitializerSyntax",",,,") ) - /// An explicit object constructor should use the syntax 'new(args) = expr' - /// (Originally from ..\FSComp.txt:514) - static member tcExplicitObjectConstructorSyntax() = (679, GetStringFunc("tcExplicitObjectConstructorSyntax",",,,") ) - /// Unexpected source-level property specification - /// (Originally from ..\FSComp.txt:515) - static member tcUnexpectedPropertySpec() = (680, GetStringFunc("tcUnexpectedPropertySpec",",,,") ) - /// This form of object expression is not used in F#. Use 'member this.MemberName ... = ...' to define member implementations in object expressions. - /// (Originally from ..\FSComp.txt:516) - static member tcObjectExpressionFormDeprecated() = (GetStringFunc("tcObjectExpressionFormDeprecated",",,,") ) - /// Invalid declaration - /// (Originally from ..\FSComp.txt:517) - static member tcInvalidDeclaration() = (682, GetStringFunc("tcInvalidDeclaration",",,,") ) - /// Attributes are not allowed within patterns - /// (Originally from ..\FSComp.txt:518) - static member tcAttributesInvalidInPatterns() = (683, GetStringFunc("tcAttributesInvalidInPatterns",",,,") ) - /// The generic function '%s' must be given explicit type argument(s) - /// (Originally from ..\FSComp.txt:519) - static member tcFunctionRequiresExplicitTypeArguments(a0 : System.String) = (685, GetStringFunc("tcFunctionRequiresExplicitTypeArguments",",,,%s,,,") a0) - /// The method or function '%s' should not be given explicit type argument(s) because it does not declare its type parameters explicitly - /// (Originally from ..\FSComp.txt:520) - static member tcDoesNotAllowExplicitTypeArguments(a0 : System.String) = (686, GetStringFunc("tcDoesNotAllowExplicitTypeArguments",",,,%s,,,") a0) - /// This value, type or method expects %d type parameter(s) but was given %d - /// (Originally from ..\FSComp.txt:521) - static member tcTypeParameterArityMismatch(a0 : System.Int32, a1 : System.Int32) = (687, GetStringFunc("tcTypeParameterArityMismatch",",,,%d,,,%d,,,") a0 a1) - /// The default, zero-initializing constructor of a struct type may only be used if all the fields of the struct type admit default initialization - /// (Originally from ..\FSComp.txt:522) - static member tcDefaultStructConstructorCall() = (688, GetStringFunc("tcDefaultStructConstructorCall",",,,") ) - /// Couldn't find Dispose on IDisposable, or it was overloaded - /// (Originally from ..\FSComp.txt:523) - static member tcCouldNotFindIDisposable() = (GetStringFunc("tcCouldNotFindIDisposable",",,,") ) - /// This value is not a literal and cannot be used in a pattern - /// (Originally from ..\FSComp.txt:524) - static member tcNonLiteralCannotBeUsedInPattern() = (689, GetStringFunc("tcNonLiteralCannotBeUsedInPattern",",,,") ) - /// This field is readonly - /// (Originally from ..\FSComp.txt:525) - static member tcFieldIsReadonly() = (690, GetStringFunc("tcFieldIsReadonly",",,,") ) - /// Named arguments must appear after all other arguments - /// (Originally from ..\FSComp.txt:526) - static member tcNameArgumentsMustAppearLast() = (691, GetStringFunc("tcNameArgumentsMustAppearLast",",,,") ) - /// This function value is being used to construct a delegate type whose signature includes a byref argument. You must use an explicit lambda expression taking %d arguments. - /// (Originally from ..\FSComp.txt:527) - static member tcFunctionRequiresExplicitLambda(a0 : System.Int32) = (692, GetStringFunc("tcFunctionRequiresExplicitLambda",",,,%d,,,") a0) - /// The type '%s' is not a type whose values can be enumerated with this syntax, i.e. is not compatible with either seq<_>, IEnumerable<_> or IEnumerable and does not have a GetEnumerator method - /// (Originally from ..\FSComp.txt:528) - static member tcTypeCannotBeEnumerated(a0 : System.String) = (693, GetStringFunc("tcTypeCannotBeEnumerated",",,,%s,,,") a0) - /// This recursive binding uses an invalid mixture of recursive forms - /// (Originally from ..\FSComp.txt:529) - static member tcInvalidMixtureOfRecursiveForms() = (695, GetStringFunc("tcInvalidMixtureOfRecursiveForms",",,,") ) - /// This is not a valid object construction expression. Explicit object constructors must either call an alternate constructor or initialize all fields of the object and specify a call to a super class constructor. - /// (Originally from ..\FSComp.txt:530) - static member tcInvalidObjectConstructionExpression() = (696, GetStringFunc("tcInvalidObjectConstructionExpression",",,,") ) - /// Invalid constraint - /// (Originally from ..\FSComp.txt:531) - static member tcInvalidConstraint() = (697, GetStringFunc("tcInvalidConstraint",",,,") ) - /// Invalid constraint: the type used for the constraint is sealed, which means the constraint could only be satisfied by at most one solution - /// (Originally from ..\FSComp.txt:532) - static member tcInvalidConstraintTypeSealed() = (698, GetStringFunc("tcInvalidConstraintTypeSealed",",,,") ) - /// An 'enum' constraint must be of the form 'enum' - /// (Originally from ..\FSComp.txt:533) - static member tcInvalidEnumConstraint() = (699, GetStringFunc("tcInvalidEnumConstraint",",,,") ) - /// 'new' constraints must take one argument of type 'unit' and return the constructed type - /// (Originally from ..\FSComp.txt:534) - static member tcInvalidNewConstraint() = (700, GetStringFunc("tcInvalidNewConstraint",",,,") ) - /// This property has an invalid type. Properties taking multiple indexer arguments should have types of the form 'ty1 * ty2 -> ty3'. Properties returning functions should have types of the form '(ty1 -> ty2)'. - /// (Originally from ..\FSComp.txt:535) - static member tcInvalidPropertyType() = (701, GetStringFunc("tcInvalidPropertyType",",,,") ) - /// Expected unit-of-measure parameter, not type parameter. Explicit unit-of-measure parameters must be marked with the [] attribute. - /// (Originally from ..\FSComp.txt:536) - static member tcExpectedUnitOfMeasureMarkWithAttribute() = (702, GetStringFunc("tcExpectedUnitOfMeasureMarkWithAttribute",",,,") ) - /// Expected type parameter, not unit-of-measure parameter - /// (Originally from ..\FSComp.txt:537) - static member tcExpectedTypeParameter() = (703, GetStringFunc("tcExpectedTypeParameter",",,,") ) - /// Expected type, not unit-of-measure - /// (Originally from ..\FSComp.txt:538) - static member tcExpectedTypeNotUnitOfMeasure() = (704, GetStringFunc("tcExpectedTypeNotUnitOfMeasure",",,,") ) - /// Expected unit-of-measure, not type - /// (Originally from ..\FSComp.txt:539) - static member tcExpectedUnitOfMeasureNotType() = (705, GetStringFunc("tcExpectedUnitOfMeasureNotType",",,,") ) - /// Units-of-measure cannot be used as prefix arguments to a type. Rewrite as postfix arguments in angle brackets. - /// (Originally from ..\FSComp.txt:540) - static member tcInvalidUnitsOfMeasurePrefix() = (706, GetStringFunc("tcInvalidUnitsOfMeasurePrefix",",,,") ) - /// Unit-of-measure cannot be used in type constructor application - /// (Originally from ..\FSComp.txt:541) - static member tcUnitsOfMeasureInvalidInTypeConstructor() = (707, GetStringFunc("tcUnitsOfMeasureInvalidInTypeConstructor",",,,") ) - /// This control construct may only be used if the computation expression builder defines a '%s' method - /// (Originally from ..\FSComp.txt:542) - static member tcRequireBuilderMethod(a0 : System.String) = (708, GetStringFunc("tcRequireBuilderMethod",",,,%s,,,") a0) - /// This type has no nested types - /// (Originally from ..\FSComp.txt:543) - static member tcTypeHasNoNestedTypes() = (709, GetStringFunc("tcTypeHasNoNestedTypes",",,,") ) - /// Unexpected %s in type expression - /// (Originally from ..\FSComp.txt:544) - static member tcUnexpectedSymbolInTypeExpression(a0 : System.String) = (711, GetStringFunc("tcUnexpectedSymbolInTypeExpression",",,,%s,,,") a0) - /// Type parameter cannot be used as type constructor - /// (Originally from ..\FSComp.txt:545) - static member tcTypeParameterInvalidAsTypeConstructor() = (712, GetStringFunc("tcTypeParameterInvalidAsTypeConstructor",",,,") ) - /// Illegal syntax in type expression - /// (Originally from ..\FSComp.txt:546) - static member tcIllegalSyntaxInTypeExpression() = (713, GetStringFunc("tcIllegalSyntaxInTypeExpression",",,,") ) - /// Anonymous unit-of-measure cannot be nested inside another unit-of-measure expression - /// (Originally from ..\FSComp.txt:547) - static member tcAnonymousUnitsOfMeasureCannotBeNested() = (714, GetStringFunc("tcAnonymousUnitsOfMeasureCannotBeNested",",,,") ) - /// Anonymous type variables are not permitted in this declaration - /// (Originally from ..\FSComp.txt:548) - static member tcAnonymousTypeInvalidInDeclaration() = (715, GetStringFunc("tcAnonymousTypeInvalidInDeclaration",",,,") ) - /// Unexpected / in type - /// (Originally from ..\FSComp.txt:549) - static member tcUnexpectedSlashInType() = (716, GetStringFunc("tcUnexpectedSlashInType",",,,") ) - /// Unexpected type arguments - /// (Originally from ..\FSComp.txt:550) - static member tcUnexpectedTypeArguments() = (717, GetStringFunc("tcUnexpectedTypeArguments",",,,") ) - /// Optional arguments are only permitted on type members - /// (Originally from ..\FSComp.txt:551) - static member tcOptionalArgsOnlyOnMembers() = (718, GetStringFunc("tcOptionalArgsOnlyOnMembers",",,,") ) - /// Name '%s' not bound in pattern context - /// (Originally from ..\FSComp.txt:552) - static member tcNameNotBoundInPattern(a0 : System.String) = (719, GetStringFunc("tcNameNotBoundInPattern",",,,%s,,,") a0) - /// Non-primitive numeric literal constants cannot be used in pattern matches because they can be mapped to multiple different types through the use of a NumericLiteral module. Consider using replacing with a variable, and use 'when = ' at the end of the match clause. - /// (Originally from ..\FSComp.txt:553) - static member tcInvalidNonPrimitiveLiteralInPatternMatch() = (720, GetStringFunc("tcInvalidNonPrimitiveLiteralInPatternMatch",",,,") ) - /// Type arguments cannot be specified here - /// (Originally from ..\FSComp.txt:554) - static member tcInvalidTypeArgumentUsage() = (721, GetStringFunc("tcInvalidTypeArgumentUsage",",,,") ) - /// Only active patterns returning exactly one result may accept arguments - /// (Originally from ..\FSComp.txt:555) - static member tcRequireActivePatternWithOneResult() = (722, GetStringFunc("tcRequireActivePatternWithOneResult",",,,") ) - /// Invalid argument to parameterized pattern label - /// (Originally from ..\FSComp.txt:556) - static member tcInvalidArgForParameterizedPattern() = (723, GetStringFunc("tcInvalidArgForParameterizedPattern",",,,") ) - /// Internal error. Invalid index into active pattern array - /// (Originally from ..\FSComp.txt:557) - static member tcInvalidIndexIntoActivePatternArray() = (724, GetStringFunc("tcInvalidIndexIntoActivePatternArray",",,,") ) - /// This union case does not take arguments - /// (Originally from ..\FSComp.txt:558) - static member tcUnionCaseDoesNotTakeArguments() = (725, GetStringFunc("tcUnionCaseDoesNotTakeArguments",",,,") ) - /// This union case takes one argument - /// (Originally from ..\FSComp.txt:559) - static member tcUnionCaseRequiresOneArgument() = (726, GetStringFunc("tcUnionCaseRequiresOneArgument",",,,") ) - /// This union case expects %d arguments in tupled form - /// (Originally from ..\FSComp.txt:560) - static member tcUnionCaseExpectsTupledArguments(a0 : System.Int32) = (727, GetStringFunc("tcUnionCaseExpectsTupledArguments",",,,%d,,,") a0) - /// Field '%s' is not static - /// (Originally from ..\FSComp.txt:561) - static member tcFieldIsNotStatic(a0 : System.String) = (728, GetStringFunc("tcFieldIsNotStatic",",,,%s,,,") a0) - /// This field is not a literal and cannot be used in a pattern - /// (Originally from ..\FSComp.txt:562) - static member tcFieldNotLiteralCannotBeUsedInPattern() = (729, GetStringFunc("tcFieldNotLiteralCannotBeUsedInPattern",",,,") ) - /// This is not a variable, constant, active recognizer or literal - /// (Originally from ..\FSComp.txt:563) - static member tcRequireVarConstRecogOrLiteral() = (730, GetStringFunc("tcRequireVarConstRecogOrLiteral",",,,") ) - /// This is not a valid pattern - /// (Originally from ..\FSComp.txt:564) - static member tcInvalidPattern() = (731, GetStringFunc("tcInvalidPattern",",,,") ) - /// Character range matches have been removed in F#. Consider using a 'when' pattern guard instead. - /// (Originally from ..\FSComp.txt:565) - static member tcUseWhenPatternGuard() = (GetStringFunc("tcUseWhenPatternGuard",",,,") ) - /// Illegal pattern - /// (Originally from ..\FSComp.txt:566) - static member tcIllegalPattern() = (733, GetStringFunc("tcIllegalPattern",",,,") ) - /// Syntax error - unexpected '?' symbol - /// (Originally from ..\FSComp.txt:567) - static member tcSyntaxErrorUnexpectedQMark() = (734, GetStringFunc("tcSyntaxErrorUnexpectedQMark",",,,") ) - /// Expected %d expressions, got %d - /// (Originally from ..\FSComp.txt:568) - static member tcExpressionCountMisMatch(a0 : System.Int32, a1 : System.Int32) = (735, GetStringFunc("tcExpressionCountMisMatch",",,,%d,,,%d,,,") a0 a1) - /// TcExprUndelayed: delayed - /// (Originally from ..\FSComp.txt:569) - static member tcExprUndelayed() = (736, GetStringFunc("tcExprUndelayed",",,,") ) - /// This expression form may only be used in sequence and computation expressions - /// (Originally from ..\FSComp.txt:570) - static member tcExpressionRequiresSequence() = (737, GetStringFunc("tcExpressionRequiresSequence",",,,") ) - /// Invalid object expression. Objects without overrides or interfaces should use the expression form 'new Type(args)' without braces. - /// (Originally from ..\FSComp.txt:571) - static member tcInvalidObjectExpressionSyntaxForm() = (738, GetStringFunc("tcInvalidObjectExpressionSyntaxForm",",,,") ) - /// Invalid object, sequence or record expression - /// (Originally from ..\FSComp.txt:572) - static member tcInvalidObjectSequenceOrRecordExpression() = (739, GetStringFunc("tcInvalidObjectSequenceOrRecordExpression",",,,") ) - /// Invalid record, sequence or computation expression. Sequence expressions should be of the form 'seq { ... }' - /// (Originally from ..\FSComp.txt:573) - static member tcInvalidSequenceExpressionSyntaxForm() = (740, GetStringFunc("tcInvalidSequenceExpressionSyntaxForm",",,,") ) - /// This list or array expression includes an element of the form 'if ... then ... else'. Parenthesize this expression to indicate it is an individual element of the list or array, to disambiguate this from a list generated using a sequence expression - /// (Originally from ..\FSComp.txt:574) - static member tcExpressionWithIfRequiresParenthesis() = (GetStringFunc("tcExpressionWithIfRequiresParenthesis",",,,") ) - /// Unable to parse format string '%s' - /// (Originally from ..\FSComp.txt:575) - static member tcUnableToParseFormatString(a0 : System.String) = (741, GetStringFunc("tcUnableToParseFormatString",",,,%s,,,") a0) - /// This list expression exceeds the maximum size for list literals. Use an array for larger literals and call Array.ToList. - /// (Originally from ..\FSComp.txt:576) - static member tcListLiteralMaxSize() = (742, GetStringFunc("tcListLiteralMaxSize",",,,") ) - /// The expression form 'expr then expr' may only be used as part of an explicit object constructor - /// (Originally from ..\FSComp.txt:577) - static member tcExpressionFormRequiresObjectConstructor() = (743, GetStringFunc("tcExpressionFormRequiresObjectConstructor",",,,") ) - /// Named arguments cannot be given to member trait calls - /// (Originally from ..\FSComp.txt:578) - static member tcNamedArgumentsCannotBeUsedInMemberTraits() = (744, GetStringFunc("tcNamedArgumentsCannotBeUsedInMemberTraits",",,,") ) - /// This is not a valid name for an enumeration case - /// (Originally from ..\FSComp.txt:579) - static member tcNotValidEnumCaseName() = (745, GetStringFunc("tcNotValidEnumCaseName",",,,") ) - /// This field is not mutable - /// (Originally from ..\FSComp.txt:580) - static member tcFieldIsNotMutable() = (746, GetStringFunc("tcFieldIsNotMutable",",,,") ) - /// This construct may only be used within list, array and sequence expressions, e.g. expressions of the form 'seq { ... }', '[ ... ]' or '[| ... |]'. These use the syntax 'for ... in ... do ... yield...' to generate elements - /// (Originally from ..\FSComp.txt:581) - static member tcConstructRequiresListArrayOrSequence() = (747, GetStringFunc("tcConstructRequiresListArrayOrSequence",",,,") ) - /// This construct may only be used within computation expressions. To return a value from an ordinary function simply write the expression without 'return'. - /// (Originally from ..\FSComp.txt:582) - static member tcConstructRequiresComputationExpressions() = (748, GetStringFunc("tcConstructRequiresComputationExpressions",",,,") ) - /// This construct may only be used within sequence or computation expressions - /// (Originally from ..\FSComp.txt:583) - static member tcConstructRequiresSequenceOrComputations() = (749, GetStringFunc("tcConstructRequiresSequenceOrComputations",",,,") ) - /// This construct may only be used within computation expressions - /// (Originally from ..\FSComp.txt:584) - static member tcConstructRequiresComputationExpression() = (750, GetStringFunc("tcConstructRequiresComputationExpression",",,,") ) - /// Invalid indexer expression - /// (Originally from ..\FSComp.txt:585) - static member tcInvalidIndexerExpression() = (751, GetStringFunc("tcInvalidIndexerExpression",",,,") ) - /// The operator 'expr.[idx]' has been used on an object of indeterminate type based on information prior to this program point. Consider adding further type constraints - /// (Originally from ..\FSComp.txt:586) - static member tcObjectOfIndeterminateTypeUsedRequireTypeConstraint() = (752, GetStringFunc("tcObjectOfIndeterminateTypeUsedRequireTypeConstraint",",,,") ) - /// Cannot inherit from a variable type - /// (Originally from ..\FSComp.txt:587) - static member tcCannotInheritFromVariableType() = (753, GetStringFunc("tcCannotInheritFromVariableType",",,,") ) - /// Calls to object constructors on type parameters cannot be given arguments - /// (Originally from ..\FSComp.txt:588) - static member tcObjectConstructorsOnTypeParametersCannotTakeArguments() = (754, GetStringFunc("tcObjectConstructorsOnTypeParametersCannotTakeArguments",",,,") ) - /// The 'CompiledName' attribute cannot be used with this language element - /// (Originally from ..\FSComp.txt:589) - static member tcCompiledNameAttributeMisused() = (755, GetStringFunc("tcCompiledNameAttributeMisused",",,,") ) - /// '%s' may only be used with named types - /// (Originally from ..\FSComp.txt:590) - static member tcNamedTypeRequired(a0 : System.String) = (756, GetStringFunc("tcNamedTypeRequired",",,,%s,,,") a0) - /// 'inherit' cannot be used on interface types. Consider implementing the interface by using 'interface ... with ... end' instead. - /// (Originally from ..\FSComp.txt:591) - static member tcInheritCannotBeUsedOnInterfaceType() = (757, GetStringFunc("tcInheritCannotBeUsedOnInterfaceType",",,,") ) - /// 'new' cannot be used on interface types. Consider using an object expression '{ new ... with ... }' instead. - /// (Originally from ..\FSComp.txt:592) - static member tcNewCannotBeUsedOnInterfaceType() = (758, GetStringFunc("tcNewCannotBeUsedOnInterfaceType",",,,") ) - /// Instances of this type cannot be created since it has been marked abstract or not all methods have been given implementations. Consider using an object expression '{ new ... with ... }' instead. - /// (Originally from ..\FSComp.txt:593) - static member tcAbstractTypeCannotBeInstantiated() = (759, GetStringFunc("tcAbstractTypeCannotBeInstantiated",",,,") ) - /// It is recommended that objects supporting the IDisposable interface are created using the syntax 'new Type(args)', rather than 'Type(args)' or 'Type' as a function value representing the constructor, to indicate that resources may be owned by the generated value - /// (Originally from ..\FSComp.txt:594) - static member tcIDisposableTypeShouldUseNew() = (760, GetStringFunc("tcIDisposableTypeShouldUseNew",",,,") ) - /// '%s' may only be used to construct object types - /// (Originally from ..\FSComp.txt:595) - static member tcSyntaxCanOnlyBeUsedToCreateObjectTypes(a0 : System.String) = (761, GetStringFunc("tcSyntaxCanOnlyBeUsedToCreateObjectTypes",",,,%s,,,") a0) - /// Constructors for the type '%s' must directly or indirectly call its implicit object constructor. Use a call to the implicit object constructor instead of a record expression. - /// (Originally from ..\FSComp.txt:596) - static member tcConstructorRequiresCall(a0 : System.String) = (762, GetStringFunc("tcConstructorRequiresCall",",,,%s,,,") a0) - /// The field '%s' has been given a value, but is not present in the type '%s' - /// (Originally from ..\FSComp.txt:597) - static member tcUndefinedField(a0 : System.String, a1 : System.String) = (763, GetStringFunc("tcUndefinedField",",,,%s,,,%s,,,") a0 a1) - /// No assignment given for field '%s' of type '%s' - /// (Originally from ..\FSComp.txt:598) - static member tcFieldRequiresAssignment(a0 : System.String, a1 : System.String) = (764, GetStringFunc("tcFieldRequiresAssignment",",,,%s,,,%s,,,") a0 a1) - /// Extraneous fields have been given values - /// (Originally from ..\FSComp.txt:599) - static member tcExtraneousFieldsGivenValues() = (765, GetStringFunc("tcExtraneousFieldsGivenValues",",,,") ) - /// Only overrides of abstract and virtual members may be specified in object expressions - /// (Originally from ..\FSComp.txt:600) - static member tcObjectExpressionsCanOnlyOverrideAbstractOrVirtual() = (766, GetStringFunc("tcObjectExpressionsCanOnlyOverrideAbstractOrVirtual",",,,") ) - /// The member '%s' does not correspond to any abstract or virtual method available to override or implement. - /// (Originally from ..\FSComp.txt:601) - static member tcNoAbstractOrVirtualMemberFound(a0 : System.String) = (767, GetStringFunc("tcNoAbstractOrVirtualMemberFound",",,,%s,,,") a0) - /// The type %s contains the member '%s' but it is not a virtual or abstract method that is available to override or implement. - /// (Originally from ..\FSComp.txt:602) - static member tcMemberFoundIsNotAbstractOrVirtual(a0 : System.String, a1 : System.String) = (767, GetStringFunc("tcMemberFoundIsNotAbstractOrVirtual",",,,%s,,,%s,,,") a0 a1) - /// The member '%s' does not accept the correct number of arguments. %d argument(s) are expected, but %d were given. The required signature is '%s'.%s - /// (Originally from ..\FSComp.txt:603) - static member tcArgumentArityMismatch(a0 : System.String, a1 : System.Int32, a2 : System.Int32, a3 : System.String, a4 : System.String) = (768, GetStringFunc("tcArgumentArityMismatch",",,,%s,,,%d,,,%d,,,%s,,,%s,,,") a0 a1 a2 a3 a4) - /// The member '%s' does not accept the correct number of arguments. One overload accepts %d arguments, but %d were given. The required signature is '%s'.%s - /// (Originally from ..\FSComp.txt:604) - static member tcArgumentArityMismatchOneOverload(a0 : System.String, a1 : System.Int32, a2 : System.Int32, a3 : System.String, a4 : System.String) = (769, GetStringFunc("tcArgumentArityMismatchOneOverload",",,,%s,,,%d,,,%d,,,%s,,,%s,,,") a0 a1 a2 a3 a4) - /// A simple method name is required here - /// (Originally from ..\FSComp.txt:605) - static member tcSimpleMethodNameRequired() = (770, GetStringFunc("tcSimpleMethodNameRequired",",,,") ) - /// The types System.ValueType, System.Enum, System.Delegate, System.MulticastDelegate and System.Array cannot be used as super types in an object expression or class - /// (Originally from ..\FSComp.txt:606) - static member tcPredefinedTypeCannotBeUsedAsSuperType() = (771, GetStringFunc("tcPredefinedTypeCannotBeUsedAsSuperType",",,,") ) - /// 'new' must be used with a named type - /// (Originally from ..\FSComp.txt:607) - static member tcNewMustBeUsedWithNamedType() = (772, GetStringFunc("tcNewMustBeUsedWithNamedType",",,,") ) - /// Cannot create an extension of a sealed type - /// (Originally from ..\FSComp.txt:608) - static member tcCannotCreateExtensionOfSealedType() = (773, GetStringFunc("tcCannotCreateExtensionOfSealedType",",,,") ) - /// No arguments may be given when constructing a record value - /// (Originally from ..\FSComp.txt:609) - static member tcNoArgumentsForRecordValue() = (774, GetStringFunc("tcNoArgumentsForRecordValue",",,,") ) - /// Interface implementations cannot be given on construction expressions - /// (Originally from ..\FSComp.txt:610) - static member tcNoInterfaceImplementationForConstructionExpression() = (775, GetStringFunc("tcNoInterfaceImplementationForConstructionExpression",",,,") ) - /// Object construction expressions may only be used to implement constructors in class types - /// (Originally from ..\FSComp.txt:611) - static member tcObjectConstructionCanOnlyBeUsedInClassTypes() = (776, GetStringFunc("tcObjectConstructionCanOnlyBeUsedInClassTypes",",,,") ) - /// Only simple bindings of the form 'id = expr' can be used in construction expressions - /// (Originally from ..\FSComp.txt:612) - static member tcOnlySimpleBindingsCanBeUsedInConstructionExpressions() = (777, GetStringFunc("tcOnlySimpleBindingsCanBeUsedInConstructionExpressions",",,,") ) - /// Objects must be initialized by an object construction expression that calls an inherited object constructor and assigns a value to each field - /// (Originally from ..\FSComp.txt:613) - static member tcObjectsMustBeInitializedWithObjectExpression() = (778, GetStringFunc("tcObjectsMustBeInitializedWithObjectExpression",",,,") ) - /// Expected an interface type - /// (Originally from ..\FSComp.txt:614) - static member tcExpectedInterfaceType() = (779, GetStringFunc("tcExpectedInterfaceType",",,,") ) - /// Constructor expressions for interfaces do not take arguments - /// (Originally from ..\FSComp.txt:615) - static member tcConstructorForInterfacesDoNotTakeArguments() = (780, GetStringFunc("tcConstructorForInterfacesDoNotTakeArguments",",,,") ) - /// This object constructor requires arguments - /// (Originally from ..\FSComp.txt:616) - static member tcConstructorRequiresArguments() = (781, GetStringFunc("tcConstructorRequiresArguments",",,,") ) - /// 'new' may only be used with object constructors - /// (Originally from ..\FSComp.txt:617) - static member tcNewRequiresObjectConstructor() = (782, GetStringFunc("tcNewRequiresObjectConstructor",",,,") ) - /// At least one override did not correctly implement its corresponding abstract member - /// (Originally from ..\FSComp.txt:618) - static member tcAtLeastOneOverrideIsInvalid() = (783, GetStringFunc("tcAtLeastOneOverrideIsInvalid",",,,") ) - /// This numeric literal requires that a module '%s' defining functions FromZero, FromOne, FromInt32, FromInt64 and FromString be in scope - /// (Originally from ..\FSComp.txt:619) - static member tcNumericLiteralRequiresModule(a0 : System.String) = (784, GetStringFunc("tcNumericLiteralRequiresModule",",,,%s,,,") a0) - /// Invalid record construction - /// (Originally from ..\FSComp.txt:620) - static member tcInvalidRecordConstruction() = (785, GetStringFunc("tcInvalidRecordConstruction",",,,") ) - /// The expression form { expr with ... } may only be used with record types. To build object types use { new Type(...) with ... } - /// (Originally from ..\FSComp.txt:621) - static member tcExpressionFormRequiresRecordTypes() = (786, GetStringFunc("tcExpressionFormRequiresRecordTypes",",,,") ) - /// The inherited type is not an object model type - /// (Originally from ..\FSComp.txt:622) - static member tcInheritedTypeIsNotObjectModelType() = (787, GetStringFunc("tcInheritedTypeIsNotObjectModelType",",,,") ) - /// Object construction expressions (i.e. record expressions with inheritance specifications) may only be used to implement constructors in object model types. Use 'new ObjectType(args)' to construct instances of object model types outside of constructors - /// (Originally from ..\FSComp.txt:623) - static member tcObjectConstructionExpressionCanOnlyImplementConstructorsInObjectModelTypes() = (788, GetStringFunc("tcObjectConstructionExpressionCanOnlyImplementConstructorsInObjectModelTypes",",,,") ) - /// '{ }' is not a valid expression. Records must include at least one field. Empty sequences are specified by using Seq.empty or an empty list '[]'. - /// (Originally from ..\FSComp.txt:624) - static member tcEmptyRecordInvalid() = (789, GetStringFunc("tcEmptyRecordInvalid",",,,") ) - /// This type is not a record type. Values of class and struct types must be created using calls to object constructors. - /// (Originally from ..\FSComp.txt:625) - static member tcTypeIsNotARecordTypeNeedConstructor() = (790, GetStringFunc("tcTypeIsNotARecordTypeNeedConstructor",",,,") ) - /// This type is not a record type - /// (Originally from ..\FSComp.txt:626) - static member tcTypeIsNotARecordType() = (791, GetStringFunc("tcTypeIsNotARecordType",",,,") ) - /// This construct is ambiguous as part of a computation expression. Nested expressions may be written using 'let _ = (...)' and nested computations using 'let! res = builder { ... }'. - /// (Originally from ..\FSComp.txt:627) - static member tcConstructIsAmbiguousInComputationExpression() = (792, GetStringFunc("tcConstructIsAmbiguousInComputationExpression",",,,") ) - /// This construct is ambiguous as part of a sequence expression. Nested expressions may be written using 'let _ = (...)' and nested sequences using 'yield! seq {... }'. - /// (Originally from ..\FSComp.txt:628) - static member tcConstructIsAmbiguousInSequenceExpression() = (793, GetStringFunc("tcConstructIsAmbiguousInSequenceExpression",",,,") ) - /// 'do!' cannot be used within sequence expressions - /// (Originally from ..\FSComp.txt:629) - static member tcDoBangIllegalInSequenceExpression() = (794, GetStringFunc("tcDoBangIllegalInSequenceExpression",",,,") ) - /// The use of 'let! x = coll' in sequence expressions is not permitted. Use 'for x in coll' instead. - /// (Originally from ..\FSComp.txt:630) - static member tcUseForInSequenceExpression() = (795, GetStringFunc("tcUseForInSequenceExpression",",,,") ) - /// 'try'/'with' cannot be used within sequence expressions - /// (Originally from ..\FSComp.txt:631) - static member tcTryIllegalInSequenceExpression() = (796, GetStringFunc("tcTryIllegalInSequenceExpression",",,,") ) - /// In sequence expressions, multiple results are generated using 'yield!' - /// (Originally from ..\FSComp.txt:632) - static member tcUseYieldBangForMultipleResults() = (797, GetStringFunc("tcUseYieldBangForMultipleResults",",,,") ) - /// Invalid assignment - /// (Originally from ..\FSComp.txt:633) - static member tcInvalidAssignment() = (799, GetStringFunc("tcInvalidAssignment",",,,") ) - /// Invalid use of a type name - /// (Originally from ..\FSComp.txt:634) - static member tcInvalidUseOfTypeName() = (800, GetStringFunc("tcInvalidUseOfTypeName",",,,") ) - /// This type has no accessible object constructors - /// (Originally from ..\FSComp.txt:635) - static member tcTypeHasNoAccessibleConstructor() = (801, GetStringFunc("tcTypeHasNoAccessibleConstructor",",,,") ) - /// Invalid use of an interface type - /// (Originally from ..\FSComp.txt:638) - static member tcInvalidUseOfInterfaceType() = (804, GetStringFunc("tcInvalidUseOfInterfaceType",",,,") ) - /// Invalid use of a delegate constructor. Use the syntax 'new Type(args)' or just 'Type(args)'. - /// (Originally from ..\FSComp.txt:639) - static member tcInvalidUseOfDelegate() = (805, GetStringFunc("tcInvalidUseOfDelegate",",,,") ) - /// Property '%s' is not static - /// (Originally from ..\FSComp.txt:640) - static member tcPropertyIsNotStatic(a0 : System.String) = (806, GetStringFunc("tcPropertyIsNotStatic",",,,%s,,,") a0) - /// Property '%s' is not readable - /// (Originally from ..\FSComp.txt:641) - static member tcPropertyIsNotReadable(a0 : System.String) = (807, GetStringFunc("tcPropertyIsNotReadable",",,,%s,,,") a0) - /// This lookup cannot be used here - /// (Originally from ..\FSComp.txt:642) - static member tcLookupMayNotBeUsedHere() = (808, GetStringFunc("tcLookupMayNotBeUsedHere",",,,") ) - /// Property '%s' is static - /// (Originally from ..\FSComp.txt:643) - static member tcPropertyIsStatic(a0 : System.String) = (809, GetStringFunc("tcPropertyIsStatic",",,,%s,,,") a0) - /// Property '%s' cannot be set - /// (Originally from ..\FSComp.txt:644) - static member tcPropertyCannotBeSet1(a0 : System.String) = (810, GetStringFunc("tcPropertyCannotBeSet1",",,,%s,,,") a0) - /// Constructors must be applied to arguments and cannot be used as first-class values. If necessary use an anonymous function '(fun arg1 ... argN -> new Type(arg1,...,argN))'. - /// (Originally from ..\FSComp.txt:645) - static member tcConstructorsCannotBeFirstClassValues() = (811, GetStringFunc("tcConstructorsCannotBeFirstClassValues",",,,") ) - /// The syntax 'expr.id' may only be used with record labels, properties and fields - /// (Originally from ..\FSComp.txt:646) - static member tcSyntaxFormUsedOnlyWithRecordLabelsPropertiesAndFields() = (812, GetStringFunc("tcSyntaxFormUsedOnlyWithRecordLabelsPropertiesAndFields",",,,") ) - /// Event '%s' is static - /// (Originally from ..\FSComp.txt:647) - static member tcEventIsStatic(a0 : System.String) = (813, GetStringFunc("tcEventIsStatic",",,,%s,,,") a0) - /// Event '%s' is not static - /// (Originally from ..\FSComp.txt:648) - static member tcEventIsNotStatic(a0 : System.String) = (814, GetStringFunc("tcEventIsNotStatic",",,,%s,,,") a0) - /// The named argument '%s' did not match any argument or mutable property - /// (Originally from ..\FSComp.txt:649) - static member tcNamedArgumentDidNotMatch(a0 : System.String) = (815, GetStringFunc("tcNamedArgumentDidNotMatch",",,,%s,,,") a0) - /// One or more of the overloads of this method has curried arguments. Consider redesigning these members to take arguments in tupled form. - /// (Originally from ..\FSComp.txt:650) - static member tcOverloadsCannotHaveCurriedArguments() = (816, GetStringFunc("tcOverloadsCannotHaveCurriedArguments",",,,") ) - /// The unnamed arguments do not form a prefix of the arguments of the method called - /// (Originally from ..\FSComp.txt:651) - static member tcUnnamedArgumentsDoNotFormPrefix() = (GetStringFunc("tcUnnamedArgumentsDoNotFormPrefix",",,,") ) - /// Static optimization conditionals are only for use within the F# library - /// (Originally from ..\FSComp.txt:652) - static member tcStaticOptimizationConditionalsOnlyForFSharpLibrary() = (817, GetStringFunc("tcStaticOptimizationConditionalsOnlyForFSharpLibrary",",,,") ) - /// The corresponding formal argument is not optional - /// (Originally from ..\FSComp.txt:653) - static member tcFormalArgumentIsNotOptional() = (818, GetStringFunc("tcFormalArgumentIsNotOptional",",,,") ) - /// Invalid optional assignment to a property or field - /// (Originally from ..\FSComp.txt:654) - static member tcInvalidOptionalAssignmentToPropertyOrField() = (819, GetStringFunc("tcInvalidOptionalAssignmentToPropertyOrField",",,,") ) - /// A delegate constructor must be passed a single function value - /// (Originally from ..\FSComp.txt:655) - static member tcDelegateConstructorMustBePassed() = (820, GetStringFunc("tcDelegateConstructorMustBePassed",",,,") ) - /// A binding cannot be marked both 'use' and 'rec' - /// (Originally from ..\FSComp.txt:656) - static member tcBindingCannotBeUseAndRec() = (821, GetStringFunc("tcBindingCannotBeUseAndRec",",,,") ) - /// The 'VolatileField' attribute may only be used on 'let' bindings in classes - /// (Originally from ..\FSComp.txt:657) - static member tcVolatileOnlyOnClassLetBindings() = (823, GetStringFunc("tcVolatileOnlyOnClassLetBindings",",,,") ) - /// Attributes are not permitted on 'let' bindings in expressions - /// (Originally from ..\FSComp.txt:658) - static member tcAttributesAreNotPermittedOnLetBindings() = (824, GetStringFunc("tcAttributesAreNotPermittedOnLetBindings",",,,") ) - /// The 'DefaultValue' attribute may only be used on 'val' declarations - /// (Originally from ..\FSComp.txt:659) - static member tcDefaultValueAttributeRequiresVal() = (825, GetStringFunc("tcDefaultValueAttributeRequiresVal",",,,") ) - /// The 'ConditionalAttribute' attribute may only be used on members - /// (Originally from ..\FSComp.txt:660) - static member tcConditionalAttributeRequiresMembers() = (826, GetStringFunc("tcConditionalAttributeRequiresMembers",",,,") ) - /// This is not a valid name for an active pattern - /// (Originally from ..\FSComp.txt:661) - static member tcInvalidActivePatternName() = (827, GetStringFunc("tcInvalidActivePatternName",",,,") ) - /// The 'EntryPointAttribute' attribute may only be used on function definitions in modules - /// (Originally from ..\FSComp.txt:662) - static member tcEntryPointAttributeRequiresFunctionInModule() = (828, GetStringFunc("tcEntryPointAttributeRequiresFunctionInModule",",,,") ) - /// Mutable values cannot be marked 'inline' - /// (Originally from ..\FSComp.txt:663) - static member tcMutableValuesCannotBeInline() = (829, GetStringFunc("tcMutableValuesCannotBeInline",",,,") ) - /// Mutable values cannot have generic parameters - /// (Originally from ..\FSComp.txt:664) - static member tcMutableValuesMayNotHaveGenericParameters() = (830, GetStringFunc("tcMutableValuesMayNotHaveGenericParameters",",,,") ) - /// Mutable function values should be written 'let mutable f = (fun args -> ...)' - /// (Originally from ..\FSComp.txt:665) - static member tcMutableValuesSyntax() = (831, GetStringFunc("tcMutableValuesSyntax",",,,") ) - /// Only functions may be marked 'inline' - /// (Originally from ..\FSComp.txt:666) - static member tcOnlyFunctionsCanBeInline() = (832, GetStringFunc("tcOnlyFunctionsCanBeInline",",,,") ) - /// A literal value cannot be given the [] or [] attributes - /// (Originally from ..\FSComp.txt:667) - static member tcIllegalAttributesForLiteral() = (833, GetStringFunc("tcIllegalAttributesForLiteral",",,,") ) - /// A literal value cannot be marked 'mutable' - /// (Originally from ..\FSComp.txt:668) - static member tcLiteralCannotBeMutable() = (834, GetStringFunc("tcLiteralCannotBeMutable",",,,") ) - /// A literal value cannot be marked 'inline' - /// (Originally from ..\FSComp.txt:669) - static member tcLiteralCannotBeInline() = (835, GetStringFunc("tcLiteralCannotBeInline",",,,") ) - /// Literal values cannot have generic parameters - /// (Originally from ..\FSComp.txt:670) - static member tcLiteralCannotHaveGenericParameters() = (836, GetStringFunc("tcLiteralCannotHaveGenericParameters",",,,") ) - /// This is not a valid constant expression - /// (Originally from ..\FSComp.txt:671) - static member tcInvalidConstantExpression() = (837, GetStringFunc("tcInvalidConstantExpression",",,,") ) - /// This type is not accessible from this code location - /// (Originally from ..\FSComp.txt:672) - static member tcTypeIsInaccessible() = (838, GetStringFunc("tcTypeIsInaccessible",",,,") ) - /// Unexpected condition in imported assembly: failed to decode AttributeUsage attribute - /// (Originally from ..\FSComp.txt:673) - static member tcUnexpectedConditionInImportedAssembly() = (839, GetStringFunc("tcUnexpectedConditionInImportedAssembly",",,,") ) - /// Unrecognized attribute target. Valid attribute targets are 'assembly', 'module', 'type', 'method', 'property', 'return', 'param', 'field', 'event', 'constructor'. - /// (Originally from ..\FSComp.txt:674) - static member tcUnrecognizedAttributeTarget() = (840, GetStringFunc("tcUnrecognizedAttributeTarget",",,,") ) - /// This attribute is not valid for use on this language element. Assembly attributes should be attached to a 'do ()' declaration, if necessary within an F# module. - /// (Originally from ..\FSComp.txt:675) - static member tcAttributeIsNotValidForLanguageElementUseDo() = (841, GetStringFunc("tcAttributeIsNotValidForLanguageElementUseDo",",,,") ) - /// This attribute is not valid for use on this language element - /// (Originally from ..\FSComp.txt:676) - static member tcAttributeIsNotValidForLanguageElement() = (842, GetStringFunc("tcAttributeIsNotValidForLanguageElement",",,,") ) - /// Optional arguments cannot be used in custom attributes - /// (Originally from ..\FSComp.txt:677) - static member tcOptionalArgumentsCannotBeUsedInCustomAttribute() = (843, GetStringFunc("tcOptionalArgumentsCannotBeUsedInCustomAttribute",",,,") ) - /// This property cannot be set - /// (Originally from ..\FSComp.txt:678) - static member tcPropertyCannotBeSet0() = (844, GetStringFunc("tcPropertyCannotBeSet0",",,,") ) - /// This property or field was not found on this custom attribute type - /// (Originally from ..\FSComp.txt:679) - static member tcPropertyOrFieldNotFoundInAttribute() = (845, GetStringFunc("tcPropertyOrFieldNotFoundInAttribute",",,,") ) - /// A custom attribute must be a reference type - /// (Originally from ..\FSComp.txt:680) - static member tcCustomAttributeMustBeReferenceType() = (846, GetStringFunc("tcCustomAttributeMustBeReferenceType",",,,") ) - /// The number of args for a custom attribute does not match the expected number of args for the attribute constructor - /// (Originally from ..\FSComp.txt:681) - static member tcCustomAttributeArgumentMismatch() = (847, GetStringFunc("tcCustomAttributeArgumentMismatch",",,,") ) - /// A custom attribute must invoke an object constructor - /// (Originally from ..\FSComp.txt:682) - static member tcCustomAttributeMustInvokeConstructor() = (848, GetStringFunc("tcCustomAttributeMustInvokeConstructor",",,,") ) - /// Attribute expressions must be calls to object constructors - /// (Originally from ..\FSComp.txt:683) - static member tcAttributeExpressionsMustBeConstructorCalls() = (849, GetStringFunc("tcAttributeExpressionsMustBeConstructorCalls",",,,") ) - /// This attribute cannot be used in this version of F# - /// (Originally from ..\FSComp.txt:684) - static member tcUnsupportedAttribute() = (850, GetStringFunc("tcUnsupportedAttribute",",,,") ) - /// Invalid inline specification - /// (Originally from ..\FSComp.txt:685) - static member tcInvalidInlineSpecification() = (851, GetStringFunc("tcInvalidInlineSpecification",",,,") ) - /// 'use' bindings must be of the form 'use = ' - /// (Originally from ..\FSComp.txt:686) - static member tcInvalidUseBinding() = (852, GetStringFunc("tcInvalidUseBinding",",,,") ) - /// Abstract members are not permitted in an augmentation - they must be defined as part of the type itself - /// (Originally from ..\FSComp.txt:687) - static member tcAbstractMembersIllegalInAugmentation() = (853, GetStringFunc("tcAbstractMembersIllegalInAugmentation",",,,") ) - /// Method overrides and interface implementations are not permitted here - /// (Originally from ..\FSComp.txt:688) - static member tcMethodOverridesIllegalHere() = (854, GetStringFunc("tcMethodOverridesIllegalHere",",,,") ) - /// No abstract or interface member was found that corresponds to this override - /// (Originally from ..\FSComp.txt:689) - static member tcNoMemberFoundForOverride() = (855, GetStringFunc("tcNoMemberFoundForOverride",",,,") ) - /// This override takes a different number of arguments to the corresponding abstract member. The following abstract members were found:%s - /// (Originally from ..\FSComp.txt:690) - static member tcOverrideArityMismatch(a0 : System.String) = (856, GetStringFunc("tcOverrideArityMismatch",",,,%s,,,") a0) - /// This method already has a default implementation - /// (Originally from ..\FSComp.txt:691) - static member tcDefaultImplementationAlreadyExists() = (857, GetStringFunc("tcDefaultImplementationAlreadyExists",",,,") ) - /// The method implemented by this default is ambiguous - /// (Originally from ..\FSComp.txt:692) - static member tcDefaultAmbiguous() = (858, GetStringFunc("tcDefaultAmbiguous",",,,") ) - /// No abstract property was found that corresponds to this override - /// (Originally from ..\FSComp.txt:693) - static member tcNoPropertyFoundForOverride() = (859, GetStringFunc("tcNoPropertyFoundForOverride",",,,") ) - /// This property overrides or implements an abstract property but the abstract property doesn't have a corresponding %s - /// (Originally from ..\FSComp.txt:694) - static member tcAbstractPropertyMissingGetOrSet(a0 : System.String) = (860, GetStringFunc("tcAbstractPropertyMissingGetOrSet",",,,%s,,,") a0) - /// Invalid signature for set member - /// (Originally from ..\FSComp.txt:695) - static member tcInvalidSignatureForSet() = (861, GetStringFunc("tcInvalidSignatureForSet",",,,") ) - /// This new member hides the abstract member '%s'. Rename the member or use 'override' instead. - /// (Originally from ..\FSComp.txt:696) - static member tcNewMemberHidesAbstractMember(a0 : System.String) = (864, GetStringFunc("tcNewMemberHidesAbstractMember",",,,%s,,,") a0) - /// This new member hides the abstract member '%s' once tuples, functions, units of measure and/or provided types are erased. Rename the member or use 'override' instead. - /// (Originally from ..\FSComp.txt:697) - static member tcNewMemberHidesAbstractMemberWithSuffix(a0 : System.String) = (864, GetStringFunc("tcNewMemberHidesAbstractMemberWithSuffix",",,,%s,,,") a0) - /// Interfaces cannot contain definitions of static initializers - /// (Originally from ..\FSComp.txt:698) - static member tcStaticInitializersIllegalInInterface() = (865, GetStringFunc("tcStaticInitializersIllegalInInterface",",,,") ) - /// Interfaces cannot contain definitions of object constructors - /// (Originally from ..\FSComp.txt:699) - static member tcObjectConstructorsIllegalInInterface() = (866, GetStringFunc("tcObjectConstructorsIllegalInInterface",",,,") ) - /// Interfaces cannot contain definitions of member overrides - /// (Originally from ..\FSComp.txt:700) - static member tcMemberOverridesIllegalInInterface() = (867, GetStringFunc("tcMemberOverridesIllegalInInterface",",,,") ) - /// Interfaces cannot contain definitions of concrete members. You may need to define a constructor on your type to indicate that the type is a class. - /// (Originally from ..\FSComp.txt:701) - static member tcConcreteMembersIllegalInInterface() = (868, GetStringFunc("tcConcreteMembersIllegalInInterface",",,,") ) - /// Constructors cannot be specified in exception augmentations - /// (Originally from ..\FSComp.txt:702) - static member tcConstructorsDisallowedInExceptionAugmentation() = (869, GetStringFunc("tcConstructorsDisallowedInExceptionAugmentation",",,,") ) - /// Structs cannot have an object constructor with no arguments. This is a restriction imposed on all CLI languages as structs automatically support a default constructor. - /// (Originally from ..\FSComp.txt:703) - static member tcStructsCannotHaveConstructorWithNoArguments() = (870, GetStringFunc("tcStructsCannotHaveConstructorWithNoArguments",",,,") ) - /// Constructors cannot be defined for this type - /// (Originally from ..\FSComp.txt:704) - static member tcConstructorsIllegalForThisType() = (871, GetStringFunc("tcConstructorsIllegalForThisType",",,,") ) - /// Recursive bindings that include member specifications can only occur as a direct augmentation of a type - /// (Originally from ..\FSComp.txt:705) - static member tcRecursiveBindingsWithMembersMustBeDirectAugmentation() = (872, GetStringFunc("tcRecursiveBindingsWithMembersMustBeDirectAugmentation",",,,") ) - /// Only simple variable patterns can be bound in 'let rec' constructs - /// (Originally from ..\FSComp.txt:706) - static member tcOnlySimplePatternsInLetRec() = (873, GetStringFunc("tcOnlySimplePatternsInLetRec",",,,") ) - /// Only record fields and simple, non-recursive 'let' bindings may be marked mutable - /// (Originally from ..\FSComp.txt:707) - static member tcOnlyRecordFieldsAndSimpleLetCanBeMutable() = (874, GetStringFunc("tcOnlyRecordFieldsAndSimpleLetCanBeMutable",",,,") ) - /// This member is not sufficiently generic - /// (Originally from ..\FSComp.txt:708) - static member tcMemberIsNotSufficientlyGeneric() = (875, GetStringFunc("tcMemberIsNotSufficientlyGeneric",",,,") ) - /// A declaration may only be the [] attribute if a constant value is also given, e.g. 'val x : int = 1' - /// (Originally from ..\FSComp.txt:709) - static member tcLiteralAttributeRequiresConstantValue() = (876, GetStringFunc("tcLiteralAttributeRequiresConstantValue",",,,") ) - /// A declaration may only be given a value in a signature if the declaration has the [] attribute - /// (Originally from ..\FSComp.txt:710) - static member tcValueInSignatureRequiresLiteralAttribute() = (877, GetStringFunc("tcValueInSignatureRequiresLiteralAttribute",",,,") ) - /// Thread-static and context-static variables must be static and given the [] attribute to indicate that the value is initialized to the default value on each new thread - /// (Originally from ..\FSComp.txt:711) - static member tcThreadStaticAndContextStaticMustBeStatic() = (878, GetStringFunc("tcThreadStaticAndContextStaticMustBeStatic",",,,") ) - /// Volatile fields must be marked 'mutable' and cannot be thread-static - /// (Originally from ..\FSComp.txt:712) - static member tcVolatileFieldsMustBeMutable() = (879, GetStringFunc("tcVolatileFieldsMustBeMutable",",,,") ) - /// Uninitialized 'val' fields must be mutable and marked with the '[]' attribute. Consider using a 'let' binding instead of a 'val' field. - /// (Originally from ..\FSComp.txt:713) - static member tcUninitializedValFieldsMustBeMutable() = (880, GetStringFunc("tcUninitializedValFieldsMustBeMutable",",,,") ) - /// Static 'val' fields in types must be mutable, private and marked with the '[]' attribute. They are initialized to the 'null' or 'zero' value for their type. Consider also using a 'static let mutable' binding in a class type. - /// (Originally from ..\FSComp.txt:714) - static member tcStaticValFieldsMustBeMutableAndPrivate() = (881, GetStringFunc("tcStaticValFieldsMustBeMutableAndPrivate",",,,") ) - /// This field requires a name - /// (Originally from ..\FSComp.txt:715) - static member tcFieldRequiresName() = (882, GetStringFunc("tcFieldRequiresName",",,,") ) - /// Invalid namespace, module, type or union case name - /// (Originally from ..\FSComp.txt:716) - static member tcInvalidNamespaceModuleTypeUnionName() = (883, GetStringFunc("tcInvalidNamespaceModuleTypeUnionName",",,,") ) - /// Explicit type declarations for constructors must be of the form 'ty1 * ... * tyN -> resTy'. Parentheses may be required around 'resTy' - /// (Originally from ..\FSComp.txt:717) - static member tcIllegalFormForExplicitTypeDeclaration() = (884, GetStringFunc("tcIllegalFormForExplicitTypeDeclaration",",,,") ) - /// Return types of union cases must be identical to the type being defined, up to abbreviations - /// (Originally from ..\FSComp.txt:718) - static member tcReturnTypesForUnionMustBeSameAsType() = (885, GetStringFunc("tcReturnTypesForUnionMustBeSameAsType",",,,") ) - /// This is not a valid value for an enumeration literal - /// (Originally from ..\FSComp.txt:719) - static member tcInvalidEnumerationLiteral() = (886, GetStringFunc("tcInvalidEnumerationLiteral",",,,") ) - /// The type '%s' is not an interface type - /// (Originally from ..\FSComp.txt:720) - static member tcTypeIsNotInterfaceType1(a0 : System.String) = (887, GetStringFunc("tcTypeIsNotInterfaceType1",",,,%s,,,") a0) - /// Duplicate specification of an interface - /// (Originally from ..\FSComp.txt:721) - static member tcDuplicateSpecOfInterface() = (888, GetStringFunc("tcDuplicateSpecOfInterface",",,,") ) - /// A field/val declaration is not permitted here - /// (Originally from ..\FSComp.txt:722) - static member tcFieldValIllegalHere() = (889, GetStringFunc("tcFieldValIllegalHere",",,,") ) - /// A inheritance declaration is not permitted here - /// (Originally from ..\FSComp.txt:723) - static member tcInheritIllegalHere() = (890, GetStringFunc("tcInheritIllegalHere",",,,") ) - /// This declaration opens the module '%s', which is marked as 'RequireQualifiedAccess'. Adjust your code to use qualified references to the elements of the module instead, e.g. 'List.map' instead of 'map'. This change will ensure that your code is robust as new constructs are added to libraries. - /// (Originally from ..\FSComp.txt:724) - static member tcModuleRequiresQualifiedAccess(a0 : System.String) = (892, GetStringFunc("tcModuleRequiresQualifiedAccess",",,,%s,,,") a0) - /// This declaration opens the namespace or module '%s' through a partially qualified path. Adjust this code to use the full path of the namespace. This change will make your code more robust as new constructs are added to the F# and CLI libraries. - /// (Originally from ..\FSComp.txt:725) - static member tcOpenUsedWithPartiallyQualifiedPath(a0 : System.String) = (893, GetStringFunc("tcOpenUsedWithPartiallyQualifiedPath",",,,%s,,,") a0) - /// Local class bindings cannot be marked inline. Consider lifting the definition out of the class or else do not mark it as inline. - /// (Originally from ..\FSComp.txt:726) - static member tcLocalClassBindingsCannotBeInline() = (894, GetStringFunc("tcLocalClassBindingsCannotBeInline",",,,") ) - /// Type abbreviations cannot have members - /// (Originally from ..\FSComp.txt:727) - static member tcTypeAbbreviationsMayNotHaveMembers() = (895, GetStringFunc("tcTypeAbbreviationsMayNotHaveMembers",",,,") ) - /// As of F# 4.1, the accessibility of type abbreviations is checked at compile-time. Consider changing the accessibility of the type abbreviation. Ignoring this warning might lead to runtime errors. - /// (Originally from ..\FSComp.txt:728) - static member tcTypeAbbreviationsCheckedAtCompileTime() = (GetStringFunc("tcTypeAbbreviationsCheckedAtCompileTime",",,,") ) - /// Enumerations cannot have members - /// (Originally from ..\FSComp.txt:729) - static member tcEnumerationsMayNotHaveMembers() = (896, GetStringFunc("tcEnumerationsMayNotHaveMembers",",,,") ) - /// Measure declarations may have only static members - /// (Originally from ..\FSComp.txt:730) - static member tcMeasureDeclarationsRequireStaticMembers() = (897, GetStringFunc("tcMeasureDeclarationsRequireStaticMembers",",,,") ) - /// Structs cannot contain 'do' bindings because the default constructor for structs would not execute these bindings - /// (Originally from ..\FSComp.txt:731) - static member tcStructsMayNotContainDoBindings() = (GetStringFunc("tcStructsMayNotContainDoBindings",",,,") ) - /// Structs cannot contain value definitions because the default constructor for structs will not execute these bindings. Consider adding additional arguments to the primary constructor for the type. - /// (Originally from ..\FSComp.txt:732) - static member tcStructsMayNotContainLetBindings() = (901, GetStringFunc("tcStructsMayNotContainLetBindings",",,,") ) - /// Static value definitions may only be used in types with a primary constructor. Consider adding arguments to the type definition, e.g. 'type X(args) = ...'. - /// (Originally from ..\FSComp.txt:733) - static member tcStaticLetBindingsRequireClassesWithImplicitConstructors() = (902, GetStringFunc("tcStaticLetBindingsRequireClassesWithImplicitConstructors",",,,") ) - /// Measure declarations may have only static members: constructors are not available - /// (Originally from ..\FSComp.txt:734) - static member tcMeasureDeclarationsRequireStaticMembersNotConstructors() = (904, GetStringFunc("tcMeasureDeclarationsRequireStaticMembersNotConstructors",",,,") ) - /// A member and a local class binding both have the name '%s' - /// (Originally from ..\FSComp.txt:735) - static member tcMemberAndLocalClassBindingHaveSameName(a0 : System.String) = (905, GetStringFunc("tcMemberAndLocalClassBindingHaveSameName",",,,%s,,,") a0) - /// Type abbreviations cannot have interface declarations - /// (Originally from ..\FSComp.txt:736) - static member tcTypeAbbreviationsCannotHaveInterfaceDeclaration() = (906, GetStringFunc("tcTypeAbbreviationsCannotHaveInterfaceDeclaration",",,,") ) - /// Enumerations cannot have interface declarations - /// (Originally from ..\FSComp.txt:737) - static member tcEnumerationsCannotHaveInterfaceDeclaration() = (907, GetStringFunc("tcEnumerationsCannotHaveInterfaceDeclaration",",,,") ) - /// This type is not an interface type - /// (Originally from ..\FSComp.txt:738) - static member tcTypeIsNotInterfaceType0() = (908, GetStringFunc("tcTypeIsNotInterfaceType0",",,,") ) - /// All implemented interfaces should be declared on the initial declaration of the type - /// (Originally from ..\FSComp.txt:739) - static member tcAllImplementedInterfacesShouldBeDeclared() = (909, GetStringFunc("tcAllImplementedInterfacesShouldBeDeclared",",,,") ) - /// A default implementation of this interface has already been added because the explicit implementation of the interface was not specified at the definition of the type - /// (Originally from ..\FSComp.txt:740) - static member tcDefaultImplementationForInterfaceHasAlreadyBeenAdded() = (910, GetStringFunc("tcDefaultImplementationForInterfaceHasAlreadyBeenAdded",",,,") ) - /// This member is not permitted in an interface implementation - /// (Originally from ..\FSComp.txt:741) - static member tcMemberNotPermittedInInterfaceImplementation() = (911, GetStringFunc("tcMemberNotPermittedInInterfaceImplementation",",,,") ) - /// This declaration element is not permitted in an augmentation - /// (Originally from ..\FSComp.txt:742) - static member tcDeclarationElementNotPermittedInAugmentation() = (912, GetStringFunc("tcDeclarationElementNotPermittedInAugmentation",",,,") ) - /// Types cannot contain nested type definitions - /// (Originally from ..\FSComp.txt:743) - static member tcTypesCannotContainNestedTypes() = (913, GetStringFunc("tcTypesCannotContainNestedTypes",",,,") ) - /// type, exception or module - /// (Originally from ..\FSComp.txt:744) - static member tcTypeExceptionOrModule() = (GetStringFunc("tcTypeExceptionOrModule",",,,") ) - /// type or module - /// (Originally from ..\FSComp.txt:745) - static member tcTypeOrModule() = (GetStringFunc("tcTypeOrModule",",,,") ) - /// The struct, record or union type '%s' implements the interface 'System.IStructuralEquatable' explicitly. Apply the 'CustomEquality' attribute to the type. - /// (Originally from ..\FSComp.txt:746) - static member tcImplementsIStructuralEquatableExplicitly(a0 : System.String) = (914, GetStringFunc("tcImplementsIStructuralEquatableExplicitly",",,,%s,,,") a0) - /// The struct, record or union type '%s' implements the interface 'System.IEquatable<_>' explicitly. Apply the 'CustomEquality' attribute to the type and provide a consistent implementation of the non-generic override 'System.Object.Equals(obj)'. - /// (Originally from ..\FSComp.txt:747) - static member tcImplementsIEquatableExplicitly(a0 : System.String) = (915, GetStringFunc("tcImplementsIEquatableExplicitly",",,,%s,,,") a0) - /// Explicit type specifications cannot be used for exception constructors - /// (Originally from ..\FSComp.txt:748) - static member tcExplicitTypeSpecificationCannotBeUsedForExceptionConstructors() = (916, GetStringFunc("tcExplicitTypeSpecificationCannotBeUsedForExceptionConstructors",",,,") ) - /// Exception abbreviations should not have argument lists - /// (Originally from ..\FSComp.txt:749) - static member tcExceptionAbbreviationsShouldNotHaveArgumentList() = (917, GetStringFunc("tcExceptionAbbreviationsShouldNotHaveArgumentList",",,,") ) - /// Abbreviations for Common IL exceptions cannot take arguments - /// (Originally from ..\FSComp.txt:750) - static member tcAbbreviationsFordotNetExceptionsCannotTakeArguments() = (918, GetStringFunc("tcAbbreviationsFordotNetExceptionsCannotTakeArguments",",,,") ) - /// Exception abbreviations must refer to existing exceptions or F# types deriving from System.Exception - /// (Originally from ..\FSComp.txt:751) - static member tcExceptionAbbreviationsMustReferToValidExceptions() = (919, GetStringFunc("tcExceptionAbbreviationsMustReferToValidExceptions",",,,") ) - /// Abbreviations for Common IL exception types must have a matching object constructor - /// (Originally from ..\FSComp.txt:752) - static member tcAbbreviationsFordotNetExceptionsMustHaveMatchingObjectConstructor() = (920, GetStringFunc("tcAbbreviationsFordotNetExceptionsMustHaveMatchingObjectConstructor",",,,") ) - /// Not an exception - /// (Originally from ..\FSComp.txt:753) - static member tcNotAnException() = (921, GetStringFunc("tcNotAnException",",,,") ) - /// Invalid module name - /// (Originally from ..\FSComp.txt:755) - static member tcInvalidModuleName() = (924, GetStringFunc("tcInvalidModuleName",",,,") ) - /// Invalid type extension - /// (Originally from ..\FSComp.txt:756) - static member tcInvalidTypeExtension() = (925, GetStringFunc("tcInvalidTypeExtension",",,,") ) - /// The attributes of this type specify multiple kinds for the type - /// (Originally from ..\FSComp.txt:757) - static member tcAttributesOfTypeSpecifyMultipleKindsForType() = (926, GetStringFunc("tcAttributesOfTypeSpecifyMultipleKindsForType",",,,") ) - /// The kind of the type specified by its attributes does not match the kind implied by its definition - /// (Originally from ..\FSComp.txt:758) - static member tcKindOfTypeSpecifiedDoesNotMatchDefinition() = (927, GetStringFunc("tcKindOfTypeSpecifiedDoesNotMatchDefinition",",,,") ) - /// Measure definitions cannot have type parameters - /// (Originally from ..\FSComp.txt:759) - static member tcMeasureDefinitionsCannotHaveTypeParameters() = (928, GetStringFunc("tcMeasureDefinitionsCannotHaveTypeParameters",",,,") ) - /// This type requires a definition - /// (Originally from ..\FSComp.txt:760) - static member tcTypeRequiresDefinition() = (929, GetStringFunc("tcTypeRequiresDefinition",",,,") ) - /// This type abbreviation has one or more declared type parameters that do not appear in the type being abbreviated. Type abbreviations must use all declared type parameters in the type being abbreviated. Consider removing one or more type parameters, or use a concrete type definition that wraps an underlying type, such as 'type C<'a> = C of ...'. - /// (Originally from ..\FSComp.txt:761) - static member tcTypeAbbreviationHasTypeParametersMissingOnType() = (GetStringFunc("tcTypeAbbreviationHasTypeParametersMissingOnType",",,,") ) - /// Structs, interfaces, enums and delegates cannot inherit from other types - /// (Originally from ..\FSComp.txt:762) - static member tcStructsInterfacesEnumsDelegatesMayNotInheritFromOtherTypes() = (931, GetStringFunc("tcStructsInterfacesEnumsDelegatesMayNotInheritFromOtherTypes",",,,") ) - /// Types cannot inherit from multiple concrete types - /// (Originally from ..\FSComp.txt:763) - static member tcTypesCannotInheritFromMultipleConcreteTypes() = (932, GetStringFunc("tcTypesCannotInheritFromMultipleConcreteTypes",",,,") ) - /// Records, union, abbreviations and struct types cannot have the 'AllowNullLiteral' attribute - /// (Originally from ..\FSComp.txt:764) - static member tcRecordsUnionsAbbreviationsStructsMayNotHaveAllowNullLiteralAttribute() = (934, GetStringFunc("tcRecordsUnionsAbbreviationsStructsMayNotHaveAllowNullLiteralAttribute",",,,") ) - /// Types with the 'AllowNullLiteral' attribute may only inherit from or implement types which also allow the use of the null literal - /// (Originally from ..\FSComp.txt:765) - static member tcAllowNullTypesMayOnlyInheritFromAllowNullTypes() = (935, GetStringFunc("tcAllowNullTypesMayOnlyInheritFromAllowNullTypes",",,,") ) - /// Generic types cannot be given the 'StructLayout' attribute - /// (Originally from ..\FSComp.txt:766) - static member tcGenericTypesCannotHaveStructLayout() = (936, GetStringFunc("tcGenericTypesCannotHaveStructLayout",",,,") ) - /// Only structs and classes without primary constructors may be given the 'StructLayout' attribute - /// (Originally from ..\FSComp.txt:767) - static member tcOnlyStructsCanHaveStructLayout() = (937, GetStringFunc("tcOnlyStructsCanHaveStructLayout",",,,") ) - /// The representation of this type is hidden by the signature. It must be given an attribute such as [], [] or [] to indicate the characteristics of the type. - /// (Originally from ..\FSComp.txt:768) - static member tcRepresentationOfTypeHiddenBySignature() = (938, GetStringFunc("tcRepresentationOfTypeHiddenBySignature",",,,") ) - /// Only classes may be given the 'AbstractClass' attribute - /// (Originally from ..\FSComp.txt:769) - static member tcOnlyClassesCanHaveAbstract() = (939, GetStringFunc("tcOnlyClassesCanHaveAbstract",",,,") ) - /// Only types representing units-of-measure may be given the 'Measure' attribute - /// (Originally from ..\FSComp.txt:770) - static member tcOnlyTypesRepresentingUnitsOfMeasureCanHaveMeasure() = (940, GetStringFunc("tcOnlyTypesRepresentingUnitsOfMeasureCanHaveMeasure",",,,") ) - /// Accessibility modifiers are not permitted on overrides or interface implementations - /// (Originally from ..\FSComp.txt:771) - static member tcOverridesCannotHaveVisibilityDeclarations() = (941, GetStringFunc("tcOverridesCannotHaveVisibilityDeclarations",",,,") ) - /// Discriminated union types are always sealed - /// (Originally from ..\FSComp.txt:772) - static member tcTypesAreAlwaysSealedDU() = (942, GetStringFunc("tcTypesAreAlwaysSealedDU",",,,") ) - /// Record types are always sealed - /// (Originally from ..\FSComp.txt:773) - static member tcTypesAreAlwaysSealedRecord() = (942, GetStringFunc("tcTypesAreAlwaysSealedRecord",",,,") ) - /// Assembly code types are always sealed - /// (Originally from ..\FSComp.txt:774) - static member tcTypesAreAlwaysSealedAssemblyCode() = (942, GetStringFunc("tcTypesAreAlwaysSealedAssemblyCode",",,,") ) - /// Struct types are always sealed - /// (Originally from ..\FSComp.txt:775) - static member tcTypesAreAlwaysSealedStruct() = (942, GetStringFunc("tcTypesAreAlwaysSealedStruct",",,,") ) - /// Delegate types are always sealed - /// (Originally from ..\FSComp.txt:776) - static member tcTypesAreAlwaysSealedDelegate() = (942, GetStringFunc("tcTypesAreAlwaysSealedDelegate",",,,") ) - /// Enum types are always sealed - /// (Originally from ..\FSComp.txt:777) - static member tcTypesAreAlwaysSealedEnum() = (942, GetStringFunc("tcTypesAreAlwaysSealedEnum",",,,") ) - /// Interface types and delegate types cannot contain fields - /// (Originally from ..\FSComp.txt:778) - static member tcInterfaceTypesAndDelegatesCannotContainFields() = (943, GetStringFunc("tcInterfaceTypesAndDelegatesCannotContainFields",",,,") ) - /// Abbreviated types cannot be given the 'Sealed' attribute - /// (Originally from ..\FSComp.txt:779) - static member tcAbbreviatedTypesCannotBeSealed() = (944, GetStringFunc("tcAbbreviatedTypesCannotBeSealed",",,,") ) - /// Cannot inherit a sealed type - /// (Originally from ..\FSComp.txt:780) - static member tcCannotInheritFromSealedType() = (945, GetStringFunc("tcCannotInheritFromSealedType",",,,") ) - /// Cannot inherit from interface type. Use interface ... with instead. - /// (Originally from ..\FSComp.txt:781) - static member tcCannotInheritFromInterfaceType() = (946, GetStringFunc("tcCannotInheritFromInterfaceType",",,,") ) - /// Struct types cannot contain abstract members - /// (Originally from ..\FSComp.txt:782) - static member tcStructTypesCannotContainAbstractMembers() = (947, GetStringFunc("tcStructTypesCannotContainAbstractMembers",",,,") ) - /// Interface types cannot be sealed - /// (Originally from ..\FSComp.txt:783) - static member tcInterfaceTypesCannotBeSealed() = (948, GetStringFunc("tcInterfaceTypesCannotBeSealed",",,,") ) - /// Delegate specifications must be of the form 'typ -> typ' - /// (Originally from ..\FSComp.txt:784) - static member tcInvalidDelegateSpecification() = (949, GetStringFunc("tcInvalidDelegateSpecification",",,,") ) - /// Delegate specifications must not be curried types. Use 'typ * ... * typ -> typ' for multi-argument delegates, and 'typ -> (typ -> typ)' for delegates returning function values. - /// (Originally from ..\FSComp.txt:785) - static member tcDelegatesCannotBeCurried() = (950, GetStringFunc("tcDelegatesCannotBeCurried",",,,") ) - /// Literal enumerations must have type int, uint, int16, uint16, int64, uint64, byte, sbyte or char - /// (Originally from ..\FSComp.txt:786) - static member tcInvalidTypeForLiteralEnumeration() = (951, GetStringFunc("tcInvalidTypeForLiteralEnumeration",",,,") ) - /// This type definition involves an immediate cyclic reference through an abbreviation - /// (Originally from ..\FSComp.txt:788) - static member tcTypeDefinitionIsCyclic() = (953, GetStringFunc("tcTypeDefinitionIsCyclic",",,,") ) - /// This type definition involves an immediate cyclic reference through a struct field or inheritance relation - /// (Originally from ..\FSComp.txt:789) - static member tcTypeDefinitionIsCyclicThroughInheritance() = (954, GetStringFunc("tcTypeDefinitionIsCyclicThroughInheritance",",,,") ) - /// The syntax 'type X with ...' is reserved for augmentations. Types whose representations are hidden but which have members are now declared in signatures using 'type X = ...'. You may also need to add the '[] attribute to the type definition in the signature - /// (Originally from ..\FSComp.txt:790) - static member tcReservedSyntaxForAugmentation() = (GetStringFunc("tcReservedSyntaxForAugmentation",",,,") ) - /// Members that extend interface, delegate or enum types must be placed in a module separate to the definition of the type. This module must either have the AutoOpen attribute or be opened explicitly by client code to bring the extension members into scope. - /// (Originally from ..\FSComp.txt:791) - static member tcMembersThatExtendInterfaceMustBePlacedInSeparateModule() = (956, GetStringFunc("tcMembersThatExtendInterfaceMustBePlacedInSeparateModule",",,,") ) - /// One or more of the declared type parameters for this type extension have a missing or wrong type constraint not matching the original type constraints on '%s' - /// (Originally from ..\FSComp.txt:792) - static member tcDeclaredTypeParametersForExtensionDoNotMatchOriginal(a0 : System.String) = (957, GetStringFunc("tcDeclaredTypeParametersForExtensionDoNotMatchOriginal",",,,%s,,,") a0) - /// Type definitions may only have one 'inherit' specification and it must be the first declaration - /// (Originally from ..\FSComp.txt:793) - static member tcTypeDefinitionsWithImplicitConstructionMustHaveOneInherit() = (959, GetStringFunc("tcTypeDefinitionsWithImplicitConstructionMustHaveOneInherit",",,,") ) - /// 'let' and 'do' bindings must come before member and interface definitions in type definitions - /// (Originally from ..\FSComp.txt:794) - static member tcTypeDefinitionsWithImplicitConstructionMustHaveLocalBindingsBeforeMembers() = (960, GetStringFunc("tcTypeDefinitionsWithImplicitConstructionMustHaveLocalBindingsBeforeMembers",",,,") ) - /// This 'inherit' declaration specifies the inherited type but no arguments. Consider supplying arguments, e.g. 'inherit BaseType(args)'. - /// (Originally from ..\FSComp.txt:795) - static member tcInheritDeclarationMissingArguments() = (961, GetStringFunc("tcInheritDeclarationMissingArguments",",,,") ) - /// This 'inherit' declaration has arguments, but is not in a type with a primary constructor. Consider adding arguments to your type definition, e.g. 'type X(args) = ...'. - /// (Originally from ..\FSComp.txt:796) - static member tcInheritConstructionCallNotPartOfImplicitSequence() = (962, GetStringFunc("tcInheritConstructionCallNotPartOfImplicitSequence",",,,") ) - /// This definition may only be used in a type with a primary constructor. Consider adding arguments to your type definition, e.g. 'type X(args) = ...'. - /// (Originally from ..\FSComp.txt:797) - static member tcLetAndDoRequiresImplicitConstructionSequence() = (963, GetStringFunc("tcLetAndDoRequiresImplicitConstructionSequence",",,,") ) - /// Type abbreviations cannot have augmentations - /// (Originally from ..\FSComp.txt:798) - static member tcTypeAbbreviationsCannotHaveAugmentations() = (964, GetStringFunc("tcTypeAbbreviationsCannotHaveAugmentations",",,,") ) - /// The path '%s' is a namespace. A module abbreviation may not abbreviate a namespace. - /// (Originally from ..\FSComp.txt:799) - static member tcModuleAbbreviationForNamespace(a0 : System.String) = (965, GetStringFunc("tcModuleAbbreviationForNamespace",",,,%s,,,") a0) - /// The type '%s' is used in an invalid way. A value prior to '%s' has an inferred type involving '%s', which is an invalid forward reference. - /// (Originally from ..\FSComp.txt:800) - static member tcTypeUsedInInvalidWay(a0 : System.String, a1 : System.String, a2 : System.String) = (966, GetStringFunc("tcTypeUsedInInvalidWay",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// The member '%s' is used in an invalid way. A use of '%s' has been inferred prior to the definition of '%s', which is an invalid forward reference. - /// (Originally from ..\FSComp.txt:801) - static member tcMemberUsedInInvalidWay(a0 : System.String, a1 : System.String, a2 : System.String) = (967, GetStringFunc("tcMemberUsedInInvalidWay",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// The attribute 'AutoOpen(\"%s\")' in the assembly '%s' did not refer to a valid module or namespace in that assembly and has been ignored - /// (Originally from ..\FSComp.txt:804) - static member tcAttributeAutoOpenWasIgnored(a0 : System.String, a1 : System.String) = (970, GetStringFunc("tcAttributeAutoOpenWasIgnored",",,,%s,,,%s,,,") a0 a1) - /// Undefined value '%s' - /// (Originally from ..\FSComp.txt:805) - static member ilUndefinedValue(a0 : System.String) = (971, GetStringFunc("ilUndefinedValue",",,,%s,,,") a0) - /// Label %s not found - /// (Originally from ..\FSComp.txt:806) - static member ilLabelNotFound(a0 : System.String) = (972, GetStringFunc("ilLabelNotFound",",,,%s,,,") a0) - /// Incorrect number of type arguments to local call - /// (Originally from ..\FSComp.txt:807) - static member ilIncorrectNumberOfTypeArguments() = (973, GetStringFunc("ilIncorrectNumberOfTypeArguments",",,,") ) - /// Dynamic invocation of %s is not supported - /// (Originally from ..\FSComp.txt:808) - static member ilDynamicInvocationNotSupported(a0 : System.String) = (GetStringFunc("ilDynamicInvocationNotSupported",",,,%s,,,") a0) - /// Taking the address of a literal field is invalid - /// (Originally from ..\FSComp.txt:809) - static member ilAddressOfLiteralFieldIsInvalid() = (975, GetStringFunc("ilAddressOfLiteralFieldIsInvalid",",,,") ) - /// This operation involves taking the address of a value '%s' represented using a local variable or other special representation. This is invalid. - /// (Originally from ..\FSComp.txt:810) - static member ilAddressOfValueHereIsInvalid(a0 : System.String) = (976, GetStringFunc("ilAddressOfValueHereIsInvalid",",,,%s,,,") a0) - /// Custom marshallers cannot be specified in F# code. Consider using a C# helper function. - /// (Originally from ..\FSComp.txt:811) - static member ilCustomMarshallersCannotBeUsedInFSharp() = (980, GetStringFunc("ilCustomMarshallersCannotBeUsedInFSharp",",,,") ) - /// The MarshalAs attribute could not be decoded - /// (Originally from ..\FSComp.txt:812) - static member ilMarshalAsAttributeCannotBeDecoded() = (981, GetStringFunc("ilMarshalAsAttributeCannotBeDecoded",",,,") ) - /// The signature for this external function contains type parameters. Constrain the argument and return types to indicate the types of the corresponding C function. - /// (Originally from ..\FSComp.txt:813) - static member ilSignatureForExternalFunctionContainsTypeParameters() = (982, GetStringFunc("ilSignatureForExternalFunctionContainsTypeParameters",",,,") ) - /// The DllImport attribute could not be decoded - /// (Originally from ..\FSComp.txt:814) - static member ilDllImportAttributeCouldNotBeDecoded() = (983, GetStringFunc("ilDllImportAttributeCouldNotBeDecoded",",,,") ) - /// Literal fields cannot be set - /// (Originally from ..\FSComp.txt:815) - static member ilLiteralFieldsCannotBeSet() = (984, GetStringFunc("ilLiteralFieldsCannotBeSet",",,,") ) - /// GenSetStorage: %s was represented as a static method but was not an appropriate lambda expression - /// (Originally from ..\FSComp.txt:816) - static member ilStaticMethodIsNotLambda(a0 : System.String) = (985, GetStringFunc("ilStaticMethodIsNotLambda",",,,%s,,,") a0) - /// Mutable variables cannot escape their method - /// (Originally from ..\FSComp.txt:817) - static member ilMutableVariablesCannotEscapeMethod() = (986, GetStringFunc("ilMutableVariablesCannotEscapeMethod",",,,") ) - /// Compiler error: unexpected unrealized value - /// (Originally from ..\FSComp.txt:818) - static member ilUnexpectedUnrealizedValue() = (987, GetStringFunc("ilUnexpectedUnrealizedValue",",,,") ) - /// Main module of program is empty: nothing will happen when it is run - /// (Originally from ..\FSComp.txt:819) - static member ilMainModuleEmpty() = (988, GetStringFunc("ilMainModuleEmpty",",,,") ) - /// This type cannot be used for a literal field - /// (Originally from ..\FSComp.txt:820) - static member ilTypeCannotBeUsedForLiteralField() = (989, GetStringFunc("ilTypeCannotBeUsedForLiteralField",",,,") ) - /// Unexpected GetSet annotation on a property - /// (Originally from ..\FSComp.txt:821) - static member ilUnexpectedGetSetAnnotation() = (990, GetStringFunc("ilUnexpectedGetSetAnnotation",",,,") ) - /// The FieldOffset attribute could not be decoded - /// (Originally from ..\FSComp.txt:822) - static member ilFieldOffsetAttributeCouldNotBeDecoded() = (991, GetStringFunc("ilFieldOffsetAttributeCouldNotBeDecoded",",,,") ) - /// The StructLayout attribute could not be decoded - /// (Originally from ..\FSComp.txt:823) - static member ilStructLayoutAttributeCouldNotBeDecoded() = (992, GetStringFunc("ilStructLayoutAttributeCouldNotBeDecoded",",,,") ) - /// The DefaultAugmentation attribute could not be decoded - /// (Originally from ..\FSComp.txt:824) - static member ilDefaultAugmentationAttributeCouldNotBeDecoded() = (993, GetStringFunc("ilDefaultAugmentationAttributeCouldNotBeDecoded",",,,") ) - /// Reflected definitions cannot contain uses of the prefix splice operator '%%' - /// (Originally from ..\FSComp.txt:825) - static member ilReflectedDefinitionsCannotUseSliceOperator() = (994, GetStringFunc("ilReflectedDefinitionsCannotUseSliceOperator",",,,") ) - /// Problem with codepage '%d': %s - /// (Originally from ..\FSComp.txt:826) - static member optsProblemWithCodepage(a0 : System.Int32, a1 : System.String) = (1000, GetStringFunc("optsProblemWithCodepage",",,,%d,,,%s,,,") a0 a1) - /// Copyright (c) Microsoft Corporation. All Rights Reserved. - /// (Originally from ..\FSComp.txt:827) - static member optsCopyright() = (GetStringFunc("optsCopyright",",,,") ) - /// Freely distributed under the MIT Open Source License. https://github.com/Microsoft/visualfsharp/blob/master/License.txt - /// (Originally from ..\FSComp.txt:828) - static member optsCopyrightCommunity() = (GetStringFunc("optsCopyrightCommunity",",,,") ) - /// Name of the output file (Short form: -o) - /// (Originally from ..\FSComp.txt:829) - static member optsNameOfOutputFile() = (GetStringFunc("optsNameOfOutputFile",",,,") ) - /// Build a console executable - /// (Originally from ..\FSComp.txt:830) - static member optsBuildConsole() = (GetStringFunc("optsBuildConsole",",,,") ) - /// Build a Windows executable - /// (Originally from ..\FSComp.txt:831) - static member optsBuildWindows() = (GetStringFunc("optsBuildWindows",",,,") ) - /// Build a library (Short form: -a) - /// (Originally from ..\FSComp.txt:832) - static member optsBuildLibrary() = (GetStringFunc("optsBuildLibrary",",,,") ) - /// Build a module that can be added to another assembly - /// (Originally from ..\FSComp.txt:833) - static member optsBuildModule() = (GetStringFunc("optsBuildModule",",,,") ) - /// Delay-sign the assembly using only the public portion of the strong name key - /// (Originally from ..\FSComp.txt:834) - static member optsDelaySign() = (GetStringFunc("optsDelaySign",",,,") ) - /// Public-sign the assembly using only the public portion of the strong name key, and mark the assembly as signed - /// (Originally from ..\FSComp.txt:835) - static member optsPublicSign() = (GetStringFunc("optsPublicSign",",,,") ) - /// Write the xmldoc of the assembly to the given file - /// (Originally from ..\FSComp.txt:836) - static member optsWriteXml() = (GetStringFunc("optsWriteXml",",,,") ) - /// Specify a strong name key file - /// (Originally from ..\FSComp.txt:837) - static member optsStrongKeyFile() = (GetStringFunc("optsStrongKeyFile",",,,") ) - /// Specify a strong name key container - /// (Originally from ..\FSComp.txt:838) - static member optsStrongKeyContainer() = (GetStringFunc("optsStrongKeyContainer",",,,") ) - /// Limit which platforms this code can run on: x86, Itanium, x64, anycpu32bitpreferred, or anycpu. The default is anycpu. - /// (Originally from ..\FSComp.txt:839) - static member optsPlatform() = (GetStringFunc("optsPlatform",",,,") ) - /// Only include optimization information essential for implementing inlined constructs. Inhibits cross-module inlining but improves binary compatibility. - /// (Originally from ..\FSComp.txt:840) - static member optsNoOpt() = (GetStringFunc("optsNoOpt",",,,") ) - /// Don't add a resource to the generated assembly containing F#-specific metadata - /// (Originally from ..\FSComp.txt:841) - static member optsNoInterface() = (GetStringFunc("optsNoInterface",",,,") ) - /// Print the inferred interface of the assembly to a file - /// (Originally from ..\FSComp.txt:842) - static member optsSig() = (GetStringFunc("optsSig",",,,") ) - /// Reference an assembly (Short form: -r) - /// (Originally from ..\FSComp.txt:843) - static member optsReference() = (GetStringFunc("optsReference",",,,") ) - /// Specify a Win32 resource file (.res) - /// (Originally from ..\FSComp.txt:844) - static member optsWin32res() = (GetStringFunc("optsWin32res",",,,") ) - /// Specify a Win32 manifest file - /// (Originally from ..\FSComp.txt:845) - static member optsWin32manifest() = (GetStringFunc("optsWin32manifest",",,,") ) - /// Do not include the default Win32 manifest - /// (Originally from ..\FSComp.txt:846) - static member optsNowin32manifest() = (GetStringFunc("optsNowin32manifest",",,,") ) - /// Embed all source files in the portable PDB file - /// (Originally from ..\FSComp.txt:847) - static member optsEmbedAllSource() = (GetStringFunc("optsEmbedAllSource",",,,") ) - /// Embed specific source files in the portable PDB file - /// (Originally from ..\FSComp.txt:848) - static member optsEmbedSource() = (GetStringFunc("optsEmbedSource",",,,") ) - /// Source link information file to embed in the portable PDB file - /// (Originally from ..\FSComp.txt:849) - static member optsSourceLink() = (GetStringFunc("optsSourceLink",",,,") ) - /// --embed switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - /// (Originally from ..\FSComp.txt:850) - static member optsEmbeddedSourceRequirePortablePDBs() = (1501, GetStringFunc("optsEmbeddedSourceRequirePortablePDBs",",,,") ) - /// --sourcelink switch only supported when emitting a Portable PDB (--debug:portable or --debug:embedded) - /// (Originally from ..\FSComp.txt:851) - static member optsSourceLinkRequirePortablePDBs() = (1502, GetStringFunc("optsSourceLinkRequirePortablePDBs",",,,") ) - /// Source file is too large to embed in a portable PDB - /// (Originally from ..\FSComp.txt:852) - static member srcFileTooLarge() = (GetStringFunc("srcFileTooLarge",",,,") ) - /// Embed the specified managed resource - /// (Originally from ..\FSComp.txt:853) - static member optsResource() = (GetStringFunc("optsResource",",,,") ) - /// Link the specified resource to this assembly where the resinfo format is [,[,public|private]] - /// (Originally from ..\FSComp.txt:854) - static member optsLinkresource() = (GetStringFunc("optsLinkresource",",,,") ) - /// Emit debug information (Short form: -g) - /// (Originally from ..\FSComp.txt:855) - static member optsDebugPM() = (GetStringFunc("optsDebugPM",",,,") ) - /// Specify debugging type: full, portable, embedded, pdbonly. ('%s' is the default if no debuggging type specified and enables attaching a debugger to a running program, 'portable' is a cross-platform format, 'embedded' is a cross-platform format embedded into the output file). - /// (Originally from ..\FSComp.txt:856) - static member optsDebug(a0 : System.String) = (GetStringFunc("optsDebug",",,,%s,,,") a0) - /// Enable optimizations (Short form: -O) - /// (Originally from ..\FSComp.txt:857) - static member optsOptimize() = (GetStringFunc("optsOptimize",",,,") ) - /// Enable or disable tailcalls - /// (Originally from ..\FSComp.txt:858) - static member optsTailcalls() = (GetStringFunc("optsTailcalls",",,,") ) - /// Produce a deterministic assembly (including module version GUID and timestamp) - /// (Originally from ..\FSComp.txt:859) - static member optsDeterministic() = (GetStringFunc("optsDeterministic",",,,") ) - /// Enable or disable cross-module optimizations - /// (Originally from ..\FSComp.txt:860) - static member optsCrossoptimize() = (GetStringFunc("optsCrossoptimize",",,,") ) - /// Report all warnings as errors - /// (Originally from ..\FSComp.txt:861) - static member optsWarnaserrorPM() = (GetStringFunc("optsWarnaserrorPM",",,,") ) - /// Report specific warnings as errors - /// (Originally from ..\FSComp.txt:862) - static member optsWarnaserror() = (GetStringFunc("optsWarnaserror",",,,") ) - /// Set a warning level (0-5) - /// (Originally from ..\FSComp.txt:863) - static member optsWarn() = (GetStringFunc("optsWarn",",,,") ) - /// Disable specific warning messages - /// (Originally from ..\FSComp.txt:864) - static member optsNowarn() = (GetStringFunc("optsNowarn",",,,") ) - /// Enable specific warnings that may be off by default - /// (Originally from ..\FSComp.txt:865) - static member optsWarnOn() = (GetStringFunc("optsWarnOn",",,,") ) - /// Generate overflow checks - /// (Originally from ..\FSComp.txt:866) - static member optsChecked() = (GetStringFunc("optsChecked",",,,") ) - /// Define conditional compilation symbols (Short form: -d) - /// (Originally from ..\FSComp.txt:867) - static member optsDefine() = (GetStringFunc("optsDefine",",,,") ) - /// Ignore ML compatibility warnings - /// (Originally from ..\FSComp.txt:868) - static member optsMlcompatibility() = (GetStringFunc("optsMlcompatibility",",,,") ) - /// Suppress compiler copyright message - /// (Originally from ..\FSComp.txt:869) - static member optsNologo() = (GetStringFunc("optsNologo",",,,") ) - /// Display this usage message (Short form: -?) - /// (Originally from ..\FSComp.txt:870) - static member optsHelp() = (GetStringFunc("optsHelp",",,,") ) - /// Read response file for more options - /// (Originally from ..\FSComp.txt:871) - static member optsResponseFile() = (GetStringFunc("optsResponseFile",",,,") ) - /// Specify the codepage used to read source files - /// (Originally from ..\FSComp.txt:872) - static member optsCodepage() = (GetStringFunc("optsCodepage",",,,") ) - /// Output messages in UTF-8 encoding - /// (Originally from ..\FSComp.txt:873) - static member optsUtf8output() = (GetStringFunc("optsUtf8output",",,,") ) - /// Output messages with fully qualified paths - /// (Originally from ..\FSComp.txt:874) - static member optsFullpaths() = (GetStringFunc("optsFullpaths",",,,") ) - /// Specify a directory for the include path which is used to resolve source files and assemblies (Short form: -I) - /// (Originally from ..\FSComp.txt:875) - static member optsLib() = (GetStringFunc("optsLib",",,,") ) - /// Base address for the library to be built - /// (Originally from ..\FSComp.txt:876) - static member optsBaseaddress() = (GetStringFunc("optsBaseaddress",",,,") ) - /// Do not reference the default CLI assemblies by default - /// (Originally from ..\FSComp.txt:877) - static member optsNoframework() = (GetStringFunc("optsNoframework",",,,") ) - /// Statically link the F# library and all referenced DLLs that depend on it into the assembly being generated - /// (Originally from ..\FSComp.txt:878) - static member optsStandalone() = (GetStringFunc("optsStandalone",",,,") ) - /// Statically link the given assembly and all referenced DLLs that depend on this assembly. Use an assembly name e.g. mylib, not a DLL name. - /// (Originally from ..\FSComp.txt:879) - static member optsStaticlink() = (GetStringFunc("optsStaticlink",",,,") ) - /// Use a resident background compilation service to improve compiler startup times. - /// (Originally from ..\FSComp.txt:880) - static member optsResident() = (GetStringFunc("optsResident",",,,") ) - /// Name the output debug file - /// (Originally from ..\FSComp.txt:881) - static member optsPdb() = (GetStringFunc("optsPdb",",,,") ) - /// Resolve assembly references using directory-based rules rather than MSBuild resolution - /// (Originally from ..\FSComp.txt:882) - static member optsSimpleresolution() = (GetStringFunc("optsSimpleresolution",",,,") ) - /// Unrecognized target '%s', expected 'exe', 'winexe', 'library' or 'module' - /// (Originally from ..\FSComp.txt:883) - static member optsUnrecognizedTarget(a0 : System.String) = (1048, GetStringFunc("optsUnrecognizedTarget",",,,%s,,,") a0) - /// Unrecognized debug type '%s', expected 'pdbonly' or 'full' - /// (Originally from ..\FSComp.txt:884) - static member optsUnrecognizedDebugType(a0 : System.String) = (1049, GetStringFunc("optsUnrecognizedDebugType",",,,%s,,,") a0) - /// Invalid warning level '%d' - /// (Originally from ..\FSComp.txt:885) - static member optsInvalidWarningLevel(a0 : System.Int32) = (1050, GetStringFunc("optsInvalidWarningLevel",",,,%d,,,") a0) - /// Short form of '%s' - /// (Originally from ..\FSComp.txt:886) - static member optsShortFormOf(a0 : System.String) = (GetStringFunc("optsShortFormOf",",,,%s,,,") a0) - /// The command-line option '--cliroot' has been deprecated. Use an explicit reference to a specific copy of mscorlib.dll instead. - /// (Originally from ..\FSComp.txt:887) - static member optsClirootDeprecatedMsg() = (GetStringFunc("optsClirootDeprecatedMsg",",,,") ) - /// Use to override where the compiler looks for mscorlib.dll and framework components - /// (Originally from ..\FSComp.txt:888) - static member optsClirootDescription() = (GetStringFunc("optsClirootDescription",",,,") ) - /// - OUTPUT FILES - - /// (Originally from ..\FSComp.txt:889) - static member optsHelpBannerOutputFiles() = (GetStringFunc("optsHelpBannerOutputFiles",",,,") ) - /// - INPUT FILES - - /// (Originally from ..\FSComp.txt:890) - static member optsHelpBannerInputFiles() = (GetStringFunc("optsHelpBannerInputFiles",",,,") ) - /// - RESOURCES - - /// (Originally from ..\FSComp.txt:891) - static member optsHelpBannerResources() = (GetStringFunc("optsHelpBannerResources",",,,") ) - /// - CODE GENERATION - - /// (Originally from ..\FSComp.txt:892) - static member optsHelpBannerCodeGen() = (GetStringFunc("optsHelpBannerCodeGen",",,,") ) - /// - ADVANCED - - /// (Originally from ..\FSComp.txt:893) - static member optsHelpBannerAdvanced() = (GetStringFunc("optsHelpBannerAdvanced",",,,") ) - /// - MISCELLANEOUS - - /// (Originally from ..\FSComp.txt:894) - static member optsHelpBannerMisc() = (GetStringFunc("optsHelpBannerMisc",",,,") ) - /// - LANGUAGE - - /// (Originally from ..\FSComp.txt:895) - static member optsHelpBannerLanguage() = (GetStringFunc("optsHelpBannerLanguage",",,,") ) - /// - ERRORS AND WARNINGS - - /// (Originally from ..\FSComp.txt:896) - static member optsHelpBannerErrsAndWarns() = (GetStringFunc("optsHelpBannerErrsAndWarns",",,,") ) - /// Unknown --test argument: '%s' - /// (Originally from ..\FSComp.txt:897) - static member optsUnknownArgumentToTheTestSwitch(a0 : System.String) = (1063, GetStringFunc("optsUnknownArgumentToTheTestSwitch",",,,%s,,,") a0) - /// Unrecognized platform '%s', valid values are 'x86', 'x64', 'Itanium', 'anycpu32bitpreferred', and 'anycpu' - /// (Originally from ..\FSComp.txt:898) - static member optsUnknownPlatform(a0 : System.String) = (1064, GetStringFunc("optsUnknownPlatform",",,,%s,,,") a0) - /// The command-line option '%s' is for test purposes only - /// (Originally from ..\FSComp.txt:899) - static member optsInternalNoDescription(a0 : System.String) = (GetStringFunc("optsInternalNoDescription",",,,%s,,,") a0) - /// The command-line option '%s' has been deprecated - /// (Originally from ..\FSComp.txt:900) - static member optsDCLONoDescription(a0 : System.String) = (GetStringFunc("optsDCLONoDescription",",,,%s,,,") a0) - /// The command-line option '%s' has been deprecated. Use '%s' instead. - /// (Originally from ..\FSComp.txt:901) - static member optsDCLODeprecatedSuggestAlternative(a0 : System.String, a1 : System.String) = (GetStringFunc("optsDCLODeprecatedSuggestAlternative",",,,%s,,,%s,,,") a0 a1) - /// The command-line option '%s' has been deprecated. HTML document generation is now part of the F# Power Pack, via the tool FsHtmlDoc.exe. - /// (Originally from ..\FSComp.txt:902) - static member optsDCLOHtmlDoc(a0 : System.String) = (GetStringFunc("optsDCLOHtmlDoc",",,,%s,,,") a0) - /// Output warning and error messages in color - /// (Originally from ..\FSComp.txt:903) - static member optsConsoleColors() = (GetStringFunc("optsConsoleColors",",,,") ) - /// Enable high-entropy ASLR - /// (Originally from ..\FSComp.txt:904) - static member optsUseHighEntropyVA() = (GetStringFunc("optsUseHighEntropyVA",",,,") ) - /// Specify subsystem version of this assembly - /// (Originally from ..\FSComp.txt:905) - static member optsSubSystemVersion() = (GetStringFunc("optsSubSystemVersion",",,,") ) - /// Specify target framework profile of this assembly. Valid values are mscorlib, netcore or netstandard. Default - mscorlib - /// (Originally from ..\FSComp.txt:906) - static member optsTargetProfile() = (GetStringFunc("optsTargetProfile",",,,") ) - /// Emit debug information in quotations - /// (Originally from ..\FSComp.txt:907) - static member optsEmitDebugInfoInQuotations() = (GetStringFunc("optsEmitDebugInfoInQuotations",",,,") ) - /// Specify the preferred output language culture name (e.g. es-ES, ja-JP) - /// (Originally from ..\FSComp.txt:908) - static member optsPreferredUiLang() = (GetStringFunc("optsPreferredUiLang",",,,") ) - /// Don't copy FSharp.Core.dll along the produced binaries - /// (Originally from ..\FSComp.txt:909) - static member optsNoCopyFsharpCore() = (GetStringFunc("optsNoCopyFsharpCore",",,,") ) - /// Invalid version '%s' for '--subsystemversion'. The version must be 4.00 or greater. - /// (Originally from ..\FSComp.txt:910) - static member optsInvalidSubSystemVersion(a0 : System.String) = (1051, GetStringFunc("optsInvalidSubSystemVersion",",,,%s,,,") a0) - /// Invalid value '%s' for '--targetprofile', valid values are 'mscorlib', 'netcore' or 'netstandard'. - /// (Originally from ..\FSComp.txt:911) - static member optsInvalidTargetProfile(a0 : System.String) = (1052, GetStringFunc("optsInvalidTargetProfile",",,,%s,,,") a0) - /// Full name - /// (Originally from ..\FSComp.txt:912) - static member typeInfoFullName() = (GetStringFunc("typeInfoFullName",",,,") ) - /// and %d other overloads - /// (Originally from ..\FSComp.txt:916) - static member typeInfoOtherOverloads(a0 : System.Int32) = (GetStringFunc("typeInfoOtherOverloads",",,,%d,,,") a0) - /// union case - /// (Originally from ..\FSComp.txt:917) - static member typeInfoUnionCase() = (GetStringFunc("typeInfoUnionCase",",,,") ) - /// active pattern result - /// (Originally from ..\FSComp.txt:918) - static member typeInfoActivePatternResult() = (GetStringFunc("typeInfoActivePatternResult",",,,") ) - /// active recognizer - /// (Originally from ..\FSComp.txt:919) - static member typeInfoActiveRecognizer() = (GetStringFunc("typeInfoActiveRecognizer",",,,") ) - /// field - /// (Originally from ..\FSComp.txt:920) - static member typeInfoField() = (GetStringFunc("typeInfoField",",,,") ) - /// event - /// (Originally from ..\FSComp.txt:921) - static member typeInfoEvent() = (GetStringFunc("typeInfoEvent",",,,") ) - /// property - /// (Originally from ..\FSComp.txt:922) - static member typeInfoProperty() = (GetStringFunc("typeInfoProperty",",,,") ) - /// extension - /// (Originally from ..\FSComp.txt:923) - static member typeInfoExtension() = (GetStringFunc("typeInfoExtension",",,,") ) - /// custom operation - /// (Originally from ..\FSComp.txt:924) - static member typeInfoCustomOperation() = (GetStringFunc("typeInfoCustomOperation",",,,") ) - /// argument - /// (Originally from ..\FSComp.txt:925) - static member typeInfoArgument() = (GetStringFunc("typeInfoArgument",",,,") ) - /// anonymous record field - /// (Originally from ..\FSComp.txt:926) - static member typeInfoAnonRecdField() = (GetStringFunc("typeInfoAnonRecdField",",,,") ) - /// patvar - /// (Originally from ..\FSComp.txt:927) - static member typeInfoPatternVariable() = (GetStringFunc("typeInfoPatternVariable",",,,") ) - /// namespace - /// (Originally from ..\FSComp.txt:928) - static member typeInfoNamespace() = (GetStringFunc("typeInfoNamespace",",,,") ) - /// module - /// (Originally from ..\FSComp.txt:929) - static member typeInfoModule() = (GetStringFunc("typeInfoModule",",,,") ) - /// namespace/module - /// (Originally from ..\FSComp.txt:930) - static member typeInfoNamespaceOrModule() = (GetStringFunc("typeInfoNamespaceOrModule",",,,") ) - /// from %s - /// (Originally from ..\FSComp.txt:931) - static member typeInfoFromFirst(a0 : System.String) = (GetStringFunc("typeInfoFromFirst",",,,%s,,,") a0) - /// also from %s - /// (Originally from ..\FSComp.txt:932) - static member typeInfoFromNext(a0 : System.String) = (GetStringFunc("typeInfoFromNext",",,,%s,,,") a0) - /// generated property - /// (Originally from ..\FSComp.txt:933) - static member typeInfoGeneratedProperty() = (GetStringFunc("typeInfoGeneratedProperty",",,,") ) - /// generated type - /// (Originally from ..\FSComp.txt:934) - static member typeInfoGeneratedType() = (GetStringFunc("typeInfoGeneratedType",",,,") ) - /// Found by AssemblyFolders registry key - /// (Originally from ..\FSComp.txt:935) - static member assemblyResolutionFoundByAssemblyFoldersKey() = (GetStringFunc("assemblyResolutionFoundByAssemblyFoldersKey",",,,") ) - /// Found by AssemblyFoldersEx registry key - /// (Originally from ..\FSComp.txt:936) - static member assemblyResolutionFoundByAssemblyFoldersExKey() = (GetStringFunc("assemblyResolutionFoundByAssemblyFoldersExKey",",,,") ) - /// .NET Framework - /// (Originally from ..\FSComp.txt:937) - static member assemblyResolutionNetFramework() = (GetStringFunc("assemblyResolutionNetFramework",",,,") ) - /// Global Assembly Cache - /// (Originally from ..\FSComp.txt:938) - static member assemblyResolutionGAC() = (GetStringFunc("assemblyResolutionGAC",",,,") ) - /// Recursive class hierarchy in type '%s' - /// (Originally from ..\FSComp.txt:939) - static member recursiveClassHierarchy(a0 : System.String) = (1089, GetStringFunc("recursiveClassHierarchy",",,,%s,,,") a0) - /// Invalid recursive reference to an abstract slot - /// (Originally from ..\FSComp.txt:940) - static member InvalidRecursiveReferenceToAbstractSlot() = (1090, GetStringFunc("InvalidRecursiveReferenceToAbstractSlot",",,,") ) - /// The event '%s' has a non-standard type. If this event is declared in another CLI language, you may need to access this event using the explicit %s and %s methods for the event. If this event is declared in F#, make the type of the event an instantiation of either 'IDelegateEvent<_>' or 'IEvent<_,_>'. - /// (Originally from ..\FSComp.txt:941) - static member eventHasNonStandardType(a0 : System.String, a1 : System.String, a2 : System.String) = (1091, GetStringFunc("eventHasNonStandardType",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// The type '%s' is not accessible from this code location - /// (Originally from ..\FSComp.txt:942) - static member typeIsNotAccessible(a0 : System.String) = (1092, GetStringFunc("typeIsNotAccessible",",,,%s,,,") a0) - /// The union cases or fields of the type '%s' are not accessible from this code location - /// (Originally from ..\FSComp.txt:943) - static member unionCasesAreNotAccessible(a0 : System.String) = (1093, GetStringFunc("unionCasesAreNotAccessible",",,,%s,,,") a0) - /// The value '%s' is not accessible from this code location - /// (Originally from ..\FSComp.txt:944) - static member valueIsNotAccessible(a0 : System.String) = (1094, GetStringFunc("valueIsNotAccessible",",,,%s,,,") a0) - /// The union case '%s' is not accessible from this code location - /// (Originally from ..\FSComp.txt:945) - static member unionCaseIsNotAccessible(a0 : System.String) = (1095, GetStringFunc("unionCaseIsNotAccessible",",,,%s,,,") a0) - /// The record, struct or class field '%s' is not accessible from this code location - /// (Originally from ..\FSComp.txt:946) - static member fieldIsNotAccessible(a0 : System.String) = (1096, GetStringFunc("fieldIsNotAccessible",",,,%s,,,") a0) - /// The struct or class field '%s' is not accessible from this code location - /// (Originally from ..\FSComp.txt:947) - static member structOrClassFieldIsNotAccessible(a0 : System.String) = (1097, GetStringFunc("structOrClassFieldIsNotAccessible",",,,%s,,,") a0) - /// This construct is experimental - /// (Originally from ..\FSComp.txt:948) - static member experimentalConstruct() = (GetStringFunc("experimentalConstruct",",,,") ) - /// No Invoke methods found for delegate type - /// (Originally from ..\FSComp.txt:949) - static member noInvokeMethodsFound() = (1099, GetStringFunc("noInvokeMethodsFound",",,,") ) - /// More than one Invoke method found for delegate type - /// (Originally from ..\FSComp.txt:950) - static member moreThanOneInvokeMethodFound() = (GetStringFunc("moreThanOneInvokeMethodFound",",,,") ) - /// Delegates are not allowed to have curried signatures - /// (Originally from ..\FSComp.txt:951) - static member delegatesNotAllowedToHaveCurriedSignatures() = (1101, GetStringFunc("delegatesNotAllowedToHaveCurriedSignatures",",,,") ) - /// Unexpected Expr.TyChoose - /// (Originally from ..\FSComp.txt:952) - static member tlrUnexpectedTExpr() = (1102, GetStringFunc("tlrUnexpectedTExpr",",,,") ) - /// Note: Lambda-lifting optimizations have not been applied because of the use of this local constrained generic function as a first class value. Adding type constraints may resolve this condition. - /// (Originally from ..\FSComp.txt:953) - static member tlrLambdaLiftingOptimizationsNotApplied() = (1103, GetStringFunc("tlrLambdaLiftingOptimizationsNotApplied",",,,") ) - /// Identifiers containing '@' are reserved for use in F# code generation - /// (Originally from ..\FSComp.txt:954) - static member lexhlpIdentifiersContainingAtSymbolReserved() = (1104, GetStringFunc("lexhlpIdentifiersContainingAtSymbolReserved",",,,") ) - /// The identifier '%s' is reserved for future use by F# - /// (Originally from ..\FSComp.txt:955) - static member lexhlpIdentifierReserved(a0 : System.String) = (GetStringFunc("lexhlpIdentifierReserved",",,,%s,,,") a0) - /// Missing variable '%s' - /// (Originally from ..\FSComp.txt:956) - static member patcMissingVariable(a0 : System.String) = (1106, GetStringFunc("patcMissingVariable",",,,%s,,,") a0) - /// Partial active patterns may only generate one result - /// (Originally from ..\FSComp.txt:957) - static member patcPartialActivePatternsGenerateOneResult() = (1107, GetStringFunc("patcPartialActivePatternsGenerateOneResult",",,,") ) - /// The type '%s' is required here and is unavailable. You must add a reference to assembly '%s'. - /// (Originally from ..\FSComp.txt:958) - static member impTypeRequiredUnavailable(a0 : System.String, a1 : System.String) = (1108, GetStringFunc("impTypeRequiredUnavailable",",,,%s,,,%s,,,") a0 a1) - /// A reference to the type '%s' in assembly '%s' was found, but the type could not be found in that assembly - /// (Originally from ..\FSComp.txt:959) - static member impReferencedTypeCouldNotBeFoundInAssembly(a0 : System.String, a1 : System.String) = (1109, GetStringFunc("impReferencedTypeCouldNotBeFoundInAssembly",",,,%s,,,%s,,,") a0 a1) - /// Internal error or badly formed metadata: not enough type parameters were in scope while importing - /// (Originally from ..\FSComp.txt:960) - static member impNotEnoughTypeParamsInScopeWhileImporting() = (1110, GetStringFunc("impNotEnoughTypeParamsInScopeWhileImporting",",,,") ) - /// A reference to the DLL %s is required by assembly %s. The imported type %s is located in the first assembly and could not be resolved. - /// (Originally from ..\FSComp.txt:961) - static member impReferenceToDllRequiredByAssembly(a0 : System.String, a1 : System.String, a2 : System.String) = (1111, GetStringFunc("impReferenceToDllRequiredByAssembly",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// An imported assembly uses the type '%s' but that type is not public - /// (Originally from ..\FSComp.txt:962) - static member impImportedAssemblyUsesNotPublicType(a0 : System.String) = (1112, GetStringFunc("impImportedAssemblyUsesNotPublicType",",,,%s,,,") a0) - /// The value '%s' was marked inline but its implementation makes use of an internal or private function which is not sufficiently accessible - /// (Originally from ..\FSComp.txt:963) - static member optValueMarkedInlineButIncomplete(a0 : System.String) = (1113, GetStringFunc("optValueMarkedInlineButIncomplete",",,,%s,,,") a0) - /// The value '%s' was marked inline but was not bound in the optimization environment - /// (Originally from ..\FSComp.txt:964) - static member optValueMarkedInlineButWasNotBoundInTheOptEnv(a0 : System.String) = (1114, GetStringFunc("optValueMarkedInlineButWasNotBoundInTheOptEnv",",,,%s,,,") a0) - /// Local value %s not found during optimization - /// (Originally from ..\FSComp.txt:965) - static member optLocalValueNotFoundDuringOptimization(a0 : System.String) = (1115, GetStringFunc("optLocalValueNotFoundDuringOptimization",",,,%s,,,") a0) - /// A value marked as 'inline' has an unexpected value - /// (Originally from ..\FSComp.txt:966) - static member optValueMarkedInlineHasUnexpectedValue() = (1116, GetStringFunc("optValueMarkedInlineHasUnexpectedValue",",,,") ) - /// A value marked as 'inline' could not be inlined - /// (Originally from ..\FSComp.txt:967) - static member optValueMarkedInlineCouldNotBeInlined() = (1117, GetStringFunc("optValueMarkedInlineCouldNotBeInlined",",,,") ) - /// Failed to inline the value '%s' marked 'inline', perhaps because a recursive value was marked 'inline' - /// (Originally from ..\FSComp.txt:968) - static member optFailedToInlineValue(a0 : System.String) = (1118, GetStringFunc("optFailedToInlineValue",",,,%s,,,") a0) - /// Recursive ValValue %s - /// (Originally from ..\FSComp.txt:969) - static member optRecursiveValValue(a0 : System.String) = (1119, GetStringFunc("optRecursiveValValue",",,,%s,,,") a0) - /// The indentation of this 'in' token is incorrect with respect to the corresponding 'let' - /// (Originally from ..\FSComp.txt:970) - static member lexfltIncorrentIndentationOfIn() = (GetStringFunc("lexfltIncorrentIndentationOfIn",",,,") ) - /// Possible incorrect indentation: this token is offside of context started at position %s. Try indenting this token further or using standard formatting conventions. - /// (Originally from ..\FSComp.txt:971) - static member lexfltTokenIsOffsideOfContextStartedEarlier(a0 : System.String) = (GetStringFunc("lexfltTokenIsOffsideOfContextStartedEarlier",",,,%s,,,") a0) - /// The '|' tokens separating rules of this pattern match are misaligned by one column. Consider realigning your code or using further indentation. - /// (Originally from ..\FSComp.txt:972) - static member lexfltSeparatorTokensOfPatternMatchMisaligned() = (GetStringFunc("lexfltSeparatorTokensOfPatternMatchMisaligned",",,,") ) - /// Invalid module/expression/type - /// (Originally from ..\FSComp.txt:973) - static member nrInvalidModuleExprType() = (1123, GetStringFunc("nrInvalidModuleExprType",",,,") ) - /// Multiple types exist called '%s', taking different numbers of generic parameters. Provide a type instantiation to disambiguate the type resolution, e.g. '%s'. - /// (Originally from ..\FSComp.txt:974) - static member nrTypeInstantiationNeededToDisambiguateTypesWithSameName(a0 : System.String, a1 : System.String) = (1124, GetStringFunc("nrTypeInstantiationNeededToDisambiguateTypesWithSameName",",,,%s,,,%s,,,") a0 a1) - /// The instantiation of the generic type '%s' is missing and can't be inferred from the arguments or return type of this member. Consider providing a type instantiation when accessing this type, e.g. '%s'. - /// (Originally from ..\FSComp.txt:975) - static member nrTypeInstantiationIsMissingAndCouldNotBeInferred(a0 : System.String, a1 : System.String) = (1125, GetStringFunc("nrTypeInstantiationIsMissingAndCouldNotBeInferred",",,,%s,,,%s,,,") a0 a1) - /// 'global' may only be used as the first name in a qualified path - /// (Originally from ..\FSComp.txt:976) - static member nrGlobalUsedOnlyAsFirstName() = (1126, GetStringFunc("nrGlobalUsedOnlyAsFirstName",",,,") ) - /// This is not a constructor or literal, or a constructor is being used incorrectly - /// (Originally from ..\FSComp.txt:977) - static member nrIsNotConstructorOrLiteral() = (1127, GetStringFunc("nrIsNotConstructorOrLiteral",",,,") ) - /// Unexpected empty long identifier - /// (Originally from ..\FSComp.txt:978) - static member nrUnexpectedEmptyLongId() = (1128, GetStringFunc("nrUnexpectedEmptyLongId",",,,") ) - /// The record type '%s' does not contain a label '%s'. - /// (Originally from ..\FSComp.txt:979) - static member nrRecordDoesNotContainSuchLabel(a0 : System.String, a1 : System.String) = (1129, GetStringFunc("nrRecordDoesNotContainSuchLabel",",,,%s,,,%s,,,") a0 a1) - /// Invalid field label - /// (Originally from ..\FSComp.txt:980) - static member nrInvalidFieldLabel() = (1130, GetStringFunc("nrInvalidFieldLabel",",,,") ) - /// Invalid expression '%s' - /// (Originally from ..\FSComp.txt:981) - static member nrInvalidExpression(a0 : System.String) = (1132, GetStringFunc("nrInvalidExpression",",,,%s,,,") a0) - /// No constructors are available for the type '%s' - /// (Originally from ..\FSComp.txt:982) - static member nrNoConstructorsAvailableForType(a0 : System.String) = (1133, GetStringFunc("nrNoConstructorsAvailableForType",",,,%s,,,") a0) - /// The union type for union case '%s' was defined with the RequireQualifiedAccessAttribute. Include the name of the union type ('%s') in the name you are using. - /// (Originally from ..\FSComp.txt:983) - static member nrUnionTypeNeedsQualifiedAccess(a0 : System.String, a1 : System.String) = (1134, GetStringFunc("nrUnionTypeNeedsQualifiedAccess",",,,%s,,,%s,,,") a0 a1) - /// The record type for the record field '%s' was defined with the RequireQualifiedAccessAttribute. Include the name of the record type ('%s') in the name you are using. - /// (Originally from ..\FSComp.txt:984) - static member nrRecordTypeNeedsQualifiedAccess(a0 : System.String, a1 : System.String) = (1135, GetStringFunc("nrRecordTypeNeedsQualifiedAccess",",,,%s,,,%s,,,") a0 a1) - /// Unexpected error creating debug information file '%s' - /// (Originally from ..\FSComp.txt:985) - static member ilwriteErrorCreatingPdb(a0 : System.String) = (1136, GetStringFunc("ilwriteErrorCreatingPdb",",,,%s,,,") a0) - /// This number is outside the allowable range for this integer type - /// (Originally from ..\FSComp.txt:986) - static member lexOutsideIntegerRange() = (1138, GetStringFunc("lexOutsideIntegerRange",",,,") ) - /// '%s' is not permitted as a character in operator names and is reserved for future use - /// (Originally from ..\FSComp.txt:990) - static member lexCharNotAllowedInOperatorNames(a0 : System.String) = (GetStringFunc("lexCharNotAllowedInOperatorNames",",,,%s,,,") a0) - /// Unexpected character '%s' - /// (Originally from ..\FSComp.txt:991) - static member lexUnexpectedChar(a0 : System.String) = (GetStringFunc("lexUnexpectedChar",",,,%s,,,") a0) - /// This byte array literal contains characters that do not encode as a single byte - /// (Originally from ..\FSComp.txt:992) - static member lexByteArrayCannotEncode() = (1140, GetStringFunc("lexByteArrayCannotEncode",",,,") ) - /// Identifiers followed by '%s' are reserved for future use - /// (Originally from ..\FSComp.txt:993) - static member lexIdentEndInMarkReserved(a0 : System.String) = (1141, GetStringFunc("lexIdentEndInMarkReserved",",,,%s,,,") a0) - /// This number is outside the allowable range for 8-bit signed integers - /// (Originally from ..\FSComp.txt:994) - static member lexOutsideEightBitSigned() = (1142, GetStringFunc("lexOutsideEightBitSigned",",,,") ) - /// This number is outside the allowable range for hexadecimal 8-bit signed integers - /// (Originally from ..\FSComp.txt:995) - static member lexOutsideEightBitSignedHex() = (1143, GetStringFunc("lexOutsideEightBitSignedHex",",,,") ) - /// This number is outside the allowable range for 8-bit unsigned integers - /// (Originally from ..\FSComp.txt:996) - static member lexOutsideEightBitUnsigned() = (1144, GetStringFunc("lexOutsideEightBitUnsigned",",,,") ) - /// This number is outside the allowable range for 16-bit signed integers - /// (Originally from ..\FSComp.txt:997) - static member lexOutsideSixteenBitSigned() = (1145, GetStringFunc("lexOutsideSixteenBitSigned",",,,") ) - /// This number is outside the allowable range for 16-bit unsigned integers - /// (Originally from ..\FSComp.txt:998) - static member lexOutsideSixteenBitUnsigned() = (1146, GetStringFunc("lexOutsideSixteenBitUnsigned",",,,") ) - /// This number is outside the allowable range for 32-bit signed integers - /// (Originally from ..\FSComp.txt:999) - static member lexOutsideThirtyTwoBitSigned() = (1147, GetStringFunc("lexOutsideThirtyTwoBitSigned",",,,") ) - /// This number is outside the allowable range for 32-bit unsigned integers - /// (Originally from ..\FSComp.txt:1000) - static member lexOutsideThirtyTwoBitUnsigned() = (1148, GetStringFunc("lexOutsideThirtyTwoBitUnsigned",",,,") ) - /// This number is outside the allowable range for 64-bit signed integers - /// (Originally from ..\FSComp.txt:1001) - static member lexOutsideSixtyFourBitSigned() = (1149, GetStringFunc("lexOutsideSixtyFourBitSigned",",,,") ) - /// This number is outside the allowable range for 64-bit unsigned integers - /// (Originally from ..\FSComp.txt:1002) - static member lexOutsideSixtyFourBitUnsigned() = (1150, GetStringFunc("lexOutsideSixtyFourBitUnsigned",",,,") ) - /// This number is outside the allowable range for signed native integers - /// (Originally from ..\FSComp.txt:1003) - static member lexOutsideNativeSigned() = (1151, GetStringFunc("lexOutsideNativeSigned",",,,") ) - /// This number is outside the allowable range for unsigned native integers - /// (Originally from ..\FSComp.txt:1004) - static member lexOutsideNativeUnsigned() = (1152, GetStringFunc("lexOutsideNativeUnsigned",",,,") ) - /// Invalid floating point number - /// (Originally from ..\FSComp.txt:1005) - static member lexInvalidFloat() = (1153, GetStringFunc("lexInvalidFloat",",,,") ) - /// This number is outside the allowable range for decimal literals - /// (Originally from ..\FSComp.txt:1006) - static member lexOusideDecimal() = (1154, GetStringFunc("lexOusideDecimal",",,,") ) - /// This number is outside the allowable range for 32-bit floats - /// (Originally from ..\FSComp.txt:1007) - static member lexOusideThirtyTwoBitFloat() = (1155, GetStringFunc("lexOusideThirtyTwoBitFloat",",,,") ) - /// This is not a valid numeric literal. Valid numeric literals include 1, 0x1, 0b0001 (int), 1u (uint32), 1L (int64), 1UL (uint64), 1s (int16), 1y (sbyte), 1uy (byte), 1.0 (float), 1.0f (float32), 1.0m (decimal), 1I (BigInteger). - /// (Originally from ..\FSComp.txt:1008) - static member lexInvalidNumericLiteral() = (1156, GetStringFunc("lexInvalidNumericLiteral",",,,") ) - /// This is not a valid byte literal - /// (Originally from ..\FSComp.txt:1009) - static member lexInvalidByteLiteral() = (1157, GetStringFunc("lexInvalidByteLiteral",",,,") ) - /// This is not a valid character literal - /// (Originally from ..\FSComp.txt:1010) - static member lexInvalidCharLiteral() = (1158, GetStringFunc("lexInvalidCharLiteral",",,,") ) - /// This Unicode encoding is only valid in string literals - /// (Originally from ..\FSComp.txt:1011) - static member lexThisUnicodeOnlyInStringLiterals() = (1159, GetStringFunc("lexThisUnicodeOnlyInStringLiterals",",,,") ) - /// This token is reserved for future use - /// (Originally from ..\FSComp.txt:1012) - static member lexTokenReserved() = (1160, GetStringFunc("lexTokenReserved",",,,") ) - /// TABs are not allowed in F# code unless the #indent \"off\" option is used - /// (Originally from ..\FSComp.txt:1013) - static member lexTabsNotAllowed() = (1161, GetStringFunc("lexTabsNotAllowed",",,,") ) - /// Invalid line number: '%s' - /// (Originally from ..\FSComp.txt:1014) - static member lexInvalidLineNumber(a0 : System.String) = (1162, GetStringFunc("lexInvalidLineNumber",",,,%s,,,") a0) - /// #if directive must appear as the first non-whitespace character on a line - /// (Originally from ..\FSComp.txt:1015) - static member lexHashIfMustBeFirst() = (1163, GetStringFunc("lexHashIfMustBeFirst",",,,") ) - /// #else has no matching #if - /// (Originally from ..\FSComp.txt:1016) - static member lexHashElseNoMatchingIf() = (GetStringFunc("lexHashElseNoMatchingIf",",,,") ) - /// #endif required for #else - /// (Originally from ..\FSComp.txt:1017) - static member lexHashEndifRequiredForElse() = (GetStringFunc("lexHashEndifRequiredForElse",",,,") ) - /// #else directive must appear as the first non-whitespace character on a line - /// (Originally from ..\FSComp.txt:1018) - static member lexHashElseMustBeFirst() = (1166, GetStringFunc("lexHashElseMustBeFirst",",,,") ) - /// #endif has no matching #if - /// (Originally from ..\FSComp.txt:1019) - static member lexHashEndingNoMatchingIf() = (GetStringFunc("lexHashEndingNoMatchingIf",",,,") ) - /// #endif directive must appear as the first non-whitespace character on a line - /// (Originally from ..\FSComp.txt:1020) - static member lexHashEndifMustBeFirst() = (1168, GetStringFunc("lexHashEndifMustBeFirst",",,,") ) - /// #if directive should be immediately followed by an identifier - /// (Originally from ..\FSComp.txt:1021) - static member lexHashIfMustHaveIdent() = (1169, GetStringFunc("lexHashIfMustHaveIdent",",,,") ) - /// Syntax error. Wrong nested #endif, unexpected tokens before it. - /// (Originally from ..\FSComp.txt:1022) - static member lexWrongNestedHashEndif() = (1170, GetStringFunc("lexWrongNestedHashEndif",",,,") ) - /// #! may only appear as the first line at the start of a file. - /// (Originally from ..\FSComp.txt:1023) - static member lexHashBangMustBeFirstInFile() = (GetStringFunc("lexHashBangMustBeFirstInFile",",,,") ) - /// Expected single line comment or end of line - /// (Originally from ..\FSComp.txt:1024) - static member pplexExpectedSingleLineComment() = (1171, GetStringFunc("pplexExpectedSingleLineComment",",,,") ) - /// Infix operator member '%s' has no arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... - /// (Originally from ..\FSComp.txt:1025) - static member memberOperatorDefinitionWithNoArguments(a0 : System.String) = (1172, GetStringFunc("memberOperatorDefinitionWithNoArguments",",,,%s,,,") a0) - /// Infix operator member '%s' has %d initial argument(s). Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... - /// (Originally from ..\FSComp.txt:1026) - static member memberOperatorDefinitionWithNonPairArgument(a0 : System.String, a1 : System.Int32) = (1173, GetStringFunc("memberOperatorDefinitionWithNonPairArgument",",,,%s,,,%d,,,") a0 a1) - /// Infix operator member '%s' has extra curried arguments. Expected a tuple of 2 arguments, e.g. static member (+) (x,y) = ... - /// (Originally from ..\FSComp.txt:1027) - static member memberOperatorDefinitionWithCurriedArguments(a0 : System.String) = (1174, GetStringFunc("memberOperatorDefinitionWithCurriedArguments",",,,%s,,,") a0) - /// All record, union and struct types in FSharp.Core.dll must be explicitly labelled with 'StructuralComparison' or 'NoComparison' - /// (Originally from ..\FSComp.txt:1028) - static member tcFSharpCoreRequiresExplicit() = (1175, GetStringFunc("tcFSharpCoreRequiresExplicit",",,,") ) - /// The struct, record or union type '%s' has the 'StructuralComparison' attribute but the type parameter '%s' does not satisfy the 'comparison' constraint. Consider adding the 'comparison' constraint to the type parameter - /// (Originally from ..\FSComp.txt:1029) - static member tcStructuralComparisonNotSatisfied1(a0 : System.String, a1 : System.String) = (1176, GetStringFunc("tcStructuralComparisonNotSatisfied1",",,,%s,,,%s,,,") a0 a1) - /// The struct, record or union type '%s' has the 'StructuralComparison' attribute but the component type '%s' does not satisfy the 'comparison' constraint - /// (Originally from ..\FSComp.txt:1030) - static member tcStructuralComparisonNotSatisfied2(a0 : System.String, a1 : System.String) = (1177, GetStringFunc("tcStructuralComparisonNotSatisfied2",",,,%s,,,%s,,,") a0 a1) - /// The struct, record or union type '%s' is not structurally comparable because the type parameter %s does not satisfy the 'comparison' constraint. Consider adding the 'NoComparison' attribute to the type '%s' to clarify that the type is not comparable - /// (Originally from ..\FSComp.txt:1031) - static member tcNoComparisonNeeded1(a0 : System.String, a1 : System.String, a2 : System.String) = (1178, GetStringFunc("tcNoComparisonNeeded1",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// The struct, record or union type '%s' is not structurally comparable because the type '%s' does not satisfy the 'comparison' constraint. Consider adding the 'NoComparison' attribute to the type '%s' to clarify that the type is not comparable - /// (Originally from ..\FSComp.txt:1032) - static member tcNoComparisonNeeded2(a0 : System.String, a1 : System.String, a2 : System.String) = (1178, GetStringFunc("tcNoComparisonNeeded2",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// The struct, record or union type '%s' does not support structural equality because the type parameter %s does not satisfy the 'equality' constraint. Consider adding the 'NoEquality' attribute to the type '%s' to clarify that the type does not support structural equality - /// (Originally from ..\FSComp.txt:1033) - static member tcNoEqualityNeeded1(a0 : System.String, a1 : System.String, a2 : System.String) = (1178, GetStringFunc("tcNoEqualityNeeded1",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// The struct, record or union type '%s' does not support structural equality because the type '%s' does not satisfy the 'equality' constraint. Consider adding the 'NoEquality' attribute to the type '%s' to clarify that the type does not support structural equality - /// (Originally from ..\FSComp.txt:1034) - static member tcNoEqualityNeeded2(a0 : System.String, a1 : System.String, a2 : System.String) = (1178, GetStringFunc("tcNoEqualityNeeded2",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// The struct, record or union type '%s' has the 'StructuralEquality' attribute but the type parameter '%s' does not satisfy the 'equality' constraint. Consider adding the 'equality' constraint to the type parameter - /// (Originally from ..\FSComp.txt:1035) - static member tcStructuralEqualityNotSatisfied1(a0 : System.String, a1 : System.String) = (1179, GetStringFunc("tcStructuralEqualityNotSatisfied1",",,,%s,,,%s,,,") a0 a1) - /// The struct, record or union type '%s' has the 'StructuralEquality' attribute but the component type '%s' does not satisfy the 'equality' constraint - /// (Originally from ..\FSComp.txt:1036) - static member tcStructuralEqualityNotSatisfied2(a0 : System.String, a1 : System.String) = (1180, GetStringFunc("tcStructuralEqualityNotSatisfied2",",,,%s,,,%s,,,") a0 a1) - /// Each argument of the primary constructor for a struct must be given a type, for example 'type S(x1:int, x2: int) = ...'. These arguments determine the fields of the struct. - /// (Originally from ..\FSComp.txt:1037) - static member tcStructsMustDeclareTypesOfImplicitCtorArgsExplicitly() = (1181, GetStringFunc("tcStructsMustDeclareTypesOfImplicitCtorArgsExplicitly",",,,") ) - /// The value '%s' is unused - /// (Originally from ..\FSComp.txt:1038) - static member chkUnusedValue(a0 : System.String) = (1182, GetStringFunc("chkUnusedValue",",,,%s,,,") a0) - /// The recursive object reference '%s' is unused. The presence of a recursive object reference adds runtime initialization checks to members in this and derived types. Consider removing this recursive object reference. - /// (Originally from ..\FSComp.txt:1039) - static member chkUnusedThisVariable(a0 : System.String) = (1183, GetStringFunc("chkUnusedThisVariable",",,,%s,,,") a0) - /// A getter property may have at most one argument group - /// (Originally from ..\FSComp.txt:1040) - static member parsGetterAtMostOneArgument() = (1184, GetStringFunc("parsGetterAtMostOneArgument",",,,") ) - /// A setter property may have at most two argument groups - /// (Originally from ..\FSComp.txt:1041) - static member parsSetterAtMostTwoArguments() = (1185, GetStringFunc("parsSetterAtMostTwoArguments",",,,") ) - /// Invalid property getter or setter - /// (Originally from ..\FSComp.txt:1042) - static member parsInvalidProperty() = (1186, GetStringFunc("parsInvalidProperty",",,,") ) - /// An indexer property must be given at least one argument - /// (Originally from ..\FSComp.txt:1043) - static member parsIndexerPropertyRequiresAtLeastOneArgument() = (1187, GetStringFunc("parsIndexerPropertyRequiresAtLeastOneArgument",",,,") ) - /// This operation accesses a mutable top-level value defined in another assembly in an unsupported way. The value cannot be accessed through its address. Consider copying the expression to a mutable local, e.g. 'let mutable x = ...', and if necessary assigning the value back after the completion of the operation - /// (Originally from ..\FSComp.txt:1044) - static member tastInvalidAddressOfMutableAcrossAssemblyBoundary() = (1188, GetStringFunc("tastInvalidAddressOfMutableAcrossAssemblyBoundary",",,,") ) - /// Remove spaces between the type name and type parameter, e.g. \"type C<'T>\", not type \"C <'T>\". Type parameters must be placed directly adjacent to the type name. - /// (Originally from ..\FSComp.txt:1045) - static member parsNonAdjacentTypars() = (1189, GetStringFunc("parsNonAdjacentTypars",",,,") ) - /// Remove spaces between the type name and type parameter, e.g. \"C<'T>\", not \"C <'T>\". Type parameters must be placed directly adjacent to the type name. - /// (Originally from ..\FSComp.txt:1046) - static member parsNonAdjacentTyargs() = (1190, GetStringFunc("parsNonAdjacentTyargs",",,,") ) - /// The use of the type syntax 'int C' and 'C ' is not permitted here. Consider adjusting this type to be written in the form 'C' - /// (Originally from ..\FSComp.txt:1047) - static member parsNonAtomicType() = (GetStringFunc("parsNonAtomicType",",,,") ) - /// The module/namespace '%s' from compilation unit '%s' did not contain the module/namespace '%s' - /// (Originally from ..\FSComp.txt:1050) - static member tastUndefinedItemRefModuleNamespace(a0 : System.String, a1 : System.String, a2 : System.String) = (1193, GetStringFunc("tastUndefinedItemRefModuleNamespace",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// The module/namespace '%s' from compilation unit '%s' did not contain the val '%s' - /// (Originally from ..\FSComp.txt:1051) - static member tastUndefinedItemRefVal(a0 : System.String, a1 : System.String, a2 : System.String) = (1194, GetStringFunc("tastUndefinedItemRefVal",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// The module/namespace '%s' from compilation unit '%s' did not contain the namespace, module or type '%s' - /// (Originally from ..\FSComp.txt:1052) - static member tastUndefinedItemRefModuleNamespaceType(a0 : System.String, a1 : System.String, a2 : System.String) = (1195, GetStringFunc("tastUndefinedItemRefModuleNamespaceType",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// The 'UseNullAsTrueValue' attribute flag may only be used with union types that have one nullary case and at least one non-nullary case - /// (Originally from ..\FSComp.txt:1053) - static member tcInvalidUseNullAsTrueValue() = (1196, GetStringFunc("tcInvalidUseNullAsTrueValue",",,,") ) - /// The parameter '%s' was inferred to have byref type. Parameters of byref type must be given an explicit type annotation, e.g. 'x1: byref'. When used, a byref parameter is implicitly dereferenced. - /// (Originally from ..\FSComp.txt:1054) - static member tcParameterInferredByref(a0 : System.String) = (1197, GetStringFunc("tcParameterInferredByref",",,,%s,,,") a0) - /// The generic member '%s' has been used at a non-uniform instantiation prior to this program point. Consider reordering the members so this member occurs first. Alternatively, specify the full type of the member explicitly, including argument types, return type and any additional generic parameters and constraints. - /// (Originally from ..\FSComp.txt:1055) - static member tcNonUniformMemberUse(a0 : System.String) = (1198, GetStringFunc("tcNonUniformMemberUse",",,,%s,,,") a0) - /// The attribute '%s' appears in both the implementation and the signature, but the attribute arguments differ. Only the attribute from the signature will be included in the compiled code. - /// (Originally from ..\FSComp.txt:1056) - static member tcAttribArgsDiffer(a0 : System.String) = (1200, GetStringFunc("tcAttribArgsDiffer",",,,%s,,,") a0) - /// Cannot call an abstract base member: '%s' - /// (Originally from ..\FSComp.txt:1057) - static member tcCannotCallAbstractBaseMember(a0 : System.String) = (1201, GetStringFunc("tcCannotCallAbstractBaseMember",",,,%s,,,") a0) - /// Could not resolve the ambiguity in the use of a generic construct with an 'unmanaged' constraint at or near this position - /// (Originally from ..\FSComp.txt:1058) - static member typrelCannotResolveAmbiguityInUnmanaged() = (1202, GetStringFunc("typrelCannotResolveAmbiguityInUnmanaged",",,,") ) - /// This construct is for ML compatibility. %s. You can disable this warning by using '--mlcompatibility' or '--nowarn:62'. - /// (Originally from ..\FSComp.txt:1061) - static member mlCompatMessage(a0 : System.String) = (GetStringFunc("mlCompatMessage",",,,%s,,,") a0) - /// The type '%s' has been marked as having an Explicit layout, but the field '%s' has not been marked with the 'FieldOffset' attribute - /// (Originally from ..\FSComp.txt:1063) - static member ilFieldDoesNotHaveValidOffsetForStructureLayout(a0 : System.String, a1 : System.String) = (1206, GetStringFunc("ilFieldDoesNotHaveValidOffsetForStructureLayout",",,,%s,,,%s,,,") a0 a1) - /// Interfaces inherited by other interfaces should be declared using 'inherit ...' instead of 'interface ...' - /// (Originally from ..\FSComp.txt:1064) - static member tcInterfacesShouldUseInheritNotInterface() = (1207, GetStringFunc("tcInterfacesShouldUseInheritNotInterface",",,,") ) - /// Invalid prefix operator - /// (Originally from ..\FSComp.txt:1065) - static member parsInvalidPrefixOperator() = (1208, GetStringFunc("parsInvalidPrefixOperator",",,,") ) - /// Invalid operator definition. Prefix operator definitions must use a valid prefix operator name. - /// (Originally from ..\FSComp.txt:1066) - static member parsInvalidPrefixOperatorDefinition() = (1208, GetStringFunc("parsInvalidPrefixOperatorDefinition",",,,") ) - /// The file extensions '.ml' and '.mli' are for ML compatibility - /// (Originally from ..\FSComp.txt:1067) - static member buildCompilingExtensionIsForML() = (GetStringFunc("buildCompilingExtensionIsForML",",,,") ) - /// Consider using a file with extension '.ml' or '.mli' instead - /// (Originally from ..\FSComp.txt:1068) - static member lexIndentOffForML() = (GetStringFunc("lexIndentOffForML",",,,") ) - /// Active pattern '%s' is not a function - /// (Originally from ..\FSComp.txt:1069) - static member activePatternIdentIsNotFunctionTyped(a0 : System.String) = (1209, GetStringFunc("activePatternIdentIsNotFunctionTyped",",,,%s,,,") a0) - /// Active pattern '%s' has a result type containing type variables that are not determined by the input. The common cause is a when a result case is not mentioned, e.g. 'let (|A|B|) (x:int) = A x'. This can be fixed with a type constraint, e.g. 'let (|A|B|) (x:int) : Choice = A x' - /// (Originally from ..\FSComp.txt:1070) - static member activePatternChoiceHasFreeTypars(a0 : System.String) = (1210, GetStringFunc("activePatternChoiceHasFreeTypars",",,,%s,,,") a0) - /// The FieldOffset attribute can only be placed on members of types marked with the StructLayout(LayoutKind.Explicit) - /// (Originally from ..\FSComp.txt:1071) - static member ilFieldHasOffsetForSequentialLayout() = (1211, GetStringFunc("ilFieldHasOffsetForSequentialLayout",",,,") ) - /// Optional arguments must come at the end of the argument list, after any non-optional arguments - /// (Originally from ..\FSComp.txt:1072) - static member tcOptionalArgsMustComeAfterNonOptionalArgs() = (1212, GetStringFunc("tcOptionalArgsMustComeAfterNonOptionalArgs",",,,") ) - /// Attribute 'System.Diagnostics.ConditionalAttribute' is only valid on methods or attribute classes - /// (Originally from ..\FSComp.txt:1073) - static member tcConditionalAttributeUsage() = (1213, GetStringFunc("tcConditionalAttributeUsage",",,,") ) - /// Extension members cannot provide operator overloads. Consider defining the operator as part of the type definition instead. - /// (Originally from ..\FSComp.txt:1075) - static member tcMemberOperatorDefinitionInExtrinsic() = (1215, GetStringFunc("tcMemberOperatorDefinitionInExtrinsic",",,,") ) - /// The name of the MDB file must be .mdb. The --pdb option will be ignored. - /// (Originally from ..\FSComp.txt:1076) - static member ilwriteMDBFileNameCannotBeChangedWarning() = (1216, GetStringFunc("ilwriteMDBFileNameCannotBeChangedWarning",",,,") ) - /// MDB generation failed. Could not find compatible member %s - /// (Originally from ..\FSComp.txt:1077) - static member ilwriteMDBMemberMissing(a0 : System.String) = (1217, GetStringFunc("ilwriteMDBMemberMissing",",,,%s,,,") a0) - /// Cannot generate MDB debug information. Failed to load the 'MonoSymbolWriter' type from the 'Mono.CompilerServices.SymbolWriter.dll' assembly. - /// (Originally from ..\FSComp.txt:1078) - static member ilwriteErrorCreatingMdb() = (1218, GetStringFunc("ilwriteErrorCreatingMdb",",,,") ) - /// The union case named '%s' conflicts with the generated type '%s' - /// (Originally from ..\FSComp.txt:1079) - static member tcUnionCaseNameConflictsWithGeneratedType(a0 : System.String, a1 : System.String) = (1219, GetStringFunc("tcUnionCaseNameConflictsWithGeneratedType",",,,%s,,,%s,,,") a0 a1) - /// ReflectedDefinitionAttribute may not be applied to an instance member on a struct type, because the instance member takes an implicit 'this' byref parameter - /// (Originally from ..\FSComp.txt:1080) - static member chkNoReflectedDefinitionOnStructMember() = (1220, GetStringFunc("chkNoReflectedDefinitionOnStructMember",",,,") ) - /// DLLImport bindings must be static members in a class or function definitions in a module - /// (Originally from ..\FSComp.txt:1081) - static member tcDllImportNotAllowed() = (1221, GetStringFunc("tcDllImportNotAllowed",",,,") ) - /// When mscorlib.dll or FSharp.Core.dll is explicitly referenced the %s option must also be passed - /// (Originally from ..\FSComp.txt:1082) - static member buildExplicitCoreLibRequiresNoFramework(a0 : System.String) = (1222, GetStringFunc("buildExplicitCoreLibRequiresNoFramework",",,,%s,,,") a0) - /// FSharp.Core.sigdata not found alongside FSharp.Core. File expected in %s. Consider upgrading to a more recent version of FSharp.Core, where this file is no longer be required. - /// (Originally from ..\FSComp.txt:1083) - static member buildExpectedSigdataFile(a0 : System.String) = (1223, GetStringFunc("buildExpectedSigdataFile",",,,%s,,,") a0) - /// File '%s' not found alongside FSharp.Core. File expected in %s. Consider upgrading to a more recent version of FSharp.Core, where this file is no longer be required. - /// (Originally from ..\FSComp.txt:1084) - static member buildExpectedFileAlongSideFSharpCore(a0 : System.String, a1 : System.String) = (1225, GetStringFunc("buildExpectedFileAlongSideFSharpCore",",,,%s,,,%s,,,") a0 a1) - /// Filename '%s' contains invalid character '%s' - /// (Originally from ..\FSComp.txt:1085) - static member buildUnexpectedFileNameCharacter(a0 : System.String, a1 : System.String) = (1227, GetStringFunc("buildUnexpectedFileNameCharacter",",,,%s,,,%s,,,") a0 a1) - /// 'use!' bindings must be of the form 'use! = ' - /// (Originally from ..\FSComp.txt:1086) - static member tcInvalidUseBangBinding() = (1228, GetStringFunc("tcInvalidUseBangBinding",",,,") ) - /// Inner generic functions are not permitted in quoted expressions. Consider adding some type constraints until this function is no longer generic. - /// (Originally from ..\FSComp.txt:1087) - static member crefNoInnerGenericsInQuotations() = (1230, GetStringFunc("crefNoInnerGenericsInQuotations",",,,") ) - /// The type '%s' is not a valid enumerator type , i.e. does not have a 'MoveNext()' method returning a bool, and a 'Current' property - /// (Originally from ..\FSComp.txt:1088) - static member tcEnumTypeCannotBeEnumerated(a0 : System.String) = (1231, GetStringFunc("tcEnumTypeCannotBeEnumerated",",,,%s,,,") a0) - /// End of file in triple-quote string begun at or before here - /// (Originally from ..\FSComp.txt:1089) - static member parsEofInTripleQuoteString() = (1232, GetStringFunc("parsEofInTripleQuoteString",",,,") ) - /// End of file in triple-quote string embedded in comment begun at or before here - /// (Originally from ..\FSComp.txt:1090) - static member parsEofInTripleQuoteStringInComment() = (1233, GetStringFunc("parsEofInTripleQuoteStringInComment",",,,") ) - /// This type test or downcast will ignore the unit-of-measure '%s' - /// (Originally from ..\FSComp.txt:1091) - static member tcTypeTestLosesMeasures(a0 : System.String) = (1240, GetStringFunc("tcTypeTestLosesMeasures",",,,%s,,,") a0) - /// Expected type argument or static argument - /// (Originally from ..\FSComp.txt:1092) - static member parsMissingTypeArgs() = (1241, GetStringFunc("parsMissingTypeArgs",",,,") ) - /// Unmatched '<'. Expected closing '>' - /// (Originally from ..\FSComp.txt:1093) - static member parsMissingGreaterThan() = (1242, GetStringFunc("parsMissingGreaterThan",",,,") ) - /// Unexpected quotation operator '<@' in type definition. If you intend to pass a verbatim string as a static argument to a type provider, put a space between the '<' and '@' characters. - /// (Originally from ..\FSComp.txt:1094) - static member parsUnexpectedQuotationOperatorInTypeAliasDidYouMeanVerbatimString() = (1243, GetStringFunc("parsUnexpectedQuotationOperatorInTypeAliasDidYouMeanVerbatimString",",,,") ) - /// Attempted to parse this as an operator name, but failed - /// (Originally from ..\FSComp.txt:1095) - static member parsErrorParsingAsOperatorName() = (1244, GetStringFunc("parsErrorParsingAsOperatorName",",,,") ) - /// \U%s is not a valid Unicode character escape sequence - /// (Originally from ..\FSComp.txt:1096) - static member lexInvalidUnicodeLiteral(a0 : System.String) = (1245, GetStringFunc("lexInvalidUnicodeLiteral",",,,%s,,,") a0) - /// '%s' must be applied to an argument of type '%s', but has been applied to an argument of type '%s' - /// (Originally from ..\FSComp.txt:1097) - static member tcCallerInfoWrongType(a0 : System.String, a1 : System.String, a2 : System.String) = (1246, GetStringFunc("tcCallerInfoWrongType",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// '%s' can only be applied to optional arguments - /// (Originally from ..\FSComp.txt:1098) - static member tcCallerInfoNotOptional(a0 : System.String) = (1247, GetStringFunc("tcCallerInfoNotOptional",",,,%s,,,") a0) - /// The specified .NET Framework version '%s' is not supported. Please specify a value from the enumeration Microsoft.Build.Utilities.TargetDotNetFrameworkVersion. - /// (Originally from ..\FSComp.txt:1100) - static member toolLocationHelperUnsupportedFrameworkVersion(a0 : System.String) = (1300, GetStringFunc("toolLocationHelperUnsupportedFrameworkVersion",",,,%s,,,") a0) - /// Invalid Magic value in CLR Header - /// (Originally from ..\FSComp.txt:1104) - static member ilSignInvalidMagicValue() = (1301, GetStringFunc("ilSignInvalidMagicValue",",,,") ) - /// Bad image format - /// (Originally from ..\FSComp.txt:1105) - static member ilSignBadImageFormat() = (1302, GetStringFunc("ilSignBadImageFormat",",,,") ) - /// Private key expected - /// (Originally from ..\FSComp.txt:1106) - static member ilSignPrivateKeyExpected() = (1303, GetStringFunc("ilSignPrivateKeyExpected",",,,") ) - /// RSA key expected - /// (Originally from ..\FSComp.txt:1107) - static member ilSignRsaKeyExpected() = (1304, GetStringFunc("ilSignRsaKeyExpected",",,,") ) - /// Invalid bit Length - /// (Originally from ..\FSComp.txt:1108) - static member ilSignInvalidBitLen() = (1305, GetStringFunc("ilSignInvalidBitLen",",,,") ) - /// Invalid RSAParameters structure - '{0}' expected - /// (Originally from ..\FSComp.txt:1109) - static member ilSignInvalidRSAParams() = (1306, GetStringFunc("ilSignInvalidRSAParams",",,,") ) - /// Invalid algId - 'Exponent' expected - /// (Originally from ..\FSComp.txt:1110) - static member ilSignInvalidAlgId() = (1307, GetStringFunc("ilSignInvalidAlgId",",,,") ) - /// Invalid signature size - /// (Originally from ..\FSComp.txt:1111) - static member ilSignInvalidSignatureSize() = (1308, GetStringFunc("ilSignInvalidSignatureSize",",,,") ) - /// No signature directory - /// (Originally from ..\FSComp.txt:1112) - static member ilSignNoSignatureDirectory() = (1309, GetStringFunc("ilSignNoSignatureDirectory",",,,") ) - /// Invalid Public Key blob - /// (Originally from ..\FSComp.txt:1113) - static member ilSignInvalidPKBlob() = (1310, GetStringFunc("ilSignInvalidPKBlob",",,,") ) - /// Exiting - too many errors - /// (Originally from ..\FSComp.txt:1115) - static member fscTooManyErrors() = (GetStringFunc("fscTooManyErrors",",,,") ) - /// The documentation file has no .xml suffix - /// (Originally from ..\FSComp.txt:1116) - static member docfileNoXmlSuffix() = (2001, GetStringFunc("docfileNoXmlSuffix",",,,") ) - /// No implementation files specified - /// (Originally from ..\FSComp.txt:1117) - static member fscNoImplementationFiles() = (2002, GetStringFunc("fscNoImplementationFiles",",,,") ) - /// The attribute %s specified version '%s', but this value is invalid and has been ignored - /// (Originally from ..\FSComp.txt:1118) - static member fscBadAssemblyVersion(a0 : System.String, a1 : System.String) = (2003, GetStringFunc("fscBadAssemblyVersion",",,,%s,,,%s,,,") a0 a1) - /// Conflicting options specified: 'win32manifest' and 'win32res'. Only one of these can be used. - /// (Originally from ..\FSComp.txt:1119) - static member fscTwoResourceManifests() = (2004, GetStringFunc("fscTwoResourceManifests",",,,") ) - /// The code in assembly '%s' makes uses of quotation literals. Static linking may not include components that make use of quotation literals unless all assemblies are compiled with at least F# 4.0. - /// (Originally from ..\FSComp.txt:1120) - static member fscQuotationLiteralsStaticLinking(a0 : System.String) = (2005, GetStringFunc("fscQuotationLiteralsStaticLinking",",,,%s,,,") a0) - /// Code in this assembly makes uses of quotation literals. Static linking may not include components that make use of quotation literals unless all assemblies are compiled with at least F# 4.0. - /// (Originally from ..\FSComp.txt:1121) - static member fscQuotationLiteralsStaticLinking0() = (2006, GetStringFunc("fscQuotationLiteralsStaticLinking0",",,,") ) - /// Static linking may not include a .EXE - /// (Originally from ..\FSComp.txt:1122) - static member fscStaticLinkingNoEXE() = (2007, GetStringFunc("fscStaticLinkingNoEXE",",,,") ) - /// Static linking may not include a mixed managed/unmanaged DLL - /// (Originally from ..\FSComp.txt:1123) - static member fscStaticLinkingNoMixedDLL() = (2008, GetStringFunc("fscStaticLinkingNoMixedDLL",",,,") ) - /// Ignoring mixed managed/unmanaged assembly '%s' during static linking - /// (Originally from ..\FSComp.txt:1124) - static member fscIgnoringMixedWhenLinking(a0 : System.String) = (2009, GetStringFunc("fscIgnoringMixedWhenLinking",",,,%s,,,") a0) - /// Assembly '%s' was referenced transitively and the assembly could not be resolved automatically. Static linking will assume this DLL has no dependencies on the F# library or other statically linked DLLs. Consider adding an explicit reference to this DLL. - /// (Originally from ..\FSComp.txt:1125) - static member fscAssumeStaticLinkContainsNoDependencies(a0 : System.String) = (2011, GetStringFunc("fscAssumeStaticLinkContainsNoDependencies",",,,%s,,,") a0) - /// Assembly '%s' not found in dependency set of target binary. Statically linked roots should be specified using an assembly name, without a DLL or EXE extension. If this assembly was referenced explicitly then it is possible the assembly was not actually required by the generated binary, in which case it should not be statically linked. - /// (Originally from ..\FSComp.txt:1126) - static member fscAssemblyNotFoundInDependencySet(a0 : System.String) = (2012, GetStringFunc("fscAssemblyNotFoundInDependencySet",",,,%s,,,") a0) - /// The key file '%s' could not be opened - /// (Originally from ..\FSComp.txt:1127) - static member fscKeyFileCouldNotBeOpened(a0 : System.String) = (2013, GetStringFunc("fscKeyFileCouldNotBeOpened",",,,%s,,,") a0) - /// A problem occurred writing the binary '%s': %s - /// (Originally from ..\FSComp.txt:1128) - static member fscProblemWritingBinary(a0 : System.String, a1 : System.String) = (2014, GetStringFunc("fscProblemWritingBinary",",,,%s,,,%s,,,") a0 a1) - /// The 'AssemblyVersionAttribute' has been ignored because a version was given using a command line option - /// (Originally from ..\FSComp.txt:1129) - static member fscAssemblyVersionAttributeIgnored() = (2015, GetStringFunc("fscAssemblyVersionAttributeIgnored",",,,") ) - /// Error emitting 'System.Reflection.AssemblyCultureAttribute' attribute -- 'Executables cannot be satellite assemblies, Culture should always be empty' - /// (Originally from ..\FSComp.txt:1130) - static member fscAssemblyCultureAttributeError() = (2016, GetStringFunc("fscAssemblyCultureAttributeError",",,,") ) - /// Option '--delaysign' overrides attribute 'System.Reflection.AssemblyDelaySignAttribute' given in a source file or added module - /// (Originally from ..\FSComp.txt:1131) - static member fscDelaySignWarning() = (2017, GetStringFunc("fscDelaySignWarning",",,,") ) - /// Option '--keyfile' overrides attribute 'System.Reflection.AssemblyKeyFileAttribute' given in a source file or added module - /// (Originally from ..\FSComp.txt:1132) - static member fscKeyFileWarning() = (2018, GetStringFunc("fscKeyFileWarning",",,,") ) - /// Option '--keycontainer' overrides attribute 'System.Reflection.AssemblyNameAttribute' given in a source file or added module - /// (Originally from ..\FSComp.txt:1133) - static member fscKeyNameWarning() = (2019, GetStringFunc("fscKeyNameWarning",",,,") ) - /// The assembly '%s' is listed on the command line. Assemblies should be referenced using a command line flag such as '-r'. - /// (Originally from ..\FSComp.txt:1134) - static member fscReferenceOnCommandLine(a0 : System.String) = (2020, GetStringFunc("fscReferenceOnCommandLine",",,,%s,,,") a0) - /// The resident compilation service was not used because a problem occured in communicating with the server. - /// (Originally from ..\FSComp.txt:1135) - static member fscRemotingError() = (2021, GetStringFunc("fscRemotingError",",,,") ) - /// Problem with filename '%s': Illegal characters in path. - /// (Originally from ..\FSComp.txt:1136) - static member pathIsInvalid(a0 : System.String) = (2022, GetStringFunc("pathIsInvalid",",,,%s,,,") a0) - /// Passing a .resx file (%s) as a source file to the compiler is deprecated. Use resgen.exe to transform the .resx file into a .resources file to pass as a --resource option. If you are using MSBuild, this can be done via an item in the .fsproj project file. - /// (Originally from ..\FSComp.txt:1137) - static member fscResxSourceFileDeprecated(a0 : System.String) = (2023, GetStringFunc("fscResxSourceFileDeprecated",",,,%s,,,") a0) - /// Static linking may not be used on an assembly referencing mscorlib (e.g. a .NET Framework assembly) when generating an assembly that references System.Runtime (e.g. a .NET Core or Portable assembly). - /// (Originally from ..\FSComp.txt:1138) - static member fscStaticLinkingNoProfileMismatches() = (2024, GetStringFunc("fscStaticLinkingNoProfileMismatches",",,,") ) - /// An %s specified version '%s', but this value is a wildcard, and you have requested a deterministic build, these are in conflict. - /// (Originally from ..\FSComp.txt:1139) - static member fscAssemblyWildcardAndDeterminism(a0 : System.String, a1 : System.String) = (2025, GetStringFunc("fscAssemblyWildcardAndDeterminism",",,,%s,,,%s,,,") a0 a1) - /// Determinstic builds only support portable PDBs (--debug:portable or --debug:embedded) - /// (Originally from ..\FSComp.txt:1140) - static member fscDeterministicDebugRequiresPortablePdb() = (2026, GetStringFunc("fscDeterministicDebugRequiresPortablePdb",",,,") ) - /// Character '%s' is not allowed in provided namespace name '%s' - /// (Originally from ..\FSComp.txt:1141) - static member etIllegalCharactersInNamespaceName(a0 : System.String, a1 : System.String) = (3000, GetStringFunc("etIllegalCharactersInNamespaceName",",,,%s,,,%s,,,") a0 a1) - /// The provided type '%s' returned a member with a null or empty member name - /// (Originally from ..\FSComp.txt:1142) - static member etNullOrEmptyMemberName(a0 : System.String) = (3001, GetStringFunc("etNullOrEmptyMemberName",",,,%s,,,") a0) - /// The provided type '%s' returned a null member - /// (Originally from ..\FSComp.txt:1143) - static member etNullMember(a0 : System.String) = (3002, GetStringFunc("etNullMember",",,,%s,,,") a0) - /// The provided type '%s' member info '%s' has null declaring type - /// (Originally from ..\FSComp.txt:1144) - static member etNullMemberDeclaringType(a0 : System.String, a1 : System.String) = (3003, GetStringFunc("etNullMemberDeclaringType",",,,%s,,,%s,,,") a0 a1) - /// The provided type '%s' has member '%s' which has declaring type '%s'. Expected declaring type to be the same as provided type. - /// (Originally from ..\FSComp.txt:1145) - static member etNullMemberDeclaringTypeDifferentFromProvidedType(a0 : System.String, a1 : System.String, a2 : System.String) = (3004, GetStringFunc("etNullMemberDeclaringTypeDifferentFromProvidedType",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// Referenced assembly '%s' has assembly level attribute '%s' but no public type provider classes were found - /// (Originally from ..\FSComp.txt:1146) - static member etHostingAssemblyFoundWithoutHosts(a0 : System.String, a1 : System.String) = (3005, GetStringFunc("etHostingAssemblyFoundWithoutHosts",",,,%s,,,%s,,,") a0 a1) - /// Type '%s' from type provider '%s' has an empty namespace. Use 'null' for the global namespace. - /// (Originally from ..\FSComp.txt:1147) - static member etEmptyNamespaceOfTypeNotAllowed(a0 : System.String, a1 : System.String) = (3006, GetStringFunc("etEmptyNamespaceOfTypeNotAllowed",",,,%s,,,%s,,,") a0 a1) - /// Empty namespace found from the type provider '%s'. Use 'null' for the global namespace. - /// (Originally from ..\FSComp.txt:1148) - static member etEmptyNamespaceNotAllowed(a0 : System.String) = (3007, GetStringFunc("etEmptyNamespaceNotAllowed",",,,%s,,,") a0) - /// Provided type '%s' has 'IsGenericType' as true, but generic types are not supported. - /// (Originally from ..\FSComp.txt:1149) - static member etMustNotBeGeneric(a0 : System.String) = (3011, GetStringFunc("etMustNotBeGeneric",",,,%s,,,") a0) - /// Provided type '%s' has 'IsArray' as true, but array types are not supported. - /// (Originally from ..\FSComp.txt:1150) - static member etMustNotBeAnArray(a0 : System.String) = (3013, GetStringFunc("etMustNotBeAnArray",",,,%s,,,") a0) - /// Invalid member '%s' on provided type '%s'. Provided type members must be public, and not be generic, virtual, or abstract. - /// (Originally from ..\FSComp.txt:1151) - static member etMethodHasRequirements(a0 : System.String, a1 : System.String) = (3014, GetStringFunc("etMethodHasRequirements",",,,%s,,,%s,,,") a0 a1) - /// Invalid member '%s' on provided type '%s'. Only properties, methods and constructors are allowed - /// (Originally from ..\FSComp.txt:1152) - static member etUnsupportedMemberKind(a0 : System.String, a1 : System.String) = (3015, GetStringFunc("etUnsupportedMemberKind",",,,%s,,,%s,,,") a0 a1) - /// Property '%s' on provided type '%s' has CanRead=true but there was no value from GetGetMethod() - /// (Originally from ..\FSComp.txt:1153) - static member etPropertyCanReadButHasNoGetter(a0 : System.String, a1 : System.String) = (3016, GetStringFunc("etPropertyCanReadButHasNoGetter",",,,%s,,,%s,,,") a0 a1) - /// Property '%s' on provided type '%s' has CanRead=false but GetGetMethod() returned a method - /// (Originally from ..\FSComp.txt:1154) - static member etPropertyHasGetterButNoCanRead(a0 : System.String, a1 : System.String) = (3017, GetStringFunc("etPropertyHasGetterButNoCanRead",",,,%s,,,%s,,,") a0 a1) - /// Property '%s' on provided type '%s' has CanWrite=true but there was no value from GetSetMethod() - /// (Originally from ..\FSComp.txt:1155) - static member etPropertyCanWriteButHasNoSetter(a0 : System.String, a1 : System.String) = (3018, GetStringFunc("etPropertyCanWriteButHasNoSetter",",,,%s,,,%s,,,") a0 a1) - /// Property '%s' on provided type '%s' has CanWrite=false but GetSetMethod() returned a method - /// (Originally from ..\FSComp.txt:1156) - static member etPropertyHasSetterButNoCanWrite(a0 : System.String, a1 : System.String) = (3019, GetStringFunc("etPropertyHasSetterButNoCanWrite",",,,%s,,,%s,,,") a0 a1) - /// One or more errors seen during provided type setup - /// (Originally from ..\FSComp.txt:1157) - static member etOneOrMoreErrorsSeenDuringExtensionTypeSetting() = (3020, GetStringFunc("etOneOrMoreErrorsSeenDuringExtensionTypeSetting",",,,") ) - /// Unexpected exception from provided type '%s' member '%s': %s - /// (Originally from ..\FSComp.txt:1158) - static member etUnexpectedExceptionFromProvidedTypeMember(a0 : System.String, a1 : System.String, a2 : System.String) = (3021, GetStringFunc("etUnexpectedExceptionFromProvidedTypeMember",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// Unsupported constant type '%s'. Quotations provided by type providers can only contain simple constants. The implementation of the type provider may need to be adjusted by moving a value declared outside a provided quotation literal to be a 'let' binding inside the quotation literal. - /// (Originally from ..\FSComp.txt:1159) - static member etUnsupportedConstantType(a0 : System.String) = (3022, GetStringFunc("etUnsupportedConstantType",",,,%s,,,") a0) - /// Unsupported expression '%s' from type provider. If you are the author of this type provider, consider adjusting it to provide a different provided expression. - /// (Originally from ..\FSComp.txt:1160) - static member etUnsupportedProvidedExpression(a0 : System.String) = (3025, GetStringFunc("etUnsupportedProvidedExpression",",,,%s,,,") a0) - /// Expected provided type named '%s' but provided type has 'Name' with value '%s' - /// (Originally from ..\FSComp.txt:1161) - static member etProvidedTypeHasUnexpectedName(a0 : System.String, a1 : System.String) = (3028, GetStringFunc("etProvidedTypeHasUnexpectedName",",,,%s,,,%s,,,") a0 a1) - /// Event '%s' on provided type '%s' has no value from GetAddMethod() - /// (Originally from ..\FSComp.txt:1162) - static member etEventNoAdd(a0 : System.String, a1 : System.String) = (3029, GetStringFunc("etEventNoAdd",",,,%s,,,%s,,,") a0 a1) - /// Event '%s' on provided type '%s' has no value from GetRemoveMethod() - /// (Originally from ..\FSComp.txt:1163) - static member etEventNoRemove(a0 : System.String, a1 : System.String) = (3030, GetStringFunc("etEventNoRemove",",,,%s,,,%s,,,") a0 a1) - /// Assembly attribute '%s' refers to a designer assembly '%s' which cannot be loaded or doesn't exist. %s - /// (Originally from ..\FSComp.txt:1164) - static member etProviderHasWrongDesignerAssembly(a0 : System.String, a1 : System.String, a2 : System.String) = (3031, GetStringFunc("etProviderHasWrongDesignerAssembly",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// The type provider does not have a valid constructor. A constructor taking either no arguments or one argument of type 'TypeProviderConfig' was expected. - /// (Originally from ..\FSComp.txt:1165) - static member etProviderDoesNotHaveValidConstructor() = (3032, GetStringFunc("etProviderDoesNotHaveValidConstructor",",,,") ) - /// The type provider '%s' reported an error: %s - /// (Originally from ..\FSComp.txt:1166) - static member etProviderError(a0 : System.String, a1 : System.String) = (3033, GetStringFunc("etProviderError",",,,%s,,,%s,,,") a0 a1) - /// The type provider '%s' used an invalid parameter in the ParameterExpression: %s - /// (Originally from ..\FSComp.txt:1167) - static member etIncorrectParameterExpression(a0 : System.String, a1 : System.String) = (3034, GetStringFunc("etIncorrectParameterExpression",",,,%s,,,%s,,,") a0 a1) - /// The type provider '%s' provided a method with a name '%s' and metadata token '%d', which is not reported among its methods of its declaring type '%s' - /// (Originally from ..\FSComp.txt:1168) - static member etIncorrectProvidedMethod(a0 : System.String, a1 : System.String, a2 : System.Int32, a3 : System.String) = (3035, GetStringFunc("etIncorrectProvidedMethod",",,,%s,,,%s,,,%d,,,%s,,,") a0 a1 a2 a3) - /// The type provider '%s' provided a constructor which is not reported among the constructors of its declaring type '%s' - /// (Originally from ..\FSComp.txt:1169) - static member etIncorrectProvidedConstructor(a0 : System.String, a1 : System.String) = (3036, GetStringFunc("etIncorrectProvidedConstructor",",,,%s,,,%s,,,") a0 a1) - /// A direct reference to the generated type '%s' is not permitted. Instead, use a type definition, e.g. 'type TypeAlias = '. This indicates that a type provider adds generated types to your assembly. - /// (Originally from ..\FSComp.txt:1170) - static member etDirectReferenceToGeneratedTypeNotAllowed(a0 : System.String) = (3039, GetStringFunc("etDirectReferenceToGeneratedTypeNotAllowed",",,,%s,,,") a0) - /// Expected provided type with path '%s' but provided type has path '%s' - /// (Originally from ..\FSComp.txt:1171) - static member etProvidedTypeHasUnexpectedPath(a0 : System.String, a1 : System.String) = (3041, GetStringFunc("etProvidedTypeHasUnexpectedPath",",,,%s,,,%s,,,") a0 a1) - /// Unexpected 'null' return value from provided type '%s' member '%s' - /// (Originally from ..\FSComp.txt:1172) - static member etUnexpectedNullFromProvidedTypeMember(a0 : System.String, a1 : System.String) = (3042, GetStringFunc("etUnexpectedNullFromProvidedTypeMember",",,,%s,,,%s,,,") a0 a1) - /// Unexpected exception from member '%s' of provided type '%s' member '%s': %s - /// (Originally from ..\FSComp.txt:1173) - static member etUnexpectedExceptionFromProvidedMemberMember(a0 : System.String, a1 : System.String, a2 : System.String, a3 : System.String) = (3043, GetStringFunc("etUnexpectedExceptionFromProvidedMemberMember",",,,%s,,,%s,,,%s,,,%s,,,") a0 a1 a2 a3) - /// Nested provided types do not take static arguments or generic parameters - /// (Originally from ..\FSComp.txt:1174) - static member etNestedProvidedTypesDoNotTakeStaticArgumentsOrGenericParameters() = (3044, GetStringFunc("etNestedProvidedTypesDoNotTakeStaticArgumentsOrGenericParameters",",,,") ) - /// Invalid static argument to provided type. Expected an argument of kind '%s'. - /// (Originally from ..\FSComp.txt:1175) - static member etInvalidStaticArgument(a0 : System.String) = (3045, GetStringFunc("etInvalidStaticArgument",",,,%s,,,") a0) - /// An error occured applying the static arguments to a provided type - /// (Originally from ..\FSComp.txt:1176) - static member etErrorApplyingStaticArgumentsToType() = (3046, GetStringFunc("etErrorApplyingStaticArgumentsToType",",,,") ) - /// Unknown static argument kind '%s' when resolving a reference to a provided type or method '%s' - /// (Originally from ..\FSComp.txt:1177) - static member etUnknownStaticArgumentKind(a0 : System.String, a1 : System.String) = (3047, GetStringFunc("etUnknownStaticArgumentKind",",,,%s,,,%s,,,") a0 a1) - /// invalid namespace for provided type - /// (Originally from ..\FSComp.txt:1178) - static member invalidNamespaceForProvidedType() = (GetStringFunc("invalidNamespaceForProvidedType",",,,") ) - /// invalid full name for provided type - /// (Originally from ..\FSComp.txt:1179) - static member invalidFullNameForProvidedType() = (GetStringFunc("invalidFullNameForProvidedType",",,,") ) - /// The type provider returned 'null', which is not a valid return value from '%s' - /// (Originally from ..\FSComp.txt:1181) - static member etProviderReturnedNull(a0 : System.String) = (3051, GetStringFunc("etProviderReturnedNull",",,,%s,,,") a0) - /// The type provider constructor has thrown an exception: %s - /// (Originally from ..\FSComp.txt:1182) - static member etTypeProviderConstructorException(a0 : System.String) = (3053, GetStringFunc("etTypeProviderConstructorException",",,,%s,,,") a0) - /// Type provider '%s' returned null from GetInvokerExpression. - /// (Originally from ..\FSComp.txt:1183) - static member etNullProvidedExpression(a0 : System.String) = (3056, GetStringFunc("etNullProvidedExpression",",,,%s,,,") a0) - /// The type provider '%s' returned an invalid type from 'ApplyStaticArguments'. A type with name '%s' was expected, but a type with name '%s' was returned. - /// (Originally from ..\FSComp.txt:1184) - static member etProvidedAppliedTypeHadWrongName(a0 : System.String, a1 : System.String, a2 : System.String) = (3057, GetStringFunc("etProvidedAppliedTypeHadWrongName",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// The type provider '%s' returned an invalid method from 'ApplyStaticArgumentsForMethod'. A method with name '%s' was expected, but a method with name '%s' was returned. - /// (Originally from ..\FSComp.txt:1185) - static member etProvidedAppliedMethodHadWrongName(a0 : System.String, a1 : System.String, a2 : System.String) = (3058, GetStringFunc("etProvidedAppliedMethodHadWrongName",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// This type test or downcast will erase the provided type '%s' to the type '%s' - /// (Originally from ..\FSComp.txt:1186) - static member tcTypeTestLossy(a0 : System.String, a1 : System.String) = (3060, GetStringFunc("tcTypeTestLossy",",,,%s,,,%s,,,") a0 a1) - /// This downcast will erase the provided type '%s' to the type '%s'. - /// (Originally from ..\FSComp.txt:1187) - static member tcTypeCastErased(a0 : System.String, a1 : System.String) = (3061, GetStringFunc("tcTypeCastErased",",,,%s,,,%s,,,") a0 a1) - /// This type test with a provided type '%s' is not allowed because this provided type will be erased to '%s' at runtime. - /// (Originally from ..\FSComp.txt:1188) - static member tcTypeTestErased(a0 : System.String, a1 : System.String) = (3062, GetStringFunc("tcTypeTestErased",",,,%s,,,%s,,,") a0 a1) - /// Cannot inherit from erased provided type - /// (Originally from ..\FSComp.txt:1189) - static member tcCannotInheritFromErasedType() = (3063, GetStringFunc("tcCannotInheritFromErasedType",",,,") ) - /// Assembly '%s' hase TypeProviderAssembly attribute with invalid value '%s'. The value should be a valid assembly name - /// (Originally from ..\FSComp.txt:1190) - static member etInvalidTypeProviderAssemblyName(a0 : System.String, a1 : System.String) = (3065, GetStringFunc("etInvalidTypeProviderAssemblyName",",,,%s,,,%s,,,") a0 a1) - /// Invalid member name. Members may not have name '.ctor' or '.cctor' - /// (Originally from ..\FSComp.txt:1191) - static member tcInvalidMemberNameCtor() = (3066, GetStringFunc("tcInvalidMemberNameCtor",",,,") ) - /// The function or member '%s' is used in a way that requires further type annotations at its definition to ensure consistency of inferred types. The inferred signature is '%s'. - /// (Originally from ..\FSComp.txt:1192) - static member tcInferredGenericTypeGivesRiseToInconsistency(a0 : System.String, a1 : System.String) = (3068, GetStringFunc("tcInferredGenericTypeGivesRiseToInconsistency",",,,%s,,,%s,,,") a0 a1) - /// The number of type arguments did not match: '%d' given, '%d' expected. This may be related to a previously reported error. - /// (Originally from ..\FSComp.txt:1193) - static member tcInvalidTypeArgumentCount(a0 : System.Int32, a1 : System.Int32) = (3069, GetStringFunc("tcInvalidTypeArgumentCount",",,,%d,,,%d,,,") a0 a1) - /// Cannot override inherited member '%s' because it is sealed - /// (Originally from ..\FSComp.txt:1194) - static member tcCannotOverrideSealedMethod(a0 : System.String) = (3070, GetStringFunc("tcCannotOverrideSealedMethod",",,,%s,,,") a0) - /// The type provider '%s' reported an error in the context of provided type '%s', member '%s'. The error: %s - /// (Originally from ..\FSComp.txt:1195) - static member etProviderErrorWithContext(a0 : System.String, a1 : System.String, a2 : System.String, a3 : System.String) = (3071, GetStringFunc("etProviderErrorWithContext",",,,%s,,,%s,,,%s,,,%s,,,") a0 a1 a2 a3) - /// An exception occurred when accessing the '%s' of a provided type: %s - /// (Originally from ..\FSComp.txt:1196) - static member etProvidedTypeWithNameException(a0 : System.String, a1 : System.String) = (3072, GetStringFunc("etProvidedTypeWithNameException",",,,%s,,,%s,,,") a0 a1) - /// The '%s' of a provided type was null or empty. - /// (Originally from ..\FSComp.txt:1197) - static member etProvidedTypeWithNullOrEmptyName(a0 : System.String) = (3073, GetStringFunc("etProvidedTypeWithNullOrEmptyName",",,,%s,,,") a0) - /// Character '%s' is not allowed in provided type name '%s' - /// (Originally from ..\FSComp.txt:1198) - static member etIllegalCharactersInTypeName(a0 : System.String, a1 : System.String) = (3075, GetStringFunc("etIllegalCharactersInTypeName",",,,%s,,,%s,,,") a0 a1) - /// In queries, '%s' must use a simple pattern - /// (Originally from ..\FSComp.txt:1199) - static member tcJoinMustUseSimplePattern(a0 : System.String) = (3077, GetStringFunc("tcJoinMustUseSimplePattern",",,,%s,,,") a0) - /// A custom query operation for '%s' is required but not specified - /// (Originally from ..\FSComp.txt:1200) - static member tcMissingCustomOperation(a0 : System.String) = (3078, GetStringFunc("tcMissingCustomOperation",",,,%s,,,") a0) - /// Named static arguments must come after all unnamed static arguments - /// (Originally from ..\FSComp.txt:1201) - static member etBadUnnamedStaticArgs() = (3080, GetStringFunc("etBadUnnamedStaticArgs",",,,") ) - /// The static parameter '%s' of the provided type or method '%s' requires a value. Static parameters to type providers may be optionally specified using named arguments, e.g. '%s<%s=...>'. - /// (Originally from ..\FSComp.txt:1202) - static member etStaticParameterRequiresAValue(a0 : System.String, a1 : System.String, a2 : System.String, a3 : System.String) = (3081, GetStringFunc("etStaticParameterRequiresAValue",",,,%s,,,%s,,,%s,,,%s,,,") a0 a1 a2 a3) - /// No static parameter exists with name '%s' - /// (Originally from ..\FSComp.txt:1203) - static member etNoStaticParameterWithName(a0 : System.String) = (3082, GetStringFunc("etNoStaticParameterWithName",",,,%s,,,") a0) - /// The static parameter '%s' has already been given a value - /// (Originally from ..\FSComp.txt:1204) - static member etStaticParameterAlreadyHasValue(a0 : System.String) = (3083, GetStringFunc("etStaticParameterAlreadyHasValue",",,,%s,,,") a0) - /// Multiple static parameters exist with name '%s' - /// (Originally from ..\FSComp.txt:1205) - static member etMultipleStaticParameterWithName(a0 : System.String) = (3084, GetStringFunc("etMultipleStaticParameterWithName",",,,%s,,,") a0) - /// A custom operation may not be used in conjunction with a non-value or recursive 'let' binding in another part of this computation expression - /// (Originally from ..\FSComp.txt:1206) - static member tcCustomOperationMayNotBeUsedInConjunctionWithNonSimpleLetBindings() = (3085, GetStringFunc("tcCustomOperationMayNotBeUsedInConjunctionWithNonSimpleLetBindings",",,,") ) - /// A custom operation may not be used in conjunction with 'use', 'try/with', 'try/finally', 'if/then/else' or 'match' operators within this computation expression - /// (Originally from ..\FSComp.txt:1207) - static member tcCustomOperationMayNotBeUsedHere() = (3086, GetStringFunc("tcCustomOperationMayNotBeUsedHere",",,,") ) - /// The custom operation '%s' refers to a method which is overloaded. The implementations of custom operations may not be overloaded. - /// (Originally from ..\FSComp.txt:1208) - static member tcCustomOperationMayNotBeOverloaded(a0 : System.String) = (3087, GetStringFunc("tcCustomOperationMayNotBeOverloaded",",,,%s,,,") a0) - /// An if/then/else expression may not be used within queries. Consider using either an if/then expression, or use a sequence expression instead. - /// (Originally from ..\FSComp.txt:1209) - static member tcIfThenElseMayNotBeUsedWithinQueries() = (3090, GetStringFunc("tcIfThenElseMayNotBeUsedWithinQueries",",,,") ) - /// Invalid argument to 'methodhandleof' during codegen - /// (Originally from ..\FSComp.txt:1210) - static member ilxgenUnexpectedArgumentToMethodHandleOfDuringCodegen() = (3091, GetStringFunc("ilxgenUnexpectedArgumentToMethodHandleOfDuringCodegen",",,,") ) - /// A reference to a provided type was missing a value for the static parameter '%s'. You may need to recompile one or more referenced assemblies. - /// (Originally from ..\FSComp.txt:1211) - static member etProvidedTypeReferenceMissingArgument(a0 : System.String) = (3092, GetStringFunc("etProvidedTypeReferenceMissingArgument",",,,%s,,,") a0) - /// A reference to a provided type had an invalid value '%s' for a static parameter. You may need to recompile one or more referenced assemblies. - /// (Originally from ..\FSComp.txt:1212) - static member etProvidedTypeReferenceInvalidText(a0 : System.String) = (3093, GetStringFunc("etProvidedTypeReferenceInvalidText",",,,%s,,,") a0) - /// '%s' is not used correctly. This is a custom operation in this query or computation expression. - /// (Originally from ..\FSComp.txt:1213) - static member tcCustomOperationNotUsedCorrectly(a0 : System.String) = (3095, GetStringFunc("tcCustomOperationNotUsedCorrectly",",,,%s,,,") a0) - /// '%s' is not used correctly. Usage: %s. This is a custom operation in this query or computation expression. - /// (Originally from ..\FSComp.txt:1214) - static member tcCustomOperationNotUsedCorrectly2(a0 : System.String, a1 : System.String) = (3095, GetStringFunc("tcCustomOperationNotUsedCorrectly2",",,,%s,,,%s,,,") a0 a1) - /// %s var in collection %s (outerKey = innerKey). Note that parentheses are required after '%s' - /// (Originally from ..\FSComp.txt:1215) - static member customOperationTextLikeJoin(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("customOperationTextLikeJoin",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// %s var in collection %s (outerKey = innerKey) into group. Note that parentheses are required after '%s' - /// (Originally from ..\FSComp.txt:1216) - static member customOperationTextLikeGroupJoin(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("customOperationTextLikeGroupJoin",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// %s var in collection - /// (Originally from ..\FSComp.txt:1217) - static member customOperationTextLikeZip(a0 : System.String) = (GetStringFunc("customOperationTextLikeZip",",,,%s,,,") a0) - /// '%s' must be followed by a variable name. Usage: %s. - /// (Originally from ..\FSComp.txt:1218) - static member tcBinaryOperatorRequiresVariable(a0 : System.String, a1 : System.String) = (3096, GetStringFunc("tcBinaryOperatorRequiresVariable",",,,%s,,,%s,,,") a0 a1) - /// Incorrect syntax for '%s'. Usage: %s. - /// (Originally from ..\FSComp.txt:1219) - static member tcOperatorIncorrectSyntax(a0 : System.String, a1 : System.String) = (3097, GetStringFunc("tcOperatorIncorrectSyntax",",,,%s,,,%s,,,") a0 a1) - /// '%s' must come after a 'for' selection clause and be followed by the rest of the query. Syntax: ... %s ... - /// (Originally from ..\FSComp.txt:1220) - static member tcBinaryOperatorRequiresBody(a0 : System.String, a1 : System.String) = (3098, GetStringFunc("tcBinaryOperatorRequiresBody",",,,%s,,,%s,,,") a0 a1) - /// '%s' is used with an incorrect number of arguments. This is a custom operation in this query or computation expression. Expected %d argument(s), but given %d. - /// (Originally from ..\FSComp.txt:1221) - static member tcCustomOperationHasIncorrectArgCount(a0 : System.String, a1 : System.Int32, a2 : System.Int32) = (3099, GetStringFunc("tcCustomOperationHasIncorrectArgCount",",,,%s,,,%d,,,%d,,,") a0 a1 a2) - /// Expected an expression after this point - /// (Originally from ..\FSComp.txt:1222) - static member parsExpectedExpressionAfterToken() = (3100, GetStringFunc("parsExpectedExpressionAfterToken",",,,") ) - /// Expected a type after this point - /// (Originally from ..\FSComp.txt:1223) - static member parsExpectedTypeAfterToken() = (3101, GetStringFunc("parsExpectedTypeAfterToken",",,,") ) - /// Unmatched '[<'. Expected closing '>]' - /// (Originally from ..\FSComp.txt:1224) - static member parsUnmatchedLBrackLess() = (3102, GetStringFunc("parsUnmatchedLBrackLess",",,,") ) - /// Unexpected end of input in 'match' expression. Expected 'match with | -> | -> ...'. - /// (Originally from ..\FSComp.txt:1225) - static member parsUnexpectedEndOfFileMatch() = (3103, GetStringFunc("parsUnexpectedEndOfFileMatch",",,,") ) - /// Unexpected end of input in 'try' expression. Expected 'try with ' or 'try finally '. - /// (Originally from ..\FSComp.txt:1226) - static member parsUnexpectedEndOfFileTry() = (3104, GetStringFunc("parsUnexpectedEndOfFileTry",",,,") ) - /// Unexpected end of input in 'while' expression. Expected 'while do '. - /// (Originally from ..\FSComp.txt:1227) - static member parsUnexpectedEndOfFileWhile() = (3105, GetStringFunc("parsUnexpectedEndOfFileWhile",",,,") ) - /// Unexpected end of input in 'for' expression. Expected 'for in do '. - /// (Originally from ..\FSComp.txt:1228) - static member parsUnexpectedEndOfFileFor() = (3106, GetStringFunc("parsUnexpectedEndOfFileFor",",,,") ) - /// Unexpected end of input in 'match' or 'try' expression - /// (Originally from ..\FSComp.txt:1229) - static member parsUnexpectedEndOfFileWith() = (3107, GetStringFunc("parsUnexpectedEndOfFileWith",",,,") ) - /// Unexpected end of input in 'then' branch of conditional expression. Expected 'if then ' or 'if then else '. - /// (Originally from ..\FSComp.txt:1230) - static member parsUnexpectedEndOfFileThen() = (3108, GetStringFunc("parsUnexpectedEndOfFileThen",",,,") ) - /// Unexpected end of input in 'else' branch of conditional expression. Expected 'if then ' or 'if then else '. - /// (Originally from ..\FSComp.txt:1231) - static member parsUnexpectedEndOfFileElse() = (3109, GetStringFunc("parsUnexpectedEndOfFileElse",",,,") ) - /// Unexpected end of input in body of lambda expression. Expected 'fun ... -> '. - /// (Originally from ..\FSComp.txt:1232) - static member parsUnexpectedEndOfFileFunBody() = (3110, GetStringFunc("parsUnexpectedEndOfFileFunBody",",,,") ) - /// Unexpected end of input in type arguments - /// (Originally from ..\FSComp.txt:1233) - static member parsUnexpectedEndOfFileTypeArgs() = (3111, GetStringFunc("parsUnexpectedEndOfFileTypeArgs",",,,") ) - /// Unexpected end of input in type signature - /// (Originally from ..\FSComp.txt:1234) - static member parsUnexpectedEndOfFileTypeSignature() = (3112, GetStringFunc("parsUnexpectedEndOfFileTypeSignature",",,,") ) - /// Unexpected end of input in type definition - /// (Originally from ..\FSComp.txt:1235) - static member parsUnexpectedEndOfFileTypeDefinition() = (3113, GetStringFunc("parsUnexpectedEndOfFileTypeDefinition",",,,") ) - /// Unexpected end of input in object members - /// (Originally from ..\FSComp.txt:1236) - static member parsUnexpectedEndOfFileObjectMembers() = (3114, GetStringFunc("parsUnexpectedEndOfFileObjectMembers",",,,") ) - /// Unexpected end of input in value, function or member definition - /// (Originally from ..\FSComp.txt:1237) - static member parsUnexpectedEndOfFileDefinition() = (3115, GetStringFunc("parsUnexpectedEndOfFileDefinition",",,,") ) - /// Unexpected end of input in expression - /// (Originally from ..\FSComp.txt:1238) - static member parsUnexpectedEndOfFileExpression() = (3116, GetStringFunc("parsUnexpectedEndOfFileExpression",",,,") ) - /// Unexpected end of type. Expected a name after this point. - /// (Originally from ..\FSComp.txt:1239) - static member parsExpectedNameAfterToken() = (3117, GetStringFunc("parsExpectedNameAfterToken",",,,") ) - /// Incomplete value or function definition. If this is in an expression, the body of the expression must be indented to the same column as the 'let' keyword. - /// (Originally from ..\FSComp.txt:1240) - static member parsUnmatchedLet() = (3118, GetStringFunc("parsUnmatchedLet",",,,") ) - /// Incomplete value definition. If this is in an expression, the body of the expression must be indented to the same column as the 'let!' keyword. - /// (Originally from ..\FSComp.txt:1241) - static member parsUnmatchedLetBang() = (3119, GetStringFunc("parsUnmatchedLetBang",",,,") ) - /// Incomplete value definition. If this is in an expression, the body of the expression must be indented to the same column as the 'use!' keyword. - /// (Originally from ..\FSComp.txt:1242) - static member parsUnmatchedUseBang() = (3120, GetStringFunc("parsUnmatchedUseBang",",,,") ) - /// Incomplete value definition. If this is in an expression, the body of the expression must be indented to the same column as the 'use' keyword. - /// (Originally from ..\FSComp.txt:1243) - static member parsUnmatchedUse() = (3121, GetStringFunc("parsUnmatchedUse",",,,") ) - /// Missing 'do' in 'while' expression. Expected 'while do '. - /// (Originally from ..\FSComp.txt:1244) - static member parsWhileDoExpected() = (3122, GetStringFunc("parsWhileDoExpected",",,,") ) - /// Missing 'do' in 'for' expression. Expected 'for in do '. - /// (Originally from ..\FSComp.txt:1245) - static member parsForDoExpected() = (3123, GetStringFunc("parsForDoExpected",",,,") ) - /// Invalid join relation in '%s'. Expected 'expr expr', where is =, =?, ?= or ?=?. - /// (Originally from ..\FSComp.txt:1246) - static member tcInvalidRelationInJoin(a0 : System.String) = (3125, GetStringFunc("tcInvalidRelationInJoin",",,,%s,,,") a0) - /// Calls - /// (Originally from ..\FSComp.txt:1247) - static member typeInfoCallsWord() = (GetStringFunc("typeInfoCallsWord",",,,") ) - /// Invalid number of generic arguments to type '%s' in provided type. Expected '%d' arguments, given '%d'. - /// (Originally from ..\FSComp.txt:1248) - static member impInvalidNumberOfGenericArguments(a0 : System.String, a1 : System.Int32, a2 : System.Int32) = (3126, GetStringFunc("impInvalidNumberOfGenericArguments",",,,%s,,,%d,,,%d,,,") a0 a1 a2) - /// Invalid value '%s' for unit-of-measure parameter '%s' - /// (Originally from ..\FSComp.txt:1249) - static member impInvalidMeasureArgument1(a0 : System.String, a1 : System.String) = (3127, GetStringFunc("impInvalidMeasureArgument1",",,,%s,,,%s,,,") a0 a1) - /// Invalid value unit-of-measure parameter '%s' - /// (Originally from ..\FSComp.txt:1250) - static member impInvalidMeasureArgument2(a0 : System.String) = (3127, GetStringFunc("impInvalidMeasureArgument2",",,,%s,,,") a0) - /// Property '%s' on provided type '%s' is neither readable nor writable as it has CanRead=false and CanWrite=false - /// (Originally from ..\FSComp.txt:1251) - static member etPropertyNeedsCanWriteOrCanRead(a0 : System.String, a1 : System.String) = (3128, GetStringFunc("etPropertyNeedsCanWriteOrCanRead",",,,%s,,,%s,,,") a0 a1) - /// A use of 'into' must be followed by the remainder of the computation - /// (Originally from ..\FSComp.txt:1252) - static member tcIntoNeedsRestOfQuery() = (3129, GetStringFunc("tcIntoNeedsRestOfQuery",",,,") ) - /// The operator '%s' does not accept the use of 'into' - /// (Originally from ..\FSComp.txt:1253) - static member tcOperatorDoesntAcceptInto(a0 : System.String) = (3130, GetStringFunc("tcOperatorDoesntAcceptInto",",,,%s,,,") a0) - /// The definition of the custom operator '%s' does not use a valid combination of attribute flags - /// (Originally from ..\FSComp.txt:1254) - static member tcCustomOperationInvalid(a0 : System.String) = (3131, GetStringFunc("tcCustomOperationInvalid",",,,%s,,,") a0) - /// This type definition may not have the 'CLIMutable' attribute. Only record types may have this attribute. - /// (Originally from ..\FSComp.txt:1255) - static member tcThisTypeMayNotHaveACLIMutableAttribute() = (3132, GetStringFunc("tcThisTypeMayNotHaveACLIMutableAttribute",",,,") ) - /// 'member val' definitions are only permitted in types with a primary constructor. Consider adding arguments to your type definition, e.g. 'type X(args) = ...'. - /// (Originally from ..\FSComp.txt:1256) - static member tcAutoPropertyRequiresImplicitConstructionSequence() = (3133, GetStringFunc("tcAutoPropertyRequiresImplicitConstructionSequence",",,,") ) - /// Property definitions may not be declared mutable. To indicate that this property can be set, use 'member val PropertyName = expr with get,set'. - /// (Originally from ..\FSComp.txt:1257) - static member parsMutableOnAutoPropertyShouldBeGetSet() = (3134, GetStringFunc("parsMutableOnAutoPropertyShouldBeGetSet",",,,") ) - /// To indicate that this property can be set, use 'member val PropertyName = expr with get,set'. - /// (Originally from ..\FSComp.txt:1258) - static member parsMutableOnAutoPropertyShouldBeGetSetNotJustSet() = (3135, GetStringFunc("parsMutableOnAutoPropertyShouldBeGetSetNotJustSet",",,,") ) - /// Type '%s' is illegal because in byref, T cannot contain byref types. - /// (Originally from ..\FSComp.txt:1259) - static member chkNoByrefsOfByrefs(a0 : System.String) = (3136, GetStringFunc("chkNoByrefsOfByrefs",",,,%s,,,") a0) - /// F# supports array ranks between 1 and 32. The value %d is not allowed. - /// (Originally from ..\FSComp.txt:1260) - static member tastopsMaxArrayThirtyTwo(a0 : System.Int32) = (3138, GetStringFunc("tastopsMaxArrayThirtyTwo",",,,%d,,,") a0) - /// In queries, use the form 'for x in n .. m do ...' for ranging over integers - /// (Originally from ..\FSComp.txt:1261) - static member tcNoIntegerForLoopInQuery() = (3139, GetStringFunc("tcNoIntegerForLoopInQuery",",,,") ) - /// 'while' expressions may not be used in queries - /// (Originally from ..\FSComp.txt:1262) - static member tcNoWhileInQuery() = (3140, GetStringFunc("tcNoWhileInQuery",",,,") ) - /// 'try/finally' expressions may not be used in queries - /// (Originally from ..\FSComp.txt:1263) - static member tcNoTryFinallyInQuery() = (3141, GetStringFunc("tcNoTryFinallyInQuery",",,,") ) - /// 'use' expressions may not be used in queries - /// (Originally from ..\FSComp.txt:1264) - static member tcUseMayNotBeUsedInQueries() = (3142, GetStringFunc("tcUseMayNotBeUsedInQueries",",,,") ) - /// 'let!', 'use!' and 'do!' expressions may not be used in queries - /// (Originally from ..\FSComp.txt:1265) - static member tcBindMayNotBeUsedInQueries() = (3143, GetStringFunc("tcBindMayNotBeUsedInQueries",",,,") ) - /// 'return' and 'return!' may not be used in queries - /// (Originally from ..\FSComp.txt:1266) - static member tcReturnMayNotBeUsedInQueries() = (3144, GetStringFunc("tcReturnMayNotBeUsedInQueries",",,,") ) - /// This is not a known query operator. Query operators are identifiers such as 'select', 'where', 'sortBy', 'thenBy', 'groupBy', 'groupValBy', 'join', 'groupJoin', 'sumBy' and 'averageBy', defined using corresponding methods on the 'QueryBuilder' type. - /// (Originally from ..\FSComp.txt:1267) - static member tcUnrecognizedQueryOperator() = (3145, GetStringFunc("tcUnrecognizedQueryOperator",",,,") ) - /// 'try/with' expressions may not be used in queries - /// (Originally from ..\FSComp.txt:1268) - static member tcTryWithMayNotBeUsedInQueries() = (3146, GetStringFunc("tcTryWithMayNotBeUsedInQueries",",,,") ) - /// This 'let' definition may not be used in a query. Only simple value definitions may be used in queries. - /// (Originally from ..\FSComp.txt:1269) - static member tcNonSimpleLetBindingInQuery() = (3147, GetStringFunc("tcNonSimpleLetBindingInQuery",",,,") ) - /// Too many static parameters. Expected at most %d parameters, but got %d unnamed and %d named parameters. - /// (Originally from ..\FSComp.txt:1270) - static member etTooManyStaticParameters(a0 : System.Int32, a1 : System.Int32, a2 : System.Int32) = (3148, GetStringFunc("etTooManyStaticParameters",",,,%d,,,%d,,,%d,,,") a0 a1 a2) - /// Invalid provided literal value '%s' - /// (Originally from ..\FSComp.txt:1271) - static member infosInvalidProvidedLiteralValue(a0 : System.String) = (3149, GetStringFunc("infosInvalidProvidedLiteralValue",",,,%s,,,") a0) - /// The 'anycpu32bitpreferred' platform can only be used with EXE targets. You must use 'anycpu' instead. - /// (Originally from ..\FSComp.txt:1272) - static member invalidPlatformTarget() = (3150, GetStringFunc("invalidPlatformTarget",",,,") ) - /// This member, function or value declaration may not be declared 'inline' - /// (Originally from ..\FSComp.txt:1273) - static member tcThisValueMayNotBeInlined() = (3151, GetStringFunc("tcThisValueMayNotBeInlined",",,,") ) - /// The provider '%s' returned a non-generated type '%s' in the context of a set of generated types. Consider adjusting the type provider to only return generated types. - /// (Originally from ..\FSComp.txt:1274) - static member etErasedTypeUsedInGeneration(a0 : System.String, a1 : System.String) = (3152, GetStringFunc("etErasedTypeUsedInGeneration",",,,%s,,,%s,,,") a0 a1) - /// Arguments to query operators may require parentheses, e.g. 'where (x > y)' or 'groupBy (x.Length / 10)' - /// (Originally from ..\FSComp.txt:1275) - static member tcUnrecognizedQueryBinaryOperator() = (3153, GetStringFunc("tcUnrecognizedQueryBinaryOperator",",,,") ) - /// A quotation may not involve an assignment to or taking the address of a captured local variable - /// (Originally from ..\FSComp.txt:1276) - static member crefNoSetOfHole() = (3155, GetStringFunc("crefNoSetOfHole",",,,") ) - /// + 1 overload - /// (Originally from ..\FSComp.txt:1277) - static member nicePrintOtherOverloads1() = (GetStringFunc("nicePrintOtherOverloads1",",,,") ) - /// + %d overloads - /// (Originally from ..\FSComp.txt:1278) - static member nicePrintOtherOverloadsN(a0 : System.Int32) = (GetStringFunc("nicePrintOtherOverloadsN",",,,%d,,,") a0) - /// Erased to - /// (Originally from ..\FSComp.txt:1279) - static member erasedTo() = (GetStringFunc("erasedTo",",,,") ) - /// Unexpected token '%s' or incomplete expression - /// (Originally from ..\FSComp.txt:1280) - static member parsUnfinishedExpression(a0 : System.String) = (3156, GetStringFunc("parsUnfinishedExpression",",,,%s,,,") a0) - /// Cannot find code target for this attribute, possibly because the code after the attribute is incomplete. - /// (Originally from ..\FSComp.txt:1281) - static member parsAttributeOnIncompleteCode() = (3158, GetStringFunc("parsAttributeOnIncompleteCode",",,,") ) - /// Type name cannot be empty. - /// (Originally from ..\FSComp.txt:1282) - static member parsTypeNameCannotBeEmpty() = (3159, GetStringFunc("parsTypeNameCannotBeEmpty",",,,") ) - /// Problem reading assembly '%s': %s - /// (Originally from ..\FSComp.txt:1283) - static member buildProblemReadingAssembly(a0 : System.String, a1 : System.String) = (3160, GetStringFunc("buildProblemReadingAssembly",",,,%s,,,%s,,,") a0 a1) - /// Invalid provided field. Provided fields of erased provided types must be literals. - /// (Originally from ..\FSComp.txt:1284) - static member tcTPFieldMustBeLiteral() = (3161, GetStringFunc("tcTPFieldMustBeLiteral",",,,") ) - /// (loading description...) - /// (Originally from ..\FSComp.txt:1285) - static member loadingDescription() = (GetStringFunc("loadingDescription",",,,") ) - /// (description unavailable...) - /// (Originally from ..\FSComp.txt:1286) - static member descriptionUnavailable() = (GetStringFunc("descriptionUnavailable",",,,") ) - /// A type variable has been constrained by multiple different class types. A type variable may only have one class constraint. - /// (Originally from ..\FSComp.txt:1287) - static member chkTyparMultipleClassConstraints() = (3162, GetStringFunc("chkTyparMultipleClassConstraints",",,,") ) - /// 'match' expressions may not be used in queries - /// (Originally from ..\FSComp.txt:1288) - static member tcMatchMayNotBeUsedWithQuery() = (3163, GetStringFunc("tcMatchMayNotBeUsedWithQuery",",,,") ) - /// Infix operator member '%s' has %d initial argument(s). Expected a tuple of 3 arguments - /// (Originally from ..\FSComp.txt:1289) - static member memberOperatorDefinitionWithNonTripleArgument(a0 : System.String, a1 : System.Int32) = (3164, GetStringFunc("memberOperatorDefinitionWithNonTripleArgument",",,,%s,,,%d,,,") a0 a1) - /// The operator '%s' cannot be resolved. Consider opening the module 'Microsoft.FSharp.Linq.NullableOperators'. - /// (Originally from ..\FSComp.txt:1290) - static member cannotResolveNullableOperators(a0 : System.String) = (3165, GetStringFunc("cannotResolveNullableOperators",",,,%s,,,") a0) - /// '%s' must be followed by 'in'. Usage: %s. - /// (Originally from ..\FSComp.txt:1291) - static member tcOperatorRequiresIn(a0 : System.String, a1 : System.String) = (3167, GetStringFunc("tcOperatorRequiresIn",",,,%s,,,%s,,,") a0 a1) - /// Neither 'member val' nor 'override val' definitions are permitted in object expressions. - /// (Originally from ..\FSComp.txt:1292) - static member parsIllegalMemberVarInObjectImplementation() = (3168, GetStringFunc("parsIllegalMemberVarInObjectImplementation",",,,") ) - /// Copy-and-update record expressions must include at least one field. - /// (Originally from ..\FSComp.txt:1293) - static member tcEmptyCopyAndUpdateRecordInvalid() = (3169, GetStringFunc("tcEmptyCopyAndUpdateRecordInvalid",",,,") ) - /// '_' cannot be used as field name - /// (Originally from ..\FSComp.txt:1294) - static member parsUnderscoreInvalidFieldName() = (3170, GetStringFunc("parsUnderscoreInvalidFieldName",",,,") ) - /// The provided types generated by this use of a type provider may not be used from other F# assemblies and should be marked internal or private. Consider using 'type internal TypeName = ...' or 'type private TypeName = ...'. - /// (Originally from ..\FSComp.txt:1295) - static member tcGeneratedTypesShouldBeInternalOrPrivate() = (3171, GetStringFunc("tcGeneratedTypesShouldBeInternalOrPrivate",",,,") ) - /// A property's getter and setter must have the same type. Property '%s' has getter of type '%s' but setter of type '%s'. - /// (Originally from ..\FSComp.txt:1296) - static member chkGetterAndSetterHaveSamePropertyType(a0 : System.String, a1 : System.String, a2 : System.String) = (3172, GetStringFunc("chkGetterAndSetterHaveSamePropertyType",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// Array method '%s' is supplied by the runtime and cannot be directly used in code. For operations with array elements consider using family of GetArray/SetArray functions from LanguagePrimitives.IntrinsicFunctions module. - /// (Originally from ..\FSComp.txt:1297) - static member tcRuntimeSuppliedMethodCannotBeUsedInUserCode(a0 : System.String) = (3173, GetStringFunc("tcRuntimeSuppliedMethodCannotBeUsedInUserCode",",,,%s,,,") a0) - /// The union case '%s' does not have a field named '%s'. - /// (Originally from ..\FSComp.txt:1298) - static member tcUnionCaseConstructorDoesNotHaveFieldWithGivenName(a0 : System.String, a1 : System.String) = (3174, GetStringFunc("tcUnionCaseConstructorDoesNotHaveFieldWithGivenName",",,,%s,,,%s,,,") a0 a1) - /// The exception '%s' does not have a field named '%s'. - /// (Originally from ..\FSComp.txt:1299) - static member tcExceptionConstructorDoesNotHaveFieldWithGivenName(a0 : System.String, a1 : System.String) = (3174, GetStringFunc("tcExceptionConstructorDoesNotHaveFieldWithGivenName",",,,%s,,,%s,,,") a0 a1) - /// Active patterns do not have fields. This syntax is invalid. - /// (Originally from ..\FSComp.txt:1300) - static member tcActivePatternsDoNotHaveFields() = (3174, GetStringFunc("tcActivePatternsDoNotHaveFields",",,,") ) - /// The constructor does not have a field named '%s'. - /// (Originally from ..\FSComp.txt:1301) - static member tcConstructorDoesNotHaveFieldWithGivenName(a0 : System.String) = (3174, GetStringFunc("tcConstructorDoesNotHaveFieldWithGivenName",",,,%s,,,") a0) - /// Union case/exception field '%s' cannot be used more than once. - /// (Originally from ..\FSComp.txt:1302) - static member tcUnionCaseFieldCannotBeUsedMoreThanOnce(a0 : System.String) = (3175, GetStringFunc("tcUnionCaseFieldCannotBeUsedMoreThanOnce",",,,%s,,,") a0) - /// Named field '%s' is used more than once. - /// (Originally from ..\FSComp.txt:1303) - static member tcFieldNameIsUsedModeThanOnce(a0 : System.String) = (3176, GetStringFunc("tcFieldNameIsUsedModeThanOnce",",,,%s,,,") a0) - /// Named field '%s' conflicts with autogenerated name for anonymous field. - /// (Originally from ..\FSComp.txt:1304) - static member tcFieldNameConflictsWithGeneratedNameForAnonymousField(a0 : System.String) = (3176, GetStringFunc("tcFieldNameConflictsWithGeneratedNameForAnonymousField",",,,%s,,,") a0) - /// This literal expression or attribute argument results in an arithmetic overflow. - /// (Originally from ..\FSComp.txt:1305) - static member tastConstantExpressionOverflow() = (3177, GetStringFunc("tastConstantExpressionOverflow",",,,") ) - /// This is not valid literal expression. The [] attribute will be ignored. - /// (Originally from ..\FSComp.txt:1306) - static member tcIllegalStructTypeForConstantExpression() = (3178, GetStringFunc("tcIllegalStructTypeForConstantExpression",",,,") ) - /// System.Runtime.InteropServices assembly is required to use UnknownWrapper\DispatchWrapper classes. - /// (Originally from ..\FSComp.txt:1307) - static member fscSystemRuntimeInteropServicesIsRequired() = (3179, GetStringFunc("fscSystemRuntimeInteropServicesIsRequired",",,,") ) - /// The mutable local '%s' is implicitly allocated as a reference cell because it has been captured by a closure. This warning is for informational purposes only to indicate where implicit allocations are performed. - /// (Originally from ..\FSComp.txt:1308) - static member abImplicitHeapAllocation(a0 : System.String) = (3180, GetStringFunc("abImplicitHeapAllocation",",,,%s,,,") a0) - /// A type provider implemented GetStaticParametersForMethod, but ApplyStaticArgumentsForMethod was not implemented or invalid - /// (Originally from ..\FSComp.txt:1309) - static member estApplyStaticArgumentsForMethodNotImplemented() = (GetStringFunc("estApplyStaticArgumentsForMethodNotImplemented",",,,") ) - /// An error occured applying the static arguments to a provided method - /// (Originally from ..\FSComp.txt:1310) - static member etErrorApplyingStaticArgumentsToMethod() = (3181, GetStringFunc("etErrorApplyingStaticArgumentsToMethod",",,,") ) - /// Unexpected character '%s' in preprocessor expression - /// (Originally from ..\FSComp.txt:1311) - static member pplexUnexpectedChar(a0 : System.String) = (3182, GetStringFunc("pplexUnexpectedChar",",,,%s,,,") a0) - /// Unexpected token '%s' in preprocessor expression - /// (Originally from ..\FSComp.txt:1312) - static member ppparsUnexpectedToken(a0 : System.String) = (3183, GetStringFunc("ppparsUnexpectedToken",",,,%s,,,") a0) - /// Incomplete preprocessor expression - /// (Originally from ..\FSComp.txt:1313) - static member ppparsIncompleteExpression() = (3184, GetStringFunc("ppparsIncompleteExpression",",,,") ) - /// Missing token '%s' in preprocessor expression - /// (Originally from ..\FSComp.txt:1314) - static member ppparsMissingToken(a0 : System.String) = (3185, GetStringFunc("ppparsMissingToken",",,,%s,,,") a0) - /// An error occurred while reading the F# metadata node at position %d in table '%s' of assembly '%s'. The node had no matching declaration. Please report this warning. You may need to recompile the F# assembly you are using. - /// (Originally from ..\FSComp.txt:1315) - static member pickleMissingDefinition(a0 : System.Int32, a1 : System.String, a2 : System.String) = (3186, GetStringFunc("pickleMissingDefinition",",,,%d,,,%s,,,%s,,,") a0 a1 a2) - /// Type inference caused the type variable %s to escape its scope. Consider adding an explicit type parameter declaration or adjusting your code to be less generic. - /// (Originally from ..\FSComp.txt:1316) - static member checkNotSufficientlyGenericBecauseOfScope(a0 : System.String) = (3187, GetStringFunc("checkNotSufficientlyGenericBecauseOfScope",",,,%s,,,") a0) - /// Type inference caused an inference type variable to escape its scope. Consider adding type annotations to make your code less generic. - /// (Originally from ..\FSComp.txt:1317) - static member checkNotSufficientlyGenericBecauseOfScopeAnon() = (3188, GetStringFunc("checkNotSufficientlyGenericBecauseOfScopeAnon",",,,") ) - /// Redundant arguments are being ignored in function '%s'. Expected %d but got %d arguments. - /// (Originally from ..\FSComp.txt:1318) - static member checkRaiseFamilyFunctionArgumentCount(a0 : System.String, a1 : System.Int32, a2 : System.Int32) = (3189, GetStringFunc("checkRaiseFamilyFunctionArgumentCount",",,,%s,,,%d,,,%d,,,") a0 a1 a2) - /// Lowercase literal '%s' is being shadowed by a new pattern with the same name. Only uppercase and module-prefixed literals can be used as named patterns. - /// (Originally from ..\FSComp.txt:1319) - static member checkLowercaseLiteralBindingInPattern(a0 : System.String) = (3190, GetStringFunc("checkLowercaseLiteralBindingInPattern",",,,%s,,,") a0) - /// This literal pattern does not take arguments - /// (Originally from ..\FSComp.txt:1320) - static member tcLiteralDoesNotTakeArguments() = (3191, GetStringFunc("tcLiteralDoesNotTakeArguments",",,,") ) - /// Constructors are not permitted as extension members - they must be defined as part of the original definition of the type - /// (Originally from ..\FSComp.txt:1321) - static member tcConstructorsIllegalInAugmentation() = (3192, GetStringFunc("tcConstructorsIllegalInAugmentation",",,,") ) - /// Invalid response file '%s' ( '%s' ) - /// (Originally from ..\FSComp.txt:1322) - static member optsInvalidResponseFile(a0 : System.String, a1 : System.String) = (3193, GetStringFunc("optsInvalidResponseFile",",,,%s,,,%s,,,") a0 a1) - /// Response file '%s' not found in '%s' - /// (Originally from ..\FSComp.txt:1323) - static member optsResponseFileNotFound(a0 : System.String, a1 : System.String) = (3194, GetStringFunc("optsResponseFileNotFound",",,,%s,,,%s,,,") a0 a1) - /// Response file name '%s' is empty, contains invalid characters, has a drive specification without an absolute path, or is too long - /// (Originally from ..\FSComp.txt:1324) - static member optsResponseFileNameInvalid(a0 : System.String) = (3195, GetStringFunc("optsResponseFileNameInvalid",",,,%s,,,") a0) - /// Cannot find FSharp.Core.dll in compiler's directory - /// (Originally from ..\FSComp.txt:1325) - static member fsharpCoreNotFoundToBeCopied() = (3196, GetStringFunc("fsharpCoreNotFoundToBeCopied",",,,") ) - /// One tuple type is a struct tuple, the other is a reference tuple - /// (Originally from ..\FSComp.txt:1326) - static member tcTupleStructMismatch() = (GetStringFunc("tcTupleStructMismatch",",,,") ) - /// This provided method requires static parameters - /// (Originally from ..\FSComp.txt:1327) - static member etMissingStaticArgumentsToMethod() = (3197, GetStringFunc("etMissingStaticArgumentsToMethod",",,,") ) - /// The conversion from %s to %s is a compile-time safe upcast, not a downcast. Consider using 'upcast' instead of 'downcast'. - /// (Originally from ..\FSComp.txt:1328) - static member considerUpcast(a0 : System.String, a1 : System.String) = (3198, GetStringFunc("considerUpcast",",,,%s,,,%s,,,") a0 a1) - /// The conversion from %s to %s is a compile-time safe upcast, not a downcast. Consider using the :> (upcast) operator instead of the :?> (downcast) operator. - /// (Originally from ..\FSComp.txt:1329) - static member considerUpcastOperator(a0 : System.String, a1 : System.String) = (3198, GetStringFunc("considerUpcastOperator",",,,%s,,,%s,,,") a0 a1) - /// The 'rec' on this module is implied by an outer 'rec' declaration and is being ignored - /// (Originally from ..\FSComp.txt:1330) - static member tcRecImplied() = (3199, GetStringFunc("tcRecImplied",",,,") ) - /// In a recursive declaration group, 'open' declarations must come first in each module - /// (Originally from ..\FSComp.txt:1331) - static member tcOpenFirstInMutRec() = (3200, GetStringFunc("tcOpenFirstInMutRec",",,,") ) - /// In a recursive declaration group, module abbreviations must come after all 'open' declarations and before other declarations - /// (Originally from ..\FSComp.txt:1332) - static member tcModuleAbbrevFirstInMutRec() = (3201, GetStringFunc("tcModuleAbbrevFirstInMutRec",",,,") ) - /// This declaration is not supported in recursive declaration groups - /// (Originally from ..\FSComp.txt:1333) - static member tcUnsupportedMutRecDecl() = (3202, GetStringFunc("tcUnsupportedMutRecDecl",",,,") ) - /// Invalid use of 'rec' keyword - /// (Originally from ..\FSComp.txt:1334) - static member parsInvalidUseOfRec() = (3203, GetStringFunc("parsInvalidUseOfRec",",,,") ) - /// If a union type has more than one case and is a struct, then all fields within the union type must be given unique names. - /// (Originally from ..\FSComp.txt:1335) - static member tcStructUnionMultiCaseDistinctFields() = (3204, GetStringFunc("tcStructUnionMultiCaseDistinctFields",",,,") ) - /// The CallerMemberNameAttribute applied to parameter '%s' will have no effect. It is overridden by the CallerFilePathAttribute. - /// (Originally from ..\FSComp.txt:1336) - static member CallerMemberNameIsOverriden(a0 : System.String) = (3206, GetStringFunc("CallerMemberNameIsOverriden",",,,%s,,,") a0) - /// Invalid use of 'fixed'. 'fixed' may only be used in a declaration of the form 'use x = fixed expr' where the expression is an array, the address of a field, the address of an array element or a string' - /// (Originally from ..\FSComp.txt:1337) - static member tcFixedNotAllowed() = (3207, GetStringFunc("tcFixedNotAllowed",",,,") ) - /// Could not find method System.Runtime.CompilerServices.OffsetToStringData in references when building 'fixed' expression. - /// (Originally from ..\FSComp.txt:1338) - static member tcCouldNotFindOffsetToStringData() = (3208, GetStringFunc("tcCouldNotFindOffsetToStringData",",,,") ) - /// The address of the variable '%s' or a related expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - /// (Originally from ..\FSComp.txt:1339) - static member chkNoByrefAddressOfLocal(a0 : System.String) = (3209, GetStringFunc("chkNoByrefAddressOfLocal",",,,%s,,,") a0) - /// %s is an active pattern and cannot be treated as a discriminated union case with named fields. - /// (Originally from ..\FSComp.txt:1340) - static member tcNamedActivePattern(a0 : System.String) = (3210, GetStringFunc("tcNamedActivePattern",",,,%s,,,") a0) - /// The default value does not have the same type as the argument. The DefaultParameterValue attribute and any Optional attribute will be ignored. Note: 'null' needs to be annotated with the correct type, e.g. 'DefaultParameterValue(null:obj)'. - /// (Originally from ..\FSComp.txt:1341) - static member DefaultParameterValueNotAppropriateForArgument() = (3211, GetStringFunc("DefaultParameterValueNotAppropriateForArgument",",,,") ) - /// The system type '%s' was required but no referenced system DLL contained this type - /// (Originally from ..\FSComp.txt:1342) - static member tcGlobalsSystemTypeNotFound(a0 : System.String) = (GetStringFunc("tcGlobalsSystemTypeNotFound",",,,%s,,,") a0) - /// The member '%s' matches multiple overloads of the same method.\nPlease restrict it to one of the following:%s. - /// (Originally from ..\FSComp.txt:1343) - static member typrelMemberHasMultiplePossibleDispatchSlots(a0 : System.String, a1 : System.String) = (3213, GetStringFunc("typrelMemberHasMultiplePossibleDispatchSlots",",,,%s,,,%s,,,") a0 a1) - /// Method or object constructor '%s' is not static - /// (Originally from ..\FSComp.txt:1344) - static member methodIsNotStatic(a0 : System.String) = (3214, GetStringFunc("methodIsNotStatic",",,,%s,,,") a0) - /// Unexpected symbol '=' in expression. Did you intend to use 'for x in y .. z do' instead? - /// (Originally from ..\FSComp.txt:1345) - static member parsUnexpectedSymbolEqualsInsteadOfIn() = (3215, GetStringFunc("parsUnexpectedSymbolEqualsInsteadOfIn",",,,") ) - /// Two anonymous record types are from different assemblies '%s' and '%s' - /// (Originally from ..\FSComp.txt:1346) - static member tcAnonRecdCcuMismatch(a0 : System.String, a1 : System.String) = (GetStringFunc("tcAnonRecdCcuMismatch",",,,%s,,,%s,,,") a0 a1) - /// Two anonymous record types have mismatched sets of field names '%s' and '%s' - /// (Originally from ..\FSComp.txt:1347) - static member tcAnonRecdFieldNameMismatch(a0 : System.String, a1 : System.String) = (GetStringFunc("tcAnonRecdFieldNameMismatch",",,,%s,,,%s,,,") a0 a1) - /// Indicates a method that either has no implementation in the type in which it is declared or that is virtual and has a default implementation. - /// (Originally from ..\FSComp.txt:1348) - static member keywordDescriptionAbstract() = (GetStringFunc("keywordDescriptionAbstract",",,,") ) - /// Used in mutually recursive bindings, in property declarations, and with multiple constraints on generic parameters. - /// (Originally from ..\FSComp.txt:1349) - static member keyworkDescriptionAnd() = (GetStringFunc("keyworkDescriptionAnd",",,,") ) - /// Used to give the current class object an object name. Also used to give a name to a whole pattern within a pattern match. - /// (Originally from ..\FSComp.txt:1350) - static member keywordDescriptionAs() = (GetStringFunc("keywordDescriptionAs",",,,") ) - /// Used to verify code during debugging. - /// (Originally from ..\FSComp.txt:1351) - static member keywordDescriptionAssert() = (GetStringFunc("keywordDescriptionAssert",",,,") ) - /// Used as the name of the base class object. - /// (Originally from ..\FSComp.txt:1352) - static member keywordDescriptionBase() = (GetStringFunc("keywordDescriptionBase",",,,") ) - /// In verbose syntax, indicates the start of a code block. - /// (Originally from ..\FSComp.txt:1353) - static member keywordDescriptionBegin() = (GetStringFunc("keywordDescriptionBegin",",,,") ) - /// In verbose syntax, indicates the start of a class definition. - /// (Originally from ..\FSComp.txt:1354) - static member keywordDescriptionClass() = (GetStringFunc("keywordDescriptionClass",",,,") ) - /// Indicates an implementation of an abstract method; used together with an abstract method declaration to create a virtual method. - /// (Originally from ..\FSComp.txt:1355) - static member keywordDescriptionDefault() = (GetStringFunc("keywordDescriptionDefault",",,,") ) - /// Used to declare a delegate. - /// (Originally from ..\FSComp.txt:1356) - static member keywordDescriptionDelegate() = (GetStringFunc("keywordDescriptionDelegate",",,,") ) - /// Used in looping constructs or to execute imperative code. - /// (Originally from ..\FSComp.txt:1357) - static member keywordDescriptionDo() = (GetStringFunc("keywordDescriptionDo",",,,") ) - /// In verbose syntax, indicates the end of a block of code in a looping expression. - /// (Originally from ..\FSComp.txt:1358) - static member keywordDescriptionDone() = (GetStringFunc("keywordDescriptionDone",",,,") ) - /// Used to convert to a type that is lower in the inheritance chain. - /// (Originally from ..\FSComp.txt:1359) - static member keywordDescriptionDowncast() = (GetStringFunc("keywordDescriptionDowncast",",,,") ) - /// In a for expression, used when counting in reverse. - /// (Originally from ..\FSComp.txt:1360) - static member keywordDescriptionDownto() = (GetStringFunc("keywordDescriptionDownto",",,,") ) - /// Used in conditional branching. A short form of else if. - /// (Originally from ..\FSComp.txt:1361) - static member keywordDescriptionElif() = (GetStringFunc("keywordDescriptionElif",",,,") ) - /// Used in conditional branching. - /// (Originally from ..\FSComp.txt:1362) - static member keywordDescriptionElse() = (GetStringFunc("keywordDescriptionElse",",,,") ) - /// In type definitions and type extensions, indicates the end of a section of member definitions. In verbose syntax, used to specify the end of a code block that starts with the begin keyword. - /// (Originally from ..\FSComp.txt:1363) - static member keywordDescriptionEnd() = (GetStringFunc("keywordDescriptionEnd",",,,") ) - /// Used to declare an exception type. - /// (Originally from ..\FSComp.txt:1364) - static member keywordDescriptionException() = (GetStringFunc("keywordDescriptionException",",,,") ) - /// Indicates that a declared program element is defined in another binary or assembly. - /// (Originally from ..\FSComp.txt:1365) - static member keywordDescriptionExtern() = (GetStringFunc("keywordDescriptionExtern",",,,") ) - /// Used as a Boolean literal. - /// (Originally from ..\FSComp.txt:1366) - static member keywordDescriptionTrueFalse() = (GetStringFunc("keywordDescriptionTrueFalse",",,,") ) - /// Used together with try to introduce a block of code that executes regardless of whether an exception occurs. - /// (Originally from ..\FSComp.txt:1367) - static member keywordDescriptionFinally() = (GetStringFunc("keywordDescriptionFinally",",,,") ) - /// Used in looping constructs. - /// (Originally from ..\FSComp.txt:1368) - static member keywordDescriptionFor() = (GetStringFunc("keywordDescriptionFor",",,,") ) - /// Used in lambda expressions, also known as anonymous functions. - /// (Originally from ..\FSComp.txt:1369) - static member keywordDescriptionFun() = (GetStringFunc("keywordDescriptionFun",",,,") ) - /// Used as a shorter alternative to the fun keyword and a match expression in a lambda expression that has pattern matching on a single argument. - /// (Originally from ..\FSComp.txt:1370) - static member keywordDescriptionFunction() = (GetStringFunc("keywordDescriptionFunction",",,,") ) - /// Used to reference the top-level .NET namespace. - /// (Originally from ..\FSComp.txt:1371) - static member keywordDescriptionGlobal() = (GetStringFunc("keywordDescriptionGlobal",",,,") ) - /// Used in conditional branching constructs. - /// (Originally from ..\FSComp.txt:1372) - static member keywordDescriptionIf() = (GetStringFunc("keywordDescriptionIf",",,,") ) - /// Used for sequence expressions and, in verbose syntax, to separate expressions from bindings. - /// (Originally from ..\FSComp.txt:1373) - static member keywordDescriptionIn() = (GetStringFunc("keywordDescriptionIn",",,,") ) - /// Used to specify a base class or base interface. - /// (Originally from ..\FSComp.txt:1374) - static member keywordDescriptionInherit() = (GetStringFunc("keywordDescriptionInherit",",,,") ) - /// Used to indicate a function that should be integrated directly into the caller's code. - /// (Originally from ..\FSComp.txt:1375) - static member keywordDescriptionInline() = (GetStringFunc("keywordDescriptionInline",",,,") ) - /// Used to declare and implement interfaces. - /// (Originally from ..\FSComp.txt:1376) - static member keywordDescriptionInterface() = (GetStringFunc("keywordDescriptionInterface",",,,") ) - /// Used to specify that a member is visible inside an assembly but not outside it. - /// (Originally from ..\FSComp.txt:1377) - static member keywordDescriptionInternal() = (GetStringFunc("keywordDescriptionInternal",",,,") ) - /// Used to specify a computation that is to be performed only when a result is needed. - /// (Originally from ..\FSComp.txt:1378) - static member keywordDescriptionLazy() = (GetStringFunc("keywordDescriptionLazy",",,,") ) - /// Used to associate, or bind, a name to a value or function. - /// (Originally from ..\FSComp.txt:1379) - static member keywordDescriptionLet() = (GetStringFunc("keywordDescriptionLet",",,,") ) - /// Used in computation expressions to bind a name to the result of another computation expression. - /// (Originally from ..\FSComp.txt:1380) - static member keywordDescriptionLetBang() = (GetStringFunc("keywordDescriptionLetBang",",,,") ) - /// Used to branch by comparing a value to a pattern. - /// (Originally from ..\FSComp.txt:1381) - static member keywordDescriptionMatch() = (GetStringFunc("keywordDescriptionMatch",",,,") ) - /// Used in computation expressions to pattern match directly over the result of another computation expression. - /// (Originally from ..\FSComp.txt:1382) - static member keywordDescriptionMatchBang() = (GetStringFunc("keywordDescriptionMatchBang",",,,") ) - /// Used to declare a property or method in an object type. - /// (Originally from ..\FSComp.txt:1383) - static member keywordDescriptionMember() = (GetStringFunc("keywordDescriptionMember",",,,") ) - /// Used to associate a name with a group of related types, values, and functions, to logically separate it from other code. - /// (Originally from ..\FSComp.txt:1384) - static member keywordDescriptionModule() = (GetStringFunc("keywordDescriptionModule",",,,") ) - /// Used to declare a variable, that is, a value that can be changed. - /// (Originally from ..\FSComp.txt:1385) - static member keywordDescriptionMutable() = (GetStringFunc("keywordDescriptionMutable",",,,") ) - /// Used to associate a name with a group of related types and modules, to logically separate it from other code. - /// (Originally from ..\FSComp.txt:1386) - static member keywordDescriptionNamespace() = (GetStringFunc("keywordDescriptionNamespace",",,,") ) - /// Used to declare, define, or invoke a constructor that creates or that can create an object. Also used in generic parameter constraints to indicate that a type must have a certain constructor. - /// (Originally from ..\FSComp.txt:1387) - static member keywordDescriptionNew() = (GetStringFunc("keywordDescriptionNew",",,,") ) - /// Not actually a keyword. However, not struct in combination is used as a generic parameter constraint. - /// (Originally from ..\FSComp.txt:1388) - static member keywordDescriptionNot() = (GetStringFunc("keywordDescriptionNot",",,,") ) - /// Indicates the absence of an object. Also used in generic parameter constraints. - /// (Originally from ..\FSComp.txt:1389) - static member keywordDescriptionNull() = (GetStringFunc("keywordDescriptionNull",",,,") ) - /// Used in discriminated unions to indicate the type of categories of values, and in delegate and exception declarations. - /// (Originally from ..\FSComp.txt:1390) - static member keywordDescriptionOf() = (GetStringFunc("keywordDescriptionOf",",,,") ) - /// Used to make the contents of a namespace or module available without qualification. - /// (Originally from ..\FSComp.txt:1391) - static member keywordDescriptionOpen() = (GetStringFunc("keywordDescriptionOpen",",,,") ) - /// Used with Boolean conditions as a Boolean or operator. Equivalent to ||. Also used in member constraints. - /// (Originally from ..\FSComp.txt:1392) - static member keywordDescriptionOr() = (GetStringFunc("keywordDescriptionOr",",,,") ) - /// Used to implement a version of an abstract or virtual method that differs from the base version. - /// (Originally from ..\FSComp.txt:1393) - static member keywordDescriptionOverride() = (GetStringFunc("keywordDescriptionOverride",",,,") ) - /// Restricts access to a member to code in the same type or module. - /// (Originally from ..\FSComp.txt:1394) - static member keywordDescriptionPrivate() = (GetStringFunc("keywordDescriptionPrivate",",,,") ) - /// Allows access to a member from outside the type. - /// (Originally from ..\FSComp.txt:1395) - static member keywordDescriptionPublic() = (GetStringFunc("keywordDescriptionPublic",",,,") ) - /// Used to indicate that a function is recursive. - /// (Originally from ..\FSComp.txt:1396) - static member keywordDescriptionRec() = (GetStringFunc("keywordDescriptionRec",",,,") ) - /// Used to provide a value for the result of the containing computation expression. - /// (Originally from ..\FSComp.txt:1397) - static member keywordDescriptionReturn() = (GetStringFunc("keywordDescriptionReturn",",,,") ) - /// Used to provide a value for the result of the containing computation expression, where that value itself comes from the result another computation expression. - /// (Originally from ..\FSComp.txt:1398) - static member keywordDescriptionReturnBang() = (GetStringFunc("keywordDescriptionReturnBang",",,,") ) - /// Used in query expressions to specify what fields or columns to extract. Note that this is a contextual keyword, which means that it is not actually a reserved word and it only acts like a keyword in appropriate context. - /// (Originally from ..\FSComp.txt:1399) - static member keywordDescriptionSelect() = (GetStringFunc("keywordDescriptionSelect",",,,") ) - /// Used to indicate a method or property that can be called without an instance of a type, or a value member that is shared among all instances of a type. - /// (Originally from ..\FSComp.txt:1400) - static member keywordDescriptionStatic() = (GetStringFunc("keywordDescriptionStatic",",,,") ) - /// Used to declare a structure type. Also used in generic parameter constraints. Used for OCaml compatibility in module definitions. - /// (Originally from ..\FSComp.txt:1401) - static member keywordDescriptionStruct() = (GetStringFunc("keywordDescriptionStruct",",,,") ) - /// Used in conditional expressions. Also used to perform side effects after object construction. - /// (Originally from ..\FSComp.txt:1402) - static member keywordDescriptionThen() = (GetStringFunc("keywordDescriptionThen",",,,") ) - /// Used in for loops to indicate a range. - /// (Originally from ..\FSComp.txt:1403) - static member keywordDescriptionTo() = (GetStringFunc("keywordDescriptionTo",",,,") ) - /// Used to introduce a block of code that might generate an exception. Used together with with or finally. - /// (Originally from ..\FSComp.txt:1404) - static member keywordDescriptionTry() = (GetStringFunc("keywordDescriptionTry",",,,") ) - /// Used to declare a class, record, structure, discriminated union, enumeration type, unit of measure, or type abbreviation. - /// (Originally from ..\FSComp.txt:1405) - static member keywordDescriptionType() = (GetStringFunc("keywordDescriptionType",",,,") ) - /// Used to convert to a type that is higher in the inheritance chain. - /// (Originally from ..\FSComp.txt:1406) - static member keywordDescriptionUpcast() = (GetStringFunc("keywordDescriptionUpcast",",,,") ) - /// Used instead of let for values that implement IDisposable" - /// (Originally from ..\FSComp.txt:1407) - static member keywordDescriptionUse() = (GetStringFunc("keywordDescriptionUse",",,,") ) - /// Used instead of let! in computation expressions for computation expression results that implement IDisposable. - /// (Originally from ..\FSComp.txt:1408) - static member keywordDescriptionUseBang() = (GetStringFunc("keywordDescriptionUseBang",",,,") ) - /// Used in a signature to indicate a value, or in a type to declare a member, in limited situations. - /// (Originally from ..\FSComp.txt:1409) - static member keywordDescriptionVal() = (GetStringFunc("keywordDescriptionVal",",,,") ) - /// Indicates the .NET void type. Used when interoperating with other .NET languages. - /// (Originally from ..\FSComp.txt:1410) - static member keywordDescriptionVoid() = (GetStringFunc("keywordDescriptionVoid",",,,") ) - /// Used for Boolean conditions (when guards) on pattern matches and to introduce a constraint clause for a generic type parameter. - /// (Originally from ..\FSComp.txt:1411) - static member keywordDescriptionWhen() = (GetStringFunc("keywordDescriptionWhen",",,,") ) - /// Introduces a looping construct. - /// (Originally from ..\FSComp.txt:1412) - static member keywordDescriptionWhile() = (GetStringFunc("keywordDescriptionWhile",",,,") ) - /// Used together with the match keyword in pattern matching expressions. Also used in object expressions, record copying expressions, and type extensions to introduce member definitions, and to introduce exception handlers. - /// (Originally from ..\FSComp.txt:1413) - static member keywordDescriptionWith() = (GetStringFunc("keywordDescriptionWith",",,,") ) - /// Used in a sequence expression to produce a value for a sequence. - /// (Originally from ..\FSComp.txt:1414) - static member keywordDescriptionYield() = (GetStringFunc("keywordDescriptionYield",",,,") ) - /// Used in a computation expression to append the result of a given computation expression to a collection of results for the containing computation expression. - /// (Originally from ..\FSComp.txt:1415) - static member keywordDescriptionYieldBang() = (GetStringFunc("keywordDescriptionYieldBang",",,,") ) - /// In function types, delimits arguments and return values. Yields an expression (in sequence expressions); equivalent to the yield keyword. Used in match expressions - /// (Originally from ..\FSComp.txt:1416) - static member keywordDescriptionRightArrow() = (GetStringFunc("keywordDescriptionRightArrow",",,,") ) - /// Assigns a value to a variable. - /// (Originally from ..\FSComp.txt:1417) - static member keywordDescriptionLeftArrow() = (GetStringFunc("keywordDescriptionLeftArrow",",,,") ) - /// Converts a type to type that is higher in the hierarchy. - /// (Originally from ..\FSComp.txt:1418) - static member keywordDescriptionCast() = (GetStringFunc("keywordDescriptionCast",",,,") ) - /// Converts a type to a type that is lower in the hierarchy. - /// (Originally from ..\FSComp.txt:1419) - static member keywordDescriptionDynamicCast() = (GetStringFunc("keywordDescriptionDynamicCast",",,,") ) - /// Delimits a typed code quotation. - /// (Originally from ..\FSComp.txt:1420) - static member keywordDescriptionTypedQuotation() = (GetStringFunc("keywordDescriptionTypedQuotation",",,,") ) - /// Delimits a untyped code quotation. - /// (Originally from ..\FSComp.txt:1421) - static member keywordDescriptionUntypedQuotation() = (GetStringFunc("keywordDescriptionUntypedQuotation",",,,") ) - /// %s '%s' not found in assembly '%s'. A possible cause may be a version incompatibility. You may need to explicitly reference the correct version of this assembly to allow all referenced components to use the correct version. - /// (Originally from ..\FSComp.txt:1422) - static member itemNotFoundDuringDynamicCodeGen(a0 : System.String, a1 : System.String, a2 : System.String) = (3216, GetStringFunc("itemNotFoundDuringDynamicCodeGen",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// %s '%s' not found in type '%s' from assembly '%s'. A possible cause may be a version incompatibility. You may need to explicitly reference the correct version of this assembly to allow all referenced components to use the correct version. - /// (Originally from ..\FSComp.txt:1423) - static member itemNotFoundInTypeDuringDynamicCodeGen(a0 : System.String, a1 : System.String, a2 : System.String, a3 : System.String) = (3216, GetStringFunc("itemNotFoundInTypeDuringDynamicCodeGen",",,,%s,,,%s,,,%s,,,%s,,,") a0 a1 a2 a3) - /// is - /// (Originally from ..\FSComp.txt:1424) - static member descriptionWordIs() = (GetStringFunc("descriptionWordIs",",,,") ) - /// This value is not a function and cannot be applied. - /// (Originally from ..\FSComp.txt:1425) - static member notAFunction() = (GetStringFunc("notAFunction",",,,") ) - /// This value is not a function and cannot be applied. Did you intend to access the indexer via %s.[index] instead? - /// (Originally from ..\FSComp.txt:1426) - static member notAFunctionButMaybeIndexerWithName(a0 : System.String) = (GetStringFunc("notAFunctionButMaybeIndexerWithName",",,,%s,,,") a0) - /// This expression is not a function and cannot be applied. Did you intend to access the indexer via expr.[index] instead? - /// (Originally from ..\FSComp.txt:1427) - static member notAFunctionButMaybeIndexer() = (GetStringFunc("notAFunctionButMaybeIndexer",",,,") ) - /// - /// (Originally from ..\FSComp.txt:1428) - static member notAFunctionButMaybeIndexerErrorCode() = (3217, GetStringFunc("notAFunctionButMaybeIndexerErrorCode",",,,") ) - /// This value is not a function and cannot be applied. Did you forget to terminate a declaration? - /// (Originally from ..\FSComp.txt:1429) - static member notAFunctionButMaybeDeclaration() = (GetStringFunc("notAFunctionButMaybeDeclaration",",,,") ) - /// The argument names in the signature '%s' and implementation '%s' do not match. The argument name from the signature file will be used. This may cause problems when debugging or profiling. - /// (Originally from ..\FSComp.txt:1430) - static member ArgumentsInSigAndImplMismatch(a0 : System.String, a1 : System.String) = (3218, GetStringFunc("ArgumentsInSigAndImplMismatch",",,,%s,,,%s,,,") a0 a1) - /// 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. - /// (Originally from ..\FSComp.txt:1431) - static member pickleUnexpectedNonZero(a0 : System.String) = (3219, GetStringFunc("pickleUnexpectedNonZero",",,,%s,,,") a0) - /// This method or property is not normally used from F# code, use an explicit tuple pattern for deconstruction instead. - /// (Originally from ..\FSComp.txt:1432) - static member tcTupleMemberNotNormallyUsed() = (3220, GetStringFunc("tcTupleMemberNotNormallyUsed",",,,") ) - /// 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:1433) - static member implicitlyDiscardedInSequenceExpression(a0 : System.String) = (3221, GetStringFunc("implicitlyDiscardedInSequenceExpression",",,,%s,,,") a0) - /// 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:1434) - static member implicitlyDiscardedSequenceInSequenceExpression(a0 : System.String) = (3222, GetStringFunc("implicitlyDiscardedSequenceInSequenceExpression",",,,%s,,,") a0) - /// The file '%s' changed on disk unexpectedly, please reload. - /// (Originally from ..\FSComp.txt:1435) - static member ilreadFileChanged(a0 : System.String) = (3223, GetStringFunc("ilreadFileChanged",",,,%s,,,") a0) - /// The byref pointer is readonly, so this write is not permitted. - /// (Originally from ..\FSComp.txt:1436) - static member writeToReadOnlyByref() = (3224, GetStringFunc("writeToReadOnlyByref",",,,") ) - /// A ReadOnly attribute has been applied to a struct type with a mutable field. - /// (Originally from ..\FSComp.txt:1437) - static member readOnlyAttributeOnStructWithMutableField() = (3225, GetStringFunc("readOnlyAttributeOnStructWithMutableField",",,,") ) - /// A byref pointer returned by a function or method is implicitly dereferenced as of F# 4.5. To acquire the return value as a pointer, use the address-of operator, e.g. '&f(x)' or '&obj.Method(arg1, arg2)'. - /// (Originally from ..\FSComp.txt:1438) - static member tcByrefReturnImplicitlyDereferenced() = (3226, GetStringFunc("tcByrefReturnImplicitlyDereferenced",",,,") ) - /// A type annotated with IsByRefLike must also be a struct. Consider adding the [] attribute to the type. - /// (Originally from ..\FSComp.txt:1439) - static member tcByRefLikeNotStruct() = (3227, GetStringFunc("tcByRefLikeNotStruct",",,,") ) - /// The address of a value returned from the expression cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - /// (Originally from ..\FSComp.txt:1440) - static member chkNoByrefAddressOfValueFromExpression() = (3228, GetStringFunc("chkNoByrefAddressOfValueFromExpression",",,,") ) - /// This value can't be assigned because the target '%s' may refer to non-stack-local memory, while the expression being assigned is assessed to potentially refer to stack-local memory. This is to help prevent pointers to stack-bound memory escaping their scope. - /// (Originally from ..\FSComp.txt:1441) - static member chkNoWriteToLimitedSpan(a0 : System.String) = (3229, GetStringFunc("chkNoWriteToLimitedSpan",",,,%s,,,") a0) - /// A value defined in a module must be mutable in order to take its address, e.g. 'let mutable x = ...' - /// (Originally from ..\FSComp.txt:1442) - static member tastValueMustBeLocal() = (3230, GetStringFunc("tastValueMustBeLocal",",,,") ) - /// A type annotated with IsReadOnly must also be a struct. Consider adding the [] attribute to the type. - /// (Originally from ..\FSComp.txt:1443) - static member tcIsReadOnlyNotStruct() = (3231, GetStringFunc("tcIsReadOnlyNotStruct",",,,") ) - /// Struct members cannot return the address of fields of the struct by reference - /// (Originally from ..\FSComp.txt:1444) - static member chkStructsMayNotReturnAddressesOfContents() = (3232, GetStringFunc("chkStructsMayNotReturnAddressesOfContents",",,,") ) - /// The function or method call cannot be used at this point, because one argument that is a byref of a non-stack-local Span or IsByRefLike type is used with another argument that is a stack-local Span or IsByRefLike type. This is to ensure the address of the local value does not escape its scope. - /// (Originally from ..\FSComp.txt:1445) - static member chkNoByrefLikeFunctionCall() = (3233, GetStringFunc("chkNoByrefLikeFunctionCall",",,,") ) - /// The Span or IsByRefLike variable '%s' cannot be used at this point. This is to ensure the address of the local value does not escape its scope. - /// (Originally from ..\FSComp.txt:1446) - static member chkNoSpanLikeVariable(a0 : System.String) = (3234, GetStringFunc("chkNoSpanLikeVariable",",,,%s,,,") a0) - /// A Span or IsByRefLike value returned from the expression cannot be used at ths point. This is to ensure the address of the local value does not escape its scope. - /// (Originally from ..\FSComp.txt:1447) - static member chkNoSpanLikeValueFromExpression() = (3235, GetStringFunc("chkNoSpanLikeValueFromExpression",",,,") ) - /// Cannot take the address of the value returned from the expression. Assign the returned value to a let-bound value before taking the address. - /// (Originally from ..\FSComp.txt:1448) - static member tastCantTakeAddressOfExpression() = (3236, GetStringFunc("tastCantTakeAddressOfExpression",",,,") ) - /// Cannot call the byref extension method '%s. The first parameter requires the value to be mutable or a non-readonly byref type. - /// (Originally from ..\FSComp.txt:1449) - static member tcCannotCallExtensionMethodInrefToByref(a0 : System.String) = (3237, GetStringFunc("tcCannotCallExtensionMethodInrefToByref",",,,%s,,,") a0) - /// Byref types are not allowed to have optional type extensions. - /// (Originally from ..\FSComp.txt:1450) - static member tcByrefsMayNotHaveTypeExtensions() = (3238, GetStringFunc("tcByrefsMayNotHaveTypeExtensions",",,,") ) - /// Cannot partially apply the extension method '%s' because the first parameter is a byref type. - /// (Originally from ..\FSComp.txt:1451) - static member tcCannotPartiallyApplyExtensionMethodForByref(a0 : System.String) = (3239, GetStringFunc("tcCannotPartiallyApplyExtensionMethodForByref",",,,%s,,,") a0) - /// This type does not inherit Attribute, it will not work correctly with other .NET languages. - /// (Originally from ..\FSComp.txt:1452) - static member tcTypeDoesNotInheritAttribute() = (3242, GetStringFunc("tcTypeDoesNotInheritAttribute",",,,") ) - /// Invalid anonymous record expression - /// (Originally from ..\FSComp.txt:1453) - static member parsInvalidAnonRecdExpr() = (3243, GetStringFunc("parsInvalidAnonRecdExpr",",,,") ) - /// Invalid anonymous record type - /// (Originally from ..\FSComp.txt:1454) - static member parsInvalidAnonRecdType() = (3244, GetStringFunc("parsInvalidAnonRecdType",",,,") ) - /// The input to a copy-and-update expression that creates an anonymous record must be either an anonymous record or a record - /// (Originally from ..\FSComp.txt:1455) - static member tcCopyAndUpdateNeedsRecordType() = (3245, GetStringFunc("tcCopyAndUpdateNeedsRecordType",",,,") ) - /// The parameter '%s' has an invalid type '%s'. This is not permitted by the rules of Common IL. - /// (Originally from ..\FSComp.txt:1456) - static member chkInvalidFunctionParameterType(a0 : System.String, a1 : System.String) = (3300, GetStringFunc("chkInvalidFunctionParameterType",",,,%s,,,%s,,,") a0 a1) - /// The function or method has an invalid return type '%s'. This is not permitted by the rules of Common IL. - /// (Originally from ..\FSComp.txt:1457) - static member chkInvalidFunctionReturnType(a0 : System.String) = (3301, GetStringFunc("chkInvalidFunctionReturnType",",,,%s,,,") a0) - - /// Call this method once to validate that all known resources are valid; throws if not - static member RunStartupValidation() = - ignore(GetString("undefinedNameNamespace")) - ignore(GetString("undefinedNameNamespaceOrModule")) - ignore(GetString("undefinedNameFieldConstructorOrMember")) - ignore(GetString("undefinedNameValueConstructorNamespaceOrType")) - ignore(GetString("undefinedNameValueOfConstructor")) - ignore(GetString("undefinedNameValueNamespaceTypeOrModule")) - ignore(GetString("undefinedNameConstructorModuleOrNamespace")) - ignore(GetString("undefinedNameType")) - ignore(GetString("undefinedNameTypeIn")) - ignore(GetString("undefinedNameRecordLabelOrNamespace")) - ignore(GetString("undefinedNameRecordLabel")) - ignore(GetString("undefinedNameSuggestionsIntro")) - ignore(GetString("undefinedNameTypeParameter")) - ignore(GetString("undefinedNamePatternDiscriminator")) - ignore(GetString("replaceWithSuggestion")) - ignore(GetString("addIndexerDot")) - ignore(GetString("listElementHasWrongType")) - ignore(GetString("arrayElementHasWrongType")) - ignore(GetString("missingElseBranch")) - ignore(GetString("ifExpression")) - ignore(GetString("elseBranchHasWrongType")) - ignore(GetString("followingPatternMatchClauseHasWrongType")) - ignore(GetString("patternMatchGuardIsNotBool")) - ignore(GetString("commaInsteadOfSemicolonInRecord")) - ignore(GetString("derefInsteadOfNot")) - ignore(GetString("buildUnexpectedTypeArgs")) - ignore(GetString("returnUsedInsteadOfReturnBang")) - ignore(GetString("yieldUsedInsteadOfYieldBang")) - ignore(GetString("tupleRequiredInAbstractMethod")) - ignore(GetString("buildInvalidWarningNumber")) - ignore(GetString("buildInvalidVersionString")) - ignore(GetString("buildInvalidVersionFile")) - ignore(GetString("buildProductName")) - ignore(GetString("buildProductNameCommunity")) - ignore(GetString("buildProblemWithFilename")) - ignore(GetString("buildNoInputsSpecified")) - ignore(GetString("buildPdbRequiresDebug")) - ignore(GetString("buildInvalidSearchDirectory")) - ignore(GetString("buildSearchDirectoryNotFound")) - ignore(GetString("buildInvalidFilename")) - ignore(GetString("buildInvalidAssemblyName")) - ignore(GetString("buildInvalidPrivacy")) - ignore(GetString("buildMultipleReferencesNotAllowed")) - ignore(GetString("buildCouldNotReadVersionInfoFromMscorlib")) - ignore(GetString("buildCannotReadAssembly")) - ignore(GetString("buildAssemblyResolutionFailed")) - ignore(GetString("buildImplicitModuleIsNotLegalIdentifier")) - ignore(GetString("buildMultiFileRequiresNamespaceOrModule")) - ignore(GetString("noEqualSignAfterModule")) - ignore(GetString("buildMultipleToplevelModules")) - ignore(GetString("buildOptionRequiresParameter")) - ignore(GetString("buildCouldNotFindSourceFile")) - ignore(GetString("buildInvalidSourceFileExtension")) - ignore(GetString("buildCouldNotResolveAssembly")) - ignore(GetString("buildCouldNotResolveAssemblyRequiredByFile")) - ignore(GetString("buildErrorOpeningBinaryFile")) - ignore(GetString("buildDifferentVersionMustRecompile")) - ignore(GetString("buildInvalidHashIDirective")) - ignore(GetString("buildInvalidHashrDirective")) - ignore(GetString("buildInvalidHashloadDirective")) - ignore(GetString("buildInvalidHashtimeDirective")) - ignore(GetString("buildDirectivesInModulesAreIgnored")) - ignore(GetString("buildSignatureAlreadySpecified")) - ignore(GetString("buildImplementationAlreadyGivenDetail")) - ignore(GetString("buildImplementationAlreadyGiven")) - ignore(GetString("buildSignatureWithoutImplementation")) - ignore(GetString("buildArgInvalidInt")) - ignore(GetString("buildArgInvalidFloat")) - ignore(GetString("buildUnrecognizedOption")) - ignore(GetString("buildInvalidModuleOrNamespaceName")) - ignore(GetString("pickleErrorReadingWritingMetadata")) - ignore(GetString("tastTypeOrModuleNotConcrete")) - ignore(GetString("tastTypeHasAssemblyCodeRepresentation")) - ignore(GetString("tastNamespaceAndModuleWithSameNameInAssembly")) - ignore(GetString("tastTwoModulesWithSameNameInAssembly")) - ignore(GetString("tastDuplicateTypeDefinitionInAssembly")) - ignore(GetString("tastConflictingModuleAndTypeDefinitionInAssembly")) - ignore(GetString("tastInvalidMemberSignature")) - ignore(GetString("tastValueDoesNotHaveSetterType")) - ignore(GetString("tastInvalidFormForPropertyGetter")) - ignore(GetString("tastInvalidFormForPropertySetter")) - ignore(GetString("tastUnexpectedByRef")) - ignore(GetString("tastValueMustBeMutable")) - ignore(GetString("tastInvalidMutationOfConstant")) - ignore(GetString("tastValueHasBeenCopied")) - ignore(GetString("tastRecursiveValuesMayNotBeInConstructionOfTuple")) - ignore(GetString("tastRecursiveValuesMayNotAppearInConstructionOfType")) - ignore(GetString("tastRecursiveValuesMayNotBeAssignedToNonMutableField")) - ignore(GetString("tastUnexpectedDecodeOfAutoOpenAttribute")) - ignore(GetString("tastUnexpectedDecodeOfInternalsVisibleToAttribute")) - ignore(GetString("tastUnexpectedDecodeOfInterfaceDataVersionAttribute")) - ignore(GetString("tastActivePatternsLimitedToSeven")) - ignore(GetString("tastNotAConstantExpression")) - ignore(GetString("ValueNotContainedMutabilityAttributesDiffer")) - ignore(GetString("ValueNotContainedMutabilityNamesDiffer")) - ignore(GetString("ValueNotContainedMutabilityCompiledNamesDiffer")) - ignore(GetString("ValueNotContainedMutabilityDisplayNamesDiffer")) - ignore(GetString("ValueNotContainedMutabilityAccessibilityMore")) - ignore(GetString("ValueNotContainedMutabilityInlineFlagsDiffer")) - ignore(GetString("ValueNotContainedMutabilityLiteralConstantValuesDiffer")) - ignore(GetString("ValueNotContainedMutabilityOneIsTypeFunction")) - ignore(GetString("ValueNotContainedMutabilityParameterCountsDiffer")) - ignore(GetString("ValueNotContainedMutabilityTypesDiffer")) - ignore(GetString("ValueNotContainedMutabilityExtensionsDiffer")) - ignore(GetString("ValueNotContainedMutabilityArityNotInferred")) - ignore(GetString("ValueNotContainedMutabilityGenericParametersDiffer")) - ignore(GetString("ValueNotContainedMutabilityGenericParametersAreDifferentKinds")) - ignore(GetString("ValueNotContainedMutabilityAritiesDiffer")) - ignore(GetString("ValueNotContainedMutabilityDotNetNamesDiffer")) - ignore(GetString("ValueNotContainedMutabilityStaticsDiffer")) - ignore(GetString("ValueNotContainedMutabilityVirtualsDiffer")) - ignore(GetString("ValueNotContainedMutabilityAbstractsDiffer")) - ignore(GetString("ValueNotContainedMutabilityFinalsDiffer")) - ignore(GetString("ValueNotContainedMutabilityOverridesDiffer")) - ignore(GetString("ValueNotContainedMutabilityOneIsConstructor")) - ignore(GetString("ValueNotContainedMutabilityStaticButInstance")) - ignore(GetString("ValueNotContainedMutabilityInstanceButStatic")) - ignore(GetString("DefinitionsInSigAndImplNotCompatibleNamesDiffer")) - ignore(GetString("DefinitionsInSigAndImplNotCompatibleParameterCountsDiffer")) - ignore(GetString("DefinitionsInSigAndImplNotCompatibleAccessibilityDiffer")) - ignore(GetString("DefinitionsInSigAndImplNotCompatibleMissingInterface")) - ignore(GetString("DefinitionsInSigAndImplNotCompatibleImplementationSaysNull")) - ignore(GetString("DefinitionsInSigAndImplNotCompatibleImplementationSaysNull2")) - ignore(GetString("DefinitionsInSigAndImplNotCompatibleSignatureSaysNull")) - ignore(GetString("DefinitionsInSigAndImplNotCompatibleSignatureSaysNull2")) - ignore(GetString("DefinitionsInSigAndImplNotCompatibleImplementationSealed")) - ignore(GetString("DefinitionsInSigAndImplNotCompatibleImplementationIsNotSealed")) - ignore(GetString("DefinitionsInSigAndImplNotCompatibleImplementationIsAbstract")) - ignore(GetString("DefinitionsInSigAndImplNotCompatibleSignatureIsAbstract")) - ignore(GetString("DefinitionsInSigAndImplNotCompatibleTypesHaveDifferentBaseTypes")) - ignore(GetString("DefinitionsInSigAndImplNotCompatibleNumbersDiffer")) - ignore(GetString("DefinitionsInSigAndImplNotCompatibleSignatureDefinesButImplDoesNot")) - ignore(GetString("DefinitionsInSigAndImplNotCompatibleImplDefinesButSignatureDoesNot")) - ignore(GetString("DefinitionsInSigAndImplNotCompatibleImplDefinesStruct")) - ignore(GetString("DefinitionsInSigAndImplNotCompatibleDotNetTypeRepresentationIsHidden")) - ignore(GetString("DefinitionsInSigAndImplNotCompatibleTypeIsHidden")) - ignore(GetString("DefinitionsInSigAndImplNotCompatibleTypeIsDifferentKind")) - ignore(GetString("DefinitionsInSigAndImplNotCompatibleILDiffer")) - ignore(GetString("DefinitionsInSigAndImplNotCompatibleRepresentationsDiffer")) - ignore(GetString("DefinitionsInSigAndImplNotCompatibleFieldWasPresent")) - ignore(GetString("DefinitionsInSigAndImplNotCompatibleFieldOrderDiffer")) - ignore(GetString("DefinitionsInSigAndImplNotCompatibleFieldRequiredButNotSpecified")) - ignore(GetString("DefinitionsInSigAndImplNotCompatibleFieldIsInImplButNotSig")) - ignore(GetString("DefinitionsInSigAndImplNotCompatibleAbstractMemberMissingInImpl")) - ignore(GetString("DefinitionsInSigAndImplNotCompatibleAbstractMemberMissingInSig")) - ignore(GetString("DefinitionsInSigAndImplNotCompatibleSignatureDeclaresDiffer")) - ignore(GetString("DefinitionsInSigAndImplNotCompatibleAbbreviationsDiffer")) - ignore(GetString("DefinitionsInSigAndImplNotCompatibleAbbreviationHiddenBySig")) - ignore(GetString("DefinitionsInSigAndImplNotCompatibleSigHasAbbreviation")) - ignore(GetString("ModuleContainsConstructorButNamesDiffer")) - ignore(GetString("ModuleContainsConstructorButDataFieldsDiffer")) - ignore(GetString("ModuleContainsConstructorButTypesOfFieldsDiffer")) - ignore(GetString("ModuleContainsConstructorButAccessibilityDiffers")) - ignore(GetString("FieldNotContainedNamesDiffer")) - ignore(GetString("FieldNotContainedAccessibilitiesDiffer")) - ignore(GetString("FieldNotContainedStaticsDiffer")) - ignore(GetString("FieldNotContainedMutablesDiffer")) - ignore(GetString("FieldNotContainedLiteralsDiffer")) - ignore(GetString("FieldNotContainedTypesDiffer")) - ignore(GetString("typrelCannotResolveImplicitGenericInstantiation")) - ignore(GetString("typrelCannotResolveAmbiguityInPrintf")) - ignore(GetString("typrelCannotResolveAmbiguityInEnum")) - ignore(GetString("typrelCannotResolveAmbiguityInDelegate")) - ignore(GetString("typrelInvalidValue")) - ignore(GetString("typrelSigImplNotCompatibleParamCountsDiffer")) - ignore(GetString("typrelSigImplNotCompatibleCompileTimeRequirementsDiffer")) - ignore(GetString("typrelSigImplNotCompatibleConstraintsDiffer")) - ignore(GetString("typrelSigImplNotCompatibleConstraintsDifferRemove")) - ignore(GetString("typrelTypeImplementsIComparableShouldOverrideObjectEquals")) - ignore(GetString("typrelTypeImplementsIComparableDefaultObjectEqualsProvided")) - ignore(GetString("typrelExplicitImplementationOfGetHashCodeOrEquals")) - ignore(GetString("typrelExplicitImplementationOfGetHashCode")) - ignore(GetString("typrelExplicitImplementationOfEquals")) - ignore(GetString("ExceptionDefsNotCompatibleHiddenBySignature")) - ignore(GetString("ExceptionDefsNotCompatibleDotNetRepresentationsDiffer")) - ignore(GetString("ExceptionDefsNotCompatibleAbbreviationHiddenBySignature")) - ignore(GetString("ExceptionDefsNotCompatibleSignaturesDiffer")) - ignore(GetString("ExceptionDefsNotCompatibleExceptionDeclarationsDiffer")) - ignore(GetString("ExceptionDefsNotCompatibleFieldInSigButNotImpl")) - ignore(GetString("ExceptionDefsNotCompatibleFieldInImplButNotSig")) - ignore(GetString("ExceptionDefsNotCompatibleFieldOrderDiffers")) - ignore(GetString("typrelModuleNamespaceAttributesDifferInSigAndImpl")) - ignore(GetString("typrelMethodIsOverconstrained")) - ignore(GetString("typrelOverloadNotFound")) - ignore(GetString("typrelOverrideWasAmbiguous")) - ignore(GetString("typrelMoreThenOneOverride")) - ignore(GetString("typrelMethodIsSealed")) - ignore(GetString("typrelOverrideImplementsMoreThenOneSlot")) - ignore(GetString("typrelDuplicateInterface")) - ignore(GetString("typrelNeedExplicitImplementation")) - ignore(GetString("typrelNamedArgumentHasBeenAssignedMoreThenOnce")) - ignore(GetString("typrelNoImplementationGiven")) - ignore(GetString("typrelNoImplementationGivenWithSuggestion")) - ignore(GetString("typrelMemberDoesNotHaveCorrectNumberOfArguments")) - ignore(GetString("typrelMemberDoesNotHaveCorrectNumberOfTypeParameters")) - ignore(GetString("typrelMemberDoesNotHaveCorrectKindsOfGenericParameters")) - ignore(GetString("typrelMemberCannotImplement")) - ignore(GetString("astParseEmbeddedILError")) - ignore(GetString("astParseEmbeddedILTypeError")) - ignore(GetString("astDeprecatedIndexerNotation")) - ignore(GetString("astInvalidExprLeftHandOfAssignment")) - ignore(GetString("augNoRefEqualsOnStruct")) - ignore(GetString("augInvalidAttrs")) - ignore(GetString("augNoEqualityNeedsNoComparison")) - ignore(GetString("augStructCompNeedsStructEquality")) - ignore(GetString("augStructEqNeedsNoCompOrStructComp")) - ignore(GetString("augTypeCantHaveRefEqAndStructAttrs")) - ignore(GetString("augOnlyCertainTypesCanHaveAttrs")) - ignore(GetString("augRefEqCantHaveObjEquals")) - ignore(GetString("augCustomEqNeedsObjEquals")) - ignore(GetString("augCustomCompareNeedsIComp")) - ignore(GetString("augNoEqNeedsNoObjEquals")) - ignore(GetString("augNoCompCantImpIComp")) - ignore(GetString("augCustomEqNeedsNoCompOrCustomComp")) - ignore(GetString("forPositionalSpecifiersNotPermitted")) - ignore(GetString("forMissingFormatSpecifier")) - ignore(GetString("forFlagSetTwice")) - ignore(GetString("forPrefixFlagSpacePlusSetTwice")) - ignore(GetString("forHashSpecifierIsInvalid")) - ignore(GetString("forBadPrecision")) - ignore(GetString("forBadWidth")) - ignore(GetString("forDoesNotSupportZeroFlag")) - ignore(GetString("forPrecisionMissingAfterDot")) - ignore(GetString("forFormatDoesntSupportPrecision")) - ignore(GetString("forBadFormatSpecifier")) - ignore(GetString("forLIsUnnecessary")) - ignore(GetString("forHIsUnnecessary")) - ignore(GetString("forDoesNotSupportPrefixFlag")) - ignore(GetString("forBadFormatSpecifierGeneral")) - ignore(GetString("elSysEnvExitDidntExit")) - ignore(GetString("elDeprecatedOperator")) - ignore(GetString("chkProtectedOrBaseCalled")) - ignore(GetString("chkByrefUsedInInvalidWay")) - ignore(GetString("chkBaseUsedInInvalidWay")) - ignore(GetString("chkVariableUsedInInvalidWay")) - ignore(GetString("chkTypeLessAccessibleThanType")) - ignore(GetString("chkSystemVoidOnlyInTypeof")) - ignore(GetString("chkErrorUseOfByref")) - ignore(GetString("chkErrorContainsCallToRethrow")) - ignore(GetString("chkSplicingOnlyInQuotations")) - ignore(GetString("chkNoFirstClassSplicing")) - ignore(GetString("chkNoFirstClassAddressOf")) - ignore(GetString("chkNoFirstClassRethrow")) - ignore(GetString("chkNoByrefAtThisPoint")) - ignore(GetString("chkLimitationsOfBaseKeyword")) - ignore(GetString("chkObjCtorsCantUseExceptionHandling")) - ignore(GetString("chkNoAddressOfAtThisPoint")) - ignore(GetString("chkNoAddressStaticFieldAtThisPoint")) - ignore(GetString("chkNoAddressFieldAtThisPoint")) - ignore(GetString("chkNoAddressOfArrayElementAtThisPoint")) - ignore(GetString("chkFirstClassFuncNoByref")) - ignore(GetString("chkReturnTypeNoByref")) - ignore(GetString("chkInvalidCustAttrVal")) - ignore(GetString("chkAttrHasAllowMultiFalse")) - ignore(GetString("chkMemberUsedInInvalidWay")) - ignore(GetString("chkNoByrefAsTopValue")) - ignore(GetString("chkReflectedDefCantSplice")) - ignore(GetString("chkEntryPointUsage")) - ignore(GetString("chkUnionCaseCompiledForm")) - ignore(GetString("chkUnionCaseDefaultAugmentation")) - ignore(GetString("chkPropertySameNameMethod")) - ignore(GetString("chkGetterSetterDoNotMatchAbstract")) - ignore(GetString("chkPropertySameNameIndexer")) - ignore(GetString("chkCantStoreByrefValue")) - ignore(GetString("chkDuplicateMethod")) - ignore(GetString("chkDuplicateMethodWithSuffix")) - ignore(GetString("chkDuplicateMethodCurried")) - ignore(GetString("chkCurriedMethodsCantHaveOutParams")) - ignore(GetString("chkDuplicateProperty")) - ignore(GetString("chkDuplicatePropertyWithSuffix")) - ignore(GetString("chkDuplicateMethodInheritedType")) - ignore(GetString("chkDuplicateMethodInheritedTypeWithSuffix")) - ignore(GetString("chkMultipleGenericInterfaceInstantiations")) - ignore(GetString("chkValueWithDefaultValueMustHaveDefaultValue")) - ignore(GetString("chkNoByrefInTypeAbbrev")) - ignore(GetString("crefBoundVarUsedInSplice")) - ignore(GetString("crefQuotationsCantContainGenericExprs")) - ignore(GetString("crefQuotationsCantContainGenericFunctions")) - ignore(GetString("crefQuotationsCantContainObjExprs")) - ignore(GetString("crefQuotationsCantContainAddressOf")) - ignore(GetString("crefQuotationsCantContainStaticFieldRef")) - ignore(GetString("crefQuotationsCantContainInlineIL")) - ignore(GetString("crefQuotationsCantContainDescendingForLoops")) - ignore(GetString("crefQuotationsCantFetchUnionIndexes")) - ignore(GetString("crefQuotationsCantSetUnionFields")) - ignore(GetString("crefQuotationsCantSetExceptionFields")) - ignore(GetString("crefQuotationsCantRequireByref")) - ignore(GetString("crefQuotationsCantCallTraitMembers")) - ignore(GetString("crefQuotationsCantContainThisConstant")) - ignore(GetString("crefQuotationsCantContainThisPatternMatch")) - ignore(GetString("crefQuotationsCantContainArrayPatternMatching")) - ignore(GetString("crefQuotationsCantContainThisType")) - ignore(GetString("csTypeCannotBeResolvedAtCompileTime")) - ignore(GetString("csCodeLessGeneric")) - ignore(GetString("csTypeInferenceMaxDepth")) - ignore(GetString("csExpectedArguments")) - ignore(GetString("csIndexArgumentMismatch")) - ignore(GetString("csExpectTypeWithOperatorButGivenFunction")) - ignore(GetString("csExpectTypeWithOperatorButGivenTuple")) - ignore(GetString("csTypesDoNotSupportOperator")) - ignore(GetString("csTypeDoesNotSupportOperator")) - ignore(GetString("csTypesDoNotSupportOperatorNullable")) - ignore(GetString("csTypeDoesNotSupportOperatorNullable")) - ignore(GetString("csTypeDoesNotSupportConversion")) - ignore(GetString("csMethodFoundButIsStatic")) - ignore(GetString("csMethodFoundButIsNotStatic")) - ignore(GetString("csStructConstraintInconsistent")) - ignore(GetString("csTypeDoesNotHaveNull")) - ignore(GetString("csNullableTypeDoesNotHaveNull")) - ignore(GetString("csTypeDoesNotSupportComparison1")) - ignore(GetString("csTypeDoesNotSupportComparison2")) - ignore(GetString("csTypeDoesNotSupportComparison3")) - ignore(GetString("csTypeDoesNotSupportEquality1")) - ignore(GetString("csTypeDoesNotSupportEquality2")) - ignore(GetString("csTypeDoesNotSupportEquality3")) - ignore(GetString("csTypeIsNotEnumType")) - ignore(GetString("csTypeHasNonStandardDelegateType")) - ignore(GetString("csTypeIsNotDelegateType")) - ignore(GetString("csTypeParameterCannotBeNullable")) - ignore(GetString("csGenericConstructRequiresStructType")) - ignore(GetString("csGenericConstructRequiresUnmanagedType")) - ignore(GetString("csTypeNotCompatibleBecauseOfPrintf")) - ignore(GetString("csGenericConstructRequiresReferenceSemantics")) - ignore(GetString("csGenericConstructRequiresNonAbstract")) - ignore(GetString("csGenericConstructRequiresPublicDefaultConstructor")) - ignore(GetString("csTypeInstantiationLengthMismatch")) - ignore(GetString("csOptionalArgumentNotPermittedHere")) - ignore(GetString("csMemberIsNotStatic")) - ignore(GetString("csMemberIsNotInstance")) - ignore(GetString("csArgumentLengthMismatch")) - ignore(GetString("csArgumentTypesDoNotMatch")) - ignore(GetString("csMethodExpectsParams")) - ignore(GetString("csMemberIsNotAccessible")) - ignore(GetString("csMemberIsNotAccessible2")) - ignore(GetString("csMethodIsNotAStaticMethod")) - ignore(GetString("csMethodIsNotAnInstanceMethod")) - ignore(GetString("csMemberHasNoArgumentOrReturnProperty")) - ignore(GetString("csCtorHasNoArgumentOrReturnProperty")) - ignore(GetString("csRequiredSignatureIs")) - ignore(GetString("csMemberSignatureMismatch")) - ignore(GetString("csMemberSignatureMismatch2")) - ignore(GetString("csMemberSignatureMismatch3")) - ignore(GetString("csMemberSignatureMismatch4")) - ignore(GetString("csMemberSignatureMismatchArityNamed")) - ignore(GetString("csMemberSignatureMismatchArity")) - ignore(GetString("csCtorSignatureMismatchArity")) - ignore(GetString("csCtorSignatureMismatchArityProp")) - ignore(GetString("csMemberSignatureMismatchArityType")) - ignore(GetString("csMemberNotAccessible")) - ignore(GetString("csIncorrectGenericInstantiation")) - ignore(GetString("csMemberOverloadArityMismatch")) - ignore(GetString("csNoMemberTakesTheseArguments")) - ignore(GetString("csNoMemberTakesTheseArguments2")) - ignore(GetString("csNoMemberTakesTheseArguments3")) - ignore(GetString("csMethodNotFound")) - ignore(GetString("csNoOverloadsFound")) - ignore(GetString("csMethodIsOverloaded")) - ignore(GetString("csCandidates")) - ignore(GetString("csSeeAvailableOverloads")) - ignore(GetString("parsDoCannotHaveVisibilityDeclarations")) - ignore(GetString("parsEofInHashIf")) - ignore(GetString("parsEofInString")) - ignore(GetString("parsEofInVerbatimString")) - ignore(GetString("parsEofInComment")) - ignore(GetString("parsEofInStringInComment")) - ignore(GetString("parsEofInVerbatimStringInComment")) - ignore(GetString("parsEofInIfOcaml")) - ignore(GetString("parsEofInDirective")) - ignore(GetString("parsNoHashEndIfFound")) - ignore(GetString("parsAttributesIgnored")) - ignore(GetString("parsUseBindingsIllegalInImplicitClassConstructors")) - ignore(GetString("parsUseBindingsIllegalInModules")) - ignore(GetString("parsIntegerForLoopRequiresSimpleIdentifier")) - ignore(GetString("parsOnlyOneWithAugmentationAllowed")) - ignore(GetString("parsUnexpectedSemicolon")) - ignore(GetString("parsUnexpectedEndOfFile")) - ignore(GetString("parsUnexpectedVisibilityDeclaration")) - ignore(GetString("parsOnlyHashDirectivesAllowed")) - ignore(GetString("parsVisibilityDeclarationsShouldComePriorToIdentifier")) - ignore(GetString("parsNamespaceOrModuleNotBoth")) - ignore(GetString("parsModuleAbbreviationMustBeSimpleName")) - ignore(GetString("parsIgnoreAttributesOnModuleAbbreviation")) - ignore(GetString("parsIgnoreAttributesOnModuleAbbreviationAlwaysPrivate")) - ignore(GetString("parsIgnoreVisibilityOnModuleAbbreviationAlwaysPrivate")) - ignore(GetString("parsUnClosedBlockInHashLight")) - ignore(GetString("parsUnmatchedBeginOrStruct")) - ignore(GetString("parsModuleDefnMustBeSimpleName")) - ignore(GetString("parsUnexpectedEmptyModuleDefn")) - ignore(GetString("parsAttributesMustComeBeforeVal")) - ignore(GetString("parsAttributesAreNotPermittedOnInterfaceImplementations")) - ignore(GetString("parsSyntaxError")) - ignore(GetString("parsAugmentationsIllegalOnDelegateType")) - ignore(GetString("parsUnmatchedClassInterfaceOrStruct")) - ignore(GetString("parsEmptyTypeDefinition")) - ignore(GetString("parsUnmatchedWith")) - ignore(GetString("parsGetOrSetRequired")) - ignore(GetString("parsOnlyClassCanTakeValueArguments")) - ignore(GetString("parsUnmatchedBegin")) - ignore(GetString("parsInvalidDeclarationSyntax")) - ignore(GetString("parsGetAndOrSetRequired")) - ignore(GetString("parsTypeAnnotationsOnGetSet")) - ignore(GetString("parsGetterMustHaveAtLeastOneArgument")) - ignore(GetString("parsMultipleAccessibilitiesForGetSet")) - ignore(GetString("parsSetSyntax")) - ignore(GetString("parsInterfacesHaveSameVisibilityAsEnclosingType")) - ignore(GetString("parsAccessibilityModsIllegalForAbstract")) - ignore(GetString("parsAttributesIllegalOnInherit")) - ignore(GetString("parsVisibilityIllegalOnInherit")) - ignore(GetString("parsInheritDeclarationsCannotHaveAsBindings")) - ignore(GetString("parsAttributesIllegalHere")) - ignore(GetString("parsTypeAbbreviationsCannotHaveVisibilityDeclarations")) - ignore(GetString("parsEnumTypesCannotHaveVisibilityDeclarations")) - ignore(GetString("parsAllEnumFieldsRequireValues")) - ignore(GetString("parsInlineAssemblyCannotHaveVisibilityDeclarations")) - ignore(GetString("parsUnexpectedIdentifier")) - ignore(GetString("parsUnionCasesCannotHaveVisibilityDeclarations")) - ignore(GetString("parsEnumFieldsCannotHaveVisibilityDeclarations")) - ignore(GetString("parsConsiderUsingSeparateRecordType")) - ignore(GetString("parsRecordFieldsCannotHaveVisibilityDeclarations")) - ignore(GetString("parsLetAndForNonRecBindings")) - ignore(GetString("parsUnmatchedParen")) - ignore(GetString("parsSuccessivePatternsShouldBeSpacedOrTupled")) - ignore(GetString("parsNoMatchingInForLet")) - ignore(GetString("parsErrorInReturnForLetIncorrectIndentation")) - ignore(GetString("parsExpectedExpressionAfterLet")) - ignore(GetString("parsIncompleteIf")) - ignore(GetString("parsAssertIsNotFirstClassValue")) - ignore(GetString("parsIdentifierExpected")) - ignore(GetString("parsInOrEqualExpected")) - ignore(GetString("parsArrowUseIsLimited")) - ignore(GetString("parsSuccessiveArgsShouldBeSpacedOrTupled")) - ignore(GetString("parsUnmatchedBracket")) - ignore(GetString("parsMissingQualificationAfterDot")) - ignore(GetString("parsParenFormIsForML")) - ignore(GetString("parsMismatchedQuote")) - ignore(GetString("parsUnmatched")) - ignore(GetString("parsUnmatchedBracketBar")) - ignore(GetString("parsUnmatchedBrace")) - ignore(GetString("parsUnmatchedBraceBar")) - ignore(GetString("parsFieldBinding")) - ignore(GetString("parsMemberIllegalInObjectImplementation")) - ignore(GetString("parsMissingFunctionBody")) - ignore(GetString("parsSyntaxErrorInLabeledType")) - ignore(GetString("parsUnexpectedInfixOperator")) - ignore(GetString("parsMultiArgumentGenericTypeFormDeprecated")) - ignore(GetString("parsInvalidLiteralInType")) - ignore(GetString("parsUnexpectedOperatorForUnitOfMeasure")) - ignore(GetString("parsUnexpectedIntegerLiteralForUnitOfMeasure")) - ignore(GetString("parsUnexpectedTypeParameter")) - ignore(GetString("parsMismatchedQuotationName")) - ignore(GetString("parsActivePatternCaseMustBeginWithUpperCase")) - ignore(GetString("parsActivePatternCaseContainsPipe")) - ignore(GetString("parsIllegalDenominatorForMeasureExponent")) - ignore(GetString("parsNoEqualShouldFollowNamespace")) - ignore(GetString("parsSyntaxModuleStructEndDeprecated")) - ignore(GetString("parsSyntaxModuleSigEndDeprecated")) - ignore(GetString("tcStaticFieldUsedWhenInstanceFieldExpected")) - ignore(GetString("tcMethodNotAccessible")) - ignore(GetString("tcImplicitMeasureFollowingSlash")) - ignore(GetString("tcUnexpectedMeasureAnon")) - ignore(GetString("tcNonZeroConstantCannotHaveGenericUnit")) - ignore(GetString("tcSeqResultsUseYield")) - ignore(GetString("tcUnexpectedBigRationalConstant")) - ignore(GetString("tcInvalidTypeForUnitsOfMeasure")) - ignore(GetString("tcUnexpectedConstUint16Array")) - ignore(GetString("tcUnexpectedConstByteArray")) - ignore(GetString("tcParameterRequiresName")) - ignore(GetString("tcReturnValuesCannotHaveNames")) - ignore(GetString("tcMemberKindPropertyGetSetNotExpected")) - ignore(GetString("tcNamespaceCannotContainValues")) - ignore(GetString("tcNamespaceCannotContainExtensionMembers")) - ignore(GetString("tcMultipleVisibilityAttributes")) - ignore(GetString("tcMultipleVisibilityAttributesWithLet")) - ignore(GetString("tcInvalidMethodNameForRelationalOperator")) - ignore(GetString("tcInvalidMethodNameForEquality")) - ignore(GetString("tcInvalidMemberName")) - ignore(GetString("tcInvalidMemberNameFixedTypes")) - ignore(GetString("tcInvalidOperatorDefinitionRelational")) - ignore(GetString("tcInvalidOperatorDefinitionEquality")) - ignore(GetString("tcInvalidOperatorDefinition")) - ignore(GetString("tcInvalidIndexOperatorDefinition")) - ignore(GetString("tcExpectModuleOrNamespaceParent")) - ignore(GetString("tcImplementsIComparableExplicitly")) - ignore(GetString("tcImplementsGenericIComparableExplicitly")) - ignore(GetString("tcImplementsIStructuralComparableExplicitly")) - ignore(GetString("tcRecordFieldInconsistentTypes")) - ignore(GetString("tcDllImportStubsCannotBeInlined")) - ignore(GetString("tcStructsCanOnlyBindThisAtMemberDeclaration")) - ignore(GetString("tcUnexpectedExprAtRecInfPoint")) - ignore(GetString("tcLessGenericBecauseOfAnnotation")) - ignore(GetString("tcConstrainedTypeVariableCannotBeGeneralized")) - ignore(GetString("tcGenericParameterHasBeenConstrained")) - ignore(GetString("tcTypeParameterHasBeenConstrained")) - ignore(GetString("tcTypeParametersInferredAreNotStable")) - ignore(GetString("tcExplicitTypeParameterInvalid")) - ignore(GetString("tcOverridingMethodRequiresAllOrNoTypeParameters")) - ignore(GetString("tcFieldsDoNotDetermineUniqueRecordType")) - ignore(GetString("tcFieldAppearsTwiceInRecord")) - ignore(GetString("tcUnknownUnion")) - ignore(GetString("tcNotSufficientlyGenericBecauseOfScope")) - ignore(GetString("tcPropertyRequiresExplicitTypeParameters")) - ignore(GetString("tcConstructorCannotHaveTypeParameters")) - ignore(GetString("tcInstanceMemberRequiresTarget")) - ignore(GetString("tcUnexpectedPropertyInSyntaxTree")) - ignore(GetString("tcStaticInitializerRequiresArgument")) - ignore(GetString("tcObjectConstructorRequiresArgument")) - ignore(GetString("tcStaticMemberShouldNotHaveThis")) - ignore(GetString("tcExplicitStaticInitializerSyntax")) - ignore(GetString("tcExplicitObjectConstructorSyntax")) - ignore(GetString("tcUnexpectedPropertySpec")) - ignore(GetString("tcObjectExpressionFormDeprecated")) - ignore(GetString("tcInvalidDeclaration")) - ignore(GetString("tcAttributesInvalidInPatterns")) - ignore(GetString("tcFunctionRequiresExplicitTypeArguments")) - ignore(GetString("tcDoesNotAllowExplicitTypeArguments")) - ignore(GetString("tcTypeParameterArityMismatch")) - ignore(GetString("tcDefaultStructConstructorCall")) - ignore(GetString("tcCouldNotFindIDisposable")) - ignore(GetString("tcNonLiteralCannotBeUsedInPattern")) - ignore(GetString("tcFieldIsReadonly")) - ignore(GetString("tcNameArgumentsMustAppearLast")) - ignore(GetString("tcFunctionRequiresExplicitLambda")) - ignore(GetString("tcTypeCannotBeEnumerated")) - ignore(GetString("tcInvalidMixtureOfRecursiveForms")) - ignore(GetString("tcInvalidObjectConstructionExpression")) - ignore(GetString("tcInvalidConstraint")) - ignore(GetString("tcInvalidConstraintTypeSealed")) - ignore(GetString("tcInvalidEnumConstraint")) - ignore(GetString("tcInvalidNewConstraint")) - ignore(GetString("tcInvalidPropertyType")) - ignore(GetString("tcExpectedUnitOfMeasureMarkWithAttribute")) - ignore(GetString("tcExpectedTypeParameter")) - ignore(GetString("tcExpectedTypeNotUnitOfMeasure")) - ignore(GetString("tcExpectedUnitOfMeasureNotType")) - ignore(GetString("tcInvalidUnitsOfMeasurePrefix")) - ignore(GetString("tcUnitsOfMeasureInvalidInTypeConstructor")) - ignore(GetString("tcRequireBuilderMethod")) - ignore(GetString("tcTypeHasNoNestedTypes")) - ignore(GetString("tcUnexpectedSymbolInTypeExpression")) - ignore(GetString("tcTypeParameterInvalidAsTypeConstructor")) - ignore(GetString("tcIllegalSyntaxInTypeExpression")) - ignore(GetString("tcAnonymousUnitsOfMeasureCannotBeNested")) - ignore(GetString("tcAnonymousTypeInvalidInDeclaration")) - ignore(GetString("tcUnexpectedSlashInType")) - ignore(GetString("tcUnexpectedTypeArguments")) - ignore(GetString("tcOptionalArgsOnlyOnMembers")) - ignore(GetString("tcNameNotBoundInPattern")) - ignore(GetString("tcInvalidNonPrimitiveLiteralInPatternMatch")) - ignore(GetString("tcInvalidTypeArgumentUsage")) - ignore(GetString("tcRequireActivePatternWithOneResult")) - ignore(GetString("tcInvalidArgForParameterizedPattern")) - ignore(GetString("tcInvalidIndexIntoActivePatternArray")) - ignore(GetString("tcUnionCaseDoesNotTakeArguments")) - ignore(GetString("tcUnionCaseRequiresOneArgument")) - ignore(GetString("tcUnionCaseExpectsTupledArguments")) - ignore(GetString("tcFieldIsNotStatic")) - ignore(GetString("tcFieldNotLiteralCannotBeUsedInPattern")) - ignore(GetString("tcRequireVarConstRecogOrLiteral")) - ignore(GetString("tcInvalidPattern")) - ignore(GetString("tcUseWhenPatternGuard")) - ignore(GetString("tcIllegalPattern")) - ignore(GetString("tcSyntaxErrorUnexpectedQMark")) - ignore(GetString("tcExpressionCountMisMatch")) - ignore(GetString("tcExprUndelayed")) - ignore(GetString("tcExpressionRequiresSequence")) - ignore(GetString("tcInvalidObjectExpressionSyntaxForm")) - ignore(GetString("tcInvalidObjectSequenceOrRecordExpression")) - ignore(GetString("tcInvalidSequenceExpressionSyntaxForm")) - ignore(GetString("tcExpressionWithIfRequiresParenthesis")) - ignore(GetString("tcUnableToParseFormatString")) - ignore(GetString("tcListLiteralMaxSize")) - ignore(GetString("tcExpressionFormRequiresObjectConstructor")) - ignore(GetString("tcNamedArgumentsCannotBeUsedInMemberTraits")) - ignore(GetString("tcNotValidEnumCaseName")) - ignore(GetString("tcFieldIsNotMutable")) - ignore(GetString("tcConstructRequiresListArrayOrSequence")) - ignore(GetString("tcConstructRequiresComputationExpressions")) - ignore(GetString("tcConstructRequiresSequenceOrComputations")) - ignore(GetString("tcConstructRequiresComputationExpression")) - ignore(GetString("tcInvalidIndexerExpression")) - ignore(GetString("tcObjectOfIndeterminateTypeUsedRequireTypeConstraint")) - ignore(GetString("tcCannotInheritFromVariableType")) - ignore(GetString("tcObjectConstructorsOnTypeParametersCannotTakeArguments")) - ignore(GetString("tcCompiledNameAttributeMisused")) - ignore(GetString("tcNamedTypeRequired")) - ignore(GetString("tcInheritCannotBeUsedOnInterfaceType")) - ignore(GetString("tcNewCannotBeUsedOnInterfaceType")) - ignore(GetString("tcAbstractTypeCannotBeInstantiated")) - ignore(GetString("tcIDisposableTypeShouldUseNew")) - ignore(GetString("tcSyntaxCanOnlyBeUsedToCreateObjectTypes")) - ignore(GetString("tcConstructorRequiresCall")) - ignore(GetString("tcUndefinedField")) - ignore(GetString("tcFieldRequiresAssignment")) - ignore(GetString("tcExtraneousFieldsGivenValues")) - ignore(GetString("tcObjectExpressionsCanOnlyOverrideAbstractOrVirtual")) - ignore(GetString("tcNoAbstractOrVirtualMemberFound")) - ignore(GetString("tcMemberFoundIsNotAbstractOrVirtual")) - ignore(GetString("tcArgumentArityMismatch")) - ignore(GetString("tcArgumentArityMismatchOneOverload")) - ignore(GetString("tcSimpleMethodNameRequired")) - ignore(GetString("tcPredefinedTypeCannotBeUsedAsSuperType")) - ignore(GetString("tcNewMustBeUsedWithNamedType")) - ignore(GetString("tcCannotCreateExtensionOfSealedType")) - ignore(GetString("tcNoArgumentsForRecordValue")) - ignore(GetString("tcNoInterfaceImplementationForConstructionExpression")) - ignore(GetString("tcObjectConstructionCanOnlyBeUsedInClassTypes")) - ignore(GetString("tcOnlySimpleBindingsCanBeUsedInConstructionExpressions")) - ignore(GetString("tcObjectsMustBeInitializedWithObjectExpression")) - ignore(GetString("tcExpectedInterfaceType")) - ignore(GetString("tcConstructorForInterfacesDoNotTakeArguments")) - ignore(GetString("tcConstructorRequiresArguments")) - ignore(GetString("tcNewRequiresObjectConstructor")) - ignore(GetString("tcAtLeastOneOverrideIsInvalid")) - ignore(GetString("tcNumericLiteralRequiresModule")) - ignore(GetString("tcInvalidRecordConstruction")) - ignore(GetString("tcExpressionFormRequiresRecordTypes")) - ignore(GetString("tcInheritedTypeIsNotObjectModelType")) - ignore(GetString("tcObjectConstructionExpressionCanOnlyImplementConstructorsInObjectModelTypes")) - ignore(GetString("tcEmptyRecordInvalid")) - ignore(GetString("tcTypeIsNotARecordTypeNeedConstructor")) - ignore(GetString("tcTypeIsNotARecordType")) - ignore(GetString("tcConstructIsAmbiguousInComputationExpression")) - ignore(GetString("tcConstructIsAmbiguousInSequenceExpression")) - ignore(GetString("tcDoBangIllegalInSequenceExpression")) - ignore(GetString("tcUseForInSequenceExpression")) - ignore(GetString("tcTryIllegalInSequenceExpression")) - ignore(GetString("tcUseYieldBangForMultipleResults")) - ignore(GetString("tcInvalidAssignment")) - ignore(GetString("tcInvalidUseOfTypeName")) - ignore(GetString("tcTypeHasNoAccessibleConstructor")) - ignore(GetString("tcInvalidUseOfInterfaceType")) - ignore(GetString("tcInvalidUseOfDelegate")) - ignore(GetString("tcPropertyIsNotStatic")) - ignore(GetString("tcPropertyIsNotReadable")) - ignore(GetString("tcLookupMayNotBeUsedHere")) - ignore(GetString("tcPropertyIsStatic")) - ignore(GetString("tcPropertyCannotBeSet1")) - ignore(GetString("tcConstructorsCannotBeFirstClassValues")) - ignore(GetString("tcSyntaxFormUsedOnlyWithRecordLabelsPropertiesAndFields")) - ignore(GetString("tcEventIsStatic")) - ignore(GetString("tcEventIsNotStatic")) - ignore(GetString("tcNamedArgumentDidNotMatch")) - ignore(GetString("tcOverloadsCannotHaveCurriedArguments")) - ignore(GetString("tcUnnamedArgumentsDoNotFormPrefix")) - ignore(GetString("tcStaticOptimizationConditionalsOnlyForFSharpLibrary")) - ignore(GetString("tcFormalArgumentIsNotOptional")) - ignore(GetString("tcInvalidOptionalAssignmentToPropertyOrField")) - ignore(GetString("tcDelegateConstructorMustBePassed")) - ignore(GetString("tcBindingCannotBeUseAndRec")) - ignore(GetString("tcVolatileOnlyOnClassLetBindings")) - ignore(GetString("tcAttributesAreNotPermittedOnLetBindings")) - ignore(GetString("tcDefaultValueAttributeRequiresVal")) - ignore(GetString("tcConditionalAttributeRequiresMembers")) - ignore(GetString("tcInvalidActivePatternName")) - ignore(GetString("tcEntryPointAttributeRequiresFunctionInModule")) - ignore(GetString("tcMutableValuesCannotBeInline")) - ignore(GetString("tcMutableValuesMayNotHaveGenericParameters")) - ignore(GetString("tcMutableValuesSyntax")) - ignore(GetString("tcOnlyFunctionsCanBeInline")) - ignore(GetString("tcIllegalAttributesForLiteral")) - ignore(GetString("tcLiteralCannotBeMutable")) - ignore(GetString("tcLiteralCannotBeInline")) - ignore(GetString("tcLiteralCannotHaveGenericParameters")) - ignore(GetString("tcInvalidConstantExpression")) - ignore(GetString("tcTypeIsInaccessible")) - ignore(GetString("tcUnexpectedConditionInImportedAssembly")) - ignore(GetString("tcUnrecognizedAttributeTarget")) - ignore(GetString("tcAttributeIsNotValidForLanguageElementUseDo")) - ignore(GetString("tcAttributeIsNotValidForLanguageElement")) - ignore(GetString("tcOptionalArgumentsCannotBeUsedInCustomAttribute")) - ignore(GetString("tcPropertyCannotBeSet0")) - ignore(GetString("tcPropertyOrFieldNotFoundInAttribute")) - ignore(GetString("tcCustomAttributeMustBeReferenceType")) - ignore(GetString("tcCustomAttributeArgumentMismatch")) - ignore(GetString("tcCustomAttributeMustInvokeConstructor")) - ignore(GetString("tcAttributeExpressionsMustBeConstructorCalls")) - ignore(GetString("tcUnsupportedAttribute")) - ignore(GetString("tcInvalidInlineSpecification")) - ignore(GetString("tcInvalidUseBinding")) - ignore(GetString("tcAbstractMembersIllegalInAugmentation")) - ignore(GetString("tcMethodOverridesIllegalHere")) - ignore(GetString("tcNoMemberFoundForOverride")) - ignore(GetString("tcOverrideArityMismatch")) - ignore(GetString("tcDefaultImplementationAlreadyExists")) - ignore(GetString("tcDefaultAmbiguous")) - ignore(GetString("tcNoPropertyFoundForOverride")) - ignore(GetString("tcAbstractPropertyMissingGetOrSet")) - ignore(GetString("tcInvalidSignatureForSet")) - ignore(GetString("tcNewMemberHidesAbstractMember")) - ignore(GetString("tcNewMemberHidesAbstractMemberWithSuffix")) - ignore(GetString("tcStaticInitializersIllegalInInterface")) - ignore(GetString("tcObjectConstructorsIllegalInInterface")) - ignore(GetString("tcMemberOverridesIllegalInInterface")) - ignore(GetString("tcConcreteMembersIllegalInInterface")) - ignore(GetString("tcConstructorsDisallowedInExceptionAugmentation")) - ignore(GetString("tcStructsCannotHaveConstructorWithNoArguments")) - ignore(GetString("tcConstructorsIllegalForThisType")) - ignore(GetString("tcRecursiveBindingsWithMembersMustBeDirectAugmentation")) - ignore(GetString("tcOnlySimplePatternsInLetRec")) - ignore(GetString("tcOnlyRecordFieldsAndSimpleLetCanBeMutable")) - ignore(GetString("tcMemberIsNotSufficientlyGeneric")) - ignore(GetString("tcLiteralAttributeRequiresConstantValue")) - ignore(GetString("tcValueInSignatureRequiresLiteralAttribute")) - ignore(GetString("tcThreadStaticAndContextStaticMustBeStatic")) - ignore(GetString("tcVolatileFieldsMustBeMutable")) - ignore(GetString("tcUninitializedValFieldsMustBeMutable")) - ignore(GetString("tcStaticValFieldsMustBeMutableAndPrivate")) - ignore(GetString("tcFieldRequiresName")) - ignore(GetString("tcInvalidNamespaceModuleTypeUnionName")) - ignore(GetString("tcIllegalFormForExplicitTypeDeclaration")) - ignore(GetString("tcReturnTypesForUnionMustBeSameAsType")) - ignore(GetString("tcInvalidEnumerationLiteral")) - ignore(GetString("tcTypeIsNotInterfaceType1")) - ignore(GetString("tcDuplicateSpecOfInterface")) - ignore(GetString("tcFieldValIllegalHere")) - ignore(GetString("tcInheritIllegalHere")) - ignore(GetString("tcModuleRequiresQualifiedAccess")) - ignore(GetString("tcOpenUsedWithPartiallyQualifiedPath")) - ignore(GetString("tcLocalClassBindingsCannotBeInline")) - ignore(GetString("tcTypeAbbreviationsMayNotHaveMembers")) - ignore(GetString("tcTypeAbbreviationsCheckedAtCompileTime")) - ignore(GetString("tcEnumerationsMayNotHaveMembers")) - ignore(GetString("tcMeasureDeclarationsRequireStaticMembers")) - ignore(GetString("tcStructsMayNotContainDoBindings")) - ignore(GetString("tcStructsMayNotContainLetBindings")) - ignore(GetString("tcStaticLetBindingsRequireClassesWithImplicitConstructors")) - ignore(GetString("tcMeasureDeclarationsRequireStaticMembersNotConstructors")) - ignore(GetString("tcMemberAndLocalClassBindingHaveSameName")) - ignore(GetString("tcTypeAbbreviationsCannotHaveInterfaceDeclaration")) - ignore(GetString("tcEnumerationsCannotHaveInterfaceDeclaration")) - ignore(GetString("tcTypeIsNotInterfaceType0")) - ignore(GetString("tcAllImplementedInterfacesShouldBeDeclared")) - ignore(GetString("tcDefaultImplementationForInterfaceHasAlreadyBeenAdded")) - ignore(GetString("tcMemberNotPermittedInInterfaceImplementation")) - ignore(GetString("tcDeclarationElementNotPermittedInAugmentation")) - ignore(GetString("tcTypesCannotContainNestedTypes")) - ignore(GetString("tcTypeExceptionOrModule")) - ignore(GetString("tcTypeOrModule")) - ignore(GetString("tcImplementsIStructuralEquatableExplicitly")) - ignore(GetString("tcImplementsIEquatableExplicitly")) - ignore(GetString("tcExplicitTypeSpecificationCannotBeUsedForExceptionConstructors")) - ignore(GetString("tcExceptionAbbreviationsShouldNotHaveArgumentList")) - ignore(GetString("tcAbbreviationsFordotNetExceptionsCannotTakeArguments")) - ignore(GetString("tcExceptionAbbreviationsMustReferToValidExceptions")) - ignore(GetString("tcAbbreviationsFordotNetExceptionsMustHaveMatchingObjectConstructor")) - ignore(GetString("tcNotAnException")) - ignore(GetString("tcInvalidModuleName")) - ignore(GetString("tcInvalidTypeExtension")) - ignore(GetString("tcAttributesOfTypeSpecifyMultipleKindsForType")) - ignore(GetString("tcKindOfTypeSpecifiedDoesNotMatchDefinition")) - ignore(GetString("tcMeasureDefinitionsCannotHaveTypeParameters")) - ignore(GetString("tcTypeRequiresDefinition")) - ignore(GetString("tcTypeAbbreviationHasTypeParametersMissingOnType")) - ignore(GetString("tcStructsInterfacesEnumsDelegatesMayNotInheritFromOtherTypes")) - ignore(GetString("tcTypesCannotInheritFromMultipleConcreteTypes")) - ignore(GetString("tcRecordsUnionsAbbreviationsStructsMayNotHaveAllowNullLiteralAttribute")) - ignore(GetString("tcAllowNullTypesMayOnlyInheritFromAllowNullTypes")) - ignore(GetString("tcGenericTypesCannotHaveStructLayout")) - ignore(GetString("tcOnlyStructsCanHaveStructLayout")) - ignore(GetString("tcRepresentationOfTypeHiddenBySignature")) - ignore(GetString("tcOnlyClassesCanHaveAbstract")) - ignore(GetString("tcOnlyTypesRepresentingUnitsOfMeasureCanHaveMeasure")) - ignore(GetString("tcOverridesCannotHaveVisibilityDeclarations")) - ignore(GetString("tcTypesAreAlwaysSealedDU")) - ignore(GetString("tcTypesAreAlwaysSealedRecord")) - ignore(GetString("tcTypesAreAlwaysSealedAssemblyCode")) - ignore(GetString("tcTypesAreAlwaysSealedStruct")) - ignore(GetString("tcTypesAreAlwaysSealedDelegate")) - ignore(GetString("tcTypesAreAlwaysSealedEnum")) - ignore(GetString("tcInterfaceTypesAndDelegatesCannotContainFields")) - ignore(GetString("tcAbbreviatedTypesCannotBeSealed")) - ignore(GetString("tcCannotInheritFromSealedType")) - ignore(GetString("tcCannotInheritFromInterfaceType")) - ignore(GetString("tcStructTypesCannotContainAbstractMembers")) - ignore(GetString("tcInterfaceTypesCannotBeSealed")) - ignore(GetString("tcInvalidDelegateSpecification")) - ignore(GetString("tcDelegatesCannotBeCurried")) - ignore(GetString("tcInvalidTypeForLiteralEnumeration")) - ignore(GetString("tcTypeDefinitionIsCyclic")) - ignore(GetString("tcTypeDefinitionIsCyclicThroughInheritance")) - ignore(GetString("tcReservedSyntaxForAugmentation")) - ignore(GetString("tcMembersThatExtendInterfaceMustBePlacedInSeparateModule")) - ignore(GetString("tcDeclaredTypeParametersForExtensionDoNotMatchOriginal")) - ignore(GetString("tcTypeDefinitionsWithImplicitConstructionMustHaveOneInherit")) - ignore(GetString("tcTypeDefinitionsWithImplicitConstructionMustHaveLocalBindingsBeforeMembers")) - ignore(GetString("tcInheritDeclarationMissingArguments")) - ignore(GetString("tcInheritConstructionCallNotPartOfImplicitSequence")) - ignore(GetString("tcLetAndDoRequiresImplicitConstructionSequence")) - ignore(GetString("tcTypeAbbreviationsCannotHaveAugmentations")) - ignore(GetString("tcModuleAbbreviationForNamespace")) - ignore(GetString("tcTypeUsedInInvalidWay")) - ignore(GetString("tcMemberUsedInInvalidWay")) - ignore(GetString("tcAttributeAutoOpenWasIgnored")) - ignore(GetString("ilUndefinedValue")) - ignore(GetString("ilLabelNotFound")) - ignore(GetString("ilIncorrectNumberOfTypeArguments")) - ignore(GetString("ilDynamicInvocationNotSupported")) - ignore(GetString("ilAddressOfLiteralFieldIsInvalid")) - ignore(GetString("ilAddressOfValueHereIsInvalid")) - ignore(GetString("ilCustomMarshallersCannotBeUsedInFSharp")) - ignore(GetString("ilMarshalAsAttributeCannotBeDecoded")) - ignore(GetString("ilSignatureForExternalFunctionContainsTypeParameters")) - ignore(GetString("ilDllImportAttributeCouldNotBeDecoded")) - ignore(GetString("ilLiteralFieldsCannotBeSet")) - ignore(GetString("ilStaticMethodIsNotLambda")) - ignore(GetString("ilMutableVariablesCannotEscapeMethod")) - ignore(GetString("ilUnexpectedUnrealizedValue")) - ignore(GetString("ilMainModuleEmpty")) - ignore(GetString("ilTypeCannotBeUsedForLiteralField")) - ignore(GetString("ilUnexpectedGetSetAnnotation")) - ignore(GetString("ilFieldOffsetAttributeCouldNotBeDecoded")) - ignore(GetString("ilStructLayoutAttributeCouldNotBeDecoded")) - ignore(GetString("ilDefaultAugmentationAttributeCouldNotBeDecoded")) - ignore(GetString("ilReflectedDefinitionsCannotUseSliceOperator")) - ignore(GetString("optsProblemWithCodepage")) - ignore(GetString("optsCopyright")) - ignore(GetString("optsCopyrightCommunity")) - ignore(GetString("optsNameOfOutputFile")) - ignore(GetString("optsBuildConsole")) - ignore(GetString("optsBuildWindows")) - ignore(GetString("optsBuildLibrary")) - ignore(GetString("optsBuildModule")) - ignore(GetString("optsDelaySign")) - ignore(GetString("optsPublicSign")) - ignore(GetString("optsWriteXml")) - ignore(GetString("optsStrongKeyFile")) - ignore(GetString("optsStrongKeyContainer")) - ignore(GetString("optsPlatform")) - ignore(GetString("optsNoOpt")) - ignore(GetString("optsNoInterface")) - ignore(GetString("optsSig")) - ignore(GetString("optsReference")) - ignore(GetString("optsWin32res")) - ignore(GetString("optsWin32manifest")) - ignore(GetString("optsNowin32manifest")) - ignore(GetString("optsEmbedAllSource")) - ignore(GetString("optsEmbedSource")) - ignore(GetString("optsSourceLink")) - ignore(GetString("optsEmbeddedSourceRequirePortablePDBs")) - ignore(GetString("optsSourceLinkRequirePortablePDBs")) - ignore(GetString("srcFileTooLarge")) - ignore(GetString("optsResource")) - ignore(GetString("optsLinkresource")) - ignore(GetString("optsDebugPM")) - ignore(GetString("optsDebug")) - ignore(GetString("optsOptimize")) - ignore(GetString("optsTailcalls")) - ignore(GetString("optsDeterministic")) - ignore(GetString("optsCrossoptimize")) - ignore(GetString("optsWarnaserrorPM")) - ignore(GetString("optsWarnaserror")) - ignore(GetString("optsWarn")) - ignore(GetString("optsNowarn")) - ignore(GetString("optsWarnOn")) - ignore(GetString("optsChecked")) - ignore(GetString("optsDefine")) - ignore(GetString("optsMlcompatibility")) - ignore(GetString("optsNologo")) - ignore(GetString("optsHelp")) - ignore(GetString("optsResponseFile")) - ignore(GetString("optsCodepage")) - ignore(GetString("optsUtf8output")) - ignore(GetString("optsFullpaths")) - ignore(GetString("optsLib")) - ignore(GetString("optsBaseaddress")) - ignore(GetString("optsNoframework")) - ignore(GetString("optsStandalone")) - ignore(GetString("optsStaticlink")) - ignore(GetString("optsResident")) - ignore(GetString("optsPdb")) - ignore(GetString("optsSimpleresolution")) - ignore(GetString("optsUnrecognizedTarget")) - ignore(GetString("optsUnrecognizedDebugType")) - ignore(GetString("optsInvalidWarningLevel")) - ignore(GetString("optsShortFormOf")) - ignore(GetString("optsClirootDeprecatedMsg")) - ignore(GetString("optsClirootDescription")) - ignore(GetString("optsHelpBannerOutputFiles")) - ignore(GetString("optsHelpBannerInputFiles")) - ignore(GetString("optsHelpBannerResources")) - ignore(GetString("optsHelpBannerCodeGen")) - ignore(GetString("optsHelpBannerAdvanced")) - ignore(GetString("optsHelpBannerMisc")) - ignore(GetString("optsHelpBannerLanguage")) - ignore(GetString("optsHelpBannerErrsAndWarns")) - ignore(GetString("optsUnknownArgumentToTheTestSwitch")) - ignore(GetString("optsUnknownPlatform")) - ignore(GetString("optsInternalNoDescription")) - ignore(GetString("optsDCLONoDescription")) - ignore(GetString("optsDCLODeprecatedSuggestAlternative")) - ignore(GetString("optsDCLOHtmlDoc")) - ignore(GetString("optsConsoleColors")) - ignore(GetString("optsUseHighEntropyVA")) - ignore(GetString("optsSubSystemVersion")) - ignore(GetString("optsTargetProfile")) - ignore(GetString("optsEmitDebugInfoInQuotations")) - ignore(GetString("optsPreferredUiLang")) - ignore(GetString("optsNoCopyFsharpCore")) - ignore(GetString("optsInvalidSubSystemVersion")) - ignore(GetString("optsInvalidTargetProfile")) - ignore(GetString("typeInfoFullName")) - ignore(GetString("typeInfoOtherOverloads")) - ignore(GetString("typeInfoUnionCase")) - ignore(GetString("typeInfoActivePatternResult")) - ignore(GetString("typeInfoActiveRecognizer")) - ignore(GetString("typeInfoField")) - ignore(GetString("typeInfoEvent")) - ignore(GetString("typeInfoProperty")) - ignore(GetString("typeInfoExtension")) - ignore(GetString("typeInfoCustomOperation")) - ignore(GetString("typeInfoArgument")) - ignore(GetString("typeInfoAnonRecdField")) - ignore(GetString("typeInfoPatternVariable")) - ignore(GetString("typeInfoNamespace")) - ignore(GetString("typeInfoModule")) - ignore(GetString("typeInfoNamespaceOrModule")) - ignore(GetString("typeInfoFromFirst")) - ignore(GetString("typeInfoFromNext")) - ignore(GetString("typeInfoGeneratedProperty")) - ignore(GetString("typeInfoGeneratedType")) - ignore(GetString("assemblyResolutionFoundByAssemblyFoldersKey")) - ignore(GetString("assemblyResolutionFoundByAssemblyFoldersExKey")) - ignore(GetString("assemblyResolutionNetFramework")) - ignore(GetString("assemblyResolutionGAC")) - ignore(GetString("recursiveClassHierarchy")) - ignore(GetString("InvalidRecursiveReferenceToAbstractSlot")) - ignore(GetString("eventHasNonStandardType")) - ignore(GetString("typeIsNotAccessible")) - ignore(GetString("unionCasesAreNotAccessible")) - ignore(GetString("valueIsNotAccessible")) - ignore(GetString("unionCaseIsNotAccessible")) - ignore(GetString("fieldIsNotAccessible")) - ignore(GetString("structOrClassFieldIsNotAccessible")) - ignore(GetString("experimentalConstruct")) - ignore(GetString("noInvokeMethodsFound")) - ignore(GetString("moreThanOneInvokeMethodFound")) - ignore(GetString("delegatesNotAllowedToHaveCurriedSignatures")) - ignore(GetString("tlrUnexpectedTExpr")) - ignore(GetString("tlrLambdaLiftingOptimizationsNotApplied")) - ignore(GetString("lexhlpIdentifiersContainingAtSymbolReserved")) - ignore(GetString("lexhlpIdentifierReserved")) - ignore(GetString("patcMissingVariable")) - ignore(GetString("patcPartialActivePatternsGenerateOneResult")) - ignore(GetString("impTypeRequiredUnavailable")) - ignore(GetString("impReferencedTypeCouldNotBeFoundInAssembly")) - ignore(GetString("impNotEnoughTypeParamsInScopeWhileImporting")) - ignore(GetString("impReferenceToDllRequiredByAssembly")) - ignore(GetString("impImportedAssemblyUsesNotPublicType")) - ignore(GetString("optValueMarkedInlineButIncomplete")) - ignore(GetString("optValueMarkedInlineButWasNotBoundInTheOptEnv")) - ignore(GetString("optLocalValueNotFoundDuringOptimization")) - ignore(GetString("optValueMarkedInlineHasUnexpectedValue")) - ignore(GetString("optValueMarkedInlineCouldNotBeInlined")) - ignore(GetString("optFailedToInlineValue")) - ignore(GetString("optRecursiveValValue")) - ignore(GetString("lexfltIncorrentIndentationOfIn")) - ignore(GetString("lexfltTokenIsOffsideOfContextStartedEarlier")) - ignore(GetString("lexfltSeparatorTokensOfPatternMatchMisaligned")) - ignore(GetString("nrInvalidModuleExprType")) - ignore(GetString("nrTypeInstantiationNeededToDisambiguateTypesWithSameName")) - ignore(GetString("nrTypeInstantiationIsMissingAndCouldNotBeInferred")) - ignore(GetString("nrGlobalUsedOnlyAsFirstName")) - ignore(GetString("nrIsNotConstructorOrLiteral")) - ignore(GetString("nrUnexpectedEmptyLongId")) - ignore(GetString("nrRecordDoesNotContainSuchLabel")) - ignore(GetString("nrInvalidFieldLabel")) - ignore(GetString("nrInvalidExpression")) - ignore(GetString("nrNoConstructorsAvailableForType")) - ignore(GetString("nrUnionTypeNeedsQualifiedAccess")) - ignore(GetString("nrRecordTypeNeedsQualifiedAccess")) - ignore(GetString("ilwriteErrorCreatingPdb")) - ignore(GetString("lexOutsideIntegerRange")) - ignore(GetString("lexCharNotAllowedInOperatorNames")) - ignore(GetString("lexUnexpectedChar")) - ignore(GetString("lexByteArrayCannotEncode")) - ignore(GetString("lexIdentEndInMarkReserved")) - ignore(GetString("lexOutsideEightBitSigned")) - ignore(GetString("lexOutsideEightBitSignedHex")) - ignore(GetString("lexOutsideEightBitUnsigned")) - ignore(GetString("lexOutsideSixteenBitSigned")) - ignore(GetString("lexOutsideSixteenBitUnsigned")) - ignore(GetString("lexOutsideThirtyTwoBitSigned")) - ignore(GetString("lexOutsideThirtyTwoBitUnsigned")) - ignore(GetString("lexOutsideSixtyFourBitSigned")) - ignore(GetString("lexOutsideSixtyFourBitUnsigned")) - ignore(GetString("lexOutsideNativeSigned")) - ignore(GetString("lexOutsideNativeUnsigned")) - ignore(GetString("lexInvalidFloat")) - ignore(GetString("lexOusideDecimal")) - ignore(GetString("lexOusideThirtyTwoBitFloat")) - ignore(GetString("lexInvalidNumericLiteral")) - ignore(GetString("lexInvalidByteLiteral")) - ignore(GetString("lexInvalidCharLiteral")) - ignore(GetString("lexThisUnicodeOnlyInStringLiterals")) - ignore(GetString("lexTokenReserved")) - ignore(GetString("lexTabsNotAllowed")) - ignore(GetString("lexInvalidLineNumber")) - ignore(GetString("lexHashIfMustBeFirst")) - ignore(GetString("lexHashElseNoMatchingIf")) - ignore(GetString("lexHashEndifRequiredForElse")) - ignore(GetString("lexHashElseMustBeFirst")) - ignore(GetString("lexHashEndingNoMatchingIf")) - ignore(GetString("lexHashEndifMustBeFirst")) - ignore(GetString("lexHashIfMustHaveIdent")) - ignore(GetString("lexWrongNestedHashEndif")) - ignore(GetString("lexHashBangMustBeFirstInFile")) - ignore(GetString("pplexExpectedSingleLineComment")) - ignore(GetString("memberOperatorDefinitionWithNoArguments")) - ignore(GetString("memberOperatorDefinitionWithNonPairArgument")) - ignore(GetString("memberOperatorDefinitionWithCurriedArguments")) - ignore(GetString("tcFSharpCoreRequiresExplicit")) - ignore(GetString("tcStructuralComparisonNotSatisfied1")) - ignore(GetString("tcStructuralComparisonNotSatisfied2")) - ignore(GetString("tcNoComparisonNeeded1")) - ignore(GetString("tcNoComparisonNeeded2")) - ignore(GetString("tcNoEqualityNeeded1")) - ignore(GetString("tcNoEqualityNeeded2")) - ignore(GetString("tcStructuralEqualityNotSatisfied1")) - ignore(GetString("tcStructuralEqualityNotSatisfied2")) - ignore(GetString("tcStructsMustDeclareTypesOfImplicitCtorArgsExplicitly")) - ignore(GetString("chkUnusedValue")) - ignore(GetString("chkUnusedThisVariable")) - ignore(GetString("parsGetterAtMostOneArgument")) - ignore(GetString("parsSetterAtMostTwoArguments")) - ignore(GetString("parsInvalidProperty")) - ignore(GetString("parsIndexerPropertyRequiresAtLeastOneArgument")) - ignore(GetString("tastInvalidAddressOfMutableAcrossAssemblyBoundary")) - ignore(GetString("parsNonAdjacentTypars")) - ignore(GetString("parsNonAdjacentTyargs")) - ignore(GetString("parsNonAtomicType")) - ignore(GetString("tastUndefinedItemRefModuleNamespace")) - ignore(GetString("tastUndefinedItemRefVal")) - ignore(GetString("tastUndefinedItemRefModuleNamespaceType")) - ignore(GetString("tcInvalidUseNullAsTrueValue")) - ignore(GetString("tcParameterInferredByref")) - ignore(GetString("tcNonUniformMemberUse")) - ignore(GetString("tcAttribArgsDiffer")) - ignore(GetString("tcCannotCallAbstractBaseMember")) - ignore(GetString("typrelCannotResolveAmbiguityInUnmanaged")) - ignore(GetString("mlCompatMessage")) - ignore(GetString("ilFieldDoesNotHaveValidOffsetForStructureLayout")) - ignore(GetString("tcInterfacesShouldUseInheritNotInterface")) - ignore(GetString("parsInvalidPrefixOperator")) - ignore(GetString("parsInvalidPrefixOperatorDefinition")) - ignore(GetString("buildCompilingExtensionIsForML")) - ignore(GetString("lexIndentOffForML")) - ignore(GetString("activePatternIdentIsNotFunctionTyped")) - ignore(GetString("activePatternChoiceHasFreeTypars")) - ignore(GetString("ilFieldHasOffsetForSequentialLayout")) - ignore(GetString("tcOptionalArgsMustComeAfterNonOptionalArgs")) - ignore(GetString("tcConditionalAttributeUsage")) - ignore(GetString("tcMemberOperatorDefinitionInExtrinsic")) - ignore(GetString("ilwriteMDBFileNameCannotBeChangedWarning")) - ignore(GetString("ilwriteMDBMemberMissing")) - ignore(GetString("ilwriteErrorCreatingMdb")) - ignore(GetString("tcUnionCaseNameConflictsWithGeneratedType")) - ignore(GetString("chkNoReflectedDefinitionOnStructMember")) - ignore(GetString("tcDllImportNotAllowed")) - ignore(GetString("buildExplicitCoreLibRequiresNoFramework")) - ignore(GetString("buildExpectedSigdataFile")) - ignore(GetString("buildExpectedFileAlongSideFSharpCore")) - ignore(GetString("buildUnexpectedFileNameCharacter")) - ignore(GetString("tcInvalidUseBangBinding")) - ignore(GetString("crefNoInnerGenericsInQuotations")) - ignore(GetString("tcEnumTypeCannotBeEnumerated")) - ignore(GetString("parsEofInTripleQuoteString")) - ignore(GetString("parsEofInTripleQuoteStringInComment")) - ignore(GetString("tcTypeTestLosesMeasures")) - ignore(GetString("parsMissingTypeArgs")) - ignore(GetString("parsMissingGreaterThan")) - ignore(GetString("parsUnexpectedQuotationOperatorInTypeAliasDidYouMeanVerbatimString")) - ignore(GetString("parsErrorParsingAsOperatorName")) - ignore(GetString("lexInvalidUnicodeLiteral")) - ignore(GetString("tcCallerInfoWrongType")) - ignore(GetString("tcCallerInfoNotOptional")) - ignore(GetString("toolLocationHelperUnsupportedFrameworkVersion")) - ignore(GetString("ilSignInvalidMagicValue")) - ignore(GetString("ilSignBadImageFormat")) - ignore(GetString("ilSignPrivateKeyExpected")) - ignore(GetString("ilSignRsaKeyExpected")) - ignore(GetString("ilSignInvalidBitLen")) - ignore(GetString("ilSignInvalidRSAParams")) - ignore(GetString("ilSignInvalidAlgId")) - ignore(GetString("ilSignInvalidSignatureSize")) - ignore(GetString("ilSignNoSignatureDirectory")) - ignore(GetString("ilSignInvalidPKBlob")) - ignore(GetString("fscTooManyErrors")) - ignore(GetString("docfileNoXmlSuffix")) - ignore(GetString("fscNoImplementationFiles")) - ignore(GetString("fscBadAssemblyVersion")) - ignore(GetString("fscTwoResourceManifests")) - ignore(GetString("fscQuotationLiteralsStaticLinking")) - ignore(GetString("fscQuotationLiteralsStaticLinking0")) - ignore(GetString("fscStaticLinkingNoEXE")) - ignore(GetString("fscStaticLinkingNoMixedDLL")) - ignore(GetString("fscIgnoringMixedWhenLinking")) - ignore(GetString("fscAssumeStaticLinkContainsNoDependencies")) - ignore(GetString("fscAssemblyNotFoundInDependencySet")) - ignore(GetString("fscKeyFileCouldNotBeOpened")) - ignore(GetString("fscProblemWritingBinary")) - ignore(GetString("fscAssemblyVersionAttributeIgnored")) - ignore(GetString("fscAssemblyCultureAttributeError")) - ignore(GetString("fscDelaySignWarning")) - ignore(GetString("fscKeyFileWarning")) - ignore(GetString("fscKeyNameWarning")) - ignore(GetString("fscReferenceOnCommandLine")) - ignore(GetString("fscRemotingError")) - ignore(GetString("pathIsInvalid")) - ignore(GetString("fscResxSourceFileDeprecated")) - ignore(GetString("fscStaticLinkingNoProfileMismatches")) - ignore(GetString("fscAssemblyWildcardAndDeterminism")) - ignore(GetString("fscDeterministicDebugRequiresPortablePdb")) - ignore(GetString("etIllegalCharactersInNamespaceName")) - ignore(GetString("etNullOrEmptyMemberName")) - ignore(GetString("etNullMember")) - ignore(GetString("etNullMemberDeclaringType")) - ignore(GetString("etNullMemberDeclaringTypeDifferentFromProvidedType")) - ignore(GetString("etHostingAssemblyFoundWithoutHosts")) - ignore(GetString("etEmptyNamespaceOfTypeNotAllowed")) - ignore(GetString("etEmptyNamespaceNotAllowed")) - ignore(GetString("etMustNotBeGeneric")) - ignore(GetString("etMustNotBeAnArray")) - ignore(GetString("etMethodHasRequirements")) - ignore(GetString("etUnsupportedMemberKind")) - ignore(GetString("etPropertyCanReadButHasNoGetter")) - ignore(GetString("etPropertyHasGetterButNoCanRead")) - ignore(GetString("etPropertyCanWriteButHasNoSetter")) - ignore(GetString("etPropertyHasSetterButNoCanWrite")) - ignore(GetString("etOneOrMoreErrorsSeenDuringExtensionTypeSetting")) - ignore(GetString("etUnexpectedExceptionFromProvidedTypeMember")) - ignore(GetString("etUnsupportedConstantType")) - ignore(GetString("etUnsupportedProvidedExpression")) - ignore(GetString("etProvidedTypeHasUnexpectedName")) - ignore(GetString("etEventNoAdd")) - ignore(GetString("etEventNoRemove")) - ignore(GetString("etProviderHasWrongDesignerAssembly")) - ignore(GetString("etProviderDoesNotHaveValidConstructor")) - ignore(GetString("etProviderError")) - ignore(GetString("etIncorrectParameterExpression")) - ignore(GetString("etIncorrectProvidedMethod")) - ignore(GetString("etIncorrectProvidedConstructor")) - ignore(GetString("etDirectReferenceToGeneratedTypeNotAllowed")) - ignore(GetString("etProvidedTypeHasUnexpectedPath")) - ignore(GetString("etUnexpectedNullFromProvidedTypeMember")) - ignore(GetString("etUnexpectedExceptionFromProvidedMemberMember")) - ignore(GetString("etNestedProvidedTypesDoNotTakeStaticArgumentsOrGenericParameters")) - ignore(GetString("etInvalidStaticArgument")) - ignore(GetString("etErrorApplyingStaticArgumentsToType")) - ignore(GetString("etUnknownStaticArgumentKind")) - ignore(GetString("invalidNamespaceForProvidedType")) - ignore(GetString("invalidFullNameForProvidedType")) - ignore(GetString("etProviderReturnedNull")) - ignore(GetString("etTypeProviderConstructorException")) - ignore(GetString("etNullProvidedExpression")) - ignore(GetString("etProvidedAppliedTypeHadWrongName")) - ignore(GetString("etProvidedAppliedMethodHadWrongName")) - ignore(GetString("tcTypeTestLossy")) - ignore(GetString("tcTypeCastErased")) - ignore(GetString("tcTypeTestErased")) - ignore(GetString("tcCannotInheritFromErasedType")) - ignore(GetString("etInvalidTypeProviderAssemblyName")) - ignore(GetString("tcInvalidMemberNameCtor")) - ignore(GetString("tcInferredGenericTypeGivesRiseToInconsistency")) - ignore(GetString("tcInvalidTypeArgumentCount")) - ignore(GetString("tcCannotOverrideSealedMethod")) - ignore(GetString("etProviderErrorWithContext")) - ignore(GetString("etProvidedTypeWithNameException")) - ignore(GetString("etProvidedTypeWithNullOrEmptyName")) - ignore(GetString("etIllegalCharactersInTypeName")) - ignore(GetString("tcJoinMustUseSimplePattern")) - ignore(GetString("tcMissingCustomOperation")) - ignore(GetString("etBadUnnamedStaticArgs")) - ignore(GetString("etStaticParameterRequiresAValue")) - ignore(GetString("etNoStaticParameterWithName")) - ignore(GetString("etStaticParameterAlreadyHasValue")) - ignore(GetString("etMultipleStaticParameterWithName")) - ignore(GetString("tcCustomOperationMayNotBeUsedInConjunctionWithNonSimpleLetBindings")) - ignore(GetString("tcCustomOperationMayNotBeUsedHere")) - ignore(GetString("tcCustomOperationMayNotBeOverloaded")) - ignore(GetString("tcIfThenElseMayNotBeUsedWithinQueries")) - ignore(GetString("ilxgenUnexpectedArgumentToMethodHandleOfDuringCodegen")) - ignore(GetString("etProvidedTypeReferenceMissingArgument")) - ignore(GetString("etProvidedTypeReferenceInvalidText")) - ignore(GetString("tcCustomOperationNotUsedCorrectly")) - ignore(GetString("tcCustomOperationNotUsedCorrectly2")) - ignore(GetString("customOperationTextLikeJoin")) - ignore(GetString("customOperationTextLikeGroupJoin")) - ignore(GetString("customOperationTextLikeZip")) - ignore(GetString("tcBinaryOperatorRequiresVariable")) - ignore(GetString("tcOperatorIncorrectSyntax")) - ignore(GetString("tcBinaryOperatorRequiresBody")) - ignore(GetString("tcCustomOperationHasIncorrectArgCount")) - ignore(GetString("parsExpectedExpressionAfterToken")) - ignore(GetString("parsExpectedTypeAfterToken")) - ignore(GetString("parsUnmatchedLBrackLess")) - ignore(GetString("parsUnexpectedEndOfFileMatch")) - ignore(GetString("parsUnexpectedEndOfFileTry")) - ignore(GetString("parsUnexpectedEndOfFileWhile")) - ignore(GetString("parsUnexpectedEndOfFileFor")) - ignore(GetString("parsUnexpectedEndOfFileWith")) - ignore(GetString("parsUnexpectedEndOfFileThen")) - ignore(GetString("parsUnexpectedEndOfFileElse")) - ignore(GetString("parsUnexpectedEndOfFileFunBody")) - ignore(GetString("parsUnexpectedEndOfFileTypeArgs")) - ignore(GetString("parsUnexpectedEndOfFileTypeSignature")) - ignore(GetString("parsUnexpectedEndOfFileTypeDefinition")) - ignore(GetString("parsUnexpectedEndOfFileObjectMembers")) - ignore(GetString("parsUnexpectedEndOfFileDefinition")) - ignore(GetString("parsUnexpectedEndOfFileExpression")) - ignore(GetString("parsExpectedNameAfterToken")) - ignore(GetString("parsUnmatchedLet")) - ignore(GetString("parsUnmatchedLetBang")) - ignore(GetString("parsUnmatchedUseBang")) - ignore(GetString("parsUnmatchedUse")) - ignore(GetString("parsWhileDoExpected")) - ignore(GetString("parsForDoExpected")) - ignore(GetString("tcInvalidRelationInJoin")) - ignore(GetString("typeInfoCallsWord")) - ignore(GetString("impInvalidNumberOfGenericArguments")) - ignore(GetString("impInvalidMeasureArgument1")) - ignore(GetString("impInvalidMeasureArgument2")) - ignore(GetString("etPropertyNeedsCanWriteOrCanRead")) - ignore(GetString("tcIntoNeedsRestOfQuery")) - ignore(GetString("tcOperatorDoesntAcceptInto")) - ignore(GetString("tcCustomOperationInvalid")) - ignore(GetString("tcThisTypeMayNotHaveACLIMutableAttribute")) - ignore(GetString("tcAutoPropertyRequiresImplicitConstructionSequence")) - ignore(GetString("parsMutableOnAutoPropertyShouldBeGetSet")) - ignore(GetString("parsMutableOnAutoPropertyShouldBeGetSetNotJustSet")) - ignore(GetString("chkNoByrefsOfByrefs")) - ignore(GetString("tastopsMaxArrayThirtyTwo")) - ignore(GetString("tcNoIntegerForLoopInQuery")) - ignore(GetString("tcNoWhileInQuery")) - ignore(GetString("tcNoTryFinallyInQuery")) - ignore(GetString("tcUseMayNotBeUsedInQueries")) - ignore(GetString("tcBindMayNotBeUsedInQueries")) - ignore(GetString("tcReturnMayNotBeUsedInQueries")) - ignore(GetString("tcUnrecognizedQueryOperator")) - ignore(GetString("tcTryWithMayNotBeUsedInQueries")) - ignore(GetString("tcNonSimpleLetBindingInQuery")) - ignore(GetString("etTooManyStaticParameters")) - ignore(GetString("infosInvalidProvidedLiteralValue")) - ignore(GetString("invalidPlatformTarget")) - ignore(GetString("tcThisValueMayNotBeInlined")) - ignore(GetString("etErasedTypeUsedInGeneration")) - ignore(GetString("tcUnrecognizedQueryBinaryOperator")) - ignore(GetString("crefNoSetOfHole")) - ignore(GetString("nicePrintOtherOverloads1")) - ignore(GetString("nicePrintOtherOverloadsN")) - ignore(GetString("erasedTo")) - ignore(GetString("parsUnfinishedExpression")) - ignore(GetString("parsAttributeOnIncompleteCode")) - ignore(GetString("parsTypeNameCannotBeEmpty")) - ignore(GetString("buildProblemReadingAssembly")) - ignore(GetString("tcTPFieldMustBeLiteral")) - ignore(GetString("loadingDescription")) - ignore(GetString("descriptionUnavailable")) - ignore(GetString("chkTyparMultipleClassConstraints")) - ignore(GetString("tcMatchMayNotBeUsedWithQuery")) - ignore(GetString("memberOperatorDefinitionWithNonTripleArgument")) - ignore(GetString("cannotResolveNullableOperators")) - ignore(GetString("tcOperatorRequiresIn")) - ignore(GetString("parsIllegalMemberVarInObjectImplementation")) - ignore(GetString("tcEmptyCopyAndUpdateRecordInvalid")) - ignore(GetString("parsUnderscoreInvalidFieldName")) - ignore(GetString("tcGeneratedTypesShouldBeInternalOrPrivate")) - ignore(GetString("chkGetterAndSetterHaveSamePropertyType")) - ignore(GetString("tcRuntimeSuppliedMethodCannotBeUsedInUserCode")) - ignore(GetString("tcUnionCaseConstructorDoesNotHaveFieldWithGivenName")) - ignore(GetString("tcExceptionConstructorDoesNotHaveFieldWithGivenName")) - ignore(GetString("tcActivePatternsDoNotHaveFields")) - ignore(GetString("tcConstructorDoesNotHaveFieldWithGivenName")) - ignore(GetString("tcUnionCaseFieldCannotBeUsedMoreThanOnce")) - ignore(GetString("tcFieldNameIsUsedModeThanOnce")) - ignore(GetString("tcFieldNameConflictsWithGeneratedNameForAnonymousField")) - ignore(GetString("tastConstantExpressionOverflow")) - ignore(GetString("tcIllegalStructTypeForConstantExpression")) - ignore(GetString("fscSystemRuntimeInteropServicesIsRequired")) - ignore(GetString("abImplicitHeapAllocation")) - ignore(GetString("estApplyStaticArgumentsForMethodNotImplemented")) - ignore(GetString("etErrorApplyingStaticArgumentsToMethod")) - ignore(GetString("pplexUnexpectedChar")) - ignore(GetString("ppparsUnexpectedToken")) - ignore(GetString("ppparsIncompleteExpression")) - ignore(GetString("ppparsMissingToken")) - ignore(GetString("pickleMissingDefinition")) - ignore(GetString("checkNotSufficientlyGenericBecauseOfScope")) - ignore(GetString("checkNotSufficientlyGenericBecauseOfScopeAnon")) - ignore(GetString("checkRaiseFamilyFunctionArgumentCount")) - ignore(GetString("checkLowercaseLiteralBindingInPattern")) - ignore(GetString("tcLiteralDoesNotTakeArguments")) - ignore(GetString("tcConstructorsIllegalInAugmentation")) - ignore(GetString("optsInvalidResponseFile")) - ignore(GetString("optsResponseFileNotFound")) - ignore(GetString("optsResponseFileNameInvalid")) - ignore(GetString("fsharpCoreNotFoundToBeCopied")) - ignore(GetString("tcTupleStructMismatch")) - ignore(GetString("etMissingStaticArgumentsToMethod")) - ignore(GetString("considerUpcast")) - ignore(GetString("considerUpcastOperator")) - ignore(GetString("tcRecImplied")) - ignore(GetString("tcOpenFirstInMutRec")) - ignore(GetString("tcModuleAbbrevFirstInMutRec")) - ignore(GetString("tcUnsupportedMutRecDecl")) - ignore(GetString("parsInvalidUseOfRec")) - ignore(GetString("tcStructUnionMultiCaseDistinctFields")) - ignore(GetString("CallerMemberNameIsOverriden")) - ignore(GetString("tcFixedNotAllowed")) - ignore(GetString("tcCouldNotFindOffsetToStringData")) - ignore(GetString("chkNoByrefAddressOfLocal")) - ignore(GetString("tcNamedActivePattern")) - ignore(GetString("DefaultParameterValueNotAppropriateForArgument")) - ignore(GetString("tcGlobalsSystemTypeNotFound")) - ignore(GetString("typrelMemberHasMultiplePossibleDispatchSlots")) - ignore(GetString("methodIsNotStatic")) - ignore(GetString("parsUnexpectedSymbolEqualsInsteadOfIn")) - ignore(GetString("tcAnonRecdCcuMismatch")) - ignore(GetString("tcAnonRecdFieldNameMismatch")) - ignore(GetString("keywordDescriptionAbstract")) - ignore(GetString("keyworkDescriptionAnd")) - ignore(GetString("keywordDescriptionAs")) - ignore(GetString("keywordDescriptionAssert")) - ignore(GetString("keywordDescriptionBase")) - ignore(GetString("keywordDescriptionBegin")) - ignore(GetString("keywordDescriptionClass")) - ignore(GetString("keywordDescriptionDefault")) - ignore(GetString("keywordDescriptionDelegate")) - ignore(GetString("keywordDescriptionDo")) - ignore(GetString("keywordDescriptionDone")) - ignore(GetString("keywordDescriptionDowncast")) - ignore(GetString("keywordDescriptionDownto")) - ignore(GetString("keywordDescriptionElif")) - ignore(GetString("keywordDescriptionElse")) - ignore(GetString("keywordDescriptionEnd")) - ignore(GetString("keywordDescriptionException")) - ignore(GetString("keywordDescriptionExtern")) - ignore(GetString("keywordDescriptionTrueFalse")) - ignore(GetString("keywordDescriptionFinally")) - ignore(GetString("keywordDescriptionFor")) - ignore(GetString("keywordDescriptionFun")) - ignore(GetString("keywordDescriptionFunction")) - ignore(GetString("keywordDescriptionGlobal")) - ignore(GetString("keywordDescriptionIf")) - ignore(GetString("keywordDescriptionIn")) - ignore(GetString("keywordDescriptionInherit")) - ignore(GetString("keywordDescriptionInline")) - ignore(GetString("keywordDescriptionInterface")) - ignore(GetString("keywordDescriptionInternal")) - ignore(GetString("keywordDescriptionLazy")) - ignore(GetString("keywordDescriptionLet")) - ignore(GetString("keywordDescriptionLetBang")) - ignore(GetString("keywordDescriptionMatch")) - ignore(GetString("keywordDescriptionMatchBang")) - ignore(GetString("keywordDescriptionMember")) - ignore(GetString("keywordDescriptionModule")) - ignore(GetString("keywordDescriptionMutable")) - ignore(GetString("keywordDescriptionNamespace")) - ignore(GetString("keywordDescriptionNew")) - ignore(GetString("keywordDescriptionNot")) - ignore(GetString("keywordDescriptionNull")) - ignore(GetString("keywordDescriptionOf")) - ignore(GetString("keywordDescriptionOpen")) - ignore(GetString("keywordDescriptionOr")) - ignore(GetString("keywordDescriptionOverride")) - ignore(GetString("keywordDescriptionPrivate")) - ignore(GetString("keywordDescriptionPublic")) - ignore(GetString("keywordDescriptionRec")) - ignore(GetString("keywordDescriptionReturn")) - ignore(GetString("keywordDescriptionReturnBang")) - ignore(GetString("keywordDescriptionSelect")) - ignore(GetString("keywordDescriptionStatic")) - ignore(GetString("keywordDescriptionStruct")) - ignore(GetString("keywordDescriptionThen")) - ignore(GetString("keywordDescriptionTo")) - ignore(GetString("keywordDescriptionTry")) - ignore(GetString("keywordDescriptionType")) - ignore(GetString("keywordDescriptionUpcast")) - ignore(GetString("keywordDescriptionUse")) - ignore(GetString("keywordDescriptionUseBang")) - ignore(GetString("keywordDescriptionVal")) - ignore(GetString("keywordDescriptionVoid")) - ignore(GetString("keywordDescriptionWhen")) - ignore(GetString("keywordDescriptionWhile")) - ignore(GetString("keywordDescriptionWith")) - ignore(GetString("keywordDescriptionYield")) - ignore(GetString("keywordDescriptionYieldBang")) - ignore(GetString("keywordDescriptionRightArrow")) - ignore(GetString("keywordDescriptionLeftArrow")) - ignore(GetString("keywordDescriptionCast")) - ignore(GetString("keywordDescriptionDynamicCast")) - ignore(GetString("keywordDescriptionTypedQuotation")) - ignore(GetString("keywordDescriptionUntypedQuotation")) - ignore(GetString("itemNotFoundDuringDynamicCodeGen")) - ignore(GetString("itemNotFoundInTypeDuringDynamicCodeGen")) - ignore(GetString("descriptionWordIs")) - ignore(GetString("notAFunction")) - ignore(GetString("notAFunctionButMaybeIndexerWithName")) - ignore(GetString("notAFunctionButMaybeIndexer")) - ignore(GetString("notAFunctionButMaybeIndexerErrorCode")) - ignore(GetString("notAFunctionButMaybeDeclaration")) - ignore(GetString("ArgumentsInSigAndImplMismatch")) - ignore(GetString("pickleUnexpectedNonZero")) - ignore(GetString("tcTupleMemberNotNormallyUsed")) - ignore(GetString("implicitlyDiscardedInSequenceExpression")) - ignore(GetString("implicitlyDiscardedSequenceInSequenceExpression")) - ignore(GetString("ilreadFileChanged")) - ignore(GetString("writeToReadOnlyByref")) - ignore(GetString("readOnlyAttributeOnStructWithMutableField")) - ignore(GetString("tcByrefReturnImplicitlyDereferenced")) - ignore(GetString("tcByRefLikeNotStruct")) - ignore(GetString("chkNoByrefAddressOfValueFromExpression")) - ignore(GetString("chkNoWriteToLimitedSpan")) - ignore(GetString("tastValueMustBeLocal")) - ignore(GetString("tcIsReadOnlyNotStruct")) - ignore(GetString("chkStructsMayNotReturnAddressesOfContents")) - ignore(GetString("chkNoByrefLikeFunctionCall")) - ignore(GetString("chkNoSpanLikeVariable")) - ignore(GetString("chkNoSpanLikeValueFromExpression")) - ignore(GetString("tastCantTakeAddressOfExpression")) - ignore(GetString("tcCannotCallExtensionMethodInrefToByref")) - ignore(GetString("tcByrefsMayNotHaveTypeExtensions")) - ignore(GetString("tcCannotPartiallyApplyExtensionMethodForByref")) - ignore(GetString("tcTypeDoesNotInheritAttribute")) - ignore(GetString("parsInvalidAnonRecdExpr")) - ignore(GetString("parsInvalidAnonRecdType")) - ignore(GetString("tcCopyAndUpdateNeedsRecordType")) - ignore(GetString("chkInvalidFunctionParameterType")) - ignore(GetString("chkInvalidFunctionReturnType")) - () diff --git a/src/buildfromsource/FSharp.Compiler.Private/FSIstrings.fs b/src/buildfromsource/FSharp.Compiler.Private/FSIstrings.fs deleted file mode 100644 index 53169f5f06..0000000000 --- a/src/buildfromsource/FSharp.Compiler.Private/FSIstrings.fs +++ /dev/null @@ -1,333 +0,0 @@ -// This is a generated file; the original input is '..\fsi\FSIstrings.txt' -namespace FSIstrings - -open Microsoft.FSharp.Core.LanguagePrimitives.IntrinsicOperators -open Microsoft.FSharp.Reflection -open System.Reflection -// (namespaces below for specific case of using the tool to compile FSharp.Core itself) -open Microsoft.FSharp.Core -open Microsoft.FSharp.Core.Operators -open Microsoft.FSharp.Text -open Microsoft.FSharp.Collections -open Printf - -type internal SR private() = - - // BEGIN BOILERPLATE - - static let getCurrentAssembly () = - #if FX_RESHAPED_REFLECTION - typeof.GetTypeInfo().Assembly - #else - System.Reflection.Assembly.GetExecutingAssembly() - #endif - - static let getTypeInfo (t: System.Type) = - #if FX_RESHAPED_REFLECTION - t.GetTypeInfo() - #else - t - #endif - - static let resources = lazy (new System.Resources.ResourceManager("FSIstrings", getCurrentAssembly())) - - static let GetString(name:string) = - let s = resources.Value.GetString(name, System.Globalization.CultureInfo.CurrentUICulture) - #if DEBUG - if null = s then - System.Diagnostics.Debug.Assert(false, sprintf "**RESOURCE ERROR**: Resource token %s does not exist!" name) - #endif - s - - static let mkFunctionValue (tys: System.Type[]) (impl:obj->obj) = - FSharpValue.MakeFunction(FSharpType.MakeFunctionType(tys.[0],tys.[1]), impl) - - static let funTyC = typeof<(obj -> obj)>.GetGenericTypeDefinition() - - static let isNamedType(ty:System.Type) = not (ty.IsArray || ty.IsByRef || ty.IsPointer) - static let isFunctionType (ty1:System.Type) = - isNamedType(ty1) && getTypeInfo(ty1).IsGenericType && (ty1.GetGenericTypeDefinition()).Equals(funTyC) - - static let rec destFunTy (ty:System.Type) = - if isFunctionType ty then - ty, ty.GetGenericArguments() - else - match getTypeInfo(ty).BaseType with - | null -> failwith "destFunTy: not a function type" - | b -> destFunTy b - - static let buildFunctionForOneArgPat (ty: System.Type) impl = - let _,tys = destFunTy ty - let rty = tys.[1] - // PERF: this technique is a bit slow (e.g. in simple cases, like 'sprintf "%x"') - mkFunctionValue tys (fun inp -> impl rty inp) - - static let capture1 (fmt:string) i args ty (go : obj list -> System.Type -> int -> obj) : obj = - match fmt.[i] with - | '%' -> go args ty (i+1) - | 'd' - | 'f' - | 's' -> buildFunctionForOneArgPat ty (fun rty n -> go (n :: args) rty (i+1)) - | _ -> failwith "bad format specifier" - - // newlines and tabs get converted to strings when read from a resource file - // this will preserve their original intention - static let postProcessString (s : string) = - s.Replace("\\n","\n").Replace("\\t","\t").Replace("\\r","\r").Replace("\\\"", "\"") - - static let createMessageString (messageString : string) (fmt : Printf.StringFormat<'T>) : 'T = - let fmt = fmt.Value // here, we use the actual error string, as opposed to the one stored as fmt - let len = fmt.Length - - /// Function to capture the arguments and then run. - let rec capture args ty i = - if i >= len || (fmt.[i] = '%' && i+1 >= len) then - let b = new System.Text.StringBuilder() - b.AppendFormat(messageString, [| for x in List.rev args -> x |]) |> ignore - box(b.ToString()) - // REVIEW: For these purposes, this should be a nop, but I'm leaving it - // in incase we ever decide to support labels for the error format string - // E.g., "%s%d" - elif System.Char.IsSurrogatePair(fmt,i) then - capture args ty (i+2) - else - match fmt.[i] with - | '%' -> - let i = i+1 - capture1 fmt i args ty capture - | _ -> - capture args ty (i+1) - - (unbox (capture [] (typeof<'T>) 0) : 'T) - - static let mutable swallowResourceText = false - - static let GetStringFunc((messageID : string),(fmt : Printf.StringFormat<'T>)) : 'T = - if swallowResourceText then - sprintf fmt - else - let mutable messageString = GetString(messageID) - messageString <- postProcessString messageString - createMessageString messageString fmt - - /// If set to true, then all error messages will just return the filled 'holes' delimited by ',,,'s - this is for language-neutral testing (e.g. localization-invariant baselines). - static member SwallowResourceText with get () = swallowResourceText - and set (b) = swallowResourceText <- b - // END BOILERPLATE - - /// Stopped due to error\n - /// (Originally from ..\fsi\FSIstrings.txt:2) - static member stoppedDueToError() = (GetStringFunc("stoppedDueToError",",,,") ) - /// Usage: %s [script.fsx []] - /// (Originally from ..\fsi\FSIstrings.txt:3) - static member fsiUsage(a0 : System.String) = (GetStringFunc("fsiUsage",",,,%s,,,") a0) - /// - INPUT FILES - - /// (Originally from ..\fsi\FSIstrings.txt:4) - static member fsiInputFiles() = (GetStringFunc("fsiInputFiles",",,,") ) - /// - CODE GENERATION - - /// (Originally from ..\fsi\FSIstrings.txt:5) - static member fsiCodeGeneration() = (GetStringFunc("fsiCodeGeneration",",,,") ) - /// - ERRORS AND WARNINGS - - /// (Originally from ..\fsi\FSIstrings.txt:6) - static member fsiErrorsAndWarnings() = (GetStringFunc("fsiErrorsAndWarnings",",,,") ) - /// - LANGUAGE - - /// (Originally from ..\fsi\FSIstrings.txt:7) - static member fsiLanguage() = (GetStringFunc("fsiLanguage",",,,") ) - /// - MISCELLANEOUS - - /// (Originally from ..\fsi\FSIstrings.txt:8) - static member fsiMiscellaneous() = (GetStringFunc("fsiMiscellaneous",",,,") ) - /// - ADVANCED - - /// (Originally from ..\fsi\FSIstrings.txt:9) - static member fsiAdvanced() = (GetStringFunc("fsiAdvanced",",,,") ) - /// Exception raised when starting remoting server.\n%s - /// (Originally from ..\fsi\FSIstrings.txt:10) - static member fsiExceptionRaisedStartingServer(a0 : System.String) = (GetStringFunc("fsiExceptionRaisedStartingServer",",,,%s,,,") a0) - /// Use the given file on startup as initial input - /// (Originally from ..\fsi\FSIstrings.txt:11) - static member fsiUse() = (GetStringFunc("fsiUse",",,,") ) - /// #load the given file on startup - /// (Originally from ..\fsi\FSIstrings.txt:12) - static member fsiLoad() = (GetStringFunc("fsiLoad",",,,") ) - /// Treat remaining arguments as command line arguments, accessed using fsi.CommandLineArgs - /// (Originally from ..\fsi\FSIstrings.txt:13) - static member fsiRemaining() = (GetStringFunc("fsiRemaining",",,,") ) - /// Display this usage message (Short form: -?) - /// (Originally from ..\fsi\FSIstrings.txt:14) - static member fsiHelp() = (GetStringFunc("fsiHelp",",,,") ) - /// Exit fsi after loading the files or running the .fsx script given on the command line - /// (Originally from ..\fsi\FSIstrings.txt:15) - static member fsiExec() = (GetStringFunc("fsiExec",",,,") ) - /// Execute interactions on a Windows Forms event loop (on by default) - /// (Originally from ..\fsi\FSIstrings.txt:16) - static member fsiGui() = (GetStringFunc("fsiGui",",,,") ) - /// Suppress fsi writing to stdout - /// (Originally from ..\fsi\FSIstrings.txt:17) - static member fsiQuiet() = (GetStringFunc("fsiQuiet",",,,") ) - /// Support TAB completion in console (on by default) - /// (Originally from ..\fsi\FSIstrings.txt:18) - static member fsiReadline() = (GetStringFunc("fsiReadline",",,,") ) - /// Emit debug information in quotations - /// (Originally from ..\fsi\FSIstrings.txt:19) - static member fsiEmitDebugInfoInQuotations() = (GetStringFunc("fsiEmitDebugInfoInQuotations",",,,") ) - /// For help type #help;; - /// (Originally from ..\fsi\FSIstrings.txt:20) - static member fsiBanner3() = (GetStringFunc("fsiBanner3",",,,") ) - /// A problem occurred starting the F# Interactive process. This may be due to a known problem with background process console support for Unicode-enabled applications on some Windows systems. Try selecting Tools->Options->F# Interactive for Visual Studio and enter '--fsi-server-no-unicode'. - /// (Originally from ..\fsi\FSIstrings.txt:21) - static member fsiConsoleProblem() = (GetStringFunc("fsiConsoleProblem",",,,") ) - /// '%s' is not a valid assembly name - /// (Originally from ..\fsi\FSIstrings.txt:22) - static member fsiInvalidAssembly(a0 : System.String) = (2301, GetStringFunc("fsiInvalidAssembly",",,,%s,,,") a0) - /// Directory '%s' doesn't exist - /// (Originally from ..\fsi\FSIstrings.txt:23) - static member fsiDirectoryDoesNotExist(a0 : System.String) = (2302, GetStringFunc("fsiDirectoryDoesNotExist",",,,%s,,,") a0) - /// Invalid directive '#%s %s' - /// (Originally from ..\fsi\FSIstrings.txt:24) - static member fsiInvalidDirective(a0 : System.String, a1 : System.String) = (GetStringFunc("fsiInvalidDirective",",,,%s,,,%s,,,") a0 a1) - /// Warning: line too long, ignoring some characters\n - /// (Originally from ..\fsi\FSIstrings.txt:25) - static member fsiLineTooLong() = (GetStringFunc("fsiLineTooLong",",,,") ) - /// Real: %s, CPU: %s, GC %s - /// (Originally from ..\fsi\FSIstrings.txt:26) - static member fsiTimeInfoMainString(a0 : System.String, a1 : System.String, a2 : System.String) = (GetStringFunc("fsiTimeInfoMainString",",,,%s,,,%s,,,%s,,,") a0 a1 a2) - /// gen - /// (Originally from ..\fsi\FSIstrings.txt:27) - static member fsiTimeInfoGCGenerationLabelSomeShorthandForTheWordGeneration() = (GetStringFunc("fsiTimeInfoGCGenerationLabelSomeShorthandForTheWordGeneration",",,,") ) - /// \n\nException raised during pretty printing.\nPlease report this so it can be fixed.\nTrace: %s\n - /// (Originally from ..\fsi\FSIstrings.txt:28) - static member fsiExceptionDuringPrettyPrinting(a0 : System.String) = (GetStringFunc("fsiExceptionDuringPrettyPrinting",",,,%s,,,") a0) - /// F# Interactive directives: - /// (Originally from ..\fsi\FSIstrings.txt:29) - static member fsiIntroTextHeader1directives() = (GetStringFunc("fsiIntroTextHeader1directives",",,,") ) - /// Reference (dynamically load) the given DLL - /// (Originally from ..\fsi\FSIstrings.txt:30) - static member fsiIntroTextHashrInfo() = (GetStringFunc("fsiIntroTextHashrInfo",",,,") ) - /// Add the given search path for referenced DLLs - /// (Originally from ..\fsi\FSIstrings.txt:31) - static member fsiIntroTextHashIInfo() = (GetStringFunc("fsiIntroTextHashIInfo",",,,") ) - /// Load the given file(s) as if compiled and referenced - /// (Originally from ..\fsi\FSIstrings.txt:32) - static member fsiIntroTextHashloadInfo() = (GetStringFunc("fsiIntroTextHashloadInfo",",,,") ) - /// Toggle timing on/off - /// (Originally from ..\fsi\FSIstrings.txt:33) - static member fsiIntroTextHashtimeInfo() = (GetStringFunc("fsiIntroTextHashtimeInfo",",,,") ) - /// Display help - /// (Originally from ..\fsi\FSIstrings.txt:34) - static member fsiIntroTextHashhelpInfo() = (GetStringFunc("fsiIntroTextHashhelpInfo",",,,") ) - /// Exit - /// (Originally from ..\fsi\FSIstrings.txt:35) - static member fsiIntroTextHashquitInfo() = (GetStringFunc("fsiIntroTextHashquitInfo",",,,") ) - /// F# Interactive command line options: - /// (Originally from ..\fsi\FSIstrings.txt:36) - static member fsiIntroTextHeader2commandLine() = (GetStringFunc("fsiIntroTextHeader2commandLine",",,,") ) - /// See '%s' for options - /// (Originally from ..\fsi\FSIstrings.txt:37) - static member fsiIntroTextHeader3(a0 : System.String) = (GetStringFunc("fsiIntroTextHeader3",",,,%s,,,") a0) - /// Loading - /// (Originally from ..\fsi\FSIstrings.txt:38) - static member fsiLoadingFilesPrefixText() = (GetStringFunc("fsiLoadingFilesPrefixText",",,,") ) - /// \n- Interrupt\n - /// (Originally from ..\fsi\FSIstrings.txt:39) - static member fsiInterrupt() = (GetStringFunc("fsiInterrupt",",,,") ) - /// \n- Exit...\n - /// (Originally from ..\fsi\FSIstrings.txt:40) - static member fsiExit() = (GetStringFunc("fsiExit",",,,") ) - /// - Aborting main thread... - /// (Originally from ..\fsi\FSIstrings.txt:41) - static member fsiAbortingMainThread() = (GetStringFunc("fsiAbortingMainThread",",,,") ) - /// Failed to install ctrl-c handler - Ctrl-C handling will not be available. Error was:\n\t%s - /// (Originally from ..\fsi\FSIstrings.txt:42) - static member fsiCouldNotInstallCtrlCHandler(a0 : System.String) = (GetStringFunc("fsiCouldNotInstallCtrlCHandler",",,,%s,,,") a0) - /// --> Referenced '%s' - /// (Originally from ..\fsi\FSIstrings.txt:43) - static member fsiDidAHashr(a0 : System.String) = (GetStringFunc("fsiDidAHashr",",,,%s,,,") a0) - /// --> Referenced '%s' (file may be locked by F# Interactive process) - /// (Originally from ..\fsi\FSIstrings.txt:44) - static member fsiDidAHashrWithLockWarning(a0 : System.String) = (GetStringFunc("fsiDidAHashrWithLockWarning",",,,%s,,,") a0) - /// --> Referenced '%s' (an assembly with a different timestamp has already been referenced from this location, reset fsi to load the updated assembly) - /// (Originally from ..\fsi\FSIstrings.txt:45) - static member fsiDidAHashrWithStaleWarning(a0 : System.String) = (GetStringFunc("fsiDidAHashrWithStaleWarning",",,,%s,,,") a0) - /// --> Added '%s' to library include path - /// (Originally from ..\fsi\FSIstrings.txt:46) - static member fsiDidAHashI(a0 : System.String) = (GetStringFunc("fsiDidAHashI",",,,%s,,,") a0) - /// --> Timing now on - /// (Originally from ..\fsi\FSIstrings.txt:47) - static member fsiTurnedTimingOn() = (GetStringFunc("fsiTurnedTimingOn",",,,") ) - /// --> Timing now off - /// (Originally from ..\fsi\FSIstrings.txt:48) - static member fsiTurnedTimingOff() = (GetStringFunc("fsiTurnedTimingOff",",,,") ) - /// - Unexpected ThreadAbortException (Ctrl-C) during event handling: Trying to restart... - /// (Originally from ..\fsi\FSIstrings.txt:49) - static member fsiUnexpectedThreadAbortException() = (GetStringFunc("fsiUnexpectedThreadAbortException",",,,") ) - /// Failed to resolve assembly '%s' - /// (Originally from ..\fsi\FSIstrings.txt:50) - static member fsiFailedToResolveAssembly(a0 : System.String) = (GetStringFunc("fsiFailedToResolveAssembly",",,,%s,,,") a0) - /// Binding session to '%s'... - /// (Originally from ..\fsi\FSIstrings.txt:51) - static member fsiBindingSessionTo(a0 : System.String) = (GetStringFunc("fsiBindingSessionTo",",,,%s,,,") a0) - /// Microsoft (R) F# Interactive version %s - /// (Originally from ..\fsi\FSIstrings.txt:52) - static member fsiProductName(a0 : System.String) = (GetStringFunc("fsiProductName",",,,%s,,,") a0) - /// F# Interactive for F# %s - /// (Originally from ..\fsi\FSIstrings.txt:53) - static member fsiProductNameCommunity(a0 : System.String) = (GetStringFunc("fsiProductNameCommunity",",,,%s,,,") a0) - /// Prevents references from being locked by the F# Interactive process - /// (Originally from ..\fsi\FSIstrings.txt:54) - static member shadowCopyReferences() = (GetStringFunc("shadowCopyReferences",",,,") ) - - /// Call this method once to validate that all known resources are valid; throws if not - static member RunStartupValidation() = - ignore(GetString("stoppedDueToError")) - ignore(GetString("fsiUsage")) - ignore(GetString("fsiInputFiles")) - ignore(GetString("fsiCodeGeneration")) - ignore(GetString("fsiErrorsAndWarnings")) - ignore(GetString("fsiLanguage")) - ignore(GetString("fsiMiscellaneous")) - ignore(GetString("fsiAdvanced")) - ignore(GetString("fsiExceptionRaisedStartingServer")) - ignore(GetString("fsiUse")) - ignore(GetString("fsiLoad")) - ignore(GetString("fsiRemaining")) - ignore(GetString("fsiHelp")) - ignore(GetString("fsiExec")) - ignore(GetString("fsiGui")) - ignore(GetString("fsiQuiet")) - ignore(GetString("fsiReadline")) - ignore(GetString("fsiEmitDebugInfoInQuotations")) - ignore(GetString("fsiBanner3")) - ignore(GetString("fsiConsoleProblem")) - ignore(GetString("fsiInvalidAssembly")) - ignore(GetString("fsiDirectoryDoesNotExist")) - ignore(GetString("fsiInvalidDirective")) - ignore(GetString("fsiLineTooLong")) - ignore(GetString("fsiTimeInfoMainString")) - ignore(GetString("fsiTimeInfoGCGenerationLabelSomeShorthandForTheWordGeneration")) - ignore(GetString("fsiExceptionDuringPrettyPrinting")) - ignore(GetString("fsiIntroTextHeader1directives")) - ignore(GetString("fsiIntroTextHashrInfo")) - ignore(GetString("fsiIntroTextHashIInfo")) - ignore(GetString("fsiIntroTextHashloadInfo")) - ignore(GetString("fsiIntroTextHashtimeInfo")) - ignore(GetString("fsiIntroTextHashhelpInfo")) - ignore(GetString("fsiIntroTextHashquitInfo")) - ignore(GetString("fsiIntroTextHeader2commandLine")) - ignore(GetString("fsiIntroTextHeader3")) - ignore(GetString("fsiLoadingFilesPrefixText")) - ignore(GetString("fsiInterrupt")) - ignore(GetString("fsiExit")) - ignore(GetString("fsiAbortingMainThread")) - ignore(GetString("fsiCouldNotInstallCtrlCHandler")) - ignore(GetString("fsiDidAHashr")) - ignore(GetString("fsiDidAHashrWithLockWarning")) - ignore(GetString("fsiDidAHashrWithStaleWarning")) - ignore(GetString("fsiDidAHashI")) - ignore(GetString("fsiTurnedTimingOn")) - ignore(GetString("fsiTurnedTimingOff")) - ignore(GetString("fsiUnexpectedThreadAbortException")) - ignore(GetString("fsiFailedToResolveAssembly")) - ignore(GetString("fsiBindingSessionTo")) - ignore(GetString("fsiProductName")) - ignore(GetString("fsiProductNameCommunity")) - ignore(GetString("shadowCopyReferences")) - () From d59d380689cc022759c0c7da1a81d67944c89e51 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Thu, 16 May 2019 22:47:06 -0700 Subject: [PATCH 044/159] remove bad option (#6758) --- azure-pipelines.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 750cd0b5db..e91647ea51 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -38,8 +38,9 @@ jobs: jobs: - job: Full_Signed pool: - name: NetCoreInternal-Pool - queue: buildpool.windows.10.amd64.vs2017 + name: NetCoreInternal-Int-Pool + queue: buildpool.windows.10.amd64.vs2019 + timeoutInMinutes: 300 variables: - group: DotNet-Blob-Feed - group: DotNet-Symbol-Server-Pats @@ -54,7 +55,6 @@ jobs: -configuration $(_BuildConfig) -prepareMachine -testAll - -warnaserror:0 /p:SignType=$(_SignType) /p:DotNetSignType=$(_SignType) /p:MicroBuild_SigningEnabled=true From 4d0ed2111b9ddf864fa07753854d047c5382504e Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Fri, 17 May 2019 15:25:32 -0700 Subject: [PATCH 045/159] Enable roll forward in our .NET Core exes This changes our build to mark all of our .NET Core applications as rolling forward on major / minor versions of the .NET framework. Presently our tools ship inside both .NET Core 2 and 3 SDKs. This setting allows our tools to run unmodified in both settings. --- DEVGUIDE.md | 1 + FSharpBuild.Directory.Build.targets | 1 + eng/Build.ps1 | 5 +++++ eng/build.sh | 3 +++ eng/config/runtimeconfig.template.json | 3 +++ eng/targets/Imports.targets | 9 +++++++++ 6 files changed, 22 insertions(+) create mode 100644 eng/config/runtimeconfig.template.json create mode 100644 eng/targets/Imports.targets diff --git a/DEVGUIDE.md b/DEVGUIDE.md index 303ef89c2e..52fdb20cce 100644 --- a/DEVGUIDE.md +++ b/DEVGUIDE.md @@ -27,6 +27,7 @@ Follow the instructions below to build and develop the F# Compiler, Core Library Install - [.NET Framework 4.7.2](https://dotnet.microsoft.com/download/dotnet-framework/net472) +- [.NET Core 3 SDK](https://dotnet.microsoft.com/download/dotnet-core/3.0) **NOTE on Windows:** diff --git a/FSharpBuild.Directory.Build.targets b/FSharpBuild.Directory.Build.targets index 1d9828726b..70ef0b1b50 100644 --- a/FSharpBuild.Directory.Build.targets +++ b/FSharpBuild.Directory.Build.targets @@ -1,5 +1,6 @@ + diff --git a/eng/Build.ps1 b/eng/Build.ps1 index 6b85aaef9c..68928ace71 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -233,6 +233,11 @@ try { if ($ci) { Prepare-TempDir + + # enable us to build netcoreapp2.1 binaries + $global:_DotNetInstallDir = Join-Path $RepoRoot ".dotnet" + InstallDotNetSdk $global:_DotNetInstallDir $GlobalJson.tools.dotnet + InstallDotNetSdk $global:_DotNetInstallDir "2.1.503" } if ($bootstrap) { diff --git a/eng/build.sh b/eng/build.sh index 58b283ff39..23b00ef66a 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -237,6 +237,9 @@ function BuildSolution { InitializeDotNetCli $restore +# enable us to build netcoreapp2.1 binaries +InstallDotNetSdk $_InitializeDotNetCli 2.1.503 + BuildSolution if [[ "$test_core_clr" == true ]]; then diff --git a/eng/config/runtimeconfig.template.json b/eng/config/runtimeconfig.template.json new file mode 100644 index 0000000000..a3075303ad --- /dev/null +++ b/eng/config/runtimeconfig.template.json @@ -0,0 +1,3 @@ +{ + "rollForwardOnNoCandidateFx": 2 +} diff --git a/eng/targets/Imports.targets b/eng/targets/Imports.targets new file mode 100644 index 0000000000..c13c86875d --- /dev/null +++ b/eng/targets/Imports.targets @@ -0,0 +1,9 @@ + + + + $(RepositoryEngineeringDir)config\runtimeconfig.template.json + + From fd374c7bc071e1da78b3bf64b513d99682d58b02 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Mon, 20 May 2019 10:28:26 -0700 Subject: [PATCH 046/159] enable PR checks on `fsharp47` and `fsharp5` branches --- azure-pipelines.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e91647ea51..c99cfd9dfd 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -6,6 +6,8 @@ trigger: pr: - master - dev16.1 +- fsharp47 +- fsharp5 - release/* variables: From b4086f4a0334a9ea30187b9edea8e449aae0fd39 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Mon, 20 May 2019 11:04:12 -0700 Subject: [PATCH 047/159] FX_NO_REFLECTION_METADATA_TOKENS is never set in our build (#6769) --- src/fsharp/ExtensionTyping.fs | 2 - src/fsharp/ExtensionTyping.fsi | 2 - src/fsharp/FSharp.Core/Linq.fs | 2 - src/fsharp/FSharp.Core/quotations.fs | 121 --------------------------- 4 files changed, 127 deletions(-) diff --git a/src/fsharp/ExtensionTyping.fs b/src/fsharp/ExtensionTyping.fs index 9f58399d33..0513bcf2ee 100755 --- a/src/fsharp/ExtensionTyping.fs +++ b/src/fsharp/ExtensionTyping.fs @@ -637,9 +637,7 @@ module internal ExtensionTyping = static member CreateArray ctxt xs = match xs with null -> null | _ -> xs |> Array.map (ProvidedMethodInfo.Create ctxt) member __.Handle = x -#if !FX_NO_REFLECTION_METADATA_TOKENS member __.MetadataToken = x.MetadataToken -#endif override __.Equals y = assert false; match y with :? ProvidedMethodInfo as y -> x.Equals y.Handle | _ -> false override __.GetHashCode() = assert false; x.GetHashCode() diff --git a/src/fsharp/ExtensionTyping.fsi b/src/fsharp/ExtensionTyping.fsi index d4b58be8cb..5049fffa77 100755 --- a/src/fsharp/ExtensionTyping.fsi +++ b/src/fsharp/ExtensionTyping.fsi @@ -181,9 +181,7 @@ module internal ExtensionTyping = ProvidedMethodInfo = inherit ProvidedMethodBase member ReturnType : ProvidedType -#if !FX_NO_REFLECTION_METADATA_TOKENS member MetadataToken : int -#endif and [] ProvidedParameterInfo = diff --git a/src/fsharp/FSharp.Core/Linq.fs b/src/fsharp/FSharp.Core/Linq.fs index 68e8fde5fe..4663e6f79a 100644 --- a/src/fsharp/FSharp.Core/Linq.fs +++ b/src/fsharp/FSharp.Core/Linq.fs @@ -235,9 +235,7 @@ module LeafExpressionConverter = match tm with | Call(obj, minfo2, args) when ( -#if !FX_NO_REFLECTION_METADATA_TOKENS minfo.MetadataToken = minfo2.MetadataToken && -#endif if isg1 then minfo2.IsGenericMethod && gmd = minfo2.GetGenericMethodDefinition() else minfo = minfo2 ) -> diff --git a/src/fsharp/FSharp.Core/quotations.fs b/src/fsharp/FSharp.Core/quotations.fs index 55694d22ad..efd9763e1c 100644 --- a/src/fsharp/FSharp.Core/quotations.fs +++ b/src/fsharp/FSharp.Core/quotations.fs @@ -132,12 +132,10 @@ type Var(name: string, typ:Type, ?isMutable: bool) = if System.Object.ReferenceEquals(v, v2) then 0 else let c = compare v.Name v2.Name if c <> 0 then c else -#if !FX_NO_REFLECTION_METADATA_TOKENS // not available on Compact Framework let c = compare v.Type.MetadataToken v2.Type.MetadataToken if c <> 0 then c else let c = compare v.Type.Module.MetadataToken v2.Type.Module.MetadataToken if c <> 0 then c else -#endif let c = compare v.Type.Assembly.FullName v2.Type.Assembly.FullName if c <> 0 then c else compare v.Stamp v2.Stamp @@ -1686,7 +1684,6 @@ module Patterns = let decodedTopResources = new Dictionary(10, HashIdentity.Structural) -#if !FX_NO_REFLECTION_METADATA_TOKENS #if FX_NO_REFLECTION_MODULE_HANDLES // not available on Silverlight [] type ModuleHandle = ModuleHandle of string * string @@ -1695,130 +1692,12 @@ module Patterns = #else type ModuleHandle = System.ModuleHandle #endif -#endif - -#if FX_NO_REFLECTION_METADATA_TOKENS // not available on Compact Framework - [] - type ReflectedDefinitionTableKey = - // Key is declaring type * type parameters count * name * parameter types * return type - // Registered reflected definitions can contain generic methods or constructors in generic types, - // however TryGetReflectedDefinition can be queried with concrete instantiations of the same methods that doesn't contain type parameters. - // To make these two cases match we apply the following transformations: - // 1. if declaring type is generic - key will contain generic type definition, otherwise - type itself - // 2. if method is instantiation of generic one - pick parameters from generic method definition, otherwise - from methods itself - // 3 if method is constructor and declaring type is generic then we'll use the following trick to treat C<'a>() and C() as the same type - // - we resolve method handle of the constructor using generic type definition - as a result for constructor from instantiated type we obtain matching constructor in generic type definition - | Key of System.Type * int * string * System.Type[] * System.Type - static member GetKey(methodBase:MethodBase) = - let isGenericType = methodBase.DeclaringType.IsGenericType - let declaringType = - if isGenericType then - methodBase.DeclaringType.GetGenericTypeDefinition() - else methodBase.DeclaringType - let tyArgsCount = - if methodBase.IsGenericMethod then - methodBase.GetGenericArguments().Length - else 0 -#if FX_RESHAPED_REFLECTION - // this is very unfortunate consequence of limited Reflection capabilities on .NETCore - // what we want: having MethodBase for some concrete method or constructor we would like to locate corresponding MethodInfo\ConstructorInfo from the open generic type (canonical form). - // It is necessary to build the key for the table of reflected definitions: reflection definition is saved for open generic type but user may request it using - // arbitrary instantiation. - let findMethodInOpenGenericType (mb : ('T :> MethodBase)) : 'T = - let candidates = - let bindingFlags = - (if mb.IsPublic then BindingFlags.Public else BindingFlags.NonPublic) ||| - (if mb.IsStatic then BindingFlags.Static else BindingFlags.Instance) - let candidates : MethodBase[] = - downcast ( - if mb.IsConstructor then - box (declaringType.GetConstructors bindingFlags) - else - box (declaringType.GetMethods bindingFlags) - ) - candidates |> Array.filter (fun c -> - c.Name = mb.Name && - (c.GetParameters().Length) = (mb.GetParameters().Length) && - (c.IsGenericMethod = mb.IsGenericMethod) && - (if c.IsGenericMethod then c.GetGenericArguments().Length = mb.GetGenericArguments().Length else true) - ) - let solution = - if candidates.Length = 0 then failwith "Unexpected, failed to locate matching method" - elif candidates.Length = 1 then candidates.[0] - else - // here we definitely know that candidates - // a. has matching name - // b. has the same number of arguments - // c. has the same number of type parameters if any - - let originalParameters = mb.GetParameters() - let originalTypeArguments = mb.DeclaringType.GetGenericArguments() - let EXACT_MATCHING_COST = 2 - let GENERIC_TYPE_MATCHING_COST = 1 - - // loops through the parameters and computes the rate of the current candidate. - // having the argument: - // - rate is increased on EXACT_MATCHING_COST if type of argument that candidate has at position i exactly matched the type of argument for the original method. - // - rate is increased on GENERIC_TYPE_MATCHING_COST if candidate has generic argument at given position and its type matched the type of argument for the original method. - // - otherwise rate will be 0 - let evaluateCandidate (mb : MethodBase) : int = - let parameters = mb.GetParameters() - let rec loop i resultSoFar = - if i >= parameters.Length then resultSoFar - else - let p = parameters.[i] - let orig = originalParameters.[i] - if p.ParameterType = orig.ParameterType then loop (i + 1) (resultSoFar + EXACT_MATCHING_COST) // exact matching - elif p.ParameterType.IsGenericParameter && p.ParameterType.DeclaringType = mb.DeclaringType then - let pos = p.ParameterType.GenericParameterPosition - if originalTypeArguments.[pos] = orig.ParameterType then loop (i + 1) (resultSoFar + GENERIC_TYPE_MATCHING_COST) - else 0 - else - 0 - - loop 0 0 - - Array.maxBy evaluateCandidate candidates - - solution :?> 'T -#endif - match methodBase with - | :? MethodInfo as mi -> - let mi = - if mi.IsGenericMethod then - let mi = mi.GetGenericMethodDefinition() - if isGenericType then -#if FX_RESHAPED_REFLECTION - findMethodInOpenGenericType mi -#else - MethodBase.GetMethodFromHandle(mi.MethodHandle, declaringType.TypeHandle) :?> MethodInfo -#endif - else - mi - else mi - let paramTypes = mi.GetParameters() |> getTypesFromParamInfos - Key(declaringType, tyArgsCount, methodBase.Name, paramTypes, mi.ReturnType) - | :? ConstructorInfo as ci -> - let mi = - if isGenericType then -#if FX_RESHAPED_REFLECTION - findMethodInOpenGenericType ci -#else - MethodBase.GetMethodFromHandle(ci. MethodHandle, declaringType.TypeHandle) :?> ConstructorInfo // convert ctor with concrete args to ctor with generic args -#endif - else - ci - let paramTypes = mi.GetParameters() |> getTypesFromParamInfos - Key(declaringType, tyArgsCount, methodBase.Name, paramTypes, declaringType) - | _ -> failwithf "Unexpected MethodBase type, %A" (methodBase.GetType()) // per MSDN ConstructorInfo and MethodInfo are the only derived types from MethodBase -#else [] type ReflectedDefinitionTableKey = | Key of ModuleHandle * int static member GetKey(methodBase:MethodBase) = Key(methodBase.Module.ModuleHandle, methodBase.MetadataToken) -#endif [] type ReflectedDefinitionTableEntry = Entry of Bindable From 7383ead4c5ba06fc893be16aacebc2863af32724 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Mon, 20 May 2019 11:07:14 -0700 Subject: [PATCH 048/159] enable CI builds on `fsharp47` and `fsharp5` branches --- azure-pipelines.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c99cfd9dfd..aa8a7d0c91 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,6 +2,8 @@ trigger: - master - dev16.1 +- fsharp47 +- fsharp5 - release/* pr: - master From 858642d53cfe68c9f161ad651a364c118cea64d0 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Mon, 20 May 2019 12:58:48 -0700 Subject: [PATCH 049/159] Preview package (#6761) * Allow targetting of preview FSharp.Core. Parameterize dsharp.core versions * Parameterise app.config generation * parameterize banner text * Do app.config right * fcs * fcs tests * add discriminator * Update FSharp.Compiler.Service.ProjectCrackerTool.fsproj * remove dead file --- FSharpBuild.Directory.Build.targets | 54 +++++++++++++++--- eng/Versions.props | 9 ++- fcs/Directory.Build.targets | 57 ++++++++++++++++++- .../FSharp.Compiler.Service.Tests.fsproj | 5 +- .../FSharp.Compiler.Service.fsproj | 1 + src/fsharp/FSComp.txt | 1 + src/fsharp/FSharp.Build/FSBuild.txt | 3 +- src/fsharp/FSharp.Build/FSharp.Build.fsproj | 9 ++- .../Microsoft.FSharp.NetSdk.props | 3 +- .../Microsoft.FSharp.NetSdk.targets | 6 ++ .../FSharp.Build/xlf/FSBuild.txt.cs.xlf | 5 ++ .../FSharp.Build/xlf/FSBuild.txt.de.xlf | 5 ++ .../FSharp.Build/xlf/FSBuild.txt.es.xlf | 5 ++ .../FSharp.Build/xlf/FSBuild.txt.fr.xlf | 5 ++ .../FSharp.Build/xlf/FSBuild.txt.it.xlf | 5 ++ .../FSharp.Build/xlf/FSBuild.txt.ja.xlf | 5 ++ .../FSharp.Build/xlf/FSBuild.txt.ko.xlf | 5 ++ .../FSharp.Build/xlf/FSBuild.txt.pl.xlf | 5 ++ .../FSharp.Build/xlf/FSBuild.txt.pt-BR.xlf | 5 ++ .../FSharp.Build/xlf/FSBuild.txt.ru.xlf | 5 ++ .../FSharp.Build/xlf/FSBuild.txt.tr.xlf | 5 ++ .../FSharp.Build/xlf/FSBuild.txt.zh-Hans.xlf | 5 ++ .../FSharp.Build/xlf/FSBuild.txt.zh-Hant.xlf | 5 ++ .../FSharp.Compiler.Private.fsproj | 1 + .../FSharp.Core/Testing.FSharp.Core.nuspec | 49 ---------------- src/fsharp/fsc/{app.config => App.config} | 2 +- src/fsharp/fsc/fsc.fsproj | 5 +- src/fsharp/fsi/{app.config => App.config} | 2 +- src/fsharp/fsi/fsi.fsproj | 5 +- .../fsiAnyCpu/{app.config => App.config} | 2 +- src/fsharp/fsiAnyCpu/fsiAnyCpu.fsproj | 5 +- src/fsharp/xlf/FSComp.txt.cs.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.de.xlf | 5 ++ src/fsharp/xlf/FSComp.txt.es.xlf | 7 ++- 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 ++ src/utils/CompilerLocationUtils.fs | 10 +++- ...osoft.VisualStudio.Editors.Designer.cs.xlf | 2 +- ...osoft.VisualStudio.Editors.Designer.de.xlf | 2 +- ...osoft.VisualStudio.Editors.Designer.es.xlf | 2 +- ...osoft.VisualStudio.Editors.Designer.fr.xlf | 2 +- ...osoft.VisualStudio.Editors.Designer.it.xlf | 2 +- ...osoft.VisualStudio.Editors.Designer.ja.xlf | 2 +- ...osoft.VisualStudio.Editors.Designer.ko.xlf | 2 +- ...osoft.VisualStudio.Editors.Designer.pl.xlf | 2 +- ...ft.VisualStudio.Editors.Designer.pt-BR.xlf | 2 +- ...osoft.VisualStudio.Editors.Designer.ru.xlf | 2 +- ...osoft.VisualStudio.Editors.Designer.tr.xlf | 2 +- ....VisualStudio.Editors.Designer.zh-Hans.xlf | 2 +- ....VisualStudio.Editors.Designer.zh-Hant.xlf | 2 +- vsintegration/tests/UnitTests/App.config | 2 +- .../UnitTests/VisualFSharp.UnitTests.fsproj | 10 ++-- 60 files changed, 306 insertions(+), 93 deletions(-) delete mode 100644 src/fsharp/FSharp.Core/Testing.FSharp.Core.nuspec rename src/fsharp/fsc/{app.config => App.config} (87%) rename src/fsharp/fsi/{app.config => App.config} (86%) rename src/fsharp/fsiAnyCpu/{app.config => App.config} (87%) diff --git a/FSharpBuild.Directory.Build.targets b/FSharpBuild.Directory.Build.targets index 70ef0b1b50..742f43fb3f 100644 --- a/FSharpBuild.Directory.Build.targets +++ b/FSharpBuild.Directory.Build.targets @@ -5,23 +5,59 @@ - - $(CompileDependsOn);CopyAndSubstituteTextFiles - - + Outputs="@(CopyAndSubstituteText->'$(IntermediateOutputPath)%(Filename)%(Extension)')" + BeforeTargets="BeforeBuild"> + + <__TargetFilePath>@(CopyAndSubstituteText->'$(IntermediateOutputPath)%(Filename)%(Extension)') + <__TargetFileName>@(CopyAndSubstituteText->'%(Filename)%(Extension)') + <_ReplacementText>$([System.IO.File]::ReadAllText('%(CopyAndSubstituteText.FullPath)')) <_ReplacementText Condition="'%(CopyAndSubstituteText.Pattern1)' != ''">$(_ReplacementText.Replace('%(CopyAndSubstituteText.Pattern1)', '%(CopyAndSubstituteText.Replacement1)')) <_ReplacementText Condition="'%(CopyAndSubstituteText.Pattern2)' != ''">$(_ReplacementText.Replace('%(CopyAndSubstituteText.Pattern2)', '%(CopyAndSubstituteText.Replacement2)')) - + + + + + + + + + + + + + + + + <_BuildPropertyLines Remove="@(_BuildPropertyLines)" /> + <_BuildPropertyLines Include="// <auto-generated >" /> + <_BuildPropertyLines Include="// <Generated by the FSharp WriteCodeFragment class./>" /> + <_BuildPropertyLines Include="// </auto-generated/>" /> + <_BuildPropertyLines Include="//" /> + <_BuildPropertyLines Include="module internal FSharp.BuildProperties" /> + <_BuildPropertyLines Include="let fsProductVersion = "$(FSPRODUCTVERSION)"" /> + <_BuildPropertyLines Include="let fsLanguageVersion = "$(FSLANGUAGEVERSION)"" /> + + + + + - - - + + + + diff --git a/eng/Versions.props b/eng/Versions.props index b7706f695e..40d00b05a9 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -12,10 +12,15 @@ beta - 4.6 + 4.6 + $(FSLanguageVersion) $(FSCoreMajorVersion).3 $(FSCoreMajorVersion).0 $(FSCoreVersionPrefix).0 + + 4.6.2 + + $(FSCorePackageVersion)-$(PreReleaseVersionLabel).* 10.4 @@ -184,4 +189,4 @@ 1.0.0-beta2-dev3 5.22.2.1 - + \ No newline at end of file diff --git a/fcs/Directory.Build.targets b/fcs/Directory.Build.targets index bb5b23d29d..ea3d9bd8c4 100644 --- a/fcs/Directory.Build.targets +++ b/fcs/Directory.Build.targets @@ -1,3 +1,58 @@ - + + + + + <__TargetFilePath>@(CopyAndSubstituteText->'$(IntermediateOutputPath)%(Filename)%(Extension)') + <__TargetFileName>@(CopyAndSubstituteText->'%(Filename)%(Extension)') + + <_ReplacementText>$([System.IO.File]::ReadAllText('%(CopyAndSubstituteText.FullPath)')) + <_ReplacementText Condition="'%(CopyAndSubstituteText.Pattern1)' != ''">$(_ReplacementText.Replace('%(CopyAndSubstituteText.Pattern1)', '%(CopyAndSubstituteText.Replacement1)')) + <_ReplacementText Condition="'%(CopyAndSubstituteText.Pattern2)' != ''">$(_ReplacementText.Replace('%(CopyAndSubstituteText.Pattern2)', '%(CopyAndSubstituteText.Replacement2)')) + + + + + + + + + + + + + + + + + <_BuildPropertyLines Remove="@(_BuildPropertyLines)" /> + <_BuildPropertyLines Include="// <auto-generated >" /> + <_BuildPropertyLines Include="// <Generated by the FSharp WriteCodeFragment class./>" /> + <_BuildPropertyLines Include="// </auto-generated/>" /> + <_BuildPropertyLines Include="//" /> + <_BuildPropertyLines Include="module internal FSharp.BuildProperties" /> + <_BuildPropertyLines Include="let fsProductVersion = "$(FSPRODUCTVERSION)"" /> + <_BuildPropertyLines Include="let fsLanguageVersion = "$(FSLANGUAGEVERSION)"" /> + + + + + + + + + + + + diff --git a/fcs/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj b/fcs/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj index 1f7ffbf6d5..9f16ede65d 100644 --- a/fcs/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj +++ b/fcs/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj @@ -73,7 +73,10 @@ Program.fs - + + {{FSCoreVersion}} + $(FSCoreVersion) + diff --git a/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj b/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj index 81db7f54c5..134a3ca745 100644 --- a/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj +++ b/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj @@ -8,6 +8,7 @@ $(DefineConstants);COMPILER $(DefineConstants);ENABLE_MONO_SUPPORT $(DefineConstants);NO_STRONG_NAMES + $(DefineConstants);LOCALIZATION_FSCOMP $(TargetFramework)\ $(TargetFramework)\ $(OtherFlags) /warnon:1182 diff --git a/src/fsharp/FSComp.txt b/src/fsharp/FSComp.txt index c28343c01b..ee2b41f2e9 100644 --- a/src/fsharp/FSComp.txt +++ b/src/fsharp/FSComp.txt @@ -1462,3 +1462,4 @@ notAFunctionButMaybeDeclaration,"This value is not a function and cannot be appl 3300,chkInvalidFunctionParameterType,"The parameter '%s' has an invalid type '%s'. This is not permitted by the rules of Common IL." 3301,chkInvalidFunctionReturnType,"The function or method has an invalid return type '%s'. This is not permitted by the rules of Common IL." useSdkRefs,"Use reference assemblies for .NET framework references when available (Enabled by default)." +fSharpBannerVersion,"%s for F# %s" diff --git a/src/fsharp/FSharp.Build/FSBuild.txt b/src/fsharp/FSharp.Build/FSBuild.txt index 10fdedb215..47d1ee7431 100644 --- a/src/fsharp/FSharp.Build/FSBuild.txt +++ b/src/fsharp/FSharp.Build/FSBuild.txt @@ -1,2 +1,3 @@ # FSharp.Build resource strings -toolpathUnknown,"ToolPath is unknown; specify the path to the tool." \ No newline at end of file +toolpathUnknown,"ToolPath is unknown; specify the path to the tool." +fSharpBannerVersion,"%s for F# %s" diff --git a/src/fsharp/FSharp.Build/FSharp.Build.fsproj b/src/fsharp/FSharp.Build/FSharp.Build.fsproj index c236fbd864..ef4d013dc1 100644 --- a/src/fsharp/FSharp.Build/FSharp.Build.fsproj +++ b/src/fsharp/FSharp.Build/FSharp.Build.fsproj @@ -11,6 +11,7 @@ true $(OtherFlags) --maxerrors:20 --extraoptimizationloops:1 true + $(DefineConstants);LOCALIZATION_FSBUILD @@ -27,8 +28,14 @@ - + + Microsoft.FSharp.NetSdk.props + {{FSharpCoreShippedPackageVersion}} + $(FSharpCoreShippedPackageVersion) + {{FSharpCorePreviewPackageVersion}} + $(FSharpCorePreviewPackageVersion) + diff --git a/src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.props b/src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.props index 2d07d58ce6..1b40e6675e 100644 --- a/src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.props +++ b/src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.props @@ -74,7 +74,8 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and 4.4.0 - 4.6.2 + {{FSharpCoreShippedPackageVersion}} + {{FSharpCorePreviewPackageVersion}} $(DefaultValueTuplePackageVersion) $(DefaultFSharpCorePackageVersion) diff --git a/src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.targets b/src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.targets index 0e4aab34d7..282166c98d 100644 --- a/src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.targets +++ b/src/fsharp/FSharp.Build/Microsoft.FSharp.NetSdk.targets @@ -52,6 +52,12 @@ WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and $(TargetsForTfmSpecificContentInPackage);PackageFSharpDesignTimeTools + + + $(DefaultFSharpCorePreviewPackageVersion) + $(RestoreSources); https://dotnet.myget.org/F/fsharp/api/v3/index.json + + fsharp41 diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.cs.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.cs.xlf index 374f1770bb..64e44dc099 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.cs.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.cs.xlf @@ -2,6 +2,11 @@ + + {0} for F# {1} + {0} for F# {1} + + ToolPath is unknown; specify the path to the tool. Parametr ToolPath není známý. Zadejte cestu k nástroji. diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.de.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.de.xlf index c5a6cb42c9..1865fb58fe 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.de.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.de.xlf @@ -2,6 +2,11 @@ + + {0} for F# {1} + {0} for F# {1} + + ToolPath is unknown; specify the path to the tool. ToolPath unbekannt. Geben Sie den Pfad zum Tool an. diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.es.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.es.xlf index 4791cd16b2..05929de603 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.es.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.es.xlf @@ -2,6 +2,11 @@ + + {0} for F# {1} + {0} for F# {1} + + ToolPath is unknown; specify the path to the tool. ToolPath se desconoce; especifique la ruta de acceso a la herramienta. diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.fr.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.fr.xlf index 79ddfd7ab2..22d534392f 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.fr.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.fr.xlf @@ -2,6 +2,11 @@ + + {0} for F# {1} + {0} for F# {1} + + ToolPath is unknown; specify the path to the tool. ToolPath est inconnu, spécifiez le chemin de l'outil. diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.it.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.it.xlf index a7dd116bb4..2e707f2508 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.it.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.it.xlf @@ -2,6 +2,11 @@ + + {0} for F# {1} + {0} for F# {1} + + ToolPath is unknown; specify the path to the tool. Il valore di ToolPath è sconosciuto. Specificare il percorso dello strumento. diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ja.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ja.xlf index e26503cb96..627dc44db2 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ja.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ja.xlf @@ -2,6 +2,11 @@ + + {0} for F# {1} + {0} for F# {1} + + ToolPath is unknown; specify the path to the tool. ToolPath が不明です。ツールンパスを指定します。 diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ko.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ko.xlf index 4c14165867..f337b0ad28 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ko.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ko.xlf @@ -2,6 +2,11 @@ + + {0} for F# {1} + {0} for F# {1} + + ToolPath is unknown; specify the path to the tool. ToolPath를 알 수 없습니다. 도구 경로를 지정하세요. diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.pl.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.pl.xlf index b7734b58a7..f88076689a 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.pl.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.pl.xlf @@ -2,6 +2,11 @@ + + {0} for F# {1} + {0} for F# {1} + + ToolPath is unknown; specify the path to the tool. Właściwość ToolPath jest nieznana. Określ ścieżkę do narzędzia. diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.pt-BR.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.pt-BR.xlf index 865c593fd0..e6c5b3c601 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.pt-BR.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.pt-BR.xlf @@ -2,6 +2,11 @@ + + {0} for F# {1} + {0} for F# {1} + + ToolPath is unknown; specify the path to the tool. ToolPath desconhecido. Especifique o caminho para a ferramenta. diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ru.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ru.xlf index b1fef639ee..b84d44d49d 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ru.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ru.xlf @@ -2,6 +2,11 @@ + + {0} for F# {1} + {0} for F# {1} + + ToolPath is unknown; specify the path to the tool. Путь к инструменту (ToolPath) неизвестен, укажите путь к инструменту. diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.tr.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.tr.xlf index 4dd43b3553..02194a2720 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.tr.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.tr.xlf @@ -2,6 +2,11 @@ + + {0} for F# {1} + {0} for F# {1} + + ToolPath is unknown; specify the path to the tool. ToolPath bilinmiyor; aracın yolunu belirtin. diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.zh-Hans.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.zh-Hans.xlf index bf5016a368..12ae0131cb 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.zh-Hans.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.zh-Hans.xlf @@ -2,6 +2,11 @@ + + {0} for F# {1} + {0} for F# {1} + + ToolPath is unknown; specify the path to the tool. ToolPath 未知;请指定工具的路径。 diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.zh-Hant.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.zh-Hant.xlf index 0e30a5cfec..c18392ba1d 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.zh-Hant.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.zh-Hant.xlf @@ -2,6 +2,11 @@ + + {0} for F# {1} + {0} for F# {1} + + ToolPath is unknown; specify the path to the tool. ToolPath 未知; 請指定工具的路徑。 diff --git a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj index 0bc20b9046..ebef5fb040 100644 --- a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj +++ b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj @@ -11,6 +11,7 @@ true $(DefineConstants);COMPILER $(DefineConstants);MSBUILD_AT_LEAST_15 + $(DefineConstants);LOCALIZATION_FCOMP $(OtherFlags) --warnon:1182 --maxerrors:20 --extraoptimizationloops:1 true diff --git a/src/fsharp/FSharp.Core/Testing.FSharp.Core.nuspec b/src/fsharp/FSharp.Core/Testing.FSharp.Core.nuspec deleted file mode 100644 index 746986fc7a..0000000000 --- a/src/fsharp/FSharp.Core/Testing.FSharp.Core.nuspec +++ /dev/null @@ -1,49 +0,0 @@ - - - - Testing.FSharp.Core - - .NET Core compatible version of the fsharp core library FSharp.Core.dll - Supported Platforms: - .NET Core (netstandard1.6) - - en-US - true - $version$ - $authors$ - $licenseUrl$ - $projectUrl$ - $tags$ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/fsharp/fsc/app.config b/src/fsharp/fsc/App.config similarity index 87% rename from src/fsharp/fsc/app.config rename to src/fsharp/fsc/App.config index 68fff88101..3e0f05bbf9 100644 --- a/src/fsharp/fsc/app.config +++ b/src/fsharp/fsc/App.config @@ -6,7 +6,7 @@ - + diff --git a/src/fsharp/fsc/fsc.fsproj b/src/fsharp/fsc/fsc.fsproj index 9cec3fb314..8e5dce90af 100644 --- a/src/fsharp/fsc/fsc.fsproj +++ b/src/fsharp/fsc/fsc.fsproj @@ -21,11 +21,14 @@ fscmain.fs - default.win32manifest PreserveNewest + + {{FSCoreVersion}} + $(FSCoreVersion) + diff --git a/src/fsharp/fsi/app.config b/src/fsharp/fsi/App.config similarity index 86% rename from src/fsharp/fsi/app.config rename to src/fsharp/fsi/App.config index 818ebc93b4..43f1fdd57e 100644 --- a/src/fsharp/fsi/app.config +++ b/src/fsharp/fsi/App.config @@ -5,7 +5,7 @@ - + diff --git a/src/fsharp/fsi/fsi.fsproj b/src/fsharp/fsi/fsi.fsproj index 4b92a354ab..d091baf9f9 100644 --- a/src/fsharp/fsi/fsi.fsproj +++ b/src/fsharp/fsi/fsi.fsproj @@ -22,7 +22,10 @@ - + + {{FSCoreVersion}} + $(FSCoreVersion) + diff --git a/src/fsharp/fsiAnyCpu/app.config b/src/fsharp/fsiAnyCpu/App.config similarity index 87% rename from src/fsharp/fsiAnyCpu/app.config rename to src/fsharp/fsiAnyCpu/App.config index 6e8f1eb908..af303c8db1 100644 --- a/src/fsharp/fsiAnyCpu/app.config +++ b/src/fsharp/fsiAnyCpu/App.config @@ -6,7 +6,7 @@ - + diff --git a/src/fsharp/fsiAnyCpu/fsiAnyCpu.fsproj b/src/fsharp/fsiAnyCpu/fsiAnyCpu.fsproj index dbe31f6ec2..cbd4f7103a 100644 --- a/src/fsharp/fsiAnyCpu/fsiAnyCpu.fsproj +++ b/src/fsharp/fsiAnyCpu/fsiAnyCpu.fsproj @@ -22,7 +22,10 @@ - + + {{FSCoreVersion}} + $(FSCoreVersion) + diff --git a/src/fsharp/xlf/FSComp.txt.cs.xlf b/src/fsharp/xlf/FSComp.txt.cs.xlf index 23ea06f75a..b3d508d082 100644 --- a/src/fsharp/xlf/FSComp.txt.cs.xlf +++ b/src/fsharp/xlf/FSComp.txt.cs.xlf @@ -2,6 +2,11 @@ + + {0} for F# {1} + {0} for F# {1} + + The namespace '{0}' is not defined. Není definovaný obor názvů {0}. diff --git a/src/fsharp/xlf/FSComp.txt.de.xlf b/src/fsharp/xlf/FSComp.txt.de.xlf index 7c13cf3c31..41c117c785 100644 --- a/src/fsharp/xlf/FSComp.txt.de.xlf +++ b/src/fsharp/xlf/FSComp.txt.de.xlf @@ -2,6 +2,11 @@ + + {0} for F# {1} + {0} for F# {1} + + The namespace '{0}' is not defined. Der Namespace "{0}" ist nicht definiert. diff --git a/src/fsharp/xlf/FSComp.txt.es.xlf b/src/fsharp/xlf/FSComp.txt.es.xlf index f3c85065ce..0afc48bb2c 100644 --- a/src/fsharp/xlf/FSComp.txt.es.xlf +++ b/src/fsharp/xlf/FSComp.txt.es.xlf @@ -2,6 +2,11 @@ + + {0} for F# {1} + {0} for F# {1} + + The namespace '{0}' is not defined. El espacio de nombres "{0}" no está definido. @@ -109,7 +114,7 @@ All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. - Todas las ramas de una expresión de coincidencia de patrón deben devolver valores del mismo tipo. La primera rama devolvió un valor de tipo "{0}", pero esta rama devolvió un valor de tipo "\{1 \}". + All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. diff --git a/src/fsharp/xlf/FSComp.txt.fr.xlf b/src/fsharp/xlf/FSComp.txt.fr.xlf index f7a5bc4332..32d85d1e78 100644 --- a/src/fsharp/xlf/FSComp.txt.fr.xlf +++ b/src/fsharp/xlf/FSComp.txt.fr.xlf @@ -2,6 +2,11 @@ + + {0} for F# {1} + {0} for F# {1} + + The namespace '{0}' is not defined. L'espace de noms '{0}' n'est pas défini. diff --git a/src/fsharp/xlf/FSComp.txt.it.xlf b/src/fsharp/xlf/FSComp.txt.it.xlf index 8e4eccbd9c..a7e0a7b48d 100644 --- a/src/fsharp/xlf/FSComp.txt.it.xlf +++ b/src/fsharp/xlf/FSComp.txt.it.xlf @@ -2,6 +2,11 @@ + + {0} for F# {1} + {0} for F# {1} + + The namespace '{0}' is not defined. Lo spazio dei nomi '{0}' non è definito. diff --git a/src/fsharp/xlf/FSComp.txt.ja.xlf b/src/fsharp/xlf/FSComp.txt.ja.xlf index b49ebd63d9..328322d38c 100644 --- a/src/fsharp/xlf/FSComp.txt.ja.xlf +++ b/src/fsharp/xlf/FSComp.txt.ja.xlf @@ -2,6 +2,11 @@ + + {0} for F# {1} + {0} for F# {1} + + The namespace '{0}' is not defined. 名前空間 '{0}' が定義されていません。 diff --git a/src/fsharp/xlf/FSComp.txt.ko.xlf b/src/fsharp/xlf/FSComp.txt.ko.xlf index 4f106b5795..720db8bff6 100644 --- a/src/fsharp/xlf/FSComp.txt.ko.xlf +++ b/src/fsharp/xlf/FSComp.txt.ko.xlf @@ -2,6 +2,11 @@ + + {0} for F# {1} + {0} for F# {1} + + The namespace '{0}' is not defined. '{0}' 네임스페이스가 정의되지 않았습니다. diff --git a/src/fsharp/xlf/FSComp.txt.pl.xlf b/src/fsharp/xlf/FSComp.txt.pl.xlf index 15ac9b912c..ef4db0d67c 100644 --- a/src/fsharp/xlf/FSComp.txt.pl.xlf +++ b/src/fsharp/xlf/FSComp.txt.pl.xlf @@ -2,6 +2,11 @@ + + {0} for F# {1} + {0} for F# {1} + + The namespace '{0}' is not defined. Nie zdefiniowano przestrzeni nazw „{0}”. diff --git a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf index 1d50b7356c..504db8484b 100644 --- a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf +++ b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf @@ -2,6 +2,11 @@ + + {0} for F# {1} + {0} for F# {1} + + The namespace '{0}' is not defined. O namespace '{0}' não está definido. diff --git a/src/fsharp/xlf/FSComp.txt.ru.xlf b/src/fsharp/xlf/FSComp.txt.ru.xlf index 5e54c71aa4..978ab1c59e 100644 --- a/src/fsharp/xlf/FSComp.txt.ru.xlf +++ b/src/fsharp/xlf/FSComp.txt.ru.xlf @@ -2,6 +2,11 @@ + + {0} for F# {1} + {0} for F# {1} + + The namespace '{0}' is not defined. Пространство имен "{0}" не определено. diff --git a/src/fsharp/xlf/FSComp.txt.tr.xlf b/src/fsharp/xlf/FSComp.txt.tr.xlf index c3f580ec6b..2e884168dd 100644 --- a/src/fsharp/xlf/FSComp.txt.tr.xlf +++ b/src/fsharp/xlf/FSComp.txt.tr.xlf @@ -2,6 +2,11 @@ + + {0} for F# {1} + {0} for F# {1} + + The namespace '{0}' is not defined. '{0}' ad alanı tanımlı değil. diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf index 99e41ca6b9..e87d047a13 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf @@ -2,6 +2,11 @@ + + {0} for F# {1} + {0} for F# {1} + + The namespace '{0}' is not defined. 未定义命名空间“{0}”。 diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf index 70b7a400f4..98ed811142 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf @@ -2,6 +2,11 @@ + + {0} for F# {1} + {0} for F# {1} + + The namespace '{0}' is not defined. 未定義命名空間 '{0}'。 diff --git a/src/utils/CompilerLocationUtils.fs b/src/utils/CompilerLocationUtils.fs index 84a0dfbfd4..41de8bb911 100644 --- a/src/utils/CompilerLocationUtils.fs +++ b/src/utils/CompilerLocationUtils.fs @@ -12,7 +12,15 @@ open System.Runtime.InteropServices module internal FSharpEnvironment = /// The F# version reported in the banner - let FSharpBannerVersion = "10.4.0 for F# 4.6" +#if LOCALIZATION_FSBUILD + let FSharpBannerVersion = FSBuild.SR.fSharpBannerVersion(FSharp.BuildProperties.fsProductVersion, FSharp.BuildProperties.fsLanguageVersion) +#else +#if LOCALIZATION_FSCOMP + let FSharpBannerVersion = FSComp.SR.fSharpBannerVersion(FSharp.BuildProperties.fsProductVersion, FSharp.BuildProperties.fsLanguageVersion) +#else + let FSharpBannerVersion = sprintf "%s for F# %s" (FSharp.BuildProperties.fsProductVersion) (FSharp.BuildProperties.fsLanguageVersion) +#endif +#endif let versionOf<'t> = #if FX_RESHAPED_REFLECTION diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.cs.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.cs.xlf index 96c40e377d..34d3f8e939 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.cs.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.cs.xlf @@ -1828,7 +1828,7 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size # {0} = width (as an integer) diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.de.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.de.xlf index 5af4039514..65b4328fdc 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.de.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.de.xlf @@ -1828,7 +1828,7 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size # {0} = width (as an integer) diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.es.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.es.xlf index 40d73cd4e8..e6d3f88032 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.es.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.es.xlf @@ -1828,7 +1828,7 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size # {0} = width (as an integer) diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.fr.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.fr.xlf index 83a941758a..d6eb96345c 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.fr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.fr.xlf @@ -1828,7 +1828,7 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size # {0} = width (as an integer) diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.it.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.it.xlf index fd7d41daa5..44ff0d0304 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.it.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.it.xlf @@ -1828,7 +1828,7 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size # {0} = width (as an integer) diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ja.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ja.xlf index cd4de3e846..b40e048941 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ja.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ja.xlf @@ -1828,7 +1828,7 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size # {0} = width (as an integer) diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ko.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ko.xlf index 8951b09f12..c8b592b4d3 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ko.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ko.xlf @@ -1828,7 +1828,7 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size # {0} = width (as an integer) diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pl.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pl.xlf index e75adbf369..a1396dd274 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pl.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pl.xlf @@ -1828,7 +1828,7 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size # {0} = width (as an integer) diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pt-BR.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pt-BR.xlf index 3cd5702720..3e8a169348 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pt-BR.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pt-BR.xlf @@ -1828,7 +1828,7 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size # {0} = width (as an integer) diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ru.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ru.xlf index 94a58397fe..2b5303d91d 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ru.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ru.xlf @@ -1828,7 +1828,7 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size # {0} = width (as an integer) diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.tr.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.tr.xlf index 84703a61bd..b6029ff9b5 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.tr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.tr.xlf @@ -1828,7 +1828,7 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size # {0} = width (as an integer) diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hans.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hans.xlf index ccdc1a1939..7296c365e6 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hans.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hans.xlf @@ -1828,7 +1828,7 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size # {0} = width (as an integer) diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hant.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hant.xlf index 11c81c6df1..16b7339b2a 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hant.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hant.xlf @@ -1828,7 +1828,7 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size # {0} = width (as an integer) diff --git a/vsintegration/tests/UnitTests/App.config b/vsintegration/tests/UnitTests/App.config index 768fbe1d13..6df63308b2 100644 --- a/vsintegration/tests/UnitTests/App.config +++ b/vsintegration/tests/UnitTests/App.config @@ -40,7 +40,7 @@ - + diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj index e67623fd9f..e7adc88e63 100644 --- a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj @@ -165,12 +165,10 @@ Roslyn\DocumentHighlightsServiceTests.fs - - - PreserveNewest - - - + + {{FSCoreVersion}} + $(FSCoreVersion) + From feeb1dbb69a6e2713cba742be99fda1222b83dd5 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Mon, 20 May 2019 15:23:17 -0700 Subject: [PATCH 050/159] enable tests to be skipped during an official build (#6786) Primarily useful when testing build process changes. --- .vsts-signed.yaml | 9 ++++++++- azure-pipelines.yml | 7 +++++++ eng/Build.ps1 | 13 +++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/.vsts-signed.yaml b/.vsts-signed.yaml index 153f57ec84..3ec301bbe0 100644 --- a/.vsts-signed.yaml +++ b/.vsts-signed.yaml @@ -5,6 +5,12 @@ variables: - name: VisualStudioDropName value: Products/$(System.TeamProject)/$(Build.Repository.Name)/$(Build.SourceBranchName)/$(Build.BuildNumber) +# Variables defined in yml cannot be overridden at queue time; instead overridable variables must be defined in the web UI. +# Commenting out until something like this is supported: https://github.com/Microsoft/azure-pipelines-yaml/pull/129 +#variables: +#- name: SkipTests +# defaultValue: false + jobs: - job: Full_Signed pool: @@ -26,6 +32,7 @@ jobs: - script: eng\CIBuild.cmd -configuration $(BuildConfiguration) -testAll + -officialSkipTests $(SkipTests) /p:OfficialBuildId=$(BUILD.BUILDNUMBER) /p:VisualStudioDropName=$(VisualStudioDropName) /p:DotNetSignType=$(SignType) @@ -55,7 +62,7 @@ jobs: ArtifactName: 'Test Results' publishLocation: Container continueOnError: true - condition: succeededOrFailed() + condition: and(succeededOrFailed(), ne(variables['SkipTests'], 'true')) # Upload VSTS Drop - task: ms-vseng.MicroBuildTasks.4305a8de-ba66-4d8b-b2d1-0dc4ecbbf5e8.MicroBuildUploadVstsDropFolder@1 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index aa8a7d0c91..68cb352a41 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -24,6 +24,12 @@ variables: - name: VisualStudioDropName value: Products/$(System.TeamProject)/$(Build.Repository.Name)/$(Build.SourceBranchName)/$(Build.BuildNumber) +# Variables defined in yml cannot be overridden at queue time; instead overridable variables must be defined in the web UI. +# Commenting out until something like this is supported: https://github.com/Microsoft/azure-pipelines-yaml/pull/129 +#variables: +#- name: SkipTests +# defaultValue: false + jobs: #---------------------------------------------------------------------------------------------------------------------# @@ -59,6 +65,7 @@ jobs: -configuration $(_BuildConfig) -prepareMachine -testAll + -officialSkipTests $(SkipTests) /p:SignType=$(_SignType) /p:DotNetSignType=$(_SignType) /p:MicroBuild_SigningEnabled=true diff --git a/eng/Build.ps1 b/eng/Build.ps1 index 68928ace71..2c88012b37 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -52,6 +52,7 @@ param ( [switch]$testFSharpQA, [switch]$testVs, [switch]$testAll, + [string]$officialSkipTests = "false", [parameter(ValueFromRemainingArguments=$true)][string[]]$properties) @@ -84,6 +85,7 @@ function Print-Usage() { Write-Host " -testFSharpCore Run FSharpCore unit tests" Write-Host " -testFSharpQA Run F# Cambridge tests" Write-Host " -testVs Run F# editor unit tests" + Write-Host " -officialSkipTests Set to 'true' to skip running tests" Write-Host "" Write-Host "Advanced settings:" Write-Host " -ci Set when running on CI server" @@ -112,6 +114,17 @@ function Process-Arguments() { $script:testVs = $True } + if ([System.Boolean]::Parse($script:officialSkipTests)) { + $script:testAll = $False + $script:testCambridge = $False + $script:testCompiler = $False + $script:testDesktop = $False + $script:testCoreClr = $False + $script:testFSharpCore = $False + $script:testFSharpQA = $False + $script:testVs = $False + } + if ($noRestore) { $script:restore = $False; } From afe77d70993be04a316857123f38bf3bb17497e5 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Mon, 20 May 2019 15:24:01 -0700 Subject: [PATCH 051/159] publish artifacts during internal build --- azure-pipelines.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 68cb352a41..3e8ff5a8dc 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -81,6 +81,24 @@ jobs: /p:OfficialBuildId=$(BUILD.BUILDNUMBER) /p:PublishToSymbolServer=true /p:VisualStudioDropName=$(VisualStudioDropName) + - task: PublishBuildArtifacts@1 + displayName: Publish Artifact Packages + inputs: + PathtoPublish: '$(Build.SourcesDirectory)\artifacts\packages\$(_BuildConfig)' + ArtifactName: 'Packages' + condition: succeeded() + - task: PublishBuildArtifacts@1 + displayName: Publish Artifact VSSetup + inputs: + PathtoPublish: '$(Build.SourcesDirectory)\artifacts\VSSetup\$(_BuildConfig)\Insertion' + ArtifactName: 'VSSetup' + condition: succeeded() + - task: PublishBuildArtifacts@1 + displayName: Publish Artifact Nightly + inputs: + PathtoPublish: '$(Build.SourcesDirectory)\artifacts\VSSetup\$(_BuildConfig)\VisualFSharpFull.vsix' + ArtifactName: 'Nightly' + condition: succeeded() #---------------------------------------------------------------------------------------------------------------------# # PR builds # From b5a0fdf8ae0083f1afca352058f1013b0659e00b Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Mon, 20 May 2019 18:09:51 -0700 Subject: [PATCH 052/159] Update issue templates (#6784) * Update issue templates Differentiate between bug and feature requests. Also cleans up/updates the existing bug report template. * Update bug_report.md * Delete ISSUE_TEMPLATE.md --- .github/ISSUE_TEMPLATE/bug_report.md | 40 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 ++++++++++++ ISSUE_TEMPLATE.md | 38 --------------------- 3 files changed, 60 insertions(+), 38 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md delete mode 100644 ISSUE_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000000..212c869a3e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,40 @@ +--- +name: Bug report +about: Create a report to help us improve F# +title: '' +labels: '' +assignees: '' + +--- + +Please provide a succinct description of the issue. + +**Repro steps** + +Provide the steps required to reproduce the problem: + +1. Step A +2. Step B + +If possible attach a zip file with the repro case. This often makes it easier for others to reproduce. +The zip file should ideally represent the situation just before the call/step that is problematic. + +**Expected behavior** + +Provide a description of the expected behavior. + +**Actual behavior** + +Provide a description of the actual behaviour observed. + +**Known workarounds** + +Provide a description of any known workarounds. + +**Related information** + +Provide any related information (optional): + +* Operating system +* .NET Runtime kind (.NET Core, .NET Framework, Mono) +* Editing Tools (e.g. Visual Studio Version, Visual Studio) diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000000..0a66fd8d38 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for the F# tools or compiler +title: '' +labels: Feature Request +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md deleted file mode 100644 index 452ecef05d..0000000000 --- a/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,38 +0,0 @@ - - -Please provide a succinct description of the issue. - -#### Repro steps - -Provide the steps required to reproduce the problem - -1. Step A - -2. Step B - -If possible attach a zip file with the repro case. This often makes it easier for others to reproduce. -The zip file should ideally represent the situation just before the call/step that is problematic. - -#### Expected behavior - -Provide a description of the expected behaviour. - -#### Actual behavior - -Provide a description of the actual behaviour observed. - -#### Known workarounds - -Provide a description of any known workarounds. - -#### Related information - -Provide any related information - -* Operating system -* Branch -* .NET Runtime, CoreCLR or Mono Version -* Editing Tools (e.g. Visual Studio Version) -* Links to F# RFCs or entries on https://github.com/fsharp/fslang-suggestions -* Links to performance testing scripts -* Indications of severity From 7b810d75f0d3c67cea4252e620eeb00089373789 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 21 May 2019 19:32:34 +0100 Subject: [PATCH 053/159] fix incremental build (#6795) --- FSharpBuild.Directory.Build.targets | 4 ++-- fcs/Directory.Build.targets | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/FSharpBuild.Directory.Build.targets b/FSharpBuild.Directory.Build.targets index 742f43fb3f..d87d68d36c 100644 --- a/FSharpBuild.Directory.Build.targets +++ b/FSharpBuild.Directory.Build.targets @@ -22,7 +22,7 @@ - + @@ -51,7 +51,7 @@ - + diff --git a/fcs/Directory.Build.targets b/fcs/Directory.Build.targets index ea3d9bd8c4..19b6fcd667 100644 --- a/fcs/Directory.Build.targets +++ b/fcs/Directory.Build.targets @@ -17,7 +17,7 @@ - + @@ -46,7 +46,7 @@ - + From 8e399d0d8630b58a13653c836679f5b6d0b50e71 Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Tue, 21 May 2019 11:54:25 -0700 Subject: [PATCH 054/159] Trim vsconfig (#6789) sqlclr, liveshare, and Just in time debugging aren't necessary --- .vsconfig | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.vsconfig b/.vsconfig index 0be88d0ab8..302d980890 100644 --- a/.vsconfig +++ b/.vsconfig @@ -15,16 +15,13 @@ "Microsoft.Net.ComponentGroup.DevelopmentPrerequisites", "Microsoft.Component.MSBuild", "Microsoft.VisualStudio.Component.TextTemplating", - "Microsoft.VisualStudio.Component.SQL.CLR", "Microsoft.VisualStudio.Component.ManagedDesktop.Core", "Microsoft.Net.Component.4.6.TargetingPack", - "Component.Microsoft.VisualStudio.LiveShare", "Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites", - "Microsoft.VisualStudio.Component.Debugger.JustInTime", "Microsoft.VisualStudio.Component.FSharp.Desktop", "Microsoft.VisualStudio.Workload.ManagedDesktop", "Microsoft.VisualStudio.Component.VSSDK", "Microsoft.VisualStudio.ComponentGroup.VisualStudioExtension.Prerequisites", "Microsoft.VisualStudio.Workload.VisualStudioExtension" ] -} \ No newline at end of file +} From d7ebc4a114b19f6e476ae621757e91f66fb4d5d3 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Tue, 21 May 2019 15:27:34 -0700 Subject: [PATCH 055/159] update CI/PR triggers --- azure-pipelines.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3e8ff5a8dc..6e956cbed3 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,14 +2,12 @@ trigger: - master - dev16.1 -- fsharp47 -- fsharp5 +- feature/* - release/* pr: - master - dev16.1 -- fsharp47 -- fsharp5 +- feature/* - release/* variables: From 23d0f4d6ac1eddc3d9c2d314a169553f7350bc82 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Wed, 22 May 2019 22:41:53 -0700 Subject: [PATCH 056/159] publish test results (#6815) --- azure-pipelines.yml | 56 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6e956cbed3..02136c45fd 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -79,6 +79,22 @@ jobs: /p:OfficialBuildId=$(BUILD.BUILDNUMBER) /p:PublishToSymbolServer=true /p:VisualStudioDropName=$(VisualStudioDropName) + - task: PublishTestResults@2 + displayName: Publish Test Results + inputs: + testResultsFormat: 'NUnit' + testResultsFiles: '*.xml' + searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)' + continueOnError: true + condition: ne(variables['SkipTests'], 'true') + - task: PublishBuildArtifacts@1 + displayName: Publish Test Logs + inputs: + PathtoPublish: '$(Build.SourcesDirectory)\artifacts\TestResults\$(_BuildConfig)' + ArtifactName: 'Test Logs' + publishLocation: Container + continueOnError: true + condition: ne(variables['SkipTests'], 'true') - task: PublishBuildArtifacts@1 displayName: Publish Artifact Packages inputs: @@ -138,6 +154,22 @@ jobs: clean: true - script: eng\CIBuild.cmd -configuration $(_configuration) -$(_testKind) displayName: Build / Test + - task: PublishTestResults@2 + displayName: Publish Test Results + inputs: + testResultsFormat: 'NUnit' + testResultsFiles: '*.xml' + searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_configuration)' + continueOnError: true + condition: ne(variables['_testKind'], 'testFSharpQA') + - task: PublishBuildArtifacts@1 + displayName: Publish Test Logs + inputs: + PathtoPublish: '$(Build.SourcesDirectory)\artifacts\TestResults\$(_configuration)' + ArtifactName: 'Windows $(_configuration) $(_testKind) test logs' + publishLocation: Container + continueOnError: true + condition: eq(variables['_testKind'], 'testFSharpQA') # Linux - job: Linux @@ -151,6 +183,14 @@ jobs: clean: true - script: ./eng/cibuild.sh --configuration $(_BuildConfig) --testcoreclr displayName: Build / Test + - task: PublishTestResults@2 + displayName: Publish Test Results + inputs: + testResultsFormat: 'NUnit' + testResultsFiles: '*.xml' + searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)' + continueOnError: true + condition: always() # MacOS - job: MacOS @@ -164,6 +204,14 @@ jobs: clean: true - script: ./eng/cibuild.sh --configuration $(_BuildConfig) --testcoreclr displayName: Build / Test + - task: PublishTestResults@2 + displayName: Publish Test Results + inputs: + testResultsFormat: 'NUnit' + testResultsFiles: '*.xml' + searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)' + continueOnError: true + condition: always() # Source Build Linux - job: SourceBuild_Linux @@ -211,6 +259,14 @@ jobs: clean: true - script: fcs\build.cmd TestAndNuget displayName: Build / Test + - task: PublishTestResults@2 + displayName: Publish Test Results + inputs: + testResultsFormat: 'NUnit' + testResultsFiles: '*.xml' + searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/Release' + continueOnError: true + condition: always() - job: Linux_FCS pool: From f83739fb7a8423b04624d0a44b001a82562e388b Mon Sep 17 00:00:00 2001 From: Rich Lander Date: Thu, 23 May 2019 15:33:10 -0700 Subject: [PATCH 057/159] Create THIRD-PARTY-NOTICES.TXT (#6831) A TPN for https://github.com/dotnet/fsharp/blob/ec04e47bb0b63495697459411b42cc8e126b7be8/tests/fsharp/core/members/ops/test.fsx#L394 --- .../core/members/ops/THIRD-PARTY-NOTICES.TXT | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/fsharp/core/members/ops/THIRD-PARTY-NOTICES.TXT diff --git a/tests/fsharp/core/members/ops/THIRD-PARTY-NOTICES.TXT b/tests/fsharp/core/members/ops/THIRD-PARTY-NOTICES.TXT new file mode 100644 index 0000000000..75a2788250 --- /dev/null +++ b/tests/fsharp/core/members/ops/THIRD-PARTY-NOTICES.TXT @@ -0,0 +1,24 @@ +F# uses third-party libraries or other resources that may be +distributed under licenses different than the .NET Core software. + +Attributions and license notices for test cases originally authored by +third parties can be found in the respective test directories. + +In the event that we accidentally failed to list a required notice, please +bring it to our attention. Post an issue or email us: + + dotnet@microsoft.com + +The attached notices are provided for information only. + +License notice for Stack Overflow +------------------------------------- + +Policy: https://stackoverflow.com/help/licensing +License: https://creativecommons.org/licenses/by-sa/3.0/ + +Content: How to write a variadic function in F# emulating a similar Haskell solution? +URL: https://stackoverflow.com/questions/28243963/how-to-write-a-variadic-function-in-f-emulating-a-similar-haskell-solution/28244413#28244413 + +Question author: robkuz -- https://stackoverflow.com/users/621427/robkuz +Answer author: Gustavo -- https://stackoverflow.com/users/446822/gustavo From 0325034922d67751a2dfee7a497cba8a3aadea4f Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Fri, 24 May 2019 20:24:30 +0300 Subject: [PATCH 058/159] Fix unused opens false positive for record fields (#6846) * Fix unused opens false positive for record fields * Add record check --- src/fsharp/service/ServiceAnalysis.fs | 10 ++++++++++ tests/service/ProjectAnalysisTests.fs | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/src/fsharp/service/ServiceAnalysis.fs b/src/fsharp/service/ServiceAnalysis.fs index f66d372bc2..e4f942b657 100644 --- a/src/fsharp/service/ServiceAnalysis.fs +++ b/src/fsharp/service/ServiceAnalysis.fs @@ -99,17 +99,27 @@ 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 + | :? FSharpMemberOrFunctionOrValue when su.IsFromDefinition -> // Value definitions should be ignored false + | :? FSharpGenericParameter -> // Generic parameters can be ignored, they never come into scope via 'open' false + | :? FSharpUnionCase when su.IsFromDefinition -> false + + | :? FSharpField as field when + field.DeclaringEntity.IsSome && field.DeclaringEntity.Value.IsFSharpRecord -> + // Record fields are used in name resolution + true + | _ -> // 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 diff --git a/tests/service/ProjectAnalysisTests.fs b/tests/service/ProjectAnalysisTests.fs index 08f19cbe70..9dca0cd56f 100644 --- a/tests/service/ProjectAnalysisTests.fs +++ b/tests/service/ProjectAnalysisTests.fs @@ -5523,6 +5523,14 @@ type UseTheThings(i:int) = member x.UseSomeUsedModuleContainingActivePattern(ActivePattern g) = g member x.UseSomeUsedModuleContainingExtensionMember() = (3).Q member x.UseSomeUsedModuleContainingUnion() = A + +module M1 = + type R = { Field: int } + +module M2 = + open M1 + + let foo x = x.Field """ let fileSource1 = FSharp.Compiler.Text.SourceText.ofString fileSource1Text File.WriteAllText(fileName1, fileSource1Text) From 4f50cd6c771a6cd7f80c68a0a0571f2a34b4ffb1 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Fri, 24 May 2019 11:02:01 -0700 Subject: [PATCH 059/159] add CI leg to verify assemblies aren't unnecessarily being rebuilt (#6816) --- azure-pipelines.yml | 13 ++++++++ eng/tests/UpToDate.ps1 | 70 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 eng/tests/UpToDate.ps1 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 02136c45fd..2207a4792e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -233,6 +233,19 @@ jobs: - script: eng\CIBuild.cmd -configuration Release -noSign /p:DotNetBuildFromSource=true /p:FSharpSourceBuild=true displayName: Build + # Up-to-date + - job: UpToDate_Windows + pool: + vmImage: windows-2019 + steps: + - checkout: self + clean: true + - task: PowerShell@2 + displayName: Run up-to-date build check + inputs: + filePath: eng\tests\UpToDate.ps1 + arguments: -configuration $(_BuildConfig) -ci -binaryLog + #---------------------------------------------------------------------------------------------------------------------# # FCS builds # #---------------------------------------------------------------------------------------------------------------------# diff --git a/eng/tests/UpToDate.ps1 b/eng/tests/UpToDate.ps1 new file mode 100644 index 0000000000..a7e50a26d6 --- /dev/null +++ b/eng/tests/UpToDate.ps1 @@ -0,0 +1,70 @@ +# This script verifies that subsequent calls to `Build.cmd` don't cause assemblies to be unnecessarily rebuilt. + +[CmdletBinding(PositionalBinding=$false)] +param ( + [string][Alias('c')]$configuration = "Debug", + [parameter(ValueFromRemainingArguments=$true)][string[]]$properties +) + +Set-StrictMode -version 2.0 +$ErrorActionPreference = "Stop" + +try { + $RepoRoot = Join-Path $PSScriptRoot ".." | Join-Path -ChildPath ".." -Resolve + $BuildScript = Join-Path $RepoRoot "Build.cmd" + + # do first build + & $BuildScript -configuration $configuration @properties + if ($LASTEXITCODE -ne 0) { + Write-Host "Error running first build." + exit 1 + } + + # gather assembly timestamps + $ArtifactsBinDir = Join-Path $RepoRoot "artifacts" | Join-Path -ChildPath "bin" -Resolve + $FSharpAssemblyDirs = Get-ChildItem -Path $ArtifactsBinDir -Filter "FSharp.*" + $FSharpAssemblyPaths = $FSharpAssemblyDirs | ForEach-Object { Get-ChildItem -Path (Join-Path $ArtifactsBinDir $_) -Recurse -Filter "$_.dll" } | ForEach-Object { $_.FullName } + + $InitialAssembliesAndTimes = @{} + foreach ($asm in $FSharpAssemblyPaths) { + $LastWriteTime = (Get-Item $asm).LastWriteTimeUtc + $InitialAssembliesAndTimes.Add($asm, $LastWriteTime) + } + + $InitialCompiledCount = $FSharpAssemblyPaths.Length + + # build again + & $BuildScript -configuration $configuration @properties + if ($LASTEXITCODE -ne 0) { + Write-Host "Error running second build." + exit 1 + } + + # gather assembly timestamps again + $FinalAssembliesAndTimes = @{} + foreach ($asm in $FSharpAssemblyPaths) { + $LastWriteTime = (Get-Item $asm).LastWriteTimeUtc + $FinalAssembliesAndTimes.Add($asm, $LastWriteTime) + } + + # validate that assembly timestamps haven't changed + $RecompiledFiles = @() + foreach ($asm in $InitialAssembliesAndTimes.keys) { + $InitialTime = $InitialAssembliesAndTimes[$asm] + $FinalTime = $FinalAssembliesAndTimes[$asm] + if ($InitialTime -ne $FinalTime) { + $RecompiledFiles += $asm + } + } + + $RecompiledCount = $RecompiledFiles.Length + Write-Host "$RecompiledCount of $InitialCompiledCount assemblies were re-compiled" + $RecompiledFiles | ForEach-Object { Write-Host " $_" } + exit $RecompiledCount +} +catch { + Write-Host $_ + Write-Host $_.Exception + Write-Host $_.ScriptStackTrace + exit 1 +} From 25560f4775ca5c049227022704ec8b790c74b860 Mon Sep 17 00:00:00 2001 From: Fangyi Zhou Date: Fri, 24 May 2019 19:27:02 +0100 Subject: [PATCH 060/159] Removing option from Tuple active pattern (#6772) --- src/fsharp/symbols/SymbolPatterns.fs | 4 ++-- src/fsharp/symbols/SymbolPatterns.fsi | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fsharp/symbols/SymbolPatterns.fs b/src/fsharp/symbols/SymbolPatterns.fs index 2265682692..6c2286b409 100644 --- a/src/fsharp/symbols/SymbolPatterns.fs +++ b/src/fsharp/symbols/SymbolPatterns.fs @@ -132,8 +132,8 @@ module Symbol = #endif let (|Enum|_|) (entity: FSharpEntity) = if entity.IsEnum then Some() else None - let (|Tuple|_|) (ty: FSharpType option) = - ty |> Option.bind (fun ty -> if ty.IsTupleType then Some() else None) + let (|Tuple|_|) (ty: FSharpType) = + if ty.IsTupleType then Some() else None let (|RefCell|_|) (ty: FSharpType) = match getAbbreviatedType ty with diff --git a/src/fsharp/symbols/SymbolPatterns.fsi b/src/fsharp/symbols/SymbolPatterns.fsi index c4c242270c..ca3659f34d 100644 --- a/src/fsharp/symbols/SymbolPatterns.fsi +++ b/src/fsharp/symbols/SymbolPatterns.fsi @@ -37,7 +37,7 @@ module public Symbol = val (|ProvidedAndErasedType|_|) : FSharpEntity -> unit option #endif val (|Enum|_|) : FSharpEntity -> unit option - val (|Tuple|_|) : FSharpType option -> unit option + val (|Tuple|_|) : FSharpType -> unit option val (|RefCell|_|) : FSharpType -> unit option val (|FunctionType|_|) : FSharpType -> unit option val (|Pattern|_|) : FSharpSymbol -> unit option From 070be18c44e9f48118666a85703b65a3419f1aab Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Sun, 26 May 2019 21:16:13 -0700 Subject: [PATCH 061/159] Unify fsharpqa comparer.fsx (#6875) --- .../fsc/gccerrors/comparer.fsx | 21 --------- .../CompilerOptions/fsc/gccerrors/env.lst | 4 +- .../CompilerOptions/fsc/help/comparer.fsx | 32 -------------- .../Source/CompilerOptions/fsc/help/env.lst | 6 +-- .../CompilerOptions/fsc/nologo/comparer.fsx | 33 -------------- .../Source/CompilerOptions/fsc/nologo/env.lst | 4 +- .../CompilerOptions/fsi/exename/comparer.fsx | 21 --------- .../CompilerOptions/fsi/exename/env.lst | 2 +- .../CompilerOptions/fsi/help/comparer.fsx | 36 --------------- .../Source/CompilerOptions/fsi/help/env.lst | 8 ++-- tests/fsharpqa/Source/comparer.fsx | 44 +++++++++++++++++++ 11 files changed, 55 insertions(+), 156 deletions(-) delete mode 100644 tests/fsharpqa/Source/CompilerOptions/fsc/gccerrors/comparer.fsx delete mode 100644 tests/fsharpqa/Source/CompilerOptions/fsc/help/comparer.fsx delete mode 100644 tests/fsharpqa/Source/CompilerOptions/fsc/nologo/comparer.fsx delete mode 100644 tests/fsharpqa/Source/CompilerOptions/fsi/exename/comparer.fsx delete mode 100644 tests/fsharpqa/Source/CompilerOptions/fsi/help/comparer.fsx create mode 100644 tests/fsharpqa/Source/comparer.fsx diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/gccerrors/comparer.fsx b/tests/fsharpqa/Source/CompilerOptions/fsc/gccerrors/comparer.fsx deleted file mode 100644 index dfc716408b..0000000000 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/gccerrors/comparer.fsx +++ /dev/null @@ -1,21 +0,0 @@ -// #NoMT #CompilerOptions #RequiresENU -let fn1 = fsi.CommandLineArgs.[1] -let fn2 = fsi.CommandLineArgs.[2] -// Read file into an array -let File2List(filename : string) = System.IO.File.ReadAllLines filename |> Array.toList -let f1 = File2List fn1 -let f2 = File2List fn2 -let mutable i = 0 - -let compare f1 f2 = - (f1, f2) ||> List.forall2 (fun (a : string) (b : string) -> - i <- i + 1 - if (a = b) then true - else - printfn "Files differ at line %d:" i - printfn "\t>> %s" a - printfn "\t<< %s" b - false) - -exit (if (f1.Length = f2.Length && compare f1 f2) then 0 - else 1) diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/gccerrors/env.lst b/tests/fsharpqa/Source/CompilerOptions/fsc/gccerrors/env.lst index e7cc45cb1e..e45bfc1834 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/gccerrors/env.lst +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/gccerrors/env.lst @@ -1,3 +1 @@ -ReqENU SOURCE=gccerrors01.fs COMPILE_ONLY=1 SCFLAGS="--gccerrors --nologo gccerrors01.fs >gccerrors01.txt" POSTCMD="\$FSI_PIPE --nologo --quiet --exec comparer.fsx gccerrors01.txt gccerrors01.bsl" - - +ReqENU SOURCE=gccerrors01.fs COMPILE_ONLY=1 SCFLAGS="--gccerrors --nologo gccerrors01.fs >gccerrors01.txt" POSTCMD="\$FSI_PIPE --nologo --quiet --exec ..\\..\\..\\comparer.fsx gccerrors01.txt gccerrors01.bsl" diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/help/comparer.fsx b/tests/fsharpqa/Source/CompilerOptions/fsc/help/comparer.fsx deleted file mode 100644 index 38adec6afd..0000000000 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/help/comparer.fsx +++ /dev/null @@ -1,32 +0,0 @@ -// #NoMT #CompilerOptions #RequiresENU -#light - -let arg0 = System.Environment.GetCommandLineArgs().[0] -let path = System.Environment.GetEnvironmentVariable("PATH") -let fn1 = fsi.CommandLineArgs.[1] -let fn2 = fsi.CommandLineArgs.[2] - -// Read file into an array -let File2List (filename:string) = System.IO.File.ReadAllLines(filename) - -let f1 = File2List fn1 -let f2 = File2List fn2 - -let mutable i = 0 -let compare (f1:string[]) (f2:string[]) = - if f1.Length <> f2.Length then failwithf "Help text did not match. f1.Length = %d, f2.Length = %d. Check you have fsc on path, arg0 = %s, PATH=%s" f1.Length f2.Length arg0 path - (f1, f2) ||> Array.forall2 (fun (a:string) (b:string) -> - let aa = System.Text.RegularExpressions.Regex.Replace(a, @"F# Compiler version .+", "F# Compiler") - let bb = System.Text.RegularExpressions.Regex.Replace(b, @"F# Compiler version .+", "F# Compiler") - i <- i+1 - if (aa = bb) then - true - else - printfn "Files differ at line %d:" i - printfn "\t>> %s" a - printfn "\t<< %s" b - false - ) - -exit (if compare f1 f2 then 0 else 1) - diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/help/env.lst b/tests/fsharpqa/Source/CompilerOptions/fsc/help/env.lst index 2deb1bea39..d6e7a56c5c 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/help/env.lst +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/help/env.lst @@ -1,6 +1,6 @@ # ReqENU means that the test is non-localized -ReqENU SOURCE=dummy.fsx COMPILE_ONLY=1 PRECMD="\$FSC_PIPE >help40.txt -? 2>&1" POSTCMD="\$FSI_PIPE --nologo --quiet --exec comparer.fsx help40.txt help40.437.1033.bsl" # -? -ReqENU SOURCE=dummy.fsx COMPILE_ONLY=1 PRECMD="\$FSC_PIPE >help40.txt --help 2>&1" POSTCMD="\$FSI_PIPE --nologo --quiet --exec comparer.fsx help40.txt help40.437.1033.bsl" # --help -ReqENU SOURCE=dummy.fsx COMPILE_ONLY=1 PRECMD="\$FSC_PIPE >help40.txt /? 2>&1" POSTCMD="\$FSI_PIPE --nologo --quiet --exec comparer.fsx help40.txt help40.437.1033.bsl" # /? +ReqENU SOURCE=dummy.fsx COMPILE_ONLY=1 PRECMD="\$FSC_PIPE >help40.txt -? 2>&1" POSTCMD="\$FSI_PIPE --nologo --quiet --exec ..\\..\\..\\comparer.fsx help40.txt help40.437.1033.bsl" # -? +ReqENU SOURCE=dummy.fsx COMPILE_ONLY=1 PRECMD="\$FSC_PIPE >help40.txt --help 2>&1" POSTCMD="\$FSI_PIPE --nologo --quiet --exec ..\\..\\..\\comparer.fsx help40.txt help40.437.1033.bsl" # --help +ReqENU SOURCE=dummy.fsx COMPILE_ONLY=1 PRECMD="\$FSC_PIPE >help40.txt /? 2>&1" POSTCMD="\$FSI_PIPE --nologo --quiet --exec ..\\..\\..\\comparer.fsx help40.txt help40.437.1033.bsl" # /? diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/nologo/comparer.fsx b/tests/fsharpqa/Source/CompilerOptions/fsc/nologo/comparer.fsx deleted file mode 100644 index 9f4ea4aab6..0000000000 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/nologo/comparer.fsx +++ /dev/null @@ -1,33 +0,0 @@ -// #NoMT #CompilerOptions #RequiresENU -#light - -let fn1 = fsi.CommandLineArgs.[1] -let fn2 = fsi.CommandLineArgs.[2] - -// Read file into an array -let File2List (filename:string) = - use s = new System.IO.StreamReader(filename) - let mutable l = [] - while not s.EndOfStream do - l <- List.append l ( s.ReadLine() :: []) - l - -let f1 = File2List fn1 -let f2 = File2List fn2 - -let mutable i = 0 -let compare (f1:string list) (f2:string list) = List.forall2 (fun (a:string) (b:string) -> - let aa = System.Text.RegularExpressions.Regex.Replace(a, @"F# Compiler version .+", "F# Compiler version") - let bb = System.Text.RegularExpressions.Regex.Replace(b, @"F# Compiler version .+", "F# Compiler version") - - i <- i+1 - if (aa = bb) then - true - else - printfn "Files differ at line %d:" i - printfn "\t>> %s" a - printfn "\t<< %s" b - false - ) f1 f2 - -exit (if compare f1 f2 then 0 else 1) diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/nologo/env.lst b/tests/fsharpqa/Source/CompilerOptions/fsc/nologo/env.lst index b4d4335cbf..179f4ddb7f 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/nologo/env.lst +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/nologo/env.lst @@ -1,7 +1,7 @@ # Not really related to the --nologo option -ReqENU SOURCE=dummy.fsx COMPILE_ONLY=1 PRECMD="\$FSC_PIPE >logo.txt 2>&1 || time /t" POSTCMD="\$FSI_PIPE --nologo --quiet --exec comparer.fsx logo.txt logo.437.1033.bsl" # fsc -ReqENU SOURCE=dummy.fsx COMPILE_ONLY=1 PRECMD="\$FSC_PIPE >nologo.txt --nologo 2>&1 || time /t" POSTCMD="\$FSI_PIPE --nologo --quiet --exec comparer.fsx nologo.txt nologo.437.1033.bsl" # fsc --nologo +ReqENU SOURCE=dummy.fsx COMPILE_ONLY=1 PRECMD="\$FSC_PIPE >logo.txt 2>&1 || time /t" POSTCMD="\$FSI_PIPE --nologo --quiet --exec ..\\..\\..\\comparer.fsx logo.txt logo.437.1033.bsl" # fsc +ReqENU SOURCE=dummy.fsx COMPILE_ONLY=1 PRECMD="\$FSC_PIPE >nologo.txt --nologo 2>&1 || time /t" POSTCMD="\$FSI_PIPE --nologo --quiet --exec ..\\..\\..\\comparer.fsx nologo.txt nologo.437.1033.bsl" # fsc --nologo diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/exename/comparer.fsx b/tests/fsharpqa/Source/CompilerOptions/fsi/exename/comparer.fsx deleted file mode 100644 index dd10fa3f16..0000000000 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/exename/comparer.fsx +++ /dev/null @@ -1,21 +0,0 @@ -// #NoMT #CompilerOptions #RequiresENU -let fn1 = fsi.CommandLineArgs.[1] -let fn2 = fsi.CommandLineArgs.[2] -let File2List(filename : string) = System.IO.File.ReadAllLines filename |> Array.toList -let f1 = File2List fn1 -let f2 = File2List fn2 -let mutable i = 0 - -let compare f1 f2 = - (f1,f2) ||> List.forall2 (fun a b -> - i <- i + 1 - if (a = b) then true - else - printfn "Files differ at line %d:" i - printfn "\t>> %s" a - printfn "\t<< %s" b - false) - -exit (if compare f1 f2 then 0 - else 1) - diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/exename/env.lst b/tests/fsharpqa/Source/CompilerOptions/fsi/exename/env.lst index 58ac3b820a..4ab3350f39 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/exename/env.lst +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/exename/env.lst @@ -1,5 +1,5 @@ -ReqENU SOURCE=dummy.fsx COMPILE_ONLY=1 SCFLAGS="--nologo --exename:fsharpi --help >help.txt" FSIMODE=EXEC POSTCMD="\$FSI_PIPE --nologo --quiet --exec comparer.fsx help.txt help40.437.1033.bsl" # -?-40 +ReqENU SOURCE=dummy.fsx COMPILE_ONLY=1 SCFLAGS="--nologo --exename:fsharpi --help >help.txt" FSIMODE=EXEC POSTCMD="\$FSI_PIPE --nologo --quiet --exec ..\\..\\..\\comparer.fsx help.txt help40.437.1033.bsl" # -?-40 diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/help/comparer.fsx b/tests/fsharpqa/Source/CompilerOptions/fsi/help/comparer.fsx deleted file mode 100644 index c0b39d14f3..0000000000 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/help/comparer.fsx +++ /dev/null @@ -1,36 +0,0 @@ -// #NoMT #CompilerOptions #RequiresENU -#light - -let arg0 = System.Environment.GetCommandLineArgs().[0] -let path = System.Environment.GetEnvironmentVariable("PATH") -let fn1 = fsi.CommandLineArgs.[1] -let fn2 = fsi.CommandLineArgs.[2] - -// Read file into an array -let File2List (filename:string) = System.IO.File.ReadAllLines(filename) - -let f1 = File2List fn1 -let f2 = File2List fn2 - -let mutable i = 0 -let compare (f1:string[]) (f2:string[]) = - if f1.Length <> f2.Length then failwithf "Help text did not match. f1.Length = %d, f2.Length = %d, Check you have right fsi on path. fsi = %s, PATH=%s" f1.Length f2.Length arg0 path - (f1, f2) ||> Array.forall2 (fun (a:string) (b:string) -> - let aa = System.Text.RegularExpressions.Regex.Replace(a, @"F# Interactive build .+", "F# Interactive build") - let bb = System.Text.RegularExpressions.Regex.Replace(b, @"F# Interactive build .+", "F# Interactive build") - - // unify fsi.exe and FsiAnyCPU.exe - let aa = aa.Replace("FsiAnyCPU.exe", "fsi.exe") - let bb = aa.Replace("FsiAnyCPU.exe", "fsi.exe") - - i <- i+1 - if (aa = bb) then - true - else - printfn "Files differ at line %d:" i - printfn "\t>> %s" a - printfn "\t<< %s" b - false - ) - -exit (if compare f1 f2 then 0 else 1) diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/help/env.lst b/tests/fsharpqa/Source/CompilerOptions/fsi/help/env.lst index 236e79c6d7..c09c31f00a 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/help/env.lst +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/help/env.lst @@ -1,11 +1,11 @@ -ReqENU SOURCE=dummy.fsx COMPILE_ONLY=1 SCFLAGS="--nologo" FSIMODE=EXEC PRECMD="\$FSI_PIPE >help.txt -? 2>&1" POSTCMD="\$FSI_PIPE --nologo --quiet --exec comparer.fsx help.txt help40.437.1033.bsl" # -?-40 +ReqENU SOURCE=dummy.fsx COMPILE_ONLY=1 SCFLAGS="--nologo" FSIMODE=EXEC PRECMD="\$FSI_PIPE >help.txt -? 2>&1" POSTCMD="\$FSI_PIPE --nologo --quiet --exec ..\\..\\..\\comparer.fsx help.txt help40.437.1033.bsl" # -?-40 -ReqENU SOURCE=dummy.fsx COMPILE_ONLY=1 SCFLAGS="--nologo" FSIMODE=EXEC PRECMD="\$FSI_PIPE >help.txt --help 2>&1" POSTCMD="\$FSI_PIPE --nologo --quiet --exec comparer.fsx help.txt help40.437.1033.bsl" # --help-40 +ReqENU SOURCE=dummy.fsx COMPILE_ONLY=1 SCFLAGS="--nologo" FSIMODE=EXEC PRECMD="\$FSI_PIPE >help.txt --help 2>&1" POSTCMD="\$FSI_PIPE --nologo --quiet --exec ..\\..\\..\\comparer.fsx help.txt help40.437.1033.bsl" # --help-40 -ReqENU SOURCE=dummy.fsx COMPILE_ONLY=1 SCFLAGS="--nologo" FSIMODE=EXEC PRECMD="\$FSI_PIPE >help.txt /? 2>&1" POSTCMD="\$FSI_PIPE --nologo --quiet --exec comparer.fsx help.txt help40.437.1033.bsl" # /?-40 +ReqENU SOURCE=dummy.fsx COMPILE_ONLY=1 SCFLAGS="--nologo" FSIMODE=EXEC PRECMD="\$FSI_PIPE >help.txt /? 2>&1" POSTCMD="\$FSI_PIPE --nologo --quiet --exec ..\\..\\..\\comparer.fsx help.txt help40.437.1033.bsl" # /?-40 # With --nologo -ReqENU SOURCE=dummy.fsx COMPILE_ONLY=1 SCFLAGS="--nologo" FSIMODE=EXEC PRECMD="\$FSI_PIPE >help.txt --nologo -? 2>&1" POSTCMD="\$FSI_PIPE --nologo --quiet --exec comparer.fsx help.txt help40-nologo.437.1033.bsl" # -? --nologo-40 +ReqENU SOURCE=dummy.fsx COMPILE_ONLY=1 SCFLAGS="--nologo" FSIMODE=EXEC PRECMD="\$FSI_PIPE >help.txt --nologo -? 2>&1" POSTCMD="\$FSI_PIPE --nologo --quiet --exec ..\\..\\..\\comparer.fsx help.txt help40-nologo.437.1033.bsl" # -? --nologo-40 diff --git a/tests/fsharpqa/Source/comparer.fsx b/tests/fsharpqa/Source/comparer.fsx new file mode 100644 index 0000000000..26bff8cb78 --- /dev/null +++ b/tests/fsharpqa/Source/comparer.fsx @@ -0,0 +1,44 @@ +// #NoMT #CompilerOptions #RequiresENU +#light +open System +open System.IO +open System.Text.RegularExpressions + +let arg0 = Environment.GetCommandLineArgs().[0] +let path = Environment.GetEnvironmentVariable("PATH") +let fn1 = fsi.CommandLineArgs.[1] +let fn2 = fsi.CommandLineArgs.[2] + +// Read file into an array +let File2List (filename:string) = File.ReadAllLines(filename) + +let f1 = File2List fn1 +let f2 = File2List fn2 + +let mutable i = 0 +let compare (f1:string[]) (f2:string[]) = + if f1.Length <> f2.Length then failwithf "Help text did not match. f1.Length = %d, f2.Length = %d, Check you have right fsi on path. fsi = %s, PATH=%s" f1.Length f2.Length arg0 path + (f1, f2) ||> Array.forall2 (fun (a:string) (b:string) -> + + let replace (sourcepattern:string) (replacement:string) (str:string) : string = + Regex.Replace(str, sourcepattern, replacement) + + let normalizeText (str:string) = + str |> replace @"F# Interactive version .+" "F# Interactive" + |> replace @"F# Compiler version .+" "F# Compiler" + |> replace "fsiAnyCpu.exe" "fsi.exe" + + let aa = normalizeText a + let bb = normalizeText b + + i <- i+1 + if (aa = bb) then + true + else + printfn "Files differ at line %d:" i + printfn "\t>> %s" a + printfn "\t<< %s" b + false + ) + +exit (if compare f1 f2 then 0 else 1) From 163cb4c6cfc8b4731c9a9399a0d03795664fa65f Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Sun, 26 May 2019 21:17:58 -0700 Subject: [PATCH 062/159] Clean navigation (#6849) * Remove need for IVT in ServiceNavigation * Apply Euguene's suggestions --- src/fsharp/service/ServiceNavigation.fs | 6 ++++-- src/fsharp/service/ServiceNavigation.fsi | 8 +++----- src/fsharp/service/ServiceUntypedParse.fs | 12 ++++++------ .../Navigation/NavigationBarItemService.fs | 6 ++---- 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/fsharp/service/ServiceNavigation.fs b/src/fsharp/service/ServiceNavigation.fs index 1909f2454f..0640e9ef06 100755 --- a/src/fsharp/service/ServiceNavigation.fs +++ b/src/fsharp/service/ServiceNavigation.fs @@ -441,10 +441,12 @@ module NavigationImpl = items |> Array.sortInPlaceWith (fun a b -> compare a.Declaration.Name b.Declaration.Name) new FSharpNavigationItems(items) +[] +module FSharpNavigation = let getNavigation (parsedInput: ParsedInput) = match parsedInput with - | ParsedInput.SigFile (ParsedSigFileInput (modules = modules)) -> getNavigationFromSigFile modules - | ParsedInput.ImplFile (ParsedImplFileInput (modules = modules)) -> getNavigationFromImplFile modules + | ParsedInput.SigFile (ParsedSigFileInput (modules = modules)) -> NavigationImpl.getNavigationFromSigFile modules + | ParsedInput.ImplFile (ParsedImplFileInput (modules = modules)) -> NavigationImpl.getNavigationFromImplFile modules let empty = FSharpNavigationItems([||]) diff --git a/src/fsharp/service/ServiceNavigation.fsi b/src/fsharp/service/ServiceNavigation.fsi index be15736601..b91389bbf2 100755 --- a/src/fsharp/service/ServiceNavigation.fsi +++ b/src/fsharp/service/ServiceNavigation.fsi @@ -60,12 +60,10 @@ type public FSharpNavigationTopLevelDeclaration = type public FSharpNavigationItems = member Declarations : FSharpNavigationTopLevelDeclaration[] -// implementation details used by other code in the compiler -module internal NavigationImpl = - val internal getNavigationFromImplFile : Ast.SynModuleOrNamespace list -> FSharpNavigationItems - val internal getNavigationFromSigFile : Ast.SynModuleOrNamespaceSig list -> FSharpNavigationItems - val internal getNavigation : Ast.ParsedInput -> FSharpNavigationItems +// Functionality to access navigable F# items. +module public FSharpNavigation = val internal empty : FSharpNavigationItems + val getNavigation : Ast.ParsedInput -> FSharpNavigationItems module public NavigateTo = [] diff --git a/src/fsharp/service/ServiceUntypedParse.fs b/src/fsharp/service/ServiceUntypedParse.fs index 84197fc608..4e5b1e596f 100755 --- a/src/fsharp/service/ServiceUntypedParse.fs +++ b/src/fsharp/service/ServiceUntypedParse.fs @@ -111,15 +111,15 @@ type FSharpParseFileResults(errors: FSharpErrorInfo[], input: Ast.ParsedInput op ErrorScope.Protect Range.range0 (fun () -> match input with - | Some (ParsedInput.ImplFile (ParsedImplFileInput (modules = modules))) -> - NavigationImpl.getNavigationFromImplFile modules - | Some (ParsedInput.SigFile (ParsedSigFileInput _)) -> - NavigationImpl.empty + | Some (ParsedInput.ImplFile _ as p) -> + FSharpNavigation.getNavigation p + | Some (ParsedInput.SigFile _) -> + FSharpNavigation.empty | _ -> - NavigationImpl.empty ) + FSharpNavigation.empty) (fun err -> Trace.TraceInformation(sprintf "FCS: recovering from error in GetNavigationItemsImpl: '%s'" err) - NavigationImpl.empty) + FSharpNavigation.empty) member private scope.ValidateBreakpointLocationImpl pos = let isMatchRange m = rangeContainsPos m pos || m.StartLine = pos.Line diff --git a/vsintegration/src/FSharp.Editor/Navigation/NavigationBarItemService.fs b/vsintegration/src/FSharp.Editor/Navigation/NavigationBarItemService.fs index f80d10422d..52d75c2b41 100644 --- a/vsintegration/src/FSharp.Editor/Navigation/NavigationBarItemService.fs +++ b/vsintegration/src/FSharp.Editor/Navigation/NavigationBarItemService.fs @@ -6,11 +6,9 @@ open System.Composition open System.Collections.Generic open System.Threading.Tasks -open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Editor open Microsoft.CodeAnalysis.Navigation open Microsoft.CodeAnalysis.Host.Mef -open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.Notification open FSharp.Compiler.SourceCodeServices @@ -35,9 +33,9 @@ type internal FSharpNavigationBarItemService let! parsingOptions, _options = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document, cancellationToken) let! sourceText = document.GetTextAsync(cancellationToken) let! parsedInput = checkerProvider.Checker.ParseDocument(document, parsingOptions, sourceText=sourceText, userOpName=userOpName) - let navItems = NavigationImpl.getNavigation parsedInput + let navItems = FSharpNavigation.getNavigation parsedInput let rangeToTextSpan range = RoslynHelpers.TryFSharpRangeToTextSpan(sourceText, range) - return + return navItems.Declarations |> Array.choose (fun topLevelDecl -> rangeToTextSpan(topLevelDecl.Declaration.Range) From 0b8ea174684c2811751ced71c8463743a914e13e Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Sun, 26 May 2019 21:18:19 -0700 Subject: [PATCH 063/159] Use FCS API for keywords instead of LexHelp internals (#6851) * Use FCS API for keywords instead of LexHelp internals * LexHelp gone --- .../src/FSharp.Editor/Completion/CompletionProvider.fs | 6 +----- .../src/FSharp.Editor/InlineRename/InlineRenameService.fs | 2 +- .../src/FSharp.Editor/LanguageService/Tokenizer.fs | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs index 4b80da5700..2c1603181f 100644 --- a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs +++ b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs @@ -7,7 +7,6 @@ open System.Collections.Generic open System.Collections.Immutable open System.Threading open System.Threading.Tasks -open System.Runtime.CompilerServices open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Completion @@ -15,13 +14,10 @@ open Microsoft.CodeAnalysis.Options open Microsoft.CodeAnalysis.Text open Microsoft.VisualStudio.Shell -open Microsoft.VisualStudio.Shell.Interop open FSharp.Compiler open FSharp.Compiler.Range open FSharp.Compiler.SourceCodeServices -open System.Runtime.Caching -open System.Collections.Concurrent module Logger = Microsoft.VisualStudio.FSharp.Editor.Logger @@ -48,7 +44,7 @@ type internal FSharpCompletionProvider static let [] IndexPropName = "Index" static let keywordCompletionItems = - Lexhelp.Keywords.keywordsWithDescription + Keywords.KeywordsWithDescription |> List.filter (fun (keyword, _) -> not (PrettyNaming.IsOperatorName keyword)) |> List.sortBy (fun (keyword, _) -> keyword) |> List.mapi (fun n (keyword, description) -> diff --git a/vsintegration/src/FSharp.Editor/InlineRename/InlineRenameService.fs b/vsintegration/src/FSharp.Editor/InlineRename/InlineRenameService.fs index 36158eefbc..82cccffbf1 100644 --- a/vsintegration/src/FSharp.Editor/InlineRename/InlineRenameService.fs +++ b/vsintegration/src/FSharp.Editor/InlineRename/InlineRenameService.fs @@ -57,7 +57,7 @@ type internal InlineRenameLocationSet(locations: InlineRenameLocation [], origin match symbolKind with | LexerSymbolKind.GenericTypeParameter | LexerSymbolKind.StaticallyResolvedTypeParameter -> replacementText - | _ -> Lexhelp.Keywords.NormalizeIdentifierBackticks replacementText + | _ -> Keywords.NormalizeIdentifierBackticks replacementText return { new IInlineRenameReplacementInfo with member __.NewSolution = newSolution diff --git a/vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs b/vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs index 66a3a22a63..c71a4a01a7 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/Tokenizer.fs @@ -809,7 +809,7 @@ module internal Tokenizer = else PrettyNaming.IsIdentifierPartCharacter c) let isFixableIdentifier (s: string) = - not (String.IsNullOrEmpty s) && Lexhelp.Keywords.NormalizeIdentifierBackticks s |> isIdentifier + not (String.IsNullOrEmpty s) && Keywords.NormalizeIdentifierBackticks s |> isIdentifier let forbiddenChars = [| '.'; '+'; '$'; '&'; '['; ']'; '/'; '\\'; '*'; '\"' |] From 14e5082c190681056c247dd27862b9583be5f253 Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Sun, 26 May 2019 21:26:11 -0700 Subject: [PATCH 064/159] Clean unecessary constructs from LanguageService.fs (#6848) --- .../LanguageService/LanguageService.fs | 41 +++++-------------- 1 file changed, 10 insertions(+), 31 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index da7ae84baf..d28229441b 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -2,43 +2,22 @@ namespace rec Microsoft.VisualStudio.FSharp.Editor -#nowarn "40" - open System -open System.Collections.Concurrent -open System.Collections.Generic -open System.Collections.Immutable -open System.ComponentModel.Composition open System.ComponentModel.Design -open System.Diagnostics -open System.IO -open System.Linq -open System.Runtime.CompilerServices open System.Runtime.InteropServices open System.Threading open Microsoft.CodeAnalysis -open Microsoft.CodeAnalysis.Diagnostics -open Microsoft.CodeAnalysis.Completion open Microsoft.CodeAnalysis.Options -open FSharp.Compiler.CompileOps open FSharp.Compiler.SourceCodeServices open Microsoft.VisualStudio -open Microsoft.VisualStudio.Editor open Microsoft.VisualStudio.FSharp.Editor -open Microsoft.VisualStudio.TextManager.Interop open Microsoft.VisualStudio.LanguageServices open Microsoft.VisualStudio.LanguageServices.Implementation.LanguageService open Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem -open Microsoft.VisualStudio.LanguageServices.Implementation.TaskList open Microsoft.VisualStudio.LanguageServices.ProjectSystem open Microsoft.VisualStudio.Shell -open Microsoft.VisualStudio.Shell.Events open Microsoft.VisualStudio.Shell.Interop -open Microsoft.VisualStudio.ComponentModelHost open Microsoft.VisualStudio.Text.Outlining -open FSharp.NativeInterop - -#nowarn "9" // NativePtr.toNativeInt // Used to expose FSharpChecker/ProjectInfo manager to diagnostic providers // Diagnostic providers can be executed in environment that does not use MEF so they can rely only @@ -68,10 +47,10 @@ type internal FSharpCheckerWorkspaceServiceFactory projectInfoManager: FSharpProjectOptionsManager ) = interface Microsoft.CodeAnalysis.Host.Mef.IWorkspaceServiceFactory with - member this.CreateService(_workspaceServices) = + member __.CreateService(_workspaceServices) = upcast { new FSharpCheckerWorkspaceService with - member this.Checker = checkerProvider.Checker - member this.FSharpProjectOptionsManager = projectInfoManager } + member __.Checker = checkerProvider.Checker + member __.FSharpProjectOptionsManager = projectInfoManager } [] type private FSharpSolutionEvents(projectManager: FSharpProjectOptionsManager) = @@ -104,7 +83,7 @@ type private FSharpSolutionEvents(projectManager: FSharpProjectOptionsManager) = type internal FSharpSettingsFactory [] (settings: EditorOptions) = interface Microsoft.CodeAnalysis.Host.Mef.IWorkspaceServiceFactory with - member this.CreateService(_) = upcast settings + member __.CreateService(_) = upcast settings [] [, @@ -242,14 +221,14 @@ type internal FSharpLanguageService(package : FSharpPackage) = let theme = package.ComponentModel.DefaultExportProvider.GetExport().Value theme.SetColors() - override this.ContentTypeName = FSharpConstants.FSharpContentTypeName - override this.LanguageName = FSharpConstants.FSharpLanguageName - override this.RoslynLanguageName = FSharpConstants.FSharpLanguageName + override __.ContentTypeName = FSharpConstants.FSharpContentTypeName + override __.LanguageName = FSharpConstants.FSharpLanguageName + override __.RoslynLanguageName = FSharpConstants.FSharpLanguageName - override this.LanguageServiceId = new Guid(FSharpConstants.languageServiceGuidString) - override this.DebuggerLanguageId = DebuggerEnvironment.GetLanguageID() + override __.LanguageServiceId = new Guid(FSharpConstants.languageServiceGuidString) + override __.DebuggerLanguageId = DebuggerEnvironment.GetLanguageID() - override this.CreateContext(_,_,_,_,_) = raise(System.NotImplementedException()) + override __.CreateContext(_,_,_,_,_) = raise(System.NotImplementedException()) override this.SetupNewTextView(textView) = base.SetupNewTextView(textView) From 6f664036e0265db06450b4879f6f623319fe627a Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Thu, 30 May 2019 10:59:22 -0700 Subject: [PATCH 065/159] Cleanup xml in error message tests (#6902) * Cleanup xml * fixup some tests --- .../AssemblyAlgorithmId_001.fs | 2 +- .../AssemblyCompany/AssemblyCompany_001.fs | 2 +- .../AssemblyConfiguration_001.fs | 2 +- .../AssemblyCopyright_001.fs | 2 +- .../AssemblyDescription_001.fs | 2 +- .../AssemblyFileVersion_001.fs | 2 +- .../AssemblyInformationalVersion_001.fs | 2 +- .../AssemblyTitle/AssemblyTitle_001.fs | 2 +- .../AssemblyTrademark_001.fs | 2 +- .../AssemblyVersion/AssemblyVersion_001.fs | 2 +- .../EmittedIL/Misc/ModuleWithExpression01.fs | 2 +- .../fsc/codepage/Functional01.fs | 2 +- .../fsc/codepage/MatchingCodePage01.fsx | 2 +- .../CompilerOptions/fsc/codepage/Zero.fs | 2 +- .../fsc/determinism/PathMap1/pathmap.fs | 2 +- .../fsc/determinism/PathMap2/pathmap.fs | 2 +- .../fsc/dumpAllCommandLineOptions/dummy.fsx | 2 +- .../Source/CompilerOptions/fsc/lib/dummy.fs | 2 +- .../Source/CompilerOptions/fsc/out/dummy.fs | 2 +- .../CompilerOptions/fsc/out/invalidchar.fs | 2 +- .../fsc/responsefile/responsefile01.fs | 2 +- .../fsc/responsefile/responsefile02.fs | 2 +- .../fsc/simpleresolution/simpleres_02.fs | 4 +- .../CompilerOptions/fsc/times/times01.fs | 78 ++++++------- .../Source/CompilerOptions/fsc/warn/nowarn.fs | 2 +- .../fsc/warn/nowarn_with_warnaserror03.fs | 4 +- .../fsi/arguments/PassedArguments01.fsx | 2 +- .../fsi/arguments/PassedArguments02.fsx | 2 +- .../fsi/arguments/PassedArguments03.fs | 2 +- .../fsi/arguments/PassedArguments04.fsx | 4 +- .../CompilerOptions/fsi/arguments/error02.fsx | 2 +- .../CompilerOptions/fsi/nologo/nologo01.fsx | 2 +- .../CompilerOptions/fsi/times/asargument.fsx | 2 +- .../CompilerOptions/fsi/times/times01.fs | 2 +- .../Constants/DecimalLiterals02.fs | 2 +- .../ExclamationMark02.fs | 2 +- .../ExceptionDefinitions/Abbreviation01.fsx | 2 +- .../Abbreviation_SampleCodeFromSpec01.fsx | 2 +- ...xceptionAsDerivedFromSystemException01.fsx | 2 +- .../ExnAsDiscriminatedUnion01.fsx | 2 +- .../GeneratedTypeNameNoClash01.fsx | 2 +- .../ImportCSharpException01.fsx | 2 +- .../ExceptionDefinitions/NamedFields01.fsx | 2 +- .../ExceptionDefinitions/Override01.fsx | 2 +- .../PatternMatch_SampleCodeFromSpec01.fsx | 2 +- .../Basic/Arrays.fsx | 2 +- .../Basic/Exceptions.fsx | 2 +- .../Basic/Generated_Record.fsx | 2 +- .../Basic/Lists.fsx | 2 +- .../Basic/NeverGenerated_Class.fsx | 2 +- .../Basic/NeverGenerated_Delegate.fsx | 2 +- .../Basic/NeverGenerated_Interface.fsx | 2 +- .../Basic/Options.fsx | 2 +- .../Basic/Sample_Records.fsx | 2 +- .../Basic/Sample_Tuples.fsx | 2 +- .../Basic/Structs.fsx | 2 +- .../Basic/Unions.fsx | 2 +- .../ModuleDefinitions/LightSyntax01.fsx | 2 +- .../ModuleAbbreviationWithModule01.fs | 2 +- .../ModuleDefinitions/ModuleSuffix02.fsx | 2 +- .../ModuleWithExpression01.fs | 2 +- .../ModuleWithExpression02.fs | 2 +- .../Production_ExceptionDefinition.fsx | 2 +- .../Production_ImportDeclaration.fsx | 2 +- .../Production_LetBindings_Binding.fsx | 2 +- .../Production_LetBindings_SideEff.fsx | 2 +- .../Production_ModuleAbbreviation.fsx | 2 +- .../Production_ModuleDefinition.fsx | 2 +- .../Production_OCamlCompat.fsx | 2 +- .../Production_TypeDefinitions.fsx | 2 +- .../RecordTypes/DispatchSlot_Equals01.fsx | 2 +- .../RecordTypes/DispatchSlot_GetHashCode.fsx | 2 +- .../RecordTypes/E_TypeInference01b.fs | 2 +- .../RecordTypes/Interface_IComparable.fsx | 2 +- .../RecordTypes/LongIdentifiers01.fsx | 2 +- .../RecordTypes/Member01.fsx | 2 +- .../RecordTypes/MutableFields01.fsx | 2 +- .../MutableFields_SampleFromSpec02.fsx | 2 +- .../RecordTypes/SampleFromSpec01.fsx | 2 +- .../RecordTypes/SampleFromSpec03.fsx | 2 +- .../RecordTypes/Scoping03.fsx | 2 +- .../RecordTypes/Scoping04.fsx | 2 +- .../RecordTypes/UnitType01.fsx | 2 +- .../Constraints_SampleFromSpec01.fsx | 2 +- .../TypeAbbreviations/Identity01.fsx | 2 +- .../ReorderingTypeVariables01.fsx | 2 +- .../TypeNestedInModules01.fsx | 2 +- .../UnionTypes/DispatchSlot_Equals01.fsx | 2 +- .../UnionTypes/DispatchSlot_GetHashCode.fsx | 2 +- .../UnionTypes/Interface01.fsx | 2 +- .../UnionTypes/Interface_IComparable.fsx | 2 +- .../UnionTypes/Member01.fsx | 2 +- .../UnionTypes/NamedFields01.fsx | 2 +- .../UnionTypes/NamedFields02.fsx | 2 +- .../UnionTypes/NamedFields03.fsx | 2 +- .../UnionTypes/Overrides01.fsx | 2 +- .../UnionTypes/Parenthesis01.fsx | 2 +- .../UnionTypes/Parenthesis03.fsx | 2 +- .../UnionTypes/Recursive01.fsx | 2 +- .../UnionTypes/SampleFromSpec01b.fsx | 2 +- .../UnionTypes/SampleFromSpec01d.fsx | 2 +- .../ScopeAndDataConstrAndPattern01.fsx | 2 +- .../UnionTypes/UnionCaseProduction01.fsx | 2 +- .../UnionTypes/UnionCasesProduction01.fsx | 2 +- .../E_accessibilityOnInterface.fs | 12 +- .../basic/LocalLetBinding01.fs | 2 +- .../AttributeUsage/WithBitwiseOr02a.fsx | 2 +- .../AttributeUsage/WithBitwiseOr02b.fsx | 2 +- .../Basic/FreeTypeVariable01.fs | 4 +- .../CustomAttributes/Basic/Function01.fs | 2 +- .../CustomAttributes/Basic/FunctionArg01.fs | 2 +- .../CustomAttributes/Basic/ReturnType01.fs | 2 +- .../CustomAttributes/Basic/ReturnType02.fs | 2 +- .../CustomAttributes/Basic/ReturnType03.fs | 2 +- .../LetBindings/Basic/E_AsPat01.fs | 2 +- .../LetBindings/Basic/Pathological02.fs | 2 +- .../LetBindings/Basic/Pathological04.fs | 2 +- .../TypeFunctions/typeofBasic001.fs | 2 +- .../typeofInCustomAttributes001.fs | 2 +- .../TypeFunctions/typeof_anonymous_01.fs | 2 +- .../NoOverloadIDSpecified.fs | 2 +- .../OverloadingMembers/TooGeneric.fs | 2 +- .../ModuleAbbreviations/SanityCheck.fs | 2 +- .../ModuleAbbreviations/useInsideModuleDef.fs | 2 +- .../useInsideNamespaceDef.fs | 2 +- .../useInsideNamespaceDefExternal.fs | 2 +- .../PatternMatching/LiteralNull01.fs | 2 +- .../AddressOf/addressof001.fsx | 2 +- .../AddressOf/addressof002.fsx | 2 +- .../AddressOf/addressof_local_unit.fsx | 2 +- .../GenericTypeAnnotations01.fs | 2 +- .../FloatingPointRangeExp01.fs | 2 +- .../CodeDisposalInMatch01.fs | 2 +- .../SequenceExpressions/IfThenElse04.fs | 2 +- .../SequenceExpressions/IfThenElse05.fs | 2 +- .../SequenceExpressions/IfThenElse06.fs | 2 +- .../SequenceExpressions/IfThenElse07.fs | 2 +- .../final_yield_bang_keyword_01.fs | 2 +- .../final_yield_dash_gt_01.fs | 2 +- .../final_yield_keyword_01.fs | 2 +- .../RigidTypeAnnotation01.fsx | 2 +- .../RigidTypeAnnotation02.fsx | 2 +- .../RigidTypeAnnotation_null01.fsx | 2 +- .../StaticCoercion_class01.fsx | 2 +- .../StaticCoercion_int_to_obj.fsx | 2 +- .../StaticCoercion_interface01.fsx | 2 +- .../StaticCoercion_interface02.fsx | 2 +- .../StaticCoercion_null_to_obj.fsx | 2 +- .../NoMoreValueRestriction01.fs | 2 +- .../TypeInference/IgnoreUnitParameters.fs | 2 +- .../Comments/E_embeddedString005.fs | 2 +- .../Comments/embeddedString001.fs | 2 +- .../Comments/embeddedString002.fs | 2 +- .../Comments/embeddedString003.fs | 2 +- .../Comments/embeddedString004.fs | 2 +- .../Comments/escapeCharsInComments001.fs | 2 +- .../Comments/escapeCharsInComments002.fs | 2 +- .../LexicalAnalysis/Comments/ocamlstyle001.fs | 2 +- .../Comments/ocamlstyle_nested001.fs | 2 +- .../Comments/ocamlstyle_nested002.fs | 2 +- .../Comments/ocamlstyle_nested003.fs | 2 +- .../Comments/ocamlstyle_nested004.fs | 2 +- .../Comments/ocamlstyle_nested005.fs | 2 +- .../E_ReservedIdentKeywords.fs | 34 +++--- .../backtickmoduleandtypenames.fsx | 2 +- .../NumericLiterals/casingBin.fs | 2 +- .../NumericLiterals/casingHex.fs | 2 +- .../NumericLiterals/casingIEEE-lf-LF01.fs | 2 +- .../NumericLiterals/casingIEEE-lf-LF02.fs | 2 +- .../NumericLiterals/casingOct.fs | 2 +- .../Shift/Generics/RightShift001.fs | 2 +- .../Shift/Generics/RightShift002.fs | 2 +- .../StringsAndCharacters/UnicodeString03.fs | 2 +- .../GreaterThanClosedCurly01.fs | 2 +- .../GreaterThanClosedCurly02.fs | 2 +- .../GreaterThanClosedCurly03.fs | 2 +- .../GreaterThanClosedCurly04.fs | 2 +- .../GreaterThanClosedCurly05.fs | 2 +- .../GreaterThanClosedParenthesis01.fs | 2 +- .../GreaterThanClosedSquare01.fs | 2 +- .../GreaterThanClosedSquare02.fs | 2 +- .../E_GreaterThanColon002.fs | 2 +- .../SymbolicOperators/GreaterThanColon001.fs | 2 +- .../OffsideExceptions/InfixTokenPlusOne.fs | 2 +- .../HashLight/First_Non_Comment_Text01.fs | 2 +- .../HashLight/default_in_fsi01.fs | 2 +- .../HashLight/default_in_fsi02.fs | 2 +- .../HashLight/indent_off_after_comment01.fs | 2 +- .../HashLight/light_off_01.fs | 2 +- .../RangeOperator01.fs | 2 +- .../RangeOperator01.fsx | 2 +- .../InheritFromAbstractClass.fs | 2 +- .../Sealed_Member_Override01.fsx | 2 +- .../LexicalScoping01.fs | 2 +- .../StaticLetDoDeclarations/Offside01.fs | 2 +- .../RecNonMutable01.fs | 2 +- .../ValidSignature_MultiArg01.fs | 2 +- .../ValidSignature_ReturningValues01.fs | 2 +- .../InterfaceTypes/MultipleInst03.fs | 2 +- .../StructTypes/E_StructInheritance01b.fs | 2 +- .../StructTypes/StructWithNoFields01.fs | 2 +- .../basic/NonConflictingIntrinsicMembers.fs | 2 +- .../TypeExtensions/basic/SignitureIssue01.fs | 2 +- .../TypeExtensions/basic/SignitureIssue01.fsi | 2 +- .../basic/SignitureIssue01.test.fs | 2 +- .../optional/E_typeext_opt005.fs | 4 +- .../TypeExtensions/optional/typeext_opt008.fs | 2 +- .../Named/E_ActivePatternHasNoFields.fs | 2 +- .../PatternMatching/Named/E_Error_LetRec01.fs | 2 +- .../PatternMatching/Named/E_Error_LetRec02.fs | 2 +- .../PatternMatching/Named/E_Error_LetRec03.fs | 2 +- .../PatternMatching/Named/E_Error_LetRec04.fs | 2 +- .../Named/E_Error_NonParam01.fs | 2 +- .../Named/E_Error_NonParam02.fs | 2 +- .../Named/E_Error_NonParam03.fs | 2 +- .../Named/E_Error_NonParam04.fs | 2 +- .../PatternMatching/Named/E_Error_Param01.fs | 2 +- .../PatternMatching/Named/E_Error_Param02.fs | 2 +- .../PatternMatching/Named/E_Error_Param03.fs | 2 +- .../PatternMatching/Named/E_Error_Param04.fs | 2 +- .../E_StructConstructor01.fsi | 2 +- .../Diagnostics/RangeOfDimensioned01.fs | 2 +- .../Diagnostics/RangeOfDimensioned02.fs | 4 +- .../Parsing/KnownTypeAsUnit01b.fs | 10 +- .../UnitsOfMeasure/Parsing/find_gtdef.fsx | 2 +- .../TypeAbbreviation_decimal_01.fs | 2 +- .../TypeAbbreviation_float32_01.fs | 2 +- .../TypeChecker/TypeAbbreviation_float_01.fs | 2 +- .../UnitsOfMeasure/WithOOP/Polymorphism02.fs | 2 +- ...E_AreYouMissingAnArgumentToAFunction01b.fs | 2 +- .../General/E_IncompleteConstruct01b.fs | 2 +- .../General/E_SpanExtendsToNextToken01.fs | 2 +- .../E_StructMustHaveAtLeastOneField.fs | 2 +- .../General/E_UnexpectedSymbol01.fs | 2 +- .../Diagnostics/General/Generic_Subtype01.fs | 2 +- .../W_InstantiationOfGenericTypeMissing02.fs | 2 +- .../NONTERM/attrUnionCaseDecl01b.fs | 2 +- .../Diagnostics/NONTERM/braceExpr01b.fs | 2 +- .../Source/Diagnostics/NONTERM/declExpr01b.fs | 2 +- .../Diagnostics/NONTERM/fileModuleImpl01b.fs | 2 +- .../Diagnostics/NONTERM/fileModuleImpl02b.fs | 2 +- .../Diagnostics/NONTERM/fileModuleImpl03.fs | 4 +- .../NONTERM/fileNamespaceImpl01b.fs | 2 +- ...teractiveExprOrDefinitionsTerminator01b.fs | 2 +- ...teractiveExprOrDefinitionsTerminator02b.fs | 2 +- ...teractiveExprOrDefinitionsTerminator03b.fs | 2 +- ...teractiveExprOrDefinitionsTerminator04b.fs | 2 +- ...teractiveExprOrDefinitionsTerminator05b.fs | 2 +- ...teractiveExprOrDefinitionsTerminator06b.fs | 2 +- .../NONTERM/memberDefinitionWithoutType01b.fs | 2 +- .../NONTERM/monadicExprNonEmptyInitial01b.fs | 2 +- .../NONTERM/monadicPatternClauses01b.fs | 2 +- .../Diagnostics/NONTERM/quoteExpr01b.fs | 2 +- .../Diagnostics/NONTERM/tuplewithlazy01b.fs | 2 +- .../Source/Diagnostics/NONTERM/typ01b.fs | 2 +- .../Diagnostics/NONTERM/typeConstraint01b.fs | 2 +- .../NONTERM/typedSeqExprBlock01b.fs | 2 +- .../NONTERM/typedSeqExprBlock02b.fs | 2 +- .../Source/EntryPoint/E_twofiles_002b.fs | 2 +- .../fsharpqa/Source/EntryPoint/behavior001.fs | 2 +- .../Source/EntryPoint/entrypointandFSI.fs | 2 +- .../Source/EntryPoint/entrypointandFSI02.fsx | 2 +- .../entrypointfunctionnotmain001.fs | 2 +- .../Source/EntryPoint/inamodule001.fs | 2 +- .../Source/EntryPoint/noarguments001.fs | 2 +- .../Source/EntryPoint/oneargument001.fs | 2 +- .../Source/EntryPoint/twofiles_001a.fs | 2 +- .../Source/EntryPoint/twofiles_001b.fs | 2 +- .../Source/Import/assign_to_static_field01.fs | 2 +- .../InteractiveSession/Misc/DeclareEvent.fsx | 2 +- .../Misc/DontShowCompilerGenNames01.fsx | 14 +-- .../Misc/E_RangeOperator01.fsx | 4 +- .../InteractiveSession/Misc/EmptyList.fsx | 2 +- .../Misc/NativeIntSuffix01.fs | 2 +- .../InteractiveSession/Misc/References.fsx | 2 +- .../InteractiveSession/Misc/References35.fsx | 2 +- .../InteractiveSession/Misc/References40.fsx | 2 +- .../InteractiveSession/Misc/TimeToggles.fsx | 4 +- .../Misc/UNativeIntSuffix01.fs | 2 +- .../Misc/UnitConstInput_6323b.fsx | 4 +- .../Core/Collections/Seq_Cast_Dispose01.fs | 2 +- .../Core/LanguagePrimitives/anytostring01.fsx | 108 +++++++++--------- .../Libraries/Core/Operators/CastOperator.fs | 2 +- tests/fsharpqa/Source/Misc/DefaultManifest.fs | 2 +- .../Source/Misc/WhetherEmbededManifest.fs | 2 +- .../Source/OCamlCompat/NoParensInLet01.fs | 2 +- .../Source/Printing/BindingsWithValues01.fsx | 42 +++---- .../Source/Printing/CustomExceptions02.fsx | 6 +- .../Source/Printing/DisposeOnSprintfA.fs | 2 +- .../Printing/ParamArrayInSignatures.fsx | 8 +- tests/fsharpqa/Source/Printing/Quotation01.fs | 6 +- .../Printing/SignatureWithOptionalArgs01.fs | 16 +-- .../UnitsOfMeasureIdentifiersRoundTrip01.fsx | 6 +- .../UnitsOfMeasureIdentifiersRoundTrip02.fsx | 6 +- .../UnitsOfMeasuresGenericSignature01.fsx | 2 +- .../UnitsOfMeasuresGenericSignature02.fsx | 2 +- .../Source/Printing/VariantTypes01.fs | 2 +- .../MemberHasMultiplePossibleDispatchSlots.fs | 2 +- .../Warnings/WarnOnlyOnLastExpression.fs | 2 +- .../Source/XmlDoc/Basic/XMLDocOnEnum01.fs | 2 +- .../fsharpqa/Source/XmlDoc/Basic/xmlDoc001.fs | 2 +- .../fsharpqa/Source/XmlDoc/Basic/xmlDoc002.fs | 2 +- .../fsharpqa/Source/XmlDoc/Basic/xmlDoc003.fs | 2 +- .../fsharpqa/Source/XmlDoc/Basic/xmlDoc004.fs | 2 +- .../fsharpqa/Source/XmlDoc/Basic/xmlDoc005.fs | 2 +- .../Source/XmlDoc/OCamlDoc/ocamldoc001.fs | 2 +- tests/fsharpqa/Source/test.lst | 2 +- 307 files changed, 473 insertions(+), 481 deletions(-) diff --git a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyAlgorithmId/AssemblyAlgorithmId_001.fs b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyAlgorithmId/AssemblyAlgorithmId_001.fs index d7f37d152c..ec76483144 100644 --- a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyAlgorithmId/AssemblyAlgorithmId_001.fs +++ b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyAlgorithmId/AssemblyAlgorithmId_001.fs @@ -2,7 +2,7 @@ // AssemblyAttributes // See FSHARP1.0:832,1674,1675 and 2290 // Attribute under test: AssemblyAlgorithmId -// +// #light diff --git a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyCompany/AssemblyCompany_001.fs b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyCompany/AssemblyCompany_001.fs index 918cccc2b6..38550cb9e9 100644 --- a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyCompany/AssemblyCompany_001.fs +++ b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyCompany/AssemblyCompany_001.fs @@ -1,7 +1,7 @@ // AssemblyAttributes // See FSHARP1.0:832,1674,1675 and 2290 // Attribute under test: AssemblyCompany -// +// #light diff --git a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyConfiguration/AssemblyConfiguration_001.fs b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyConfiguration/AssemblyConfiguration_001.fs index f159e63c11..66257e2164 100644 --- a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyConfiguration/AssemblyConfiguration_001.fs +++ b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyConfiguration/AssemblyConfiguration_001.fs @@ -2,7 +2,7 @@ // AssemblyAttributes // See FSHARP1.0:832,1674,1675 and 2290 // Attribute under test: AssemblyConfiguration -// +// #light diff --git a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyCopyright/AssemblyCopyright_001.fs b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyCopyright/AssemblyCopyright_001.fs index b19fe0c978..d5bf3b7158 100644 --- a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyCopyright/AssemblyCopyright_001.fs +++ b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyCopyright/AssemblyCopyright_001.fs @@ -1,7 +1,7 @@ // AssemblyAttributes // See FSHARP1.0:832,1674,1675 and 2290 // Attribute under test: AssemblyCopyright -// +// #light diff --git a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyDescription/AssemblyDescription_001.fs b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyDescription/AssemblyDescription_001.fs index 2a586e348c..293ab4ad11 100644 --- a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyDescription/AssemblyDescription_001.fs +++ b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyDescription/AssemblyDescription_001.fs @@ -1,7 +1,7 @@ // AssemblyAttributes // See FSHARP1.0:832,1674,1675 and 2290 // Attribute under test: AssemblyDescription -// +// #light diff --git a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyFileVersion/AssemblyFileVersion_001.fs b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyFileVersion/AssemblyFileVersion_001.fs index b507a18bd1..3b27e3a86d 100644 --- a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyFileVersion/AssemblyFileVersion_001.fs +++ b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyFileVersion/AssemblyFileVersion_001.fs @@ -1,7 +1,7 @@ // AssemblyAttributes // See FSHARP1.0:832,1674,1675 and 2290 // Attribute under test: AssemblyFileVersion -// +// #light diff --git a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyInformationalVersion/AssemblyInformationalVersion_001.fs b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyInformationalVersion/AssemblyInformationalVersion_001.fs index 4565354075..d5a5872219 100644 --- a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyInformationalVersion/AssemblyInformationalVersion_001.fs +++ b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyInformationalVersion/AssemblyInformationalVersion_001.fs @@ -1,7 +1,7 @@ // AssemblyAttributes // See FSHARP1.0:832,1674,1675 and 2290 // Attribute under test: AssemblyInformationalVersion -// +// #light diff --git a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyTitle/AssemblyTitle_001.fs b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyTitle/AssemblyTitle_001.fs index 4df4d7003b..01339cfcdb 100644 --- a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyTitle/AssemblyTitle_001.fs +++ b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyTitle/AssemblyTitle_001.fs @@ -1,7 +1,7 @@ // AssemblyAttributes // See FSHARP1.0:832,1674,1675 and 2290 // Attribute under test: AssemblyTitle -// +// #light diff --git a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyTrademark/AssemblyTrademark_001.fs b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyTrademark/AssemblyTrademark_001.fs index 5942474dfd..45fd7e6205 100644 --- a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyTrademark/AssemblyTrademark_001.fs +++ b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyTrademark/AssemblyTrademark_001.fs @@ -1,7 +1,7 @@ // AssemblyAttributes // See FSHARP1.0:832,1674,1675 and 2290 // Attribute under test: AssemblyTrademark -// +// #light diff --git a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyVersion/AssemblyVersion_001.fs b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyVersion/AssemblyVersion_001.fs index 733384b109..c855f442c2 100644 --- a/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyVersion/AssemblyVersion_001.fs +++ b/tests/fsharpqa/Source/ClrFx/PseudoCustomAttributes/AssemblyVersion/AssemblyVersion_001.fs @@ -2,7 +2,7 @@ // AssemblyAttributes // See FSHARP1.0:832,1674,1675 and 2290 // Attribute under test: AssemblyVersion -// +// #light diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/ModuleWithExpression01.fs b/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/ModuleWithExpression01.fs index 97f178a786..d9dfb9ac86 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/ModuleWithExpression01.fs +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/ModuleWithExpression01.fs @@ -1,7 +1,7 @@ // #Regression #NoMono #NoMT #CodeGen #EmittedIL // Regression test for FSHARP1.0:2644 (a module may start with an expression) // Verify that we can compile a module with an expression in it -// +// #light module M = diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/Functional01.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/Functional01.fs index 1d7f197fe2..382cf1b56a 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/Functional01.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/Functional01.fs @@ -3,7 +3,7 @@ // - The same source file (FunctionalLibrary01.fs) is compile twice, with different --codepage options // - The library file is designed so that it gets compiled to slightly different assemblies // - This file references both assemblies and should compile without problems -// +// #light diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/MatchingCodePage01.fsx b/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/MatchingCodePage01.fsx index eb41741555..d4ca66733d 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/MatchingCodePage01.fsx +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/MatchingCodePage01.fsx @@ -1,4 +1,4 @@ // #NoMT #CompilerOptions #load "FunctionalLibrary01.fs";; #q;; -// +// diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/Zero.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/Zero.fs index fb1d506c8e..55e151c551 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/Zero.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/codepage/Zero.fs @@ -1,7 +1,7 @@ // #NoMT #CompilerOptions // --codepage 0 // It does not mean much to me... -// +// #light let x = "a" diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/determinism/PathMap1/pathmap.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/determinism/PathMap1/pathmap.fs index a5cdf2d023..9dd5d2f70b 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/determinism/PathMap1/pathmap.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/determinism/PathMap1/pathmap.fs @@ -1,5 +1,5 @@ // #NoMT #CompilerOptions #Deterministic -// +// // // IMPORTANT: PathMap1/pathmap.fs and PathMap2/pathmap.fs must be identical! module TestPathMap diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/determinism/PathMap2/pathmap.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/determinism/PathMap2/pathmap.fs index a5cdf2d023..9dd5d2f70b 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/determinism/PathMap2/pathmap.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/determinism/PathMap2/pathmap.fs @@ -1,5 +1,5 @@ // #NoMT #CompilerOptions #Deterministic -// +// // // IMPORTANT: PathMap1/pathmap.fs and PathMap2/pathmap.fs must be identical! module TestPathMap diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx b/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx index e16db4e42e..e0d7d42cc8 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/dumpAllCommandLineOptions/dummy.fsx @@ -72,7 +72,7 @@ //section='NoSection ' ! option=splitting kind=OptionSwitch //section='NoSection ' ! option=versionfile kind=OptionString //section='NoSection ' ! option=times kind=OptionUnit -//section='NoSection ' ! option=showextensionresolution kind=OptionUnit +//section='NoSection ' ! option=showextensionresolution kind=OptionUnit //section='NoSection ' ! option=metadataversion kind=OptionString //section='NoSection ' ! option=d kind=OptionString //section='NoSection ' ! option=O kind=OptionSwitch diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/lib/dummy.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/lib/dummy.fs index 069fcced08..5dcac9cf66 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/lib/dummy.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/lib/dummy.fs @@ -1,3 +1,3 @@ // #NoMT #CompilerOptions -// +// exit 0 diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/out/dummy.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/out/dummy.fs index 069fcced08..5dcac9cf66 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/out/dummy.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/out/dummy.fs @@ -1,3 +1,3 @@ // #NoMT #CompilerOptions -// +// exit 0 diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/out/invalidchar.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/out/invalidchar.fs index f44d40f492..9bad8413f8 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/out/invalidchar.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/out/invalidchar.fs @@ -1,3 +1,3 @@ // #NoMT #CompilerOptions -// +// exit 0 \ No newline at end of file diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/responsefile/responsefile01.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/responsefile/responsefile01.fs index f6b04c2c5e..4359bc0009 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/responsefile/responsefile01.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/responsefile/responsefile01.fs @@ -1,5 +1,5 @@ // #NoMT #CompilerOptions -// +// [] let main args = diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/responsefile/responsefile02.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/responsefile/responsefile02.fs index 13e5600860..a7ea6871f6 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/responsefile/responsefile02.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/responsefile/responsefile02.fs @@ -1,5 +1,5 @@ // #NoMT #CompilerOptions -// +// [] let main args = diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/simpleresolution/simpleres_02.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/simpleresolution/simpleres_02.fs index a8e2f22d2c..5acad376be 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/simpleresolution/simpleres_02.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/simpleresolution/simpleres_02.fs @@ -1,7 +1,7 @@ // Regression test for FSharp1.0:4849 // Title: Promote "-simpleresolution" to a documented compiler switch -//mscorlib -//FSharp.Core +//mscorlib +//FSharp.Core exit 0 \ No newline at end of file diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/times/times01.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/times/times01.fs index 30331de28d..b01b7a501d 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/times/times01.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/times/times01.fs @@ -14,46 +14,38 @@ namespace N2 module M3 = exit 0 -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Import mscorlib\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Build Framework TC Imports\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Parse inputs\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Import DLLs\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Typecheck\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Typechecked\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Write Interface File \] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Write XML docs\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Write HTML docs\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Encode Interface Data\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Initial simplify\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Lowertop optimization\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[TAST -> ILX\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[ILX -> IL\] -//ilwrite: TIME.+Write Started -//ilwrite: TIME.+Module Generation Preparation -//ilwrite: TIME.+Module Generation Pass 1 -//ilwrite: TIME.+Module Generation Pass 2 -//ilwrite: TIME.+Module Generation Pass 3 -//ilwrite: TIME.+Module Generation Pass 4 -//ilwrite: TIME.+Finalize Module Generation Results -//ilwrite: TIME.+Generated Tables and Code -//ilwrite: TIME.+Layout Header of Tables -//ilwrite: TIME.+Build String/Blob Address Tables -//ilwrite: TIME.+Sort Tables -//ilwrite: TIME.+Write Header of tablebuf -//ilwrite: TIME.+Write Tables to tablebuf -//ilwrite: TIME.+Layout Metadata -//ilwrite: TIME.+Write Metadata Header -//ilwrite: TIME.+Write Metadata Tables -//ilwrite: TIME.+Write Metadata Strings -//ilwrite: TIME.+Write Metadata User Strings -//ilwrite: TIME.+Write Blob Stream -//ilwrite: TIME.+Fixup Metadata -//ilwrite: TIME.+Generated IL and metadata -//ilwrite: TIME.+Layout image -//ilwrite: TIME.+Writing Image -//ilwrite: TIME.+Finalize PDB -//ilwrite: TIME.+Signing Image -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Write .NET Binary\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Write Config File\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Write Stats File\] -//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Copy referenced files\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Import mscorlib and FSharp.Core.dll\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Parse inputs\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Import non-system references\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Typecheck\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Typechecked\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Write XML docs\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Write HTML docs\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Encode Interface Data\] +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[TAST -> IL\] +//ilwrite: TIME.+Write Started +//ilwrite: TIME.+Module Generation Preparation +//ilwrite: TIME.+Module Generation Pass 1 +//ilwrite: TIME.+Module Generation Pass 2 +//ilwrite: TIME.+Module Generation Pass 3 +//ilwrite: TIME.+Module Generation Pass 4 +//ilwrite: TIME.+Finalize Module Generation Results +//ilwrite: TIME.+Generated Tables and Code +//ilwrite: TIME.+Layout Header of Tables +//ilwrite: TIME.+Build String/Blob Address Tables +//ilwrite: TIME.+Sort Tables +//ilwrite: TIME.+Write Header of tablebuf +//ilwrite: TIME.+Write Tables to tablebuf +//ilwrite: TIME.+Layout Metadata +//ilwrite: TIME.+Write Metadata Header +//ilwrite: TIME.+Write Metadata Tables +//ilwrite: TIME.+Write Metadata Strings +//ilwrite: TIME.+Write Metadata User Strings +//ilwrite: TIME.+Write Blob Stream +//ilwrite: TIME.+Fixup Metadata +//ilwrite: TIME.+Generated IL and metadata +//ilwrite: TIME.+Layout image +//ilwrite: TIME.+Writing Image +//ilwrite: TIME.+Finalize PDB +//ilwrite: TIME.+Signing Image +//TIME:.+Delta:.+Mem:.+G0:.+G1:.+G2:.+\[Write .NET Binary\] diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/warn/nowarn.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/warn/nowarn.fs index 9a2eb16929..7f7d7accda 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/warn/nowarn.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/warn/nowarn.fs @@ -1,7 +1,7 @@ // #Regression #NoMT #CompilerOptions // Regression test for FSHARP1.0:3789 // Unfixable warning 45 -// +// #nowarn "0988" type I = abstract M : unit -> unit diff --git a/tests/fsharpqa/Source/CompilerOptions/fsc/warn/nowarn_with_warnaserror03.fs b/tests/fsharpqa/Source/CompilerOptions/fsc/warn/nowarn_with_warnaserror03.fs index 149d67a253..a829eea182 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsc/warn/nowarn_with_warnaserror03.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsc/warn/nowarn_with_warnaserror03.fs @@ -1,8 +1,8 @@ // #Regression #NoMT #CompilerOptions // Regression test for FSHARP1.0:4867 // nowarn has no effect if "Warning level = 4" and "Warnings as errors" -//FS0040 -//FS0021 +//FS0040 +//FS0021 #nowarn "21" #nowarn "40" diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments01.fsx b/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments01.fsx index a34de38edf..4ec51d3842 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments01.fsx +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments01.fsx @@ -1,4 +1,4 @@ -// Args: \[\|"PassedArguments01\.fsx"\|] +//Args: \[\|"PassedArguments01\.fsx"\|] printfn "Args: %A" fsi.CommandLineArgs #q;; \ No newline at end of file diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments02.fsx b/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments02.fsx index 5b6819251b..3c0c0881a1 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments02.fsx +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments02.fsx @@ -1,4 +1,4 @@ -// Args: \[\|"PassedArguments02\.fsx"; "Alpha"; "Beta Gamma"; "foo\.fs"\|] +//Args: \[\|"PassedArguments02\.fsx"; "Alpha"; "Beta Gamma"; "foo\.fs"\|] printfn "Args: %A" fsi.CommandLineArgs #q;; \ No newline at end of file diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments03.fs b/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments03.fs index fcdc1430a1..491fa87541 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments03.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments03.fs @@ -1,3 +1,3 @@ -// Args: \[\|"PassedArguments03\.fs"\|] +//Args: \[\|"PassedArguments03\.fs"\|] printfn "Args: %A" fsi.CommandLineArgs \ No newline at end of file diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments04.fsx b/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments04.fsx index 65477eb854..17c37a083b 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments04.fsx +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/PassedArguments04.fsx @@ -1,4 +1,4 @@ -// Args: \[\|"PassedArguments04\.fsx"; "Alpha"\|] -// Args: \[\|"PassedArguments04\.fsx"; "Alpha"\|] +// Args: \[\|"PassedArguments04\.fsx"; "Alpha"\|] +// Args: \[\|"PassedArguments04\.fsx"; "Alpha"\|] printfn "Args: %A" fsi.CommandLineArgs \ No newline at end of file diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/error02.fsx b/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/error02.fsx index d6d041937b..5d040a2471 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/error02.fsx +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/arguments/error02.fsx @@ -1,2 +1,2 @@ -// error FS0078:.+ +//error FS0078:.+ #q;; \ No newline at end of file diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/nologo/nologo01.fsx b/tests/fsharpqa/Source/CompilerOptions/fsi/nologo/nologo01.fsx index f56d132a6d..6909de053c 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/nologo/nologo01.fsx +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/nologo/nologo01.fsx @@ -1,3 +1,3 @@ // #NoMT #CompilerOptions -//NOTE +//NOTE #q;; diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/times/asargument.fsx b/tests/fsharpqa/Source/CompilerOptions/fsi/times/asargument.fsx index 8231d24207..a06a2fa3ad 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/times/asargument.fsx +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/times/asargument.fsx @@ -1,4 +1,4 @@ // #NoMT #CompilerOptions -// +// #light exit 0 diff --git a/tests/fsharpqa/Source/CompilerOptions/fsi/times/times01.fs b/tests/fsharpqa/Source/CompilerOptions/fsi/times/times01.fs index 66d43ff946..e30ea7ad56 100644 --- a/tests/fsharpqa/Source/CompilerOptions/fsi/times/times01.fs +++ b/tests/fsharpqa/Source/CompilerOptions/fsi/times/times01.fs @@ -1,4 +1,4 @@ // #NoMT #CompilerOptions -//TIME.+Optimizations +//TIME.+Optimizations exit 0;; diff --git a/tests/fsharpqa/Source/Conformance/BasicGrammarElements/Constants/DecimalLiterals02.fs b/tests/fsharpqa/Source/Conformance/BasicGrammarElements/Constants/DecimalLiterals02.fs index af9d419bf5..ff61e0a1b4 100644 --- a/tests/fsharpqa/Source/Conformance/BasicGrammarElements/Constants/DecimalLiterals02.fs +++ b/tests/fsharpqa/Source/Conformance/BasicGrammarElements/Constants/DecimalLiterals02.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #BasicGrammarElements #Constants #NoMono // This is a positive test on Dev10, at least until // FSHARP1.0:4523 gets resolved. -// +// let ok = 1.0E-50M // parses ok on Dev10 diff --git a/tests/fsharpqa/Source/Conformance/BasicGrammarElements/PrecedenceAndOperators/ExclamationMark02.fs b/tests/fsharpqa/Source/Conformance/BasicGrammarElements/PrecedenceAndOperators/ExclamationMark02.fs index 3f358cb275..d2ce98e00a 100644 --- a/tests/fsharpqa/Source/Conformance/BasicGrammarElements/PrecedenceAndOperators/ExclamationMark02.fs +++ b/tests/fsharpqa/Source/Conformance/BasicGrammarElements/PrecedenceAndOperators/ExclamationMark02.fs @@ -3,7 +3,7 @@ // Prefix only operators: !OP, ?OP, ~OP // Try to use !OP as an infix-op is an error // ?OP ~OP -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Abbreviation01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Abbreviation01.fsx index 055894027f..4aac243ead 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Abbreviation01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Abbreviation01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Exceptions // Abbreviation - using short and long identifiers -// +// #light module M = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Abbreviation_SampleCodeFromSpec01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Abbreviation_SampleCodeFromSpec01.fsx index 38f8c46585..087a7a4063 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Abbreviation_SampleCodeFromSpec01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Abbreviation_SampleCodeFromSpec01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Exceptions // This is the sample code that appears in the specs under 9.4 -// +// #light exception ThatWentBadlyWrong of string * int diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ExceptionAsDerivedFromSystemException01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ExceptionAsDerivedFromSystemException01.fsx index 33ed3c3776..c7e13ce9e7 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ExceptionAsDerivedFromSystemException01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ExceptionAsDerivedFromSystemException01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Exceptions // Exception values may be generated by defining and using classes that extends System.Exception // In this test we verify that both defitions can be used interchangably -// +// type E1(s) = class inherit System.Exception(s) diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ExnAsDiscriminatedUnion01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ExnAsDiscriminatedUnion01.fsx index 1f4d6c24d2..5184278d07 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ExnAsDiscriminatedUnion01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ExnAsDiscriminatedUnion01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Exceptions // Exception definition define new discriminated union cases // Verify that we can use misc types (notice that the "sig-spec" cannot be used [covered in another testcase] -// +// #light exception E1 diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/GeneratedTypeNameNoClash01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/GeneratedTypeNameNoClash01.fsx index 9fa3d94c69..c0b62be04c 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/GeneratedTypeNameNoClash01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/GeneratedTypeNameNoClash01.fsx @@ -2,7 +2,7 @@ // An exception definition no longer generates a type with name idException // (this used to be the case until Dev10 Beta1, but not anymore) // In this case we check and see what happens when such a type already exist -// +// exception E of string type EException = | EE diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ImportCSharpException01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ImportCSharpException01.fsx index e9dd9c03e5..7a27a7ca85 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ImportCSharpException01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/ImportCSharpException01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Exceptions // Import C# exception in F# -// +// #light #r "CSharpException.dll" diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/NamedFields01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/NamedFields01.fsx index 305c5ef9e1..806cb29ed9 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/NamedFields01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/NamedFields01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Exceptions // Specify and match on named fields -// +// exception AAA of V1 : int * V2 : int * V3 : string exception BBB of bool * bool diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Override01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Override01.fsx index 0b09b6befb..1cb548bd73 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Override01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/Override01.fsx @@ -2,7 +2,7 @@ // Exception definition define new discriminated union cases // Verify that we can use misc types (notice that the "sig-spec" cannot be used [covered in another testcase] // This is reqgression test for FSHARP1.0:3725 -// +// [] type Kg diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/PatternMatch_SampleCodeFromSpec01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/PatternMatch_SampleCodeFromSpec01.fsx index 2efcb980ff..ad08703e8c 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/PatternMatch_SampleCodeFromSpec01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ExceptionDefinitions/PatternMatch_SampleCodeFromSpec01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Exceptions // This is the sample code that appears in the specs under 9.4 // It shows how to use exceptions in pattern match -// +// #light exception Error of int * string diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Arrays.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Arrays.fsx index 5c240f9bdc..0971bca358 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Arrays.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Arrays.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Arrays -// +// let samples = [ [|1;1+1|] = [|1;2|]; [|hash (1,1+1)|] = [|hash (1,2)|]; diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Exceptions.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Exceptions.fsx index 7492fef287..df1081f8e0 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Exceptions.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Exceptions.fsx @@ -1,7 +1,7 @@ // #Regression #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Sample on exception // See bug FSHARP1.0:5345 -// +// exception E of int * int diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Generated_Record.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Generated_Record.fsx index e9857b417b..45b1a9b300 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Generated_Record.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Generated_Record.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Check thru reflection the set of methods // Record -// +// #light let TestListOfMethods (typ : System.Type) (exp : string array) = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Lists.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Lists.fsx index 80f3468d47..5241648be9 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Lists.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Lists.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // List -// +// let samples = [ [1;1+1] = [1;2]; // tuples support structural equality [hash (1,1+1)] = [hash (1,2)]; // Function calls return identical values diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Class.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Class.fsx index 43b309619a..188aa41958 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Class.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Class.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Check thru reflection the set of methods // Classes -// +// #light let TestListOfMethods (typ : System.Type) (exp : string array) = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Delegate.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Delegate.fsx index 2b2abb21a6..00dbdb7c4a 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Delegate.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Delegate.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Check thru reflection the set of methods // Delegate -// +// #light let TestListOfMethods (typ : System.Type) (exp : string array) = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Interface.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Interface.fsx index 6997648873..1305080924 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Interface.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/NeverGenerated_Interface.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Check thru reflection the set of methods // Interface -// +// #light let TestListOfMethods (typ : System.Type) (exp : string array) = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Options.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Options.fsx index 2a23ced7f9..ad0945f595 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Options.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Options.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Options // Interesting case: Some vs None -// +// let samples = [ Some(1,1+1) = Some(1,2); // tuples support structural equality Some(hash (1,1+1)) = Some(hash (1,2)); // Function calls return identical values diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Sample_Records.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Sample_Records.fsx index aecacd74ee..96a9518be1 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Sample_Records.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Sample_Records.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Sample on records -// +// type R = R of int * int diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Sample_Tuples.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Sample_Tuples.fsx index 3004400435..e90c48f063 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Sample_Tuples.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Sample_Tuples.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Sample on records -// +// let samples = [ (1,1+1) = (1,2); // tuples support structural equality hash (1,1+1) = hash (1,2); // Function calls return identical values diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Structs.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Structs.fsx index 959e012f67..e5a163f92a 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Structs.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Structs.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Structs -// +// type S<'a> = struct new ( a:'a ) = { f = a } diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Unions.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Unions.fsx index 89a77d2e22..bafeef6d6e 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Unions.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/GeneratedEqualityHashingComparison/Basic/Unions.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #GeneratedEqualityAndHashing // Unions -// +// type DU = | A | B diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/LightSyntax01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/LightSyntax01.fsx index a322a5053b..0d9d10e2ca 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/LightSyntax01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/LightSyntax01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Modules // Light syntax: begin/end can be omitted -// +// #light module N1 = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleAbbreviationWithModule01.fs b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleAbbreviationWithModule01.fs index bf3f02a16e..a4eb1fe232 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleAbbreviationWithModule01.fs +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleAbbreviationWithModule01.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:2644 (a module may start with an expression) // Module abbreviation: // Trying to abbreviate a module is ok -// +// #light // Module abbreviations diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleSuffix02.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleSuffix02.fsx index 08af03fe86..9ce7dfd7fe 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleSuffix02.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleSuffix02.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Modules // Decorating a module with the CompilationRepresentation -// +// #light [] diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleWithExpression01.fs b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleWithExpression01.fs index b1ca869233..b4e987a152 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleWithExpression01.fs +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleWithExpression01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #TypesAndModules #Modules // Regression test for FSHARP1.0:2644 (a module may start with an expression) // Verify that we can compile a module with an expression in it -// +// #light module M = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleWithExpression02.fs b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleWithExpression02.fs index 1368f2aabe..de640d9e72 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleWithExpression02.fs +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/ModuleWithExpression02.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:2644 (a module may start with an expression) // This is unfortunate, but this is the current behavior for this release. // So, the workaround is to use begin... end -// +// #light module M2 = begin diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ExceptionDefinition.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ExceptionDefinition.fsx index af3a544868..d66062890b 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ExceptionDefinition.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ExceptionDefinition.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Modules // Productions -// +// #light module M4 = begin diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ImportDeclaration.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ImportDeclaration.fsx index 62b675e22e..0c28010332 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ImportDeclaration.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ImportDeclaration.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Modules // Productions -// +// #light module M7 = begin diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_LetBindings_Binding.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_LetBindings_Binding.fsx index 2420054016..bdd1915e30 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_LetBindings_Binding.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_LetBindings_Binding.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Modules // Productions -// +// #light module M1 = begin diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_LetBindings_SideEff.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_LetBindings_SideEff.fsx index 80e2b4dca4..f4e122d45d 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_LetBindings_SideEff.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_LetBindings_SideEff.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Modules // Productions -// +// #light module M2 = begin diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ModuleAbbreviation.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ModuleAbbreviation.fsx index 8e33910fde..0e0b33c611 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ModuleAbbreviation.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ModuleAbbreviation.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Modules // Productions -// +// #light module M6 = begin diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ModuleDefinition.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ModuleDefinition.fsx index 5cb177ab56..72b6bb5de9 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ModuleDefinition.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_ModuleDefinition.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Modules // Productions -// +// #light module M5 = begin diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_OCamlCompat.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_OCamlCompat.fsx index e1d533892e..ad3085500b 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_OCamlCompat.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_OCamlCompat.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Modules // Productions // Compile with: --mlcompatibility -a --warnaserror+ -// +// #light module N1 = struct diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_TypeDefinitions.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_TypeDefinitions.fsx index 2e7d213e13..7eb95ab5c8 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_TypeDefinitions.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/ModuleDefinitions/Production_TypeDefinitions.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Modules // Productions -// +// #light module M3 = begin type T = | A = 1 diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/DispatchSlot_Equals01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/DispatchSlot_Equals01.fsx index e1fc1df313..76a42060e7 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/DispatchSlot_Equals01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/DispatchSlot_Equals01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Records // By default, Union types implement dispatch slot Equals // Also minimal test on the expected implementation. -// +// #light [] type Kg diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/DispatchSlot_GetHashCode.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/DispatchSlot_GetHashCode.fsx index dab0aae3fd..a2c6072efc 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/DispatchSlot_GetHashCode.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/DispatchSlot_GetHashCode.fsx @@ -3,7 +3,7 @@ // By default, Union types implement dispatch slot Equals // Also minimal test on the expected implementation. -// +// #light [] type Kg diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/E_TypeInference01b.fs b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/E_TypeInference01b.fs index bc4b7aa4e0..dff437e639 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/E_TypeInference01b.fs +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/E_TypeInference01b.fs @@ -2,7 +2,7 @@ // Verify appropriate error with ambiguous record inference // Same as 01, but with generic types // Regression test for FSHARP1.0:2780 -//No assignment given for field 'Y' of type 'N\.M\.Blue<_>' +//No assignment given for field 'Y' of type 'N\.M\.Blue+ namespace N module M = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Interface_IComparable.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Interface_IComparable.fsx index 1a05f0322b..d23f40d38f 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Interface_IComparable.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Interface_IComparable.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Records // By default, record types implement IComparable -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/LongIdentifiers01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/LongIdentifiers01.fsx index bbfd268769..f107174b96 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/LongIdentifiers01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/LongIdentifiers01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Records // This test is a bit of a kitchen-sink, but its main // purpose is to validate that we can use fully qualified field names -// +// #light type ı = int diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Member01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Member01.fsx index 9ccfb90db7..32b251c047 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Member01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Member01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Records // Record types may include members // Test both static and instance members -// +// #light // Instance member diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/MutableFields01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/MutableFields01.fsx index 4f148fcd61..049ec44f13 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/MutableFields01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/MutableFields01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Records // Verify that record fields may be marked mutable // In this case, only one field is marked as mutable -// +// #light [] type Kg diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/MutableFields_SampleFromSpec02.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/MutableFields_SampleFromSpec02.fsx index 734682db99..d90102244b 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/MutableFields_SampleFromSpec02.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/MutableFields_SampleFromSpec02.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Records // Sample found on the spec. // Section 9.2 (second code snippet) -// +// #light type R2 = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/SampleFromSpec01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/SampleFromSpec01.fsx index 7fe4513897..41fe778adc 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/SampleFromSpec01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/SampleFromSpec01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Records // Sample found on the spec. // Section 9.2 -// +// #light type R1 = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/SampleFromSpec03.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/SampleFromSpec03.fsx index 007989b7a8..22d4a31401 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/SampleFromSpec03.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/SampleFromSpec03.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Records // Sample found on the spec. // Section 9.2 (3rd code snippet) -// +// #light type R = { dx : int; dy: int } diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Scoping03.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Scoping03.fsx index e7a5527184..ac35685aa0 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Scoping03.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Scoping03.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Records // Field labels have module scope -// +// #light type T1 = { a : decimal } diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Scoping04.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Scoping04.fsx index c64eab36cc..5fd5f32742 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Scoping04.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/Scoping04.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Records // Field labels have module scope // Also, in this case we see that there is no collision when the field and type have the same name -// +// #light type ı = int diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/UnitType01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/UnitType01.fsx index 380c7a5438..2735d24b51 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/UnitType01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/RecordTypes/UnitType01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Records // Field has type 'unit' (which is kind of special) -// +// #light type T1 = { u : unit;} diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/Constraints_SampleFromSpec01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/Constraints_SampleFromSpec01.fsx index c5df98643e..b6c2be9886 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/Constraints_SampleFromSpec01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/Constraints_SampleFromSpec01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules // Abbreviation: the constraints on the right-hand-side are sufficient -// +// #light type IA = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/Identity01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/Identity01.fsx index 5d6d34022f..9d1f573387 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/Identity01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/Identity01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules // Type abbreviation // A type that redefine itself -- not very useful, but ok -// +// #light type Z = Z // ok (useless, but ok) diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/ReorderingTypeVariables01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/ReorderingTypeVariables01.fsx index 377001a76b..35a1169058 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/ReorderingTypeVariables01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/ReorderingTypeVariables01.fsx @@ -2,7 +2,7 @@ // Abbreviation: it is ok to reorder type variables // Used to be regression test for FSHARP1.0:3738 // It is now regression test for FSHARP1.0:4786 -// +// module M type Reverse<'a,'b> = 'b -> 'a diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/TypeNestedInModules01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/TypeNestedInModules01.fsx index a8a08368b1..66456c0d0f 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/TypeNestedInModules01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/TypeAbbreviations/TypeNestedInModules01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules // Type abbreviation // The type nested in modules -// +// #light module M1 = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/DispatchSlot_Equals01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/DispatchSlot_Equals01.fsx index 44eb0b1bac..9cec35e1c9 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/DispatchSlot_Equals01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/DispatchSlot_Equals01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Unions // By default, Union types implement dispatch slot Equals // Also minimal test on the expected implementation. -// +// #light type T1 = | A diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/DispatchSlot_GetHashCode.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/DispatchSlot_GetHashCode.fsx index 7c256533dc..e098945c59 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/DispatchSlot_GetHashCode.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/DispatchSlot_GetHashCode.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Unions // By default, Union types implement dispatch slot GetHashCode // We also minimally verify that the hash codes are different for this simple case -// +// #light type T1 = | A diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Interface01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Interface01.fsx index d70e164488..263007b609 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Interface01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Interface01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Unions // DU may include implement interfaces -// +// #light type I = interface diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Interface_IComparable.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Interface_IComparable.fsx index 51eeaf412e..d2692cf9af 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Interface_IComparable.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Interface_IComparable.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Unions // By default, Union types implement IComparable -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Member01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Member01.fsx index 9ba75b652d..c3fbee93b7 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Member01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Member01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Unions // DU may include members // Test both static and instance members -// +// #light // Instance member diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields01.fsx index f771144bfc..e4fe32ea35 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Unions // Constructing DUs with named fields -// +// type Lunch = | Sandwich of meat : string * pickles : bool * layers : int | Soup of Ounces : float * string diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields02.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields02.fsx index 0585842d8b..4d7d6b9270 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields02.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields02.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Unions // Should be able to pattern match using named or positional fields -// +// type MyDU = | Case1 of int * int * int * Named1 : int * Named2 : int * int diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields03.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields03.fsx index 263ea8620e..70c518c193 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields03.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/NamedFields03.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Unions // Potentially ambiguous cases where we need to decide if user is specifying named argument or passing result of equality comparison to boolean/generic field -// +// let checkType (o : obj) ty = if o.GetType() = ty then () diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Overrides01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Overrides01.fsx index 334e604d72..54bf0f4b11 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Overrides01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Overrides01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Unions // DU may include overrides -// +// [] [] diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Parenthesis01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Parenthesis01.fsx index 71561c2a87..cf39d596ad 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Parenthesis01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Parenthesis01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypesAndModules #Unions // Paretheses are significant in DU definitions -// +// #light type T = | C of int * int diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Parenthesis03.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Parenthesis03.fsx index 7c6875ff5f..f07b38c462 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Parenthesis03.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Parenthesis03.fsx @@ -1,6 +1,6 @@ // #Regression #Conformance #TypesAndModules #Unions // Regression test for FSHARP1.0:4787 ("Discriminated union constructors as first class values") -// +// type A = | A1 of int * int diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Recursive01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Recursive01.fsx index 2bc63a34c3..ab64c103be 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Recursive01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/Recursive01.fsx @@ -2,7 +2,7 @@ // DU - with recursive definition // Note: don't try to make much sense of this code. // It's a rather (intentionally) convoluted code. -// +// #light type E = | Sum of E * E diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/SampleFromSpec01b.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/SampleFromSpec01b.fsx index ecdd581962..163d70cd45 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/SampleFromSpec01b.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/SampleFromSpec01b.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Unions // Union Types // Sample from spec - using #light "off" -// +// #light "off" (* extra space *) type Message = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/SampleFromSpec01d.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/SampleFromSpec01d.fsx index 6b01a68a9e..cd241344ff 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/SampleFromSpec01d.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/SampleFromSpec01d.fsx @@ -4,7 +4,7 @@ // The with/end tokens can be omitted when using the #light syntax option as long as the // type-defn-elements vertically aligns with the first ‘|’ in the union-cases // Regression test for FSHARP1.0:3707 -// +// #light (* extra space *) type Message = diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/ScopeAndDataConstrAndPattern01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/ScopeAndDataConstrAndPattern01.fsx index 3068748260..0917601943 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/ScopeAndDataConstrAndPattern01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/ScopeAndDataConstrAndPattern01.fsx @@ -4,7 +4,7 @@ // It also covers the fact that they can be used both as data constructors // and to form patterns. // This is the positive case. -// +// #light [] type ı diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/UnionCaseProduction01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/UnionCaseProduction01.fsx index f182ae8ce4..af214bf2b4 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/UnionCaseProduction01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/UnionCaseProduction01.fsx @@ -4,7 +4,7 @@ // | id -- nullary union case // | id of type * ... * type -- n-ary union case // | id : sig-spec -- n-ary union case -// +// #light type T = | A diff --git a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/UnionCasesProduction01.fsx b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/UnionCasesProduction01.fsx index 5596aefbd1..e2150095ce 100644 --- a/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/UnionCasesProduction01.fsx +++ b/tests/fsharpqa/Source/Conformance/BasicTypeAndModuleDefinitions/UnionTypes/UnionCasesProduction01.fsx @@ -1,7 +1,7 @@ // #Conformance #TypesAndModules #Unions // Union Types // union-cases := [ ‘|’ ] union-case ‘|’ ... ‘|’ union-case -// +// #light // With missing | diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/AccessibilityAnnotations/PermittedLocations/E_accessibilityOnInterface.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/AccessibilityAnnotations/PermittedLocations/E_accessibilityOnInterface.fs index e8489051c5..ae579c72f8 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/AccessibilityAnnotations/PermittedLocations/E_accessibilityOnInterface.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/AccessibilityAnnotations/PermittedLocations/E_accessibilityOnInterface.fs @@ -1,12 +1,12 @@ // #Regression #Conformance #DeclarationElements #Accessibility #light -//\(17,14-18,12\): error FS0191: abstract slots always have the same visibility as the enclosing type -//\(18,14-19,13\): error FS0191: abstract slots always have the same visibility as the enclosing type -//\(19,14-20,13\): error FS0191: abstract slots always have the same visibility as the enclosing type -//\(20,14-20,20\): error FS0010: unexpected keyword 'public' in member definition. Expected identifier, '\(', '\(\*\)' or other token -//\(21,5-22,13\): error FS0191: abstract slots always have the same visibility as the enclosing type -//\(22,14-22,22\): error FS0010: unexpected keyword 'internal' in member definition. Expected identifier, '\(', '\(\*\)' or other token +//\(17,14-18,12\): error FS0191: abstract slots always have the same visibility as the enclosing type +//\(18,14-19,13\): error FS0191: abstract slots always have the same visibility as the enclosing type +//\(19,14-20,13\): error FS0191: abstract slots always have the same visibility as the enclosing type +//\(20,14-20,20\): error FS0010: unexpected keyword 'public' in member definition. Expected identifier, '\(', '\(\*\)' or other token +//\(21,5-22,13\): error FS0191: abstract slots always have the same visibility as the enclosing type +//\(22,14-22,22\): error FS0010: unexpected keyword 'internal' in member definition. Expected identifier, '\(', '\(\*\)' or other token type public IDoStuffAsWell = abstract SomeStuff : int -> unit diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/AccessibilityAnnotations/basic/LocalLetBinding01.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/AccessibilityAnnotations/basic/LocalLetBinding01.fs index b432eafee8..f10d65a84b 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/AccessibilityAnnotations/basic/LocalLetBinding01.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/AccessibilityAnnotations/basic/LocalLetBinding01.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #DeclarationElements #Accessibility // Regression test for FSHARP1.0:4679 -// +// module M type internal A() = class end diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/WithBitwiseOr02a.fsx b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/WithBitwiseOr02a.fsx index eedaf6b9ef..ff5676ea2f 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/WithBitwiseOr02a.fsx +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/WithBitwiseOr02a.fsx @@ -1,7 +1,7 @@ // #Regression #Conformance #DeclarationElements #Attributes // Regression test for FSHARP1.0:3797 // Using bitwise OR (|||) in AttributeUsage works (same as WithBitwiseOr02b.fsx, on class) -// +// #light [] diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/WithBitwiseOr02b.fsx b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/WithBitwiseOr02b.fsx index 36ff507f7d..440f9a4602 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/WithBitwiseOr02b.fsx +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/AttributeUsage/WithBitwiseOr02b.fsx @@ -1,7 +1,7 @@ // #Regression #Conformance #DeclarationElements #Attributes // Regression test for FSHARP1.0:3797 // Using bitwise OR (|||) in AttributeUsage works (same as WithBitwiseOr02a.fsx, on struct) -// +// #light [] diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/FreeTypeVariable01.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/FreeTypeVariable01.fs index a31c1267b4..291c83011d 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/FreeTypeVariable01.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/FreeTypeVariable01.fs @@ -1,8 +1,8 @@ // #Regression #Conformance #DeclarationElements #Attributes // Regression test for FSHARP1.0:1708 // internal compiler error for free type variable in attribute -//internal error -// +//internal error +// #light diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/Function01.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/Function01.fs index 05412591a4..fdea8b78ee 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/Function01.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/Function01.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:2087 // Function parameter attributes are ignored and do not appear in the resulting assembly // Attribute is placed on a let-binding function definition -// +// #light open System.Reflection diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/FunctionArg01.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/FunctionArg01.fs index b75aa1b4ab..89a67dd407 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/FunctionArg01.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/FunctionArg01.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:2087 // Function parameter attributes are ignored and do not appear in the resulting assembly // Attribute is placed on the argument of a let-binding function definition -// +// #light open System.Reflection diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType01.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType01.fs index 32842a0ceb..427aa2b82f 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType01.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType01.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:1165 // F# supports custom attributes on return type // Note: the syntax is kind of awkward... -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType02.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType02.fs index 355de813e7..26bc70a04c 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType02.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType02.fs @@ -3,7 +3,7 @@ // F# supports custom attributes on return type. // Multiple attributes on the same return value (two different attributes) // Note: the syntax is kind of awkward... -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType03.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType03.fs index 8f27434b16..0676010d0d 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType03.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/CustomAttributes/Basic/ReturnType03.fs @@ -3,7 +3,7 @@ // F# supports custom attributes on return type. // Multiple attributes on the same return value (same attribute repeated twice) // Note: the syntax is kind of awkward... -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/E_AsPat01.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/E_AsPat01.fs index e774ae5c32..79385956e6 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/E_AsPat01.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/E_AsPat01.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #DeclarationElements #LetBindings // Verify errors associated with using let bindings + pattern matching -//Type mismatch\. Expecting a +//Type mismatch\. Expecting a+ let one, two = 1, 2, 3 diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/Pathological02.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/Pathological02.fs index a546fde44b..1f3590543d 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/Pathological02.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/Pathological02.fs @@ -1,7 +1,7 @@ // #Conformance #DeclarationElements #LetBindings // Interesting pathological tests // The code is odd, but parses and typechecks fine! :) -// +// module TestModule let f _ _ _ _ _ _ _ _ _ _ = () diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/Pathological04.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/Pathological04.fs index db5aca5285..27015737d9 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/Pathological04.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/Basic/Pathological04.fs @@ -1,7 +1,7 @@ // #Conformance #DeclarationElements #LetBindings // Interesting pathological tests // The code is odd, but parses and typechecks fine! :) -// +// module TestModule let f _ _ _ _ _ _ _ _ _ _ = () diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeofBasic001.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeofBasic001.fs index 93953ffa21..12a318bdac 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeofBasic001.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeofBasic001.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #DeclarationElements #LetBindings #TypeTests // Regression test for FSHARP1.0:1490 // Basic usage of typeof -// +// #light let x = typeof diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeofInCustomAttributes001.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeofInCustomAttributes001.fs index 389dfbb8da..c315468d87 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeofInCustomAttributes001.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeofInCustomAttributes001.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #DeclarationElements #LetBindings #TypeTests // Regression test for FSHARP1.0:1490 // can't use typeof in attributes -// +// [)>] type TestTypeOnType() = diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeof_anonymous_01.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeof_anonymous_01.fs index 181044fdac..e0b29ab558 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeof_anonymous_01.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/LetBindings/TypeFunctions/typeof_anonymous_01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #DeclarationElements #LetBindings #TypeTests // Regression test for FSHARP1.0:2320 // Type passed to typeof<> is _ -// +// #light let _ = typeof<_> diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/NoOverloadIDSpecified.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/NoOverloadIDSpecified.fs index b214cf657b..c4f77fe17d 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/NoOverloadIDSpecified.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/NoOverloadIDSpecified.fs @@ -1,6 +1,6 @@ // #Conformance #DeclarationElements #MemberDefinitions #Overloading // As of Beta2, we don't need OverloadIDs anymore! -// +// type Foo() = member this.SomeMethod (x:int) = true member this.SomeMethod (y:string) = false diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/TooGeneric.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/TooGeneric.fs index 96e0f5da73..fcd700ebe7 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/TooGeneric.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/MemberDefinitions/OverloadingMembers/TooGeneric.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #DeclarationElements #MemberDefinitions #Overloading // Regression test for FSHARP1.0:3388 // overloaded operators which are more generic than their enclosing class -// +// #light type Foo<'a,'b>() = #if TOO_GENERIC diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/SanityCheck.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/SanityCheck.fs index 97ead5bc66..d476d1d24d 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/SanityCheck.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/SanityCheck.fs @@ -1,5 +1,5 @@ // #Conformance #DeclarationElements #Modules -// +// #light module A = diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideModuleDef.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideModuleDef.fs index 50a62b56c1..b9c510b396 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideModuleDef.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideModuleDef.fs @@ -1,6 +1,6 @@ // #Conformance #DeclarationElements #Modules // Use module abbreviation inside a module -// +// #light module A = diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideNamespaceDef.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideNamespaceDef.fs index 3371d5ac8f..24bb542c29 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideNamespaceDef.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideNamespaceDef.fs @@ -1,6 +1,6 @@ // #Conformance #DeclarationElements #Modules // Use module abbreviation inside a namespace -// +// #light namespace Faa.Bor diff --git a/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideNamespaceDefExternal.fs b/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideNamespaceDefExternal.fs index e090adafeb..61c682c267 100644 --- a/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideNamespaceDefExternal.fs +++ b/tests/fsharpqa/Source/Conformance/DeclarationElements/ModuleAbbreviations/useInsideNamespaceDefExternal.fs @@ -1,7 +1,7 @@ // #Conformance #DeclarationElements #Modules #ReqNOMT // Use module abbreviation inside a namespace // Module is defined in an external assembly -// +// #light namespace Faa.Bor diff --git a/tests/fsharpqa/Source/Conformance/Expressions/ControlFlowExpressions/PatternMatching/LiteralNull01.fs b/tests/fsharpqa/Source/Conformance/Expressions/ControlFlowExpressions/PatternMatching/LiteralNull01.fs index d774101604..a20dcca4dd 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/ControlFlowExpressions/PatternMatching/LiteralNull01.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/ControlFlowExpressions/PatternMatching/LiteralNull01.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #ControlFlow // Regression test for FSHARP1.0:2323 (Compiler ICE when matching on literal Null) -// +// #light [] diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof001.fsx b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof001.fsx index 1161e8d27a..1611af55de 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof001.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof001.fsx @@ -2,7 +2,7 @@ // AddressOf Operator // Verify we can use the & operator to invoke .Net method (byref) // In this case we call into a C# method (ref) -// +// #light #r @"addressof001dll.dll" diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof002.fsx b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof002.fsx index 52368cae5f..519f256a37 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof002.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof002.fsx @@ -2,7 +2,7 @@ // AddressOf Operator // Verify we can use the & operator to invoke .Net method (byref) // In this case we call into a C# method (out) -// +// #light #r @"addressof002dll.dll" diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof_local_unit.fsx b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof_local_unit.fsx index c36bea78fd..ab12716891 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof_local_unit.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/AddressOf/addressof_local_unit.fsx @@ -1,7 +1,7 @@ // #Regression #Conformance #DataExpressions // Regression test for FSHARP1.0:4183 // Assert failed in code that take the address of a local of type unit -// +// let f () = let dict = System.Collections.Generic.Dictionary() diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/ObjectExpressions/GenericTypeAnnotations01.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/ObjectExpressions/GenericTypeAnnotations01.fs index 262b175df4..0f1a0653d4 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/ObjectExpressions/GenericTypeAnnotations01.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/ObjectExpressions/GenericTypeAnnotations01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #DataExpressions #ObjectConstructors // Regression test for FSHARP1.0:3857 // Incorrect 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 ''a'. -// +// #light type X = diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/RangeExpressions/FloatingPointRangeExp01.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/RangeExpressions/FloatingPointRangeExp01.fs index 6615b0a412..4fe0d1146c 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/RangeExpressions/FloatingPointRangeExp01.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/RangeExpressions/FloatingPointRangeExp01.fs @@ -3,7 +3,7 @@ // FSB 1005, float comprehensions of form "x0 .. dx .. x1" suffer rounding errors // After changes in BigInt, this is no longer a warning. -//Floating point ranges are experimental and may be deprecated in a future release +//Floating point ranges are experimental and may be deprecated in a future release let floatingPointRange = [0.0 .. 0.01 .. 2.0] let lastNum, sndToLast = floatingPointRange diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/CodeDisposalInMatch01.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/CodeDisposalInMatch01.fs index 07e0c0093a..18c751f819 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/CodeDisposalInMatch01.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/CodeDisposalInMatch01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #DataExpressions #Sequences // Regression test for FSHARP1.0:4365 // Mistake in generation of code for disposal in "match" sequence expressions -// +// let r = ref 0 let f () = [ if (incr r; true) then yield! failwith "" ] let x = (try f () with Failure _ -> [!r]) diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse04.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse04.fs index 7cb9fc6b0a..2ac4289fde 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse04.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse04.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #DataExpressions #Sequences // Regression test for FSHARP1.0:4527 -// +// let p = [ (if true then [for i = 1 to 10 do yield i] // yield is not immediately under the 'then' branch, diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse05.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse05.fs index eeac39a593..145442d6f8 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse05.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse05.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #DataExpressions #Sequences // Regression test for FSHARP1.0:4527 -// +// let p = [ (if true then 1 else 2) ] (if p = [ 1 ] then 0 else 1) |> exit diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse06.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse06.fs index 7868329a4f..fcf5e4a2a1 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse06.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse06.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #DataExpressions #Sequences // Regression test for FSHARP1.0:4527 -// +// let y = [ if true then yield! [1;2] else () ] (if y = [1;2] then 0 else 1) |> exit diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse07.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse07.fs index 41214f2990..55a248688f 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse07.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/IfThenElse07.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #DataExpressions #Sequences // Regression test for FSHARP1.0:4527 -// +// let x = [ if true then yield! [1] diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_bang_keyword_01.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_bang_keyword_01.fs index 3c9793e9ae..5ce4014dd7 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_bang_keyword_01.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_bang_keyword_01.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:3135 // Usage of "->>" in a sequence expression is deprecated // Use "do yield! ..." instead -// +// #light let s = seq { for i in [1 .. 2] do yield! seq { yield i+1 } } diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_dash_gt_01.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_dash_gt_01.fs index 0a149b1d29..537141f6ea 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_dash_gt_01.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_dash_gt_01.fs @@ -3,7 +3,7 @@ // Usage of "->" in a sequence expression is deprecated, unless // in [ for pat in expr -> expr ] and other compact seq expr // Compile with --warnaserror -// +// #light let s1 = seq { for i in [ 1 .. 2 ] -> 10 } diff --git a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_keyword_01.fs b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_keyword_01.fs index e6f8bceff1..bc0876af1d 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_keyword_01.fs +++ b/tests/fsharpqa/Source/Conformance/Expressions/DataExpressions/SequenceExpressions/final_yield_keyword_01.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:3135 // Usage of "->" in a sequence expression is deprecated, unless // in [ for pat in expr -> expr ] and other compact seq expr -// +// #light let s1 = seq { yield 10 } diff --git a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation01.fsx b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation01.fsx index d789557d0a..9f1a449e24 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation01.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation01.fsx @@ -6,7 +6,7 @@ // // rigid type annotation used in the a let-binding // -// +// #light [] type Kg diff --git a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation02.fsx b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation02.fsx index 6db2cbfdc0..53811ad400 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation02.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation02.fsx @@ -6,7 +6,7 @@ // // rigid type annotation used in the a let-binding (function definition + function invocation) // -// +// #light [] type Kg diff --git a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation_null01.fsx b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation_null01.fsx index b45dbc64fd..c42d7ac54a 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation_null01.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/RigidTypeAnnotation_null01.fsx @@ -7,7 +7,7 @@ // expr : ty // // Misc test on 'null' -// +// #light let a = null : string diff --git a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_class01.fsx b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_class01.fsx index ba26509d6a..83a7153666 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_class01.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_class01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypeRelatedExpressions #TypeAnnotations // Upcast with 1-level class hierarchy -// +// #light type K1() = class diff --git a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_int_to_obj.fsx b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_int_to_obj.fsx index 1af94c3923..e86d044d68 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_int_to_obj.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_int_to_obj.fsx @@ -1,6 +1,6 @@ // #Conformance #TypeRelatedExpressions #TypeAnnotations // Upcast to object - int -// +// #light let a = ( upcast 1 ) : obj let b = ( 1 :> _ ) : obj diff --git a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_interface01.fsx b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_interface01.fsx index fde1b72d2f..e8189cdb72 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_interface01.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_interface01.fsx @@ -1,6 +1,6 @@ // #Conformance #TypeRelatedExpressions #TypeAnnotations // Upcast with 1-level class hierarchy - cast to interface -// +// #light type I = interface diff --git a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_interface02.fsx b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_interface02.fsx index 8bb0edd84f..2e896ef9c3 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_interface02.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_interface02.fsx @@ -1,7 +1,7 @@ // #Conformance #TypeRelatedExpressions #TypeAnnotations // Upcast with 1-level class hierarchy - cast to interface // Interface is defined in the base class -> can still upcast to I -// +// #light type I = interface diff --git a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_null_to_obj.fsx b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_null_to_obj.fsx index 0355b0147f..d65de19a9d 100644 --- a/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_null_to_obj.fsx +++ b/tests/fsharpqa/Source/Conformance/Expressions/Type-relatedExpressions/StaticCoercion_null_to_obj.fsx @@ -1,6 +1,6 @@ // #Conformance #TypeRelatedExpressions #TypeAnnotations // Upcast to object - null -// +// #light let a = ( upcast null ) : obj let b = ( null :> _ ) : obj diff --git a/tests/fsharpqa/Source/Conformance/InferenceProcedures/Generalization/NoMoreValueRestriction01.fs b/tests/fsharpqa/Source/Conformance/InferenceProcedures/Generalization/NoMoreValueRestriction01.fs index eb5dcc1b98..97af65cbeb 100644 --- a/tests/fsharpqa/Source/Conformance/InferenceProcedures/Generalization/NoMoreValueRestriction01.fs +++ b/tests/fsharpqa/Source/Conformance/InferenceProcedures/Generalization/NoMoreValueRestriction01.fs @@ -1,6 +1,6 @@ // #Conformance #TypeInference // Verify error if you only specify some, but not all, type args -// +// let f<'a> x (y : 'a) = (x, y) // used to be error "Value restriction...". In Beta2, it is ok (val f : obj -> 'a -> obj * 'a) diff --git a/tests/fsharpqa/Source/Conformance/InferenceProcedures/TypeInference/IgnoreUnitParameters.fs b/tests/fsharpqa/Source/Conformance/InferenceProcedures/TypeInference/IgnoreUnitParameters.fs index 41689d49b5..92e7f412d0 100644 --- a/tests/fsharpqa/Source/Conformance/InferenceProcedures/TypeInference/IgnoreUnitParameters.fs +++ b/tests/fsharpqa/Source/Conformance/InferenceProcedures/TypeInference/IgnoreUnitParameters.fs @@ -2,7 +2,7 @@ // Regression test for https://github.com/Microsoft/visualfsharp/issues/1749 // Type Inference // Explicit program entry point: [] -// +// let run1 (f: unit -> string) = f() diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/E_embeddedString005.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/E_embeddedString005.fs index 944e227083..61b32dc9f2 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/E_embeddedString005.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/E_embeddedString005.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // string embedded in a comment: malformed string // which yield to a compilation error -//End of file in string embedded in comment begun at or before here diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString001.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString001.fs index fa317a2ee2..00265542dd 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString001.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString001.fs @@ -1,7 +1,7 @@ // #Conformance #LexicalAnalysis // string embedded in a comment: invalid escape sequence // \s is not an escaped char, so it's the same as \\s -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString002.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString002.fs index 2370baad00..d5250ec549 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString002.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString002.fs @@ -1,7 +1,7 @@ // #Conformance #LexicalAnalysis // string embedded in a comment: legitimate string containing the // block-comment-end token -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString003.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString003.fs index 09e204dfdd..4931f43463 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString003.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString003.fs @@ -1,6 +1,6 @@ // #Conformance #LexicalAnalysis // string embedded in a comment: legitimate escape sequence -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString004.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString004.fs index 3491c92e10..88dc701d70 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString004.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/embeddedString004.fs @@ -1,7 +1,7 @@ // #Conformance #LexicalAnalysis // string embedded in a comment: legitimate escape sequence // A backslash in in the string -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/escapeCharsInComments001.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/escapeCharsInComments001.fs index f0a284920b..622e431eeb 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/escapeCharsInComments001.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/escapeCharsInComments001.fs @@ -1,7 +1,7 @@ // #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:945 // comment lexing does not handle \" inside quoted strings -// +// #light (* simple escape chars (escape-char in the grammar) *) diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/escapeCharsInComments002.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/escapeCharsInComments002.fs index 742841694c..4553f23c2b 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/escapeCharsInComments002.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/escapeCharsInComments002.fs @@ -1,7 +1,7 @@ // #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:946 // comment lexing does not handle "" and \ inside @" strings -// +// #light (* @"\" *) diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle001.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle001.fs index e3ce9f3479..91f98df0bf 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle001.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle001.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:1561 // Verify that (**) does not leave the lexer in a comment state -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested001.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested001.fs index e720d1e00a..61a6c1ffc1 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested001.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested001.fs @@ -2,7 +2,7 @@ #light // Regression test for FSHARP1.0:1561 // Verify that (**) does not leave the lexer in a comment state -// +// let y1 = (* This is a comment with (**) nested *) 0 exit (if y1 = 0 then 0 else 1) diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested002.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested002.fs index 0d639e0121..669873e81a 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested002.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested002.fs @@ -2,7 +2,7 @@ #light // Regression test for FSHARP1.0:1561 // Verify that (**) does not leave the lexer in a comment state -// +// let y2 = (* This is a comment with * nested *) 2 exit (if y2 = 2 then 0 else 1) diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested003.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested003.fs index 11d0d3840b..caa6e1fcdf 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested003.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested003.fs @@ -2,7 +2,7 @@ #light // Regression test for FSHARP1.0:1561 // Verify that (**) does not leave the lexer in a comment state -// +// let y3 = (* This is a comment with (* *) nested *) 3 diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested004.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested004.fs index e6e7f3bffe..68ece1a9eb 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested004.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested004.fs @@ -2,7 +2,7 @@ #light // Regression test for FSHARP1.0:1561 // Verify that (**) does not leave the lexer in a comment state -// +// let y4 = (* This is a comment with (** **) nested *) 4 exit (if y4 = 4 then 0 else 1) diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested005.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested005.fs index ab1add1c77..1aaa55e333 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested005.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Comments/ocamlstyle_nested005.fs @@ -2,7 +2,7 @@ #light // Regression test for FSHARP1.0:1561 // Verify that (**) does not leave the lexer in a comment state -// +// let y5= (* This is a comment with (***) nested *) 5 diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/E_ReservedIdentKeywords.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/E_ReservedIdentKeywords.fs index d1a63a0c45..993798e6e7 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/E_ReservedIdentKeywords.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/E_ReservedIdentKeywords.fs @@ -31,28 +31,28 @@ let virtual = 10 -//The identifier 'break' is reserved for future use by F# -//The identifier 'checked' is reserved for future use by F# -//The identifier 'component' is reserved for future use by F# +//The identifier 'break' is reserved for future use by F# +//The identifier 'checked' is reserved for future use by F# +//The identifier 'component' is reserved for future use by F# -//The identifier 'constraint' is reserved for future use by F# +//The identifier 'constraint' is reserved for future use by F# -//The identifier 'continue' is reserved for future use by F# -//The identifier 'fori' is reserved for future use by F# +//The identifier 'continue' is reserved for future use by F# +//The identifier 'fori' is reserved for future use by F# -//The identifier 'include' is reserved for future use by F# +//The identifier 'include' is reserved for future use by F# -//The identifier 'mixin' is reserved for future use by F# +//The identifier 'mixin' is reserved for future use by F# -//The identifier 'parallel' is reserved for future use by F# -//The identifier 'params' is reserved for future use by F# -//The identifier 'process' is reserved for future use by F# -//The identifier 'protected' is reserved for future use by F# -//The identifier 'pure' is reserved for future use by F# +//The identifier 'parallel' is reserved for future use by F# +//The identifier 'params' is reserved for future use by F# +//The identifier 'process' is reserved for future use by F# +//The identifier 'protected' is reserved for future use by F# +//The identifier 'pure' is reserved for future use by F# -//The identifier 'sealed' is reserved for future use by F# -//The identifier 'tailcall' is reserved for future use by F# -//The identifier 'trait' is reserved for future use by F# -//The identifier 'virtual' is reserved for future use by F# +//The identifier 'sealed' is reserved for future use by F# +//The identifier 'tailcall' is reserved for future use by F# +//The identifier 'trait' is reserved for future use by F# +//The identifier 'virtual' is reserved for future use by F# diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/backtickmoduleandtypenames.fsx b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/backtickmoduleandtypenames.fsx index b578bcded9..a546320d98 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/backtickmoduleandtypenames.fsx +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/IdentifiersAndKeywords/backtickmoduleandtypenames.fsx @@ -1,4 +1,4 @@ -// +// open System open System.Reflection diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingBin.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingBin.fs index 08eecf2829..91ab16df81 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingBin.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingBin.fs @@ -1,7 +1,7 @@ // #Conformance #LexicalAnalysis #Constants // Number type specifier are not case sensitive // Bin -// +// #light let x1 = 0B1 diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingHex.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingHex.fs index 406ac91d88..e5a7ca5ad8 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingHex.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingHex.fs @@ -1,7 +1,7 @@ // #Conformance #LexicalAnalysis #Constants // Number type specifier are not case sensitive // Float -// +// #light let x = 0x5 diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingIEEE-lf-LF01.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingIEEE-lf-LF01.fs index 37f601ddeb..3ab355ec10 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingIEEE-lf-LF01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingIEEE-lf-LF01.fs @@ -1,7 +1,7 @@ // #Conformance #LexicalAnalysis #Constants // Number type specifier LF/lf are case sensitive // IEEE32/IEEE64 - lf vs LF -// +// #light let x = 0x5lf diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingIEEE-lf-LF02.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingIEEE-lf-LF02.fs index 5ae1d5e544..2586238948 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingIEEE-lf-LF02.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingIEEE-lf-LF02.fs @@ -2,7 +2,7 @@ // Number type specifier are not case sensitive // IEEE32/IEEE64 - lf vs LF // verify that xint can be specified either with '0x' or '0X' -// +// #light let x = 0X5LF diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingOct.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingOct.fs index 960047eaf0..dbd648a4f5 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingOct.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/NumericLiterals/casingOct.fs @@ -1,7 +1,7 @@ // #Conformance #LexicalAnalysis #Constants // Number type specifier are not case sensitive // Oct -// +// #light let x = 0o7 diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Shift/Generics/RightShift001.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Shift/Generics/RightShift001.fs index bff2323485..251673d2e0 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Shift/Generics/RightShift001.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Shift/Generics/RightShift001.fs @@ -2,7 +2,7 @@ // Regression test for FSharp1.0#1076 // Usage of >> and . // No spaces between >> and . -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Shift/Generics/RightShift002.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Shift/Generics/RightShift002.fs index 4dd9cab1ee..ec1187fbd7 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Shift/Generics/RightShift002.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/Shift/Generics/RightShift002.fs @@ -2,7 +2,7 @@ // Regression test for FSharp1.0#1076 // Usage of >> and . // 1 space >> and . -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/StringsAndCharacters/UnicodeString03.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/StringsAndCharacters/UnicodeString03.fs index aa7d7b4ff6..878eb85caa 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/StringsAndCharacters/UnicodeString03.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/StringsAndCharacters/UnicodeString03.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:2193 // Unicodegraph-long not in parity with C# -// +// #light let some_unicode_char = '\u00D6' diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly01.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly01.fs index d41170617d..12a6671e88 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:1077 // closing brace following generic type bracket is syntax error without whitespace (lexed into symbolic token). -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly02.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly02.fs index 4370c474a3..5af95e05e4 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly02.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly02.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:1077 // closing brace following generic type bracket is syntax error without whitespace (lexed into symbolic token). -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly03.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly03.fs index 62b007acc2..ed3f5860e8 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly03.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly03.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:1077 // closing brace following generic type bracket is syntax error without whitespace (lexed into symbolic token). -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly04.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly04.fs index 2ebfa5c841..0065830c2a 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly04.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly04.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:1077 // closing brace following generic type bracket is syntax error without whitespace (lexed into symbolic token). -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly05.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly05.fs index 5476699dca..6aff7f1019 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly05.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedCurly05.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:1077 // closing brace following generic type bracket is syntax error without whitespace (lexed into symbolic token). -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedParenthesis01.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedParenthesis01.fs index 638c6f267b..7f23ee0d1e 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedParenthesis01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedParenthesis01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:2464 // closing square bracket following closing generic type angle bracket is syntax error without whitespace -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedSquare01.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedSquare01.fs index fdd9d2158b..2c542fd8ea 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedSquare01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedSquare01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:2464 // closing square bracket following closing generic type angle bracket is syntax error without whitespace -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedSquare02.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedSquare02.fs index 00e9608322..76e31e183c 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedSquare02.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicKeywords/GreaterThanClosedSquare02.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis // Regression test for FSHARP1.0:2464 // closing square bracket following closing generic type angle bracket is syntax error without whitespace -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicOperators/E_GreaterThanColon002.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicOperators/E_GreaterThanColon002.fs index dc948a4e44..1333d1c115 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicOperators/E_GreaterThanColon002.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicOperators/E_GreaterThanColon002.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis #Operators // Regression test for FSHARP1.0:1392 // Space should not be required between : and > -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicOperators/GreaterThanColon001.fs b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicOperators/GreaterThanColon001.fs index 4936e4123a..e90463c36c 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicOperators/GreaterThanColon001.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalAnalysis/SymbolicOperators/GreaterThanColon001.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexicalAnalysis #Operators // Regression test for FSHARP1.0:1392 // Space should not be required between : and > -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/Basic/OffsideExceptions/InfixTokenPlusOne.fs b/tests/fsharpqa/Source/Conformance/LexicalFiltering/Basic/OffsideExceptions/InfixTokenPlusOne.fs index fdd58db8d4..b7327e1bc2 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalFiltering/Basic/OffsideExceptions/InfixTokenPlusOne.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/Basic/OffsideExceptions/InfixTokenPlusOne.fs @@ -3,7 +3,7 @@ // FSB 1624, LexFilter should consifer infix tokens according to their length -// +// let x = 3 let y = x diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/First_Non_Comment_Text01.fs b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/First_Non_Comment_Text01.fs index f60fbcf281..5533778e40 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/First_Non_Comment_Text01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/First_Non_Comment_Text01.fs @@ -1,5 +1,5 @@ // #Regression #Conformance #LexFilter // Regression test for FSHARP1.0:1078 // The #light is now the default. See also FSHARP1.0:2319 -//#light +//#light //Main module of program is empty: nothing will happen when it is run diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/default_in_fsi01.fs b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/default_in_fsi01.fs index f276b3a87e..379ba736e6 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/default_in_fsi01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/default_in_fsi01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexFilter #ReqNOMT // Regression test for FSHARP1.0:1078 // The #light is default in fsi.exe -// +// let SimpleSample() = let x = 10 + 12 - 3 let y = x * 2 + 1 diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/default_in_fsi02.fs b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/default_in_fsi02.fs index 9d33a8618c..d06c07211d 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/default_in_fsi02.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/default_in_fsi02.fs @@ -1,5 +1,5 @@ // #Conformance #LexFilter #ReqNOMT -//#light +//#light module TestModule let SimpleSample() = let x = 10 + 12 - 3 diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/indent_off_after_comment01.fs b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/indent_off_after_comment01.fs index 7a313d434f..6ba9a667f2 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/indent_off_after_comment01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/indent_off_after_comment01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #LexFilter // Regression test for FSHARP1.0:1078 // The opposit of #light is (for now) #indent "off" -// +// #indent "off" module M let SimpleSample() = diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/light_off_01.fs b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/light_off_01.fs index 43a8ed0a29..2c75e5f8ec 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/light_off_01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HashLight/light_off_01.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #LexFilter // Regression test for FSHARP1.0:1078 // The #light is (for now) #indent "off" -// +// #light "off" exit 0;; diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HighPrecedenceApplication/RangeOperator01.fs b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HighPrecedenceApplication/RangeOperator01.fs index 35c40129de..d69200019b 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HighPrecedenceApplication/RangeOperator01.fs +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HighPrecedenceApplication/RangeOperator01.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #LexFilter #Precedence #ReqNOMT // Regression test for FSHARP1.0:4161 - Error when trying to lex/parse a range involving biggest negative number -// +// module TestModule diff --git a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HighPrecedenceApplication/RangeOperator01.fsx b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HighPrecedenceApplication/RangeOperator01.fsx index 2abd0fa973..8f6b8df6b3 100644 --- a/tests/fsharpqa/Source/Conformance/LexicalFiltering/HighPrecedenceApplication/RangeOperator01.fsx +++ b/tests/fsharpqa/Source/Conformance/LexicalFiltering/HighPrecedenceApplication/RangeOperator01.fsx @@ -1,6 +1,6 @@ // #Regression #Conformance #LexFilter #Precedence #ReqNOMT // Regression test for FSHARP1.0:4161 - Error when trying to lex/parse a range involving biggest negative number -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/InheritsDeclarations/InheritFromAbstractClass.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/InheritsDeclarations/InheritFromAbstractClass.fs index a92ede8e7a..5193bdba68 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/InheritsDeclarations/InheritFromAbstractClass.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/InheritsDeclarations/InheritFromAbstractClass.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #ObjectOrientedTypes #Classes #Inheritance // Regression test for FSHARP1.0:3929 // Impossible to subclass certain C# classes -// +// #light type Bottom() = diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/MemberDeclarations/Sealed_Member_Override01.fsx b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/MemberDeclarations/Sealed_Member_Override01.fsx index c6b60e5087..bee58b466f 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/MemberDeclarations/Sealed_Member_Override01.fsx +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/MemberDeclarations/Sealed_Member_Override01.fsx @@ -1,6 +1,6 @@ // #Regression #Conformance #ObjectOrientedTypes #Classes #Inheritance // Regression test DevDiv:370485 ([Portable] Cannot override sealed method) -// +// // This is the repro case for the bug. There should be no error. type T1() = diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/LexicalScoping01.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/LexicalScoping01.fs index cda8b5087a..0ca40dc39c 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/LexicalScoping01.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/LexicalScoping01.fs @@ -1,7 +1,7 @@ // #Conformance #ObjectOrientedTypes #Classes #LetBindings // Scoping: // identifier introduced by let is local -// +// #light type C() = class static let mutable m = [1;2;3] diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/Offside01.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/Offside01.fs index 22b1a7f557..bd89ddbb5a 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/Offside01.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/Offside01.fs @@ -2,7 +2,7 @@ // Offside rule for static let // We should start counting from the 'static' not from 'let' // Regression test for FSHARP1.0:2042 -// +// #light type T() = static let foo baz = diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/RecNonMutable01.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/RecNonMutable01.fs index debbdcb429..43fdce499d 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/RecNonMutable01.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/ClassTypes/StaticLetDoDeclarations/RecNonMutable01.fs @@ -1,6 +1,6 @@ // #Conformance #ObjectOrientedTypes #Classes #LetBindings // rec (non-mutable) -// +// #light type C() = class static let rec f a = if a = 0 then 1 else a*f(a-1) diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/DelegateTypes/ValidSignature_MultiArg01.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/DelegateTypes/ValidSignature_MultiArg01.fs index ef33bb87fb..18e7e81d0a 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/DelegateTypes/ValidSignature_MultiArg01.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/DelegateTypes/ValidSignature_MultiArg01.fs @@ -1,7 +1,7 @@ // #Conformance #ObjectOrientedTypes #Delegates // Delegate taking multiple arguments // Declaration is in the form: typ * ... * typ -> typ -// +// // Non-generic type MultiArgDelegate = delegate of int * string * byte -> unit diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/DelegateTypes/ValidSignature_ReturningValues01.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/DelegateTypes/ValidSignature_ReturningValues01.fs index 8e5dda697e..629659fad7 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/DelegateTypes/ValidSignature_ReturningValues01.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/DelegateTypes/ValidSignature_ReturningValues01.fs @@ -1,7 +1,7 @@ // #Conformance #ObjectOrientedTypes #Delegates // Delegate returning a function value // Declaration is in the form: typ -> (typ -> ... -> typ -> typ) -// +// // Non-generic type DelegateReturningAFunctionValue = delegate of int -> (string -> int) diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/InterfaceTypes/MultipleInst03.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/InterfaceTypes/MultipleInst03.fs index 528b0c9caa..c420de39e1 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/InterfaceTypes/MultipleInst03.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/InterfaceTypes/MultipleInst03.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:5540 // See also FSHARP1.0:5597 // It is forbidden to implement an interface at multiple instantiations -// +//Duplicate specification of an interface$ //Duplicate or redundant interface$ //Duplicate or redundant interface$ //No abstract or interface member was found that corresponds to this override$ diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/StructTypes/E_StructInheritance01b.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/StructTypes/E_StructInheritance01b.fs index 1abe9c7206..c8771146df 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/StructTypes/E_StructInheritance01b.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/StructTypes/E_StructInheritance01b.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #ObjectOrientedTypes #Structs // Verify error when trying to inherit from a struct type // Regression test for FSHARP1.0:2803 -//FS0191: Cannot inherit from interface type +//FS0191: Cannot inherit from interface type //Cannot inherit a sealed type diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/StructTypes/StructWithNoFields01.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/StructTypes/StructWithNoFields01.fs index ba7ef290a7..ae191b89c8 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/StructTypes/StructWithNoFields01.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/StructTypes/StructWithNoFields01.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #ObjectOrientedTypes #Structs // Regression test for FSHARP1.0:3051 -// +// module TestModule [] diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/NonConflictingIntrinsicMembers.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/NonConflictingIntrinsicMembers.fs index d831cb584e..1f668e8eec 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/NonConflictingIntrinsicMembers.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/NonConflictingIntrinsicMembers.fs @@ -3,7 +3,7 @@ // conflicting members. // After recent changes, DoStuff are no longed intrinsic members; they are instead // extension methods... so this code compiles just fine. -// +// #light namespace NS diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.fs index 35a34ad811..e0b3b861f1 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #ObjectOrientedTypes #TypeExtensions // Regression test for FSHARP1.0:3473 // Signature checking issue with extension of a type defined in a C# dll -// +// #light module Experiment.Extension diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.fsi b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.fsi index d21fdb3e9d..c99ea8c121 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.fsi +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.fsi @@ -1,7 +1,7 @@ // #Regression #Conformance #ObjectOrientedTypes #TypeExtensions // Regression test for FSHARP1.0:3473 // Signature checking issue with extension of a type defined in a C# dll -// +// #light module Experiment.Extension diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.test.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.test.fs index cf998c1108..583335bb35 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.test.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/basic/SignitureIssue01.test.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #ObjectOrientedTypes #TypeExtensions // Regression test for FSHARP1.0:3473 // Signature checking issue with extension of a type defined in a C# dll -// +// #light module Experiment.Test diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/optional/E_typeext_opt005.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/optional/E_typeext_opt005.fs index eb1c2a44bb..4f9afc41f4 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/optional/E_typeext_opt005.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/optional/E_typeext_opt005.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #ObjectOrientedTypes #TypeExtensions // Error when trying to use member overloading when some overloads are specified using curried arguments -//One or more of the overloads of this method has curried arguments\. Consider redesigning these members to take arguments in tupled form -//One or more of the overloads of this method has curried arguments\. Consider redesigning these members to take arguments in tupled form +//One or more of the overloads of this method has curried arguments\. Consider redesigning these members to take arguments in tupled form +//One or more of the overloads of this method has curried arguments\. Consider redesigning these members to take arguments in tupled form namespace NS module M = diff --git a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/optional/typeext_opt008.fs b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/optional/typeext_opt008.fs index 620ed72e81..65dab9bc7c 100644 --- a/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/optional/typeext_opt008.fs +++ b/tests/fsharpqa/Source/Conformance/ObjectOrientedTypeDefinitions/TypeExtensions/optional/typeext_opt008.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #ObjectOrientedTypes #TypeExtensions // Regression test for FSHARP1.0:3593 // "Prefer extension members that have been brought into scope by more recent "open" statements" -// +// namespace NS module M = type Lib with diff --git a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_ActivePatternHasNoFields.fs b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_ActivePatternHasNoFields.fs index 09cf78bec1..9d323f7b4e 100644 --- a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_ActivePatternHasNoFields.fs +++ b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_ActivePatternHasNoFields.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #PatternMatching #ActivePatterns // Regression test for https://github.com/Microsoft/visualfsharp/issues/5745 -//Active patterns do not have fields. This syntax is invalid\. +//Active patterns do not have fields. This syntax is invalid\. open System.Text.RegularExpressions let (|USZipPlus4Code|_|) s = diff --git a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_LetRec01.fs b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_LetRec01.fs index ce1f8c52e5..ad44bfc85b 100644 --- a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_LetRec01.fs +++ b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_LetRec01.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #PatternMatching #ActivePatterns // Regression test for FSHARP1.0:4621 -//This expression was expected to have type. 'Choice<'a,'b>' .but here has type. 'string' +//This expression was expected to have type. 'Choice<'a,'b>' .but here has type. 'string' let rec (|Foo|Bar|) (a:int) x = "BAD DOG!" diff --git a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_LetRec02.fs b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_LetRec02.fs index 30cbacafdc..1e2d83477a 100644 --- a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_LetRec02.fs +++ b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_LetRec02.fs @@ -1,4 +1,4 @@ // #Regression #Conformance #PatternMatching #ActivePatterns // Regression test for FSHARP1.0:4621 -//This is not a valid name for an active pattern +//This is not a valid name for an active pattern let rec (|Foo2|Bar2|_|) (a:int) x = "BAD DOG!" diff --git a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_LetRec03.fs b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_LetRec03.fs index 8c56c01eeb..dcae474e22 100644 --- a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_LetRec03.fs +++ b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_LetRec03.fs @@ -1,4 +1,4 @@ // #Regression #Conformance #PatternMatching #ActivePatterns // Regression test for FSHARP1.0:4621 -//This is not a valid name for an active pattern +//This is not a valid name for an active pattern let rec (|Foo2b|Bar2b|Baz2b|_|) (a:int) x = "BAD DOG!" diff --git a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_LetRec04.fs b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_LetRec04.fs index b8e73717c3..25a7343ffd 100644 --- a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_LetRec04.fs +++ b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_LetRec04.fs @@ -1,5 +1,5 @@ // #Regression #Conformance #PatternMatching #ActivePatterns // Regression test for FSHARP1.0:4621 -//This expression was expected to have type. ''a option' .but here has type. 'string' +//This expression was expected to have type. ''a option' .but here has type. 'string' let rec (|Foo3|_|) (a:int) x = "BAD DOG!" diff --git a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_NonParam01.fs b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_NonParam01.fs index c6dcdfd479..e8f77849d3 100644 --- a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_NonParam01.fs +++ b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_NonParam01.fs @@ -1,5 +1,5 @@ // #Regression #Conformance #PatternMatching #ActivePatterns // Regression test for FSHARP1.0:4621 -//This expression was expected to have type. 'Choice<'a,'b>' .but here has type. 'string' +//This expression was expected to have type. 'Choice<'a,'b>' .but here has type. 'string' let (|Foo|Bar|) x = "BAD DOG!" diff --git a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_NonParam02.fs b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_NonParam02.fs index 7fbec1115f..6d310e4e9f 100644 --- a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_NonParam02.fs +++ b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_NonParam02.fs @@ -1,4 +1,4 @@ // #Regression #Conformance #PatternMatching #ActivePatterns // Regression test for FSHARP1.0:4621 -//This is not a valid name for an active pattern +//This is not a valid name for an active pattern let (|Foo2|Bar2|_|) x = "BAD DOG!" // expect: invalid name for an active pattern diff --git a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_NonParam03.fs b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_NonParam03.fs index 803ae8e5fb..3791cfb83e 100644 --- a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_NonParam03.fs +++ b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_NonParam03.fs @@ -1,4 +1,4 @@ // #Regression #Conformance #PatternMatching #ActivePatterns // Regression test for FSHARP1.0:4621 -//This is not a valid name for an active pattern +//This is not a valid name for an active pattern let (|Foo2b|Bar2b|Baz2b|_|) x = "BAD DOG!" // expect: type string doesn't match type 'choice' diff --git a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_NonParam04.fs b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_NonParam04.fs index 4bee3f2066..b164c604c2 100644 --- a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_NonParam04.fs +++ b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_NonParam04.fs @@ -1,5 +1,5 @@ // #Regression #Conformance #PatternMatching #ActivePatterns // Regression test for FSHARP1.0:4621 -//This expression was expected to have type. ''a option' .but here has type. 'string' +//This expression was expected to have type. ''a option' .but here has type. 'string' let (|Foo3|_|) x = "BAD DOG!" // expect: type string doesn't match type 'option' diff --git a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_Param01.fs b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_Param01.fs index a54718dead..d1fd1f3e71 100644 --- a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_Param01.fs +++ b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_Param01.fs @@ -1,5 +1,5 @@ // #Regression #Conformance #PatternMatching #ActivePatterns // Regression test for FSHARP1.0:4621 -//This expression was expected to have type. 'Choice<'a,'b>' .but here has type. 'string' +//This expression was expected to have type. 'Choice<'a,'b>' .but here has type. 'string' let (|Foo|Bar|) (a:int) x = "BAD DOG!" diff --git a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_Param02.fs b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_Param02.fs index c71c459206..36985891c5 100644 --- a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_Param02.fs +++ b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_Param02.fs @@ -1,4 +1,4 @@ // #Regression #Conformance #PatternMatching #ActivePatterns // Regression test for FSHARP1.0:4621 -//This is not a valid name for an active pattern +//This is not a valid name for an active pattern let (|Foo2|Bar2|_|) (a:int) x = "BAD DOG!" // expect: invalid name for an active pattern diff --git a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_Param03.fs b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_Param03.fs index fabc98f7dd..25bf8af83d 100644 --- a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_Param03.fs +++ b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_Param03.fs @@ -1,4 +1,4 @@ // #Regression #Conformance #PatternMatching #ActivePatterns // Regression test for FSHARP1.0:4621 -//This is not a valid name for an active pattern +//This is not a valid name for an active pattern let (|Foo2b|Bar2b|Baz2b|_|) (a:int) x = "BAD DOG!" // expect: type string doesn't match type 'choice' diff --git a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_Param04.fs b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_Param04.fs index 5d345aeff8..02a9fd6ba0 100644 --- a/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_Param04.fs +++ b/tests/fsharpqa/Source/Conformance/PatternMatching/Named/E_Error_Param04.fs @@ -1,5 +1,5 @@ // #Regression #Conformance #PatternMatching #ActivePatterns // Regression test for FSHARP1.0:4621 -//This expression was expected to have type. ''a option' .but here has type. 'string' +//This expression was expected to have type. ''a option' .but here has type. 'string' let (|Foo3|_|) (a:int) x = "BAD DOG!" diff --git a/tests/fsharpqa/Source/Conformance/Signatures/SignatureConformance/E_StructConstructor01.fsi b/tests/fsharpqa/Source/Conformance/Signatures/SignatureConformance/E_StructConstructor01.fsi index 7c9b851e89..991c81ee5b 100644 --- a/tests/fsharpqa/Source/Conformance/Signatures/SignatureConformance/E_StructConstructor01.fsi +++ b/tests/fsharpqa/Source/Conformance/Signatures/SignatureConformance/E_StructConstructor01.fsi @@ -1,6 +1,6 @@ // #Conformance #Signatures #Structs #Regression // Regression for Dev11:137930, structs used to not give errors on unimplemented constructors in the signature file -//Module 'M' requires a value 'new : unit -> Foo<'T>' +//Module 'M' requires a value 'new : unit -> Foo<'T>' module M diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned01.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned01.fs index 0a42a52c55..028d13cfb5 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned01.fs +++ b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned01.fs @@ -1,6 +1,6 @@ // #Regression #Conformance #UnitsOfMeasure #Diagnostics // Regression test for FSHARP1.0:2732 -// +// // Note: you need the 'step' in the range in order to see the warning! [] type Kg diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned02.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned02.fs index 1f3fb5ae30..60007529f2 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned02.fs +++ b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Diagnostics/RangeOfDimensioned02.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #UnitsOfMeasure #Diagnostics // Regression test for FSHARP1.0:2732 -//Floating point ranges are experimental -// +//Floating point ranges are experimental +// [] type Kg diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/KnownTypeAsUnit01b.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/KnownTypeAsUnit01b.fs index 7395d9854f..97b1108776 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/KnownTypeAsUnit01b.fs +++ b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/KnownTypeAsUnit01b.fs @@ -2,11 +2,11 @@ // Regression test for FSHARP1.0:2708 // ICE when using a known type (int, decimal, etc...) as a unit of measure -//Expected unit-of-measure, not type -//Expected unit-of-measure, not type -//Expected unit-of-measure, not type -//Expected unit-of-measure, not type -//Expected unit-of-measure, not type +//Expected unit-of-measure, not type +//Expected unit-of-measure, not type +//Expected unit-of-measure, not type +//Expected unit-of-measure, not type +//Expected unit-of-measure, not type [] type Kg diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/find_gtdef.fsx b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/find_gtdef.fsx index 72a6f9dc17..5c54cd0ff6 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/find_gtdef.fsx +++ b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/Parsing/find_gtdef.fsx @@ -3,7 +3,7 @@ // In 1.9.6.2, this code snipped passed to fsi used to throw an ICE // This issue was automagically fixed in Beta1 // The text of the ICE was: FSC(0,0): error FS0192: internal error: find_gtdef: Continuous not found -// +// module Compounding = [] type Continuous diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_decimal_01.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_decimal_01.fs index 07cd9c4c65..bcb68704da 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_decimal_01.fs +++ b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_decimal_01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #UnitsOfMeasure #TypeInference #TypeConstraints // Regression tests for FSHARP1.0:3427 and 3423 // -// +// #light module WithDecimal = diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float32_01.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float32_01.fs index e0d7093397..3a4b5c44f1 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float32_01.fs +++ b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float32_01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #UnitsOfMeasure #TypeInference #TypeConstraints // Regression tests for FSHARP1.0:3427 and 3423 // -// +// #light module WithFloat32 = diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float_01.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float_01.fs index 227548f506..015e097a97 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float_01.fs +++ b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/TypeChecker/TypeAbbreviation_float_01.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #UnitsOfMeasure #TypeInference #TypeConstraints // Regression tests for FSHARP1.0:3427 and 3423 // -// +// #light diff --git a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/Polymorphism02.fs b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/Polymorphism02.fs index 9eccc471df..ad94a9d4e1 100644 --- a/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/Polymorphism02.fs +++ b/tests/fsharpqa/Source/Conformance/UnitsOfMeasure/WithOOP/Polymorphism02.fs @@ -1,7 +1,7 @@ // #Regression #Conformance #UnitsOfMeasure #ObjectOrientedTypes // Regression test for FSHARP1.0:3687 // ICE in Units of Measure + Polymorphism -// +// #light module Test diff --git a/tests/fsharpqa/Source/Diagnostics/General/E_AreYouMissingAnArgumentToAFunction01b.fs b/tests/fsharpqa/Source/Diagnostics/General/E_AreYouMissingAnArgumentToAFunction01b.fs index 388da653fe..7f03cb7eee 100644 --- a/tests/fsharpqa/Source/Diagnostics/General/E_AreYouMissingAnArgumentToAFunction01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/General/E_AreYouMissingAnArgumentToAFunction01b.fs @@ -1,7 +1,7 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2804 // Make sure we don't emit ?. (notice that the error message changed a bit since the bug was opened) -//\?\. +//\?\. // let f (x : int list) = int32 (x>>32) diff --git a/tests/fsharpqa/Source/Diagnostics/General/E_IncompleteConstruct01b.fs b/tests/fsharpqa/Source/Diagnostics/General/E_IncompleteConstruct01b.fs index c863b0860a..e3fb451018 100644 --- a/tests/fsharpqa/Source/Diagnostics/General/E_IncompleteConstruct01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/General/E_IncompleteConstruct01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:1181 -//syntax error +//syntax error // diff --git a/tests/fsharpqa/Source/Diagnostics/General/E_SpanExtendsToNextToken01.fs b/tests/fsharpqa/Source/Diagnostics/General/E_SpanExtendsToNextToken01.fs index 2e64ca51bf..c12c083620 100644 --- a/tests/fsharpqa/Source/Diagnostics/General/E_SpanExtendsToNextToken01.fs +++ b/tests/fsharpqa/Source/Diagnostics/General/E_SpanExtendsToNextToken01.fs @@ -13,4 +13,4 @@ namespace N2 // Regression test for FSHARP1.0:4995 // Note that what we are really testing in this case is the span (which was incorrectly (3,1-7-10)) -//Namespaces cannot contain values\. Consider using a module to hold your value declarations\.$ +//Namespaces cannot contain values\. Consider using a module to hold your value declarations\.$ diff --git a/tests/fsharpqa/Source/Diagnostics/General/E_StructMustHaveAtLeastOneField.fs b/tests/fsharpqa/Source/Diagnostics/General/E_StructMustHaveAtLeastOneField.fs index 9064787a01..577d8c4f35 100644 --- a/tests/fsharpqa/Source/Diagnostics/General/E_StructMustHaveAtLeastOneField.fs +++ b/tests/fsharpqa/Source/Diagnostics/General/E_StructMustHaveAtLeastOneField.fs @@ -2,7 +2,7 @@ #light // Somehow related to the fix for FSHARP1.0:3143: as a result, now struct may be empty -// +// type StructType = struct end diff --git a/tests/fsharpqa/Source/Diagnostics/General/E_UnexpectedSymbol01.fs b/tests/fsharpqa/Source/Diagnostics/General/E_UnexpectedSymbol01.fs index 4b9ce7abc5..67024e490c 100644 --- a/tests/fsharpqa/Source/Diagnostics/General/E_UnexpectedSymbol01.fs +++ b/tests/fsharpqa/Source/Diagnostics/General/E_UnexpectedSymbol01.fs @@ -3,7 +3,7 @@ // Regression test for FSHARP1.0:2670 //Unexpected symbol '<-' in pattern //The block following this 'let' is unfinished. Every code block is an expression and must have a result. 'let' cannot be the final code element in a block. Consider giving this block an explicit result. -//lambda +//lambda open Microsoft.FSharp.Control diff --git a/tests/fsharpqa/Source/Diagnostics/General/Generic_Subtype01.fs b/tests/fsharpqa/Source/Diagnostics/General/Generic_Subtype01.fs index 29d42721be..1c6af33370 100644 --- a/tests/fsharpqa/Source/Diagnostics/General/Generic_Subtype01.fs +++ b/tests/fsharpqa/Source/Diagnostics/General/Generic_Subtype01.fs @@ -1,7 +1,7 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:4579 // The following code should not give any error/warning -// +// module M let fromSeq (s: #seq<'schema>) = // <--- used to give a false warning that can't be eliminated s |> Array.ofSeq diff --git a/tests/fsharpqa/Source/Diagnostics/General/W_InstantiationOfGenericTypeMissing02.fs b/tests/fsharpqa/Source/Diagnostics/General/W_InstantiationOfGenericTypeMissing02.fs index 1ccac8da60..d65c5ad447 100644 --- a/tests/fsharpqa/Source/Diagnostics/General/W_InstantiationOfGenericTypeMissing02.fs +++ b/tests/fsharpqa/Source/Diagnostics/General/W_InstantiationOfGenericTypeMissing02.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:3286 -// +// module M type C3<'a>() = class diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/attrUnionCaseDecl01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/attrUnionCaseDecl01b.fs index 3e7a4a52c8..900a961bd2 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/attrUnionCaseDecl01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/attrUnionCaseDecl01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSharp1.0:3702 -//NONTERM +//NONTERM //Incomplete structured construct at or before this point in union case\. Expected identifier, '\(', '\(\*\)' or other token\.$ diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/braceExpr01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/braceExpr01b.fs index c1853be0bb..aa88eb453a 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/braceExpr01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/braceExpr01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2369 -//NONTERM +//NONTERM //Unexpected symbol '<' in expression\. Expected '}' or other token\. //: error : Unmatched '{'$ #light diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/declExpr01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/declExpr01b.fs index 43e9b79ad3..849880f6ca 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/declExpr01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/declExpr01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2124 -//NONTERM +//NONTERM // #light "off" diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl01b.fs index 27268bf5fc..a9fb1c5dd8 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSharp1.0:2219 -//NONTERM +//NONTERM //Unexpected keyword 'val' in definition [] diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl02b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl02b.fs index 349e0f1f23..44cf67e9c0 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl02b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl02b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSharp1.0:2681 -//NONTERM +//NONTERM //Unexpected start of structured construct in definition\. Expected identifier, 'global' or other token\. module '\U00002620' diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl03.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl03.fs index af5eb1ce3b..60c5736d09 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl03.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/fileModuleImpl03.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:2681 // To repro: fsi.exe < foo.fs, otherwise it won't repro! // This test used to emit an error, now (after fix for 2193, it works fine) -//\^\^\^\^\^ -// +//\^\^\^\^\^ +// '\U00002620';; exit 0;; diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/fileNamespaceImpl01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/fileNamespaceImpl01b.fs index 246b03087a..7005248760 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/fileNamespaceImpl01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/fileNamespaceImpl01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2324 -//NONTERM +//NONTERM //Unexpected symbol '\[<' in definition #light "off" diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator01b.fs index cd027304f9..c68c6b60c4 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2124 -//NONTERM +//NONTERM //Unexpected symbol ';;' in expression\. Expected '\]' or other token\.$ //Unmatched '\['$ [1;;2] diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator02b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator02b.fs index 20571c7106..a68c24f01b 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator02b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator02b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2124 -//NONTERM +//NONTERM //Unexpected symbol ',' in lambda expression. fun x, y -> x < y diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator03b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator03b.fs index 29c2971575..d51d30c136 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator03b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator03b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2124 -//NONTERM +//NONTERM //Unexpected keyword 'member' in type definition #light "off" diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator04b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator04b.fs index b35c66c64c..d350cec694 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator04b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator04b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2124 -//NONTERM +//NONTERM //Unexpected keyword 'member' in type definition #light "off" diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator05b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator05b.fs index 690122a45a..e7aa451152 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator05b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator05b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2124 -//NONTERM +//NONTERM //Unexpected symbol '.' in implementation file failwith "foo" : int;; diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator06b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator06b.fs index b8ec396377..4046e284f4 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator06b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/interactiveExprOrDefinitionsTerminator06b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:4245 -//NONTERM +//NONTERM //Unexpected character '.' in implementation file \;; diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/memberDefinitionWithoutType01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/memberDefinitionWithoutType01b.fs index fac2ce699d..39cfda7834 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/memberDefinitionWithoutType01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/memberDefinitionWithoutType01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:4245 -//NONTERM +//NONTERM //Unexpected keyword 'member' in implementation file member private this.Size with set newSize = m_size <- newSize;; \ No newline at end of file diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/monadicExprNonEmptyInitial01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/monadicExprNonEmptyInitial01b.fs index fd0312d50e..2e135a6fba 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/monadicExprNonEmptyInitial01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/monadicExprNonEmptyInitial01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSharp1.0:2104 -//NONTERM +//NONTERM //Unexpected end of input$ #light diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/monadicPatternClauses01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/monadicPatternClauses01b.fs index 7f4300249e..765257c156 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/monadicPatternClauses01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/monadicPatternClauses01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSharp1.0:2106 -//NONTERM +//NONTERM // #light diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/quoteExpr01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/quoteExpr01b.fs index e40a343726..4d0087137c 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/quoteExpr01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/quoteExpr01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2391, FSHARP1.0:1479 -//NONTERM +//NONTERM // #light "off" diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs index 231d1ec0cc..6e950dfac5 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/tuplewithlazy01b.fs @@ -1,7 +1,7 @@ // #Regression #Diagnostics // Regression test for DevDiv:64339 // Note that the bug still repros in CHK/DBG bits - we will knownfail it -//NONTERM +//NONTERM //Unexpected keyword 'lazy' in type definition$ // 5 elements -> ok diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/typ01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/typ01b.fs index 23154a25c9..400bc6d4ab 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/typ01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/typ01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2467 -//NONTERM +//NONTERM //Unexpected symbol '->' in type #light diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/typeConstraint01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/typeConstraint01b.fs index 4a15b697fa..9f5c695916 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/typeConstraint01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/typeConstraint01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSHARP1.0:2648 -//NONTERM +//NONTERM // #light diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/typedSeqExprBlock01b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/typedSeqExprBlock01b.fs index c7b2f1c622..cc7101d992 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/typedSeqExprBlock01b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/typedSeqExprBlock01b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSharp1.0:2237 -//NONTERM +//NONTERM // #light diff --git a/tests/fsharpqa/Source/Diagnostics/NONTERM/typedSeqExprBlock02b.fs b/tests/fsharpqa/Source/Diagnostics/NONTERM/typedSeqExprBlock02b.fs index e9c309d66b..704409444c 100644 --- a/tests/fsharpqa/Source/Diagnostics/NONTERM/typedSeqExprBlock02b.fs +++ b/tests/fsharpqa/Source/Diagnostics/NONTERM/typedSeqExprBlock02b.fs @@ -1,6 +1,6 @@ // #Regression #Diagnostics // Regression test for FSharp1.0:2237 -//NONTERM +//NONTERM // diff --git a/tests/fsharpqa/Source/EntryPoint/E_twofiles_002b.fs b/tests/fsharpqa/Source/EntryPoint/E_twofiles_002b.fs index 47a8c8bbcf..bafbd8f597 100644 --- a/tests/fsharpqa/Source/EntryPoint/E_twofiles_002b.fs +++ b/tests/fsharpqa/Source/EntryPoint/E_twofiles_002b.fs @@ -3,7 +3,7 @@ // Explicit program entry point: [] // Attribute is last declaration on first file //Hello -//A function labeled with the 'EntryPointAttribute' attribute must be the last declaration in the last file in the compilation sequence. +//A function labeled with the 'EntryPointAttribute' attribute must be the last declaration in the last file in the compilation sequence. module TestModule [] diff --git a/tests/fsharpqa/Source/EntryPoint/behavior001.fs b/tests/fsharpqa/Source/EntryPoint/behavior001.fs index d8186ff921..1bbaa34c25 100644 --- a/tests/fsharpqa/Source/EntryPoint/behavior001.fs +++ b/tests/fsharpqa/Source/EntryPoint/behavior001.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:1304 // Explicit program entry point: [] // Verify that static initializers are invoked before entering the 'main' function -// +// #light diff --git a/tests/fsharpqa/Source/EntryPoint/entrypointandFSI.fs b/tests/fsharpqa/Source/EntryPoint/entrypointandFSI.fs index 04b0092e96..a8f28497cd 100644 --- a/tests/fsharpqa/Source/EntryPoint/entrypointandFSI.fs +++ b/tests/fsharpqa/Source/EntryPoint/entrypointandFSI.fs @@ -1,7 +1,7 @@ // #Regression #NoMT #EntryPoint // Regression test for FSHARP1.0:2209 - existence of this attribute should not confuse FSI // Explicit program entry point: [] -// +// #light diff --git a/tests/fsharpqa/Source/EntryPoint/entrypointandFSI02.fsx b/tests/fsharpqa/Source/EntryPoint/entrypointandFSI02.fsx index b3465af492..535ab9aa2f 100644 --- a/tests/fsharpqa/Source/EntryPoint/entrypointandFSI02.fsx +++ b/tests/fsharpqa/Source/EntryPoint/entrypointandFSI02.fsx @@ -1,7 +1,7 @@ // #Regression #NoMT #EntryPoint // Regression test for FSHARP1.0:2209 - existence of this attribute should not confuse FSI // Explicit program entry point: [] -// +// module M = [] diff --git a/tests/fsharpqa/Source/EntryPoint/entrypointfunctionnotmain001.fs b/tests/fsharpqa/Source/EntryPoint/entrypointfunctionnotmain001.fs index 048debefa9..5d5659a902 100644 --- a/tests/fsharpqa/Source/EntryPoint/entrypointfunctionnotmain001.fs +++ b/tests/fsharpqa/Source/EntryPoint/entrypointfunctionnotmain001.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:1793 // Explicit program entry point: [] // Entry point function does not have to be called 'main' -// +// #light diff --git a/tests/fsharpqa/Source/EntryPoint/inamodule001.fs b/tests/fsharpqa/Source/EntryPoint/inamodule001.fs index c6e22cef20..71070cb026 100644 --- a/tests/fsharpqa/Source/EntryPoint/inamodule001.fs +++ b/tests/fsharpqa/Source/EntryPoint/inamodule001.fs @@ -3,7 +3,7 @@ // Explicit program entry point: [] // 'main' function is in a module //Hello -// +// #light module M = diff --git a/tests/fsharpqa/Source/EntryPoint/noarguments001.fs b/tests/fsharpqa/Source/EntryPoint/noarguments001.fs index 688afe23d5..08b4ef60cf 100644 --- a/tests/fsharpqa/Source/EntryPoint/noarguments001.fs +++ b/tests/fsharpqa/Source/EntryPoint/noarguments001.fs @@ -2,7 +2,7 @@ // Regression test for FSHARP1.0:1304 // Explicit program entry point: [] // 'main' function invoked with no arguments -// +// #light diff --git a/tests/fsharpqa/Source/EntryPoint/oneargument001.fs b/tests/fsharpqa/Source/EntryPoint/oneargument001.fs index 47c4ee5a4e..c50c8334ac 100644 --- a/tests/fsharpqa/Source/EntryPoint/oneargument001.fs +++ b/tests/fsharpqa/Source/EntryPoint/oneargument001.fs @@ -3,7 +3,7 @@ // Explicit program entry point: [] // 'main' function invoked with 1 argument //Hello -// +// #light diff --git a/tests/fsharpqa/Source/EntryPoint/twofiles_001a.fs b/tests/fsharpqa/Source/EntryPoint/twofiles_001a.fs index 98ea1ad7dd..89db75bb9e 100644 --- a/tests/fsharpqa/Source/EntryPoint/twofiles_001a.fs +++ b/tests/fsharpqa/Source/EntryPoint/twofiles_001a.fs @@ -3,7 +3,7 @@ // Explicit program entry point: [] // 'main' function invoked with no arguments //Hello -// +// module M diff --git a/tests/fsharpqa/Source/EntryPoint/twofiles_001b.fs b/tests/fsharpqa/Source/EntryPoint/twofiles_001b.fs index eb54d7243e..41a6d23c11 100644 --- a/tests/fsharpqa/Source/EntryPoint/twofiles_001b.fs +++ b/tests/fsharpqa/Source/EntryPoint/twofiles_001b.fs @@ -3,7 +3,7 @@ // Explicit program entry point: [] // 'main' function invoked with no arguments //Hello -// +// module TestModule diff --git a/tests/fsharpqa/Source/Import/assign_to_static_field01.fs b/tests/fsharpqa/Source/Import/assign_to_static_field01.fs index 34cc7e1dae..345f0bf660 100644 --- a/tests/fsharpqa/Source/Import/assign_to_static_field01.fs +++ b/tests/fsharpqa/Source/Import/assign_to_static_field01.fs @@ -1,7 +1,7 @@ // #Regression #NoMT #Import // Regression test for FSHARP1.0:2097 // Make sure we can assign to a static field imported from a C# assembly -// +// #light // Retrieve initial value diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/DeclareEvent.fsx b/tests/fsharpqa/Source/InteractiveSession/Misc/DeclareEvent.fsx index 91b75021aa..52467c23a6 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/DeclareEvent.fsx +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/DeclareEvent.fsx @@ -1,5 +1,5 @@ // #NoMT #FSI -//EventName: Event +//EventName: Event type T() = do diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/DontShowCompilerGenNames01.fsx b/tests/fsharpqa/Source/InteractiveSession/Misc/DontShowCompilerGenNames01.fsx index 2e75878deb..9b2bd981e9 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/DontShowCompilerGenNames01.fsx +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/DontShowCompilerGenNames01.fsx @@ -2,13 +2,13 @@ // Regression test for FSHARP1.0:2549 // See also CL:14579 -//type T = -//class -//member M1 : x:int \* y:string -> \('a -> unit\) -//member M2 : \(int \* string\) -> \('a -> unit\) -//exception ExnType of int \* string -//type DiscUnion = \| DataTag of int \* string -//val f : x:int -> y:int -> int +//type T = +//class +//member M1 : x:int \* y:string -> \('a -> unit\) +//member M2 : \(int \* string\) -> \('a -> unit\) +//exception ExnType of int \* string +//type DiscUnion = \| DataTag of int \* string +//val f : x:int -> y:int -> int type T = diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/E_RangeOperator01.fsx b/tests/fsharpqa/Source/InteractiveSession/Misc/E_RangeOperator01.fsx index 2b6910f9d4..004ef98547 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/E_RangeOperator01.fsx +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/E_RangeOperator01.fsx @@ -1,8 +1,8 @@ // #Regression #NoMT #FSI // Regression test for FSharp1.0:4164 - FSI emit "please report to fsbugs" error on malformed usage of .. operator -// fsbug -// nonTerminalId\.GetTag +//fsbug +//nonTerminalId\.GetTag //Unexpected symbol '\.\.' in interaction\. Expected incomplete structured construct at or before this point, ';', ';;' or other token\.$ aaaa..;; diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/EmptyList.fsx b/tests/fsharpqa/Source/InteractiveSession/Misc/EmptyList.fsx index 3ab0383348..da1df59524 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/EmptyList.fsx +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/EmptyList.fsx @@ -1,7 +1,7 @@ // #Regression #NoMT #FSI // Regression test for FSHARP1.0:5599 // -//val it : 'a list$ +//val it : 'a list$ [];; #q;; diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/NativeIntSuffix01.fs b/tests/fsharpqa/Source/InteractiveSession/Misc/NativeIntSuffix01.fs index 262e185ff9..9ee7197ebe 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/NativeIntSuffix01.fs +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/NativeIntSuffix01.fs @@ -1,7 +1,7 @@ // #Regression #NoMT #FSI // Regression test for FSHARP1.0:4118 // FSI: PrettyPrinting of nativeint or unativeint does not emit the suffix (n or un, respectively) -// val it : nativeint = 2n +//val it : nativeint = 2n nativeint 2;; #q;; diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/References.fsx b/tests/fsharpqa/Source/InteractiveSession/Misc/References.fsx index 2b1bc970fb..e78bd6d32f 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/References.fsx +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/References.fsx @@ -1,4 +1,4 @@ // #NoMT #FSI -//System\.Core\.dll +//System\.Core\.dll #r "System.Core.dll";; exit 0;; diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/References35.fsx b/tests/fsharpqa/Source/InteractiveSession/Misc/References35.fsx index 18420dc591..1e09e7ca7f 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/References35.fsx +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/References35.fsx @@ -1,4 +1,4 @@ // #NoMT #FSI #NoMono -//v3\.5.+System\.Core\.dll +//v3\.5.+System\.Core\.dll #r "System.Core.dll";; exit 0;; diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/References40.fsx b/tests/fsharpqa/Source/InteractiveSession/Misc/References40.fsx index 029133fbd5..c56ce024ff 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/References40.fsx +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/References40.fsx @@ -1,4 +1,4 @@ // #NoMT #FSI #NoMono -//v4\.0.+System\.Core\.dll +//v4\.0.+System\.Core\.dll #r "System.Core.dll";; exit 0;; diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/TimeToggles.fsx b/tests/fsharpqa/Source/InteractiveSession/Misc/TimeToggles.fsx index fa3a42fb80..a764279c7f 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/TimeToggles.fsx +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/TimeToggles.fsx @@ -1,7 +1,7 @@ // #Regression #NoMT #FSI #RequiresENU // Regression test for FSharp1.0:4164 - FSI emit "please report to fsbugs" error on malformed usage of .. operator -// Timing now on -// Timing now off +// Timing now on +// Timing now off #time "on" #time "off" diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/UNativeIntSuffix01.fs b/tests/fsharpqa/Source/InteractiveSession/Misc/UNativeIntSuffix01.fs index 57fd75df7b..2c074746de 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/UNativeIntSuffix01.fs +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/UNativeIntSuffix01.fs @@ -1,7 +1,7 @@ // #Regression #NoMT #FSI // Regression test for FSHARP1.0:4118 // FSI: PrettyPrinting of nativeint or unativeint does not emit the suffix (n or un, respectively) -// val it : unativeint = 2un +//val it : unativeint = 2un unativeint 2;; #q;; diff --git a/tests/fsharpqa/Source/InteractiveSession/Misc/UnitConstInput_6323b.fsx b/tests/fsharpqa/Source/InteractiveSession/Misc/UnitConstInput_6323b.fsx index 94417a5352..9947eb92f9 100644 --- a/tests/fsharpqa/Source/InteractiveSession/Misc/UnitConstInput_6323b.fsx +++ b/tests/fsharpqa/Source/InteractiveSession/Misc/UnitConstInput_6323b.fsx @@ -1,6 +1,6 @@ // #NoMT #FSI -//val it : int = 42 -//val it : unit = \(\) +//val it : int = 42 +//val it : unit = \(\) 42;; ();; #q;; \ No newline at end of file diff --git a/tests/fsharpqa/Source/Libraries/Core/Collections/Seq_Cast_Dispose01.fs b/tests/fsharpqa/Source/Libraries/Core/Collections/Seq_Cast_Dispose01.fs index 9d78863661..9ad88b379a 100644 --- a/tests/fsharpqa/Source/Libraries/Core/Collections/Seq_Cast_Dispose01.fs +++ b/tests/fsharpqa/Source/Libraries/Core/Collections/Seq_Cast_Dispose01.fs @@ -6,7 +6,7 @@ // This test should probably go under the SystematicUnitTests suite, but // I could not decide how to make it fit... so I'm leaving it here. // -// +// let mutable dispose_called_in_E = 0 // we expect this to be incremented 3 times let mutable dispose_called_in_C = 0 // we expect this to be incremented once (=this is what the bug was about, i.e. .Dispose() was never invoked) diff --git a/tests/fsharpqa/Source/Libraries/Core/LanguagePrimitives/anytostring01.fsx b/tests/fsharpqa/Source/Libraries/Core/LanguagePrimitives/anytostring01.fsx index d753159960..ba675c60d7 100644 --- a/tests/fsharpqa/Source/Libraries/Core/LanguagePrimitives/anytostring01.fsx +++ b/tests/fsharpqa/Source/Libraries/Core/LanguagePrimitives/anytostring01.fsx @@ -1,60 +1,60 @@ // #Regression #Libraries #LanguagePrimitives #ReqNOMT // Regression test for FSHARP1.0:5894 -//val it : string = "1" -//val it : string = "1.00001" -//val it : string = "-1.00001" -//val it : string = "1" -//val it : string = "1.00001" -//val it : string = "-1.00001" -//val it : string = "127" -//val it : string = "-128" -//val it : string = "0" -//val it : string = "-1" -//val it : string = "1" -//val it : string = "255" -//val it : string = "0" -//val it : string = "0" -//val it : string = "1" -//val it : string = "32767" -//val it : string = "-32768" -//val it : string = "0" -//val it : string = "-10" -//val it : string = "10" -//val it : string = "65535" -//val it : string = "0" -//val it : string = "0" -//val it : string = "110" -//val it : string = "2147483647" -//val it : string = "-2147483648" -//val it : string = "0" -//val it : string = "-10" -//val it : string = "10" -//val it : string = "4294967295" -//val it : string = "0" -//val it : string = "0" -//val it : string = "10" -//val it : string = "9223372036854775807" -//val it : string = "-9223372036854775808" -//val it : string = "0" -//val it : string = "-10" -//val it : string = "10" -//val it : string = "18446744073709551615" -//val it : string = "0" -//val it : string = "0" -//val it : string = "10" -//val it : string = "79228162514264337593543950335" -//val it : string = "-79228162514264337593543950335" -//val it : string = "0" -//val it : string = "12345678" -//val it : string = "-12345678" -//val it : string = "-Infinity" -//val it : string = "Infinity" -//val it : string = "NaN" -//val it : string = "-Infinity" -//val it : string = "Infinity" -//val it : string = "NaN" -//val it : string = "210f4d6b-cb42-4b09-baa1-f1aa8e59d4b0" +//val it : string = "1" +//val it : string = "1.00001" +//val it : string = "-1.00001" +//val it : string = "1" +//val it : string = "1.00001" +//val it : string = "-1.00001" +//val it : string = "127" +//val it : string = "-128" +//val it : string = "0" +//val it : string = "-1" +//val it : string = "1" +//val it : string = "255" +//val it : string = "0" +//val it : string = "0" +//val it : string = "1" +//val it : string = "32767" +//val it : string = "-32768" +//val it : string = "0" +//val it : string = "-10" +//val it : string = "10" +//val it : string = "65535" +//val it : string = "0" +//val it : string = "0" +//val it : string = "110" +//val it : string = "2147483647" +//val it : string = "-2147483648" +//val it : string = "0" +//val it : string = "-10" +//val it : string = "10" +//val it : string = "4294967295" +//val it : string = "0" +//val it : string = "0" +//val it : string = "10" +//val it : string = "9223372036854775807" +//val it : string = "-9223372036854775808" +//val it : string = "0" +//val it : string = "-10" +//val it : string = "10" +//val it : string = "18446744073709551615" +//val it : string = "0" +//val it : string = "0" +//val it : string = "10" +//val it : string = "79228162514264337593543950335" +//val it : string = "-79228162514264337593543950335" +//val it : string = "0" +//val it : string = "12345678" +//val it : string = "-12345678" +//val it : string = "-Infinity" +//val it : string = "Infinity" +//val it : string = "NaN" +//val it : string = "-Infinity" +//val it : string = "Infinity" +//val it : string = "NaN" +//val it : string = "210f4d6b-cb42-4b09-baa1-f1aa8e59d4b0" (string 1.0f);; (string 1.00001f);; diff --git a/tests/fsharpqa/Source/Libraries/Core/Operators/CastOperator.fs b/tests/fsharpqa/Source/Libraries/Core/Operators/CastOperator.fs index be46abb5e1..a79a04119b 100644 --- a/tests/fsharpqa/Source/Libraries/Core/Operators/CastOperator.fs +++ b/tests/fsharpqa/Source/Libraries/Core/Operators/CastOperator.fs @@ -1,7 +1,7 @@ // #Regression #Libraries #Operators // Regression test for FSHARP1.0:1247 // Precedence of type annotations :> and :?> over preceeding expression forms, e.g. if-then-else etc. -// +// open System let x = 2 :> Object diff --git a/tests/fsharpqa/Source/Misc/DefaultManifest.fs b/tests/fsharpqa/Source/Misc/DefaultManifest.fs index c0ba0869d9..39d47d6f1d 100644 --- a/tests/fsharpqa/Source/Misc/DefaultManifest.fs +++ b/tests/fsharpqa/Source/Misc/DefaultManifest.fs @@ -1,5 +1,5 @@ // The compiler should add an embedded default win32 manifest so that UAC is handled properly -// +// open System open System.Text diff --git a/tests/fsharpqa/Source/Misc/WhetherEmbededManifest.fs b/tests/fsharpqa/Source/Misc/WhetherEmbededManifest.fs index b86d931700..bbf0c797ab 100644 --- a/tests/fsharpqa/Source/Misc/WhetherEmbededManifest.fs +++ b/tests/fsharpqa/Source/Misc/WhetherEmbededManifest.fs @@ -1,7 +1,7 @@ // #Regression #Misc #NoMono // Regression test for FSHARP1.0:1668 // Compiler should provide a way to embed manifest files -// +// open System.Reflection let thisExe = System.Reflection.Assembly.GetExecutingAssembly() diff --git a/tests/fsharpqa/Source/OCamlCompat/NoParensInLet01.fs b/tests/fsharpqa/Source/OCamlCompat/NoParensInLet01.fs index 47ede51211..471653dabd 100644 --- a/tests/fsharpqa/Source/OCamlCompat/NoParensInLet01.fs +++ b/tests/fsharpqa/Source/OCamlCompat/NoParensInLet01.fs @@ -4,7 +4,7 @@ // FSHARP1.0:1117, Bindings that look like function definitions are interpreted as pattern matches without warning. Add a warning for this case to allow for later language design change here. // FSHARP1.0:2552, name scoping bug -// +// type t = F of int * int diff --git a/tests/fsharpqa/Source/Printing/BindingsWithValues01.fsx b/tests/fsharpqa/Source/Printing/BindingsWithValues01.fsx index a1bca475bf..052100c05f 100644 --- a/tests/fsharpqa/Source/Printing/BindingsWithValues01.fsx +++ b/tests/fsharpqa/Source/Printing/BindingsWithValues01.fsx @@ -3,27 +3,27 @@ // Test for FSharp1.0:2581 - FSI should display bound values, not just evaluated expressions (was: FSI should print the value of the last declared value is there is no last expression) -//type RecT = -// {Name: string;} -//type Bldg = -// \| House -// \| Museum -// \| Office -//val a : int = 1 -//val B : string = "Hello" -//val c' : RecT = {Name = "F#";} -//val _d : Bldg = Office -//val e : seq -//val F'F : int list = \[3; 2; 1] -//val g : Set -//val g' : Set<'a> -//val getPointF : x:float32 \* y:float32 -> System\.Drawing\.PointF -//val h : System\.Drawing\.PointF = {X=.+, Y=.+} -//val i : int \* RecT \* Bldg = \(1, {Name = "F#";}, Office\) -//val J_ : int \[\] = \[\|1; 2; 3\|] -//val j_' : float \[\] = \[\|1\.0; 1\.0\|] -//val j_'_ : RecT \[\] = \[\|\|] -//val j_'' : string \[\] = \[\|"0"; "1"; "2"; "3"; "4"\|] +//type RecT = +// {Name: string;} +//type Bldg = +// \| House +// \| Museum +// \| Office +//val a : int = 1 +//val B : string = "Hello" +//val c' : RecT = {Name = "F#";} +//val _d : Bldg = Office +//val e : seq +//val F'F : int list = \[3; 2; 1] +//val g : Set +//val g' : Set<'a> +//val getPointF : x:float32 \* y:float32 -> System\.Drawing\.PointF +//val h : System\.Drawing\.PointF = {X=.+, Y=.+} +//val i : int \* RecT \* Bldg = \(1, {Name = "F#";}, Office\) +//val J_ : int \[\] = \[\|1; 2; 3\|] +//val j_' : float \[\] = \[\|1\.0; 1\.0\|] +//val j_'_ : RecT \[\] = \[\|\|] +//val j_'' : string \[\] = \[\|"0"; "1"; "2"; "3"; "4"\|] type RecT = { Name : string } diff --git a/tests/fsharpqa/Source/Printing/CustomExceptions02.fsx b/tests/fsharpqa/Source/Printing/CustomExceptions02.fsx index d1332158c1..c3a2d77b8d 100644 --- a/tests/fsharpqa/Source/Printing/CustomExceptions02.fsx +++ b/tests/fsharpqa/Source/Printing/CustomExceptions02.fsx @@ -2,9 +2,9 @@ #light // Test for FSharp1.0:4086 - accessiblity not printed for exceptions -// exception internal A of int -// exception private B of string -// exception C of System\.DateTime +//exception internal A of int +//exception private B of string +//exception C of System\.DateTime exception internal A of int exception private B of string diff --git a/tests/fsharpqa/Source/Printing/DisposeOnSprintfA.fs b/tests/fsharpqa/Source/Printing/DisposeOnSprintfA.fs index e20b0c7358..41af243eb3 100644 --- a/tests/fsharpqa/Source/Printing/DisposeOnSprintfA.fs +++ b/tests/fsharpqa/Source/Printing/DisposeOnSprintfA.fs @@ -1,7 +1,7 @@ // #Regression #NoMT #Printing // Regression test for FSHARP1.0:4725 // F# is not disposing an IEnumerator in implementation of sprintf "%A" -//Done +//Done let x = seq { try yield 1; yield 2; finally printfn "Done" } diff --git a/tests/fsharpqa/Source/Printing/ParamArrayInSignatures.fsx b/tests/fsharpqa/Source/Printing/ParamArrayInSignatures.fsx index 712a9f5ed3..c68d6bbb8e 100644 --- a/tests/fsharpqa/Source/Printing/ParamArrayInSignatures.fsx +++ b/tests/fsharpqa/Source/Printing/ParamArrayInSignatures.fsx @@ -2,10 +2,10 @@ // Regression test for https://github.com/Microsoft/visualfsharp/issues/109 // pretty printing signatures with params arguments -//type Heterogeneous = -// class -// static member Echo : \[\] args:obj \[\] -> obj \[\] -// end +//type Heterogeneous = +// class +// static member Echo : \[\] args:obj \[\] -> obj \[\] +// end type Heterogeneous = static member Echo([] args: obj[]) = args diff --git a/tests/fsharpqa/Source/Printing/Quotation01.fs b/tests/fsharpqa/Source/Printing/Quotation01.fs index bf6ce9e247..c34e1e78fb 100644 --- a/tests/fsharpqa/Source/Printing/Quotation01.fs +++ b/tests/fsharpqa/Source/Printing/Quotation01.fs @@ -1,7 +1,7 @@ // #NoMT #Printing // Regression test for FSHARP1.0:524 -//val it : Quotations.Expr = Value \(1\) {CustomAttributes = \[||\]; -// Raw = \.\.\.; -// Type = System\.Int32;} +//val it : Quotations.Expr = Value \(1\) {CustomAttributes = \[||\]; +// Raw = \.\.\.; +// Type = System\.Int32;} <@ 1 @>;; exit 0;; diff --git a/tests/fsharpqa/Source/Printing/SignatureWithOptionalArgs01.fs b/tests/fsharpqa/Source/Printing/SignatureWithOptionalArgs01.fs index 7473f0a521..5605d46d4d 100644 --- a/tests/fsharpqa/Source/Printing/SignatureWithOptionalArgs01.fs +++ b/tests/fsharpqa/Source/Printing/SignatureWithOptionalArgs01.fs @@ -2,14 +2,14 @@ // Regression test for FSHARP1.0:1110 // pretty printing signatures with optional arguments -//type AsyncTimer = -// class -// new : f:\(unit -> unit\) \* \?delay:int -> AsyncTimer -// member Start : unit -> unit -// member Stop : unit -> unit -// member Delay : int option -// member Delay : int option with set -// end +//type AsyncTimer = +// class +// new : f:\(unit -> unit\) \* \?delay:int -> AsyncTimer +// member Start : unit -> unit +// member Stop : unit -> unit +// member Delay : int option +// member Delay : int option with set +// end open Microsoft.FSharp.Control diff --git a/tests/fsharpqa/Source/Printing/UnitsOfMeasureIdentifiersRoundTrip01.fsx b/tests/fsharpqa/Source/Printing/UnitsOfMeasureIdentifiersRoundTrip01.fsx index ca110a6182..d4643be3c7 100644 --- a/tests/fsharpqa/Source/Printing/UnitsOfMeasureIdentifiersRoundTrip01.fsx +++ b/tests/fsharpqa/Source/Printing/UnitsOfMeasureIdentifiersRoundTrip01.fsx @@ -1,9 +1,9 @@ // #Regression #NoMT #Printing // Regression test for FSHARP1.0:3300 // Verify that Pretty-printing of measure identifiers round-trips, i.e. displays the long identified (Namespace.Module.Type) -//val it : decimal = -2\.0M -//val it : float32 = 2\.0f -//val it : float = 1\.2 +//val it : decimal = -2\.0M +//val it : float32 = 2\.0f +//val it : float = 1\.2 #light module M1 = diff --git a/tests/fsharpqa/Source/Printing/UnitsOfMeasureIdentifiersRoundTrip02.fsx b/tests/fsharpqa/Source/Printing/UnitsOfMeasureIdentifiersRoundTrip02.fsx index db0557eb71..b9b5d7d838 100644 --- a/tests/fsharpqa/Source/Printing/UnitsOfMeasureIdentifiersRoundTrip02.fsx +++ b/tests/fsharpqa/Source/Printing/UnitsOfMeasureIdentifiersRoundTrip02.fsx @@ -1,9 +1,9 @@ // #Regression #NoMT #Printing // Regression test for FSHARP1.0:3300 // Verify that Pretty-printing of measure identifiers round-trips, i.e. displays the long identified (Namespace.Module.Type) -//val it : decimal = -2\.0M -//val it : float32 = 2\.0f -//val it : float = 1\.2 +//val it : decimal+ +//val it : float32+ +//val it : float+ #light #r "UnitsOfMeasureIdentifiersRoundTrip02.dll" diff --git a/tests/fsharpqa/Source/Printing/UnitsOfMeasuresGenericSignature01.fsx b/tests/fsharpqa/Source/Printing/UnitsOfMeasuresGenericSignature01.fsx index 1366f40b82..e4a11a8861 100644 --- a/tests/fsharpqa/Source/Printing/UnitsOfMeasuresGenericSignature01.fsx +++ b/tests/fsharpqa/Source/Printing/UnitsOfMeasuresGenericSignature01.fsx @@ -3,6 +3,6 @@ // Make sure the generic type variable is echoed back // (notice that the next time we evaluate 'f' this // goes back to 'u) -//val f : x:float<'a> -> float<'a \^ 2> +//val f : x:float+ let f(x:float<'a>) = x*x;; exit 0;; diff --git a/tests/fsharpqa/Source/Printing/UnitsOfMeasuresGenericSignature02.fsx b/tests/fsharpqa/Source/Printing/UnitsOfMeasuresGenericSignature02.fsx index d57eda1d03..b71e606a9f 100644 --- a/tests/fsharpqa/Source/Printing/UnitsOfMeasuresGenericSignature02.fsx +++ b/tests/fsharpqa/Source/Printing/UnitsOfMeasuresGenericSignature02.fsx @@ -4,6 +4,6 @@ // (notice that the next time we evaluate 'f' this // goes back to 'u, 'v) // This is the case where the generic function takes 2 args -//val g : x:float<'a> -> y:float32<'b> -> float<'a> +//val g : x:float+ let g (x:float<'a>) (y:float32<'b>) = x * float y;; exit 0;; diff --git a/tests/fsharpqa/Source/Printing/VariantTypes01.fs b/tests/fsharpqa/Source/Printing/VariantTypes01.fs index 10ab2c0536..074e72da98 100644 --- a/tests/fsharpqa/Source/Printing/VariantTypes01.fs +++ b/tests/fsharpqa/Source/Printing/VariantTypes01.fs @@ -2,6 +2,6 @@ // Regression test for FSHARP1.0:1401 // incorrect pretty printing of variant types // The issue here was the missing parens around the nested Some ... -//val it : int option option = Some \(Some 1\) +//val it : int option option = Some \(Some 1\) Some(Some(1));; exit 0;; diff --git a/tests/fsharpqa/Source/Warnings/MemberHasMultiplePossibleDispatchSlots.fs b/tests/fsharpqa/Source/Warnings/MemberHasMultiplePossibleDispatchSlots.fs index d737c4ade3..ae6738208b 100644 --- a/tests/fsharpqa/Source/Warnings/MemberHasMultiplePossibleDispatchSlots.fs +++ b/tests/fsharpqa/Source/Warnings/MemberHasMultiplePossibleDispatchSlots.fs @@ -1,5 +1,5 @@ // #Warnings -//The member 'Bar +//The member 'Bar //Please restrict it to one of the following: //Bar : double -> int //Bar : int -> int diff --git a/tests/fsharpqa/Source/Warnings/WarnOnlyOnLastExpression.fs b/tests/fsharpqa/Source/Warnings/WarnOnlyOnLastExpression.fs index 6f2ef4d9c4..7b0b968c23 100644 --- a/tests/fsharpqa/Source/Warnings/WarnOnlyOnLastExpression.fs +++ b/tests/fsharpqa/Source/Warnings/WarnOnlyOnLastExpression.fs @@ -1,5 +1,5 @@ // #Warnings -// +//The result of this expression has type 'bool' and is implicitly ignored let mutable x = 0 while x < 1 do diff --git a/tests/fsharpqa/Source/XmlDoc/Basic/XMLDocOnEnum01.fs b/tests/fsharpqa/Source/XmlDoc/Basic/XMLDocOnEnum01.fs index 8761062c0f..793c9a1d63 100644 --- a/tests/fsharpqa/Source/XmlDoc/Basic/XMLDocOnEnum01.fs +++ b/tests/fsharpqa/Source/XmlDoc/Basic/XMLDocOnEnum01.fs @@ -1,6 +1,6 @@ // #XMLDoc // Regression test for Dev11:40070 -// +// /// Doc comment for Test. type Test = diff --git a/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc001.fs b/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc001.fs index 3e1ea349d4..6b916c9d63 100644 --- a/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc001.fs +++ b/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc001.fs @@ -1,7 +1,7 @@ // #XMLDoc // Regression test for FSHARP1.0:850 // Simple /// is xmldoc -// +// #light diff --git a/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc002.fs b/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc002.fs index 16cad97bb1..f41c9f3198 100644 --- a/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc002.fs +++ b/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc002.fs @@ -1,7 +1,7 @@ // #XMLDoc // Regression test for FSHARP1.0:850 // Verify that //// is not xmldoc -// +// #light diff --git a/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc003.fs b/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc003.fs index fd817a8010..a2930dea50 100644 --- a/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc003.fs +++ b/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc003.fs @@ -2,7 +2,7 @@ // This used to be regression test for FSHARP1.0:850 // Now, we simple verify that OCaml style xml-doc are gone (i.e. treated as regular comments) // Verify that //// is not xmldoc (after an ocaml-style xml-comment) -// +// #light diff --git a/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc004.fs b/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc004.fs index 1b90a21e47..15767fff55 100644 --- a/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc004.fs +++ b/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc004.fs @@ -1,6 +1,6 @@ // #Regression #XMLDoc // Verify that XmlDoc name is correctly generated -// +// #light diff --git a/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc005.fs b/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc005.fs index 4fa8dbecac..76977a7eec 100644 --- a/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc005.fs +++ b/tests/fsharpqa/Source/XmlDoc/Basic/xmlDoc005.fs @@ -1,6 +1,6 @@ // #Regression #XMLDoc // Verify that XmlDoc names are generated, but no empty members are generated re: issue #148 -// +// #light diff --git a/tests/fsharpqa/Source/XmlDoc/OCamlDoc/ocamldoc001.fs b/tests/fsharpqa/Source/XmlDoc/OCamlDoc/ocamldoc001.fs index 723484f1ba..f3338bfb75 100644 --- a/tests/fsharpqa/Source/XmlDoc/OCamlDoc/ocamldoc001.fs +++ b/tests/fsharpqa/Source/XmlDoc/OCamlDoc/ocamldoc001.fs @@ -3,7 +3,7 @@ // Now that the OCaml style XmlDoc is gone, (** ... *) should be just a normal comment. // We want to verify that no xml with a "summary" is generate. // See also FSHARP1.0:1654 -// +// #light diff --git a/tests/fsharpqa/Source/test.lst b/tests/fsharpqa/Source/test.lst index 67199ab113..f3d79d7a03 100644 --- a/tests/fsharpqa/Source/test.lst +++ b/tests/fsharpqa/Source/test.lst @@ -56,7 +56,7 @@ CompilerOptions01,NoMT,NoHostedCompiler CompilerOptions\fsc\staticlink CompilerOptions01,NoMT CompilerOptions\fsc\subsystemversion CompilerOptions01,NoMT CompilerOptions\fsc\tailcalls CompilerOptions01,NoMT CompilerOptions\fsc\target -CompilerOptions01,NoMT CompilerOptions\fsc\times +CompilerOptions01,NoMT,NoHostedCompiler CompilerOptions\fsc\times CompilerOptions01,NoMT CompilerOptions\fsc\warn CompilerOptions01,NoMT CompilerOptions\fsc\warnaserror CompilerOptions01,NoMT CompilerOptions\fsc\warnon From 4a695e798a05c8139c3cba89a7d971055bdd3160 Mon Sep 17 00:00:00 2001 From: Will Smith Date: Thu, 30 May 2019 17:42:23 -0700 Subject: [PATCH 066/159] Removed reference counting from IncrementalBuilder; now relies on GC. (#6863) * TcImports doesn't explicitly have to be disposed, relies on GC. Removed reference counting in incremental builder. Builders can only be invalidated by a type provider, not anything else. * Removing any notion of being incremental builder reference counting and being alive * Added ITypeProviderThread * Fixed declaration list item * Changed EnqueueWorkAndWait to just EnqueueWork that's not blocking * Minor cleanup * Forgot to check disposed * Quick update on comment * Update FCS project * Renamed ITypeProviderThread to ICompilationThread * Changes from feedback and added a test --- .../FSharp.Compiler.Service.fsproj | 14 +- src/fsharp/CompileOps.fs | 142 +++++++++++++----- src/fsharp/CompileOps.fsi | 12 ++ .../FSharp.Compiler.Private.fsproj | 12 +- src/fsharp/service/IncrementalBuild.fs | 97 +++--------- src/fsharp/service/IncrementalBuild.fsi | 22 +-- src/fsharp/service/ServiceDeclarationLists.fs | 17 +-- .../service/ServiceDeclarationLists.fsi | 2 +- src/fsharp/service/service.fs | 122 ++++----------- src/fsharp/service/service.fsi | 11 +- tests/service/MultiProjectAnalysisTests.fs | 5 - tests/service/ProjectAnalysisTests.fs | 21 ++- 12 files changed, 219 insertions(+), 258 deletions(-) diff --git a/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj b/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj index 134a3ca745..6b2d04cb62 100644 --- a/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj +++ b/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj @@ -1,4 +1,4 @@ - + @@ -543,18 +543,18 @@ Symbols/SymbolPatterns.fs - - Service/IncrementalBuild.fsi - - - Service/IncrementalBuild.fs - Service/Reactor.fsi Service/Reactor.fs + + Service/IncrementalBuild.fsi + + + Service/IncrementalBuild.fs + Service/ServiceConstants.fs diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs index d95bf2d070..491a753b9d 100644 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -1963,6 +1963,14 @@ type UnresolvedAssemblyReference = UnresolvedAssemblyReference of string * Assem type ResolvedExtensionReference = ResolvedExtensionReference of string * AssemblyReference list * Tainted list #endif +/// The thread in which compilation calls will be enqueued and done work on. +/// Note: This is currently only used when disposing of type providers and will be extended to all the other type provider calls when compilations can be done in parallel. +/// Right now all calls in FCS to type providers are single-threaded through use of the reactor thread. +type ICompilationThread = + + /// Enqueue work to be done on a compilation thread. + abstract EnqueueWork: (CompilationThreadToken -> unit) -> unit + type ImportedBinary = { FileName: string RawMetadata: IRawFSharpAssemblyData @@ -2115,6 +2123,7 @@ type TcConfigBuilder = /// show messages about extension type resolution? mutable showExtensionTypeMessages: bool #endif + mutable compilationThread: ICompilationThread /// pause between passes? mutable pause: bool @@ -2274,6 +2283,9 @@ type TcConfigBuilder = #if !NO_EXTENSIONTYPING showExtensionTypeMessages = false #endif + compilationThread = + let ctok = CompilationThreadToken () + { new ICompilationThread with member __.EnqueueWork work = work ctok } pause = false alwaysCallVirt = true noDebugData = false @@ -2746,8 +2758,9 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) = member x.showLoadedAssemblies = data.showLoadedAssemblies member x.continueAfterParseFailure = data.continueAfterParseFailure #if !NO_EXTENSIONTYPING - member x.showExtensionTypeMessages = data.showExtensionTypeMessages + member x.showExtensionTypeMessages = data.showExtensionTypeMessages #endif + member x.compilationThread = data.compilationThread member x.pause = data.pause member x.alwaysCallVirt = data.alwaysCallVirt member x.noDebugData = data.noDebugData @@ -3741,10 +3754,43 @@ type TcConfigProvider = // TcImports //-------------------------------------------------------------------------- - +#if !NO_EXTENSIONTYPING +// These are hacks in order to allow TcImports to be held as a weak reference inside a type provider. +// The reason is due to older type providers compiled using an older TypeProviderSDK, that SDK used reflection on fields and properties to determine the contract. +// The reflection code has now since been removed, see here: https://github.com/fsprojects/FSharp.TypeProviders.SDK/pull/305. But we still need to work on older type providers. +// One day we can remove these hacks when we deemed most if not all type providers were re-compiled using the newer TypeProviderSDK. +// Yuck. +type TcImportsDllInfoHack = + { + FileName: string + } + +and TcImportsWeakHack (tcImports: WeakReference) = + let mutable dllInfos: TcImportsDllInfoHack list = [] + + member __.SetDllInfos (value: ImportedBinary list) = + dllInfos <- value |> List.map (fun x -> { FileName = x.FileName }) + + member __.Base: TcImportsWeakHack option = + match tcImports.TryGetTarget() with + | true, strong -> + match strong.Base with + | Some (baseTcImports: TcImports) -> + Some baseTcImports.Weak + | _ -> + None + | _ -> + None + + member __.SystemRuntimeContainsType typeName = + match tcImports.TryGetTarget () with + | true, strong -> strong.SystemRuntimeContainsType typeName + | _ -> false +#endif /// Represents a table of imported assemblies with their resolutions. -[] -type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolutions, importsBase: TcImports option, ilGlobalsOpt) = +/// Is a disposable object, but it is recommended not to explicitly call Dispose unless you absolutely know nothing will be using its contents after the disposal. +/// Otherwise, simply allow the GC to collect this and it will properly call Dispose from the finalizer. +and [] TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolutions, importsBase: TcImports option, ilGlobalsOpt, compilationThread: ICompilationThread) as this = let mutable resolutions = initialResolutions let mutable importsBase: TcImports option = importsBase @@ -3757,12 +3803,30 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu let mutable ilGlobalsOpt = ilGlobalsOpt let mutable tcGlobals = None #if !NO_EXTENSIONTYPING + let mutable disposeTypeProviderActions = [] let mutable generatedTypeRoots = new System.Collections.Generic.Dictionary() + let mutable tcImportsWeak = TcImportsWeakHack (WeakReference<_> this) #endif let CheckDisposed() = if disposed then assert false + let dispose () = + CheckDisposed() + // disposing deliberately only closes this tcImports, not the ones up the chain + disposed <- true + if verbose then + dprintf "disposing of TcImports, %d binaries\n" disposeActions.Length +#if !NO_EXTENSIONTYPING + let actions = disposeTypeProviderActions + disposeTypeProviderActions <- [] + if actions.Length > 0 then + compilationThread.EnqueueWork (fun _ -> for action in actions do action()) +#endif + let actions = disposeActions + disposeActions <- [] + for action in actions do action() + static let ccuHasType (ccu: CcuThunk) (nsname: string list) (tname: string) = let matchNameSpace (entityOpt: Entity option) n = match entityOpt with @@ -3776,8 +3840,8 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu | Some _ -> true | None -> false | None -> false - - member private tcImports.Base = + + member internal tcImports.Base = CheckDisposed() importsBase @@ -3787,7 +3851,13 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu member tcImports.DllTable = CheckDisposed() - dllTable + dllTable + +#if !NO_EXTENSIONTYPING + member tcImports.Weak = + CheckDisposed() + tcImportsWeak +#endif member tcImports.RegisterCcu ccuInfo = CheckDisposed() @@ -3798,9 +3868,12 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu member tcImports.RegisterDll dllInfo = CheckDisposed() dllInfos <- dllInfos ++ dllInfo +#if !NO_EXTENSIONTYPING + tcImportsWeak.SetDllInfos dllInfos +#endif dllTable <- NameMap.add (getNameOfScopeRef dllInfo.ILScopeRef) dllInfo dllTable - member tcImports.GetDllInfos() = + member tcImports.GetDllInfos() : ImportedBinary list = CheckDisposed() match importsBase with | Some importsBase-> importsBase.GetDllInfos() @ dllInfos @@ -3967,9 +4040,15 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu |> Seq.toList #endif - member tcImports.AttachDisposeAction action = + member private tcImports.AttachDisposeAction action = CheckDisposed() disposeActions <- action :: disposeActions + +#if !NO_EXTENSIONTYPING + member private tcImports.AttachDisposeTypeProviderAction action = + CheckDisposed() + disposeTypeProviderActions <- action :: disposeTypeProviderActions +#endif // Note: the returned binary reader is associated with the tcImports, i.e. when the tcImports are closed // then the reader is closed. @@ -4119,7 +4198,7 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu | _ -> failwith "Unexpected representation in namespace entity referred to by a type provider" - member tcImports.ImportTypeProviderExtensions + member tcImportsStrong.ImportTypeProviderExtensions (ctok, tcConfig: TcConfig, fileNameOfRuntimeAssembly, ilScopeRefOfRuntimeAssembly, @@ -4153,7 +4232,7 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu { resolutionFolder = tcConfig.implicitIncludeDir outputFile = tcConfig.outputFile showResolutionMessages = tcConfig.showExtensionTypeMessages - referencedAssemblies = Array.distinct [| for r in tcImports.AllAssemblyResolutions() -> r.resolvedPath |] + referencedAssemblies = Array.distinct [| for r in tcImportsStrong.AllAssemblyResolutions() -> r.resolvedPath |] temporaryFolder = FileSystem.GetTempPathShim() } // The type provider should not hold strong references to disposed @@ -4161,9 +4240,10 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu // dispatch via a thunk which gets set to a non-resource-capturing // failing function when the object is disposed. let systemRuntimeContainsType = - // NOTE: do not touch this + // NOTE: do not touch this, edit: but we did, we had no choice - TPs cannot hold a strong reference on TcImports "ever". + let tcImports = tcImportsWeak let systemRuntimeContainsTypeRef = ref (fun typeName -> tcImports.SystemRuntimeContainsType typeName) - tcImports.AttachDisposeAction(fun () -> systemRuntimeContainsTypeRef := (fun _ -> raise (System.ObjectDisposedException("The type provider has been disposed")))) + tcImportsStrong.AttachDisposeTypeProviderAction(fun () -> systemRuntimeContainsTypeRef := (fun _ -> raise (System.ObjectDisposedException("The type provider has been disposed")))) fun arg -> systemRuntimeContainsTypeRef.Value arg let providers = @@ -4174,7 +4254,7 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu // Note, type providers are disposable objects. The TcImports owns the provider objects - when/if it is disposed, the providers are disposed. // We ignore all exceptions from provider disposal. for provider in providers do - tcImports.AttachDisposeAction(fun () -> + tcImportsStrong.AttachDisposeTypeProviderAction(fun () -> try provider.PUntaintNoFailure(fun x -> x).Dispose() with e -> @@ -4203,7 +4283,7 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu let handler = tp.Invalidate.Subscribe(fun _ -> capturedInvalidateCcu.Trigger (capturedMessage)) // When the TcImports is disposed we detach the invalidation callback - tcImports.AttachDisposeAction(fun () -> try handler.Dispose() with _ -> ())), m) + tcImportsStrong.AttachDisposeTypeProviderAction(fun () -> try handler.Dispose() with _ -> ())), m) match providers with | [] -> @@ -4222,7 +4302,7 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu // for that namespace. let rec loop (providedNamespace: Tainted) = let path = ExtensionTyping.GetProvidedNamespaceAsPath(m, provider, providedNamespace.PUntaint((fun r -> r.NamespaceName), m)) - tcImports.InjectProvidedNamespaceOrTypeIntoEntity (typeProviderEnvironment, tcConfig, m, entityToInjectInto, [], path, provider, None) + tcImportsStrong.InjectProvidedNamespaceOrTypeIntoEntity (typeProviderEnvironment, tcConfig, m, entityToInjectInto, [], path, provider, None) // Inject entities for the types returned by provider.GetTypes(). // @@ -4232,7 +4312,7 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu let tys = providedNamespace.PApplyArray((fun provider -> provider.GetTypes()), "GetTypes", m) let ptys = [| for ty in tys -> ty.PApply((fun ty -> ty |> ProvidedType.CreateNoContext), m) |] for st in ptys do - tcImports.InjectProvidedNamespaceOrTypeIntoEntity (typeProviderEnvironment, tcConfig, m, entityToInjectInto, [], path, provider, Some st) + tcImportsStrong.InjectProvidedNamespaceOrTypeIntoEntity (typeProviderEnvironment, tcConfig, m, entityToInjectInto, [], path, provider, Some st) for providedNestedNamespace in providedNamespace.PApplyArray((fun provider -> provider.GetNestedNamespaces()), "GetNestedNamespaces", m) do loop providedNestedNamespace @@ -4564,9 +4644,7 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu // Note: This returns a TcImports object. However, framework TcImports are not currently disposed. The only reason // we dispose TcImports is because we need to dispose type providers, and type providers are never included in the framework DLL set. - // - // If this ever changes then callers may need to begin disposing the TcImports (though remember, not before all derived - // non-framework TcImports built related to this framework TcImports are disposed). + // If a framework set ever includes type providers, you will not have to worry about explicitly calling Dispose as the Finalizer will handle it. static member BuildFrameworkTcImports (ctok, tcConfigP: TcConfigProvider, frameworkDLLs, nonFrameworkDLLs) = cancellable { @@ -4574,8 +4652,7 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu let tcResolutions = TcAssemblyResolutions.BuildFromPriorResolutions(ctok, tcConfig, frameworkDLLs, []) let tcAltResolutions = TcAssemblyResolutions.BuildFromPriorResolutions(ctok, tcConfig, nonFrameworkDLLs, []) - // Note: TcImports are disposable - the caller owns this object and must dispose - let frameworkTcImports = new TcImports(tcConfigP, tcResolutions, None, None) + let frameworkTcImports = new TcImports(tcConfigP, tcResolutions, None, None, tcConfig.compilationThread) // Fetch the primaryAssembly from the referenced assemblies otherwise let primaryAssemblyReference = @@ -4666,24 +4743,21 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu knownUnresolved |> List.map (function UnresolvedAssemblyReference(file, originalReferences) -> file, originalReferences) |> List.iter reportAssemblyNotResolved + + override tcImports.Finalize () = + dispose () - // Note: This returns a TcImports object. TcImports are disposable - the caller owns the returned TcImports object - // and when hosted in Visual Studio or another long-running process must dispose this object. static member BuildNonFrameworkTcImports (ctok, tcConfigP: TcConfigProvider, tcGlobals: TcGlobals, baseTcImports, nonFrameworkReferences, knownUnresolved) = cancellable { let tcConfig = tcConfigP.Get ctok let tcResolutions = TcAssemblyResolutions.BuildFromPriorResolutions(ctok, tcConfig, nonFrameworkReferences, knownUnresolved) let references = tcResolutions.GetAssemblyResolutions() - let tcImports = new TcImports(tcConfigP, tcResolutions, Some baseTcImports, Some tcGlobals.ilg) + let tcImports = new TcImports(tcConfigP, tcResolutions, Some baseTcImports, Some tcGlobals.ilg, tcConfig.compilationThread) let! _assemblies = tcImports.RegisterAndImportReferencedAssemblies(ctok, references) tcImports.ReportUnresolvedAssemblyReferences knownUnresolved return tcImports } - // Note: This returns a TcImports object. TcImports are disposable - the caller owns the returned TcImports object - // and if hosted in Visual Studio or another long-running process must dispose this object. However this - // function is currently only used from fsi.exe. If we move to a long-running hosted evaluation service API then - // we should start disposing these objects. static member BuildTcImports(ctok, tcConfigP: TcConfigProvider) = cancellable { let tcConfig = tcConfigP.Get ctok @@ -4696,14 +4770,8 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu interface System.IDisposable with member tcImports.Dispose() = - CheckDisposed() - // disposing deliberately only closes this tcImports, not the ones up the chain - disposed <- true - if verbose then - dprintf "disposing of TcImports, %d binaries\n" disposeActions.Length - let actions = disposeActions - disposeActions <- [] - for action in actions do action() + dispose () + GC.SuppressFinalize tcImports override tcImports.ToString() = "TcImports(...)" diff --git a/src/fsharp/CompileOps.fsi b/src/fsharp/CompileOps.fsi index 3d08610670..71bb7c6f8b 100644 --- a/src/fsharp/CompileOps.fsi +++ b/src/fsharp/CompileOps.fsi @@ -209,6 +209,14 @@ type UnresolvedAssemblyReference = UnresolvedAssemblyReference of string * Assem type ResolvedExtensionReference = ResolvedExtensionReference of string * AssemblyReference list * Tainted list #endif +/// The thread in which compilation calls will be enqueued and done work on. +/// Note: This is currently only used when disposing of type providers and will be extended to all the other type provider calls when compilations can be done in parallel. +/// Right now all calls in FCS to type providers are single-threaded through use of the reactor thread. +type ICompilationThread = + + /// Enqueue work to be done on a compilation thread. + abstract EnqueueWork: (CompilationThreadToken -> unit) -> unit + [] type CompilerTarget = | WinExe @@ -351,6 +359,7 @@ type TcConfigBuilder = #if !NO_EXTENSIONTYPING mutable showExtensionTypeMessages: bool #endif + mutable compilationThread: ICompilationThread mutable pause: bool mutable alwaysCallVirt: bool mutable noDebugData: bool @@ -510,6 +519,7 @@ type TcConfig = #if !NO_EXTENSIONTYPING member showExtensionTypeMessages: bool #endif + member compilationThread: ICompilationThread member pause: bool member alwaysCallVirt: bool member noDebugData: bool @@ -591,6 +601,8 @@ type TcAssemblyResolutions = static member BuildFromPriorResolutions : CompilationThreadToken * TcConfig * AssemblyResolution list * UnresolvedAssemblyReference list -> TcAssemblyResolutions /// Represents a table of imported assemblies with their resolutions. +/// Is a disposable object, but it is recommended not to explicitly call Dispose unless you absolutely know nothing will be using its contents after the disposal. +/// Otherwise, simply allow the GC to collect this and it will properly call Dispose from the finalizer. [] type TcImports = interface System.IDisposable diff --git a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj index ebef5fb040..3b3d38409f 100644 --- a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj +++ b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj @@ -560,6 +560,12 @@ Symbols/SymbolPatterns.fs + + Service/Reactor.fsi + + + Service/Reactor.fs + @@ -568,12 +574,6 @@ Service/IncrementalBuild.fs - - Service/Reactor.fsi - - - Service/Reactor.fs - Service/ServiceConstants.fs diff --git a/src/fsharp/service/IncrementalBuild.fs b/src/fsharp/service/IncrementalBuild.fs index 24769360ae..4099b59c80 100755 --- a/src/fsharp/service/IncrementalBuild.fs +++ b/src/fsharp/service/IncrementalBuild.fs @@ -1211,11 +1211,14 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput keepAssemblyContents, keepAllBackgroundResolutions, maxTimeShareMilliseconds) = let tcConfigP = TcConfigProvider.Constant tcConfig - let importsInvalidated = new Event() let fileParsed = new Event() let beforeFileChecked = new Event() let fileChecked = new Event() let projectChecked = new Event() +#if !NO_EXTENSIONTYPING + let importsInvalidatedByTypeProvider = new Event() +#endif + let mutable currentTcImportsOpt = None // Check for the existence of loaded sources and prepend them to the sources list if present. let sourceFiles = tcConfig.GetAvailableLoadedSources() @ (sourceFiles |>List.map (fun s -> rangeStartup, s)) @@ -1242,27 +1245,6 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput for (_, f, _) in sourceFiles do yield f |] - // The IncrementalBuilder needs to hold up to one item that needs to be disposed, which is the tcImports for the incremental - // build. - let mutable cleanupItem = None: TcImports option - let disposeCleanupItem() = - match cleanupItem with - | None -> () - | Some item -> - cleanupItem <- None - dispose item - - let setCleanupItem x = - assert cleanupItem.IsNone - cleanupItem <- Some x - - let mutable disposed = false - let assertNotDisposed() = - if disposed then - System.Diagnostics.Debug.Assert(false, "IncrementalBuild object has already been disposed!") - - let mutable referenceCount = 0 - //---------------------------------------------------- // START OF BUILD TASK FUNCTIONS @@ -1270,14 +1252,12 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput /// /// Get the timestamp of the given file name. let StampFileNameTask (cache: TimeStampCache) _ctok (_m: range, filename: string, _isLastCompiland) = - assertNotDisposed() cache.GetFileTimeStamp filename /// This is a build task function that gets placed into the build rules as the computation for a VectorMap /// /// Parse the given file and return the given input. let ParseTask ctok (sourceRange: range, filename: string, isLastCompiland) = - assertNotDisposed() DoesNotRequireCompilerThreadTokenAndCouldPossiblyBeMadeConcurrent ctok let errorLogger = CompilationErrorLogger("ParseTask", tcConfig.errorSeverityOptions) @@ -1300,7 +1280,6 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput /// /// Timestamps of referenced assemblies are taken from the file's timestamp. let StampReferencedAssemblyTask (cache: TimeStampCache) ctok (_ref, timeStamper) = - assertNotDisposed() timeStamper cache ctok @@ -1309,7 +1288,6 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput // Link all the assemblies together and produce the input typecheck accumulator let CombineImportedAssembliesTask ctok _ : Cancellable = cancellable { - assertNotDisposed() let errorLogger = CompilationErrorLogger("CombineImportedAssembliesTask", tcConfig.errorSeverityOptions) // Return the disposable object that cleans up use _holder = new CompilationGlobalsScope(errorLogger, BuildPhase.Parameter) @@ -1317,10 +1295,6 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput let! tcImports = cancellable { try - // We dispose any previous tcImports, for the case where a dependency changed which caused this part - // of the partial build to be re-evaluated. - disposeCleanupItem() - let! tcImports = TcImports.BuildNonFrameworkTcImports(ctok, tcConfigP, tcGlobals, frameworkTcImports, nonFrameworkResolutions, unresolvedReferences) #if !NO_EXTENSIONTYPING tcImports.GetCcusExcludingBase() |> Seq.iter (fun ccu -> @@ -1338,19 +1312,13 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput // // In the invalidation handler we use a weak reference to allow the IncrementalBuilder to // be collected if, for some reason, a TP instance is not disposed or not GC'd. - let capturedImportsInvalidated = WeakReference<_>(importsInvalidated) + let capturedImportsInvalidated = WeakReference<_>(importsInvalidatedByTypeProvider) ccu.Deref.InvalidateEvent.Add(fun msg -> match capturedImportsInvalidated.TryGetTarget() with | true, tg -> tg.Trigger msg - | _ -> ())) + | _ -> ())) #endif - - - // The tcImports must be cleaned up if this builder ever gets disposed. We also dispose any previous - // tcImports should we be re-creating an entry because a dependency changed which caused this part - // of the partial build to be re-evaluated. - setCleanupItem tcImports - + currentTcImportsOpt <- Some tcImports return tcImports with e -> System.Diagnostics.Debug.Assert(false, sprintf "Could not BuildAllReferencedDllTcImports %A" e) @@ -1390,7 +1358,6 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput /// /// Type check all files. let TypeCheckTask ctok (tcAcc: TypeCheckAccumulator) input: Eventually = - assertNotDisposed() match input with | Some input, _sourceRange, filename, parseErrors-> IncrementalBuilderEventTesting.MRU.Add(IncrementalBuilderEventTesting.IBETypechecked filename) @@ -1462,7 +1429,6 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput /// Finish up the typechecking to produce outputs for the rest of the compilation process let FinalizeTypeCheckTask ctok (tcStates: TypeCheckAccumulator[]) = cancellable { - assertNotDisposed() DoesNotRequireCompilerThreadTokenAndCouldPossiblyBeMadeConcurrent ctok let errorLogger = CompilationErrorLogger("CombineImportedAssembliesTask", tcConfig.errorSeverityOptions) @@ -1581,21 +1547,7 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput partialBuild <- b let MaxTimeStampInDependencies cache (ctok: CompilationThreadToken) (output: INode) = - IncrementalBuild.MaxTimeStampInDependencies cache ctok output.Name partialBuild - - member this.IncrementUsageCount() = - assertNotDisposed() - System.Threading.Interlocked.Increment(&referenceCount) |> ignore - { new System.IDisposable with member __.Dispose() = this.DecrementUsageCount() } - - member __.DecrementUsageCount() = - assertNotDisposed() - let currentValue = System.Threading.Interlocked.Decrement(&referenceCount) - if currentValue = 0 then - disposed <- true - disposeCleanupItem() - - member __.IsAlive = referenceCount > 0 + IncrementalBuild.MaxTimeStampInDependencies cache ctok output.Name partialBuild member __.TcConfig = tcConfig @@ -1607,21 +1559,14 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput member __.ProjectChecked = projectChecked.Publish - member __.ImportedCcusInvalidated = importsInvalidated.Publish - - member __.AllDependenciesDeprecated = allDependencies - #if !NO_EXTENSIONTYPING - member __.ThereAreLiveTypeProviders = - let liveTPs = - match cleanupItem with - | None -> [] - | Some tcImports -> [for ia in tcImports.GetImportedAssemblies() do yield! ia.TypeProviders] - match liveTPs with - | [] -> false - | _ -> true + member __.ImportsInvalidatedByTypeProvider = importsInvalidatedByTypeProvider.Publish #endif + member __.TryGetCurrentTcImports () = currentTcImportsOpt + + member __.AllDependenciesDeprecated = allDependencies + member __.Step (ctok: CompilationThreadToken) = cancellable { let cache = TimeStampCache defaultTimeStamp // One per step @@ -1808,6 +1753,14 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput // Never open PDB files for the language service, even if --standalone is specified tcConfigB.openDebugInformationForLaterStaticLinking <- false + tcConfigB.compilationThread <- + { new ICompilationThread with + member __.EnqueueWork work = + Reactor.Singleton.EnqueueOp ("Unknown", "ICompilationThread.EnqueueWork", "work", fun ctok -> + work ctok + ) + } + tcConfigB, sourceFilesNew match loadClosureOpt with @@ -1887,11 +1840,3 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput return builderOpt, diagnostics } - - static member KeepBuilderAlive (builderOpt: IncrementalBuilder option) = - match builderOpt with - | Some builder -> builder.IncrementUsageCount() - | None -> { new System.IDisposable with member __.Dispose() = () } - - member __.IsBeingKeptAliveApartFromCacheEntry = (referenceCount >= 2) - diff --git a/src/fsharp/service/IncrementalBuild.fsi b/src/fsharp/service/IncrementalBuild.fsi index 89d143ca98..96d0063688 100755 --- a/src/fsharp/service/IncrementalBuild.fsi +++ b/src/fsharp/service/IncrementalBuild.fsi @@ -80,9 +80,6 @@ type internal PartialCheckResults = [] type internal IncrementalBuilder = - /// Check if the builder is not disposed - member IsAlive : bool - /// The TcConfig passed in to the builder creation. member TcConfig : TcConfig @@ -104,15 +101,17 @@ type internal IncrementalBuilder = /// overall analysis results for the project will be quick. member ProjectChecked : IEvent +#if !NO_EXTENSIONTYPING /// Raised when a type provider invalidates the build. - member ImportedCcusInvalidated : IEvent + member ImportsInvalidatedByTypeProvider : IEvent +#endif + + /// Tries to get the current successful TcImports. This is only used in testing. Do not use it for other stuff. + member TryGetCurrentTcImports : unit -> TcImports option /// The list of files the build depends on member AllDependenciesDeprecated : string[] -#if !NO_EXTENSIONTYPING - /// Whether there are any 'live' type providers that may need a refresh when a project is Cleaned - member ThereAreLiveTypeProviders : bool -#endif + /// Perform one step in the F# build. Return true if the background work is finished. member Step : CompilationThreadToken -> Cancellable @@ -164,13 +163,6 @@ type internal IncrementalBuilder = 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 * suggestNamesForErrors: bool -> 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 - /// decrement the usage count and dispose if the usage count goes to zero - static member KeepBuilderAlive : IncrementalBuilder option -> IDisposable - - member IsBeingKeptAliveApartFromCacheEntry : bool - /// Generalized Incremental Builder. This is exposed only for unittesting purposes. module internal IncrementalBuild = type INode = diff --git a/src/fsharp/service/ServiceDeclarationLists.fs b/src/fsharp/service/ServiceDeclarationLists.fs index f06fc56ca2..c4bf83bf08 100644 --- a/src/fsharp/service/ServiceDeclarationLists.fs +++ b/src/fsharp/service/ServiceDeclarationLists.fs @@ -492,19 +492,12 @@ type FSharpDeclarationListItem(name: string, nameInCode: string, fullName: strin member __.StructuredDescriptionTextAsync = let userOpName = "ToolTip" match info with - | Choice1Of2 (items: CompletionItem list, infoReader, m, denv, reactor:IReactorOperations, checkAlive) -> + | Choice1Of2 (items: CompletionItem list, infoReader, m, denv, reactor:IReactorOperations) -> // reactor causes the lambda to execute on the background compiler thread, through the Reactor reactor.EnqueueAndAwaitOpAsync (userOpName, "StructuredDescriptionTextAsync", name, fun ctok -> RequireCompilationThread ctok - // This is where we do some work which may touch TAST data structures owned by the IncrementalBuilder - infoReader, item etc. - // It is written to be robust to a disposal of an IncrementalBuilder, in which case it will just return the empty string. - // It is best to think of this as a "weak reference" to the IncrementalBuilder, i.e. this code is written to be robust to its - // disposal. Yes, you are right to scratch your head here, but this is ok. - cancellable.Return( - if checkAlive() then - FSharpToolTipText(items |> List.map (fun x -> SymbolHelpers.FormatStructuredDescriptionOfItem true infoReader m denv x.ItemWithInst)) - else - FSharpToolTipText [ FSharpStructuredToolTipElement.Single(wordL (tagText (FSComp.SR.descriptionUnavailable())), FSharpXmlDoc.None) ])) + cancellable.Return(FSharpToolTipText(items |> List.map (fun x -> SymbolHelpers.FormatStructuredDescriptionOfItem true infoReader m denv x.ItemWithInst))) + ) | Choice2Of2 result -> async.Return result @@ -559,7 +552,7 @@ type FSharpDeclarationListInfo(declarations: FSharpDeclarationListItem[], isForT member __.IsError = isError // Make a 'Declarations' object for a set of selected items - static member Create(infoReader:InfoReader, m, denv, getAccessibility, items: CompletionItem list, reactor, currentNamespaceOrModule: string[] option, isAttributeApplicationContext: bool, checkAlive) = + static member Create(infoReader:InfoReader, m: range, denv, getAccessibility, items: CompletionItem list, reactor, currentNamespaceOrModule: string[] option, isAttributeApplicationContext: bool) = let g = infoReader.g let isForType = items |> List.exists (fun x -> x.Type.IsSome) let items = items |> SymbolHelpers.RemoveExplicitlySuppressedCompletionItems g @@ -697,7 +690,7 @@ type FSharpDeclarationListInfo(declarations: FSharpDeclarationListItem[], isForT | ns -> Some (System.String.Join(".", ns))) FSharpDeclarationListItem( - name, nameInCode, fullName, glyph, Choice1Of2 (items, infoReader, m, denv, reactor, checkAlive), getAccessibility item.Item, + name, nameInCode, fullName, glyph, Choice1Of2 (items, infoReader, m, denv, reactor), getAccessibility item.Item, item.Kind, item.IsOwnMember, item.MinorPriority, item.Unresolved.IsNone, namespaceToOpen)) new FSharpDeclarationListInfo(Array.ofList decls, isForType, false) diff --git a/src/fsharp/service/ServiceDeclarationLists.fsi b/src/fsharp/service/ServiceDeclarationLists.fsi index 4dc7905251..ae8171bfb0 100644 --- a/src/fsharp/service/ServiceDeclarationLists.fsi +++ b/src/fsharp/service/ServiceDeclarationLists.fsi @@ -67,7 +67,7 @@ type public FSharpDeclarationListInfo = member IsError : bool // Implementation details used by other code in the compiler - static member internal Create : infoReader:InfoReader * m:range * denv:DisplayEnv * getAccessibility:(Item -> FSharpAccessibility option) * items:CompletionItem list * reactor:IReactorOperations * currentNamespace:string[] option * isAttributeApplicationContex:bool * checkAlive:(unit -> bool) -> FSharpDeclarationListInfo + static member internal Create : infoReader:InfoReader * m:range * denv:DisplayEnv * getAccessibility:(Item -> FSharpAccessibility option) * items:CompletionItem list * reactor:IReactorOperations * currentNamespace:string[] option * isAttributeApplicationContex:bool -> FSharpDeclarationListInfo static member internal Error : message:string -> FSharpDeclarationListInfo diff --git a/src/fsharp/service/service.fs b/src/fsharp/service/service.fs index 3ca4f8a248..a63fdccee8 100644 --- a/src/fsharp/service/service.fs +++ b/src/fsharp/service/service.fs @@ -161,7 +161,6 @@ type TypeCheckInfo sFallback: NameResolutionEnv, loadClosure : LoadClosure option, reactorOps : IReactorOperations, - checkAlive : (unit -> bool), textSnapshotInfo:obj option, implFileOpt: TypedImplFile option, openDeclarations: OpenDeclaration[]) = @@ -937,7 +936,7 @@ type TypeCheckInfo |> Option.bind (fun x -> x.ParseTree) |> Option.map (fun parsedInput -> UntypedParseImpl.GetFullNameOfSmallestModuleOrNamespaceAtPoint(parsedInput, mkPos line 0)) let isAttributeApplication = ctx = Some CompletionContext.AttributeApplication - FSharpDeclarationListInfo.Create(infoReader,m,denv,getAccessibility,items,reactorOps,currentNamespaceOrModule,isAttributeApplication,checkAlive)) + FSharpDeclarationListInfo.Create(infoReader,m,denv,getAccessibility,items,reactorOps,currentNamespaceOrModule,isAttributeApplication)) (fun msg -> Trace.TraceInformation(sprintf "FCS: recovering from error in GetDeclarations: '%s'" msg) FSharpDeclarationListInfo.Error msg) @@ -1616,8 +1615,6 @@ module internal Parser = // These are the errors and warnings seen by the background compiler for the entire antecedent backgroundDiagnostics: (PhasedDiagnostic * FSharpErrorSeverity)[], reactorOps: IReactorOperations, - // Used by 'FSharpDeclarationListInfo' to check the IncrementalBuilder is still alive. - checkAlive : (unit -> bool), textSnapshotInfo : obj option, userOpName: string, suggestNamesForErrors: bool) = @@ -1761,7 +1758,6 @@ module internal Parser = tcEnvAtEnd.NameEnv, loadClosure, reactorOps, - checkAlive, textSnapshotInfo, List.tryHead implFiles, sink.GetOpenDeclarations()) @@ -1935,48 +1931,18 @@ type FSharpCheckProjectResults(projectFileName:string, tcConfigOption, keepAssem override info.ToString() = "FSharpCheckProjectResults(" + projectFileName + ")" [] -/// A live object of this type keeps the background corresponding background builder (and type providers) alive (through reference-counting). -// -// There is an important property of all the objects returned by the methods of this type: they do not require -// the corresponding background builder to be alive. That is, they are simply plain-old-data through pre-formatting of all result text. type FSharpCheckFileResults(filename: string, errors: FSharpErrorInfo[], scopeOptX: TypeCheckInfo option, dependencyFiles: string[], builderX: IncrementalBuilder option, reactorOpsX:IReactorOperations, keepAssemblyContents: bool) = - // This may be None initially, or may be set to None when the object is disposed or finalized + // This may be None initially. let mutable details = match scopeOptX with None -> None | Some scopeX -> Some (scopeX, builderX, reactorOpsX) - // Increment the usage count on the IncrementalBuilder. We want to keep the IncrementalBuilder and all associated - // resources and type providers alive for the duration of the lifetime of this object. - let decrementer = - match details with - | Some (_,builderOpt,_) -> IncrementalBuilder.KeepBuilderAlive builderOpt - | _ -> { new System.IDisposable with member x.Dispose() = () } - - let mutable disposed = false - - let dispose() = - if not disposed then - disposed <- true - match details with - | Some (_,_,reactor) -> - // Make sure we run disposal in the reactor thread, since it may trigger type provider disposals etc. - details <- None - reactor.EnqueueOp ("GCFinalizer","FSharpCheckFileResults.DecrementUsageCountOnIncrementalBuilder", filename, fun ctok -> - RequireCompilationThread ctok - decrementer.Dispose()) - | _ -> () - // Run an operation that needs to access a builder and be run in the reactor thread let reactorOp userOpName opName dflt f = async { match details with | None -> return dflt - | Some (_, Some builder, _) when not builder.IsAlive -> - System.Diagnostics.Debug.Assert(false,"unexpected dead builder") - return dflt - | Some (scope, builderOpt, reactor) -> - // Increment the usage count to ensure the builder doesn't get released while running operations asynchronously. - use _unwind = IncrementalBuilder.KeepBuilderAlive builderOpt + | Some (scope, _, reactor) -> let! res = reactor.EnqueueAndAwaitOpAsync(userOpName, opName, filename, fun ctok -> f ctok scope |> cancellable.Return) return res } @@ -1987,13 +1953,14 @@ type FSharpCheckFileResults(filename: string, errors: FSharpErrorInfo[], scopeOp | None -> dflt() | Some (scope, _builderOpt, _ops) -> f scope - // At the moment we only dispose on finalize - we never explicitly dispose these objects. Explicitly disposing is not - // really worth much since the underlying project builds are likely to still be in the incrementalBuilder cache. - override info.Finalize() = dispose() - member info.Errors = errors member info.HasFullTypeCheckInfo = details.IsSome + + member info.TryGetCurrentTcImports () = + match builderX with + | Some builder -> builder.TryGetCurrentTcImports () + | _ -> None /// Intellisense autocompletions member info.GetDeclarationListInfo(parseResultsOpt, line, lineStr, partialName, ?getAllEntities, ?hasTextChangedSinceLastTypecheck, ?userOpName: string) = @@ -2388,17 +2355,16 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC options.UseScriptResolutionRules, keepAssemblyContents, keepAllBackgroundResolutions, maxTimeShareMilliseconds, tryGetMetadataSnapshot, suggestNamesForErrors) - // We're putting the builder in the cache, so increment its count. - let decrement = IncrementalBuilder.KeepBuilderAlive builderOpt - match builderOpt with | None -> () | Some builder -> +#if !NO_EXTENSIONTYPING // Register the behaviour that responds to CCUs being invalidated because of type // provider Invalidate events. This invalidates the configuration in the build. - builder.ImportedCcusInvalidated.Add (fun _ -> + builder.ImportsInvalidatedByTypeProvider.Add (fun _ -> self.InvalidateConfiguration(options, None, userOpName)) +#endif // Register the callback called just before a file is typechecked by the background builder (without recording // errors or intellisense information). @@ -2410,7 +2376,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC builder.FileChecked.Add (fun file -> fileChecked.Trigger(file, options.ExtraProjectInfo)) builder.ProjectChecked.Add (fun () -> projectChecked.Trigger (options.ProjectFileName, options.ExtraProjectInfo)) - return (builderOpt, diagnostics, decrement) + return (builderOpt, diagnostics) } // STATIC ROOT: FSharpLanguageServiceTestable.FSharpChecker.backgroundCompiler.incrementalBuildersCache. This root typically holds more @@ -2419,27 +2385,23 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC // /// Cache of builds keyed by options. let incrementalBuildersCache = - MruCache + MruCache (keepStrongly=projectCacheSize, keepMax=projectCacheSize, areSame = FSharpProjectOptions.AreSameForChecking, - areSimilar = FSharpProjectOptions.UseSameProject, - requiredToKeep=(fun (builderOpt,_,_) -> match builderOpt with None -> false | Some (b:IncrementalBuilder) -> b.IsBeingKeptAliveApartFromCacheEntry), - onDiscard = (fun (_, _, decrement:IDisposable) -> decrement.Dispose())) + areSimilar = FSharpProjectOptions.UseSameProject) - let getOrCreateBuilderAndKeepAlive (ctok, options, userOpName) = + let getOrCreateBuilder (ctok, options, userOpName) = cancellable { RequireCompilationThread ctok match incrementalBuildersCache.TryGet (ctok, options) with - | Some (builderOpt,creationErrors,_) -> + | Some (builderOpt,creationErrors) -> Logger.Log LogCompilerFunctionId.Service_IncrementalBuildersCache_GettingCache - let decrement = IncrementalBuilder.KeepBuilderAlive builderOpt - return builderOpt,creationErrors, decrement + return builderOpt,creationErrors | None -> Logger.Log LogCompilerFunctionId.Service_IncrementalBuildersCache_BuildingNewCache - let! (builderOpt,creationErrors,_) as info = CreateOneIncrementalBuilder (ctok, options, userOpName) + let! (builderOpt,creationErrors) as info = CreateOneIncrementalBuilder (ctok, options, userOpName) incrementalBuildersCache.Set (ctok, options, info) - let decrement = IncrementalBuilder.KeepBuilderAlive builderOpt - return builderOpt, creationErrors, decrement + return builderOpt, creationErrors } let parseCacheLock = Lock() @@ -2530,8 +2492,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC member bc.GetBackgroundParseResultsForFileInProject(filename, options, userOpName) = reactor.EnqueueAndAwaitOpAsync(userOpName, "GetBackgroundParseResultsForFileInProject ", filename, fun ctok -> cancellable { - let! builderOpt, creationErrors, decrement = getOrCreateBuilderAndKeepAlive (ctok, options, userOpName) - use _unwind = decrement + let! builderOpt, creationErrors = getOrCreateBuilder (ctok, options, userOpName) match builderOpt with | None -> return FSharpParseFileResults(creationErrors, None, true, [| |]) | Some builder -> @@ -2600,7 +2561,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC let loadClosure = scriptClosureCacheLock.AcquireLock (fun ltok -> scriptClosureCache.TryGet (ltok, options)) let! tcErrors, tcFileResult = Parser.CheckOneFile(parseResults, sourceText, fileName, options.ProjectFileName, tcPrior.TcConfig, tcPrior.TcGlobals, tcPrior.TcImports, - tcPrior.TcState, tcPrior.ModuleNamesDict, loadClosure, tcPrior.TcErrors, reactorOps, (fun () -> builder.IsAlive), textSnapshotInfo, userOpName, suggestNamesForErrors) + tcPrior.TcState, tcPrior.ModuleNamesDict, loadClosure, tcPrior.TcErrors, reactorOps, textSnapshotInfo, userOpName, suggestNamesForErrors) 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, sourceText.GetHashCode()) @@ -2629,11 +2590,10 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC let! cachedResults = execWithReactorAsync <| fun ctok -> cancellable { - let! _builderOpt,_creationErrors,decrement = getOrCreateBuilderAndKeepAlive (ctok, options, userOpName) - use _unwind = decrement + let! _builderOpt,_creationErrors = getOrCreateBuilder (ctok, options, userOpName) match incrementalBuildersCache.TryGetAny (ctok, options) with - | Some (Some builder, creationErrors, _) -> + | Some (Some builder, creationErrors) -> match bc.GetCachedCheckFileResult(builder, filename, sourceText, options) with | Some (_, checkResults) -> return Some (builder, creationErrors, Some (FSharpCheckFileAnswer.Succeeded checkResults)) | _ -> return Some (builder, creationErrors, None) @@ -2668,8 +2628,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC try if implicitlyStartBackgroundWork then reactor.CancelBackgroundOp() // cancel the background work, since we will start new work after we're done - let! builderOpt,creationErrors, decrement = execWithReactorAsync (fun ctok -> getOrCreateBuilderAndKeepAlive (ctok, options, userOpName)) - use _unwind = decrement + let! builderOpt,creationErrors = execWithReactorAsync (fun ctok -> getOrCreateBuilder (ctok, options, userOpName)) match builderOpt with | None -> return FSharpCheckFileAnswer.Succeeded (MakeCheckFileResultsEmpty(filename, creationErrors)) | Some builder -> @@ -2699,8 +2658,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC Logger.LogMessage (filename + strGuid + "-Cancelling background work") LogCompilerFunctionId.Service_ParseAndCheckFileInProject reactor.CancelBackgroundOp() // cancel the background work, since we will start new work after we're done - let! builderOpt,creationErrors,decrement = execWithReactorAsync (fun ctok -> getOrCreateBuilderAndKeepAlive (ctok, options, userOpName)) - use _unwind = decrement + let! builderOpt,creationErrors = execWithReactorAsync (fun ctok -> getOrCreateBuilder (ctok, options, userOpName)) match builderOpt with | None -> Logger.LogBlockMessageStop (filename + strGuid + "-Failed_Aborted") LogCompilerFunctionId.Service_ParseAndCheckFileInProject @@ -2738,8 +2696,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC member bc.GetBackgroundCheckResultsForFileInProject(filename, options, userOpName) = reactor.EnqueueAndAwaitOpAsync(userOpName, "GetBackgroundCheckResultsForFileInProject", filename, fun ctok -> cancellable { - let! builderOpt, creationErrors, decrement = getOrCreateBuilderAndKeepAlive (ctok, options, userOpName) - use _unwind = decrement + let! builderOpt, creationErrors = getOrCreateBuilder (ctok, options, userOpName) match builderOpt with | None -> let parseResults = FSharpParseFileResults(creationErrors, None, true, [| |]) @@ -2761,7 +2718,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC List.head tcProj.TcResolutionsRev, List.head tcProj.TcSymbolUsesRev, tcProj.TcEnvAtEnd.NameEnv, - loadClosure, reactorOps, (fun () -> builder.IsAlive), None, + loadClosure, reactorOps, None, tcProj.LatestImplementationFile, List.head tcProj.TcOpenDeclarationsRev) let typedResults = MakeCheckFileResults(filename, options, builder, scope, Array.ofList tcProj.TcDependencyFiles, creationErrors, parseResults.Errors, tcErrors) @@ -2782,8 +2739,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC /// Parse and typecheck the whole project (the implementation, called recursively as project graph is evaluated) member private bc.ParseAndCheckProjectImpl(options, ctok, userOpName) : Cancellable = cancellable { - let! builderOpt,creationErrors,decrement = getOrCreateBuilderAndKeepAlive (ctok, options, userOpName) - use _unwind = decrement + let! builderOpt,creationErrors = getOrCreateBuilder (ctok, options, userOpName) match builderOpt with | None -> return FSharpCheckProjectResults (options.ProjectFileName, None, keepAssemblyContents, creationErrors, None) @@ -2803,20 +2759,11 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC // NOTE: This creation of the background builder is currently run as uncancellable. Creating background builders is generally // cheap though the timestamp computations look suspicious for transitive project references. - let builderOpt,_creationErrors,decrement = getOrCreateBuilderAndKeepAlive (ctok, options, userOpName + ".TryGetLogicalTimeStampForProject") |> Cancellable.runWithoutCancellation - use _unwind = decrement + let builderOpt,_creationErrors = getOrCreateBuilder (ctok, options, userOpName + ".TryGetLogicalTimeStampForProject") |> Cancellable.runWithoutCancellation match builderOpt with | None -> None | Some builder -> Some (builder.GetLogicalTimeStampForProject(cache, ctok)) - /// Keep the projet builder alive over a scope - member bc.KeepProjectAlive(options, userOpName) = - reactor.EnqueueAndAwaitOpAsync(userOpName, "KeepProjectAlive", options.ProjectFileName, fun ctok -> - cancellable { - let! _builderOpt,_creationErrors,decrement = getOrCreateBuilderAndKeepAlive (ctok, options, userOpName) - return decrement - }) - /// Parse and typecheck the whole project. member bc.ParseAndCheckProject(options, userOpName) = reactor.EnqueueAndAwaitOpAsync(userOpName, "ParseAndCheckProject", options.ProjectFileName, fun ctok -> bc.ParseAndCheckProjectImpl(options, ctok, userOpName)) @@ -2912,10 +2859,9 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC member bc.CheckProjectInBackground (options, userOpName) = reactor.SetBackgroundOp (Some (userOpName, "CheckProjectInBackground", options.ProjectFileName, (fun ctok ct -> // The creation of the background builder can't currently be cancelled - match getOrCreateBuilderAndKeepAlive (ctok, options, userOpName) |> Cancellable.run ct with + match getOrCreateBuilder (ctok, options, userOpName) |> Cancellable.run ct with | ValueOrCancelled.Cancelled _ -> false - | ValueOrCancelled.Value (builderOpt,_,decrement) -> - use _unwind = decrement + | ValueOrCancelled.Value (builderOpt,_) -> match builderOpt with | None -> false | Some builder -> @@ -3205,10 +3151,6 @@ type FSharpChecker(legacyReferenceResolver, projectCacheSize, keepAssemblyConten ic.CheckMaxMemoryReached() backgroundCompiler.ParseAndCheckProject(options, userOpName) - member ic.KeepProjectAlive(options, ?userOpName: string) = - let userOpName = defaultArg userOpName "Unknown" - backgroundCompiler.KeepProjectAlive(options, userOpName) - /// For a given script file, get the ProjectOptions implied by the #load closure member ic.GetProjectOptionsFromScript(filename, source, ?loadedTimeStamp, ?otherFlags, ?useFsiAuxLib, ?useSdkRefs, ?assumeDotNetFramework, ?extraProjectInfo: obj, ?optionsStamp: int64, ?userOpName: string) = let userOpName = defaultArg userOpName "Unknown" @@ -3325,7 +3267,7 @@ type FsiInteractiveChecker(legacyReferenceResolver, reactorOps: IReactorOperatio CompileOptions.ParseCompilerOptions (ignore, fsiCompilerOptions, [ ]) let loadClosure = LoadClosure.ComputeClosureOfScriptText(ctok, legacyReferenceResolver, defaultFSharpBinariesDir, filename, sourceText, CodeContext.Editing, tcConfig.useSimpleResolution, tcConfig.useFsiAuxLib, tcConfig.useSdkRefs, new Lexhelp.LexResourceManager(), applyCompilerOptions, assumeDotNetFramework, tryGetMetadataSnapshot=(fun _ -> None), reduceMemoryUsage=reduceMemoryUsage) - let! tcErrors, tcFileResult = Parser.CheckOneFile(parseResults, sourceText, filename, "project", tcConfig, tcGlobals, tcImports, tcState, Map.empty, Some loadClosure, backgroundDiagnostics, reactorOps, (fun () -> true), None, userOpName, suggestNamesForErrors) + let! tcErrors, tcFileResult = Parser.CheckOneFile(parseResults, sourceText, filename, "project", tcConfig, tcGlobals, tcImports, tcState, Map.empty, Some loadClosure, backgroundDiagnostics, reactorOps, None, userOpName, suggestNamesForErrors) return match tcFileResult with diff --git a/src/fsharp/service/service.fsi b/src/fsharp/service/service.fsi index a17abb46a3..ea27c142c1 100755 --- a/src/fsharp/service/service.fsi +++ b/src/fsharp/service/service.fsi @@ -98,6 +98,9 @@ type public FSharpCheckFileResults = /// an unrecoverable error in earlier checking/parsing/resolution steps. member HasFullTypeCheckInfo: bool + /// Tries to get the current successful TcImports. This is only used in testing. Do not use it for other stuff. + member internal TryGetCurrentTcImports: unit -> TcImports option + /// Indicates the set of files which must be watched to accurately track changes that affect these results, /// Clients interested in reacting to updates to these files should watch these files and take actions as described /// in the documentation for compiler service. @@ -504,14 +507,6 @@ type public FSharpChecker = /// An optional string used for tracing compiler operations associated with this request. member ParseAndCheckProject : options: FSharpProjectOptions * ?userOpName: string -> Async - /// - /// Create resources for the project and keep the project alive until the returned object is disposed. - /// - /// - /// The options for the project or script. - /// An optional string used for tracing compiler operations associated with this request. - member KeepProjectAlive : options: FSharpProjectOptions * ?userOpName: string -> Async - /// /// For a given script file, get the FSharpProjectOptions implied by the #load closure. /// All files are read from the FileSystem API, except the file being checked. diff --git a/tests/service/MultiProjectAnalysisTests.fs b/tests/service/MultiProjectAnalysisTests.fs index 4560825653..04ba820da0 100644 --- a/tests/service/MultiProjectAnalysisTests.fs +++ b/tests/service/MultiProjectAnalysisTests.fs @@ -348,11 +348,6 @@ let ``Test ManyProjectsStressTest cache too small`` () = let checker = ManyProjectsStressTest.makeCheckerForStressTest false - // Because the cache is too small, we need explicit calls to KeepAlive to avoid disposal of project information - let disposals = - [ for p in ManyProjectsStressTest.jointProject :: ManyProjectsStressTest.projects do - yield checker.KeepProjectAlive p.Options |> Async.RunSynchronously ] - let wholeProjectResults = checker.ParseAndCheckProject(ManyProjectsStressTest.jointProject.Options) |> Async.RunSynchronously [ for x in wholeProjectResults.AssemblySignature.Entities -> x.DisplayName ] |> shouldEqual ["JointProject"] diff --git a/tests/service/ProjectAnalysisTests.fs b/tests/service/ProjectAnalysisTests.fs index 9dca0cd56f..16ef433e69 100644 --- a/tests/service/ProjectAnalysisTests.fs +++ b/tests/service/ProjectAnalysisTests.fs @@ -96,7 +96,6 @@ let mmmm2 : M.CAbbrev = new M.CAbbrev() // note, these don't count as uses of C [] let ``Test project1 whole project errors`` () = - let wholeProjectResults = checker.ParseAndCheckProject(Project1.options) |> Async.RunSynchronously wholeProjectResults .Errors.Length |> shouldEqual 2 wholeProjectResults.Errors.[1].Message.Contains("Incomplete pattern matches on this expression") |> shouldEqual true // yes it does @@ -107,6 +106,26 @@ let ``Test project1 whole project errors`` () = wholeProjectResults.Errors.[0].StartColumn |> shouldEqual 43 wholeProjectResults.Errors.[0].EndColumn |> shouldEqual 44 +[] +let ``Test project1 and make sure TcImports gets cleaned up`` () = + + let test () = + let (_, checkFileAnswer) = checker.ParseAndCheckFileInProject(Project1.fileName1, 0, Project1.fileSource1, Project1.options) |> Async.RunSynchronously + match checkFileAnswer with + | FSharpCheckFileAnswer.Aborted -> failwith "should not be aborted" + | FSharpCheckFileAnswer.Succeeded checkFileResults -> + let tcImportsOpt = checkFileResults.TryGetCurrentTcImports () + Assert.True tcImportsOpt.IsSome + let weakTcImports = WeakReference tcImportsOpt.Value + Assert.True weakTcImports.IsAlive + weakTcImports + + let weakTcImports = test () + checker.InvalidateConfiguration (Project1.options) + checker.ClearLanguageServiceRootCachesAndCollectAndFinalizeAllTransients() + GC.Collect(2, GCCollectionMode.Forced, blocking = true) + Assert.False weakTcImports.IsAlive + [] let ``Test Project1 should have protected FullName and TryFullName return same results`` () = let wholeProjectResults = checker.ParseAndCheckProject(Project1.options) |> Async.RunSynchronously From 8e467c11ad69357d6b975524b9c98a8efee7732a Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Fri, 31 May 2019 00:08:50 -0700 Subject: [PATCH 067/159] Remove call to internal API in Simplify Name Analyzer (#6901) * Remove call to internal API in Simplify Name Analyzer * Remove unused opens --- .../Diagnostics/SimplifyNameDiagnosticAnalyzer.fs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs b/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs index 53556c97e7..97235c0f1e 100644 --- a/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs +++ b/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs @@ -7,13 +7,11 @@ open System.Collections.Immutable open System.Diagnostics open System.Threading open System.Threading.Tasks -open System.Runtime.CompilerServices open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Diagnostics open FSharp.Compiler open FSharp.Compiler.Range -open FSharp.Compiler.SourceCodeServices open System.Runtime.Caching open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics @@ -94,7 +92,7 @@ type internal SimplifyNameDiagnosticAnalyzer() = match rest with | [] -> return current | headIdent :: restPlid -> - let! res = checkResults.IsRelativeNameResolvable(posAtStartOfName, current, symbolUse.Symbol.Item, userOpName=userOpName) + let! res = checkResults.IsRelativeNameResolvableFromSymbol(posAtStartOfName, current, symbolUse.Symbol, userOpName=userOpName) if res then return current else return! loop restPlid (headIdent :: current) } From be0a37411f19280c6453fb0c78e87cb358e30f13 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Fri, 31 May 2019 00:46:34 -0700 Subject: [PATCH 068/159] add framework for LSP support (#6907) --- .gitignore | 1 + FSharp.sln | 30 ++++++++ VisualFSharp.sln | 30 ++++++++ eng/Build.ps1 | 2 + eng/Versions.props | 1 + eng/build.sh | 1 + .../Directory.Build.props | 9 +++ .../FSharp.Compiler.LanguageServer.fsproj | 31 ++++++++ .../LspTypes.fs | 72 +++++++++++++++++++ .../FSharp.Compiler.LanguageServer/Methods.fs | 22 ++++++ .../FSharp.Compiler.LanguageServer/Program.fs | 16 +++++ .../FSharp.Compiler.LanguageServer/Server.fs | 25 +++++++ .../FSharp.Compiler.LanguageServer/State.fs | 12 ++++ .../TextDocument.fs | 33 +++++++++ .../FSharp.Compiler.Private.fsproj | 1 + .../Directory.Build.props | 9 +++ ...p.Compiler.LanguageServer.UnitTests.fsproj | 25 +++++++ .../ProtocolTests.fs | 40 +++++++++++ 18 files changed, 360 insertions(+) create mode 100644 src/fsharp/FSharp.Compiler.LanguageServer/Directory.Build.props create mode 100644 src/fsharp/FSharp.Compiler.LanguageServer/FSharp.Compiler.LanguageServer.fsproj create mode 100644 src/fsharp/FSharp.Compiler.LanguageServer/LspTypes.fs create mode 100644 src/fsharp/FSharp.Compiler.LanguageServer/Methods.fs create mode 100644 src/fsharp/FSharp.Compiler.LanguageServer/Program.fs create mode 100644 src/fsharp/FSharp.Compiler.LanguageServer/Server.fs create mode 100644 src/fsharp/FSharp.Compiler.LanguageServer/State.fs create mode 100644 src/fsharp/FSharp.Compiler.LanguageServer/TextDocument.fs create mode 100644 tests/FSharp.Compiler.LanguageServer.UnitTests/Directory.Build.props create mode 100644 tests/FSharp.Compiler.LanguageServer.UnitTests/FSharp.Compiler.LanguageServer.UnitTests.fsproj create mode 100644 tests/FSharp.Compiler.LanguageServer.UnitTests/ProtocolTests.fs diff --git a/.gitignore b/.gitignore index cbf6773ddd..e6feea6dfc 100644 --- a/.gitignore +++ b/.gitignore @@ -95,6 +95,7 @@ extras ossreadme*.txt *.csproj.user *.fsproj.user +*.vbproj.user *.sln.DotSettings.user *.log *.jrs diff --git a/FSharp.sln b/FSharp.sln index 8d4feaef71..c34abdba39 100644 --- a/FSharp.sln +++ b/FSharp.sln @@ -38,6 +38,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Packages", "Packages", "{38 EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.FSharp.Compiler", "src\fsharp\FSharp.Compiler.nuget\Microsoft.FSharp.Compiler.csproj", "{81B9FE26-C976-4FC7-B6CC-C7DB5903CAA7}" EndProject +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.LanguageServer", "src\fsharp\FSharp.Compiler.LanguageServer\FSharp.Compiler.LanguageServer.fsproj", "{99B3F4A5-80B4-41D9-A073-117DB6D7DBBA}" +EndProject +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.LanguageServer.UnitTests", "tests\FSharp.Compiler.LanguageServer.UnitTests\FSharp.Compiler.LanguageServer.UnitTests.fsproj", "{C97819B0-B428-4B96-9CD7-497D2D1C738C}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -180,6 +184,30 @@ Global {81B9FE26-C976-4FC7-B6CC-C7DB5903CAA7}.Release|Any CPU.Build.0 = Release|Any CPU {81B9FE26-C976-4FC7-B6CC-C7DB5903CAA7}.Release|x86.ActiveCfg = Release|Any CPU {81B9FE26-C976-4FC7-B6CC-C7DB5903CAA7}.Release|x86.Build.0 = Release|Any CPU + {99B3F4A5-80B4-41D9-A073-117DB6D7DBBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {99B3F4A5-80B4-41D9-A073-117DB6D7DBBA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {99B3F4A5-80B4-41D9-A073-117DB6D7DBBA}.Debug|x86.ActiveCfg = Debug|Any CPU + {99B3F4A5-80B4-41D9-A073-117DB6D7DBBA}.Debug|x86.Build.0 = Debug|Any CPU + {99B3F4A5-80B4-41D9-A073-117DB6D7DBBA}.Proto|Any CPU.ActiveCfg = Debug|Any CPU + {99B3F4A5-80B4-41D9-A073-117DB6D7DBBA}.Proto|Any CPU.Build.0 = Debug|Any CPU + {99B3F4A5-80B4-41D9-A073-117DB6D7DBBA}.Proto|x86.ActiveCfg = Debug|Any CPU + {99B3F4A5-80B4-41D9-A073-117DB6D7DBBA}.Proto|x86.Build.0 = Debug|Any CPU + {99B3F4A5-80B4-41D9-A073-117DB6D7DBBA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {99B3F4A5-80B4-41D9-A073-117DB6D7DBBA}.Release|Any CPU.Build.0 = Release|Any CPU + {99B3F4A5-80B4-41D9-A073-117DB6D7DBBA}.Release|x86.ActiveCfg = Release|Any CPU + {99B3F4A5-80B4-41D9-A073-117DB6D7DBBA}.Release|x86.Build.0 = Release|Any CPU + {C97819B0-B428-4B96-9CD7-497D2D1C738C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C97819B0-B428-4B96-9CD7-497D2D1C738C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C97819B0-B428-4B96-9CD7-497D2D1C738C}.Debug|x86.ActiveCfg = Debug|Any CPU + {C97819B0-B428-4B96-9CD7-497D2D1C738C}.Debug|x86.Build.0 = Debug|Any CPU + {C97819B0-B428-4B96-9CD7-497D2D1C738C}.Proto|Any CPU.ActiveCfg = Debug|Any CPU + {C97819B0-B428-4B96-9CD7-497D2D1C738C}.Proto|Any CPU.Build.0 = Debug|Any CPU + {C97819B0-B428-4B96-9CD7-497D2D1C738C}.Proto|x86.ActiveCfg = Debug|Any CPU + {C97819B0-B428-4B96-9CD7-497D2D1C738C}.Proto|x86.Build.0 = Debug|Any CPU + {C97819B0-B428-4B96-9CD7-497D2D1C738C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C97819B0-B428-4B96-9CD7-497D2D1C738C}.Release|Any CPU.Build.0 = Release|Any CPU + {C97819B0-B428-4B96-9CD7-497D2D1C738C}.Release|x86.ActiveCfg = Release|Any CPU + {C97819B0-B428-4B96-9CD7-497D2D1C738C}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -196,6 +224,8 @@ Global {88E2D422-6852-46E3-A740-83E391DC7973} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} {53C0DAAD-158C-4658-8EC7-D7341530239F} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} {81B9FE26-C976-4FC7-B6CC-C7DB5903CAA7} = {3840F2E7-3898-45F7-8CF7-1E6829E56DB8} + {99B3F4A5-80B4-41D9-A073-117DB6D7DBBA} = {B8DDA694-7939-42E3-95E5-265C2217C142} + {C97819B0-B428-4B96-9CD7-497D2D1C738C} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {BD5177C7-1380-40E7-94D2-7768E1A8B1B8} diff --git a/VisualFSharp.sln b/VisualFSharp.sln index 41d5424b81..3df52bb473 100644 --- a/VisualFSharp.sln +++ b/VisualFSharp.sln @@ -154,6 +154,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TutorialProject", "vsintegr EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FSharp.Core.nuget", "src\fsharp\FSharp.Core.nuget\FSharp.Core.nuget.csproj", "{8EC30B2E-F1F9-4A98-BBB5-DD0CF6C84DDC}" EndProject +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.LanguageServer", "src\fsharp\FSharp.Compiler.LanguageServer\FSharp.Compiler.LanguageServer.fsproj", "{60BAFFA5-6631-4328-B044-2E012AB76DCA}" +EndProject +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.LanguageServer.UnitTests", "tests\FSharp.Compiler.LanguageServer.UnitTests\FSharp.Compiler.LanguageServer.UnitTests.fsproj", "{AAF2D233-1C38-4090-8FFA-F7C545625E06}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -884,6 +888,30 @@ Global {8EC30B2E-F1F9-4A98-BBB5-DD0CF6C84DDC}.Release|Any CPU.Build.0 = Release|Any CPU {8EC30B2E-F1F9-4A98-BBB5-DD0CF6C84DDC}.Release|x86.ActiveCfg = Release|Any CPU {8EC30B2E-F1F9-4A98-BBB5-DD0CF6C84DDC}.Release|x86.Build.0 = Release|Any CPU + {60BAFFA5-6631-4328-B044-2E012AB76DCA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {60BAFFA5-6631-4328-B044-2E012AB76DCA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {60BAFFA5-6631-4328-B044-2E012AB76DCA}.Debug|x86.ActiveCfg = Debug|Any CPU + {60BAFFA5-6631-4328-B044-2E012AB76DCA}.Debug|x86.Build.0 = Debug|Any CPU + {60BAFFA5-6631-4328-B044-2E012AB76DCA}.Proto|Any CPU.ActiveCfg = Debug|Any CPU + {60BAFFA5-6631-4328-B044-2E012AB76DCA}.Proto|Any CPU.Build.0 = Debug|Any CPU + {60BAFFA5-6631-4328-B044-2E012AB76DCA}.Proto|x86.ActiveCfg = Debug|Any CPU + {60BAFFA5-6631-4328-B044-2E012AB76DCA}.Proto|x86.Build.0 = Debug|Any CPU + {60BAFFA5-6631-4328-B044-2E012AB76DCA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {60BAFFA5-6631-4328-B044-2E012AB76DCA}.Release|Any CPU.Build.0 = Release|Any CPU + {60BAFFA5-6631-4328-B044-2E012AB76DCA}.Release|x86.ActiveCfg = Release|Any CPU + {60BAFFA5-6631-4328-B044-2E012AB76DCA}.Release|x86.Build.0 = Release|Any CPU + {AAF2D233-1C38-4090-8FFA-F7C545625E06}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AAF2D233-1C38-4090-8FFA-F7C545625E06}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AAF2D233-1C38-4090-8FFA-F7C545625E06}.Debug|x86.ActiveCfg = Debug|Any CPU + {AAF2D233-1C38-4090-8FFA-F7C545625E06}.Debug|x86.Build.0 = Debug|Any CPU + {AAF2D233-1C38-4090-8FFA-F7C545625E06}.Proto|Any CPU.ActiveCfg = Debug|Any CPU + {AAF2D233-1C38-4090-8FFA-F7C545625E06}.Proto|Any CPU.Build.0 = Debug|Any CPU + {AAF2D233-1C38-4090-8FFA-F7C545625E06}.Proto|x86.ActiveCfg = Debug|Any CPU + {AAF2D233-1C38-4090-8FFA-F7C545625E06}.Proto|x86.Build.0 = Debug|Any CPU + {AAF2D233-1C38-4090-8FFA-F7C545625E06}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AAF2D233-1C38-4090-8FFA-F7C545625E06}.Release|Any CPU.Build.0 = Release|Any CPU + {AAF2D233-1C38-4090-8FFA-F7C545625E06}.Release|x86.ActiveCfg = Release|Any CPU + {AAF2D233-1C38-4090-8FFA-F7C545625E06}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -956,6 +984,8 @@ Global {C32806E0-71C2-40E4-AEC4-517F73F6A18A} = {BED74F9E-A0D2-48E2-9EE7-449832100487} {7B345E51-F2C0-4D4B-B0E0-05432EC9D5E1} = {BED74F9E-A0D2-48E2-9EE7-449832100487} {8EC30B2E-F1F9-4A98-BBB5-DD0CF6C84DDC} = {647810D0-5307-448F-99A2-E83917010DAE} + {60BAFFA5-6631-4328-B044-2E012AB76DCA} = {B8DDA694-7939-42E3-95E5-265C2217C142} + {AAF2D233-1C38-4090-8FFA-F7C545625E06} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {48EDBBBE-C8EE-4E3C-8B19-97184A487B37} diff --git a/eng/Build.ps1 b/eng/Build.ps1 index 2c88012b37..a296764692 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -270,6 +270,7 @@ try { if ($testDesktop) { TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $desktopTargetFramework + TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.LanguageServer.UnitTests\FSharp.Compiler.LanguageServer.UnitTests.fsproj" -targetFramework $desktopTargetFramework TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" -targetFramework $desktopTargetFramework TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $desktopTargetFramework TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $desktopTargetFramework @@ -277,6 +278,7 @@ try { if ($testCoreClr) { TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $coreclrTargetFramework + TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.LanguageServer.UnitTests\FSharp.Compiler.LanguageServer.UnitTests.fsproj" -targetFramework $coreclrTargetFramework TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" -targetFramework $coreclrTargetFramework TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $coreclrTargetFramework TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $coreclrTargetFramework diff --git a/eng/Versions.props b/eng/Versions.props index ee246da3bd..d288bf98a9 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -175,5 +175,6 @@ 2.1.36 1.0.0-beta2-dev3 5.22.2.1 + 2.0.187 \ No newline at end of file diff --git a/eng/build.sh b/eng/build.sh index 23b00ef66a..8ce74bfa52 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -245,6 +245,7 @@ BuildSolution if [[ "$test_core_clr" == true ]]; then coreclrtestframework=netcoreapp2.1 TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj" --targetframework $coreclrtestframework + TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.LanguageServer.UnitTests/FSharp.Compiler.LanguageServer.UnitTests.fsproj" --targetframework $coreclrtestframework TestUsingNUnit --testproject "$repo_root/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj" --targetframework $coreclrtestframework TestUsingNUnit --testproject "$repo_root/tests/FSharp.Core.UnitTests/FSharp.Core.UnitTests.fsproj" --targetframework $coreclrtestframework fi diff --git a/src/fsharp/FSharp.Compiler.LanguageServer/Directory.Build.props b/src/fsharp/FSharp.Compiler.LanguageServer/Directory.Build.props new file mode 100644 index 0000000000..7cd41381b5 --- /dev/null +++ b/src/fsharp/FSharp.Compiler.LanguageServer/Directory.Build.props @@ -0,0 +1,9 @@ + + + + true + + + + + diff --git a/src/fsharp/FSharp.Compiler.LanguageServer/FSharp.Compiler.LanguageServer.fsproj b/src/fsharp/FSharp.Compiler.LanguageServer/FSharp.Compiler.LanguageServer.fsproj new file mode 100644 index 0000000000..1e0ca2f912 --- /dev/null +++ b/src/fsharp/FSharp.Compiler.LanguageServer/FSharp.Compiler.LanguageServer.fsproj @@ -0,0 +1,31 @@ + + + + + Exe + .exe + net472;netcoreapp2.1 + netcoreapp2.1 + true + Implements the Language Server Protocol (LSP) for F#. + + + + + + + + + + + + + + + + + + + + + diff --git a/src/fsharp/FSharp.Compiler.LanguageServer/LspTypes.fs b/src/fsharp/FSharp.Compiler.LanguageServer/LspTypes.fs new file mode 100644 index 0000000000..7a919bc74d --- /dev/null +++ b/src/fsharp/FSharp.Compiler.LanguageServer/LspTypes.fs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.LanguageServer + +// Interfaces as defined at https://microsoft.github.io/language-server-protocol/specification. The properties on these +// types are camlCased to match the underlying JSON properties to avoid attributes on every field: +// [] + +/// Represents a zero-based line and column of a text document. +type Position = + { line: int + character: int } + +type Range = + { start: Position + ``end``: Position } + +type DocumentUri = string + +type Location = + { uri: DocumentUri + range: Range } + +type DiagnosticRelatedInformation = + { location: Location + message: string } + +type Diagnostic = + { range: Range + severity: int + code: string + source: string // "F#" + message: string + relatedInformation: DiagnosticRelatedInformation[] } + static member Error = 1 + static member Warning = 2 + static member Information = 3 + static member Hint = 4 + +type PublishDiagnosticsParams = + { uri: DocumentUri + diagnostics: Diagnostic[] } + +type InitializeParams = string // TODO: + +// Note, this type has many more optional values that can be expanded as support is added. +type ServerCapabilities = + { hoverProvider: bool } + static member DefaultCapabilities() = + { ServerCapabilities.hoverProvider = true } + +type InitializeResult = + { capabilities: ServerCapabilities } + +type MarkupKind = + | PlainText + | Markdown + +type MarkupContent = + { kind: MarkupKind + value: string } + +type Hover = + { contents: MarkupContent + range: Range option } + +type TextDocumentIdentifier = + { uri: DocumentUri } + +type TextDocumentPositionParams = + { textDocument: TextDocumentIdentifier + position: Position } diff --git a/src/fsharp/FSharp.Compiler.LanguageServer/Methods.fs b/src/fsharp/FSharp.Compiler.LanguageServer/Methods.fs new file mode 100644 index 0000000000..80e06e9781 --- /dev/null +++ b/src/fsharp/FSharp.Compiler.LanguageServer/Methods.fs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.LanguageServer + +open StreamJsonRpc + +// https://microsoft.github.io/language-server-protocol/specification +type Methods(state: State) = + + [] + member __.Initialize (args: InitializeParams) = + async { + // note, it's important that this method is `async` because unit tests can then properly verify that the + // JSON RPC handling of async methods is correct + return ServerCapabilities.DefaultCapabilities() + } |> Async.StartAsTask + + [] + member __.Shutdown() = state.DoShutdown() + + [] + member __.TextDocumentHover (args: TextDocumentPositionParams) = TextDocument.Hover(state, args) |> Async.StartAsTask diff --git a/src/fsharp/FSharp.Compiler.LanguageServer/Program.fs b/src/fsharp/FSharp.Compiler.LanguageServer/Program.fs new file mode 100644 index 0000000000..13d0c9709f --- /dev/null +++ b/src/fsharp/FSharp.Compiler.LanguageServer/Program.fs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.LanguageServer + +open System + +module Program = + + [] + let main(args: string[]) = + async { + let server = new Server(Console.OpenStandardOutput(), Console.OpenStandardInput()) + server.StartListening() + do! server.WaitForExitAsync() + return 0 + } |> Async.RunSynchronously diff --git a/src/fsharp/FSharp.Compiler.LanguageServer/Server.fs b/src/fsharp/FSharp.Compiler.LanguageServer/Server.fs new file mode 100644 index 0000000000..87f6d1c2ff --- /dev/null +++ b/src/fsharp/FSharp.Compiler.LanguageServer/Server.fs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.LanguageServer + +open System +open System.IO +open StreamJsonRpc + +type Server(sendingStream: Stream, receivingStream: Stream) = + + let state = State() + let methods = Methods(state) + let rpc = new JsonRpc(sendingStream, receivingStream, methods) + + member __.StartListening() = + rpc.StartListening() + + member __.WaitForExitAsync() = + async { + do! Async.AwaitEvent (state.Shutdown) + } + + interface IDisposable with + member __.Dispose() = + rpc.Dispose() diff --git a/src/fsharp/FSharp.Compiler.LanguageServer/State.fs b/src/fsharp/FSharp.Compiler.LanguageServer/State.fs new file mode 100644 index 0000000000..53cacbb8c0 --- /dev/null +++ b/src/fsharp/FSharp.Compiler.LanguageServer/State.fs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.LanguageServer + +type State() = + + let shutdownEvent = new Event<_>() + + [] + member __.Shutdown = shutdownEvent.Publish + + member __.DoShutdown() = shutdownEvent.Trigger() diff --git a/src/fsharp/FSharp.Compiler.LanguageServer/TextDocument.fs b/src/fsharp/FSharp.Compiler.LanguageServer/TextDocument.fs new file mode 100644 index 0000000000..eef57581c5 --- /dev/null +++ b/src/fsharp/FSharp.Compiler.LanguageServer/TextDocument.fs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.LanguageServer + +module TextDocument = + + let Hover(state: State, args: TextDocumentPositionParams) = + async { + return { + Hover.contents = { + MarkupContent.kind = MarkupKind.PlainText + value = "TODO" + } + range = Some({ + Range.start = { + Position.line = 0 + character = 0 + } + ``end`` = { + Position.line = 0 + character = 0 + } + }) + } + } + + let PublishDiagnostics(state: State) = + async { + return { + PublishDiagnosticsParams.uri = "" + diagnostics = [||] + } + } diff --git a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj index 3b3d38409f..e8831bc932 100644 --- a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj +++ b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj @@ -49,6 +49,7 @@ + diff --git a/tests/FSharp.Compiler.LanguageServer.UnitTests/Directory.Build.props b/tests/FSharp.Compiler.LanguageServer.UnitTests/Directory.Build.props new file mode 100644 index 0000000000..7cd41381b5 --- /dev/null +++ b/tests/FSharp.Compiler.LanguageServer.UnitTests/Directory.Build.props @@ -0,0 +1,9 @@ + + + + true + + + + + diff --git a/tests/FSharp.Compiler.LanguageServer.UnitTests/FSharp.Compiler.LanguageServer.UnitTests.fsproj b/tests/FSharp.Compiler.LanguageServer.UnitTests/FSharp.Compiler.LanguageServer.UnitTests.fsproj new file mode 100644 index 0000000000..a5e8bdf326 --- /dev/null +++ b/tests/FSharp.Compiler.LanguageServer.UnitTests/FSharp.Compiler.LanguageServer.UnitTests.fsproj @@ -0,0 +1,25 @@ + + + + + net472;netcoreapp2.1 + netcoreapp2.1 + Library + true + nunit + + + + + + + + + + + + + + + + diff --git a/tests/FSharp.Compiler.LanguageServer.UnitTests/ProtocolTests.fs b/tests/FSharp.Compiler.LanguageServer.UnitTests/ProtocolTests.fs new file mode 100644 index 0000000000..75c6e15cee --- /dev/null +++ b/tests/FSharp.Compiler.LanguageServer.UnitTests/ProtocolTests.fs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.LanguageServer.UnitTests + +open System.Diagnostics +open System.Threading.Tasks +open FSharp.Compiler.LanguageServer +open NUnit.Framework +open StreamJsonRpc + +[] +type ProtocolTests() = + +#if !NETCOREAPP + // The `netcoreapp2.1` version of `FSharp.Compiler.LanguageServer.exe` can't be run without a `publish` step so + // we're artificially restricting this test to the full framework. + [] +#endif + member __.``Server consuming stdin and stdout``() = + async { + // start server as a console app + let serverAssemblyPath = typeof.Assembly.Location + let startInfo = ProcessStartInfo(serverAssemblyPath) + startInfo.UseShellExecute <- false + startInfo.RedirectStandardInput <- true + startInfo.RedirectStandardOutput <- true + let proc = Process.Start(startInfo) + + // create a fake client + let client = new JsonRpc(proc.StandardInput.BaseStream, proc.StandardOutput.BaseStream) + client.StartListening() + + // initialize + let! capabilitites = client.InvokeAsync("initialize", "") |> Async.AwaitTask + Assert.True(capabilitites.hoverProvider) + + // shutdown the server + do! client.NotifyAsync("shutdown") |> Async.AwaitTask + if not (proc.WaitForExit(5000)) then failwith "Expected server process to exit." + } |> Async.StartAsTask :> Task From 00cbd3f82a73f86fec123d78d4b0b3f998f1c4d6 Mon Sep 17 00:00:00 2001 From: Will Smith Date: Fri, 31 May 2019 00:47:00 -0700 Subject: [PATCH 069/159] Fixed uninitialized mutable locals inside loops (#6899) * Fixed uninitialized mutable locals inside loops * Update ForInDoMutableRegressionTest.fs --- src/fsharp/IlxGen.fs | 17 ++++- .../ForInDoMutableRegressionTest.fs | 73 +++++++++++++++++++ tests/fsharp/FSharpSuite.Tests.fsproj | 1 + 3 files changed, 88 insertions(+), 3 deletions(-) create mode 100644 tests/fsharp/Compiler/Regressions/ForInDoMutableRegressionTest.fs diff --git a/src/fsharp/IlxGen.fs b/src/fsharp/IlxGen.fs index c188b54807..826045231a 100644 --- a/src/fsharp/IlxGen.fs +++ b/src/fsharp/IlxGen.fs @@ -826,8 +826,15 @@ and IlxGenEnv = /// Are we under the scope of a try, catch or finally? If so we can't tailcall. SEH = structured exception handling withinSEH: bool + + /// Are we inside of a recursive let binding, while loop, or a for loop? + isInLoop: bool } +let SetIsInLoop isInLoop eenv = + if eenv.isInLoop = isInLoop then eenv + else { eenv with isInLoop = isInLoop } + let ReplaceTyenv tyenv (eenv: IlxGenEnv) = {eenv with tyenv = tyenv } let EnvForTypars tps eenv = {eenv with tyenv = TypeReprEnv.ForTypars tps } @@ -3369,6 +3376,7 @@ and GenTryFinally cenv cgbuf eenv (bodyExpr, handlerExpr, m, resty, spTry, spFin //-------------------------------------------------------------------------- and GenForLoop cenv cgbuf eenv (spFor, v, e1, dir, e2, loopBody, m) sequel = + let eenv = SetIsInLoop true eenv let g = cenv.g // The JIT/NGen eliminate array-bounds checks for C# loops of form: @@ -3459,6 +3467,7 @@ and GenForLoop cenv cgbuf eenv (spFor, v, e1, dir, e2, loopBody, m) sequel = //-------------------------------------------------------------------------- and GenWhileLoop cenv cgbuf eenv (spWhile, e1, e2, m) sequel = + let eenv = SetIsInLoop true eenv let finish = CG.GenerateDelayMark cgbuf "while_finish" let startTest = CG.GenerateMark cgbuf "startTest" @@ -5083,6 +5092,7 @@ and GenLetRecFixup cenv cgbuf eenv (ilxCloSpec: IlxClosureSpec, e, ilField: ILFi /// Generate letrec bindings and GenLetRecBindings cenv (cgbuf: CodeGenBuffer) eenv (allBinds: Bindings, m) = + let eenv = SetIsInLoop true eenv // Fix up recursion for non-toplevel recursive bindings let bindsPossiblyRequiringFixup = allBinds |> List.filter (fun b -> @@ -5324,8 +5334,8 @@ and GenBindingAfterSequencePoint cenv cgbuf eenv sp (TBind(vspec, rhsExpr, _)) s | _ -> let storage = StorageForVal cenv.g m vspec eenv match storage, rhsExpr with - // locals are zero-init, no need to initialize them - | Local (_, realloc, _), Expr.Const (Const.Zero, _, _) when not realloc -> + // locals are zero-init, no need to initialize them, except if you are in a loop and the local is mutable. + | Local (_, realloc, _), Expr.Const (Const.Zero, _, _) when not realloc && not (eenv.isInLoop && vspec.IsMutable) -> CommitStartScope cgbuf startScopeMarkOpt | _ -> GenBindingRhs cenv cgbuf eenv SPSuppress vspec rhsExpr @@ -7463,7 +7473,8 @@ let GetEmptyIlxGenEnv (ilg: ILGlobals) ccu = liveLocals=IntMap.empty() innerVals = [] sigToImplRemapInfo = [] (* "module remap info" *) - withinSEH = false } + withinSEH = false + isInLoop = false } type IlxGenResults = { ilTypeDefs: ILTypeDef list diff --git a/tests/fsharp/Compiler/Regressions/ForInDoMutableRegressionTest.fs b/tests/fsharp/Compiler/Regressions/ForInDoMutableRegressionTest.fs new file mode 100644 index 0000000000..7319c2fab7 --- /dev/null +++ b/tests/fsharp/Compiler/Regressions/ForInDoMutableRegressionTest.fs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.UnitTests + +open System +open NUnit.Framework + +[] +module ForInDoMutableRegressionTest = + + /// This test is to ensure we initialize locals inside loops. + [] + let Script_ForInDoMutableRegressionTest() = + let script = + """ +open System.Collections.Generic + +let bug() = + for a in [1;2;3;4] do + let mutable x = null + if x = null then + x <- HashSet() + x.Add a |> ignore + let expected = [a] + let actual = List.ofSeq x + if expected <> actual then + failwith "Bug" + +let not_a_bug() = + for a in [1;2;3;4] do + let x = ref null + if (!x) = null then + x := HashSet() + (!x).Add a |> ignore + let expected = [a] + let actual = List.ofSeq (!x) + if expected <> actual then + failwith "Bug" + +let rec test_rec xs = + let mutable x = null + match xs with + | [] -> () + | a :: xs -> + if x = null then + x <- HashSet() + x.Add a |> ignore + let expected = [a] + let actual = List.ofSeq x + if expected <> actual then + failwith "Bug" + test_rec xs + +let test_for_loop () = + let xs = [|1;2;3;4|] + for i = 0 to xs.Length - 1 do + let a = xs.[i] + let mutable x = null + if x = null then + x <- HashSet() + x.Add a |> ignore + let expected = [a] + let actual = List.ofSeq x + if expected <> actual then + failwith "Bug" + +bug () +not_a_bug () +test_rec [1;2;3;4] +test_for_loop () + """ + + CompilerAssert.RunScript script [] diff --git a/tests/fsharp/FSharpSuite.Tests.fsproj b/tests/fsharp/FSharpSuite.Tests.fsproj index 56240b466b..9376f62dcd 100644 --- a/tests/fsharp/FSharpSuite.Tests.fsproj +++ b/tests/fsharp/FSharpSuite.Tests.fsproj @@ -37,6 +37,7 @@ + From 53f8ea1bc1944351c2596b707bacfaf900953482 Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Fri, 31 May 2019 00:47:52 -0700 Subject: [PATCH 070/159] Clean projectinfomanager (#6850) * Expose IsScript from CompileOps so IVT is not needed * Undo rename of internal VersionStamp in PatternMatcher --- src/fsharp/service/service.fs | 2 ++ src/fsharp/service/service.fsi | 3 +++ .../LanguageService/FSharpProjectOptionsManager.fs | 3 +-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/fsharp/service/service.fs b/src/fsharp/service/service.fs index a63fdccee8..a3afd792b8 100644 --- a/src/fsharp/service/service.fs +++ b/src/fsharp/service/service.fs @@ -3325,3 +3325,5 @@ module PrettyNaming = let QuoteIdentifierIfNeeded id = Lexhelp.Keywords.QuoteIdentifierIfNeeded id let KeywordNames = Lexhelp.Keywords.keywordNames +module FSharpFileUtilities = + let isScriptFile (fileName: string) = CompileOps.IsScript fileName \ No newline at end of file diff --git a/src/fsharp/service/service.fsi b/src/fsharp/service/service.fsi index ea27c142c1..f5e2d373d6 100755 --- a/src/fsharp/service/service.fsi +++ b/src/fsharp/service/service.fsi @@ -761,3 +761,6 @@ module public PrettyNaming = /// All the keywords in the F# language val KeywordNames : string list +/// A set of helpers for dealing with F# files. +module FSharpFileUtilities = + val isScriptFile : string -> bool \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs b/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs index 3f966c3104..51cb4bbeec 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs @@ -10,7 +10,6 @@ open System.ComponentModel.Composition open System.IO open System.Linq open Microsoft.CodeAnalysis -open FSharp.Compiler.CompileOps open FSharp.Compiler.SourceCodeServices open Microsoft.VisualStudio open Microsoft.VisualStudio.FSharp.Editor @@ -359,7 +358,7 @@ type internal FSharpProjectOptionsManager let parsingOptions = match reactor.TryGetCachedOptionsByProjectId(document.Project.Id) with | Some (_, parsingOptions, _) -> parsingOptions - | _ -> { FSharpParsingOptions.Default with IsInteractive = IsScript document.Name } + | _ -> { FSharpParsingOptions.Default with IsInteractive = FSharpFileUtilities.isScriptFile document.Name } CompilerEnvironment.GetCompilationDefinesForEditing parsingOptions member this.TryGetOptionsByProject(project) = From 4702abbf7c452671f2fd52c927aae6a4c6c9db7c Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Fri, 31 May 2019 11:22:58 -0700 Subject: [PATCH 071/159] remove NuGet dependency from fslex/fsyacc (#6913) --- src/buildtools/fslex/fslex.fsproj | 5 +++++ src/buildtools/fsyacc/fsyacc.fsproj | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/buildtools/fslex/fslex.fsproj b/src/buildtools/fslex/fslex.fsproj index 64d3442605..2766098c25 100644 --- a/src/buildtools/fslex/fslex.fsproj +++ b/src/buildtools/fslex/fslex.fsproj @@ -4,6 +4,7 @@ Exe netcoreapp2.1 INTERNALIZED_FSLEXYACC_RUNTIME;$(DefineConstant) + true @@ -19,4 +20,8 @@ + + + + diff --git a/src/buildtools/fsyacc/fsyacc.fsproj b/src/buildtools/fsyacc/fsyacc.fsproj index 693080ec98..dc5a4f67f3 100644 --- a/src/buildtools/fsyacc/fsyacc.fsproj +++ b/src/buildtools/fsyacc/fsyacc.fsproj @@ -4,6 +4,7 @@ Exe netcoreapp2.1 INTERNALIZED_FSLEXYACC_RUNTIME;$(DefineConstant) + true @@ -19,4 +20,8 @@ + + + + From 9b1287c90c61328c399ff14bb55b243185b286ad Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Fri, 31 May 2019 18:43:23 -0700 Subject: [PATCH 072/159] Replace FSComp invocations in VS tooling with an FCS API (#6904) --- .../FSharp.Compiler.Private.fsproj | 6 ++++++ src/fsharp/service/ServiceCompilerDiagnostics.fs | 14 ++++++++++++++ src/fsharp/service/ServiceCompilerDiagnostics.fsi | 13 +++++++++++++ .../src/FSharp.Editor/CodeFix/FixIndexerAccess.fs | 6 ++---- .../FSharp.Editor/CodeFix/ProposeUppercaseLabel.fs | 3 ++- .../src/FSharp.Editor/CodeFix/RemoveUnusedOpens.fs | 1 - .../CodeFix/RenameParamToMatchSignature.fs | 5 +---- .../FSharp.Editor/CodeFix/ReplaceWithSuggestion.fs | 4 ++-- 8 files changed, 40 insertions(+), 12 deletions(-) create mode 100644 src/fsharp/service/ServiceCompilerDiagnostics.fs create mode 100644 src/fsharp/service/ServiceCompilerDiagnostics.fsi diff --git a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj index e8831bc932..1bb82db552 100644 --- a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj +++ b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj @@ -575,6 +575,12 @@ Service/IncrementalBuild.fs + + Service/ServiceCompilerDiagnostics.fsi + + + Service/ServiceCompilerDiagnostics.fs + Service/ServiceConstants.fs diff --git a/src/fsharp/service/ServiceCompilerDiagnostics.fs b/src/fsharp/service/ServiceCompilerDiagnostics.fs new file mode 100644 index 0000000000..008cb327bb --- /dev/null +++ b/src/fsharp/service/ServiceCompilerDiagnostics.fs @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.SourceCodeServices + +type DiagnosticKind = + | AddIndexerDot + | ReplaceWithSuggestion of suggestion:string + +[] +module CompilerDiagnostics = + let getErrorMessage diagnosticKind = + match diagnosticKind with + | AddIndexerDot -> FSComp.SR.addIndexerDot() + | ReplaceWithSuggestion s -> FSComp.SR.replaceWithSuggestion(s) \ No newline at end of file diff --git a/src/fsharp/service/ServiceCompilerDiagnostics.fsi b/src/fsharp/service/ServiceCompilerDiagnostics.fsi new file mode 100644 index 0000000000..4916b2c2f6 --- /dev/null +++ b/src/fsharp/service/ServiceCompilerDiagnostics.fsi @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.SourceCodeServices + +/// Supported kinds of diagnostics by this service. +type DiagnosticKind = + | AddIndexerDot + | ReplaceWithSuggestion of suggestion:string + +/// Exposes compiler diagnostic error messages. +module CompilerDiagnostics = + /// Given a DiagnosticKind, returns the string representing the error message for that diagnostic. + val getErrorMessage: diagnosticKind: DiagnosticKind -> string \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/CodeFix/FixIndexerAccess.fs b/vsintegration/src/FSharp.Editor/CodeFix/FixIndexerAccess.fs index 32f9929577..eb9a49c0fa 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/FixIndexerAccess.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/FixIndexerAccess.fs @@ -2,15 +2,13 @@ namespace Microsoft.VisualStudio.FSharp.Editor -open System open System.Composition open System.Collections.Immutable open System.Threading.Tasks -open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes -open SymbolHelpers +open FSharp.Compiler.SourceCodeServices [] type internal FSharpFixIndexerAccessCodeFixProvider() = @@ -50,7 +48,7 @@ type internal FSharpFixIndexerAccessCodeFixProvider() = let codefix = CodeFixHelpers.createTextChangeCodeFix( - FSComp.SR.addIndexerDot(), + CompilerDiagnostics.getErrorMessage AddIndexerDot, context, (fun () -> asyncMaybe.Return [| TextChange(span, replacement.TrimEnd() + ".") |])) diff --git a/vsintegration/src/FSharp.Editor/CodeFix/ProposeUppercaseLabel.fs b/vsintegration/src/FSharp.Editor/CodeFix/ProposeUppercaseLabel.fs index a01ed2f37e..8b46a80b7d 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/ProposeUppercaseLabel.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/ProposeUppercaseLabel.fs @@ -6,6 +6,7 @@ open System.Composition open System.Threading.Tasks open Microsoft.CodeAnalysis.CodeFixes open Microsoft.CodeAnalysis.CodeActions +open FSharp.Compiler.SourceCodeServices [] type internal FSharpProposeUpperCaseLabelCodeFixProvider @@ -24,7 +25,7 @@ type internal FSharpProposeUpperCaseLabelCodeFixProvider asyncMaybe { let textChanger (originalText: string) = originalText.[0].ToString().ToUpper() + originalText.Substring(1) let! solutionChanger, originalText = SymbolHelpers.changeAllSymbolReferences(context.Document, context.Span, textChanger, projectInfoManager, checkerProvider.Checker, userOpName) - let title = FSComp.SR.replaceWithSuggestion (textChanger originalText) + let title = CompilerDiagnostics.getErrorMessage (ReplaceWithSuggestion <| textChanger originalText) context.RegisterCodeFix( CodeAction.Create(title, solutionChanger, title), context.Diagnostics |> Seq.filter (fun x -> fixableDiagnosticIds |> List.contains x.Id) |> Seq.toImmutableArray) diff --git a/vsintegration/src/FSharp.Editor/CodeFix/RemoveUnusedOpens.fs b/vsintegration/src/FSharp.Editor/CodeFix/RemoveUnusedOpens.fs index b1641f99a7..e2ccc7e22c 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/RemoveUnusedOpens.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/RemoveUnusedOpens.fs @@ -6,7 +6,6 @@ open System.Composition open System.Threading open System.Threading.Tasks -open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Diagnostics open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes diff --git a/vsintegration/src/FSharp.Editor/CodeFix/RenameParamToMatchSignature.fs b/vsintegration/src/FSharp.Editor/CodeFix/RenameParamToMatchSignature.fs index 2255d003cd..245c1ff140 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/RenameParamToMatchSignature.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/RenameParamToMatchSignature.fs @@ -2,16 +2,13 @@ namespace Microsoft.VisualStudio.FSharp.Editor -open System open System.Collections.Immutable open System.Composition open System.Threading.Tasks -open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes -open FSharp.Compiler open FSharp.Compiler.SourceCodeServices open Microsoft.VisualStudio.FSharp.Editor.SymbolHelpers open FSharp.Compiler.SourceCodeServices.Keywords @@ -57,7 +54,7 @@ type internal FSharpRenameParamToMatchSignature yield TextChange(textSpan, replacement) |] return changes } - let title = FSComp.SR.replaceWithSuggestion suggestion + let title = CompilerDiagnostics.getErrorMessage (ReplaceWithSuggestion suggestion) let codefix = CodeFixHelpers.createTextChangeCodeFix(title, context, computeChanges) context.RegisterCodeFix(codefix, diagnostics) | _ -> () diff --git a/vsintegration/src/FSharp.Editor/CodeFix/ReplaceWithSuggestion.fs b/vsintegration/src/FSharp.Editor/CodeFix/ReplaceWithSuggestion.fs index dc84479da3..b3f80dc232 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/ReplaceWithSuggestion.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/ReplaceWithSuggestion.fs @@ -59,9 +59,9 @@ type internal FSharpReplaceWithSuggestionCodeFixProvider for suggestion in suggestions do let replacement = Keywords.QuoteIdentifierIfNeeded suggestion - let codeFix = + let codeFix = CodeFixHelpers.createTextChangeCodeFix( - FSComp.SR.replaceWithSuggestion suggestion, + CompilerDiagnostics.getErrorMessage (ReplaceWithSuggestion suggestion), context, (fun () -> asyncMaybe.Return [| TextChange(context.Span, replacement) |])) From d96345db05e5b8dbf2ed10bc8640aae223aeb1bd Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Sat, 1 Jun 2019 23:05:52 -0700 Subject: [PATCH 073/159] fix compiler location (#6917) --- src/utils/CompilerLocationUtils.fs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/utils/CompilerLocationUtils.fs b/src/utils/CompilerLocationUtils.fs index 41de8bb911..df0c7123b4 100644 --- a/src/utils/CompilerLocationUtils.fs +++ b/src/utils/CompilerLocationUtils.fs @@ -220,7 +220,6 @@ module internal FSharpEnvironment = // For the prototype compiler, we can just use the current domain tryCurrentDomain() with e -> - System.Diagnostics.Debug.Assert(false, "Error while determining default location of F# compiler") None From 7c39a4f8a7bb5aa5c087c35996acee3f928be0b7 Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Sun, 2 Jun 2019 00:14:54 -0700 Subject: [PATCH 074/159] Remove dead code in Extensions and Pervasive files (#6916) --- .../src/FSharp.Editor/Common/Extensions.fs | 140 +++++------------- .../src/FSharp.Editor/Common/Pervasive.fs | 12 +- 2 files changed, 41 insertions(+), 111 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/Common/Extensions.fs b/vsintegration/src/FSharp.Editor/Common/Extensions.fs index 222f4b5f09..894ef61b23 100644 --- a/vsintegration/src/FSharp.Editor/Common/Extensions.fs +++ b/vsintegration/src/FSharp.Editor/Common/Extensions.fs @@ -11,10 +11,9 @@ open Microsoft.CodeAnalysis.Host open FSharp.Compiler.Text open FSharp.Compiler.Ast open FSharp.Compiler.SourceCodeServices -open Microsoft.CodeAnalysis.ExternalAccess.FSharp type private FSharpGlyph = FSharp.Compiler.SourceCodeServices.FSharpGlyph -type private Glyph = Microsoft.CodeAnalysis.ExternalAccess.FSharp.FSharpGlyph +type private FSharpRoslynGlyph = Microsoft.CodeAnalysis.ExternalAccess.FSharp.FSharpGlyph type Path with @@ -136,79 +135,77 @@ type SourceText with SourceText.weakTable.GetValue(this, Runtime.CompilerServices.ConditionalWeakTable<_,_>.CreateValueCallback(SourceText.create)) type FSharpNavigationDeclarationItem with - member x.RoslynGlyph : Glyph = + member x.RoslynGlyph : FSharpRoslynGlyph = match x.Glyph with | FSharpGlyph.Class | FSharpGlyph.Typedef | FSharpGlyph.Type | FSharpGlyph.Exception -> match x.Access with - | Some SynAccess.Private -> Glyph.ClassPrivate - | Some SynAccess.Internal -> Glyph.ClassInternal - | _ -> Glyph.ClassPublic + | Some SynAccess.Private -> FSharpRoslynGlyph.ClassPrivate + | Some SynAccess.Internal -> FSharpRoslynGlyph.ClassInternal + | _ -> FSharpRoslynGlyph.ClassPublic | FSharpGlyph.Constant -> match x.Access with - | Some SynAccess.Private -> Glyph.ConstantPrivate - | Some SynAccess.Internal -> Glyph.ConstantInternal - | _ -> Glyph.ConstantPublic + | Some SynAccess.Private -> FSharpRoslynGlyph.ConstantPrivate + | Some SynAccess.Internal -> FSharpRoslynGlyph.ConstantInternal + | _ -> FSharpRoslynGlyph.ConstantPublic | FSharpGlyph.Delegate -> match x.Access with - | Some SynAccess.Private -> Glyph.DelegatePrivate - | Some SynAccess.Internal -> Glyph.DelegateInternal - | _ -> Glyph.DelegatePublic + | Some SynAccess.Private -> FSharpRoslynGlyph.DelegatePrivate + | Some SynAccess.Internal -> FSharpRoslynGlyph.DelegateInternal + | _ -> FSharpRoslynGlyph.DelegatePublic | FSharpGlyph.Union | FSharpGlyph.Enum -> match x.Access with - | Some SynAccess.Private -> Glyph.EnumPrivate - | Some SynAccess.Internal -> Glyph.EnumInternal - | _ -> Glyph.EnumPublic + | Some SynAccess.Private -> FSharpRoslynGlyph.EnumPrivate + | Some SynAccess.Internal -> FSharpRoslynGlyph.EnumInternal + | _ -> FSharpRoslynGlyph.EnumPublic | FSharpGlyph.EnumMember | FSharpGlyph.Variable | FSharpGlyph.Field -> match x.Access with - | Some SynAccess.Private -> Glyph.FieldPrivate - | Some SynAccess.Internal -> Glyph.FieldInternal - | _ -> Glyph.FieldPublic + | Some SynAccess.Private -> FSharpRoslynGlyph.FieldPrivate + | Some SynAccess.Internal -> FSharpRoslynGlyph.FieldInternal + | _ -> FSharpRoslynGlyph.FieldPublic | FSharpGlyph.Event -> match x.Access with - | Some SynAccess.Private -> Glyph.EventPrivate - | Some SynAccess.Internal -> Glyph.EventInternal - | _ -> Glyph.EventPublic + | Some SynAccess.Private -> FSharpRoslynGlyph.EventPrivate + | Some SynAccess.Internal -> FSharpRoslynGlyph.EventInternal + | _ -> FSharpRoslynGlyph.EventPublic | FSharpGlyph.Interface -> match x.Access with - | Some SynAccess.Private -> Glyph.InterfacePrivate - | Some SynAccess.Internal -> Glyph.InterfaceInternal - | _ -> Glyph.InterfacePublic + | Some SynAccess.Private -> FSharpRoslynGlyph.InterfacePrivate + | Some SynAccess.Internal -> FSharpRoslynGlyph.InterfaceInternal + | _ -> FSharpRoslynGlyph.InterfacePublic | FSharpGlyph.Method | FSharpGlyph.OverridenMethod -> match x.Access with - | Some SynAccess.Private -> Glyph.MethodPrivate - | Some SynAccess.Internal -> Glyph.MethodInternal - | _ -> Glyph.MethodPublic + | Some SynAccess.Private -> FSharpRoslynGlyph.MethodPrivate + | Some SynAccess.Internal -> FSharpRoslynGlyph.MethodInternal + | _ -> FSharpRoslynGlyph.MethodPublic | FSharpGlyph.Module -> match x.Access with - | Some SynAccess.Private -> Glyph.ModulePrivate - | Some SynAccess.Internal -> Glyph.ModuleInternal - | _ -> Glyph.ModulePublic - | FSharpGlyph.NameSpace -> Glyph.Namespace + | Some SynAccess.Private -> FSharpRoslynGlyph.ModulePrivate + | Some SynAccess.Internal -> FSharpRoslynGlyph.ModuleInternal + | _ -> FSharpRoslynGlyph.ModulePublic + | FSharpGlyph.NameSpace -> FSharpRoslynGlyph.Namespace | FSharpGlyph.Property -> match x.Access with - | Some SynAccess.Private -> Glyph.PropertyPrivate - | Some SynAccess.Internal -> Glyph.PropertyInternal - | _ -> Glyph.PropertyPublic + | Some SynAccess.Private -> FSharpRoslynGlyph.PropertyPrivate + | Some SynAccess.Internal -> FSharpRoslynGlyph.PropertyInternal + | _ -> FSharpRoslynGlyph.PropertyPublic | FSharpGlyph.Struct -> match x.Access with - | Some SynAccess.Private -> Glyph.StructurePrivate - | Some SynAccess.Internal -> Glyph.StructureInternal - | _ -> Glyph.StructurePublic + | Some SynAccess.Private -> FSharpRoslynGlyph.StructurePrivate + | Some SynAccess.Internal -> FSharpRoslynGlyph.StructureInternal + | _ -> FSharpRoslynGlyph.StructurePublic | FSharpGlyph.ExtensionMethod -> match x.Access with - | Some SynAccess.Private -> Glyph.ExtensionMethodPrivate - | Some SynAccess.Internal -> Glyph.ExtensionMethodInternal - | _ -> Glyph.ExtensionMethodPublic - | FSharpGlyph.Error -> Glyph.Error - - + | Some SynAccess.Private -> FSharpRoslynGlyph.ExtensionMethodPrivate + | Some SynAccess.Internal -> FSharpRoslynGlyph.ExtensionMethodInternal + | _ -> FSharpRoslynGlyph.ExtensionMethodPublic + | FSharpGlyph.Error -> FSharpRoslynGlyph.Error [] module String = @@ -234,21 +231,6 @@ module Option = let attempt (f: unit -> 'T) = try Some <| f() with _ -> None - let inline ofNull value = - if obj.ReferenceEquals(value, null) then None else Some value - - /// Gets the option if Some x, otherwise try to get another value - let inline orTry f = - function - | Some x -> Some x - | None -> f() - - /// Gets the value if Some x, otherwise try to get another value by calling a function - let inline getOrTry f = - function - | Some x -> x - | None -> f() - /// Returns 'Some list' if all elements in the list are Some, otherwise None let ofOptionList (xs : 'a option list) : 'a list option = @@ -273,48 +255,6 @@ module Array = i <- i + 1 state - /// Optimized arrays equality. ~100x faster than `array1 = array2` on strings. - /// ~2x faster for floats - /// ~0.8x slower for ints - let areEqual (xs: 'T []) (ys: 'T []) = - match xs, ys with - | null, null -> true - | [||], [||] -> true - | null, _ | _, null -> false - | _ when xs.Length <> ys.Length -> false - | _ -> - let mutable stop = false - let mutable i = 0 - let mutable result = true - while i < xs.Length && not stop do - if xs.[i] <> ys.[i] then - stop <- true - result <- false - i <- i + 1 - result - - /// check if subArray is found in the wholeArray starting - /// at the provided index - let isSubArray (subArray: 'T []) (wholeArray:'T []) index = - if isNull subArray || isNull wholeArray then false - elif subArray.Length = 0 then true - elif subArray.Length > wholeArray.Length then false - elif subArray.Length = wholeArray.Length then areEqual subArray wholeArray else - let rec loop subidx idx = - if subidx = subArray.Length then true - elif subArray.[subidx] = wholeArray.[idx] then loop (subidx+1) (idx+1) - else false - loop 0 index - - /// Returns true if one array has another as its subset from index 0. - let startsWith (prefix: _ []) (whole: _ []) = - isSubArray prefix whole 0 - - /// Returns true if one array has trailing elements equal to another's. - let endsWith (suffix: _ []) (whole: _ []) = - isSubArray suffix whole (whole.Length-suffix.Length) - - [] module Exception = diff --git a/vsintegration/src/FSharp.Editor/Common/Pervasive.fs b/vsintegration/src/FSharp.Editor/Common/Pervasive.fs index 976dbf67f8..9dd525d609 100644 --- a/vsintegration/src/FSharp.Editor/Common/Pervasive.fs +++ b/vsintegration/src/FSharp.Editor/Common/Pervasive.fs @@ -3,11 +3,8 @@ module Microsoft.VisualStudio.FSharp.Editor.Pervasive open System open System.IO -open System.Threading.Tasks open System.Diagnostics -type IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider - /// Checks if the filePath ends with ".fsi" let isSignatureFile (filePath:string) = String.Equals (Path.GetExtension filePath, ".fsi", StringComparison.OrdinalIgnoreCase) @@ -17,12 +14,8 @@ let isScriptFile (filePath:string) = let ext = Path.GetExtension filePath String.Equals (ext, ".fsx", StringComparison.OrdinalIgnoreCase) || String.Equals (ext, ".fsscript", StringComparison.OrdinalIgnoreCase) -/// Path combination operator -let () path1 path2 = Path.Combine (path1, path2) - type internal ISetThemeColors = abstract member SetColors: unit -> unit - [] type MaybeBuilder () = // 'T -> M<'T> @@ -199,7 +192,4 @@ module Async = let! replyCh = agent.Receive () replyCh.Reply res } - async { return! agent.PostAndAsyncReply id } - - - + async { return! agent.PostAndAsyncReply id } \ No newline at end of file From 2d7237cd49c0e0da8efb461994bb6e490130f455 Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Sun, 2 Jun 2019 00:17:21 -0700 Subject: [PATCH 075/159] No IVTs for CodeLenses (#6906) * Don't expose Legacy MSBuildReferenceResolver * Move the files boss hoss * Remove unused opens * Fix tests * Remove IVT dependency for CodeLens and put logging behind a flag * oopsie doopsie * meep morp * blub glub * heepers jeepers * Update fsi.fs * Update service.fs * Update service.fsi * Update FSharpCheckerProvider.fs * Update FSharpLanguageServiceTestable.fs * Update TestLib.LanguageService.fs * Updates for build in release * I'm not touching MSBuildReferenceResolver I'm not touching MSBuildReferenceResolver I'm not touching MSBuildReferenceResolver * Different ignore and adjust ifdefs --- .../FSharp.Compiler.Private.fsproj | 4 +- src/fsharp/service/service.fs | 4 +- src/fsharp/service/service.fsi | 4 +- .../AbstractCodeLensDisplayService.fs | 45 +++++++++++-- .../CodeLens/CodeLensGeneralTagger.fs | 58 ++++++++++++++--- .../CodeLens/CodeLensProvider.fs | 10 +-- .../CodeLens/FSharpCodeLensService.fs | 65 ++++++++++++------- .../CodeLens/LineLensDisplayService.fs | 16 +++-- .../LanguageService/FSharpCheckerProvider.fs | 3 - 9 files changed, 146 insertions(+), 63 deletions(-) diff --git a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj index 1bb82db552..50d8b6e9c0 100644 --- a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj +++ b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj @@ -677,7 +677,7 @@ Service/ServiceAnalysis.fs - + FSIstrings.txt @@ -688,7 +688,7 @@ InteractiveSession/fsi.fs - + Misc/MSBuildReferenceResolver.fs diff --git a/src/fsharp/service/service.fs b/src/fsharp/service/service.fs index a3afd792b8..1240b7f5bd 100644 --- a/src/fsharp/service/service.fs +++ b/src/fsharp/service/service.fs @@ -2102,12 +2102,12 @@ type FSharpCheckFileResults(filename: string, errors: FSharpErrorInfo[], scopeOp RequireCompilationThread ctok scope.IsRelativeNameResolvableFromSymbol(pos, plid, symbol)) - member info.GetDisplayEnvForPos(pos: pos) : Async = + member info.GetDisplayContextForPos(pos: pos) : Async = let userOpName = "CodeLens" reactorOp userOpName "GetDisplayContextAtPos" None (fun ctok scope -> DoesNotRequireCompilerThreadTokenAndCouldPossiblyBeMadeConcurrent ctok let (nenv, _), _ = scope.GetBestDisplayEnvForPos pos - Some nenv.DisplayEnv) + Some(FSharpDisplayContext(fun _ -> nenv.DisplayEnv))) 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" diff --git a/src/fsharp/service/service.fsi b/src/fsharp/service/service.fsi index f5e2d373d6..737737affd 100755 --- a/src/fsharp/service/service.fsi +++ b/src/fsharp/service/service.fsi @@ -244,8 +244,8 @@ 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 + /// Find the most precise display context for the given line and column. + member GetDisplayContextForPos : 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. diff --git a/vsintegration/src/FSharp.Editor/CodeLens/AbstractCodeLensDisplayService.fs b/vsintegration/src/FSharp.Editor/CodeLens/AbstractCodeLensDisplayService.fs index e6d60baf09..b5c4b8fb90 100644 --- a/vsintegration/src/FSharp.Editor/CodeLens/AbstractCodeLensDisplayService.fs +++ b/vsintegration/src/FSharp.Editor/CodeLens/AbstractCodeLensDisplayService.fs @@ -2,7 +2,6 @@ namespace rec Microsoft.VisualStudio.FSharp.Editor -open System open System.Windows.Controls open Microsoft.VisualStudio.Text open Microsoft.VisualStudio.Text.Editor @@ -123,7 +122,9 @@ type CodeLensDisplayService (view : IWpfTextView, buffer : ITextBuffer, layerNam let startLineNumber = snapshot.GetLineNumberFromPosition(trackingSpan.GetStartPoint(snapshot).Position) let uiElement = if self.UiElements.ContainsKey trackingSpan then +#if DEBUG logErrorf "Added a tracking span twice, this is not allowed and will result in invalid values! %A" (trackingSpan.GetText snapshot) +#endif self.UiElements.[trackingSpan] else let defaultStackPanel = self.CreateDefaultStackPanel() @@ -152,7 +153,12 @@ type CodeLensDisplayService (view : IWpfTextView, buffer : ITextBuffer, layerNam 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 + with e -> +#if DEBUG + logErrorf "Error in line lens provider: %A" e +#else + ignore e +#endif /// 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. @@ -171,20 +177,30 @@ type CodeLensDisplayService (view : IWpfTextView, buffer : ITextBuffer, layerNam self.UiElements.Remove trackingSpan |> ignore try self.CodeLensLayer.RemoveAdornment(Grid) - with e -> + with e -> +#if DEBUG logExceptionWithContext(e, "Removing line lens") +#else + ignore e +#endif +#if DEBUG else logWarningf "No ui element is attached to this tracking span!" +#endif let lineNumber = (trackingSpan.GetStartPoint self.CurrentBufferSnapshot).Position |> self.CurrentBufferSnapshot.GetLineNumberFromPosition if self.TrackingSpans.ContainsKey lineNumber then +#if DEBUG if self.TrackingSpans.[lineNumber].Remove trackingSpan |> not then logWarningf "No tracking span is accociated with this line number %d!" lineNumber +#endif if self.TrackingSpans.[lineNumber].Count = 0 then self.TrackingSpans.Remove lineNumber |> ignore +#if DEBUG else logWarningf "No tracking span is accociated with this line number %d!" lineNumber +#endif abstract member AddUiElementToCodeLens : ITrackingSpan * UIElement -> unit default self.AddUiElementToCodeLens (trackingSpan:ITrackingSpan, uiElement:UIElement) = @@ -234,7 +250,12 @@ type CodeLensDisplayService (view : IWpfTextView, buffer : ITextBuffer, layerNam applyFuncOnLineStackPanels line (fun ui -> ui.Visibility <- Visibility.Hidden ) - with e -> logErrorf "Error in non visible lines iteration %A" e + with e -> +#if DEBUG + logErrorf "Error in non visible lines iteration %A" e +#else + ignore e +#endif for lineNumber in newVisibleLineNumbers do try let line = @@ -244,7 +265,12 @@ type CodeLensDisplayService (view : IWpfTextView, buffer : ITextBuffer, layerNam ui.Visibility <- Visibility.Visible self.LayoutUIElementOnLine view line ui ) - with e -> logErrorf "Error in new visible lines iteration %A" e + with e -> +#if DEBUG + logErrorf "Error in new visible lines iteration %A" e +#else + ignore e +#endif 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 @@ -267,8 +293,13 @@ type CodeLensDisplayService (view : IWpfTextView, buffer : ITextBuffer, layerNam self.AsyncCustomLayoutOperation visibleLineNumbers buffer |> RoslynHelpers.StartAsyncSafe self.LayoutChangedCts.Token "HandleLayoutChanged" - with e -> logExceptionWithContext (e, "Layout changed") + with e -> +#if DEBUG + logExceptionWithContext (e, "Layout changed") +#else + ignore e +#endif abstract LayoutUIElementOnLine : IWpfTextView -> ITextViewLine -> Grid -> unit - abstract AsyncCustomLayoutOperation : int Set -> ITextSnapshot -> unit Async + abstract AsyncCustomLayoutOperation : int Set -> ITextSnapshot -> unit Async \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/CodeLens/CodeLensGeneralTagger.fs b/vsintegration/src/FSharp.Editor/CodeLens/CodeLensGeneralTagger.fs index 9ed05edf0a..3702ac6287 100644 --- a/vsintegration/src/FSharp.Editor/CodeLens/CodeLensGeneralTagger.fs +++ b/vsintegration/src/FSharp.Editor/CodeLens/CodeLensGeneralTagger.fs @@ -8,7 +8,6 @@ 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 @@ -32,7 +31,9 @@ type CodeLensGeneralTagger (view, buffer) as self = let left = Canvas.GetLeft parent let top = Canvas.GetTop parent let width = parent.ActualWidth +#if DEBUG logInfof "Width of parent: %.4f" width +#endif left + width, top | _ -> try @@ -47,12 +48,18 @@ type CodeLensGeneralTagger (view, buffer) as self = // 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 +#if DEBUG logErrorf "Incorrect return from geometry measure" +#endif Canvas.GetLeft ui, g.Top else g.Left, g.Top with e -> +#if DEBUG logExceptionWithContext (e, "Error in layout ui element on line") +#else + ignore e +#endif Canvas.GetLeft ui, Canvas.GetTop ui Canvas.SetLeft(ui, left) Canvas.SetTop(ui, top) @@ -89,7 +96,12 @@ type CodeLensGeneralTagger (view, buffer) as self = self, stackPanel, AdornmentRemovedCallback(fun _ _ -> ())) |> ignore self.AddedAdornments.Add stackPanel |> ignore | _ -> () - with e -> logExceptionWithContext (e, "LayoutChanged, processing new visible lines") + with e -> +#if DEBUG + logExceptionWithContext (e, "LayoutChanged, processing new visible lines") +#else + ignore e +#endif } |> Async.Ignore override self.AddUiElementToCodeLens (trackingSpan:ITrackingSpan, uiElement:UIElement)= @@ -114,7 +126,13 @@ type CodeLensGeneralTagger (view, buffer) as self = let lineNumber = try snapshot.GetLineNumberFromPosition(span.Start.Position) - with e -> logExceptionWithContext (e, "line number tagging"); 0 + with e -> +#if DEBUG + logExceptionWithContext (e, "line number tagging") +#else + ignore e +#endif + 0 if self.TrackingSpans.ContainsKey(lineNumber) && self.TrackingSpans.[lineNumber] |> Seq.isEmpty |> not then let tagSpan = snapshot.GetLineFromLineNumber(lineNumber).Extent @@ -128,13 +146,25 @@ type CodeLensGeneralTagger (view, buffer) as self = let span = try tagSpan.TranslateTo(span.Snapshot, SpanTrackingMode.EdgeExclusive) - with e -> logExceptionWithContext (e, "tag span translation"); tagSpan + with e -> +#if DEBUG + logExceptionWithContext (e, "tag span translation") +#else + ignore e +#endif + tagSpan let sizes = try stackPanels |> Seq.map (fun ui -> ui.Measure(Size(10000., 10000.)) ui.DesiredSize ) - with e -> logExceptionWithContext (e, "internal tagging"); Seq.empty + with e -> +#if DEBUG + logExceptionWithContext (e, "internal tagging") +#else + ignore e +#endif + Seq.empty let height = try sizes @@ -142,12 +172,20 @@ type CodeLensGeneralTagger (view, buffer) as self = |> Seq.sortDescending |> Seq.tryHead |> Option.defaultValue 0. - with e -> logExceptionWithContext (e, "height tagging"); 0. + with e -> +#if DEBUG + logExceptionWithContext (e, "height tagging") +#else + ignore e +#endif + 0.0 yield TagSpan(span, CodeLensGeneralTag(0., height, 0., 0., 0., PositionAffinity.Predecessor, stackPanels, self)) :> ITagSpan } - with e -> + with e -> +#if DEBUG logErrorf "Error in code lens get tags %A" e - Seq.empty - - +#else + ignore e +#endif + Seq.empty \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/CodeLens/CodeLensProvider.fs b/vsintegration/src/FSharp.Editor/CodeLens/CodeLensProvider.fs index 10c7f14ab9..eaf4b541a8 100644 --- a/vsintegration/src/FSharp.Editor/CodeLens/CodeLensProvider.fs +++ b/vsintegration/src/FSharp.Editor/CodeLens/CodeLensProvider.fs @@ -2,23 +2,15 @@ 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 open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor.Shared.Utilities [)>] @@ -108,4 +100,4 @@ type internal CodeLensProvider interface IWpfTextViewCreationListener with override __.TextViewCreated view = if settings.CodeLens.Enabled && settings.CodeLens.ReplaceWithLineLens then - addLineLensProviderOnce view (view.TextBuffer) |> ignore + addLineLensProviderOnce view (view.TextBuffer) |> ignore \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs b/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs index 44e9322dff..add51361f1 100644 --- a/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs +++ b/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs @@ -13,12 +13,9 @@ open System.Windows.Media.Animation open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Editor.Shared.Extensions -open Microsoft.CodeAnalysis.Editor.Shared.Utilities -open Microsoft.CodeAnalysis.Classification open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Classification open FSharp.Compiler -open FSharp.Compiler.Ast open FSharp.Compiler.SourceCodeServices open FSharp.Compiler.Range @@ -28,7 +25,6 @@ open Microsoft.VisualStudio.Shell.Interop open Microsoft.VisualStudio.Text open Microsoft.VisualStudio.Text.Classification -open Microsoft.VisualStudio.Text.Formatting open Internal.Utilities.StructuredFormat @@ -90,8 +86,10 @@ type internal FSharpCodeLensService do! Async.SwitchToContext uiContext let! res = lens.TaggedText match res with - | Some (taggedText, navigation) -> + | Some (taggedText, navigation) -> +#if DEBUG logInfof "Tagged text %A" taggedText +#endif let textBlock = new TextBlock(Background = Brushes.AliceBlue, Opacity = 0.0, TextTrimming = TextTrimming.None) DependencyObjectExtensions.SetDefaultTextProperties(textBlock, formatMap.Value) @@ -143,15 +141,20 @@ type internal FSharpCodeLensService let executeCodeLenseAsync () = asyncMaybe { do! Async.Sleep 800 |> liftAsync +#if DEBUG logInfof "Rechecking code due to buffer edit!" +#endif let! document = workspace.CurrentSolution.GetDocument(documentId.Value) |> Option.ofObj let! _, options = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document, bufferChangedCts.Token) let! _, parsedInput, checkFileResults = checker.ParseAndCheckDocument(document, options, "LineLens", allowStaleResults=true) +#if DEBUG logInfof "Getting uses of all symbols!" +#endif let! symbolUses = checkFileResults.GetAllUsesOfAllSymbolsInFile() |> liftAsync let textSnapshot = buffer.CurrentSnapshot +#if DEBUG logInfof "Updating due to buffer edit!" - +#endif // Clear existing data and cache flags // The results which are left. let oldResults = Dictionary(lastResults) @@ -171,13 +174,9 @@ type internal FSharpCodeLensService if (lineNumber >= 0 || lineNumber < textSnapshot.LineCount) then match func.FullTypeSafe with | Some _ -> - let! displayEnv = checkFileResults.GetDisplayEnvForPos func.DeclarationLocation.Start + let! maybeContext = checkFileResults.GetDisplayContextForPos(func.DeclarationLocation.Start) - let displayContext = - match displayEnv with - | Some denv -> FSharpDisplayContext(fun _ -> denv) - | None -> displayContext - + let displayContext = Option.defaultValue displayContext maybeContext let typeLayout = func.FormatLayout displayContext let taggedText = ResizeArray() @@ -187,17 +186,25 @@ type internal FSharpCodeLensService // Because the data is available notify that this line should be updated, displaying the results return Some (taggedText, navigation) | None -> +#if DEBUG logWarningf "Couldn't acquire CodeLens data for function %A" func +#endif return None else return None with e -> +#if DEBUG logErrorf "Error in lazy line lens computation. %A" e +#else + ignore e +#endif return None } let inline setNewResultsAndWarnIfOverriden fullDeclarationText value = +#if DEBUG if newResults.ContainsKey fullDeclarationText then logWarningf "New results already contains: %A" fullDeclarationText +#endif newResults.[fullDeclarationText] <- value for symbolUse in symbolUses do @@ -298,7 +305,11 @@ type internal FSharpCodeLensService textSnapshot.CreateTrackingSpan(declarationSpan, SpanTrackingMode.EdgeExclusive) codeLensToAdd.Add (trackingSpan, res) newResults.[fullDeclarationText] <- (trackingSpan, res) - with e -> logExceptionWithContext (e, "Line Lens tracking tag span creation") + with e -> +#if DEBUG + logExceptionWithContext (e, "Line Lens tracking tag span creation") +#endif + ignore e () lastResults <- newResults do! Async.SwitchToContext uiContext |> liftAsync @@ -308,7 +319,9 @@ type internal FSharpCodeLensService let! res = createTextBox codeLens if res then do! Async.SwitchToContext uiContext +#if DEBUG logInfof "Adding ui element for %A" (codeLens.TaggedText) +#endif let uiElement = codeLens.UiElement let animation = DoubleAnimation( @@ -324,16 +337,16 @@ type internal FSharpCodeLensService lineLens.RelayoutRequested.Enqueue () sb.Begin() else +#if DEBUG logWarningf "Couldn't retrieve code lens information for %A" codeLens.FullTypeSignature - // logInfo "Adding text box!" +#endif + () } |> (RoslynHelpers.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) @@ -345,7 +358,9 @@ type internal FSharpCodeLensService for value in codeLensToAdd do let trackingSpan, codeLens = value let Grid = lineLens.AddCodeLens trackingSpan - logInfof "Trackingspan %A is being added." trackingSpan +#if DEBUG + logInfof "Trackingspan %A is being added." trackingSpan +#endif Grid.IsVisibleChanged |> Event.filter (fun eventArgs -> eventArgs.NewValue :?> bool) @@ -353,10 +368,10 @@ type internal FSharpCodeLensService for oldResult in oldResults do let trackingSpan, _ = oldResult.Value - // logInfof "removing trackingSpan %A" trackingSpan lineLens.RemoveCodeLens trackingSpan |> ignore - +#if DEBUG logInfof "Finished updating line lens." +#endif if not firstTimeChecked then firstTimeChecked <- true @@ -372,8 +387,13 @@ type internal FSharpCodeLensService do! executeCodeLenseAsync() do! Async.Sleep(1000) with - | e -> logErrorf "Line Lens startup failed with: %A" e - numberOfFails <- numberOfFails + 1 + | e -> +#if DEBUG + logErrorf "Line Lens startup failed with: %A" e +#else + ignore e +#endif + numberOfFails <- numberOfFails + 1 } |> Async.Start end @@ -381,5 +401,4 @@ type internal FSharpCodeLensService bufferChangedCts.Cancel() // Stop all ongoing async workflow. bufferChangedCts.Dispose() bufferChangedCts <- new CancellationTokenSource() - executeCodeLenseAsync () |> Async.Ignore |> RoslynHelpers.StartAsyncSafe bufferChangedCts.Token "Buffer Changed" - + executeCodeLenseAsync () |> Async.Ignore |> RoslynHelpers.StartAsyncSafe bufferChangedCts.Token "Buffer Changed" \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/CodeLens/LineLensDisplayService.fs b/vsintegration/src/FSharp.Editor/CodeLens/LineLensDisplayService.fs index 138c5ac785..a34df51c72 100644 --- a/vsintegration/src/FSharp.Editor/CodeLens/LineLensDisplayService.fs +++ b/vsintegration/src/FSharp.Editor/CodeLens/LineLensDisplayService.fs @@ -5,11 +5,8 @@ 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 @@ -29,8 +26,12 @@ type internal LineLensDisplayService (view, buffer) = try let bounds = line.GetCharacterBounds(line.Start) line.TextRight + 5.0, bounds.Top - 1. - with e -> + with e -> +#if DEBUG logExceptionWithContext (e, "Error in layout ui element on line") +#else + ignore e +#endif Canvas.GetLeft ui, Canvas.GetTop ui Canvas.SetLeft(ui, left) Canvas.SetTop(ui, top) @@ -63,5 +64,10 @@ type internal LineLensDisplayService (view, buffer) = view.GetTextViewLineContainingBufferPosition l.Start self.LayoutUIElementOnLine view line grid ) - with e -> logExceptionWithContext (e, "LayoutChanged, processing new visible lines") + with e -> +#if DEBUG + logExceptionWithContext (e, "LayoutChanged, processing new visible lines") +#else + ignore e +#endif } |> Async.Ignore \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerProvider.fs b/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerProvider.fs index b43e5caf14..209fa4be59 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerProvider.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerProvider.fs @@ -6,14 +6,11 @@ open System open System.ComponentModel.Composition open System.Diagnostics open Microsoft.CodeAnalysis -open Microsoft.CodeAnalysis.Diagnostics open FSharp.Compiler.SourceCodeServices open Microsoft.VisualStudio open Microsoft.VisualStudio.FSharp.Editor open Microsoft.VisualStudio.LanguageServices -open Microsoft.VisualStudio.LanguageServices.Implementation.ProjectSystem open FSharp.NativeInterop -open Microsoft.CodeAnalysis.ExternalAccess.FSharp.LanguageServices open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics #nowarn "9" // NativePtr.toNativeInt From e4707c5a7129490362955c70b3f5969e2e445eb9 Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Sun, 2 Jun 2019 00:18:52 -0700 Subject: [PATCH 076/159] Open Implement Interface APIs (#6905) --- src/fsharp/service/ServiceInterfaceStubGenerator.fs | 5 ++--- src/fsharp/service/ServiceInterfaceStubGenerator.fsi | 9 ++------- .../CodeFix/ImplementInterfaceCodeFixProvider.fs | 1 - 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/fsharp/service/ServiceInterfaceStubGenerator.fs b/src/fsharp/service/ServiceInterfaceStubGenerator.fs index 1dad892e8d..d6e46783e7 100644 --- a/src/fsharp/service/ServiceInterfaceStubGenerator.fs +++ b/src/fsharp/service/ServiceInterfaceStubGenerator.fs @@ -4,7 +4,6 @@ namespace FSharp.Compiler.SourceCodeServices open System open System.Diagnostics -open System.Collections.Generic open FSharp.Compiler open FSharp.Compiler.Ast open FSharp.Compiler.Range @@ -102,7 +101,7 @@ module internal CodeGenerationUtils = /// Capture information about an interface in ASTs [] -type internal InterfaceData = +type InterfaceData = | Interface of SynType * SynMemberDefns option | ObjExpr of SynType * SynBinding list member x.Range = @@ -168,7 +167,7 @@ type internal InterfaceData = | _ -> [||] -module internal InterfaceStubGenerator = +module InterfaceStubGenerator = [] type internal Context = { diff --git a/src/fsharp/service/ServiceInterfaceStubGenerator.fsi b/src/fsharp/service/ServiceInterfaceStubGenerator.fsi index 49a0da63d3..4212449408 100644 --- a/src/fsharp/service/ServiceInterfaceStubGenerator.fsi +++ b/src/fsharp/service/ServiceInterfaceStubGenerator.fsi @@ -2,25 +2,20 @@ namespace FSharp.Compiler.SourceCodeServices -open System -open System.Diagnostics -open System.Collections.Generic -open FSharp.Compiler open FSharp.Compiler.Ast open FSharp.Compiler.Range open FSharp.Compiler.SourceCodeServices -open FSharp.Compiler.AbstractIL.Internal.Library #if !FX_NO_INDENTED_TEXT_WRITER /// Capture information about an interface in ASTs [] -type internal InterfaceData = +type InterfaceData = | Interface of SynType * SynMemberDefns option | ObjExpr of SynType * SynBinding list member Range : range member TypeParameters : string[] -module internal InterfaceStubGenerator = +module InterfaceStubGenerator = /// Get members in the decreasing order of inheritance chain val getInterfaceMembers : FSharpEntity -> seq> diff --git a/vsintegration/src/FSharp.Editor/CodeFix/ImplementInterfaceCodeFixProvider.fs b/vsintegration/src/FSharp.Editor/CodeFix/ImplementInterfaceCodeFixProvider.fs index aaa39980f8..032ae032b6 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/ImplementInterfaceCodeFixProvider.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/ImplementInterfaceCodeFixProvider.fs @@ -7,7 +7,6 @@ open System.Composition open System.Threading open System.Threading.Tasks -open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Formatting open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes From 3a3d6ed1f39730ac13a5b3a4a76b21d26e97a682 Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Sun, 2 Jun 2019 00:27:04 -0700 Subject: [PATCH 077/159] Replace AgedLookup with Dictionary in XML doc generation and remove dead code (#6900) * Replace AgedLookup with Dictionary in XML doc generation * Try remove unecessary stuff --- .../DocComments/XMLDocumentation.fs | 49 ++++--------------- 1 file changed, 9 insertions(+), 40 deletions(-) diff --git a/vsintegration/src/FSharp.Editor/DocComments/XMLDocumentation.fs b/vsintegration/src/FSharp.Editor/DocComments/XMLDocumentation.fs index d675803a4d..09a7951e04 100644 --- a/vsintegration/src/FSharp.Editor/DocComments/XMLDocumentation.fs +++ b/vsintegration/src/FSharp.Editor/DocComments/XMLDocumentation.fs @@ -4,14 +4,13 @@ namespace Microsoft.VisualStudio.FSharp.Editor open System open System.Runtime.CompilerServices -open System.Runtime.Caching open System.Text.RegularExpressions -open Internal.Utilities.Collections open Microsoft.VisualStudio.Shell open Microsoft.VisualStudio.Shell.Interop open FSharp.Compiler.SourceCodeServices open FSharp.Compiler.Layout open FSharp.Compiler.Layout.TaggedTextOps +open System.Collections.Generic type internal ITaggedTextCollector = abstract Add: text: TaggedText -> unit @@ -215,50 +214,20 @@ module internal XmlDocumentation = /// Provide Xml Documentation type Provider(xmlIndexService:IVsXMLMemberIndexService) = /// Index of assembly name to xml member index. - let mutable xmlCache = new AgedLookup(10,areSimilar=(fun (x,y) -> x = y)) + let cache = Dictionary() - do Events.SolutionEvents.OnAfterCloseSolution.Add (fun _ -> - xmlCache.Clear(vsToken)) - - #if DEBUG // Keep under DEBUG so that it can keep building. - - let _AppendTypeParameters (collector: ITaggedTextCollector) (memberData:IVsXMLMemberData3) = - let ok,count = memberData.GetTypeParamCount() - if Com.Succeeded(ok) && count > 0 then - for param in 0..count do - let ok,name,text = memberData.GetTypeParamTextAt(param) - if Com.Succeeded(ok) then - EnsureHardLine collector - collector.Add(tagTypeParameter name) - collector.Add(Literals.space) - collector.Add(tagPunctuation "-") - collector.Add(Literals.space) - collector.Add(tagText text) - - let _AppendRemarks (collector: ITaggedTextCollector) (memberData:IVsXMLMemberData3) = - let ok, remarksText = memberData.GetRemarksText() - if Com.Succeeded(ok) then - AppendOnNewLine collector remarksText - #endif - - let _AppendReturns (collector: ITaggedTextCollector) (memberData:IVsXMLMemberData3) = - let ok,returnsText = memberData.GetReturnsText() - if Com.Succeeded(ok) then - if not collector.EndsWithLineBreak then - AppendHardLine(collector) - AppendHardLine(collector) - AppendOnNewLine collector returnsText + do Events.SolutionEvents.OnAfterCloseSolution.Add (fun _ -> cache.Clear()) /// Retrieve the pre-existing xml index or None let GetMemberIndexOfAssembly(assemblyName) = - match xmlCache.TryGet(vsToken, assemblyName) with - | Some(memberIndex) -> Some(memberIndex) - | None -> + match cache.TryGetValue(assemblyName) with + | true, memberIndex -> Some(memberIndex) + | false, _ -> let ok,memberIndex = xmlIndexService.CreateXMLMemberIndex(assemblyName) if Com.Succeeded(ok) then let ok = memberIndex.BuildMemberIndex() - if Com.Succeeded(ok) then - xmlCache.Put(vsToken, assemblyName,memberIndex) + if Com.Succeeded(ok) then + cache.Add(assemblyName, memberIndex) Some(memberIndex) else None else None @@ -275,7 +244,7 @@ module internal XmlDocumentation = interface IDocumentationBuilder with /// Append the given processed XML formatted into the string builder - override this.AppendDocumentationFromProcessedXML(xmlCollector, exnCollector, processedXml, showExceptions, showParameters, paramName) = + override __.AppendDocumentationFromProcessedXML(xmlCollector, exnCollector, processedXml, showExceptions, showParameters, paramName) = match XmlDocReader.TryCreate processedXml with | Some xmlDocReader -> match paramName with From b91fa8b23bbda95b29460eb8f4ad0da60a665a3b Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Sun, 2 Jun 2019 10:34:17 +0300 Subject: [PATCH 078/159] Attributes lists (#6830) * Preserve attributes lists in AST * Add attribute list test --- src/fsharp/TypeChecker.fs | 42 +++++++------- src/fsharp/ast.fs | 22 +++++++- src/fsharp/pars.fsy | 23 ++++---- src/fsharp/service/ServiceAssemblyContent.fs | 28 +++++----- src/fsharp/service/ServiceStructure.fs | 2 +- src/fsharp/service/ServiceUntypedParse.fs | 26 ++++----- tests/service/ServiceUntypedParseTests.fs | 59 ++++++++++++++++++-- 7 files changed, 137 insertions(+), 65 deletions(-) diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index 485b367aed..1e261af3d5 100644 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -962,7 +962,7 @@ let AdjustValSynInfoInSignature g ty (SynValInfo(argsData, retData) as sigMD) = /// The ValReprInfo for a value, except the number of typars is not yet inferred type PartialValReprInfo = PartialValReprInfo of ArgReprInfo list list * ArgReprInfo -let TranslateTopArgSynInfo isArg m tcAttributes (SynArgInfo(attrs, isOpt, nm)) = +let TranslateTopArgSynInfo isArg m tcAttributes (SynArgInfo(Attributes attrs, isOpt, nm)) = // Synthesize an artificial "OptionalArgument" attribute for the parameter let optAttrs = if isOpt then @@ -2453,7 +2453,7 @@ type NormalizedBinding = SynBindingKind * bool * (* pesudo/mustinline value? *) bool * (* mutable *) - SynAttributes * + SynAttribute list * XmlDoc * SynValTyparDecls * SynValData * @@ -2583,7 +2583,7 @@ module BindingNormalization = let NormalizeBinding isObjExprBinding cenv (env: TcEnv) b = match b with - | Binding (vis, bkind, isInline, isMutable, attrs, doc, valSynData, p, retInfo, rhsExpr, mBinding, spBind) -> + | Binding (vis, bkind, isInline, isMutable, Attributes attrs, doc, valSynData, p, retInfo, rhsExpr, mBinding, spBind) -> let (NormalizedBindingPat(pat, rhsExpr, valSynData, typars)) = NormalizeBindingPattern cenv cenv.nameResolver isObjExprBinding env valSynData p (NormalizedBindingRhs ([], retInfo, rhsExpr)) NormalizedBinding(vis, bkind, isInline, isMutable, attrs, doc.ToXmlDoc(), typars, valSynData, pat, rhsExpr, mBinding, spBind) @@ -4572,7 +4572,7 @@ and TcTyparOrMeasurePar optKind cenv (env: TcEnv) newOk tpenv (Typar(id, _, _) a and TcTypar cenv env newOk tpenv tp = TcTyparOrMeasurePar (Some TyparKind.Type) cenv env newOk tpenv tp -and TcTyparDecl cenv env (TyparDecl(synAttrs, (Typar(id, _, _) as stp))) = +and TcTyparDecl cenv env (TyparDecl(Attributes synAttrs, (Typar(id, _, _) as stp))) = let attrs = TcAttributes cenv env AttributeTargets.GenericParameter synAttrs let hasMeasureAttr = HasFSharpAttribute cenv.g cenv.g.attrib_MeasureAttribute attrs let hasEqDepAttr = HasFSharpAttribute cenv.g cenv.g.attrib_EqualityConditionalOnAttribute attrs @@ -10763,7 +10763,7 @@ and TcNormalizedBinding declKind (cenv: cenv) env tpenv overallTy safeThisValOpt spatsL |> List.map (SynInfo.InferSynArgInfoFromSimplePats >> List.map (SynInfo.AttribsOfArgData >> TcAttrs AttributeTargets.Parameter)) let retAttribs = match rtyOpt with - | Some (SynBindingReturnInfo(_, _, retAttrs)) -> TcAttrs AttributeTargets.ReturnValue retAttrs + | Some (SynBindingReturnInfo(_, _, Attributes retAttrs)) -> TcAttrs AttributeTargets.ReturnValue retAttrs | None -> [] let argAndRetAttribs = ArgAndRetAttribs(argAttribs, retAttribs) @@ -12289,7 +12289,7 @@ and TcLetrec overridesOK cenv env tpenv (binds, bindsm, scopem) = let TcAndPublishValSpec (cenv, env, containerInfo: ContainerInfo, declKind, memFlagsOpt, tpenv, valSpfn) = - let (ValSpfn (synAttrs, _, SynValTyparDecls (synTypars, synCanInferTypars, _), _, _, isInline, mutableFlag, doc, vis, literalExprOpt, m)) = valSpfn + let (ValSpfn (Attributes synAttrs, _, SynValTyparDecls (synTypars, synCanInferTypars, _), _, _, isInline, mutableFlag, doc, vis, literalExprOpt, m)) = valSpfn GeneralizationHelpers.CheckDeclaredTyparsPermitted(memFlagsOpt, synTypars, m) let canInferTypars = GeneralizationHelpers.ComputeCanInferExtraGeneralizableTypars (containerInfo.ParentRef, synCanInferTypars, memFlagsOpt) @@ -12405,7 +12405,7 @@ module TcRecdUnionAndEnumDeclarations = begin rfspec - let TcAnonFieldDecl cenv env parent tpenv nm (Field(attribs, isStatic, idOpt, ty, isMutable, xmldoc, vis, m)) = + let TcAnonFieldDecl cenv env parent tpenv nm (Field(Attributes attribs, isStatic, idOpt, ty, isMutable, xmldoc, vis, m)) = let id = (match idOpt with None -> mkSynId m nm | Some id -> id) let f = TcFieldDecl cenv env parent false tpenv (isStatic, attribs, id, idOpt.IsNone, ty, isMutable, xmldoc.ToXmlDoc(), vis, m) match idOpt with @@ -12416,7 +12416,7 @@ module TcRecdUnionAndEnumDeclarations = begin f - let TcNamedFieldDecl cenv env parent isIncrClass tpenv (Field(attribs, isStatic, id, ty, isMutable, xmldoc, vis, m)) = + let TcNamedFieldDecl cenv env parent isIncrClass tpenv (Field(Attributes attribs, isStatic, id, ty, isMutable, xmldoc, vis, m)) = match id with | None -> error (Error(FSComp.SR.tcFieldRequiresName(), m)) | Some id -> TcFieldDecl cenv env parent isIncrClass tpenv (isStatic, attribs, id, false, ty, isMutable, xmldoc.ToXmlDoc(), vis, m) @@ -12453,7 +12453,7 @@ module TcRecdUnionAndEnumDeclarations = begin | _ -> seen.Add(f.Name, sf) - let TcUnionCaseDecl cenv env parent thisTy tpenv (UnionCase (synAttrs, id, args, xmldoc, vis, m)) = + let TcUnionCaseDecl cenv env parent thisTy tpenv (UnionCase(Attributes synAttrs, id, args, xmldoc, vis, m)) = let attrs = TcAttributes cenv env AttributeTargets.UnionCaseDecl synAttrs // the attributes of a union case decl get attached to the generated "static factory" method let vis, _ = ComputeAccessAndCompPath env None m vis None parent let vis = CombineReprAccess parent vis @@ -12490,7 +12490,7 @@ module TcRecdUnionAndEnumDeclarations = begin let unionCases' = unionCases |> List.map (TcUnionCaseDecl cenv env parent thisTy tpenv) unionCases' |> CheckDuplicates (fun uc -> uc.Id) "union case" - let TcEnumDecl cenv env parent thisTy fieldTy (EnumCase (synAttrs, id, v, xmldoc, m)) = + let TcEnumDecl cenv env parent thisTy fieldTy (EnumCase(Attributes synAttrs, id, v, xmldoc, m)) = let attrs = TcAttributes cenv env AttributeTargets.Field synAttrs match v with | SynConst.Bytes _ @@ -13556,7 +13556,7 @@ module MutRecBindingChecking = error(Error(FSComp.SR.tcEnumerationsMayNotHaveMembers(), (trimRangeToLine m))) match classMemberDef, containerInfo with - | SynMemberDefn.ImplicitCtor (vis, attrs, spats, thisIdOpt, m), ContainerInfo(_, Some(MemberOrValContainerInfo(tcref, _, baseValOpt, safeInitInfo, _))) -> + | SynMemberDefn.ImplicitCtor (vis, Attributes attrs, spats, thisIdOpt, m), ContainerInfo(_, Some(MemberOrValContainerInfo(tcref, _, baseValOpt, safeInitInfo, _))) -> if tcref.TypeOrMeasureKind = TyparKind.Measure then error(Error(FSComp.SR.tcMeasureDeclarationsRequireStaticMembers(), m)) @@ -14810,7 +14810,7 @@ let CheckForDuplicateModule env nm m = /// Check 'exception' declarations in implementations and signatures module TcExceptionDeclarations = - let TcExnDefnCore_Phase1A cenv env parent (SynExceptionDefnRepr(synAttrs, UnionCase(_, id, _, _, _, _), _, doc, vis, m)) = + let TcExnDefnCore_Phase1A cenv env parent (SynExceptionDefnRepr(Attributes synAttrs, UnionCase(_, id, _, _, _, _), _, doc, vis, m)) = let attrs = TcAttributes cenv env AttributeTargets.ExnDecl synAttrs if not (String.isUpper id.idText) then errorR(NotUpperCaseConstructor m) let vis, cpath = ComputeAccessAndCompPath env None m vis None parent @@ -15075,7 +15075,7 @@ module EstablishTypeDefinitionCores = |> set let TcTyconDefnCore_Phase1A_BuildInitialModule cenv envInitial parent typeNames compInfo decls = - let (ComponentInfo(attribs, _parms, _constraints, longPath, xml, _, vis, im)) = compInfo + let (ComponentInfo(Attributes attribs, _parms, _constraints, longPath, xml, _, vis, im)) = compInfo let id = ComputeModuleName longPath let modAttrs = TcAttributes cenv envInitial AttributeTargets.ModuleDecl attribs let modKind = ComputeModuleOrNamespaceKind cenv.g true typeNames modAttrs id.idText @@ -15146,7 +15146,7 @@ module EstablishTypeDefinitionCores = /// synTyconInfo: Syntactic AST for the name, attributes etc. of the type constructor /// synTyconRepr: Syntactic AST for the RHS of the type definition let private TcTyconDefnCore_Phase1B_EstablishBasicKind cenv inSig envinner (MutRecDefnsPhase1DataForTycon(synTyconInfo, synTyconRepr, _, _, _, _)) (tycon: Tycon) = - let (ComponentInfo(synAttrs, typars, _, _, _, _, _, _)) = synTyconInfo + let (ComponentInfo(Attributes synAttrs, typars, _, _, _, _, _, _)) = synTyconInfo let m = tycon.Range let id = tycon.Id @@ -16520,7 +16520,7 @@ module TcDeclarations = // Convert autoproperties to let bindings in the pre-list let rec preAutoProps memb = match memb with - | SynMemberDefn.AutoProperty (attribs, isStatic, id, tyOpt, propKind, _, xmlDoc, _access, synExpr, _mGetSet, mWholeAutoProp) -> + | SynMemberDefn.AutoProperty(Attributes attribs, isStatic, id, tyOpt, propKind, _, xmlDoc, _access, synExpr, _mGetSet, mWholeAutoProp) -> // Only the keep the field-targeted attributes let attribs = attribs |> List.filter (fun a -> match a.Target with Some t when t.idText = "field" -> true | _ -> false) let mLetPortion = synExpr.Range @@ -16532,6 +16532,7 @@ module TcDeclarations = | MemberKind.PropertySet | MemberKind.PropertyGetSet -> true | _ -> false + let attribs = mkAttributeList attribs mWholeAutoProp let binding = mkSynBinding (xmlDoc, headPat) (None, false, isMutable, mLetPortion, NoSequencePointAtInvisibleBinding, retInfo, synExpr, synExpr.Range, [], attribs, None) [(SynMemberDefn.LetBindings ([binding], isStatic, false, mWholeAutoProp))] @@ -16546,7 +16547,7 @@ module TcDeclarations = // Convert autoproperties to member bindings in the post-list let rec postAutoProps memb = match memb with - | SynMemberDefn.AutoProperty (attribs, isStatic, id, tyOpt, propKind, memberFlags, xmlDoc, access, _synExpr, mGetSetOpt, _mWholeAutoProp) -> + | SynMemberDefn.AutoProperty(Attributes attribs, isStatic, id, tyOpt, propKind, memberFlags, xmlDoc, access, _synExpr, mGetSetOpt, _mWholeAutoProp) -> let mMemberPortion = id.idRange // Only the keep the non-field-targeted attributes let attribs = attribs |> List.filter (fun a -> match a.Target with Some t when t.idText = "field" -> false | _ -> true) @@ -16566,6 +16567,7 @@ module TcDeclarations = let getter = let rhsExpr = SynExpr.Ident fldId let retInfo = match tyOpt with None -> None | Some ty -> Some (SynReturnInfo((ty, SynInfo.unnamedRetVal), ty.Range)) + let attribs = mkAttributeList attribs mMemberPortion let binding = mkSynBinding (xmlDoc, headPat) (access, false, false, mMemberPortion, NoSequencePointAtInvisibleBinding, retInfo, rhsExpr, rhsExpr.Range, [], attribs, Some (memberFlags MemberKind.Member)) SynMemberDefn.Member (binding, mMemberPortion) yield getter @@ -16870,7 +16872,7 @@ let rec TcSignatureElementNonMutRec cenv parent typeNames endm (env: TcEnv) synS let env = List.foldBack (AddLocalVal cenv.tcSink scopem) idvs env return env - | SynModuleSigDecl.NestedModule(ComponentInfo(attribs, _parms, _constraints, longPath, xml, _, vis, im) as compInfo, isRec, mdefs, m) -> + | SynModuleSigDecl.NestedModule(ComponentInfo(Attributes attribs, _parms, _constraints, longPath, xml, _, vis, im) as compInfo, isRec, mdefs, m) -> if isRec then // Treat 'module rec M = ...' as a single mutually recursive definition group 'module M = ...' let modDecl = SynModuleSigDecl.NestedModule(compInfo, false, mdefs, m) @@ -17175,7 +17177,7 @@ let rec TcModuleOrNamespaceElementNonMutRec (cenv: cenv) parent typeNames scopem | SynModuleDecl.DoExpr _ -> return! failwith "unreachable" - | SynModuleDecl.Attributes (synAttrs, _) -> + | SynModuleDecl.Attributes (Attributes synAttrs, _) -> let attrs, _ = TcAttributesWithPossibleTargets false cenv env AttributeTargets.Top synAttrs return ((fun e -> e), attrs), env, env @@ -17190,7 +17192,7 @@ let rec TcModuleOrNamespaceElementNonMutRec (cenv: cenv) parent typeNames scopem let modDecl = SynModuleDecl.NestedModule(compInfo, false, mdefs, isContinuingModule, m) return! TcModuleOrNamespaceElementsMutRec cenv parent typeNames m env None [modDecl] else - let (ComponentInfo(attribs, _parms, _constraints, longPath, xml, _, vis, im)) = compInfo + let (ComponentInfo(Attributes attribs, _parms, _constraints, longPath, xml, _, vis, im)) = compInfo let id = ComputeModuleName longPath let modAttrs = TcAttributes cenv env AttributeTargets.ModuleDecl attribs @@ -17327,7 +17329,7 @@ and TcModuleOrNamespaceElementsMutRec cenv parent typeNames endm envInitial mutR let m = match defs with [] -> endm | _ -> defs |> List.map (fun d -> d.Range) |> List.reduce unionRanges let scopem = (defs, endm) ||> List.foldBack (fun h m -> unionRanges h.Range m) - let (mutRecDefns, (_, _, synAttrs)) = + let (mutRecDefns, (_, _, Attributes synAttrs)) = let rec loop isNamespace attrs defs: (MutRecDefnsInitialData * _) = ((true, true, attrs), defs) ||> List.collectFold (fun (openOk, moduleAbbrevOk, attrs) def -> match ElimModuleDoBinding def with diff --git a/src/fsharp/ast.fs b/src/fsharp/ast.fs index 94f4022621..ea8a060ad3 100644 --- a/src/fsharp/ast.fs +++ b/src/fsharp/ast.fs @@ -1172,7 +1172,13 @@ and | None -> unionRanges e.Range m | Some x -> unionRanges (unionRanges e.Range m) x.Range -and SynAttributes = SynAttribute list +and + /// List of attributes enclosed in [< ... >]. + SynAttributeList = + { Attributes: SynAttribute list + Range: range } + +and SynAttributes = SynAttributeList list and [] @@ -2118,6 +2124,18 @@ type SynExpr with type SynReturnInfo = SynReturnInfo of (SynType * SynArgInfo) * range: range +let mkAttributeList attrs range = + [{ Attributes = attrs + Range = range }] + +let ConcatAttributesLists (attrsLists: SynAttributeList list) = + attrsLists + |> List.map (fun x -> x.Attributes) + |> List.concat + +let (|Attributes|) synAttributes = + ConcatAttributesLists synAttributes + /// Operations related to the syntactic analysis of arguments of value, function and member definitions and signatures. /// /// Function and member definitions have strongly syntactically constrained arities. We infer @@ -2186,7 +2204,7 @@ module SynInfo = let AritiesOfArgs (SynValInfo(args, _)) = List.map List.length args /// Get the argument attributes from the syntactic information for an argument. - let AttribsOfArgData (SynArgInfo(attribs, _, _)) = attribs + let AttribsOfArgData (SynArgInfo(Attributes attribs, _, _)) = attribs /// Infer the syntactic argument info for a single argument from a simple pattern. let rec InferSynArgInfoFromSimplePat attribs p = diff --git a/src/fsharp/pars.fsy b/src/fsharp/pars.fsy index 453e5c5634..0bd662b7c7 100644 --- a/src/fsharp/pars.fsy +++ b/src/fsharp/pars.fsy @@ -1357,20 +1357,20 @@ attributes: /* One set of custom attributes, including [< ... >] */ -attributeList: - | LBRACK_LESS attributeListElements opt_seps GREATER_RBRACK opt_OBLOCKSEP - { $2 } +attributeList: + | LBRACK_LESS attributeListElements opt_seps GREATER_RBRACK opt_OBLOCKSEP + { mkAttributeList $2 (rhs2 parseState 1 3) } - | LBRACK_LESS error GREATER_RBRACK opt_OBLOCKSEP - { [] } + | LBRACK_LESS error GREATER_RBRACK opt_OBLOCKSEP + { mkAttributeList [] (rhs2 parseState 1 3) } - | LBRACK_LESS attributeListElements opt_seps ends_coming_soon_or_recover + | LBRACK_LESS attributeListElements opt_seps ends_coming_soon_or_recover { if not $4 then reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedLBrackLess()) - $2 } + mkAttributeList $2 (rhs2 parseState 1 2) } - | LBRACK_LESS ends_coming_soon_or_recover + | LBRACK_LESS ends_coming_soon_or_recover { if not $2 then reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedLBrackLess()) - [] } + mkAttributeList [] (rhs parseState 1) } /* One set of custom attributes, not including [< ... >] */ @@ -1644,7 +1644,10 @@ memberCore: let optInline = $1 || optInline // optional attributes are only applied to getters and setters // the "top level" attrs will be applied to both - let optAttrs = optAttrs |> List.map (fun (a:SynAttribute) -> { a with AppliesToGetterAndSetter=true }) + let optAttrs = + optAttrs |> List.map (fun attrList -> + { attrList with Attributes = attrList.Attributes |> List.map (fun a -> { a with AppliesToGetterAndSetter = true } ) }) + let attrs = attrs @ optAttrs let binding = bindingBuilder (visNoLongerUsed,optInline,isMutable,mBindLhs,NoSequencePointAtInvisibleBinding,optReturnType,expr,exprm,[],attrs,Some (memFlagsBuilder MemberKind.Member)) diff --git a/src/fsharp/service/ServiceAssemblyContent.fs b/src/fsharp/service/ServiceAssemblyContent.fs index 67a7cc7e8d..dd1e344bbd 100644 --- a/src/fsharp/service/ServiceAssemblyContent.fs +++ b/src/fsharp/service/ServiceAssemblyContent.fs @@ -529,7 +529,7 @@ module ParsedInput = let rec walkImplFileInput (ParsedImplFileInput (modules = moduleOrNamespaceList)) = List.iter walkSynModuleOrNamespace moduleOrNamespaceList - and walkSynModuleOrNamespace (SynModuleOrNamespace(_, _, _, decls, _, attrs, _, _)) = + and walkSynModuleOrNamespace (SynModuleOrNamespace(_, _, _, decls, _, Attributes attrs, _, _)) = List.iter walkAttribute attrs List.iter walkSynModuleDecl decls @@ -537,7 +537,7 @@ module ParsedInput = addLongIdentWithDots attr.TypeName walkExpr attr.ArgExpr - and walkTyparDecl (SynTyparDecl.TyparDecl (attrs, typar)) = + and walkTyparDecl (SynTyparDecl.TyparDecl (Attributes attrs, typar)) = List.iter walkAttribute attrs walkTypar typar @@ -564,7 +564,7 @@ module ParsedInput = | SynPat.Typed (pat, t, _) -> walkPat pat walkType t - | SynPat.Attrib (pat, attrs, _) -> + | SynPat.Attrib (pat, Attributes attrs, _) -> walkPat pat List.iter walkAttribute attrs | SynPat.Or (pat1, pat2, _) -> List.iter walkPat [pat1; pat2] @@ -582,7 +582,7 @@ module ParsedInput = and walkTypar (Typar (_, _, _)) = () - and walkBinding (SynBinding.Binding (_, _, _, _, attrs, _, _, pat, returnInfo, e, _, _)) = + and walkBinding (SynBinding.Binding (_, _, _, _, Attributes attrs, _, _, pat, returnInfo, e, _, _)) = List.iter walkAttribute attrs walkPat pat walkExpr e @@ -726,7 +726,7 @@ module ParsedInput = | SynMeasure.Anon _ -> () and walkSimplePat = function - | SynSimplePat.Attrib (pat, attrs, _) -> + | SynSimplePat.Attrib (pat, Attributes attrs, _) -> walkSimplePat pat List.iter walkAttribute attrs | SynSimplePat.Typed(pat, t, _) -> @@ -734,15 +734,15 @@ module ParsedInput = walkType t | _ -> () - and walkField (SynField.Field(attrs, _, _, t, _, _, _, _)) = + and walkField (SynField.Field(Attributes attrs, _, _, t, _, _, _, _)) = List.iter walkAttribute attrs walkType t - and walkValSig (SynValSig.ValSpfn(attrs, _, _, t, SynValInfo(argInfos, argInfo), _, _, _, _, _, _)) = + and walkValSig (SynValSig.ValSpfn(Attributes attrs, _, _, t, SynValInfo(argInfos, argInfo), _, _, _, _, _, _)) = List.iter walkAttribute attrs walkType t argInfo :: (argInfos |> List.concat) - |> List.map (fun (SynArgInfo(attrs, _, _)) -> attrs) + |> List.map (fun (SynArgInfo(Attributes attrs, _, _)) -> attrs) |> List.concat |> List.iter walkAttribute @@ -765,7 +765,7 @@ module ParsedInput = and walkMember = function | SynMemberDefn.AbstractSlot (valSig, _, _) -> walkValSig valSig | SynMemberDefn.Member (binding, _) -> walkBinding binding - | SynMemberDefn.ImplicitCtor (_, attrs, pats, _, _) -> + | SynMemberDefn.ImplicitCtor (_, Attributes attrs, pats, _, _) -> List.iter walkAttribute attrs List.iter walkSimplePat pats | SynMemberDefn.ImplicitInherit (t, e, _, _) -> walkType t; walkExpr e @@ -776,19 +776,19 @@ module ParsedInput = | SynMemberDefn.Inherit (t, _, _) -> walkType t | SynMemberDefn.ValField (field, _) -> walkField field | SynMemberDefn.NestedType (tdef, _, _) -> walkTypeDefn tdef - | SynMemberDefn.AutoProperty (attrs, _, _, t, _, _, _, _, e, _, _) -> + | SynMemberDefn.AutoProperty (Attributes attrs, _, _, t, _, _, _, _, e, _, _) -> List.iter walkAttribute attrs Option.iter walkType t walkExpr e | _ -> () - and walkEnumCase (EnumCase(attrs, _, _, _, _)) = List.iter walkAttribute attrs + and walkEnumCase (EnumCase(Attributes attrs, _, _, _, _)) = List.iter walkAttribute attrs and walkUnionCaseType = function | SynUnionCaseType.UnionCaseFields fields -> List.iter walkField fields | SynUnionCaseType.UnionCaseFullType (t, _) -> walkType t - and walkUnionCase (SynUnionCase.UnionCase (attrs, _, t, _, _, _)) = + and walkUnionCase (SynUnionCase.UnionCase (Attributes attrs, _, t, _, _, _)) = List.iter walkAttribute attrs walkUnionCaseType t @@ -799,7 +799,7 @@ module ParsedInput = | SynTypeDefnSimpleRepr.TypeAbbrev (_, t, _) -> walkType t | _ -> () - and walkComponentInfo isTypeExtensionOrAlias (ComponentInfo(attrs, typars, constraints, longIdent, _, _, _, _)) = + and walkComponentInfo isTypeExtensionOrAlias (ComponentInfo(Attributes attrs, typars, constraints, longIdent, _, _, _, _)) = List.iter walkAttribute attrs List.iter walkTyparDecl typars List.iter walkTypeConstraint constraints @@ -836,7 +836,7 @@ module ParsedInput = | SynModuleDecl.Let (_, bindings, _) -> List.iter walkBinding bindings | SynModuleDecl.DoExpr (_, expr, _) -> walkExpr expr | SynModuleDecl.Types (types, _) -> List.iter walkTypeDefn types - | SynModuleDecl.Attributes (attrs, _) -> List.iter walkAttribute attrs + | SynModuleDecl.Attributes (Attributes attrs, _) -> List.iter walkAttribute attrs | _ -> () match input with diff --git a/src/fsharp/service/ServiceStructure.fs b/src/fsharp/service/ServiceStructure.fs index 1f35e9e8ce..1bf31e27cf 100644 --- a/src/fsharp/service/ServiceStructure.fs +++ b/src/fsharp/service/ServiceStructure.fs @@ -405,7 +405,7 @@ module Structure = rcheck Scope.MatchClause Collapse.Same e.Range collapse parseExpr e - and parseAttributes (attrs: SynAttributes) = + and parseAttributes (Attributes attrs) = let attrListRange() = if not (List.isEmpty attrs) then let range = Range.startToEnd (attrs.[0].Range) (attrs.[attrs.Length-1].ArgExpr.Range) diff --git a/src/fsharp/service/ServiceUntypedParse.fs b/src/fsharp/service/ServiceUntypedParse.fs index 4e5b1e596f..d7c8e302d4 100755 --- a/src/fsharp/service/ServiceUntypedParse.fs +++ b/src/fsharp/service/ServiceUntypedParse.fs @@ -723,7 +723,7 @@ module UntypedParseImpl = let rec walkImplFileInput (ParsedImplFileInput (modules = moduleOrNamespaceList)) = List.tryPick (walkSynModuleOrNamespace true) moduleOrNamespaceList - and walkSynModuleOrNamespace isTopLevel (SynModuleOrNamespace(_, _, _, decls, _, attrs, _, r)) = + and walkSynModuleOrNamespace isTopLevel (SynModuleOrNamespace(_, _, _, decls, _, Attributes attrs, _, r)) = List.tryPick walkAttribute attrs |> Option.orElse (ifPosInRange r (fun _ -> List.tryPick (walkSynModuleDecl isTopLevel) decls)) @@ -733,7 +733,7 @@ module UntypedParseImpl = and walkTypar (Typar (ident, _, _)) = ifPosInRange ident.idRange (fun _ -> Some EntityKind.Type) - and walkTyparDecl (SynTyparDecl.TyparDecl (attrs, typar)) = + and walkTyparDecl (SynTyparDecl.TyparDecl (Attributes attrs, typar)) = List.tryPick walkAttribute attrs |> Option.orElse (walkTypar typar) @@ -757,7 +757,7 @@ module UntypedParseImpl = if isPosInRange nameRange then None else walkPat pat | SynPat.Typed(pat, t, _) -> walkPat pat |> Option.orElse (walkType t) - | SynPat.Attrib(pat, attrs, _) -> walkPat pat |> Option.orElse (List.tryPick walkAttribute attrs) + | SynPat.Attrib(pat, Attributes attrs, _) -> walkPat pat |> Option.orElse (List.tryPick walkAttribute attrs) | SynPat.Or(pat1, pat2, _) -> List.tryPick walkPat [pat1; pat2] | SynPat.LongIdent(_, _, typars, ConstructorPats pats, _, r) -> ifPosInRange r (fun _ -> kind) @@ -776,7 +776,7 @@ module UntypedParseImpl = and walkPat = walkPatWithKind None - and walkBinding (SynBinding.Binding(_, _, _, _, attrs, _, _, pat, returnInfo, e, _, _)) = + and walkBinding (SynBinding.Binding(_, _, _, _, Attributes attrs, _, _, pat, returnInfo, e, _, _)) = List.tryPick walkAttribute attrs |> Option.orElse (walkPat pat) |> Option.orElse (walkExpr e) @@ -892,15 +892,15 @@ module UntypedParseImpl = and walkExpr = walkExprWithKind None and walkSimplePat = function - | SynSimplePat.Attrib (pat, attrs, _) -> + | SynSimplePat.Attrib (pat, Attributes attrs, _) -> walkSimplePat pat |> Option.orElse (List.tryPick walkAttribute attrs) | SynSimplePat.Typed(pat, t, _) -> walkSimplePat pat |> Option.orElse (walkType t) | _ -> None - and walkField (SynField.Field(attrs, _, _, t, _, _, _, _)) = + and walkField (SynField.Field(Attributes attrs, _, _, t, _, _, _, _)) = List.tryPick walkAttribute attrs |> Option.orElse (walkType t) - and walkValSig (SynValSig.ValSpfn(attrs, _, _, t, _, _, _, _, _, _, _)) = + and walkValSig (SynValSig.ValSpfn(Attributes attrs, _, _, t, _, _, _, _, _, _, _)) = List.tryPick walkAttribute attrs |> Option.orElse (walkType t) and walkMemberSig = function @@ -916,7 +916,7 @@ module UntypedParseImpl = and walkMember = function | SynMemberDefn.AbstractSlot (valSig, _, _) -> walkValSig valSig | SynMemberDefn.Member(binding, _) -> walkBinding binding - | SynMemberDefn.ImplicitCtor(_, attrs, pats, _, _) -> + | SynMemberDefn.ImplicitCtor(_, Attributes attrs, pats, _, _) -> List.tryPick walkAttribute attrs |> Option.orElse (List.tryPick walkSimplePat pats) | SynMemberDefn.ImplicitInherit(t, e, _, _) -> walkType t |> Option.orElse (walkExpr e) | SynMemberDefn.LetBindings(bindings, _, _, _) -> List.tryPick walkBinding bindings @@ -925,19 +925,19 @@ module UntypedParseImpl = | SynMemberDefn.Inherit(t, _, _) -> walkType t | SynMemberDefn.ValField(field, _) -> walkField field | SynMemberDefn.NestedType(tdef, _, _) -> walkTypeDefn tdef - | SynMemberDefn.AutoProperty(attrs, _, _, t, _, _, _, _, e, _, _) -> + | SynMemberDefn.AutoProperty(Attributes attrs, _, _, t, _, _, _, _, e, _, _) -> List.tryPick walkAttribute attrs |> Option.orElse (Option.bind walkType t) |> Option.orElse (walkExpr e) | _ -> None - and walkEnumCase (EnumCase(attrs, _, _, _, _)) = List.tryPick walkAttribute attrs + and walkEnumCase (EnumCase(Attributes attrs, _, _, _, _)) = List.tryPick walkAttribute attrs and walkUnionCaseType = function | SynUnionCaseType.UnionCaseFields fields -> List.tryPick walkField fields | SynUnionCaseType.UnionCaseFullType(t, _) -> walkType t - and walkUnionCase (UnionCase(attrs, _, t, _, _, _)) = + and walkUnionCase (UnionCase(Attributes attrs, _, t, _, _, _)) = List.tryPick walkAttribute attrs |> Option.orElse (walkUnionCaseType t) and walkTypeDefnSimple = function @@ -947,7 +947,7 @@ module UntypedParseImpl = | SynTypeDefnSimpleRepr.TypeAbbrev(_, t, _) -> walkType t | _ -> None - and walkComponentInfo isModule (ComponentInfo(attrs, typars, constraints, _, _, _, _, r)) = + and walkComponentInfo isModule (ComponentInfo(Attributes attrs, typars, constraints, _, _, _, _, r)) = if isModule then None else ifPosInRange r (fun _ -> Some EntityKind.Type) |> Option.orElse ( List.tryPick walkAttribute attrs @@ -1051,7 +1051,7 @@ module UntypedParseImpl = | false, false, true -> Struct | _ -> Invalid - let GetCompletionContextForInheritSynMember ((ComponentInfo(synAttributes, _, _, _, _, _, _, _)), typeDefnKind : SynTypeDefnKind, completionPath) = + let GetCompletionContextForInheritSynMember ((ComponentInfo(Attributes synAttributes, _, _, _, _, _, _, _)), typeDefnKind : SynTypeDefnKind, completionPath) = let success k = Some (CompletionContext.Inherit (k, completionPath)) diff --git a/tests/service/ServiceUntypedParseTests.fs b/tests/service/ServiceUntypedParseTests.fs index 24c55cee89..ac4e156561 100644 --- a/tests/service/ServiceUntypedParseTests.fs +++ b/tests/service/ServiceUntypedParseTests.fs @@ -7,14 +7,13 @@ module Tests.Service.ServiceUntypedParseTests #endif -open System open System.IO -open System.Text -open NUnit.Framework +open FsUnit +open FSharp.Compiler.Ast open FSharp.Compiler.Range open FSharp.Compiler.SourceCodeServices open FSharp.Compiler.Service.Tests.Common -open Tests.Service +open NUnit.Framework let [] private Marker = "(* marker *)" @@ -99,4 +98,54 @@ type T = %s type T = { F: int } -""" lineStr) => (if expectAttributeApplicationContext then Some CompletionContext.AttributeApplication else None) \ No newline at end of file +""" lineStr) => (if expectAttributeApplicationContext then Some CompletionContext.AttributeApplication else None) + + + +[] +let ``Attribute lists`` () = + let source = """ +[] +let foo1 = () + +[] +[] +let foo2 = () + +[] [] +let foo3 = () + +[] +let foo7 = () +""" + match parseSourceCode ("test", source) with + | Some (ParsedInput.ImplFile (ParsedImplFileInput (_,_,_,_,_,[SynModuleOrNamespace (_,_,_,decls,_,_,_,_)],_))) -> + decls |> List.map (fun decl -> + match decl with + | SynModuleDecl.Let (_,[Binding(_,_,_,_,attributeLists,_,_,_,_,_,_,_)],_) -> + attributeLists |> List.map (fun list -> + let r = list.Range + + list.Attributes.Length, + ((r.StartLine, r.StartColumn), (r.EndLine, r.EndColumn))) + + | _ -> failwith "Could not get binding") + |> shouldEqual + [ [ (1, ((2, 0), (2, 5))) ] + [ (1, ((5, 0), (5, 5))); (2, ((6, 0), (6, 7))) ] + [ (1, ((9, 0), (9, 5))); (2, ((9, 6), (9, 13))) ] + [ (1, ((12, 0), (13, 0))) ] + [ (1, ((15, 0), (15, 4))) ] + [ (0, ((18, 0), (18, 2))) ] + [ (0, ((21, 0), (21, 4))) ] ] + + | _ -> failwith "Could not get module decls" From c036b35aafc4149fd36949fefab6dabf6992426c Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Sun, 2 Jun 2019 10:48:08 +0300 Subject: [PATCH 079/159] Make FSharpAccessibility.IsProtected public, optimize IsPublic property (#6847) --- src/fsharp/symbols/Symbols.fs | 2 +- src/fsharp/symbols/Symbols.fsi | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/fsharp/symbols/Symbols.fs b/src/fsharp/symbols/Symbols.fs index d80beda39c..f6b93d4e32 100644 --- a/src/fsharp/symbols/Symbols.fs +++ b/src/fsharp/symbols/Symbols.fs @@ -34,7 +34,7 @@ type FSharpAccessibility(a:Accessibility, ?isProtected) = | _ when List.forall isInternalCompPath p -> Internal | _ -> Private - member __.IsPublic = not isProtected && match a with Public -> true | _ -> false + member __.IsPublic = not isProtected && match a with TAccess [] -> true | _ -> false member __.IsPrivate = not isProtected && match a with Private -> true | _ -> false diff --git a/src/fsharp/symbols/Symbols.fsi b/src/fsharp/symbols/Symbols.fsi index bd5e0b188d..c8580fedf3 100644 --- a/src/fsharp/symbols/Symbols.fsi +++ b/src/fsharp/symbols/Symbols.fsi @@ -25,17 +25,20 @@ type internal SymbolEnv = type public FSharpAccessibility = internal new: Accessibility * ?isProtected: bool -> FSharpAccessibility - /// Indicates the symbol has public accessibility - member IsPublic : bool + /// Indicates the symbol has public accessibility. + member IsPublic: bool - /// Indicates the symbol has private accessibility - member IsPrivate : bool + /// Indicates the symbol has private accessibility. + member IsPrivate: bool - /// Indicates the symbol has internal accessibility - member IsInternal : bool + /// Indicates the symbol has internal accessibility. + member IsInternal: bool + + /// Indicates the symbol has protected accessibility. + member IsProtected: bool /// The underlying Accessibility - member internal Contents : Accessibility + member internal Contents: Accessibility /// Represents the information needed to format types and other information in a style From ad5f69e41a45b23e348e1836b1a8496c857381eb Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Sun, 2 Jun 2019 21:25:12 +0300 Subject: [PATCH 080/159] Replace SynSimplePat list with SynSimplePats in ImplicitCtor (#6845) * Replace SynSimplePat list with SynSimplePats in ImplicitCtor * Use SynSimplePats in SynTypeDefnSimpleRepr.General during type check --- src/fsharp/TypeChecker.fs | 10 ++-- src/fsharp/ast.fs | 4 +- src/fsharp/pars.fsy | 63 ++++++++++++-------- src/fsharp/service/ServiceAssemblyContent.fs | 4 +- src/fsharp/service/ServiceParseTreeWalk.fs | 6 +- src/fsharp/service/ServiceUntypedParse.fs | 4 +- 6 files changed, 53 insertions(+), 38 deletions(-) diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index 1e261af3d5..a2ffbcf172 100644 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -13556,7 +13556,7 @@ module MutRecBindingChecking = error(Error(FSComp.SR.tcEnumerationsMayNotHaveMembers(), (trimRangeToLine m))) match classMemberDef, containerInfo with - | SynMemberDefn.ImplicitCtor (vis, Attributes attrs, spats, thisIdOpt, m), ContainerInfo(_, Some(MemberOrValContainerInfo(tcref, _, baseValOpt, safeInitInfo, _))) -> + | SynMemberDefn.ImplicitCtor (vis, Attributes attrs, SynSimplePats.SimplePats(spats, _), thisIdOpt, m), ContainerInfo(_, Some(MemberOrValContainerInfo(tcref, _, baseValOpt, safeInitInfo, _))) -> if tcref.TypeOrMeasureKind = TyparKind.Measure then error(Error(FSComp.SR.tcMeasureDeclarationsRequireStaticMembers(), m)) @@ -15016,7 +15016,7 @@ module EstablishTypeDefinitionCores = match implicitCtorSynPats with | None -> () | Some spats -> - let ctorArgNames, (_, names, _) = TcSimplePatsOfUnknownType cenv true NoCheckCxs env tpenv (SynSimplePats.SimplePats (spats, m)) + let ctorArgNames, (_, names, _) = TcSimplePatsOfUnknownType cenv true NoCheckCxs env tpenv spats for arg in ctorArgNames do let ty = names.[arg].Type let m = names.[arg].Ident.idRange @@ -15816,7 +15816,7 @@ module EstablishTypeDefinitionCores = () | Some spats -> if tycon.IsFSharpStructOrEnumTycon then - let ctorArgNames, (_, names, _) = TcSimplePatsOfUnknownType cenv true CheckCxs envinner tpenv (SynSimplePats.SimplePats (spats, m)) + let ctorArgNames, (_, names, _) = TcSimplePatsOfUnknownType cenv true CheckCxs envinner tpenv spats for arg in ctorArgNames do let ty = names.[arg].Type let id = names.[arg].Ident @@ -16621,7 +16621,7 @@ module TcDeclarations = let implicitCtorSynPats = members |> List.tryPick (function - | SynMemberDefn.ImplicitCtor (_, _, spats, _, _) -> Some spats + | SynMemberDefn.ImplicitCtor (_, _, (SynSimplePats.SimplePats _ as spats), _, _) -> Some spats | _ -> None) // An ugly bit of code to pre-determine if a type has a nullary constructor, prior to establishing the @@ -16630,7 +16630,7 @@ module TcDeclarations = members |> List.exists (function | SynMemberDefn.Member(Binding(_, _, _, _, _, _, SynValData(Some memberFlags, _, _), SynPatForConstructorDecl SynPatForNullaryArgs, _, _, _, _), _) -> memberFlags.MemberKind=MemberKind.Constructor - | SynMemberDefn.ImplicitCtor (_, _, spats, _, _) -> isNil spats + | SynMemberDefn.ImplicitCtor (_, _, SynSimplePats.SimplePats(spats, _), _, _) -> isNil spats | _ -> false) let repr = SynTypeDefnSimpleRepr.General(kind, inherits, slotsigs, fields, isConcrete, isIncrClass, implicitCtorSynPats, m) let isAtOriginalTyconDefn = not (isAugmentationTyconDefnRepr repr) diff --git a/src/fsharp/ast.fs b/src/fsharp/ast.fs index ea8a060ad3..3c341131fb 100644 --- a/src/fsharp/ast.fs +++ b/src/fsharp/ast.fs @@ -1310,7 +1310,7 @@ and /// An object oriented type definition. This is not a parse-tree form, but represents the core /// type representation which the type checker splits out from the "ObjectModel" cases of type definitions. - | General of SynTypeDefnKind * (SynType * range * Ident option) list * (SynValSig * MemberFlags) list * SynField list * bool * bool * SynSimplePat list option * range: range + | General of SynTypeDefnKind * (SynType * range * Ident option) list * (SynValSig * MemberFlags) list * SynField list * bool * bool * SynSimplePats option * range: range /// A type defined by using an IL assembly representation. Only used in FSharp.Core. /// @@ -1525,7 +1525,7 @@ and | Member of memberDefn: SynBinding * range: range /// implicit ctor args as a defn line, 'as' specification - | ImplicitCtor of accessiblity: SynAccess option * attributes: SynAttributes * ctorArgs: SynSimplePat list * selfIdentifier: Ident option * range: range + | ImplicitCtor of accessiblity: SynAccess option * attributes: SynAttributes * ctorArgs: SynSimplePats * selfIdentifier: Ident option * range: range /// inherit (args...) as base | ImplicitInherit of inheritType: SynType * inheritArgs: SynExpr * inheritAlias: Ident option * range: range diff --git a/src/fsharp/pars.fsy b/src/fsharp/pars.fsy index 0bd662b7c7..56e6dbfb40 100644 --- a/src/fsharp/pars.fsy +++ b/src/fsharp/pars.fsy @@ -2735,38 +2735,51 @@ bindingPattern: { let xmlDoc = grabXmlDoc(parseState,1) mkSynBinding (xmlDoc,$1), rhs parseState 1 } -/* sp = v | sp:typ | attrs sp */ +// Subset of patterns allowed to be used in implicit ctors. +// For a better error recovery we could replace these rules with the actual SynPat parsing +// and use allowed patterns only at a later analysis stage reporting errors along the way. simplePattern: - | ident - { SynSimplePat.Id ($1,None,false,false,false,rhs parseState 1) } - | QMARK ident - { SynSimplePat.Id ($2,None,false,false,true,rhs parseState 2) } + | ident + { let m = rhs parseState 1 + SynPat.Named(SynPat.Wild m, $1, false, None, m) } + | QMARK ident + { SynPat.OptionalVal($2, rhs parseState 2) } | simplePattern COLON typeWithTypeConstraints - { let lhsm = lhs parseState - SynSimplePat.Typed($1,$3,lhsm) } + { SynPat.Typed($1, $3, lhs parseState) } | attributes simplePattern %prec paren_pat_attribs - { let lhsm = lhs parseState - SynSimplePat.Attrib($2,$1,lhsm) } + { SynPat.Attrib($2, $1, lhs parseState) } simplePatternCommaList: - | simplePattern - { [$1] } - | simplePattern COMMA simplePatternCommaList - { $1 :: $3 } + | simplePattern + { $1 } + | simplePattern COMMA simplePatternCommaList + { match $3 with + | SynPat.Tuple(_, pats, _) -> SynPat.Tuple(false, $1 :: pats, rhs2 parseState 1 3) + | _ -> SynPat.Tuple(false, [$1; $3], rhs2 parseState 1 3) } simplePatterns: - | LPAREN simplePatternCommaList rparen - { $2 } - | LPAREN rparen - { [] } - | LPAREN simplePatternCommaList recover - { reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedParen()) - [] } - | LPAREN error rparen - { (* silent recovery *) [] } - | LPAREN recover - { reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedParen()) - [] } + | LPAREN simplePatternCommaList rparen + { let parenPat = SynPat.Paren($2, rhs2 parseState 1 3) + let simplePats, _ = SimplePatsOfPat parseState.SynArgNameGenerator parenPat + simplePats } + | LPAREN rparen + { let pat = SynPat.Const(SynConst.Unit, rhs2 parseState 1 2) + let simplePats, _ = SimplePatsOfPat parseState.SynArgNameGenerator pat + simplePats } + | LPAREN simplePatternCommaList recover + { reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedParen()) + let parenPat = SynPat.Paren(SynPat.Tuple(false, [], rhs2 parseState 1 2), rhs2 parseState 1 2) // todo: report parsed pats anyway? + let simplePats, _ = SimplePatsOfPat parseState.SynArgNameGenerator parenPat + simplePats } + | LPAREN error rparen + { let parenPat = SynPat.Paren(SynPat.Wild(rhs parseState 2), rhs2 parseState 1 3) // silent recovery + let simplePats, _ = SimplePatsOfPat parseState.SynArgNameGenerator parenPat + simplePats } + | LPAREN recover + { reportParseErrorAt (rhs parseState 1) (FSComp.SR.parsUnmatchedParen()) + let pat = SynPat.Wild(lhs parseState) + let simplePats, _ = SimplePatsOfPat parseState.SynArgNameGenerator pat + simplePats } headBindingPattern: diff --git a/src/fsharp/service/ServiceAssemblyContent.fs b/src/fsharp/service/ServiceAssemblyContent.fs index dd1e344bbd..8ceb381225 100644 --- a/src/fsharp/service/ServiceAssemblyContent.fs +++ b/src/fsharp/service/ServiceAssemblyContent.fs @@ -765,9 +765,9 @@ module ParsedInput = and walkMember = function | SynMemberDefn.AbstractSlot (valSig, _, _) -> walkValSig valSig | SynMemberDefn.Member (binding, _) -> walkBinding binding - | SynMemberDefn.ImplicitCtor (_, Attributes attrs, pats, _, _) -> + | SynMemberDefn.ImplicitCtor (_, Attributes attrs, SynSimplePats.SimplePats(simplePats, _), _, _) -> List.iter walkAttribute attrs - List.iter walkSimplePat pats + List.iter walkSimplePat simplePats | SynMemberDefn.ImplicitInherit (t, e, _, _) -> walkType t; walkExpr e | SynMemberDefn.LetBindings (bindings, _, _, _) -> List.iter walkBinding bindings | SynMemberDefn.Interface (t, members, _) -> diff --git a/src/fsharp/service/ServiceParseTreeWalk.fs b/src/fsharp/service/ServiceParseTreeWalk.fs index 55975c6cb5..abd3472a68 100755 --- a/src/fsharp/service/ServiceParseTreeWalk.fs +++ b/src/fsharp/service/ServiceParseTreeWalk.fs @@ -606,8 +606,10 @@ module public AstTraversal = match m with | SynMemberDefn.Open(_longIdent, _range) -> None | SynMemberDefn.Member(synBinding, _range) -> traverseSynBinding path synBinding - | SynMemberDefn.ImplicitCtor(_synAccessOption, _synAttributes, synSimplePatList, _identOption, _range) -> - visitor.VisitSimplePats(synSimplePatList) + | SynMemberDefn.ImplicitCtor(_synAccessOption, _synAttributes, simplePats, _identOption, _range) -> + match simplePats with + | SynSimplePats.SimplePats(simplePats, _) -> visitor.VisitSimplePats(simplePats) + | _ -> None | SynMemberDefn.ImplicitInherit(synType, synExpr, _identOption, range) -> [ dive () synType.Range (fun () -> diff --git a/src/fsharp/service/ServiceUntypedParse.fs b/src/fsharp/service/ServiceUntypedParse.fs index d7c8e302d4..f98fae2f72 100755 --- a/src/fsharp/service/ServiceUntypedParse.fs +++ b/src/fsharp/service/ServiceUntypedParse.fs @@ -916,8 +916,8 @@ module UntypedParseImpl = and walkMember = function | SynMemberDefn.AbstractSlot (valSig, _, _) -> walkValSig valSig | SynMemberDefn.Member(binding, _) -> walkBinding binding - | SynMemberDefn.ImplicitCtor(_, Attributes attrs, pats, _, _) -> - List.tryPick walkAttribute attrs |> Option.orElse (List.tryPick walkSimplePat pats) + | SynMemberDefn.ImplicitCtor(_, Attributes attrs, SynSimplePats.SimplePats(simplePats, _), _, _) -> + List.tryPick walkAttribute attrs |> Option.orElse (List.tryPick walkSimplePat simplePats) | SynMemberDefn.ImplicitInherit(t, e, _, _) -> walkType t |> Option.orElse (walkExpr e) | SynMemberDefn.LetBindings(bindings, _, _, _) -> List.tryPick walkBinding bindings | SynMemberDefn.Interface(t, members, _) -> From 45fed83aaf66eeeba4d9a2de12c418cf9323d503 Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Sun, 2 Jun 2019 11:28:28 -0700 Subject: [PATCH 081/159] Reconfigure Legacy MSBuildReferenceResolver to be API-driven (#6898) * Don't expose Legacy MSBuildReferenceResolver * Move the files boss hoss * Remove unused opens * Fix tests * oopsie doopsie * Do it better * fix * Fix FCS --- ...FSharp.Compiler.Service.MSBuild.v12.fsproj | 2 +- .../FSharp.Compiler.Service.fsproj | 12 ++++----- .../FSharp.Compiler.Private.fsproj | 27 +++++++++++-------- ...r.fs => LegacyMSBuildReferenceResolver.fs} | 5 ++-- src/fsharp/LegacyMSBuildReferenceResolver.fsi | 6 +++++ src/fsharp/fscmain.fs | 2 +- src/fsharp/fsi/fsimain.fs | 2 +- src/fsharp/service/service.fs | 4 +-- .../src/HostedCompilerServer/Program.fs | 2 +- .../LanguageService/FSharpCheckerProvider.fs | 4 +-- .../Salsa/FSharpLanguageServiceTestable.fs | 2 +- .../UnitTests/TestLib.LanguageService.fs | 2 +- vsintegration/tests/UnitTests/Tests.Watson.fs | 3 ++- 13 files changed, 43 insertions(+), 30 deletions(-) rename src/fsharp/{MSBuildReferenceResolver.fs => LegacyMSBuildReferenceResolver.fs} (99%) create mode 100644 src/fsharp/LegacyMSBuildReferenceResolver.fsi 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 9f7b3d20b2..486401ae8b 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 @@ -17,7 +17,7 @@ F#, compiler, msbuild - + Service/MSBuildReferenceResolver.fs diff --git a/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj b/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj index 6b2d04cb62..a83bb51269 100644 --- a/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj +++ b/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj @@ -184,9 +184,6 @@ ErrorLogging/ErrorResolutionHints.fs - - ReferenceResolution/ReferenceResolver.fs - --unicode --lexlib Internal.Utilities.Text.Lexing AbsIL/illex.fsl @@ -267,6 +264,12 @@ AbsIL/ilreflect.fs + + ReferenceResolution/ReferenceResolver.fs + + + ReferenceResolution/SimulatedMSBuildReferenceResolver.fs + CompilerLocation/CompilerLocationUtils.fs @@ -588,9 +591,6 @@ Service/reshapedmsbuild.fs - - Service/SimulatedMSBuildReferenceResolver.fs - Service/ServiceDeclarationLists.fsi diff --git a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj index 50d8b6e9c0..70dfbc51a7 100644 --- a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj +++ b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj @@ -193,10 +193,7 @@ ErrorLogging\ErrorResolutionHints.fs - - - ReferenceResolution\ReferenceResolver.fs - + --unicode --lexlib Internal.Utilities.Text.Lexing AbsIL\illex.fsl @@ -277,6 +274,21 @@ AbsIL\ilreflect.fs + + ReferenceResolution\ReferenceResolver.fs + + + + + ReferenceResolution/LegacyMSBuildReferenceResolver.fsi + + + ReferenceResolution/LegacyMSBuildReferenceResolver.fs + + + + ReferenceResolution/SimulatedMSBuildReferenceResolver.fs + CompilerLocation\CompilerLocationUtils.fs @@ -632,9 +644,6 @@ Service/reshapedmsbuild.fs - - Service/SimulatedMSBuildReferenceResolver.fs - Service/ExternalSymbol.fsi @@ -688,10 +697,6 @@ InteractiveSession/fsi.fs - - - Misc/MSBuildReferenceResolver.fs - Misc/LegacyHostedCompilerForTesting.fs diff --git a/src/fsharp/MSBuildReferenceResolver.fs b/src/fsharp/LegacyMSBuildReferenceResolver.fs similarity index 99% rename from src/fsharp/MSBuildReferenceResolver.fs rename to src/fsharp/LegacyMSBuildReferenceResolver.fs index 1a49c6a0fc..8425f6197b 100644 --- a/src/fsharp/MSBuildReferenceResolver.fs +++ b/src/fsharp/LegacyMSBuildReferenceResolver.fs @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -module internal FSharp.Compiler.MSBuildReferenceResolver +module LegacyMSBuildReferenceResolver open System open System.IO @@ -16,6 +16,7 @@ module internal FSharp.Compiler.MSBuildReferenceResolver open Microsoft.Build.Tasks open Microsoft.Build.Utilities open Microsoft.Build.Framework + open FSharp.Compiler // Reflection wrapper for properties type System.Object with @@ -367,7 +368,7 @@ module internal FSharp.Compiler.MSBuildReferenceResolver resolvedFiles - let Resolver = + let getResolver () = { new ReferenceResolver.Resolver with member __.HighestInstalledNetFrameworkVersion() = HighestInstalledRefAssembliesOrDotNETFramework() member __.DotNetFrameworkReferenceAssembliesRootDirectory = DotNetFrameworkReferenceAssembliesRootDirectory diff --git a/src/fsharp/LegacyMSBuildReferenceResolver.fsi b/src/fsharp/LegacyMSBuildReferenceResolver.fsi new file mode 100644 index 0000000000..1b4aa72858 --- /dev/null +++ b/src/fsharp/LegacyMSBuildReferenceResolver.fsi @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. +module LegacyMSBuildReferenceResolver + +open FSharp.Compiler + +val getResolver: unit -> ReferenceResolver.Resolver \ No newline at end of file diff --git a/src/fsharp/fscmain.fs b/src/fsharp/fscmain.fs index f74c47e0da..73e578f3de 100644 --- a/src/fsharp/fscmain.fs +++ b/src/fsharp/fscmain.fs @@ -62,7 +62,7 @@ module Driver = #if CROSS_PLATFORM_COMPILER SimulatedMSBuildReferenceResolver.SimulatedMSBuildResolver #else - MSBuildReferenceResolver.Resolver + LegacyMSBuildReferenceResolver.getResolver() #endif // This is the only place where ReduceMemoryFlag.No is set. This is because fsc.exe is not a long-running process and diff --git a/src/fsharp/fsi/fsimain.fs b/src/fsharp/fsi/fsimain.fs index 56ab81077c..b49bea9630 100644 --- a/src/fsharp/fsi/fsimain.fs +++ b/src/fsharp/fsi/fsimain.fs @@ -228,7 +228,7 @@ let evaluateSession(argv: string[]) = #if CROSS_PLATFORM_COMPILER SimulatedMSBuildReferenceResolver.SimulatedMSBuildResolver #else - MSBuildReferenceResolver.Resolver + LegacyMSBuildReferenceResolver.getResolver() #endif // Update the configuration to include 'StartServer', WinFormsEventLoop and 'GetOptionalConsoleReadLine()' let rec fsiConfig = diff --git a/src/fsharp/service/service.fs b/src/fsharp/service/service.fs index 1240b7f5bd..3cecd6d172 100644 --- a/src/fsharp/service/service.fs +++ b/src/fsharp/service/service.fs @@ -2944,9 +2944,9 @@ type FSharpChecker(legacyReferenceResolver, projectCacheSize, keepAssemblyConten static member Create(?projectCacheSize, ?keepAssemblyContents, ?keepAllBackgroundResolutions, ?legacyReferenceResolver, ?tryGetMetadataSnapshot, ?suggestNamesForErrors) = let legacyReferenceResolver = - match legacyReferenceResolver with - | None -> SimulatedMSBuildReferenceResolver.GetBestAvailableResolver() + match legacyReferenceResolver with | Some rr -> rr + | None -> SimulatedMSBuildReferenceResolver.GetBestAvailableResolver() let keepAssemblyContents = defaultArg keepAssemblyContents false let keepAllBackgroundResolutions = defaultArg keepAllBackgroundResolutions true diff --git a/tests/fsharpqa/testenv/src/HostedCompilerServer/Program.fs b/tests/fsharpqa/testenv/src/HostedCompilerServer/Program.fs index 440af1b7d7..858382b9f2 100644 --- a/tests/fsharpqa/testenv/src/HostedCompilerServer/Program.fs +++ b/tests/fsharpqa/testenv/src/HostedCompilerServer/Program.fs @@ -25,7 +25,7 @@ type HostedCompilerServer(port) = let (|FscCompile|Unknown|) (message : string) = match message.Split([|MessageDelimiter|], StringSplitOptions.RemoveEmptyEntries) with | [|directory; commandLine|] -> - let legacyReferenceResolver = MSBuildReferenceResolver.Resolver + let legacyReferenceResolver = LegacyMSBuildReferenceResolver.getResolver() let args = CompilerHelpers.parseCommandLine commandLine log <| sprintf "Args parsed as [%s]" (String.Join("] [", args)) log <| sprintf "Dir parsed as [%s]" directory diff --git a/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerProvider.fs b/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerProvider.fs index 209fa4be59..8397825d71 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerProvider.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/FSharpCheckerProvider.fs @@ -56,8 +56,8 @@ type internal FSharpCheckerProvider 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=FSharp.Compiler.MSBuildReferenceResolver.Resolver, + (* , MaxMemory = 2300 *) + legacyReferenceResolver=LegacyMSBuildReferenceResolver.getResolver(), tryGetMetadataSnapshot = tryGetMetadataSnapshot) // This is one half of the bridge between the F# background builder and the Roslyn analysis engine. diff --git a/vsintegration/tests/Salsa/FSharpLanguageServiceTestable.fs b/vsintegration/tests/Salsa/FSharpLanguageServiceTestable.fs index b9fbf322c0..a31777b943 100644 --- a/vsintegration/tests/Salsa/FSharpLanguageServiceTestable.fs +++ b/vsintegration/tests/Salsa/FSharpLanguageServiceTestable.fs @@ -68,7 +68,7 @@ type internal FSharpLanguageServiceTestable() as this = member this.Initialize (sp, dp, prefs, sourceFact) = if this.Unhooked then raise Error.UseOfUnhookedLanguageServiceState artifacts <- Some (ProjectSitesAndFiles()) - let checker = FSharpChecker.Create(legacyReferenceResolver=FSharp.Compiler.MSBuildReferenceResolver.Resolver) + let checker = FSharpChecker.Create(legacyReferenceResolver=LegacyMSBuildReferenceResolver.getResolver()) checker.BeforeBackgroundFileCheck.Add (fun (filename,_) -> UIThread.Run(fun () -> this.NotifyFileTypeCheckStateIsDirty(filename))) checkerContainerOpt <- Some (checker) serviceProvider <- Some sp diff --git a/vsintegration/tests/UnitTests/TestLib.LanguageService.fs b/vsintegration/tests/UnitTests/TestLib.LanguageService.fs index 6ba264252b..f19ecb1ffc 100644 --- a/vsintegration/tests/UnitTests/TestLib.LanguageService.fs +++ b/vsintegration/tests/UnitTests/TestLib.LanguageService.fs @@ -21,7 +21,7 @@ open Microsoft.VisualStudio.FSharp [] module internal Globals = - let checker = FSharpChecker.Create(legacyReferenceResolver=FSharp.Compiler.MSBuildReferenceResolver.Resolver) + let checker = FSharpChecker.Create(legacyReferenceResolver=LegacyMSBuildReferenceResolver.getResolver()) //open Internal.Utilities diff --git a/vsintegration/tests/UnitTests/Tests.Watson.fs b/vsintegration/tests/UnitTests/Tests.Watson.fs index 9cb4b7afa6..db44c89af0 100644 --- a/vsintegration/tests/UnitTests/Tests.Watson.fs +++ b/vsintegration/tests/UnitTests/Tests.Watson.fs @@ -4,6 +4,7 @@ namespace Tests.Compiler.Watson #nowarn "52" // The value has been copied to ensure the original is not mutated +open FSharp.Compiler open FSharp.Compiler.AbstractIL.ILBinaryReader open FSharp.Compiler.AbstractIL.Internal.Library open FSharp.Compiler.CompileOps @@ -33,7 +34,7 @@ type Check = |] let ctok = AssumeCompilationThreadWithoutEvidence () - let _code = mainCompile (ctok, argv, FSharp.Compiler.MSBuildReferenceResolver.Resolver, false, ReduceMemoryFlag.No, CopyFSharpCoreFlag.No, FSharp.Compiler.ErrorLogger.QuitProcessExiter, ConsoleLoggerProvider(), None, None) + let _code = mainCompile (ctok, argv, LegacyMSBuildReferenceResolver.getResolver(), false, ReduceMemoryFlag.No, CopyFSharpCoreFlag.No, FSharp.Compiler.ErrorLogger.QuitProcessExiter, ConsoleLoggerProvider(), None, None) () with | :? 'TException as e -> From 57969f6487323abd5c013b15748ed13aa0f2d11b Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Sun, 2 Jun 2019 16:09:13 -0700 Subject: [PATCH 082/159] Remove IVT to FSharp.Editor (#6930) I'm feeling dangerous doing this with the GitHub UI. --- .../FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj | 1 - 1 file changed, 1 deletion(-) diff --git a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj index 70dfbc51a7..61544622d4 100644 --- a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj +++ b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj @@ -54,7 +54,6 @@ - From 1632239f45c0005650cafc51ee8b7345455cfca5 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Mon, 3 Jun 2019 17:23:16 +0100 Subject: [PATCH 083/159] try align with fsc.fsproj --- src/fsharp/fsi/fsi.fsproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fsharp/fsi/fsi.fsproj b/src/fsharp/fsi/fsi.fsproj index d091baf9f9..cdc65b92dc 100644 --- a/src/fsharp/fsi/fsi.fsproj +++ b/src/fsharp/fsi/fsi.fsproj @@ -29,12 +29,12 @@ - - - + + + - + From 14be76788d84639b8ed11bfcaf3c36d741e4902c Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Mon, 3 Jun 2019 16:51:11 -0600 Subject: [PATCH 084/159] Don't go looking for MSBuild v12 in SimulatedMSBuildReferenceResolver (#6934) --- .../SimulatedMSBuildReferenceResolver.fs | 19 ++----------------- src/fsharp/fsi/fsi.fs | 2 +- src/fsharp/service/service.fs | 2 +- 3 files changed, 4 insertions(+), 19 deletions(-) diff --git a/src/fsharp/SimulatedMSBuildReferenceResolver.fs b/src/fsharp/SimulatedMSBuildReferenceResolver.fs index ef0fdf13c4..8b47ad9bff 100644 --- a/src/fsharp/SimulatedMSBuildReferenceResolver.fs +++ b/src/fsharp/SimulatedMSBuildReferenceResolver.fs @@ -10,11 +10,10 @@ open System open System.IO open System.Reflection open Microsoft.Win32 -open FSharp.Compiler open FSharp.Compiler.ReferenceResolver open FSharp.Compiler.AbstractIL.Internal.Library -let internal SimulatedMSBuildResolver = +let private SimulatedMSBuildResolver = let supportedFrameworks = [| "v4.7.2" "v4.7.1" @@ -183,21 +182,7 @@ let internal SimulatedMSBuildResolver = results.ToArray() } -let internal GetBestAvailableResolver() = -#if !FX_RESHAPED_MSBUILD - let tryMSBuild v = - // Detect if MSBuild is on the machine, if so use the resolver from there - let mb = try Assembly.Load(sprintf "Microsoft.Build.Framework, Version=%s.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" v) |> Option.ofObj with _ -> None - let assembly = mb |> Option.bind (fun _ -> try Assembly.Load(sprintf "FSharp.Compiler.Service.MSBuild.v%s" v) |> Option.ofObj with _ -> None) - let ty = assembly |> Option.bind (fun a -> a.GetType("FSharp.Compiler.MSBuildReferenceResolver") |> Option.ofObj) - let obj = ty |> Option.bind (fun ty -> ty.InvokeMember("get_Resolver", BindingFlags.Static ||| BindingFlags.Public ||| BindingFlags.InvokeMethod ||| BindingFlags.NonPublic, null, null, [| |]) |> Option.ofObj) - let resolver = obj |> Option.bind (fun obj -> match obj with :? Resolver as r -> Some r | _ -> None) - resolver - match tryMSBuild "12" with - | Some r -> r - | None -> -#endif - SimulatedMSBuildResolver +let internal getResolver () = SimulatedMSBuildResolver #if INTERACTIVE diff --git a/src/fsharp/fsi/fsi.fs b/src/fsharp/fsi/fsi.fs index aa1a55f949..02b26bf9af 100644 --- a/src/fsharp/fsi/fsi.fs +++ b/src/fsharp/fsi/fsi.fs @@ -2415,7 +2415,7 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i let legacyReferenceResolver = match legacyReferenceResolver with - | None -> SimulatedMSBuildReferenceResolver.GetBestAvailableResolver() + | None -> SimulatedMSBuildReferenceResolver.getResolver() | Some rr -> rr let tcConfigB = diff --git a/src/fsharp/service/service.fs b/src/fsharp/service/service.fs index 3cecd6d172..26fe8ff758 100644 --- a/src/fsharp/service/service.fs +++ b/src/fsharp/service/service.fs @@ -2946,7 +2946,7 @@ type FSharpChecker(legacyReferenceResolver, projectCacheSize, keepAssemblyConten let legacyReferenceResolver = match legacyReferenceResolver with | Some rr -> rr - | None -> SimulatedMSBuildReferenceResolver.GetBestAvailableResolver() + | None -> SimulatedMSBuildReferenceResolver.getResolver() let keepAssemblyContents = defaultArg keepAssemblyContents false let keepAllBackgroundResolutions = defaultArg keepAllBackgroundResolutions true From 52e08448c92b72f76785c1563e8ef0db965c324b Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 4 Jun 2019 15:35:33 +0100 Subject: [PATCH 085/159] try to fix build --- FSharp.sln | 3 --- 1 file changed, 3 deletions(-) diff --git a/FSharp.sln b/FSharp.sln index c34abdba39..e1c47795e8 100644 --- a/FSharp.sln +++ b/FSharp.sln @@ -16,9 +16,6 @@ EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.Interactive.Settings", "src\fsharp\FSharp.Compiler.Interactive.Settings\FSharp.Compiler.Interactive.Settings.fsproj", "{649FA588-F02E-457C-9FCF-87E46407481E}" EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fsi", "src\fsharp\fsi\fsi.fsproj", "{D0E98C0D-490B-4C61-9329-0862F6E87645}" - ProjectSection(ProjectDependencies) = postProject - {649FA588-F02E-457C-9FCF-87E46407481E} = {649FA588-F02E-457C-9FCF-87E46407481E} - EndProjectSection EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharpSuite.Tests", "tests\fsharp\FSharpSuite.Tests.fsproj", "{C163E892-5BF7-4B59-AA99-B0E8079C67C4}" EndProject From 6d989fa754c276c3481e304aaabf340e74fe540f Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Wed, 5 Jun 2019 14:13:46 -0700 Subject: [PATCH 086/159] ensure Microsoft.FSharp.NetSdk.props makes it into VisualFSharpFull.vsix (#6942) * ensure Microsoft.FSharp.NetSdk.props makes it into VisualFSharpFull.vsix During a build/deploy in VS the target `BeforeBuild` wasn't getting called on FSharp.Build.fsproj if up-to-date checks passed which meant the .props file wasn't getting added to the @(None) item group. The fix is to make that target depend on `AssignTargetPaths` which is run in both the VS build as well as the command line build. * annotate ambiguous function --- FSharpBuild.Directory.Build.targets | 29 ++++++++++--------- fcs/Directory.Build.targets | 29 ++++++++++--------- .../FSharp.Compiler.Service.Tests.fsproj | 4 +-- fcs/build.fsx | 2 +- src/fsharp/FSharp.Build/FSharp.Build.fsproj | 4 +-- src/fsharp/fsc/fsc.fsproj | 4 +-- src/fsharp/fsi/fsi.fsproj | 4 +-- src/fsharp/fsiAnyCpu/fsiAnyCpu.fsproj | 4 +-- .../UnitTests/VisualFSharp.UnitTests.fsproj | 4 +-- 9 files changed, 43 insertions(+), 41 deletions(-) diff --git a/FSharpBuild.Directory.Build.targets b/FSharpBuild.Directory.Build.targets index d87d68d36c..7548cef7ac 100644 --- a/FSharpBuild.Directory.Build.targets +++ b/FSharpBuild.Directory.Build.targets @@ -5,29 +5,30 @@ - + - <__TargetFilePath>@(CopyAndSubstituteText->'$(IntermediateOutputPath)%(Filename)%(Extension)') - <__TargetFileName>@(CopyAndSubstituteText->'%(Filename)%(Extension)') + <__TargetFilePath>@(NoneSubstituteText->'$(IntermediateOutputPath)%(Filename)%(Extension)') + <__TargetFileName>@(NoneSubstituteText->'%(Filename)%(Extension)') - <_ReplacementText>$([System.IO.File]::ReadAllText('%(CopyAndSubstituteText.FullPath)')) - <_ReplacementText Condition="'%(CopyAndSubstituteText.Pattern1)' != ''">$(_ReplacementText.Replace('%(CopyAndSubstituteText.Pattern1)', '%(CopyAndSubstituteText.Replacement1)')) - <_ReplacementText Condition="'%(CopyAndSubstituteText.Pattern2)' != ''">$(_ReplacementText.Replace('%(CopyAndSubstituteText.Pattern2)', '%(CopyAndSubstituteText.Replacement2)')) + <_ReplacementText>$([System.IO.File]::ReadAllText('%(NoneSubstituteText.FullPath)')) + <_ReplacementText Condition="'%(NoneSubstituteText.Pattern1)' != ''">$(_ReplacementText.Replace('%(NoneSubstituteText.Pattern1)', '%(NoneSubstituteText.Replacement1)')) + <_ReplacementText Condition="'%(NoneSubstituteText.Pattern2)' != ''">$(_ReplacementText.Replace('%(NoneSubstituteText.Pattern2)', '%(NoneSubstituteText.Replacement2)')) + + <_CopyToOutputDirectory Condition="'%(NoneSubstituteText.CopyToOutputDirectory)' != ''">%(NoneSubstituteText.CopyToOutputDirectory) + <_CopyToOutputDirectory Condition="'%(NoneSubstituteText.CopyToOutputDirectory)' == ''">Never - + - - + diff --git a/fcs/Directory.Build.targets b/fcs/Directory.Build.targets index 19b6fcd667..3c45a52487 100644 --- a/fcs/Directory.Build.targets +++ b/fcs/Directory.Build.targets @@ -1,28 +1,29 @@ - + - <__TargetFilePath>@(CopyAndSubstituteText->'$(IntermediateOutputPath)%(Filename)%(Extension)') - <__TargetFileName>@(CopyAndSubstituteText->'%(Filename)%(Extension)') + <__TargetFilePath>@(NoneSubstituteText->'$(IntermediateOutputPath)%(Filename)%(Extension)') + <__TargetFileName>@(NoneSubstituteText->'%(Filename)%(Extension)') - <_ReplacementText>$([System.IO.File]::ReadAllText('%(CopyAndSubstituteText.FullPath)')) - <_ReplacementText Condition="'%(CopyAndSubstituteText.Pattern1)' != ''">$(_ReplacementText.Replace('%(CopyAndSubstituteText.Pattern1)', '%(CopyAndSubstituteText.Replacement1)')) - <_ReplacementText Condition="'%(CopyAndSubstituteText.Pattern2)' != ''">$(_ReplacementText.Replace('%(CopyAndSubstituteText.Pattern2)', '%(CopyAndSubstituteText.Replacement2)')) + <_ReplacementText>$([System.IO.File]::ReadAllText('%(NoneSubstituteText.FullPath)')) + <_ReplacementText Condition="'%(NoneSubstituteText.Pattern1)' != ''">$(_ReplacementText.Replace('%(NoneSubstituteText.Pattern1)', '%(NoneSubstituteText.Replacement1)')) + <_ReplacementText Condition="'%(NoneSubstituteText.Pattern2)' != ''">$(_ReplacementText.Replace('%(NoneSubstituteText.Pattern2)', '%(NoneSubstituteText.Replacement2)')) + + <_CopyToOutputDirectory Condition="'%(NoneSubstituteText.CopyToOutputDirectory)' != ''">%(NoneSubstituteText.CopyToOutputDirectory) + <_CopyToOutputDirectory Condition="'%(NoneSubstituteText.CopyToOutputDirectory)' == ''">Never - + - - + diff --git a/fcs/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj b/fcs/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj index 9f16ede65d..c3125e32d1 100644 --- a/fcs/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj +++ b/fcs/FSharp.Compiler.Service.Tests/FSharp.Compiler.Service.Tests.fsproj @@ -73,10 +73,10 @@ Program.fs - + {{FSCoreVersion}} $(FSCoreVersion) - + diff --git a/fcs/build.fsx b/fcs/build.fsx index ec53ced9c2..cf0e0d8ded 100644 --- a/fcs/build.fsx +++ b/fcs/build.fsx @@ -67,7 +67,7 @@ let releaseDir = Path.Combine(__SOURCE_DIRECTORY__, "../artifacts/bin/fcs/Releas let release = LoadReleaseNotes (__SOURCE_DIRECTORY__ + "/RELEASE_NOTES.md") let isAppVeyorBuild = buildServer = BuildServer.AppVeyor let isJenkinsBuild = buildServer = BuildServer.Jenkins -let isVersionTag tag = Version.TryParse tag |> fst +let isVersionTag (tag: string) = Version.TryParse tag |> fst let hasRepoVersionTag = isAppVeyorBuild && AppVeyorEnvironment.RepoTag && isVersionTag AppVeyorEnvironment.RepoTagName let assemblyVersion = if hasRepoVersionTag then AppVeyorEnvironment.RepoTagName else release.NugetVersion diff --git a/src/fsharp/FSharp.Build/FSharp.Build.fsproj b/src/fsharp/FSharp.Build/FSharp.Build.fsproj index ef4d013dc1..0bf32ed19a 100644 --- a/src/fsharp/FSharp.Build/FSharp.Build.fsproj +++ b/src/fsharp/FSharp.Build/FSharp.Build.fsproj @@ -29,13 +29,13 @@ - + Microsoft.FSharp.NetSdk.props {{FSharpCoreShippedPackageVersion}} $(FSharpCoreShippedPackageVersion) {{FSharpCorePreviewPackageVersion}} $(FSharpCorePreviewPackageVersion) - + diff --git a/src/fsharp/fsc/fsc.fsproj b/src/fsharp/fsc/fsc.fsproj index 8e5dce90af..370664ee6a 100644 --- a/src/fsharp/fsc/fsc.fsproj +++ b/src/fsharp/fsc/fsc.fsproj @@ -25,10 +25,10 @@ default.win32manifest PreserveNewest - + {{FSCoreVersion}} $(FSCoreVersion) - + diff --git a/src/fsharp/fsi/fsi.fsproj b/src/fsharp/fsi/fsi.fsproj index cdc65b92dc..fb55d4d898 100644 --- a/src/fsharp/fsi/fsi.fsproj +++ b/src/fsharp/fsi/fsi.fsproj @@ -22,10 +22,10 @@ - + {{FSCoreVersion}} $(FSCoreVersion) - + diff --git a/src/fsharp/fsiAnyCpu/fsiAnyCpu.fsproj b/src/fsharp/fsiAnyCpu/fsiAnyCpu.fsproj index cbd4f7103a..92503aaea0 100644 --- a/src/fsharp/fsiAnyCpu/fsiAnyCpu.fsproj +++ b/src/fsharp/fsiAnyCpu/fsiAnyCpu.fsproj @@ -22,10 +22,10 @@ - + {{FSCoreVersion}} $(FSCoreVersion) - + diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj index 1395972fcf..7b11fb96c6 100644 --- a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj @@ -165,10 +165,10 @@ Roslyn\DocumentHighlightsServiceTests.fs - + {{FSCoreVersion}} $(FSCoreVersion) - + From f72b7b251128063adb43e40fbea221a9eb63402c Mon Sep 17 00:00:00 2001 From: Don Syme Date: Thu, 6 Jun 2019 02:03:07 +0100 Subject: [PATCH 087/159] split service.fs (#6247) * split service.fs * reduce diff * minor cleanup * fix flakey test (?) * use runsettings * same fix for FCS tests2 * fix build * add diagnostics * fix final parallel case * fix build * try again to fix test * update test fixes * add diagnostics * add diagnostics * diagnostics * diagnostics * diagnostics * add diagnostics and possible fix for tp smoke tests * fix build * fix build * merge master * integrate master * integrate master * fix build * Delete FSharp.Compiler.Private.fsproj --- .../FSharp.Compiler.Service.fsproj | 6 + .../FSharp.Compiler.Private.fsproj | 6 + src/fsharp/service/FSharpCheckerResults.fs | 2240 ++++++++++++++++ src/fsharp/service/FSharpCheckerResults.fsi | 421 +++ src/fsharp/service/service.fs | 2368 ++--------------- src/fsharp/service/service.fsi | 307 --- .../Utils/LanguageServiceProfiling/Options.fs | 2 + 7 files changed, 2828 insertions(+), 2522 deletions(-) create mode 100644 src/fsharp/service/FSharpCheckerResults.fs create mode 100644 src/fsharp/service/FSharpCheckerResults.fsi diff --git a/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj b/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj index a83bb51269..2bfaa4aa12 100644 --- a/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj +++ b/fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj @@ -621,6 +621,12 @@ Service/QuickParse.fs + + Service/FSharpCheckerResults.fsi + + + Service/FSharpCheckerResults.fs + Service/service.fsi diff --git a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj index 61544622d4..1dfee65140 100644 --- a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj +++ b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj @@ -655,6 +655,12 @@ Service/QuickParse.fs + + Service/FSharpCheckerResults.fsi + + + Service/FSharpCheckerResults.fs + Service/service.fsi diff --git a/src/fsharp/service/FSharpCheckerResults.fs b/src/fsharp/service/FSharpCheckerResults.fs new file mode 100644 index 0000000000..d8cfe81430 --- /dev/null +++ b/src/fsharp/service/FSharpCheckerResults.fs @@ -0,0 +1,2240 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +// Open up the compiler as an incremental service for parsing, +// type checking and intellisense-like environment-reporting. + +namespace FSharp.Compiler.SourceCodeServices + +open System +open System.Diagnostics +open System.IO +open System.Reflection + +open FSharp.Core.Printf +open FSharp.Compiler +open FSharp.Compiler.AbstractIL +open FSharp.Compiler.AbstractIL.IL +open FSharp.Compiler.AbstractIL.Internal.Library + +open FSharp.Compiler.AccessibilityLogic +open FSharp.Compiler.Ast +open FSharp.Compiler.CompileOps +open FSharp.Compiler.CompileOptions +open FSharp.Compiler.ErrorLogger +open FSharp.Compiler.Lib +open FSharp.Compiler.PrettyNaming +open FSharp.Compiler.Parser +open FSharp.Compiler.Range +open FSharp.Compiler.Lexhelp +open FSharp.Compiler.Layout +open FSharp.Compiler.Tast +open FSharp.Compiler.Tastops +open FSharp.Compiler.TcGlobals +open FSharp.Compiler.Text +open FSharp.Compiler.Infos +open FSharp.Compiler.InfoReader +open FSharp.Compiler.NameResolution +open FSharp.Compiler.TypeChecker +open FSharp.Compiler.SourceCodeServices.SymbolHelpers + +open Internal.Utilities +open Internal.Utilities.Collections +open FSharp.Compiler.AbstractIL.ILBinaryReader + +[] +module internal FSharpCheckerResultsSettings = + + let getToolTipTextSize = GetEnvInteger "FCS_GetToolTipTextCacheSize" 5 + + let maxTypeCheckErrorsOutOfProjectContext = GetEnvInteger "FCS_MaxErrorsOutOfProjectContext" 3 + + /// Maximum time share for a piece of background work before it should (cooperatively) yield + /// to enable other requests to be serviced. Yielding means returning a continuation function + /// (via an Eventually<_> value of case NotYetDone) that can be called as the next piece of work. + let maxTimeShareMilliseconds = + match System.Environment.GetEnvironmentVariable("FCS_MaxTimeShare") with + | null | "" -> 100L + | s -> int64 s + + // Look for DLLs in the location of the service DLL first. + let defaultFSharpBinariesDir = FSharpEnvironment.BinFolderOfDefaultFSharpCompiler(Some(typeof.Assembly.Location)).Value + +[] +type FSharpFindDeclFailureReason = + + // generic reason: no particular information about error + | Unknown of message: string + + // source code file is not available + | NoSourceCode + + // trying to find declaration of ProvidedType without TypeProviderDefinitionLocationAttribute + | ProvidedType of string + + // trying to find declaration of ProvidedMember without TypeProviderDefinitionLocationAttribute + | ProvidedMember of string + +[] +type FSharpFindDeclResult = + + /// declaration not found + reason + | DeclNotFound of FSharpFindDeclFailureReason + + /// found declaration + | DeclFound of range + + /// Indicates an external declaration was found + | ExternalDecl of assembly : string * externalSym : ExternalSymbol + +/// This type is used to describe what was found during the name resolution. +/// (Depending on the kind of the items, we may stop processing or continue to find better items) +[] +type internal NameResResult = + | Members of (ItemWithInst list * DisplayEnv * range) + | Cancel of DisplayEnv * range + | Empty + | TypecheckStaleAndTextChanged + +[] +type ResolveOverloads = +| Yes +| No + +[] +type GetPreciseCompletionListFromExprTypingsResult = + | NoneBecauseTypecheckIsStaleAndTextChanged + | NoneBecauseThereWereTypeErrors + | None + | Some of (ItemWithInst list * DisplayEnv * range) * TType + +type Names = string list + +[] +type SemanticClassificationType = + | ReferenceType + | ValueType + | UnionCase + | Function + | Property + | MutableVar + | Module + | Printf + | ComputationExpression + | IntrinsicFunction + | Enumeration + | Interface + | TypeArgument + | Operator + | Disposable + +/// A TypeCheckInfo represents everything we get back from the typecheck of a file. +/// It acts like an in-memory database about the file. +/// It is effectively immutable and not updated: when we re-typecheck we just drop the previous +/// scope object on the floor and make a new one. +[] +type internal TypeCheckInfo + (// Information corresponding to miscellaneous command-line options (--define, etc). + _sTcConfig: TcConfig, + g: TcGlobals, + // The signature of the assembly being checked, up to and including the current file + ccuSigForFile: ModuleOrNamespaceType, + thisCcu: CcuThunk, + tcImports: TcImports, + tcAccessRights: AccessorDomain, + projectFileName: string, + mainInputFileName: string, + sResolutions: TcResolutions, + sSymbolUses: TcSymbolUses, + // This is a name resolution environment to use if no better match can be found. + sFallback: NameResolutionEnv, + loadClosure : LoadClosure option, + reactorOps : IReactorOperations, + textSnapshotInfo:obj option, + implFileOpt: TypedImplFile option, + openDeclarations: OpenDeclaration[]) = + + let textSnapshotInfo = defaultArg textSnapshotInfo null + let (|CNR|) (cnr:CapturedNameResolution) = + (cnr.Pos, cnr.Item, cnr.ItemOccurence, cnr.DisplayEnv, cnr.NameResolutionEnv, cnr.AccessorDomain, cnr.Range) + + // These strings are potentially large and the editor may choose to hold them for a while. + // Use this cache to fold together data tip text results that are the same. + // Is not keyed on 'Names' collection because this is invariant for the current position in + // this unchanged file. Keyed on lineStr though to prevent a change to the currently line + // being available against a stale scope. + let getToolTipTextCache = AgedLookup>(getToolTipTextSize,areSimilar=(fun (x,y) -> x = y)) + + let amap = tcImports.GetImportMap() + let infoReader = new InfoReader(g,amap) + let ncenv = new NameResolver(g,amap,infoReader,NameResolution.FakeInstantiationGenerator) + let cenv = SymbolEnv(g, thisCcu, Some ccuSigForFile, tcImports, amap, infoReader) + + /// Find the most precise naming environment for the given line and column + let GetBestEnvForPos cursorPos = + + let mutable bestSoFar = None + + // Find the most deeply nested enclosing scope that contains given position + sResolutions.CapturedEnvs |> ResizeArray.iter (fun (possm,env,ad) -> + if rangeContainsPos possm cursorPos then + match bestSoFar with + | Some (bestm,_,_) -> + if rangeContainsRange bestm possm then + bestSoFar <- Some (possm,env,ad) + | None -> + bestSoFar <- Some (possm,env,ad)) + + let mostDeeplyNestedEnclosingScope = bestSoFar + + // Look for better subtrees on the r.h.s. of the subtree to the left of where we are + // Should really go all the way down the r.h.s. of the subtree to the left of where we are + // This is all needed when the index is floating free in the area just after the environment we really want to capture + // We guarantee to only refine to a more nested environment. It may not be strictly + // the right environment, but will always be at least as rich + + let bestAlmostIncludedSoFar = ref None + + sResolutions.CapturedEnvs |> ResizeArray.iter (fun (possm,env,ad) -> + // take only ranges that strictly do not include cursorPos (all ranges that touch cursorPos were processed during 'Strict Inclusion' part) + if rangeBeforePos possm cursorPos && not (posEq possm.End cursorPos) then + let contained = + match mostDeeplyNestedEnclosingScope with + | Some (bestm,_,_) -> rangeContainsRange bestm possm + | None -> true + + if contained then + match !bestAlmostIncludedSoFar with + | Some (rightm:range,_,_) -> + if posGt possm.End rightm.End || + (posEq possm.End rightm.End && posGt possm.Start rightm.Start) then + bestAlmostIncludedSoFar := Some (possm,env,ad) + | _ -> bestAlmostIncludedSoFar := Some (possm,env,ad)) + + let resEnv = + match !bestAlmostIncludedSoFar, mostDeeplyNestedEnclosingScope with + | Some (_,env,ad), None -> env, ad + | Some (_,almostIncludedEnv,ad), Some (_,mostDeeplyNestedEnv,_) + when almostIncludedEnv.eFieldLabels.Count >= mostDeeplyNestedEnv.eFieldLabels.Count -> + almostIncludedEnv,ad + | _ -> + match mostDeeplyNestedEnclosingScope with + | Some (_,env,ad) -> + env,ad + | None -> + sFallback,AccessibleFromSomeFSharpCode + let pm = mkRange mainInputFileName cursorPos cursorPos + + resEnv,pm + + /// The items that come back from ResolveCompletionsInType are a bit + /// noisy. Filter a few things out. + /// + /// e.g. prefer types to constructors for FSharpToolTipText + let FilterItemsForCtors filterCtors (items: ItemWithInst list) = + let items = items |> List.filter (fun item -> match item.Item with (Item.CtorGroup _) when filterCtors = ResolveTypeNamesToTypeRefs -> false | _ -> true) + items + + // Filter items to show only valid & return Some if there are any + let ReturnItemsOfType (items: ItemWithInst list) g denv (m:range) filterCtors hasTextChangedSinceLastTypecheck = + let items = + items + |> RemoveDuplicateItems g + |> RemoveExplicitlySuppressed g + |> FilterItemsForCtors filterCtors + + if not (isNil items) then + if hasTextChangedSinceLastTypecheck(textSnapshotInfo, m) then + NameResResult.TypecheckStaleAndTextChanged // typecheck is stale, wait for second-chance IntelliSense to bring up right result + else + NameResResult.Members (items, denv, m) + else NameResResult.Empty + + let GetCapturedNameResolutions endOfNamesPos resolveOverloads = + + let quals = + match resolveOverloads with + | ResolveOverloads.Yes -> sResolutions.CapturedNameResolutions + | ResolveOverloads.No -> sResolutions.CapturedMethodGroupResolutions + + let quals = quals |> ResizeArray.filter (fun cnr -> posEq cnr.Pos endOfNamesPos) + + quals + + /// Looks at the exact name resolutions that occurred during type checking + /// If 'membersByResidue' is specified, we look for members of the item obtained + /// from the name resolution and filter them by the specified residue (?) + let GetPreciseItemsFromNameResolution(line, colAtEndOfNames, membersByResidue, filterCtors, resolveOverloads, hasTextChangedSinceLastTypecheck) = + let endOfNamesPos = mkPos line colAtEndOfNames + + // Logic below expects the list to be in reverse order of resolution + let cnrs = GetCapturedNameResolutions endOfNamesPos resolveOverloads |> ResizeArray.toList |> List.rev + + match cnrs, membersByResidue with + + // If we're looking for members using a residue, we'd expect only + // a single item (pick the first one) and we need the residue (which may be "") + | CNR(_,Item.Types(_,(ty::_)), _, denv, nenv, ad, m)::_, Some _ -> + let items = ResolveCompletionsInType ncenv nenv (ResolveCompletionTargets.All(ConstraintSolver.IsApplicableMethApprox g amap m)) m ad true ty + let items = List.map ItemWithNoInst items + ReturnItemsOfType items g denv m filterCtors hasTextChangedSinceLastTypecheck + + // Value reference from the name resolution. Primarily to disallow "let x.$ = 1" + // In most of the cases, value references can be obtained from expression typings or from environment, + // so we wouldn't have to handle values here. However, if we have something like: + // let varA = "string" + // let varA = if b then 0 else varA. + // then the expression typings get confused (thinking 'varA:int'), so we use name resolution even for usual values. + + | CNR(_, Item.Value(vref), occurence, denv, nenv, ad, m)::_, Some _ -> + if (occurence = ItemOccurence.Binding || occurence = ItemOccurence.Pattern) then + // Return empty list to stop further lookup - for value declarations + NameResResult.Cancel(denv, m) + else + // If we have any valid items for the value, then return completions for its type now. + // Adjust the type in case this is the 'this' pointer stored in a reference cell. + let ty = StripSelfRefCell(g, vref.BaseOrThisInfo, vref.TauType) + // patch accessibility domain to remove protected members if accessing NormalVal + let ad = + match vref.BaseOrThisInfo, ad with + | ValBaseOrThisInfo.NormalVal, AccessibleFrom(paths, Some tcref) -> + let tcref = generalizedTyconRef tcref + // check that type of value is the same or subtype of tcref + // yes - allow access to protected members + // no - strip ability to access protected members + if FSharp.Compiler.TypeRelations.TypeFeasiblySubsumesType 0 g amap m tcref FSharp.Compiler.TypeRelations.CanCoerce ty then + ad + else + AccessibleFrom(paths, None) + | _ -> ad + + let items = ResolveCompletionsInType ncenv nenv (ResolveCompletionTargets.All(ConstraintSolver.IsApplicableMethApprox g amap m)) m ad false ty + let items = List.map ItemWithNoInst items + ReturnItemsOfType items g denv m filterCtors hasTextChangedSinceLastTypecheck + + // No residue, so the items are the full resolution of the name + | CNR(_, _, _, denv, _, _, m) :: _, None -> + let items = + cnrs + |> List.map (fun cnr -> cnr.ItemWithInst) + // "into" is special magic syntax, not an identifier or a library call. It is part of capturedNameResolutions as an + // implementation detail of syntax coloring, but we should not report name resolution results for it, to prevent spurious QuickInfo. + |> List.filter (fun item -> match item.Item with Item.CustomOperation(CustomOperations.Into,_,_) -> false | _ -> true) + ReturnItemsOfType items g denv m filterCtors hasTextChangedSinceLastTypecheck + | _, _ -> NameResResult.Empty + + let TryGetTypeFromNameResolution(line, colAtEndOfNames, membersByResidue, resolveOverloads) = + let endOfNamesPos = mkPos line colAtEndOfNames + let items = GetCapturedNameResolutions endOfNamesPos resolveOverloads |> ResizeArray.toList |> List.rev + + match items, membersByResidue with + | CNR(_,Item.Types(_,(ty::_)),_,_,_,_,_)::_, Some _ -> Some ty + | CNR(_, Item.Value(vref), occurence,_,_,_,_)::_, Some _ -> + if (occurence = ItemOccurence.Binding || occurence = ItemOccurence.Pattern) then None + else Some (StripSelfRefCell(g, vref.BaseOrThisInfo, vref.TauType)) + | _, _ -> None + + let CollectParameters (methods: MethInfo list) amap m: Item list = + methods + |> List.collect (fun meth -> + match meth.GetParamDatas(amap, m, meth.FormalMethodInst) with + | x::_ -> x |> List.choose(fun (ParamData(_isParamArray, _isInArg, _isOutArg, _optArgInfo, _callerInfo, name, _, ty)) -> + match name with + | Some n -> Some (Item.ArgName(n, ty, Some (ArgumentContainer.Method meth))) + | None -> None + ) + | _ -> [] + ) + + let GetNamedParametersAndSettableFields endOfExprPos hasTextChangedSinceLastTypecheck = + let cnrs = GetCapturedNameResolutions endOfExprPos ResolveOverloads.No |> ResizeArray.toList |> List.rev + let result = + match cnrs with + | CNR(_, Item.CtorGroup(_, ((ctor::_) as ctors)), _, denv, nenv, ad, m) ::_ -> + let props = ResolveCompletionsInType ncenv nenv ResolveCompletionTargets.SettablePropertiesAndFields m ad false ctor.ApparentEnclosingType + let parameters = CollectParameters ctors amap m + let items = props @ parameters + Some (denv, m, items) + | CNR(_, Item.MethodGroup(_, methods, _), _, denv, nenv, ad, m) ::_ -> + let props = + methods + |> List.collect (fun meth -> + let retTy = meth.GetFSharpReturnTy(amap, m, meth.FormalMethodInst) + ResolveCompletionsInType ncenv nenv ResolveCompletionTargets.SettablePropertiesAndFields m ad false retTy + ) + let parameters = CollectParameters methods amap m + let items = props @ parameters + Some (denv, m, items) + | _ -> + None + match result with + | None -> + NameResResult.Empty + | Some (denv, m, items) -> + let items = List.map ItemWithNoInst items + ReturnItemsOfType items g denv m TypeNameResolutionFlag.ResolveTypeNamesToTypeRefs hasTextChangedSinceLastTypecheck + + /// finds captured typing for the given position + let GetExprTypingForPosition(endOfExprPos) = + let quals = + sResolutions.CapturedExpressionTypings + |> Seq.filter (fun (pos,ty,denv,_,_,_) -> + // We only want expression types that end at the particular position in the file we are looking at. + let isLocationWeCareAbout = posEq pos endOfExprPos + // Get rid of function types. True, given a 2-arg curried function "f x y", it is legal to do "(f x).GetType()", + // but you almost never want to do this in practice, and we choose not to offer up any intellisense for + // F# function types. + let isFunction = isFunTy denv.g ty + isLocationWeCareAbout && not isFunction) + |> Seq.toArray + + let thereWereSomeQuals = not (Array.isEmpty quals) + // filter out errors + + let quals = quals + |> Array.filter (fun (_,ty,denv,_,_,_) -> not (isTyparTy denv.g ty && (destTyparTy denv.g ty).IsFromError)) + thereWereSomeQuals, quals + + /// obtains captured typing for the given position + /// if type of captured typing is record - returns list of record fields + let GetRecdFieldsForExpr(r : range) = + let _, quals = GetExprTypingForPosition(r.End) + let bestQual = + match quals with + | [||] -> None + | quals -> + quals |> Array.tryFind (fun (_,_,_,_,_,rq) -> + ignore(r) // for breakpoint + posEq r.Start rq.Start) + match bestQual with + | Some (_,ty,denv,_nenv,ad,m) when isRecdTy denv.g ty -> + let items = NameResolution.ResolveRecordOrClassFieldsOfType ncenv m ad ty false + Some (items, denv, m) + | _ -> None + + /// Looks at the exact expression types at the position to the left of the + /// residue then the source when it was typechecked. + let GetPreciseCompletionListFromExprTypings(parseResults:FSharpParseFileResults, endOfExprPos, filterCtors, hasTextChangedSinceLastTypecheck: (obj * range -> bool)) = + + let thereWereSomeQuals, quals = GetExprTypingForPosition(endOfExprPos) + + match quals with + | [| |] -> + if thereWereSomeQuals then + GetPreciseCompletionListFromExprTypingsResult.NoneBecauseThereWereTypeErrors + else + GetPreciseCompletionListFromExprTypingsResult.None + | _ -> + let bestQual, textChanged = + match parseResults.ParseTree with + | Some(input) -> + match UntypedParseImpl.GetRangeOfExprLeftOfDot(endOfExprPos,Some(input)) with // TODO we say "colAtEndOfNames" everywhere, but that's not really a good name ("foo . $" hit Ctrl-Space at $) + | Some( exprRange) -> + if hasTextChangedSinceLastTypecheck(textSnapshotInfo, exprRange) then + None, true // typecheck is stale, wait for second-chance IntelliSense to bring up right result + else + // See bug 130733. We have an up-to-date sync parse, and know the exact range of the prior expression. + // The quals all already have the same ending position, so find one with a matching starting position, if it exists. + // If not, then the stale typecheck info does not have a capturedExpressionTyping for this exact expression, and the + // user can wait for typechecking to catch up and second-chance intellisense to give the right result. + let qual = + quals |> Array.tryFind (fun (_,_,_,_,_,r) -> + ignore(r) // for breakpoint + posEq exprRange.Start r.Start) + qual, false + | None -> + // TODO In theory I think we should never get to this code path; it would be nice to add an assert. + // In practice, we do get here in some weird cases like "2.0 .. 3.0" and hitting Ctrl-Space in between the two dots of the range operator. + // I wasn't able to track down what was happening in those weird cases, not worth worrying about, it doesn't manifest as a product bug or anything. + None, false + | _ -> None, false + + match bestQual with + | Some bestQual -> + let (_,ty,denv,nenv,ad,m) = bestQual + let items = ResolveCompletionsInType ncenv nenv (ResolveCompletionTargets.All(ConstraintSolver.IsApplicableMethApprox g amap m)) m ad false ty + let items = items |> List.map ItemWithNoInst + let items = items |> RemoveDuplicateItems g + let items = items |> RemoveExplicitlySuppressed g + let items = items |> FilterItemsForCtors filterCtors + GetPreciseCompletionListFromExprTypingsResult.Some((items,denv,m), ty) + | None -> + if textChanged then GetPreciseCompletionListFromExprTypingsResult.NoneBecauseTypecheckIsStaleAndTextChanged + else GetPreciseCompletionListFromExprTypingsResult.None + + /// Find items in the best naming environment. + let GetEnvironmentLookupResolutions(nenv, ad, m, plid, filterCtors, showObsolete) = + let items = NameResolution.ResolvePartialLongIdent ncenv nenv (ConstraintSolver.IsApplicableMethApprox g amap m) m ad plid showObsolete + let items = items |> List.map ItemWithNoInst + let items = items |> RemoveDuplicateItems g + let items = items |> RemoveExplicitlySuppressed g + let items = items |> FilterItemsForCtors filterCtors + (items, nenv.DisplayEnv, m) + + /// Find items in the best naming environment. + let GetEnvironmentLookupResolutionsAtPosition(cursorPos, plid, filterCtors, showObsolete) = + let (nenv,ad),m = GetBestEnvForPos cursorPos + GetEnvironmentLookupResolutions(nenv, ad, m, plid, filterCtors, showObsolete) + + /// Find record fields in the best naming environment. + let GetClassOrRecordFieldsEnvironmentLookupResolutions(cursorPos, plid) = + let (nenv, ad),m = GetBestEnvForPos cursorPos + let items = NameResolution.ResolvePartialLongIdentToClassOrRecdFields ncenv nenv m ad plid false + let items = items |> List.map ItemWithNoInst + let items = items |> RemoveDuplicateItems g + let items = items |> RemoveExplicitlySuppressed g + items, nenv.DisplayEnv, m + + /// Resolve a location and/or text to items. + // Three techniques are used + // - look for an exact known name resolution from type checking + // - use the known type of an expression, e.g. (expr).Name, to generate an item list + // - lookup an entire name in the name resolution environment, e.g. A.B.Name, to generate an item list + // + // The overall aim is to resolve as accurately as possible based on what we know from type inference + + let GetBaseClassCandidates = function + | Item.ModuleOrNamespaces _ -> true + | Item.Types(_, ty::_) when (isClassTy g ty) && not (isSealedTy g ty) -> true + | _ -> false + + let GetInterfaceCandidates = function + | Item.ModuleOrNamespaces _ -> true + | Item.Types(_, ty::_) when (isInterfaceTy g ty) -> true + | _ -> false + + + // Return only items with the specified name + let FilterDeclItemsByResidue (getItem: 'a -> Item) residue (items: 'a list) = + let attributedResidue = residue + "Attribute" + let nameMatchesResidue name = (residue = name) || (attributedResidue = name) + + items |> List.filter (fun x -> + let item = getItem x + let n1 = item.DisplayName + match item with + | Item.Types _ -> nameMatchesResidue n1 + | Item.CtorGroup (_, meths) -> + nameMatchesResidue n1 || + meths |> List.exists (fun meth -> + let tcref = meth.ApparentEnclosingTyconRef + tcref.IsProvided || nameMatchesResidue tcref.DisplayName) + | _ -> residue = n1) + + /// Post-filter items to make sure they have precisely the right name + /// This also checks that there are some remaining results + /// exactMatchResidueOpt = Some _ -- means that we are looking for exact matches + let FilterRelevantItemsBy (getItem: 'a -> Item) (exactMatchResidueOpt : _ option) check (items: 'a list, denv, m) = + + // can throw if type is in located in non-resolved CCU: i.e. bigint if reference to System.Numerics is absent + let safeCheck item = try check item with _ -> false + + // Are we looking for items with precisely the given name? + if not (isNil items) && exactMatchResidueOpt.IsSome then + let items = items |> FilterDeclItemsByResidue getItem exactMatchResidueOpt.Value |> List.filter safeCheck + if not (isNil items) then Some(items, denv, m) else None + else + // When (items = []) we must returns Some([],..) and not None + // because this value is used if we want to stop further processing (e.g. let x.$ = ...) + let items = items |> List.filter safeCheck + Some(items, denv, m) + + /// Post-filter items to make sure they have precisely the right name + /// This also checks that there are some remaining results + let (|FilterRelevantItems|_|) getItem exactMatchResidueOpt orig = + FilterRelevantItemsBy getItem exactMatchResidueOpt (fun _ -> true) orig + + /// Find the first non-whitespace position in a line prior to the given character + let FindFirstNonWhitespacePosition (lineStr: string) i = + if i >= lineStr.Length then None + else + let mutable p = i + while p >= 0 && System.Char.IsWhiteSpace(lineStr.[p]) do + p <- p - 1 + if p >= 0 then Some p else None + + let CompletionItem (ty: ValueOption) (assemblySymbol: ValueOption) (item: ItemWithInst) = + let kind = + match item.Item with + | Item.MethodGroup (_, minfo :: _, _) -> CompletionItemKind.Method minfo.IsExtensionMember + | Item.RecdField _ + | Item.Property _ -> CompletionItemKind.Property + | Item.Event _ -> CompletionItemKind.Event + | Item.ILField _ + | Item.Value _ -> CompletionItemKind.Field + | Item.CustomOperation _ -> CompletionItemKind.CustomOperation + | _ -> CompletionItemKind.Other + + { ItemWithInst = item + MinorPriority = 0 + Kind = kind + IsOwnMember = false + Type = match ty with ValueSome x -> Some x | _ -> None + Unresolved = match assemblySymbol with ValueSome x -> Some x.UnresolvedSymbol | _ -> None } + + let DefaultCompletionItem item = CompletionItem ValueNone ValueNone item + + let getItem (x: ItemWithInst) = x.Item + let GetDeclaredItems (parseResultsOpt: FSharpParseFileResults option, lineStr: string, origLongIdentOpt, colAtEndOfNamesAndResidue, residueOpt, lastDotPos, line, loc, + filterCtors, resolveOverloads, hasTextChangedSinceLastTypecheck, isInRangeOperator, allSymbols: unit -> AssemblySymbol list) = + + // Are the last two chars (except whitespaces) = ".." + let isLikeRangeOp = + match FindFirstNonWhitespacePosition lineStr (colAtEndOfNamesAndResidue - 1) with + | Some x when x >= 1 && lineStr.[x] = '.' && lineStr.[x - 1] = '.' -> true + | _ -> false + + // if last two chars are .. and we are not in range operator context - no completion + if isLikeRangeOp && not isInRangeOperator then None else + + // Try to use the exact results of name resolution during type checking to generate the results + // This is based on position (i.e. colAtEndOfNamesAndResidue). This is not used if a residueOpt is given. + let nameResItems = + match residueOpt with + | None -> GetPreciseItemsFromNameResolution(line, colAtEndOfNamesAndResidue, None, filterCtors,resolveOverloads, hasTextChangedSinceLastTypecheck) + | Some residue -> + // deals with cases when we have spaces between dot and\or identifier, like A . $ + // if this is our case - then we need to locate end position of the name skipping whitespaces + // this allows us to handle cases like: let x . $ = 1 + match lastDotPos |> Option.orElseWith (fun _ -> FindFirstNonWhitespacePosition lineStr (colAtEndOfNamesAndResidue - 1)) with + | Some p when lineStr.[p] = '.' -> + match FindFirstNonWhitespacePosition lineStr (p - 1) with + | Some colAtEndOfNames -> + let colAtEndOfNames = colAtEndOfNames + 1 // convert 0-based to 1-based + GetPreciseItemsFromNameResolution(line, colAtEndOfNames, Some(residue), filterCtors,resolveOverloads, hasTextChangedSinceLastTypecheck) + | None -> NameResResult.Empty + | _ -> NameResResult.Empty + + // Normalize to form A.B.C.D where D is the residue. It may be empty for "A.B.C." + // residueOpt = Some when we are looking for the exact match + let plid, exactMatchResidueOpt = + match origLongIdentOpt, residueOpt with + | None, _ -> [], None + | Some(origLongIdent), Some _ -> origLongIdent, None + | Some(origLongIdent), None -> + System.Diagnostics.Debug.Assert(not (isNil origLongIdent), "origLongIdent is empty") + // note: as above, this happens when we are called for "precise" resolution - (F1 keyword, data tip etc..) + let plid, residue = List.frontAndBack origLongIdent + plid, Some residue + + let pos = mkPos line loc + let (nenv, ad), m = GetBestEnvForPos pos + + let getType() = + match NameResolution.TryToResolveLongIdentAsType ncenv nenv m plid with + | Some x -> tryDestAppTy g x + | None -> + match lastDotPos |> Option.orElseWith (fun _ -> FindFirstNonWhitespacePosition lineStr (colAtEndOfNamesAndResidue - 1)) with + | Some p when lineStr.[p] = '.' -> + match FindFirstNonWhitespacePosition lineStr (p - 1) with + | Some colAtEndOfNames -> + let colAtEndOfNames = colAtEndOfNames + 1 // convert 0-based to 1-based + match TryGetTypeFromNameResolution(line, colAtEndOfNames, residueOpt, resolveOverloads) with + | Some x -> tryDestAppTy g x + | _ -> ValueNone + | None -> ValueNone + | _ -> ValueNone + + match nameResItems with + | NameResResult.TypecheckStaleAndTextChanged -> None // second-chance intellisense will try again + | NameResResult.Cancel(denv,m) -> Some([], denv, m) + | NameResResult.Members(FilterRelevantItems getItem exactMatchResidueOpt (items, denv, m)) -> + // lookup based on name resolution results successful + Some (items |> List.map (CompletionItem (getType()) ValueNone), denv, m) + | _ -> + match origLongIdentOpt with + | None -> None + | Some _ -> + + // Try to use the type of the expression on the left to help generate a completion list + let qualItems, thereIsADotInvolved = + match parseResultsOpt with + | None -> + // Note, you will get here if the 'reason' is not CompleteWord/MemberSelect/DisplayMemberList, as those are currently the + // only reasons we do a sync parse to have the most precise and likely-to-be-correct-and-up-to-date info. So for example, + // if you do QuickInfo hovering over A in "f(x).A()", you will only get a tip if typechecking has a name-resolution recorded + // for A, not if merely we know the capturedExpressionTyping of f(x) and you very recently typed ".A()" - in that case, + // you won't won't get a tip until the typechecking catches back up. + GetPreciseCompletionListFromExprTypingsResult.None, false + | Some parseResults -> + + match UntypedParseImpl.TryFindExpressionASTLeftOfDotLeftOfCursor(mkPos line colAtEndOfNamesAndResidue,parseResults.ParseTree) with + | Some(pos,_) -> + GetPreciseCompletionListFromExprTypings(parseResults, pos, filterCtors, hasTextChangedSinceLastTypecheck), true + | None -> + // Can get here in a case like: if "f xxx yyy" is legal, and we do "f xxx y" + // We have no interest in expression typings, those are only useful for dot-completion. We want to fallback + // to "Use an environment lookup as the last resort" below + GetPreciseCompletionListFromExprTypingsResult.None, false + + match qualItems,thereIsADotInvolved with + | GetPreciseCompletionListFromExprTypingsResult.Some(FilterRelevantItems getItem exactMatchResidueOpt (items, denv, m), ty), _ + // Initially we only use the expression typings when looking up, e.g. (expr).Nam or (expr).Name1.Nam + // These come through as an empty plid and residue "". Otherwise we try an environment lookup + // and then return to the qualItems. This is because the expression typings are a little inaccurate, primarily because + // it appears we're getting some typings recorded for non-atomic expressions like "f x" + when isNil plid -> + // lookup based on expression typings successful + Some (items |> List.map (CompletionItem (tryDestAppTy g ty) ValueNone), denv, m) + | GetPreciseCompletionListFromExprTypingsResult.NoneBecauseThereWereTypeErrors, _ -> + // There was an error, e.g. we have "." and there is an error determining the type of + // In this case, we don't want any of the fallback logic, rather, we want to produce zero results. + None + | GetPreciseCompletionListFromExprTypingsResult.NoneBecauseTypecheckIsStaleAndTextChanged, _ -> + // we want to report no result and let second-chance intellisense kick in + None + | _, true when isNil plid -> + // If the user just pressed '.' after an _expression_ (not a plid), it is never right to show environment-lookup top-level completions. + // The user might by typing quickly, and the LS didn't have an expression type right before the dot yet. + // Second-chance intellisense will bring up the correct list in a moment. + None + | _ -> + // Use an environment lookup as the last resort + let envItems, denv, m = GetEnvironmentLookupResolutions(nenv, ad, m, plid, filterCtors, residueOpt.IsSome) + + let envResult = + match nameResItems, (envItems, denv, m), qualItems with + + // First, use unfiltered name resolution items, if they're not empty + | NameResResult.Members(items, denv, m), _, _ when not (isNil items) -> + // lookup based on name resolution results successful + ValueSome(items |> List.map (CompletionItem (getType()) ValueNone), denv, m) + + // If we have nonempty items from environment that were resolved from a type, then use them... + // (that's better than the next case - here we'd return 'int' as a type) + | _, FilterRelevantItems getItem exactMatchResidueOpt (items, denv, m), _ when not (isNil items) -> + // lookup based on name and environment successful + ValueSome(items |> List.map (CompletionItem (getType()) ValueNone), denv, m) + + // Try again with the qualItems + | _, _, GetPreciseCompletionListFromExprTypingsResult.Some(FilterRelevantItems getItem exactMatchResidueOpt (items, denv, m), ty) -> + ValueSome(items |> List.map (CompletionItem (tryDestAppTy g ty) ValueNone), denv, m) + + | _ -> ValueNone + + let globalResult = + match origLongIdentOpt with + | None | Some [] -> + let globalItems = + allSymbols() + |> List.filter (fun x -> not x.Symbol.IsExplicitlySuppressed) + |> List.filter (fun x -> + match x.Symbol with + | :? FSharpMemberOrFunctionOrValue as m when m.IsConstructor && filterCtors = ResolveTypeNamesToTypeRefs -> false + | _ -> true) + + let getItem (x: AssemblySymbol) = x.Symbol.Item + + match globalItems, denv, m with + | FilterRelevantItems getItem exactMatchResidueOpt (globalItemsFiltered, denv, m) when not (isNil globalItemsFiltered) -> + globalItemsFiltered + |> List.map(fun globalItem -> CompletionItem (getType()) (ValueSome globalItem) (ItemWithNoInst globalItem.Symbol.Item)) + |> fun r -> ValueSome(r, denv, m) + | _ -> ValueNone + | _ -> ValueNone // do not return unresolved items after dot + + match envResult, globalResult with + | ValueSome (items, denv, m), ValueSome (gItems,_,_) -> Some (items @ gItems, denv, m) + | ValueSome x, ValueNone -> Some x + | ValueNone, ValueSome y -> Some y + | ValueNone, ValueNone -> None + + + let toCompletionItems (items: ItemWithInst list, denv: DisplayEnv, m: range ) = + items |> List.map DefaultCompletionItem, denv, m + + /// Get the auto-complete items at a particular location. + let GetDeclItemsForNamesAtPosition(ctok: CompilationThreadToken, parseResultsOpt: FSharpParseFileResults option, origLongIdentOpt: string list option, + residueOpt:string option, lastDotPos: int option, line:int, lineStr:string, colAtEndOfNamesAndResidue, filterCtors, resolveOverloads, + getAllSymbols: unit -> AssemblySymbol list, hasTextChangedSinceLastTypecheck: (obj * range -> bool)) + : (CompletionItem list * DisplayEnv * CompletionContext option * range) option = + RequireCompilationThread ctok // the operations in this method need the reactor thread + + let loc = + match colAtEndOfNamesAndResidue with + | pastEndOfLine when pastEndOfLine >= lineStr.Length -> lineStr.Length + | atDot when lineStr.[atDot] = '.' -> atDot + 1 + | atStart when atStart = 0 -> 0 + | otherwise -> otherwise - 1 + + // Look for a "special" completion context + let completionContext = + parseResultsOpt + |> Option.bind (fun x -> x.ParseTree) + |> Option.bind (fun parseTree -> UntypedParseImpl.TryGetCompletionContext(mkPos line colAtEndOfNamesAndResidue, parseTree, lineStr)) + + let res = + match completionContext with + // Invalid completion locations + | Some CompletionContext.Invalid -> None + + // Completion at 'inherit C(...)" + | Some (CompletionContext.Inherit(InheritanceContext.Class, (plid, _))) -> + GetEnvironmentLookupResolutionsAtPosition(mkPos line loc, plid, filterCtors, false) + |> FilterRelevantItemsBy getItem None (getItem >> GetBaseClassCandidates) + |> Option.map toCompletionItems + + // Completion at 'interface ..." + | Some (CompletionContext.Inherit(InheritanceContext.Interface, (plid, _))) -> + GetEnvironmentLookupResolutionsAtPosition(mkPos line loc, plid, filterCtors, false) + |> FilterRelevantItemsBy getItem None (getItem >> GetInterfaceCandidates) + |> Option.map toCompletionItems + + // Completion at 'implement ..." + | Some (CompletionContext.Inherit(InheritanceContext.Unknown, (plid, _))) -> + GetEnvironmentLookupResolutionsAtPosition(mkPos line loc, plid, filterCtors, false) + |> FilterRelevantItemsBy getItem None (getItem >> (fun t -> GetBaseClassCandidates t || GetInterfaceCandidates t)) + |> Option.map toCompletionItems + + // Completion at ' { XXX = ... } " + | Some(CompletionContext.RecordField(RecordContext.New(plid, _))) -> + // { x. } can be either record construction or computation expression. Try to get all visible record fields first + match GetClassOrRecordFieldsEnvironmentLookupResolutions(mkPos line loc, plid) |> toCompletionItems with + | [],_,_ -> + // no record fields found, return completion list as if we were outside any computation expression + GetDeclaredItems (parseResultsOpt, lineStr, origLongIdentOpt, colAtEndOfNamesAndResidue, residueOpt, lastDotPos, line, loc, filterCtors,resolveOverloads, hasTextChangedSinceLastTypecheck, false, fun() -> []) + | result -> Some(result) + + // Completion at ' { XXX = ... with ... } " + | Some(CompletionContext.RecordField(RecordContext.CopyOnUpdate(r, (plid, _)))) -> + match GetRecdFieldsForExpr(r) with + | None -> + Some (GetClassOrRecordFieldsEnvironmentLookupResolutions(mkPos line loc, plid)) + |> Option.map toCompletionItems + | Some (items, denv, m) -> + Some (List.map ItemWithNoInst items, denv, m) + |> Option.map toCompletionItems + + // Completion at ' { XXX = ... with ... } " + | Some(CompletionContext.RecordField(RecordContext.Constructor(typeName))) -> + Some(GetClassOrRecordFieldsEnvironmentLookupResolutions(mkPos line loc, [typeName])) + |> Option.map toCompletionItems + + // Completion at ' SomeMethod( ... ) ' with named arguments + | Some(CompletionContext.ParameterList (endPos, fields)) -> + let results = GetNamedParametersAndSettableFields endPos hasTextChangedSinceLastTypecheck + + let declaredItems = + GetDeclaredItems (parseResultsOpt, lineStr, origLongIdentOpt, colAtEndOfNamesAndResidue, residueOpt, lastDotPos, line, loc, filterCtors, resolveOverloads, + hasTextChangedSinceLastTypecheck, false, getAllSymbols) + + match results with + | NameResResult.Members(items, denv, m) -> + let filtered = + items + |> RemoveDuplicateItems g + |> RemoveExplicitlySuppressed g + |> List.filter (fun item -> not (fields.Contains item.Item.DisplayName)) + |> List.map (fun item -> + { ItemWithInst = item + Kind = CompletionItemKind.Argument + MinorPriority = 0 + IsOwnMember = false + Type = None + Unresolved = None }) + match declaredItems with + | None -> Some (toCompletionItems (items, denv, m)) + | Some (declItems, declaredDisplayEnv, declaredRange) -> Some (filtered @ declItems, declaredDisplayEnv, declaredRange) + | _ -> declaredItems + + | Some(CompletionContext.AttributeApplication) -> + GetDeclaredItems (parseResultsOpt, lineStr, origLongIdentOpt, colAtEndOfNamesAndResidue, residueOpt, lastDotPos, line, loc, filterCtors, resolveOverloads, hasTextChangedSinceLastTypecheck, false, getAllSymbols) + |> Option.map (fun (items, denv, m) -> + items + |> List.filter (fun cItem -> + match cItem.Item with + | Item.ModuleOrNamespaces _ -> true + | _ when IsAttribute infoReader cItem.Item -> true + | _ -> false), denv, m) + + | Some(CompletionContext.OpenDeclaration) -> + GetDeclaredItems (parseResultsOpt, lineStr, origLongIdentOpt, colAtEndOfNamesAndResidue, residueOpt, lastDotPos, line, loc, filterCtors, resolveOverloads, hasTextChangedSinceLastTypecheck, false, getAllSymbols) + |> Option.map (fun (items, denv, m) -> + items |> List.filter (fun x -> match x.Item with Item.ModuleOrNamespaces _ -> true | _ -> false), denv, m) + + // Completion at '(x: ...)" + | Some (CompletionContext.PatternType) -> + GetDeclaredItems (parseResultsOpt, lineStr, origLongIdentOpt, colAtEndOfNamesAndResidue, residueOpt, lastDotPos, line, loc, filterCtors, resolveOverloads, hasTextChangedSinceLastTypecheck, false, getAllSymbols) + |> Option.map (fun (items, denv, m) -> + items + |> List.filter (fun cItem -> + match cItem.Item with + | Item.ModuleOrNamespaces _ + | Item.Types _ + | Item.UnqualifiedType _ + | Item.ExnCase _ -> true + | _ -> false), denv, m) + + // Other completions + | cc -> + match residueOpt |> Option.bind Seq.tryHead with + | Some ''' -> + // The last token in + // let x = 'E + // is Ident with text "'E", however it's either unfinished char literal or generic parameter. + // We should not provide any completion in the former case, and we don't provide it for the latter one for now + // because providing generic parameters list is context aware, which we don't have here (yet). + None + | _ -> + let isInRangeOperator = (match cc with Some (CompletionContext.RangeOperator) -> true | _ -> false) + GetDeclaredItems (parseResultsOpt, lineStr, origLongIdentOpt, colAtEndOfNamesAndResidue, residueOpt, lastDotPos, line, loc, filterCtors,resolveOverloads, hasTextChangedSinceLastTypecheck, isInRangeOperator, getAllSymbols) + + res |> Option.map (fun (items, denv, m) -> items, denv, completionContext, m) + + /// Return 'false' if this is not a completion item valid in an interface file. + let IsValidSignatureFileItem item = + 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 + NameResolution.GetVisibleNamespacesAndModulesAtPoint ncenv nenv m ad + + /// Determines if a long ident is resolvable at a specific point. + member __.IsRelativeNameResolvable(cursorPos: pos, plid: string list, item: Item) : bool = + ErrorScope.Protect + Range.range0 + (fun () -> + /// Find items in the best naming environment. + let (nenv, ad), m = GetBestEnvForPos cursorPos + NameResolution.IsItemResolvable ncenv nenv m ad plid item) + (fun msg -> + Trace.TraceInformation(sprintf "FCS: recovering from error in IsRelativeNameResolvable: '%s'" msg) + false) + + /// Determines if a long ident is resolvable at a specific point. + member scope.IsRelativeNameResolvableFromSymbol(cursorPos: pos, plid: string list, symbol: FSharpSymbol) : bool = + scope.IsRelativeNameResolvable(cursorPos, plid, symbol.Item) + + /// Get the auto-complete items at a location + member __.GetDeclarations (ctok, parseResultsOpt, line, lineStr, partialName, getAllEntities, hasTextChangedSinceLastTypecheck) = + let isInterfaceFile = SourceFileImpl.IsInterfaceFile mainInputFileName + ErrorScope.Protect Range.range0 + (fun () -> + match GetDeclItemsForNamesAtPosition(ctok, parseResultsOpt, Some partialName.QualifyingIdents, Some partialName.PartialIdent, partialName.LastDotPos, line, lineStr, partialName.EndColumn + 1, ResolveTypeNamesToCtors, ResolveOverloads.Yes, getAllEntities, hasTextChangedSinceLastTypecheck) with + | None -> FSharpDeclarationListInfo.Empty + | Some (items, denv, ctx, m) -> + let items = if isInterfaceFile then items |> List.filter (fun x -> IsValidSignatureFileItem x.Item) else items + let getAccessibility item = FSharpSymbol.GetAccessibility (FSharpSymbol.Create(cenv, item)) + let currentNamespaceOrModule = + parseResultsOpt + |> Option.bind (fun x -> x.ParseTree) + |> Option.map (fun parsedInput -> UntypedParseImpl.GetFullNameOfSmallestModuleOrNamespaceAtPoint(parsedInput, mkPos line 0)) + let isAttributeApplication = ctx = Some CompletionContext.AttributeApplication + FSharpDeclarationListInfo.Create(infoReader,m,denv,getAccessibility,items,reactorOps,currentNamespaceOrModule,isAttributeApplication)) + (fun msg -> + Trace.TraceInformation(sprintf "FCS: recovering from error in GetDeclarations: '%s'" msg) + FSharpDeclarationListInfo.Error msg) + + /// Get the symbols for auto-complete items at a location + member __.GetDeclarationListSymbols (ctok, parseResultsOpt, line, lineStr, partialName, getAllEntities, hasTextChangedSinceLastTypecheck) = + let isInterfaceFile = SourceFileImpl.IsInterfaceFile mainInputFileName + ErrorScope.Protect Range.range0 + (fun () -> + match GetDeclItemsForNamesAtPosition(ctok, parseResultsOpt, Some partialName.QualifyingIdents, Some partialName.PartialIdent, partialName.LastDotPos, line, lineStr, partialName.EndColumn + 1, ResolveTypeNamesToCtors, ResolveOverloads.Yes, getAllEntities, hasTextChangedSinceLastTypecheck) with + | None -> List.Empty + | Some (items, denv, _, m) -> + let items = if isInterfaceFile then items |> List.filter (fun x -> IsValidSignatureFileItem x.Item) else items + + //do filtering like Declarationset + let items = items |> RemoveExplicitlySuppressedCompletionItems g + + // Sort by name. For things with the same name, + // - show types with fewer generic parameters first + // - show types before over other related items - they usually have very useful XmlDocs + let items = + items |> List.sortBy (fun d -> + let n = + match d.Item with + | Item.Types (_,(TType_app(tcref,_) :: _)) -> 1 + tcref.TyparsNoRange.Length + // Put delegate ctors after types, sorted by #typars. RemoveDuplicateItems will remove FakeInterfaceCtor and DelegateCtor if an earlier type is also reported with this name + | Item.FakeInterfaceCtor (TType_app(tcref,_)) + | Item.DelegateCtor (TType_app(tcref,_)) -> 1000 + tcref.TyparsNoRange.Length + // Put type ctors after types, sorted by #typars. RemoveDuplicateItems will remove DefaultStructCtors if a type is also reported with this name + | Item.CtorGroup (_, (cinfo :: _)) -> 1000 + 10 * cinfo.DeclaringTyconRef.TyparsNoRange.Length + | _ -> 0 + (d.Item.DisplayName,n)) + + // Remove all duplicates. We've put the types first, so this removes the DelegateCtor and DefaultStructCtor's. + let items = items |> RemoveDuplicateCompletionItems g + + // Group by compiled name for types, display name for functions + // (We don't want types with the same display name to be grouped as overloads) + let items = + items |> List.groupBy (fun d -> + match d.Item with + | Item.Types (_,(TType_app(tcref,_) :: _)) + | Item.ExnCase tcref -> tcref.LogicalName + | Item.UnqualifiedType(tcref :: _) + | Item.FakeInterfaceCtor (TType_app(tcref,_)) + | Item.DelegateCtor (TType_app(tcref,_)) -> tcref.CompiledName + | Item.CtorGroup (_, (cinfo :: _)) -> + cinfo.ApparentEnclosingTyconRef.CompiledName + | _ -> d.Item.DisplayName) + + // Filter out operators (and list) + let items = + // Check whether this item looks like an operator. + let isOpItem(nm, item: CompletionItem list) = + match item |> List.map (fun x -> x.Item) with + | [Item.Value _] + | [Item.MethodGroup(_,[_],_)] -> IsOperatorName nm + | [Item.UnionCase _] -> IsOperatorName nm + | _ -> false + + let isFSharpList nm = (nm = "[]") // list shows up as a Type and a UnionCase, only such entity with a symbolic name, but want to filter out of intellisense + + items |> List.filter (fun (nm,items) -> not (isOpItem(nm,items)) && not(isFSharpList nm)) + + let items = + // Filter out duplicate names + items |> List.map (fun (_nm,itemsWithSameName) -> + match itemsWithSameName with + | [] -> failwith "Unexpected empty bag" + | items -> + items + |> List.map (fun item -> let symbol = FSharpSymbol.Create(cenv, item.Item) + FSharpSymbolUse(g, denv, symbol, ItemOccurence.Use, m))) + + //end filtering + items) + (fun msg -> + Trace.TraceInformation(sprintf "FCS: recovering from error in GetDeclarationListSymbols: '%s'" msg) + []) + + /// Get the "reference resolution" tooltip for at a location + member __.GetReferenceResolutionStructuredToolTipText(ctok, line,col) = + + RequireCompilationThread ctok // the operations in this method need the reactor thread but the reasons why are not yet grounded + + let pos = mkPos line col + let isPosMatch(pos, ar:AssemblyReference) : bool = + let isRangeMatch = (Range.rangeContainsPos ar.Range pos) + let isNotSpecialRange = not (Range.equals ar.Range rangeStartup) && not (Range.equals ar.Range range0) && not (Range.equals ar.Range rangeCmdArgs) + let isMatch = isRangeMatch && isNotSpecialRange + isMatch + + let dataTipOfReferences() = + let matches = + match loadClosure with + | None -> [] + | Some(loadClosure) -> + loadClosure.References + |> List.map snd + |> List.concat + |> List.filter(fun ar->isPosMatch(pos, ar.originalReference)) + + match matches with + | resolved::_ // Take the first seen + | [resolved] -> + let tip = wordL (TaggedTextOps.tagStringLiteral((resolved.prepareToolTip ()).TrimEnd([|'\n'|]))) + FSharpStructuredToolTipText.FSharpToolTipText [FSharpStructuredToolTipElement.Single(tip, FSharpXmlDoc.None)] + + | [] -> FSharpStructuredToolTipText.FSharpToolTipText [] + + ErrorScope.Protect Range.range0 + dataTipOfReferences + (fun err -> + Trace.TraceInformation(sprintf "FCS: recovering from error in GetReferenceResolutionStructuredToolTipText: '%s'" err) + FSharpToolTipText [FSharpStructuredToolTipElement.CompositionError err]) + + // GetToolTipText: return the "pop up" (or "Quick Info") text given a certain context. + member __.GetStructuredToolTipText(ctok, line, lineStr, colAtEndOfNames, names) = + let Compute() = + ErrorScope.Protect Range.range0 + (fun () -> + match GetDeclItemsForNamesAtPosition(ctok, None,Some(names),None,None,line,lineStr,colAtEndOfNames,ResolveTypeNamesToCtors,ResolveOverloads.Yes,(fun() -> []),fun _ -> false) with + | None -> FSharpToolTipText [] + | Some(items, denv, _, m) -> + FSharpToolTipText(items |> List.map (fun x -> FormatStructuredDescriptionOfItem false infoReader m denv x.ItemWithInst))) + (fun err -> + Trace.TraceInformation(sprintf "FCS: recovering from error in GetStructuredToolTipText: '%s'" err) + FSharpToolTipText [FSharpStructuredToolTipElement.CompositionError err]) + + // See devdiv bug 646520 for rationale behind truncating and caching these quick infos (they can be big!) + let key = line,colAtEndOfNames,lineStr + match getToolTipTextCache.TryGet (ctok, key) with + | Some res -> res + | None -> + let res = Compute() + getToolTipTextCache.Put(ctok, key,res) + res + + member __.GetF1Keyword (ctok, line, lineStr, colAtEndOfNames, names) : string option = + ErrorScope.Protect Range.range0 + (fun () -> + match GetDeclItemsForNamesAtPosition(ctok, None, Some names, None, None, line, lineStr, colAtEndOfNames, ResolveTypeNamesToCtors, ResolveOverloads.No,(fun() -> []), fun _ -> false) with // F1 Keywords do not distinguish between overloads + | None -> None + | Some (items: CompletionItem list, _,_, _) -> + match items with + | [] -> None + | [item] -> + GetF1Keyword g item.Item + | _ -> + // handle new Type() + let allTypes, constr, ty = + List.fold + (fun (allTypes,constr,ty) (item: CompletionItem) -> + match item.Item, constr, ty with + | (Item.Types _) as t, _, None -> allTypes, constr, Some t + | (Item.Types _), _, _ -> allTypes, constr, ty + | (Item.CtorGroup _), None, _ -> allTypes, Some item.Item, ty + | _ -> false, None, None) + (true,None,None) items + match allTypes, constr, ty with + | true, Some (Item.CtorGroup(_, _) as item), _ + -> GetF1Keyword g item + | true, _, Some ty + -> GetF1Keyword g ty + | _ -> None + ) + (fun msg -> + Trace.TraceInformation(sprintf "FCS: recovering from error in GetF1Keyword: '%s'" msg) + None) + + member __.GetMethods (ctok, line, lineStr, colAtEndOfNames, namesOpt) = + ErrorScope.Protect Range.range0 + (fun () -> + match GetDeclItemsForNamesAtPosition(ctok, None,namesOpt,None,None,line,lineStr,colAtEndOfNames,ResolveTypeNamesToCtors,ResolveOverloads.No,(fun() -> []),fun _ -> false) with + | None -> FSharpMethodGroup("",[| |]) + | Some (items, denv, _, m) -> + // GetDeclItemsForNamesAtPosition returns Items.Types and Item.CtorGroup for `new T(|)`, + // the Item.Types is not needed here as it duplicates (at best) parameterless ctor. + let ctors = items |> List.filter (fun x -> match x.Item with Item.CtorGroup _ -> true | _ -> false) + let items = + match ctors with + | [] -> items + | ctors -> ctors + FSharpMethodGroup.Create(infoReader, m, denv, items |> List.map (fun x -> x.ItemWithInst))) + (fun msg -> + Trace.TraceInformation(sprintf "FCS: recovering from error in GetMethods: '%s'" msg) + FSharpMethodGroup(msg,[| |])) + + member __.GetMethodsAsSymbols (ctok, line, lineStr, colAtEndOfNames, names) = + ErrorScope.Protect Range.range0 + (fun () -> + match GetDeclItemsForNamesAtPosition (ctok, None,Some(names), None, None,line, lineStr, colAtEndOfNames, ResolveTypeNamesToCtors, ResolveOverloads.No,(fun() -> []),fun _ -> false) with + | None | Some ([],_,_,_) -> None + | Some (items, denv, _, m) -> + let allItems = items |> List.collect (fun item -> SymbolHelpers.FlattenItems g m item.Item) + let symbols = allItems |> List.map (fun item -> FSharpSymbol.Create(cenv, item)) + Some (symbols, denv, m) + ) + (fun msg -> + Trace.TraceInformation(sprintf "FCS: recovering from error in GetMethodsAsSymbols: '%s'" msg) + None) + + member __.GetDeclarationLocation (ctok, line, lineStr, colAtEndOfNames, names, preferFlag) = + ErrorScope.Protect Range.range0 + (fun () -> + match GetDeclItemsForNamesAtPosition (ctok, None,Some(names), None, None, line, lineStr, colAtEndOfNames, ResolveTypeNamesToCtors,ResolveOverloads.Yes,(fun() -> []), fun _ -> false) with + | None + | Some ([], _, _, _) -> FSharpFindDeclResult.DeclNotFound (FSharpFindDeclFailureReason.Unknown "") + | Some (item :: _, _, _, _) -> + let getTypeVarNames (ilinfo: ILMethInfo) = + let classTypeParams = ilinfo.DeclaringTyconRef.ILTyconRawMetadata.GenericParams |> List.map (fun paramDef -> paramDef.Name) + let methodTypeParams = ilinfo.FormalMethodTypars |> List.map (fun ty -> ty.Name) + classTypeParams @ methodTypeParams |> Array.ofList + + let result = + match item.Item with + | Item.CtorGroup (_, (ILMeth (_,ilinfo,_)) :: _) -> + match ilinfo.MetadataScope with + | ILScopeRef.Assembly assemblyRef -> + let typeVarNames = getTypeVarNames ilinfo + ParamTypeSymbol.tryOfILTypes typeVarNames ilinfo.ILMethodRef.ArgTypes + |> Option.map (fun args -> + let externalSym = ExternalSymbol.Constructor (ilinfo.ILMethodRef.DeclaringTypeRef.FullName, args) + FSharpFindDeclResult.ExternalDecl (assemblyRef.Name, externalSym)) + | _ -> None + + | Item.MethodGroup (name, (ILMeth (_,ilinfo,_)) :: _, _) -> + match ilinfo.MetadataScope with + | ILScopeRef.Assembly assemblyRef -> + let typeVarNames = getTypeVarNames ilinfo + ParamTypeSymbol.tryOfILTypes typeVarNames ilinfo.ILMethodRef.ArgTypes + |> Option.map (fun args -> + let externalSym = ExternalSymbol.Method (ilinfo.ILMethodRef.DeclaringTypeRef.FullName, name, args, ilinfo.ILMethodRef.GenericArity) + FSharpFindDeclResult.ExternalDecl (assemblyRef.Name, externalSym)) + | _ -> None + + | Item.Property (name, ILProp propInfo :: _) -> + let methInfo = + if propInfo.HasGetter then Some propInfo.GetterMethod + elif propInfo.HasSetter then Some propInfo.SetterMethod + else None + + match methInfo with + | Some methInfo -> + match methInfo.MetadataScope with + | ILScopeRef.Assembly assemblyRef -> + let externalSym = ExternalSymbol.Property (methInfo.ILMethodRef.DeclaringTypeRef.FullName, name) + Some (FSharpFindDeclResult.ExternalDecl (assemblyRef.Name, externalSym)) + | _ -> None + | None -> None + + | Item.ILField (ILFieldInfo (typeInfo, fieldDef)) when not typeInfo.TyconRefOfRawMetadata.IsLocalRef -> + match typeInfo.ILScopeRef with + | ILScopeRef.Assembly assemblyRef -> + let externalSym = ExternalSymbol.Field (typeInfo.ILTypeRef.FullName, fieldDef.Name) + Some (FSharpFindDeclResult.ExternalDecl (assemblyRef.Name, externalSym)) + | _ -> None + + | Item.Event (ILEvent (ILEventInfo (typeInfo, eventDef))) when not typeInfo.TyconRefOfRawMetadata.IsLocalRef -> + match typeInfo.ILScopeRef with + | ILScopeRef.Assembly assemblyRef -> + let externalSym = ExternalSymbol.Event (typeInfo.ILTypeRef.FullName, eventDef.Name) + Some (FSharpFindDeclResult.ExternalDecl (assemblyRef.Name, externalSym)) + | _ -> None + + | Item.ImplicitOp(_, {contents = Some(TraitConstraintSln.FSMethSln(_, _vref, _))}) -> + //Item.Value(vref) + None + + | Item.Types (_, TType_app (tr, _) :: _) when tr.IsLocalRef && tr.IsTypeAbbrev -> None + + | Item.Types (_, [ AppTy g (tr, _) ]) when not tr.IsLocalRef -> + match tr.TypeReprInfo, tr.PublicPath with + | TILObjectRepr(TILObjectReprData (ILScopeRef.Assembly assemblyRef, _, _)), Some (PubPath parts) -> + let fullName = parts |> String.concat "." + Some (FSharpFindDeclResult.ExternalDecl (assemblyRef.Name, ExternalSymbol.Type fullName)) + | _ -> None + | _ -> None + match result with + | Some x -> x + | None -> + match rangeOfItem g preferFlag item.Item with + | Some itemRange -> + let projectDir = Filename.directoryName (if projectFileName = "" then mainInputFileName else projectFileName) + let range = fileNameOfItem g (Some projectDir) itemRange item.Item + mkRange range itemRange.Start itemRange.End + |> FSharpFindDeclResult.DeclFound + | None -> + match item.Item with +#if !NO_EXTENSIONTYPING +// provided items may have TypeProviderDefinitionLocationAttribute that binds them to some location + | Item.CtorGroup (name, ProvidedMeth (_)::_ ) + | Item.MethodGroup(name, ProvidedMeth (_)::_, _) + | Item.Property (name, ProvidedProp (_)::_ ) -> FSharpFindDeclFailureReason.ProvidedMember name + | Item.Event ( ProvidedEvent(_) as e ) -> FSharpFindDeclFailureReason.ProvidedMember e.EventName + | Item.ILField ( ProvidedField(_) as f ) -> FSharpFindDeclFailureReason.ProvidedMember f.FieldName + | SymbolHelpers.ItemIsProvidedType g (tcref) -> FSharpFindDeclFailureReason.ProvidedType tcref.DisplayName +#endif + | _ -> FSharpFindDeclFailureReason.Unknown "" + |> FSharpFindDeclResult.DeclNotFound + ) + (fun msg -> + Trace.TraceInformation(sprintf "FCS: recovering from error in GetDeclarationLocation: '%s'" msg) + FSharpFindDeclResult.DeclNotFound (FSharpFindDeclFailureReason.Unknown msg)) + + member __.GetSymbolUseAtLocation (ctok, line, lineStr, colAtEndOfNames, names) = + ErrorScope.Protect Range.range0 + (fun () -> + match GetDeclItemsForNamesAtPosition (ctok, None,Some(names), None, None, line, lineStr, colAtEndOfNames, ResolveTypeNamesToCtors, ResolveOverloads.Yes,(fun() -> []), fun _ -> false) with + | None | Some ([], _, _, _) -> None + | Some (item :: _, denv, _, m) -> + let symbol = FSharpSymbol.Create(cenv, item.Item) + Some (symbol, denv, m) + ) + (fun msg -> + Trace.TraceInformation(sprintf "FCS: recovering from error in GetSymbolUseAtLocation: '%s'" msg) + None) + + member __.PartialAssemblySignatureForFile = + FSharpAssemblySignature(g, thisCcu, ccuSigForFile, tcImports, None, ccuSigForFile) + + member __.AccessRights = tcAccessRights + + member __.GetReferencedAssemblies() = + [ for x in tcImports.GetImportedAssemblies() do + yield FSharpAssembly(g, tcImports, x.FSharpViewOfMetadata) ] + + member __.GetFormatSpecifierLocationsAndArity() = + sSymbolUses.GetFormatSpecifierLocationsAndArity() + + member __.GetSemanticClassification(range: range option) : (range * SemanticClassificationType) [] = + ErrorScope.Protect Range.range0 + (fun () -> + let (|LegitTypeOccurence|_|) = function + | ItemOccurence.UseInType + | ItemOccurence.UseInAttribute + | ItemOccurence.Use _ + | ItemOccurence.Binding _ + | ItemOccurence.Pattern _ -> Some() + | _ -> None + + let (|OptionalArgumentAttribute|_|) ttype = + match ttype with + | TType.TType_app(tref, _) when tref.Stamp = g.attrib_OptionalArgumentAttribute.TyconRef.Stamp -> Some() + | _ -> None + + let (|KeywordIntrinsicValue|_|) (vref: ValRef) = + if valRefEq g g.raise_vref vref || + valRefEq g g.reraise_vref vref || + valRefEq g g.typeof_vref vref || + valRefEq g g.typedefof_vref vref || + valRefEq g g.sizeof_vref vref + // TODO uncomment this after `nameof` operator is implemented + // || valRefEq g g.nameof_vref vref + then Some() + else None + + let (|EnumCaseFieldInfo|_|) (rfinfo : RecdFieldInfo) = + match rfinfo.TyconRef.TypeReprInfo with + | TFSharpObjectRepr x -> + match x.fsobjmodel_kind with + | TTyconEnum -> Some () + | _ -> None + | _ -> None + + let resolutions = + match range with + | Some range -> + sResolutions.CapturedNameResolutions + |> Seq.filter (fun cnr -> rangeContainsPos range cnr.Range.Start || rangeContainsPos range cnr.Range.End) + | None -> + sResolutions.CapturedNameResolutions :> seq<_> + + let isDisposableTy (ty: TType) = + protectAssemblyExplorationNoReraise false false (fun () -> Infos.ExistsHeadTypeInEntireHierarchy g amap range0 ty g.tcref_System_IDisposable) + + let isStructTyconRef (tyconRef: TyconRef) = + let ty = generalizedTyconRef tyconRef + let underlyingTy = stripTyEqnsAndMeasureEqns g ty + isStructTy g underlyingTy + + let isValRefMutable (vref: ValRef) = + // Mutable values, ref cells, and non-inref byrefs are mutable. + vref.IsMutable + || Tastops.isRefCellTy g vref.Type + || (Tastops.isByrefTy g vref.Type && not (Tastops.isInByrefTy g vref.Type)) + + let isRecdFieldMutable (rfinfo: RecdFieldInfo) = + (rfinfo.RecdField.IsMutable && rfinfo.LiteralValue.IsNone) + || Tastops.isRefCellTy g rfinfo.RecdField.FormalType + + resolutions + |> Seq.choose (fun cnr -> + match cnr with + // 'seq' in 'seq { ... }' gets colored as keywords + | CNR(_, (Item.Value vref), ItemOccurence.Use, _, _, _, m) when valRefEq g g.seq_vref vref -> + Some (m, SemanticClassificationType.ComputationExpression) + | CNR(_, (Item.Value vref), _, _, _, _, m) when isValRefMutable vref -> + Some (m, SemanticClassificationType.MutableVar) + | CNR(_, Item.Value KeywordIntrinsicValue, ItemOccurence.Use, _, _, _, m) -> + Some (m, SemanticClassificationType.IntrinsicFunction) + | CNR(_, (Item.Value vref), _, _, _, _, m) when isFunction g vref.Type -> + if valRefEq g g.range_op_vref vref || valRefEq g g.range_step_op_vref vref then + None + elif vref.IsPropertyGetterMethod || vref.IsPropertySetterMethod then + Some (m, SemanticClassificationType.Property) + elif IsOperatorName vref.DisplayName then + Some (m, SemanticClassificationType.Operator) + else + Some (m, SemanticClassificationType.Function) + | CNR(_, Item.RecdField rfinfo, _, _, _, _, m) when isRecdFieldMutable rfinfo -> + Some (m, SemanticClassificationType.MutableVar) + | CNR(_, Item.RecdField rfinfo, _, _, _, _, m) when isFunction g rfinfo.FieldType -> + Some (m, SemanticClassificationType.Function) + | CNR(_, Item.RecdField EnumCaseFieldInfo, _, _, _, _, m) -> + Some (m, SemanticClassificationType.Enumeration) + | CNR(_, Item.MethodGroup _, _, _, _, _, m) -> + Some (m, SemanticClassificationType.Function) + // custom builders, custom operations get colored as keywords + | CNR(_, (Item.CustomBuilder _ | Item.CustomOperation _), ItemOccurence.Use, _, _, _, m) -> + Some (m, SemanticClassificationType.ComputationExpression) + // types get colored as types when they occur in syntactic types or custom attributes + // typevariables get colored as types when they occur in syntactic types custom builders, custom operations get colored as keywords + | CNR(_, Item.Types (_, [OptionalArgumentAttribute]), LegitTypeOccurence, _, _, _, _) -> None + | CNR(_, Item.CtorGroup(_, [MethInfo.FSMeth(_, OptionalArgumentAttribute, _, _)]), LegitTypeOccurence, _, _, _, _) -> None + | CNR(_, Item.Types(_, types), LegitTypeOccurence, _, _, _, m) when types |> List.exists (isInterfaceTy g) -> + Some (m, SemanticClassificationType.Interface) + | CNR(_, Item.Types(_, types), LegitTypeOccurence, _, _, _, m) when types |> List.exists (isStructTy g) -> + Some (m, SemanticClassificationType.ValueType) + | CNR(_, Item.Types(_, TType_app(tyconRef, TType_measure _ :: _) :: _), LegitTypeOccurence, _, _, _, m) when isStructTyconRef tyconRef -> + Some (m, SemanticClassificationType.ValueType) + | CNR(_, Item.Types(_, types), LegitTypeOccurence, _, _, _, m) when types |> List.exists isDisposableTy -> + Some (m, SemanticClassificationType.Disposable) + | CNR(_, Item.Types _, LegitTypeOccurence, _, _, _, m) -> + Some (m, SemanticClassificationType.ReferenceType) + | CNR(_, (Item.TypeVar _ ), LegitTypeOccurence, _, _, _, m) -> + Some (m, SemanticClassificationType.TypeArgument) + | CNR(_, Item.UnqualifiedType tyconRefs, LegitTypeOccurence, _, _, _, m) -> + if tyconRefs |> List.exists (fun tyconRef -> tyconRef.Deref.IsStructOrEnumTycon) then + Some (m, SemanticClassificationType.ValueType) + else Some (m, SemanticClassificationType.ReferenceType) + | CNR(_, Item.CtorGroup(_, minfos), LegitTypeOccurence, _, _, _, m) -> + if minfos |> List.exists (fun minfo -> isStructTy g minfo.ApparentEnclosingType) then + Some (m, SemanticClassificationType.ValueType) + else Some (m, SemanticClassificationType.ReferenceType) + | CNR(_, Item.ExnCase _, LegitTypeOccurence, _, _, _, m) -> + Some (m, SemanticClassificationType.ReferenceType) + | CNR(_, Item.ModuleOrNamespaces refs, LegitTypeOccurence, _, _, _, m) when refs |> List.exists (fun x -> x.IsModule) -> + Some (m, SemanticClassificationType.Module) + | CNR(_, (Item.ActivePatternCase _ | Item.UnionCase _ | Item.ActivePatternResult _), _, _, _, _, m) -> + Some (m, SemanticClassificationType.UnionCase) + | _ -> None) + |> Seq.toArray + |> Array.append (sSymbolUses.GetFormatSpecifierLocationsAndArity() |> Array.map (fun m -> fst m, SemanticClassificationType.Printf)) + ) + (fun msg -> + Trace.TraceInformation(sprintf "FCS: recovering from error in GetSemanticClassification: '%s'" msg) + Array.empty) + + /// The resolutions in the file + member __.ScopeResolutions = sResolutions + + /// The uses of symbols in the analyzed file + member __.ScopeSymbolUses = sSymbolUses + + member __.TcGlobals = g + + member __.TcImports = tcImports + + /// The inferred signature of the file + member __.CcuSigForFile = ccuSigForFile + + /// The assembly being analyzed + member __.ThisCcu = thisCcu + + member __.ImplementationFile = implFileOpt + + /// All open declarations in the file, including auto open modules + member __.OpenDeclarations = openDeclarations + + member __.SymbolEnv = cenv + + override __.ToString() = "TypeCheckInfo(" + mainInputFileName + ")" + +type FSharpParsingOptions = + { SourceFiles: string [] + ConditionalCompilationDefines: string list + ErrorSeverityOptions: FSharpErrorSeverityOptions + IsInteractive: bool + LightSyntax: bool option + CompilingFsLib: bool + IsExe: bool } + + member x.LastFileName = + Debug.Assert(not (Array.isEmpty x.SourceFiles), "Parsing options don't contain any file") + Array.last x.SourceFiles + + static member Default = + { SourceFiles = Array.empty + ConditionalCompilationDefines = [] + ErrorSeverityOptions = FSharpErrorSeverityOptions.Default + IsInteractive = false + LightSyntax = None + CompilingFsLib = false + IsExe = false } + + static member FromTcConfig(tcConfig: TcConfig, sourceFiles, isInteractive: bool) = + { SourceFiles = sourceFiles + ConditionalCompilationDefines = tcConfig.conditionalCompilationDefines + ErrorSeverityOptions = tcConfig.errorSeverityOptions + IsInteractive = isInteractive + LightSyntax = tcConfig.light + CompilingFsLib = tcConfig.compilingFslib + IsExe = tcConfig.target.IsExe } + + static member FromTcConfigBuidler(tcConfigB: TcConfigBuilder, sourceFiles, isInteractive: bool) = + { + SourceFiles = sourceFiles + ConditionalCompilationDefines = tcConfigB.conditionalCompilationDefines + ErrorSeverityOptions = tcConfigB.errorSeverityOptions + IsInteractive = isInteractive + LightSyntax = tcConfigB.light + CompilingFsLib = tcConfigB.compilingFslib + IsExe = tcConfigB.target.IsExe + } + +module internal ParseAndCheckFile = + + /// Error handler for parsing & type checking while processing a single file + type ErrorHandler(reportErrors, mainInputFileName, errorSeverityOptions: FSharpErrorSeverityOptions, sourceText: ISourceText, suggestNamesForErrors: bool) = + let mutable options = errorSeverityOptions + let errorsAndWarningsCollector = new ResizeArray<_>() + let mutable errorCount = 0 + + // We'll need number of lines for adjusting error messages at EOF + let fileInfo = sourceText.GetLastCharacterPosition() + + // This function gets called whenever an error happens during parsing or checking + let diagnosticSink sev (exn: PhasedDiagnostic) = + // Sanity check here. The phase of an error should be in a phase known to the language service. + let exn = + if not(exn.IsPhaseInCompile()) then + // Reaching this point means that the error would be sticky if we let it prop up to the language service. + // Assert and recover by replacing phase with one known to the language service. + Trace.TraceInformation(sprintf "The subcategory '%s' seen in an error should not be seen by the language service" (exn.Subcategory())) + { exn with Phase = BuildPhase.TypeCheck } + else exn + if reportErrors then + let report exn = + for ei in ErrorHelpers.ReportError (options, false, mainInputFileName, fileInfo, (exn, sev), suggestNamesForErrors) do + errorsAndWarningsCollector.Add ei + if sev = FSharpErrorSeverity.Error then + errorCount <- errorCount + 1 + + match exn with +#if !NO_EXTENSIONTYPING + | { Exception = (:? TypeProviderError as tpe) } -> tpe.Iter(fun e -> report { exn with Exception = e }) +#endif + | e -> report e + + let errorLogger = + { new ErrorLogger("ErrorHandler") with + member x.DiagnosticSink (exn, isError) = diagnosticSink (if isError then FSharpErrorSeverity.Error else FSharpErrorSeverity.Warning) exn + member x.ErrorCount = errorCount } + + // Public members + member __.ErrorLogger = errorLogger + + member __.CollectedDiagnostics = errorsAndWarningsCollector.ToArray() + + member __.ErrorCount = errorCount + + member __.ErrorSeverityOptions with set opts = options <- opts + + member __.AnyErrors = errorCount > 0 + + let getLightSyntaxStatus fileName options = + let lower = String.lowercase fileName + let lightOnByDefault = List.exists (Filename.checkSuffix lower) FSharpLightSyntaxFileSuffixes + let lightSyntaxStatus = if lightOnByDefault then (options.LightSyntax <> Some false) else (options.LightSyntax = Some true) + LightSyntaxStatus(lightSyntaxStatus, true) + + let createLexerFunction fileName options lexbuf (errHandler: ErrorHandler) = + let lightSyntaxStatus = getLightSyntaxStatus fileName options + + // If we're editing a script then we define INTERACTIVE otherwise COMPILED. + // Since this parsing for intellisense we always define EDITING. + let defines = (SourceFileImpl.AdditionalDefinesForUseInEditor options.IsInteractive) @ options.ConditionalCompilationDefines + + // Note: we don't really attempt to intern strings across a large scope. + let lexResourceManager = new Lexhelp.LexResourceManager() + + // When analyzing files using ParseOneFile, i.e. for the use of editing clients, we do not apply line directives. + // TODO(pathmap): expose PathMap on the service API, and thread it through here + let lexargs = mkLexargs(fileName, defines, lightSyntaxStatus, lexResourceManager, ref [], errHandler.ErrorLogger, PathMap.empty) + let lexargs = { lexargs with applyLineDirectives = false } + + let tokenizer = LexFilter.LexFilter(lightSyntaxStatus, options.CompilingFsLib, Lexer.token lexargs true, lexbuf) + tokenizer.Lexer + + let createLexbuf sourceText = + UnicodeLexing.SourceTextAsLexbuf(sourceText) + + let matchBraces(sourceText: ISourceText, fileName, options: FSharpParsingOptions, userOpName: string, suggestNamesForErrors: bool) = + let delayedLogger = CapturingErrorLogger("matchBraces") + use _unwindEL = PushErrorLoggerPhaseUntilUnwind (fun _ -> delayedLogger) + use _unwindBP = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse + + Trace.TraceInformation("FCS: {0}.{1} ({2})", userOpName, "matchBraces", fileName) + + // Make sure there is an ErrorLogger installed whenever we do stuff that might record errors, even if we ultimately ignore the errors + let delayedLogger = CapturingErrorLogger("matchBraces") + use _unwindEL = PushErrorLoggerPhaseUntilUnwind (fun _ -> delayedLogger) + use _unwindBP = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse + + let matchingBraces = new ResizeArray<_>() + Lexhelp.usingLexbufForParsing(createLexbuf sourceText, fileName) (fun lexbuf -> + let errHandler = ErrorHandler(false, fileName, options.ErrorSeverityOptions, sourceText, suggestNamesForErrors) + let lexfun = createLexerFunction fileName options lexbuf errHandler + let parenTokensBalance t1 t2 = + match t1, t2 with + | (LPAREN, RPAREN) + | (LPAREN, RPAREN_IS_HERE) + | (LBRACE, RBRACE) + | (LBRACE, RBRACE_IS_HERE) + | (SIG, END) + | (STRUCT, END) + | (LBRACK_BAR, BAR_RBRACK) + | (LBRACK, RBRACK) + | (LBRACK_LESS, GREATER_RBRACK) + | (BEGIN, END) -> true + | (LQUOTE q1, RQUOTE q2) -> q1 = q2 + | _ -> false + let rec matchBraces stack = + match lexfun lexbuf, stack with + | tok2, ((tok1, m1) :: stack') when parenTokensBalance tok1 tok2 -> + matchingBraces.Add(m1, lexbuf.LexemeRange) + matchBraces stack' + | ((LPAREN | LBRACE | LBRACK | LBRACK_BAR | LQUOTE _ | LBRACK_LESS) as tok), _ -> + matchBraces ((tok, lexbuf.LexemeRange) :: stack) + | (EOF _ | LEX_FAILURE _), _ -> () + | _ -> matchBraces stack + matchBraces []) + matchingBraces.ToArray() + + let parseFile(sourceText: ISourceText, fileName, options: FSharpParsingOptions, userOpName: string, suggestNamesForErrors: bool) = + Trace.TraceInformation("FCS: {0}.{1} ({2})", userOpName, "parseFile", fileName) + let errHandler = new ErrorHandler(true, fileName, options.ErrorSeverityOptions, sourceText, suggestNamesForErrors) + use unwindEL = PushErrorLoggerPhaseUntilUnwind (fun _oldLogger -> errHandler.ErrorLogger) + use unwindBP = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse + + let parseResult = + Lexhelp.usingLexbufForParsing(createLexbuf sourceText, fileName) (fun lexbuf -> + let lexfun = createLexerFunction fileName options lexbuf errHandler + let isLastCompiland = + fileName.Equals(options.LastFileName, StringComparison.CurrentCultureIgnoreCase) || + CompileOps.IsScript(fileName) + let isExe = options.IsExe + try Some (ParseInput(lexfun, errHandler.ErrorLogger, lexbuf, None, fileName, (isLastCompiland, isExe))) + with e -> + errHandler.ErrorLogger.StopProcessingRecovery e Range.range0 // don't re-raise any exceptions, we must return None. + None) + errHandler.CollectedDiagnostics, parseResult, errHandler.AnyErrors + + + let ApplyLoadClosure(tcConfig, parsedMainInput, mainInputFileName, loadClosure: LoadClosure option, tcImports: TcImports, backgroundDiagnostics) = + + // If additional references were brought in by the preprocessor then we need to process them + match loadClosure with + | Some loadClosure -> + // Play unresolved references for this file. + tcImports.ReportUnresolvedAssemblyReferences(loadClosure.UnresolvedReferences) + + // If there was a loadClosure, replay the errors and warnings from resolution, excluding parsing + loadClosure.LoadClosureRootFileDiagnostics |> List.iter diagnosticSink + + let fileOfBackgroundError err = (match GetRangeOfDiagnostic (fst err) with Some m-> m.FileName | None -> null) + let sameFile file hashLoadInFile = + (0 = String.Compare(hashLoadInFile, file, StringComparison.OrdinalIgnoreCase)) + + // walk the list of #loads and keep the ones for this file. + let hashLoadsInFile = + loadClosure.SourceFiles + |> List.filter(fun (_,ms) -> ms<>[]) // #loaded file, ranges of #load + + let hashLoadBackgroundDiagnostics, otherBackgroundDiagnostics = + backgroundDiagnostics + |> Array.partition (fun backgroundError -> + hashLoadsInFile + |> List.exists (fst >> sameFile (fileOfBackgroundError backgroundError))) + + // Create single errors for the #load-ed files. + // Group errors and warnings by file name. + let hashLoadBackgroundDiagnosticsGroupedByFileName = + hashLoadBackgroundDiagnostics + |> 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 (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 = 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 ] + + let message = HashLoadedSourceHasIssues(warnings,errors,rangeOfHashLoad) + if errors=[] then warning(message) + else errorR(message) + + // Replay other background errors. + for (phasedError,sev) in otherBackgroundDiagnostics do + if sev = FSharpErrorSeverity.Warning then + warning phasedError.Exception + else errorR phasedError.Exception + + | None -> + // For non-scripts, check for disallow #r and #load. + ApplyMetaCommandsFromInputToTcConfig (tcConfig, parsedMainInput,Path.GetDirectoryName mainInputFileName) |> ignore + + // Type check a single file against an initial context, gleaning both errors and intellisense information. + let CheckOneFile + (parseResults: FSharpParseFileResults, + sourceText: ISourceText, + mainInputFileName: string, + projectFileName: string, + tcConfig: TcConfig, + tcGlobals: TcGlobals, + tcImports: TcImports, + tcState: TcState, + moduleNamesDict: ModuleNamesDict, + loadClosure: LoadClosure option, + // These are the errors and warnings seen by the background compiler for the entire antecedent + backgroundDiagnostics: (PhasedDiagnostic * FSharpErrorSeverity)[], + reactorOps: IReactorOperations, + // Used by 'FSharpDeclarationListInfo' to check the IncrementalBuilder is still alive. + textSnapshotInfo : obj option, + userOpName: string, + suggestNamesForErrors: bool) = async { + + use _logBlock = Logger.LogBlock LogCompilerFunctionId.Service_CheckOneFile + + match parseResults.ParseTree with + // When processing the following cases, we don't need to type-check + | None -> return [||], Result.Error() + + // Run the type checker... + | Some parsedMainInput -> + + // Initialize the error handler + let errHandler = new ErrorHandler(true, mainInputFileName, tcConfig.errorSeverityOptions, sourceText, suggestNamesForErrors) + + use _unwindEL = PushErrorLoggerPhaseUntilUnwind (fun _oldLogger -> errHandler.ErrorLogger) + use _unwindBP = PushThreadBuildPhaseUntilUnwind BuildPhase.TypeCheck + + // Apply nowarns to tcConfig (may generate errors, so ensure errorLogger is installed) + let tcConfig = ApplyNoWarnsToTcConfig (tcConfig, parsedMainInput,Path.GetDirectoryName mainInputFileName) + + // update the error handler with the modified tcConfig + errHandler.ErrorSeverityOptions <- tcConfig.errorSeverityOptions + + // Play background errors and warnings for this file. + for (err,sev) in backgroundDiagnostics do + diagnosticSink (err, (sev = FSharpErrorSeverity.Error)) + + // If additional references were brought in by the preprocessor then we need to process them + ApplyLoadClosure(tcConfig, parsedMainInput, mainInputFileName, loadClosure, tcImports, backgroundDiagnostics) + + // A problem arises with nice name generation, which really should only + // be done in the backend, but is also done in the typechecker for better or worse. + // If we don't do this the NNG accumulates data and we get a memory leak. + tcState.NiceNameGenerator.Reset() + + // Typecheck the real input. + let sink = TcResultsSinkImpl(tcGlobals, sourceText = sourceText) + + let! ct = Async.CancellationToken + + let! resOpt = + async { + try + let checkForErrors() = (parseResults.ParseHadErrors || errHandler.ErrorCount > 0) + + let parsedMainInput, _moduleNamesDict = DeduplicateParsedInputModuleName moduleNamesDict parsedMainInput + + // Typecheck is potentially a long running operation. We chop it up here with an Eventually continuation and, at each slice, give a chance + // for the client to claim the result as obsolete and have the typecheck abort. + + let! result = + TypeCheckOneInputAndFinishEventually(checkForErrors, tcConfig, tcImports, tcGlobals, None, TcResultsSink.WithSink sink, tcState, parsedMainInput) + |> Eventually.repeatedlyProgressUntilDoneOrTimeShareOverOrCanceled maxTimeShareMilliseconds ct (fun ctok f -> f ctok) + |> Eventually.forceAsync + (fun work -> + reactorOps.EnqueueAndAwaitOpAsync(userOpName, "CheckOneFile.Fragment", mainInputFileName, + fun ctok -> + // This work is not cancellable + let res = + // Reinstall the compilation globals each time we start or restart + use unwind = new CompilationGlobalsScope (errHandler.ErrorLogger, BuildPhase.TypeCheck) + work ctok + cancellable.Return(res) + )) + + return result + with e -> + errorR e + return Some((tcState.TcEnvFromSignatures, EmptyTopAttrs, [], [NewEmptyModuleOrNamespaceType Namespace]), tcState) + } + + let errors = errHandler.CollectedDiagnostics + + let res = + match resOpt with + | Some ((tcEnvAtEnd, _, implFiles, ccuSigsForFiles), tcState) -> + TypeCheckInfo(tcConfig, tcGlobals, + List.head ccuSigsForFiles, + tcState.Ccu, + tcImports, + tcEnvAtEnd.AccessRights, + projectFileName, + mainInputFileName, + sink.GetResolutions(), + sink.GetSymbolUses(), + tcEnvAtEnd.NameEnv, + loadClosure, + reactorOps, + textSnapshotInfo, + List.tryHead implFiles, + sink.GetOpenDeclarations()) + |> Result.Ok + | None -> + Result.Error() + return errors, res + } + + +[] +type FSharpProjectContext(thisCcu: CcuThunk, assemblies: FSharpAssembly list, ad: AccessorDomain) = + + /// Get the assemblies referenced + member __.GetReferencedAssemblies() = assemblies + + member __.AccessibilityRights = FSharpAccessibilityRights(thisCcu, ad) + + +[] +/// A live object of this type keeps the background corresponding background builder (and type providers) alive (through reference-counting). +// +// There is an important property of all the objects returned by the methods of this type: they do not require +// the corresponding background builder to be alive. That is, they are simply plain-old-data through pre-formatting of all result text. +type FSharpCheckFileResults + (filename: string, + errors: FSharpErrorInfo[], + scopeOptX: TypeCheckInfo option, + dependencyFiles: string[], + builderX: IncrementalBuilder option, + reactorOpsX:IReactorOperations, + keepAssemblyContents: bool) = + + // This may be None initially + let mutable details = match scopeOptX with None -> None | Some scopeX -> Some (scopeX, builderX, reactorOpsX) + + // Run an operation that needs to access a builder and be run in the reactor thread + let reactorOp userOpName opName dflt f = + async { + match details with + | None -> + return dflt + | Some (scope, _, reactor) -> + // Increment the usage count to ensure the builder doesn't get released while running operations asynchronously. + let! res = reactor.EnqueueAndAwaitOpAsync(userOpName, opName, filename, fun ctok -> f ctok scope |> cancellable.Return) + return res + } + + // Run an operation that can be called from any thread + let threadSafeOp dflt f = + match details with + | None -> dflt() + | Some (scope, _builderOpt, _ops) -> f scope + + member __.Errors = errors + + member __.HasFullTypeCheckInfo = details.IsSome + + member info.TryGetCurrentTcImports () = + match builderX with + | Some builder -> builder.TryGetCurrentTcImports () + | _ -> None + + /// Intellisense autocompletions + member __.GetDeclarationListInfo(parseResultsOpt, line, lineStr, partialName, ?getAllEntities, ?hasTextChangedSinceLastTypecheck, ?userOpName: string) = + let userOpName = defaultArg userOpName "Unknown" + let getAllEntities = defaultArg getAllEntities (fun() -> []) + let hasTextChangedSinceLastTypecheck = defaultArg hasTextChangedSinceLastTypecheck (fun _ -> false) + reactorOp userOpName "GetDeclarations" FSharpDeclarationListInfo.Empty (fun ctok scope -> + scope.GetDeclarations(ctok, parseResultsOpt, line, lineStr, partialName, getAllEntities, hasTextChangedSinceLastTypecheck)) + + member __.GetDeclarationListSymbols(parseResultsOpt, line, lineStr, partialName, ?getAllEntities, ?hasTextChangedSinceLastTypecheck, ?userOpName: string) = + let userOpName = defaultArg userOpName "Unknown" + let hasTextChangedSinceLastTypecheck = defaultArg hasTextChangedSinceLastTypecheck (fun _ -> false) + let getAllEntities = defaultArg getAllEntities (fun() -> []) + reactorOp userOpName "GetDeclarationListSymbols" List.empty (fun ctok scope -> + scope.GetDeclarationListSymbols(ctok, parseResultsOpt, line, lineStr, partialName, getAllEntities, hasTextChangedSinceLastTypecheck)) + + /// Resolve the names at the given location to give a data tip + member __.GetStructuredToolTipText(line, colAtEndOfNames, lineStr, names, tokenTag, ?userOpName: string) = + let userOpName = defaultArg userOpName "Unknown" + let dflt = FSharpToolTipText [] + match tokenTagToTokenId tokenTag with + | TOKEN_IDENT -> + reactorOp userOpName "GetStructuredToolTipText" dflt (fun ctok scope -> + scope.GetStructuredToolTipText(ctok, line, lineStr, colAtEndOfNames, names)) + | TOKEN_STRING | TOKEN_STRING_TEXT -> + reactorOp userOpName "GetReferenceResolutionToolTipText" dflt (fun ctok scope -> + scope.GetReferenceResolutionStructuredToolTipText(ctok, line, colAtEndOfNames) ) + | _ -> + 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 + + member __.GetF1Keyword (line, colAtEndOfNames, lineStr, names, ?userOpName: string) = + let userOpName = defaultArg userOpName "Unknown" + reactorOp userOpName "GetF1Keyword" None (fun ctok scope -> + scope.GetF1Keyword (ctok, line, lineStr, colAtEndOfNames, names)) + + // Resolve the names at the given location to a set of methods + member __.GetMethods(line, colAtEndOfNames, lineStr, names, ?userOpName: string) = + let userOpName = defaultArg userOpName "Unknown" + let dflt = FSharpMethodGroup("",[| |]) + reactorOp userOpName "GetMethods" dflt (fun ctok scope -> + scope.GetMethods (ctok, line, lineStr, colAtEndOfNames, names)) + + member __.GetDeclarationLocation (line, colAtEndOfNames, lineStr, names, ?preferFlag, ?userOpName: string) = + let userOpName = defaultArg userOpName "Unknown" + let dflt = FSharpFindDeclResult.DeclNotFound (FSharpFindDeclFailureReason.Unknown "") + reactorOp userOpName "GetDeclarationLocation" dflt (fun ctok scope -> + scope.GetDeclarationLocation (ctok, line, lineStr, colAtEndOfNames, names, preferFlag)) + + member __.GetSymbolUseAtLocation (line, colAtEndOfNames, lineStr, names, ?userOpName: string) = + let userOpName = defaultArg userOpName "Unknown" + reactorOp userOpName "GetSymbolUseAtLocation" None (fun ctok scope -> + scope.GetSymbolUseAtLocation (ctok, line, lineStr, colAtEndOfNames, names) + |> Option.map (fun (sym,denv,m) -> FSharpSymbolUse(scope.TcGlobals,denv,sym,ItemOccurence.Use,m))) + + member __.GetMethodsAsSymbols (line, colAtEndOfNames, lineStr, names, ?userOpName: string) = + let userOpName = defaultArg userOpName "Unknown" + reactorOp userOpName "GetMethodsAsSymbols" None (fun ctok scope -> + scope.GetMethodsAsSymbols (ctok, line, lineStr, colAtEndOfNames, names) + |> Option.map (fun (symbols,denv,m) -> + symbols |> List.map (fun sym -> FSharpSymbolUse(scope.TcGlobals,denv,sym,ItemOccurence.Use,m)))) + + member __.GetSymbolAtLocation (line, colAtEndOfNames, lineStr, names, ?userOpName: string) = + let userOpName = defaultArg userOpName "Unknown" + reactorOp userOpName "GetSymbolAtLocation" None (fun ctok scope -> + scope.GetSymbolUseAtLocation (ctok, line, lineStr, colAtEndOfNames, names) + |> Option.map (fun (sym,_,_) -> sym)) + + member info.GetFormatSpecifierLocations() = + info.GetFormatSpecifierLocationsAndArity() |> Array.map fst + + member __.GetFormatSpecifierLocationsAndArity() = + threadSafeOp + (fun () -> [| |]) + (fun scope -> + // This operation is not asynchronous - GetFormatSpecifierLocationsAndArity can be run on the calling thread + scope.GetFormatSpecifierLocationsAndArity()) + + member __.GetSemanticClassification(range: range option) = + threadSafeOp + (fun () -> [| |]) + (fun scope -> + // This operation is not asynchronous - GetSemanticClassification can be run on the calling thread + scope.GetSemanticClassification(range)) + + member __.PartialAssemblySignature = + threadSafeOp + (fun () -> failwith "not available") + (fun scope -> + // This operation is not asynchronous - PartialAssemblySignature can be run on the calling thread + scope.PartialAssemblySignatureForFile) + + member __.ProjectContext = + threadSafeOp + (fun () -> failwith "not available") + (fun scope -> + // This operation is not asynchronous - GetReferencedAssemblies can be run on the calling thread + FSharpProjectContext(scope.ThisCcu, scope.GetReferencedAssemblies(), scope.AccessRights)) + + member __.DependencyFiles = dependencyFiles + + member __.GetAllUsesOfAllSymbolsInFile() = + threadSafeOp + (fun () -> [| |]) + (fun scope -> + let cenv = scope.SymbolEnv + [| for symbolUseChunk in scope.ScopeSymbolUses.AllUsesOfSymbols do + for symbolUse in symbolUseChunk do + if symbolUse.ItemOccurence <> ItemOccurence.RelatedText then + let symbol = FSharpSymbol.Create(cenv, symbolUse.Item) + yield FSharpSymbolUse(scope.TcGlobals, symbolUse.DisplayEnv, symbol, symbolUse.ItemOccurence, symbolUse.Range) |]) + |> async.Return + + member __.GetUsesOfSymbolInFile(symbol:FSharpSymbol) = + threadSafeOp + (fun () -> [| |]) + (fun scope -> + [| 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 __.GetVisibleNamespacesAndModulesAtPoint(pos: pos) = + threadSafeOp + (fun () -> [| |]) + (fun scope -> scope.GetVisibleNamespacesAndModulesAtPosition(pos) |> List.toArray) + |> async.Return + + member __.IsRelativeNameResolvable(pos: pos, plid: string list, item: Item, ?userOpName: string) = + let userOpName = defaultArg userOpName "Unknown" + reactorOp userOpName "IsRelativeNameResolvable" true (fun ctok scope -> + RequireCompilationThread ctok + scope.IsRelativeNameResolvable(pos, plid, item)) + + member __.IsRelativeNameResolvableFromSymbol(pos: pos, plid: string list, symbol: FSharpSymbol, ?userOpName: string) = + let userOpName = defaultArg userOpName "Unknown" + reactorOp userOpName "IsRelativeNameResolvableFromSymbol" true (fun ctok scope -> + RequireCompilationThread ctok + scope.IsRelativeNameResolvableFromSymbol(pos, plid, symbol)) + + member __.GetDisplayContextForPos(pos: pos) : Async = + let userOpName = "CodeLens" + reactorOp userOpName "GetDisplayContextAtPos" None (fun ctok scope -> + DoesNotRequireCompilerThreadTokenAndCouldPossiblyBeMadeConcurrent ctok + let (nenv, _), _ = scope.GetBestDisplayEnvForPos pos + Some(FSharpDisplayContext(fun _ -> nenv.DisplayEnv))) + + member __.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 = SymbolEnv(scope.TcGlobals, scope.ThisCcu, Some scope.CcuSigForFile, scope.TcImports) + scope.ImplementationFile |> Option.map (fun implFile -> FSharpImplementationFileContents(cenv, implFile))) + |> Option.defaultValue None + + member __.OpenDeclarations = + scopeOptX + |> Option.map (fun scope -> + let cenv = scope.SymbolEnv + scope.OpenDeclarations |> Array.map (fun x -> FSharpOpenDeclaration(x.LongId, x.Range, (x.Modules |> List.map (fun x -> FSharpEntity(cenv, x))), x.AppliedScope, x.IsOwnNamespace))) + |> Option.defaultValue [| |] + + override __.ToString() = "FSharpCheckFileResults(" + filename + ")" + + static member MakeEmpty(filename: string, creationErrors: FSharpErrorInfo[], reactorOps, keepAssemblyContents) = + FSharpCheckFileResults (filename, creationErrors, None, [| |], None, reactorOps, keepAssemblyContents) + + static member JoinErrors(isIncompleteTypeCheckEnvironment, + creationErrors: FSharpErrorInfo[], + parseErrors: FSharpErrorInfo[], + tcErrors: FSharpErrorInfo[]) = + [| yield! creationErrors + yield! parseErrors + if isIncompleteTypeCheckEnvironment then + yield! Seq.truncate maxTypeCheckErrorsOutOfProjectContext tcErrors + else + yield! tcErrors |] + + static member Make + (mainInputFileName: string, + projectFileName, + tcConfig, tcGlobals, + isIncompleteTypeCheckEnvironment: bool, + builder: IncrementalBuilder, + dependencyFiles, + creationErrors: FSharpErrorInfo[], + parseErrors: FSharpErrorInfo[], + tcErrors: FSharpErrorInfo[], + reactorOps, + keepAssemblyContents, + ccuSigForFile, + thisCcu, tcImports, tcAccessRights, + sResolutions, sSymbolUses, + sFallback, loadClosure, + implFileOpt, + openDeclarations) = + + let tcFileInfo = + TypeCheckInfo(tcConfig, tcGlobals, ccuSigForFile, thisCcu, tcImports, tcAccessRights, + projectFileName, mainInputFileName, sResolutions, sSymbolUses, + sFallback, loadClosure, reactorOps, + None, implFileOpt, openDeclarations) + + let errors = FSharpCheckFileResults.JoinErrors(isIncompleteTypeCheckEnvironment, creationErrors, parseErrors, tcErrors) + FSharpCheckFileResults (mainInputFileName, errors, Some tcFileInfo, dependencyFiles, Some builder, reactorOps, keepAssemblyContents) + + static member CheckOneFile + (parseResults: FSharpParseFileResults, + sourceText: ISourceText, + mainInputFileName: string, + projectFileName: string, + tcConfig: TcConfig, + tcGlobals: TcGlobals, + tcImports: TcImports, + tcState: TcState, + moduleNamesDict: ModuleNamesDict, + loadClosure: LoadClosure option, + backgroundDiagnostics: (PhasedDiagnostic * FSharpErrorSeverity)[], + reactorOps: IReactorOperations, + textSnapshotInfo : obj option, + userOpName: string, + isIncompleteTypeCheckEnvironment: bool, + builder: IncrementalBuilder, + dependencyFiles: string[], + creationErrors: FSharpErrorInfo[], + parseErrors: FSharpErrorInfo[], + keepAssemblyContents: bool, + suggestNamesForErrors: bool) = + async { + let! tcErrors, tcFileInfo = + ParseAndCheckFile.CheckOneFile + (parseResults, sourceText, mainInputFileName, projectFileName, tcConfig, tcGlobals, tcImports, + tcState, moduleNamesDict, loadClosure, backgroundDiagnostics, reactorOps, + textSnapshotInfo, userOpName, suggestNamesForErrors) + match tcFileInfo with + | Result.Error () -> + return FSharpCheckFileAnswer.Aborted + | Result.Ok tcFileInfo -> + let errors = FSharpCheckFileResults.JoinErrors(isIncompleteTypeCheckEnvironment, creationErrors, parseErrors, tcErrors) + let results = FSharpCheckFileResults (mainInputFileName, errors, Some tcFileInfo, dependencyFiles, Some builder, reactorOps, keepAssemblyContents) + return FSharpCheckFileAnswer.Succeeded(results) + } + +and [] FSharpCheckFileAnswer = + | Aborted + | Succeeded of FSharpCheckFileResults + + +[] +// 'details' is an option because the creation of the tcGlobals etc. for the project may have failed. +type FSharpCheckProjectResults + (projectFileName:string, + tcConfigOption: TcConfig option, + keepAssemblyContents: bool, + errors: FSharpErrorInfo[], + details:(TcGlobals * TcImports * CcuThunk * ModuleOrNamespaceType * TcSymbolUses list * TopAttribs option * CompileOps.IRawFSharpAssemblyData option * ILAssemblyRef * AccessorDomain * TypedImplFile list option * string[]) option) = + + let getDetails() = + match details with + | None -> invalidOp ("The project has no results due to critical errors in the project options. Check the HasCriticalErrors before accessing the detailed results. Errors: " + String.concat "\n" [ for e in errors -> e.Message ]) + | Some d -> d + + let getTcConfig() = + match tcConfigOption with + | None -> invalidOp ("The project has no results due to critical errors in the project options. Check the HasCriticalErrors before accessing the detailed results. Errors: " + String.concat "\n" [ for e in errors -> e.Message ]) + | Some d -> d + + member __.Errors = errors + + member __.HasCriticalErrors = details.IsNone + + member __.AssemblySignature = + let (tcGlobals, tcImports, thisCcu, ccuSig, _tcSymbolUses, topAttribs, _tcAssemblyData, _ilAssemRef, _ad, _tcAssemblyExpr, _dependencyFiles) = getDetails() + FSharpAssemblySignature(tcGlobals, thisCcu, ccuSig, tcImports, topAttribs, ccuSig) + + member __.TypedImplementionFiles = + 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" + let (tcGlobals, tcImports, thisCcu, _ccuSig, _tcSymbolUses, _topAttribs, _tcAssemblyData, _ilAssemRef, _ad, tcAssemblyExpr, _dependencyFiles) = getDetails() + let mimpls = + match tcAssemblyExpr with + | None -> [] + | Some mimpls -> mimpls + tcGlobals, thisCcu, tcImports, mimpls + + member info.AssemblyContents = + 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" + let (tcGlobals, tcImports, thisCcu, ccuSig, _tcSymbolUses, _topAttribs, _tcAssemblyData, _ilAssemRef, _ad, tcAssemblyExpr, _dependencyFiles) = getDetails() + let mimpls = + match tcAssemblyExpr with + | None -> [] + | Some mimpls -> mimpls + FSharpAssemblyContents(tcGlobals, thisCcu, Some ccuSig, tcImports, mimpls) + + member __.GetOptimizedAssemblyContents() = + 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" + let (tcGlobals, tcImports, thisCcu, ccuSig, _tcSymbolUses, _topAttribs, _tcAssemblyData, _ilAssemRef, _ad, tcAssemblyExpr, _dependencyFiles) = getDetails() + let mimpls = + match tcAssemblyExpr with + | None -> [] + | Some mimpls -> mimpls + let outfile = "" // only used if tcConfig.writeTermsToFiles is true + let importMap = tcImports.GetImportMap() + let optEnv0 = GetInitialOptimizationEnv (tcImports, tcGlobals) + let tcConfig = getTcConfig() + let optimizedImpls, _optimizationData, _ = ApplyAllOptimizations (tcConfig, tcGlobals, (LightweightTcValForUsingInBuildMethodCall tcGlobals), outfile, importMap, false, optEnv0, thisCcu, mimpls) + let mimpls = + match optimizedImpls with + | TypedAssemblyAfterOptimization files -> + files |> List.map fst + + FSharpAssemblyContents(tcGlobals, thisCcu, Some ccuSig, tcImports, mimpls) + + // Not, this does not have to be a SyncOp, it can be called from any thread + member __.GetUsesOfSymbol(symbol:FSharpSymbol) = + let (tcGlobals, _tcImports, _thisCcu, _ccuSig, tcSymbolUses, _topAttribs, _tcAssemblyData, _ilAssemRef, _ad, _tcAssemblyExpr, _dependencyFiles) = getDetails() + + 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 + + // Not, this does not have to be a SyncOp, it can be called from any thread + member __.GetAllUsesOfAllSymbols() = + let (tcGlobals, tcImports, thisCcu, ccuSig, tcSymbolUses, _topAttribs, _tcAssemblyData, _ilAssemRef, _ad, _tcAssemblyExpr, _dependencyFiles) = getDetails() + let cenv = SymbolEnv(tcGlobals, thisCcu, Some ccuSig, tcImports) + + [| for r in tcSymbolUses do + for symbolUseChunk in r.AllUsesOfSymbols do + for symbolUse in symbolUseChunk do + if symbolUse.ItemOccurence <> ItemOccurence.RelatedText then + let symbol = FSharpSymbol.Create(cenv, symbolUse.Item) + yield FSharpSymbolUse(tcGlobals, symbolUse.DisplayEnv, symbol, symbolUse.ItemOccurence, symbolUse.Range) |] + |> async.Return + + member __.ProjectContext = + let (tcGlobals, tcImports, thisCcu, _ccuSig, _tcSymbolUses, _topAttribs, _tcAssemblyData, _ilAssemRef, ad, _tcAssemblyExpr, _dependencyFiles) = getDetails() + let assemblies = + [ for x in tcImports.GetImportedAssemblies() do + yield FSharpAssembly(tcGlobals, tcImports, x.FSharpViewOfMetadata) ] + FSharpProjectContext(thisCcu, assemblies, ad) + + member __.RawFSharpAssemblyData = + let (_tcGlobals, _tcImports, _thisCcu, _ccuSig, _tcSymbolUses, _topAttribs, tcAssemblyData, _ilAssemRef, _ad, _tcAssemblyExpr, _dependencyFiles) = getDetails() + tcAssemblyData + + member __.DependencyFiles = + let (_tcGlobals, _tcImports, _thisCcu, _ccuSig, _tcSymbolUses, _topAttribs, _tcAssemblyData, _ilAssemRef, _ad, _tcAssemblyExpr, dependencyFiles) = getDetails() + dependencyFiles + + member __.AssemblyFullName = + let (_tcGlobals, _tcImports, _thisCcu, _ccuSig, _tcSymbolUses, _topAttribs, _tcAssemblyData, ilAssemRef, _ad, _tcAssemblyExpr, _dependencyFiles) = getDetails() + ilAssemRef.QualifiedName + + override __.ToString() = "FSharpCheckProjectResults(" + projectFileName + ")" + +type FsiInteractiveChecker(legacyReferenceResolver, + reactorOps: IReactorOperations, + tcConfig: TcConfig, + tcGlobals, + tcImports, + tcState) = + + let keepAssemblyContents = false + + member __.ParseAndCheckInteraction (ctok, sourceText: ISourceText, ?userOpName: string) = + async { + let userOpName = defaultArg userOpName "Unknown" + let filename = Path.Combine(tcConfig.implicitIncludeDir, "stdin.fsx") + let suggestNamesForErrors = true // Will always be true, this is just for readability + // Note: projectSourceFiles is only used to compute isLastCompiland, and is ignored if Build.IsScript(mainInputFileName) is true (which it is in this case). + let parsingOptions = FSharpParsingOptions.FromTcConfig(tcConfig, [| filename |], true) + let parseErrors, parseTreeOpt, anyErrors = ParseAndCheckFile.parseFile (sourceText, filename, parsingOptions, userOpName, suggestNamesForErrors) + let dependencyFiles = [| |] // interactions have no dependencies + 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.ComputeClosureOfScriptText(ctok, legacyReferenceResolver, defaultFSharpBinariesDir, + filename, sourceText, CodeContext.Editing, + tcConfig.useSimpleResolution, tcConfig.useFsiAuxLib, + tcConfig.useSdkRefs, new Lexhelp.LexResourceManager(), + applyCompilerOptions, assumeDotNetFramework, + tryGetMetadataSnapshot=(fun _ -> None), reduceMemoryUsage=reduceMemoryUsage) + + let! tcErrors, tcFileInfo = + ParseAndCheckFile.CheckOneFile + (parseResults, sourceText, filename, "project", + tcConfig, tcGlobals, tcImports, tcState, + Map.empty, Some loadClosure, backgroundDiagnostics, + reactorOps, None, userOpName, suggestNamesForErrors) + + return + match tcFileInfo with + | Result.Ok tcFileInfo -> + let errors = [| yield! parseErrors; yield! tcErrors |] + let typeCheckResults = FSharpCheckFileResults (filename, errors, Some tcFileInfo, dependencyFiles, None, reactorOps, false) + let projectResults = + FSharpCheckProjectResults (filename, Some tcConfig, + keepAssemblyContents, errors, + Some(tcGlobals, tcImports, tcFileInfo.ThisCcu, tcFileInfo.CcuSigForFile, + [tcFileInfo.ScopeSymbolUses], None, None, mkSimpleAssemblyRef "stdin", + tcState.TcEnvFromImpls.AccessRights, None, dependencyFiles)) + + parseResults, typeCheckResults, projectResults + + | Result.Error () -> + failwith "unexpected aborted" + } + diff --git a/src/fsharp/service/FSharpCheckerResults.fsi b/src/fsharp/service/FSharpCheckerResults.fsi new file mode 100644 index 0000000000..4f7062d9ce --- /dev/null +++ b/src/fsharp/service/FSharpCheckerResults.fsi @@ -0,0 +1,421 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.SourceCodeServices + +open FSharp.Compiler +open FSharp.Compiler.AbstractIL.IL +open FSharp.Compiler.AbstractIL.Internal.Library +open FSharp.Compiler.AccessibilityLogic +open FSharp.Compiler.Ast +open FSharp.Compiler.CompileOps +open FSharp.Compiler.ErrorLogger +open FSharp.Compiler.NameResolution +open FSharp.Compiler.Range +open FSharp.Compiler.Tast +open FSharp.Compiler.Tastops +open FSharp.Compiler.TcGlobals +open FSharp.Compiler.Text +open FSharp.Compiler.TypeChecker + +/// Represents the reason why the GetDeclarationLocation operation failed. +[] +type public FSharpFindDeclFailureReason = + + /// Generic reason: no particular information about error apart from a message + | Unknown of message: string + + /// Source code file is not available + | NoSourceCode + + /// Trying to find declaration of ProvidedType without TypeProviderDefinitionLocationAttribute + | ProvidedType of string + + /// Trying to find declaration of ProvidedMember without TypeProviderDefinitionLocationAttribute + | ProvidedMember of string + +/// Represents the result of the GetDeclarationLocation operation. +[] +type public FSharpFindDeclResult = + + /// Indicates a declaration location was not found, with an additional reason + | DeclNotFound of FSharpFindDeclFailureReason + + /// Indicates a declaration location was found + | DeclFound of range + + /// Indicates an external declaration was found + | ExternalDecl of assembly : string * externalSym : ExternalSymbol + +/// Represents the checking context implied by the ProjectOptions +[] +type public FSharpProjectContext = + + /// Get the resolution and full contents of the assemblies referenced by the project options + member GetReferencedAssemblies : unit -> FSharpAssembly list + + /// Get the accessibility rights for this project context w.r.t. InternalsVisibleTo attributes granting access to other assemblies + member AccessibilityRights : FSharpAccessibilityRights + +[] +type public SemanticClassificationType = + | ReferenceType + | ValueType + | UnionCase + | Function + | Property + | MutableVar + | Module + | Printf + | ComputationExpression + | IntrinsicFunction + | Enumeration + | Interface + | TypeArgument + | Operator + | Disposable + +/// Options used to determine active --define conditionals and other options relevant to parsing files in a project +type public FSharpParsingOptions = + { + SourceFiles: string[] + ConditionalCompilationDefines: string list + ErrorSeverityOptions: FSharpErrorSeverityOptions + IsInteractive: bool + LightSyntax: bool option + CompilingFsLib: bool + IsExe: bool + } + static member Default: FSharpParsingOptions + + static member internal FromTcConfig: tcConfig: TcConfig * sourceFiles: string[] * isInteractive: bool -> FSharpParsingOptions + + static member internal FromTcConfigBuidler: tcConfigB: TcConfigBuilder * sourceFiles: string[] * isInteractive: bool -> FSharpParsingOptions + +/// A handle to the results of CheckFileInProject. +[] +type public FSharpCheckFileResults = + /// The errors returned by parsing a source file. + member Errors : FSharpErrorInfo[] + + /// Get a view of the contents of the assembly up to and including the file just checked + member PartialAssemblySignature : FSharpAssemblySignature + + /// Get the resolution of the ProjectOptions + member ProjectContext : FSharpProjectContext + + /// Indicates whether type checking successfully occurred with some results returned. If false, indicates that + /// an unrecoverable error in earlier checking/parsing/resolution steps. + member HasFullTypeCheckInfo: bool + + /// Tries to get the current successful TcImports. This is only used in testing. Do not use it for other stuff. + member internal TryGetCurrentTcImports: unit -> TcImports option + + /// Indicates the set of files which must be watched to accurately track changes that affect these results, + /// Clients interested in reacting to updates to these files should watch these files and take actions as described + /// in the documentation for compiler service. + member DependencyFiles : string[] + + /// Get the items for a declaration list + /// + /// + /// If this is present, it is used to filter declarations based on location in the + /// parse tree, specifically at 'open' declarations, 'inherit' of class or interface + /// 'record field' locations and r.h.s. of 'range' operator a..b + /// + /// The line number where the completion is happening + /// + /// Partial long name. QuickParse.GetPartialLongNameEx can be used to get it. + /// + /// + /// The text of the line where the completion is happening. This is only used to make a couple + /// of adhoc corrections to completion accuracy (e.g. checking for "..") + /// + /// + /// Function that returns all entities from current and referenced assemblies. + /// + /// + /// If text has been used from a captured name resolution from the typecheck, then + /// callback to the client to check if the text has changed. If it has, then give up + /// and assume that we're going to repeat the operation later on. + /// + /// An optional string used for tracing compiler operations associated with this request. + member GetDeclarationListInfo : ParsedFileResultsOpt:FSharpParseFileResults option * line: int * lineText:string * partialName: PartialLongName * ?getAllEntities: (unit -> AssemblySymbol list) * ?hasTextChangedSinceLastTypecheck: (obj * range -> bool) * ?userOpName: string -> Async + + /// Get the items for a declaration list in FSharpSymbol format + /// + /// + /// If this is present, it is used to filter declarations based on location in the + /// parse tree, specifically at 'open' declarations, 'inherit' of class or interface + /// 'record field' locations and r.h.s. of 'range' operator a..b + /// + /// The line number where the completion is happening + /// + /// Partial long name. QuickParse.GetPartialLongNameEx can be used to get it. + /// + /// + /// The text of the line where the completion is happening. This is only used to make a couple + /// of adhoc corrections to completion accuracy (e.g. checking for "..") + /// + /// + /// Function that returns all entities from current and referenced assemblies. + /// + /// + /// If text has been used from a captured name resolution from the typecheck, then + /// callback to the client to check if the text has changed. If it has, then give up + /// and assume that we're going to repeat the operation later on. + /// + /// An optional string used for tracing compiler operations associated with this request. + member GetDeclarationListSymbols : ParsedFileResultsOpt:FSharpParseFileResults option * line: int * lineText:string * partialName: PartialLongName * ?getAllEntities: (unit -> AssemblySymbol list) * ?hasTextChangedSinceLastTypecheck: (obj * range -> bool) * ?userOpName: string -> Async + + /// Compute a formatted tooltip for the given location + /// + /// The line number where the information is being requested. + /// The column number at the end of the identifiers where the information is being requested. + /// The text of the line where the information is being requested. + /// The identifiers at the location where the information is being requested. + /// Used to discriminate between 'identifiers', 'strings' and others. For strings, an attempt is made to give a tooltip for a #r "..." location. Use a value from FSharpTokenInfo.Tag, or FSharpTokenTag.Identifier, unless you have other information available. + /// An optional string used for tracing compiler operations associated with this request. + member GetStructuredToolTipText : line:int * colAtEndOfNames:int * lineText:string * names:string list * tokenTag:int * ?userOpName: string -> Async + + /// Compute a formatted tooltip for the given location + /// + /// The line number where the information is being requested. + /// The column number at the end of the identifiers where the information is being requested. + /// The text of the line where the information is being requested. + /// The identifiers at the location where the information is being requested. + /// Used to discriminate between 'identifiers', 'strings' and others. For strings, an attempt is made to give a tooltip for a #r "..." location. Use a value from FSharpTokenInfo.Tag, or FSharpTokenTag.Identifier, unless you have other information available. + /// An optional string used for tracing compiler operations associated with this request. + member GetToolTipText : line:int * colAtEndOfNames:int * lineText:string * names:string list * tokenTag:int * ?userOpName: string -> Async + + /// Compute the Visual Studio F1-help key identifier for the given location, based on name resolution results + /// + /// The line number where the information is being requested. + /// The column number at the end of the identifiers where the information is being requested. + /// The text of the line where the information is being requested. + /// The identifiers at the location where the information is being requested. + /// An optional string used for tracing compiler operations associated with this request. + member GetF1Keyword : line:int * colAtEndOfNames:int * lineText:string * names:string list * ?userOpName: string -> Async + + + /// Compute a set of method overloads to show in a dialog relevant to the given code location. + /// + /// The line number where the information is being requested. + /// The column number at the end of the identifiers where the information is being requested. + /// The text of the line where the information is being requested. + /// The identifiers at the location where the information is being requested. + /// An optional string used for tracing compiler operations associated with this request. + member GetMethods : line:int * colAtEndOfNames:int * lineText:string * names:string list option * ?userOpName: string -> Async + + /// Compute a set of method overloads to show in a dialog relevant to the given code location. The resulting method overloads are returned as symbols. + /// The line number where the information is being requested. + /// The column number at the end of the identifiers where the information is being requested. + /// The text of the line where the information is being requested. + /// The identifiers at the location where the information is being requested. + /// An optional string used for tracing compiler operations associated with this request. + member GetMethodsAsSymbols : line:int * colAtEndOfNames:int * lineText:string * names:string list * ?userOpName: string -> Async + + /// Resolve the names at the given location to the declaration location of the corresponding construct. + /// + /// The line number where the information is being requested. + /// The column number at the end of the identifiers where the information is being requested. + /// The text of the line where the information is being requested. + /// The identifiers at the location where the information is being requested. + /// If not given, then get the location of the symbol. If false, then prefer the location of the corresponding symbol in the implementation of the file (rather than the signature if present). If true, prefer the location of the corresponding symbol in the signature of the file (rather than the implementation). + /// An optional string used for tracing compiler operations associated with this request. + member GetDeclarationLocation : line:int * colAtEndOfNames:int * lineText:string * names:string list * ?preferFlag:bool * ?userOpName: string -> Async + + /// Resolve the names at the given location to a use of symbol. + /// + /// The line number where the information is being requested. + /// The column number at the end of the identifiers where the information is being requested. + /// The text of the line where the information is being requested. + /// The identifiers at the location where the information is being requested. + /// An optional string used for tracing compiler operations associated with this request. + member GetSymbolUseAtLocation : line:int * colAtEndOfNames:int * lineText:string * names:string list * ?userOpName: string -> Async + + /// Get any extra colorization info that is available after the typecheck + member GetSemanticClassification : range option -> (range * SemanticClassificationType)[] + + /// Get the locations of format specifiers + [] + member GetFormatSpecifierLocations : unit -> range[] + + /// Get the locations of and number of arguments associated with format specifiers + member GetFormatSpecifierLocationsAndArity : unit -> (range*int)[] + + /// Get all textual usages of all symbols throughout the file + member GetAllUsesOfAllSymbolsInFile : unit -> Async + + /// Get the textual usages that resolved to the given symbol throughout the file + member GetUsesOfSymbolInFile : symbol:FSharpSymbol -> Async + + member internal GetVisibleNamespacesAndModulesAtPoint : pos -> Async + + /// Find the most precise display environment for the given line and column. + member GetDisplayContextForPos : 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 + + /// Determines if a long ident is resolvable at a specific point. + /// 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 file, including its typechecked signatures if any. + member ImplementationFile: FSharpImplementationFileContents option + + /// Open declarations in the file, including auto open modules. + member OpenDeclarations: FSharpOpenDeclaration[] + + /// Internal constructor + static member internal MakeEmpty : + filename: string * + creationErrors: FSharpErrorInfo[] * + reactorOps: IReactorOperations * + keepAssemblyContents: bool + -> FSharpCheckFileResults + + /// Internal constructor + static member internal Make: + mainInputFileName: string * + projectFileName: string * + tcConfig: TcConfig * + tcGlobals: TcGlobals * + isIncompleteTypeCheckEnvironment: bool * + builder: IncrementalBuilder * + dependencyFiles: string[] * + creationErrors: FSharpErrorInfo[] * + parseErrors: FSharpErrorInfo[] * + tcErrors: FSharpErrorInfo[] * + reactorOps : IReactorOperations * + keepAssemblyContents: bool * + ccuSigForFile: ModuleOrNamespaceType * + thisCcu: CcuThunk * + tcImports: TcImports * + tcAccessRights: AccessorDomain * + sResolutions: TcResolutions * + sSymbolUses: TcSymbolUses * + sFallback: NameResolutionEnv * + loadClosure : LoadClosure option * + implFileOpt: TypedImplFile option * + openDeclarations: OpenDeclaration[] + -> FSharpCheckFileResults + + /// Internal constructor - check a file and collect errors + static member internal CheckOneFile: + parseResults: FSharpParseFileResults * + sourceText: ISourceText * + mainInputFileName: string * + projectFileName: string * + tcConfig: TcConfig * + tcGlobals: TcGlobals * + tcImports: TcImports * + tcState: TcState * + moduleNamesDict: ModuleNamesDict * + loadClosure: LoadClosure option * + backgroundDiagnostics: (PhasedDiagnostic * FSharpErrorSeverity)[] * + reactorOps: IReactorOperations * + textSnapshotInfo : obj option * + userOpName: string * + isIncompleteTypeCheckEnvironment: bool * + builder: IncrementalBuilder * + dependencyFiles: string[] * + creationErrors:FSharpErrorInfo[] * + parseErrors:FSharpErrorInfo[] * + keepAssemblyContents: bool * + suggestNamesForErrors: bool + -> Async + +/// The result of calling TypeCheckResult including the possibility of abort and background compiler not caught up. +and [] public FSharpCheckFileAnswer = + /// Aborted because cancellation caused an abandonment of the operation + | Aborted + + /// Success + | Succeeded of FSharpCheckFileResults + +/// A handle to the results of CheckFileInProject. +[] +type public FSharpCheckProjectResults = + + /// The errors returned by processing the project + member Errors: FSharpErrorInfo[] + + /// Get a view of the overall signature of the assembly. Only valid to use if HasCriticalErrors is false. + member AssemblySignature: FSharpAssemblySignature + + /// Get a view of the overall contents of the assembly. Only valid to use if HasCriticalErrors is false. + member AssemblyContents: FSharpAssemblyContents + + /// Get an optimized view of the overall contents of the assembly. Only valid to use if HasCriticalErrors is false. + member GetOptimizedAssemblyContents: unit -> FSharpAssemblyContents + + /// Get the resolution of the ProjectOptions + member ProjectContext: FSharpProjectContext + + /// Get the textual usages that resolved to the given symbol throughout the project + member GetUsesOfSymbol: symbol:FSharpSymbol -> Async + + /// Get all textual usages of all symbols throughout the project + member GetAllUsesOfAllSymbols: unit -> Async + + /// Indicates if critical errors existed in the project options + member HasCriticalErrors: bool + + /// Indicates the set of files which must be watched to accurately track changes that affect these results, + /// Clients interested in reacting to updates to these files should watch these files and take actions as described + /// in the documentation for compiler service. + member DependencyFiles: string[] + + member internal RawFSharpAssemblyData : IRawFSharpAssemblyData option + + // Internal constructor. + internal new : + projectFileName:string * + tcConfigOption: TcConfig option * + keepAssemblyContents: bool * + errors: FSharpErrorInfo[] * + details:(TcGlobals * TcImports * CcuThunk * ModuleOrNamespaceType * TcSymbolUses list * TopAttribs option * CompileOps.IRawFSharpAssemblyData option * ILAssemblyRef * AccessorDomain * TypedImplFile list option * string[]) option + -> FSharpCheckProjectResults + +module internal ParseAndCheckFile = + + val parseFile: + sourceText: ISourceText * + fileName: string * + options: FSharpParsingOptions * + userOpName: string * + suggestNamesForErrors: bool + -> FSharpErrorInfo[] * ParsedInput option * bool + + val matchBraces: + sourceText: ISourceText * + fileName: string * + options: FSharpParsingOptions * + userOpName: string * + suggestNamesForErrors: bool + -> (range * range)[] + +// An object to typecheck source in a given typechecking environment. +// Used internally to provide intellisense over F# Interactive. +type internal FsiInteractiveChecker = + internal new: + ReferenceResolver.Resolver * + ops: IReactorOperations * + tcConfig: TcConfig * + tcGlobals: TcGlobals * + tcImports: TcImports * + tcState: TcState + -> FsiInteractiveChecker + + member internal ParseAndCheckInteraction : + ctok: CompilationThreadToken * + sourceText:ISourceText * + ?userOpName: string + -> Async + +module internal FSharpCheckerResultsSettings = + val defaultFSharpBinariesDir: string + + val maxTimeShareMilliseconds : int64 \ No newline at end of file diff --git a/src/fsharp/service/service.fs b/src/fsharp/service/service.fs index 26fe8ff758..cc7d11b9f9 100644 --- a/src/fsharp/service/service.fs +++ b/src/fsharp/service/service.fs @@ -1,59 +1,36 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. -// Open up the compiler as an incremental service for parsing, -// type checking and intellisense-like environment-reporting. - namespace FSharp.Compiler.SourceCodeServices open System -open System.Collections.Generic open System.Collections.Concurrent open System.Diagnostics open System.IO open System.Reflection -open System.Text -open Microsoft.FSharp.Core.Printf -open FSharp.Compiler +open FSharp.Compiler open FSharp.Compiler.AbstractIL open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.AbstractIL.ILBinaryReader -open FSharp.Compiler.AbstractIL.Diagnostics -open FSharp.Compiler.AbstractIL.Internal -open FSharp.Compiler.AbstractIL.Internal.Library +open FSharp.Compiler.AbstractIL.Internal.Library -open FSharp.Compiler.AccessibilityLogic open FSharp.Compiler.Ast open FSharp.Compiler.CompileOps open FSharp.Compiler.CompileOptions open FSharp.Compiler.Driver open FSharp.Compiler.ErrorLogger open FSharp.Compiler.Lib -open FSharp.Compiler.PrettyNaming -open FSharp.Compiler.Parser open FSharp.Compiler.Range -open FSharp.Compiler.Lexhelp -open FSharp.Compiler.Layout -open FSharp.Compiler.Tast -open FSharp.Compiler.Tastops -open FSharp.Compiler.TcGlobals +open FSharp.Compiler.TcGlobals open FSharp.Compiler.Text -open FSharp.Compiler.Infos -open FSharp.Compiler.InfoReader -open FSharp.Compiler.NameResolution -open FSharp.Compiler.TypeChecker -open FSharp.Compiler.SourceCodeServices.SymbolHelpers open Internal.Utilities open Internal.Utilities.Collections -open FSharp.Compiler.Layout.TaggedTextOps type internal Layout = StructuredFormat.Layout [] module EnvMisc = - let getToolTipTextSize = GetEnvInteger "FCS_GetToolTipTextCacheSize" 5 - let maxTypeCheckErrorsOutOfProjectContext = GetEnvInteger "FCS_MaxErrorsOutOfProjectContext" 3 let braceMatchCacheSize = GetEnvInteger "FCS_BraceMatchCacheSize" 5 let parseFileCacheSize = GetEnvInteger "FCS_ParseFileCacheSize" 2 let checkFileInProjectCacheSize = GetEnvInteger "FCS_CheckFileInProjectCacheSize" 10 @@ -63,1709 +40,6 @@ module EnvMisc = let maxMBDefault = GetEnvInteger "FCS_MaxMB" 1000000 // a million MB = 1TB = disabled //let maxMBDefault = GetEnvInteger "FCS_maxMB" (if sizeof = 4 then 1700 else 3400) - /// Maximum time share for a piece of background work before it should (cooperatively) yield - /// to enable other requests to be serviced. Yielding means returning a continuation function - /// (via an Eventually<_> value of case NotYetDone) that can be called as the next piece of work. - let maxTimeShareMilliseconds = - match System.Environment.GetEnvironmentVariable("FCS_MaxTimeShare") with - | null | "" -> 100L - | s -> int64 s - - -//---------------------------------------------------------------------------- -// Scopes. -//-------------------------------------------------------------------------- - -[] -type FSharpFindDeclFailureReason = - // generic reason: no particular information about error - | Unknown of message: string - // source code file is not available - | NoSourceCode - // trying to find declaration of ProvidedType without TypeProviderDefinitionLocationAttribute - | ProvidedType of string - // trying to find declaration of ProvidedMember without TypeProviderDefinitionLocationAttribute - | ProvidedMember of string - -[] -type FSharpFindDeclResult = - /// declaration not found + reason - | DeclNotFound of FSharpFindDeclFailureReason - /// found declaration - | DeclFound of range - /// Indicates an external declaration was found - | ExternalDecl of assembly : string * externalSym : ExternalSymbol - -/// This type is used to describe what was found during the name resolution. -/// (Depending on the kind of the items, we may stop processing or continue to find better items) -[] -[] -type internal NameResResult = - | Members of (ItemWithInst list * DisplayEnv * range) - | Cancel of DisplayEnv * range - | Empty - | TypecheckStaleAndTextChanged - - -[] -type ResolveOverloads = -| Yes -| No - -[] -type GetPreciseCompletionListFromExprTypingsResult = - | NoneBecauseTypecheckIsStaleAndTextChanged - | NoneBecauseThereWereTypeErrors - | None - | Some of (ItemWithInst list * DisplayEnv * range) * TType - -type Names = string list - -[] -type SemanticClassificationType = - | ReferenceType - | ValueType - | UnionCase - | Function - | Property - | MutableVar - | Module - | Printf - | ComputationExpression - | IntrinsicFunction - | Enumeration - | Interface - | TypeArgument - | Operator - | Disposable - -/// A TypeCheckInfo represents everything we get back from the typecheck of a file. -/// It acts like an in-memory database about the file. -/// It is effectively immutable and not updated: when we re-typecheck we just drop the previous -/// scope object on the floor and make a new one. -[] -type TypeCheckInfo - (// Information corresponding to miscellaneous command-line options (--define, etc). - _sTcConfig: TcConfig, - g: TcGlobals, - // The signature of the assembly being checked, up to and including the current file - ccuSigForFile: ModuleOrNamespaceType, - thisCcu: CcuThunk, - tcImports: TcImports, - tcAccessRights: AccessorDomain, - projectFileName: string, - mainInputFileName: string, - sResolutions: TcResolutions, - sSymbolUses: TcSymbolUses, - // This is a name resolution environment to use if no better match can be found. - sFallback: NameResolutionEnv, - loadClosure : LoadClosure option, - reactorOps : IReactorOperations, - textSnapshotInfo:obj option, - implFileOpt: TypedImplFile option, - openDeclarations: OpenDeclaration[]) = - - let textSnapshotInfo = defaultArg textSnapshotInfo null - let (|CNR|) (cnr:CapturedNameResolution) = - (cnr.Pos, cnr.Item, cnr.ItemOccurence, cnr.DisplayEnv, cnr.NameResolutionEnv, cnr.AccessorDomain, cnr.Range) - - // These strings are potentially large and the editor may choose to hold them for a while. - // Use this cache to fold together data tip text results that are the same. - // Is not keyed on 'Names' collection because this is invariant for the current position in - // this unchanged file. Keyed on lineStr though to prevent a change to the currently line - // being available against a stale scope. - let getToolTipTextCache = AgedLookup>(getToolTipTextSize,areSimilar=(fun (x,y) -> x = y)) - - let amap = tcImports.GetImportMap() - let infoReader = new InfoReader(g,amap) - let ncenv = new NameResolver(g,amap,infoReader,NameResolution.FakeInstantiationGenerator) - let cenv = SymbolEnv(g, thisCcu, Some ccuSigForFile, tcImports, amap, infoReader) - - /// Find the most precise naming environment for the given line and column - let GetBestEnvForPos cursorPos = - - let mutable bestSoFar = None - - // Find the most deeply nested enclosing scope that contains given position - sResolutions.CapturedEnvs |> ResizeArray.iter (fun (possm,env,ad) -> - if rangeContainsPos possm cursorPos then - match bestSoFar with - | Some (bestm,_,_) -> - if rangeContainsRange bestm possm then - bestSoFar <- Some (possm,env,ad) - | None -> - bestSoFar <- Some (possm,env,ad)) - - let mostDeeplyNestedEnclosingScope = bestSoFar - - // Look for better subtrees on the r.h.s. of the subtree to the left of where we are - // Should really go all the way down the r.h.s. of the subtree to the left of where we are - // This is all needed when the index is floating free in the area just after the environment we really want to capture - // We guarantee to only refine to a more nested environment. It may not be strictly - // the right environment, but will always be at least as rich - - let bestAlmostIncludedSoFar = ref None - - sResolutions.CapturedEnvs |> ResizeArray.iter (fun (possm,env,ad) -> - // take only ranges that strictly do not include cursorPos (all ranges that touch cursorPos were processed during 'Strict Inclusion' part) - if rangeBeforePos possm cursorPos && not (posEq possm.End cursorPos) then - let contained = - match mostDeeplyNestedEnclosingScope with - | Some (bestm,_,_) -> rangeContainsRange bestm possm - | None -> true - - if contained then - match !bestAlmostIncludedSoFar with - | Some (rightm:range,_,_) -> - if posGt possm.End rightm.End || - (posEq possm.End rightm.End && posGt possm.Start rightm.Start) then - bestAlmostIncludedSoFar := Some (possm,env,ad) - | _ -> bestAlmostIncludedSoFar := Some (possm,env,ad)) - - let resEnv = - match !bestAlmostIncludedSoFar, mostDeeplyNestedEnclosingScope with - | Some (_,env,ad), None -> env, ad - | Some (_,almostIncludedEnv,ad), Some (_,mostDeeplyNestedEnv,_) - when almostIncludedEnv.eFieldLabels.Count >= mostDeeplyNestedEnv.eFieldLabels.Count -> - almostIncludedEnv,ad - | _ -> - match mostDeeplyNestedEnclosingScope with - | Some (_,env,ad) -> - env,ad - | None -> - sFallback,AccessibleFromSomeFSharpCode - let pm = mkRange mainInputFileName cursorPos cursorPos - - resEnv,pm - - /// The items that come back from ResolveCompletionsInType are a bit - /// noisy. Filter a few things out. - /// - /// e.g. prefer types to constructors for FSharpToolTipText - let FilterItemsForCtors filterCtors (items: ItemWithInst list) = - let items = items |> List.filter (fun item -> match item.Item with (Item.CtorGroup _) when filterCtors = ResolveTypeNamesToTypeRefs -> false | _ -> true) - items - - // Filter items to show only valid & return Some if there are any - let ReturnItemsOfType (items: ItemWithInst list) g denv (m:range) filterCtors hasTextChangedSinceLastTypecheck = - let items = - items - |> RemoveDuplicateItems g - |> RemoveExplicitlySuppressed g - |> FilterItemsForCtors filterCtors - - if not (isNil items) then - if hasTextChangedSinceLastTypecheck(textSnapshotInfo, m) then - NameResResult.TypecheckStaleAndTextChanged // typecheck is stale, wait for second-chance IntelliSense to bring up right result - else - NameResResult.Members (items, denv, m) - else NameResResult.Empty - - let GetCapturedNameResolutions endOfNamesPos resolveOverloads = - - let quals = - match resolveOverloads with - | ResolveOverloads.Yes -> sResolutions.CapturedNameResolutions - | ResolveOverloads.No -> sResolutions.CapturedMethodGroupResolutions - - let quals = quals |> ResizeArray.filter (fun cnr -> posEq cnr.Pos endOfNamesPos) - - quals - - /// Looks at the exact name resolutions that occurred during type checking - /// If 'membersByResidue' is specified, we look for members of the item obtained - /// from the name resolution and filter them by the specified residue (?) - let GetPreciseItemsFromNameResolution(line, colAtEndOfNames, membersByResidue, filterCtors, resolveOverloads, hasTextChangedSinceLastTypecheck) = - let endOfNamesPos = mkPos line colAtEndOfNames - - // Logic below expects the list to be in reverse order of resolution - let cnrs = GetCapturedNameResolutions endOfNamesPos resolveOverloads |> ResizeArray.toList |> List.rev - - match cnrs, membersByResidue with - - // If we're looking for members using a residue, we'd expect only - // a single item (pick the first one) and we need the residue (which may be "") - | CNR(_,Item.Types(_,(ty :: _)), _, denv, nenv, ad, m) :: _, Some _ -> - let items = ResolveCompletionsInType ncenv nenv (ResolveCompletionTargets.All(ConstraintSolver.IsApplicableMethApprox g amap m)) m ad true ty - let items = List.map ItemWithNoInst items - ReturnItemsOfType items g denv m filterCtors hasTextChangedSinceLastTypecheck - - // Value reference from the name resolution. Primarily to disallow "let x.$ = 1" - // In most of the cases, value references can be obtained from expression typings or from environment, - // so we wouldn't have to handle values here. However, if we have something like: - // let varA = "string" - // let varA = if b then 0 else varA. - // then the expression typings get confused (thinking 'varA:int'), so we use name resolution even for usual values. - - | CNR(_, Item.Value(vref), occurence, denv, nenv, ad, m) :: _, Some _ -> - if (occurence = ItemOccurence.Binding || occurence = ItemOccurence.Pattern) then - // Return empty list to stop further lookup - for value declarations - NameResResult.Cancel(denv, m) - else - // If we have any valid items for the value, then return completions for its type now. - // Adjust the type in case this is the 'this' pointer stored in a reference cell. - let ty = StripSelfRefCell(g, vref.BaseOrThisInfo, vref.TauType) - // patch accessibility domain to remove protected members if accessing NormalVal - let ad = - match vref.BaseOrThisInfo, ad with - | ValBaseOrThisInfo.NormalVal, AccessibleFrom(paths, Some tcref) -> - let tcref = generalizedTyconRef tcref - // check that type of value is the same or subtype of tcref - // yes - allow access to protected members - // no - strip ability to access protected members - if FSharp.Compiler.TypeRelations.TypeFeasiblySubsumesType 0 g amap m tcref FSharp.Compiler.TypeRelations.CanCoerce ty then - ad - else - AccessibleFrom(paths, None) - | _ -> ad - - let items = ResolveCompletionsInType ncenv nenv (ResolveCompletionTargets.All(ConstraintSolver.IsApplicableMethApprox g amap m)) m ad false ty - let items = List.map ItemWithNoInst items - ReturnItemsOfType items g denv m filterCtors hasTextChangedSinceLastTypecheck - - // No residue, so the items are the full resolution of the name - | CNR(_, _, _, denv, _, _, m) :: _, None -> - let items = - cnrs - |> List.map (fun cnr -> cnr.ItemWithInst) - // "into" is special magic syntax, not an identifier or a library call. It is part of capturedNameResolutions as an - // implementation detail of syntax coloring, but we should not report name resolution results for it, to prevent spurious QuickInfo. - |> List.filter (fun item -> match item.Item with Item.CustomOperation(CustomOperations.Into,_,_) -> false | _ -> true) - ReturnItemsOfType items g denv m filterCtors hasTextChangedSinceLastTypecheck - | _, _ -> NameResResult.Empty - - let TryGetTypeFromNameResolution(line, colAtEndOfNames, membersByResidue, resolveOverloads) = - let endOfNamesPos = mkPos line colAtEndOfNames - let items = GetCapturedNameResolutions endOfNamesPos resolveOverloads |> ResizeArray.toList |> List.rev - - match items, membersByResidue with - | CNR(_,Item.Types(_,(ty :: _)),_,_,_,_,_) :: _, Some _ -> Some ty - | CNR(_, Item.Value(vref), occurence,_,_,_,_) :: _, Some _ -> - if (occurence = ItemOccurence.Binding || occurence = ItemOccurence.Pattern) then None - else Some (StripSelfRefCell(g, vref.BaseOrThisInfo, vref.TauType)) - | _, _ -> None - - let CollectParameters (methods: MethInfo list) amap m: Item list = - methods - |> List.collect (fun meth -> - match meth.GetParamDatas(amap, m, meth.FormalMethodInst) with - | x :: _ -> x |> List.choose(fun (ParamData(_isParamArray, _isInArg, _isOutArg, _optArgInfo, _callerInfo, name, _, ty)) -> - match name with - | Some n -> Some (Item.ArgName(n, ty, Some (ArgumentContainer.Method meth))) - | None -> None - ) - | _ -> [] - ) - - let GetNamedParametersAndSettableFields endOfExprPos hasTextChangedSinceLastTypecheck = - let cnrs = GetCapturedNameResolutions endOfExprPos ResolveOverloads.No |> ResizeArray.toList |> List.rev - let result = - match cnrs with - | CNR(_, Item.CtorGroup(_, ((ctor :: _) as ctors)), _, denv, nenv, ad, m) :: _ -> - let props = ResolveCompletionsInType ncenv nenv ResolveCompletionTargets.SettablePropertiesAndFields m ad false ctor.ApparentEnclosingType - let parameters = CollectParameters ctors amap m - let items = props @ parameters - Some (denv, m, items) - | CNR(_, Item.MethodGroup(_, methods, _), _, denv, nenv, ad, m) :: _ -> - let props = - methods - |> List.collect (fun meth -> - let retTy = meth.GetFSharpReturnTy(amap, m, meth.FormalMethodInst) - ResolveCompletionsInType ncenv nenv ResolveCompletionTargets.SettablePropertiesAndFields m ad false retTy - ) - let parameters = CollectParameters methods amap m - let items = props @ parameters - Some (denv, m, items) - | _ -> - None - match result with - | None -> - NameResResult.Empty - | Some (denv, m, items) -> - let items = List.map ItemWithNoInst items - ReturnItemsOfType items g denv m TypeNameResolutionFlag.ResolveTypeNamesToTypeRefs hasTextChangedSinceLastTypecheck - - /// finds captured typing for the given position - let GetExprTypingForPosition(endOfExprPos) = - let quals = - sResolutions.CapturedExpressionTypings - |> Seq.filter (fun (pos,ty,denv,_,_,_) -> - // We only want expression types that end at the particular position in the file we are looking at. - let isLocationWeCareAbout = posEq pos endOfExprPos - // Get rid of function types. True, given a 2-arg curried function "f x y", it is legal to do "(f x).GetType()", - // but you almost never want to do this in practice, and we choose not to offer up any intellisense for - // F# function types. - let isFunction = isFunTy denv.g ty - isLocationWeCareAbout && not isFunction) - |> Seq.toArray - - let thereWereSomeQuals = not (Array.isEmpty quals) - // filter out errors - - let quals = quals - |> Array.filter (fun (_,ty,denv,_,_,_) -> not (isTyparTy denv.g ty && (destTyparTy denv.g ty).IsFromError)) - thereWereSomeQuals, quals - - /// obtains captured typing for the given position - /// if type of captured typing is record - returns list of record fields - let GetRecdFieldsForExpr(r : range) = - let _, quals = GetExprTypingForPosition(r.End) - let bestQual = - match quals with - | [||] -> None - | quals -> - quals |> Array.tryFind (fun (_,_,_,_,_,rq) -> - ignore(r) // for breakpoint - posEq r.Start rq.Start) - match bestQual with - | Some (_,ty,denv,_nenv,ad,m) when isRecdTy denv.g ty -> - let items = NameResolution.ResolveRecordOrClassFieldsOfType ncenv m ad ty false - Some (items, denv, m) - | _ -> None - - /// Looks at the exact expression types at the position to the left of the - /// residue then the source when it was typechecked. - let GetPreciseCompletionListFromExprTypings(parseResults:FSharpParseFileResults, endOfExprPos, filterCtors, hasTextChangedSinceLastTypecheck: (obj * range -> bool)) = - - let thereWereSomeQuals, quals = GetExprTypingForPosition(endOfExprPos) - - match quals with - | [| |] -> - if thereWereSomeQuals then - GetPreciseCompletionListFromExprTypingsResult.NoneBecauseThereWereTypeErrors - else - GetPreciseCompletionListFromExprTypingsResult.None - | _ -> - let bestQual, textChanged = - match parseResults.ParseTree with - | Some(input) -> - match UntypedParseImpl.GetRangeOfExprLeftOfDot(endOfExprPos,Some(input)) with // TODO we say "colAtEndOfNames" everywhere, but that's not really a good name ("foo . $" hit Ctrl-Space at $) - | Some( exprRange) -> - if hasTextChangedSinceLastTypecheck(textSnapshotInfo, exprRange) then - None, true // typecheck is stale, wait for second-chance IntelliSense to bring up right result - else - // See bug 130733. We have an up-to-date sync parse, and know the exact range of the prior expression. - // The quals all already have the same ending position, so find one with a matching starting position, if it exists. - // If not, then the stale typecheck info does not have a capturedExpressionTyping for this exact expression, and the - // user can wait for typechecking to catch up and second-chance intellisense to give the right result. - let qual = - quals |> Array.tryFind (fun (_,_,_,_,_,r) -> - ignore(r) // for breakpoint - posEq exprRange.Start r.Start) - qual, false - | None -> - // TODO In theory I think we should never get to this code path; it would be nice to add an assert. - // In practice, we do get here in some weird cases like "2.0 .. 3.0" and hitting Ctrl-Space in between the two dots of the range operator. - // I wasn't able to track down what was happening in those weird cases, not worth worrying about, it doesn't manifest as a product bug or anything. - None, false - | _ -> None, false - - match bestQual with - | Some bestQual -> - let (_,ty,denv,nenv,ad,m) = bestQual - let items = ResolveCompletionsInType ncenv nenv (ResolveCompletionTargets.All(ConstraintSolver.IsApplicableMethApprox g amap m)) m ad false ty - let items = items |> List.map ItemWithNoInst - let items = items |> RemoveDuplicateItems g - let items = items |> RemoveExplicitlySuppressed g - let items = items |> FilterItemsForCtors filterCtors - GetPreciseCompletionListFromExprTypingsResult.Some((items,denv,m), ty) - | None -> - if textChanged then GetPreciseCompletionListFromExprTypingsResult.NoneBecauseTypecheckIsStaleAndTextChanged - else GetPreciseCompletionListFromExprTypingsResult.None - - /// Find items in the best naming environment. - let GetEnvironmentLookupResolutions(nenv, ad, m, plid, filterCtors, showObsolete) = - let items = NameResolution.ResolvePartialLongIdent ncenv nenv (ConstraintSolver.IsApplicableMethApprox g amap m) m ad plid showObsolete - let items = items |> List.map ItemWithNoInst - let items = items |> RemoveDuplicateItems g - let items = items |> RemoveExplicitlySuppressed g - let items = items |> FilterItemsForCtors filterCtors - (items, nenv.DisplayEnv, m) - - /// Find items in the best naming environment. - let GetEnvironmentLookupResolutionsAtPosition(cursorPos, plid, filterCtors, showObsolete) = - let (nenv,ad),m = GetBestEnvForPos cursorPos - GetEnvironmentLookupResolutions(nenv, ad, m, plid, filterCtors, showObsolete) - - /// Find record fields in the best naming environment. - let GetClassOrRecordFieldsEnvironmentLookupResolutions(cursorPos, plid) = - let (nenv, ad),m = GetBestEnvForPos cursorPos - let items = NameResolution.ResolvePartialLongIdentToClassOrRecdFields ncenv nenv m ad plid false - let items = items |> List.map ItemWithNoInst - let items = items |> RemoveDuplicateItems g - let items = items |> RemoveExplicitlySuppressed g - items, nenv.DisplayEnv, m - - /// Resolve a location and/or text to items. - // Three techniques are used - // - look for an exact known name resolution from type checking - // - use the known type of an expression, e.g. (expr).Name, to generate an item list - // - lookup an entire name in the name resolution environment, e.g. A.B.Name, to generate an item list - // - // The overall aim is to resolve as accurately as possible based on what we know from type inference - - let GetBaseClassCandidates = function - | Item.ModuleOrNamespaces _ -> true - | Item.Types(_, ty :: _) when (isClassTy g ty) && not (isSealedTy g ty) -> true - | _ -> false - - let GetInterfaceCandidates = function - | Item.ModuleOrNamespaces _ -> true - | Item.Types(_, ty :: _) when (isInterfaceTy g ty) -> true - | _ -> false - - - // Return only items with the specified name - let FilterDeclItemsByResidue (getItem: 'a -> Item) residue (items: 'a list) = - let attributedResidue = residue + "Attribute" - let nameMatchesResidue name = (residue = name) || (attributedResidue = name) - - items |> List.filter (fun x -> - let item = getItem x - let n1 = item.DisplayName - match item with - | Item.Types _ -> nameMatchesResidue n1 - | Item.CtorGroup (_, meths) -> - nameMatchesResidue n1 || - meths |> List.exists (fun meth -> - let tcref = meth.ApparentEnclosingTyconRef - tcref.IsProvided || nameMatchesResidue tcref.DisplayName) - | _ -> residue = n1) - - /// Post-filter items to make sure they have precisely the right name - /// This also checks that there are some remaining results - /// exactMatchResidueOpt = Some _ -- means that we are looking for exact matches - let FilterRelevantItemsBy (getItem: 'a -> Item) (exactMatchResidueOpt : _ option) check (items: 'a list, denv, m) = - - // can throw if type is in located in non-resolved CCU: i.e. bigint if reference to System.Numerics is absent - let safeCheck item = try check item with _ -> false - - // Are we looking for items with precisely the given name? - if not (isNil items) && exactMatchResidueOpt.IsSome then - let items = items |> FilterDeclItemsByResidue getItem exactMatchResidueOpt.Value |> List.filter safeCheck - if not (isNil items) then Some(items, denv, m) else None - else - // When (items = []) we must returns Some([],..) and not None - // because this value is used if we want to stop further processing (e.g. let x.$ = ...) - let items = items |> List.filter safeCheck - Some(items, denv, m) - - /// Post-filter items to make sure they have precisely the right name - /// This also checks that there are some remaining results - let (|FilterRelevantItems|_|) getItem exactMatchResidueOpt orig = - FilterRelevantItemsBy getItem exactMatchResidueOpt (fun _ -> true) orig - - /// Find the first non-whitespace position in a line prior to the given character - let FindFirstNonWhitespacePosition (lineStr: string) i = - if i >= lineStr.Length then None - else - let mutable p = i - while p >= 0 && System.Char.IsWhiteSpace(lineStr.[p]) do - p <- p - 1 - if p >= 0 then Some p else None - - let CompletionItem (ty: ValueOption) (assemblySymbol: ValueOption) (item: ItemWithInst) = - let kind = - match item.Item with - | Item.MethodGroup (_, minfo :: _, _) -> CompletionItemKind.Method minfo.IsExtensionMember - | Item.RecdField _ - | Item.Property _ -> CompletionItemKind.Property - | Item.Event _ -> CompletionItemKind.Event - | Item.ILField _ - | Item.Value _ -> CompletionItemKind.Field - | Item.CustomOperation _ -> CompletionItemKind.CustomOperation - | _ -> CompletionItemKind.Other - - { ItemWithInst = item - MinorPriority = 0 - Kind = kind - IsOwnMember = false - Type = match ty with ValueSome x -> Some x | _ -> None - Unresolved = match assemblySymbol with ValueSome x -> Some x.UnresolvedSymbol | _ -> None } - - let DefaultCompletionItem item = CompletionItem ValueNone ValueNone item - - let getItem (x: ItemWithInst) = x.Item - let GetDeclaredItems (parseResultsOpt: FSharpParseFileResults option, lineStr: string, origLongIdentOpt, colAtEndOfNamesAndResidue, residueOpt, lastDotPos, line, loc, - filterCtors, resolveOverloads, hasTextChangedSinceLastTypecheck, isInRangeOperator, allSymbols: unit -> AssemblySymbol list) = - - // Are the last two chars (except whitespaces) = ".." - let isLikeRangeOp = - match FindFirstNonWhitespacePosition lineStr (colAtEndOfNamesAndResidue - 1) with - | Some x when x >= 1 && lineStr.[x] = '.' && lineStr.[x - 1] = '.' -> true - | _ -> false - - // if last two chars are .. and we are not in range operator context - no completion - if isLikeRangeOp && not isInRangeOperator then None else - - // Try to use the exact results of name resolution during type checking to generate the results - // This is based on position (i.e. colAtEndOfNamesAndResidue). This is not used if a residueOpt is given. - let nameResItems = - match residueOpt with - | None -> GetPreciseItemsFromNameResolution(line, colAtEndOfNamesAndResidue, None, filterCtors,resolveOverloads, hasTextChangedSinceLastTypecheck) - | Some residue -> - // deals with cases when we have spaces between dot and\or identifier, like A . $ - // if this is our case - then we need to locate end position of the name skipping whitespaces - // this allows us to handle cases like: let x . $ = 1 - match lastDotPos |> Option.orElseWith (fun _ -> FindFirstNonWhitespacePosition lineStr (colAtEndOfNamesAndResidue - 1)) with - | Some p when lineStr.[p] = '.' -> - match FindFirstNonWhitespacePosition lineStr (p - 1) with - | Some colAtEndOfNames -> - let colAtEndOfNames = colAtEndOfNames + 1 // convert 0-based to 1-based - GetPreciseItemsFromNameResolution(line, colAtEndOfNames, Some(residue), filterCtors,resolveOverloads, hasTextChangedSinceLastTypecheck) - | None -> NameResResult.Empty - | _ -> NameResResult.Empty - - // Normalize to form A.B.C.D where D is the residue. It may be empty for "A.B.C." - // residueOpt = Some when we are looking for the exact match - let plid, exactMatchResidueOpt = - match origLongIdentOpt, residueOpt with - | None, _ -> [], None - | Some(origLongIdent), Some _ -> origLongIdent, None - | Some(origLongIdent), None -> - System.Diagnostics.Debug.Assert(not (isNil origLongIdent), "origLongIdent is empty") - // note: as above, this happens when we are called for "precise" resolution - (F1 keyword, data tip etc..) - let plid, residue = List.frontAndBack origLongIdent - plid, Some residue - - let pos = mkPos line loc - let (nenv, ad), m = GetBestEnvForPos pos - - let getType() = - match NameResolution.TryToResolveLongIdentAsType ncenv nenv m plid with - | Some x -> tryDestAppTy g x - | None -> - match lastDotPos |> Option.orElseWith (fun _ -> FindFirstNonWhitespacePosition lineStr (colAtEndOfNamesAndResidue - 1)) with - | Some p when lineStr.[p] = '.' -> - match FindFirstNonWhitespacePosition lineStr (p - 1) with - | Some colAtEndOfNames -> - let colAtEndOfNames = colAtEndOfNames + 1 // convert 0-based to 1-based - match TryGetTypeFromNameResolution(line, colAtEndOfNames, residueOpt, resolveOverloads) with - | Some x -> tryDestAppTy g x - | _ -> ValueNone - | None -> ValueNone - | _ -> ValueNone - - match nameResItems with - | NameResResult.TypecheckStaleAndTextChanged -> None // second-chance intellisense will try again - | NameResResult.Cancel(denv,m) -> Some([], denv, m) - | NameResResult.Members(FilterRelevantItems getItem exactMatchResidueOpt (items, denv, m)) -> - // lookup based on name resolution results successful - Some (items |> List.map (CompletionItem (getType()) ValueNone), denv, m) - | _ -> - match origLongIdentOpt with - | None -> None - | Some _ -> - - // Try to use the type of the expression on the left to help generate a completion list - let qualItems, thereIsADotInvolved = - match parseResultsOpt with - | None -> - // Note, you will get here if the 'reason' is not CompleteWord/MemberSelect/DisplayMemberList, as those are currently the - // only reasons we do a sync parse to have the most precise and likely-to-be-correct-and-up-to-date info. So for example, - // if you do QuickInfo hovering over A in "f(x).A()", you will only get a tip if typechecking has a name-resolution recorded - // for A, not if merely we know the capturedExpressionTyping of f(x) and you very recently typed ".A()" - in that case, - // you won't won't get a tip until the typechecking catches back up. - GetPreciseCompletionListFromExprTypingsResult.None, false - | Some parseResults -> - - match UntypedParseImpl.TryFindExpressionASTLeftOfDotLeftOfCursor(mkPos line colAtEndOfNamesAndResidue,parseResults.ParseTree) with - | Some(pos,_) -> - GetPreciseCompletionListFromExprTypings(parseResults, pos, filterCtors, hasTextChangedSinceLastTypecheck), true - | None -> - // Can get here in a case like: if "f xxx yyy" is legal, and we do "f xxx y" - // We have no interest in expression typings, those are only useful for dot-completion. We want to fallback - // to "Use an environment lookup as the last resort" below - GetPreciseCompletionListFromExprTypingsResult.None, false - - match qualItems,thereIsADotInvolved with - | GetPreciseCompletionListFromExprTypingsResult.Some(FilterRelevantItems getItem exactMatchResidueOpt (items, denv, m), ty), _ - // Initially we only use the expression typings when looking up, e.g. (expr).Nam or (expr).Name1.Nam - // These come through as an empty plid and residue "". Otherwise we try an environment lookup - // and then return to the qualItems. This is because the expression typings are a little inaccurate, primarily because - // it appears we're getting some typings recorded for non-atomic expressions like "f x" - when isNil plid -> - // lookup based on expression typings successful - Some (items |> List.map (CompletionItem (tryDestAppTy g ty) ValueNone), denv, m) - | GetPreciseCompletionListFromExprTypingsResult.NoneBecauseThereWereTypeErrors, _ -> - // There was an error, e.g. we have "." and there is an error determining the type of - // In this case, we don't want any of the fallback logic, rather, we want to produce zero results. - None - | GetPreciseCompletionListFromExprTypingsResult.NoneBecauseTypecheckIsStaleAndTextChanged, _ -> - // we want to report no result and let second-chance intellisense kick in - None - | _, true when isNil plid -> - // If the user just pressed '.' after an _expression_ (not a plid), it is never right to show environment-lookup top-level completions. - // The user might by typing quickly, and the LS didn't have an expression type right before the dot yet. - // Second-chance intellisense will bring up the correct list in a moment. - None - | _ -> - // Use an environment lookup as the last resort - let envItems, denv, m = GetEnvironmentLookupResolutions(nenv, ad, m, plid, filterCtors, residueOpt.IsSome) - - let envResult = - match nameResItems, (envItems, denv, m), qualItems with - - // First, use unfiltered name resolution items, if they're not empty - | NameResResult.Members(items, denv, m), _, _ when not (isNil items) -> - // lookup based on name resolution results successful - ValueSome(items |> List.map (CompletionItem (getType()) ValueNone), denv, m) - - // If we have nonempty items from environment that were resolved from a type, then use them... - // (that's better than the next case - here we'd return 'int' as a type) - | _, FilterRelevantItems getItem exactMatchResidueOpt (items, denv, m), _ when not (isNil items) -> - // lookup based on name and environment successful - ValueSome(items |> List.map (CompletionItem (getType()) ValueNone), denv, m) - - // Try again with the qualItems - | _, _, GetPreciseCompletionListFromExprTypingsResult.Some(FilterRelevantItems getItem exactMatchResidueOpt (items, denv, m), ty) -> - ValueSome(items |> List.map (CompletionItem (tryDestAppTy g ty) ValueNone), denv, m) - - | _ -> ValueNone - - let globalResult = - match origLongIdentOpt with - | None | Some [] -> - let globalItems = - allSymbols() - |> List.filter (fun x -> not x.Symbol.IsExplicitlySuppressed) - |> List.filter (fun x -> - match x.Symbol with - | :? FSharpMemberOrFunctionOrValue as m when m.IsConstructor && filterCtors = ResolveTypeNamesToTypeRefs -> false - | _ -> true) - - let getItem (x: AssemblySymbol) = x.Symbol.Item - - match globalItems, denv, m with - | FilterRelevantItems getItem exactMatchResidueOpt (globalItemsFiltered, denv, m) when not (isNil globalItemsFiltered) -> - globalItemsFiltered - |> List.map(fun globalItem -> CompletionItem (getType()) (ValueSome globalItem) (ItemWithNoInst globalItem.Symbol.Item)) - |> fun r -> ValueSome(r, denv, m) - | _ -> ValueNone - | _ -> ValueNone // do not return unresolved items after dot - - match envResult, globalResult with - | ValueSome (items, denv, m), ValueSome (gItems,_,_) -> Some (items @ gItems, denv, m) - | ValueSome x, ValueNone -> Some x - | ValueNone, ValueSome y -> Some y - | ValueNone, ValueNone -> None - - - let toCompletionItems (items: ItemWithInst list, denv: DisplayEnv, m: range ) = - items |> List.map DefaultCompletionItem, denv, m - - /// Get the auto-complete items at a particular location. - let GetDeclItemsForNamesAtPosition(ctok: CompilationThreadToken, parseResultsOpt: FSharpParseFileResults option, origLongIdentOpt: string list option, - residueOpt:string option, lastDotPos: int option, line:int, lineStr:string, colAtEndOfNamesAndResidue, filterCtors, resolveOverloads, - getAllSymbols: unit -> AssemblySymbol list, hasTextChangedSinceLastTypecheck: (obj * range -> bool)) - : (CompletionItem list * DisplayEnv * CompletionContext option * range) option = - RequireCompilationThread ctok // the operations in this method need the reactor thread - - let loc = - match colAtEndOfNamesAndResidue with - | pastEndOfLine when pastEndOfLine >= lineStr.Length -> lineStr.Length - | atDot when lineStr.[atDot] = '.' -> atDot + 1 - | atStart when atStart = 0 -> 0 - | otherwise -> otherwise - 1 - - // Look for a "special" completion context - let completionContext = - parseResultsOpt - |> Option.bind (fun x -> x.ParseTree) - |> Option.bind (fun parseTree -> UntypedParseImpl.TryGetCompletionContext(mkPos line colAtEndOfNamesAndResidue, parseTree, lineStr)) - - let res = - match completionContext with - // Invalid completion locations - | Some CompletionContext.Invalid -> None - - // Completion at 'inherit C(...)" - | Some (CompletionContext.Inherit(InheritanceContext.Class, (plid, _))) -> - GetEnvironmentLookupResolutionsAtPosition(mkPos line loc, plid, filterCtors, false) - |> FilterRelevantItemsBy getItem None (getItem >> GetBaseClassCandidates) - |> Option.map toCompletionItems - - // Completion at 'interface ..." - | Some (CompletionContext.Inherit(InheritanceContext.Interface, (plid, _))) -> - GetEnvironmentLookupResolutionsAtPosition(mkPos line loc, plid, filterCtors, false) - |> FilterRelevantItemsBy getItem None (getItem >> GetInterfaceCandidates) - |> Option.map toCompletionItems - - // Completion at 'implement ..." - | Some (CompletionContext.Inherit(InheritanceContext.Unknown, (plid, _))) -> - GetEnvironmentLookupResolutionsAtPosition(mkPos line loc, plid, filterCtors, false) - |> FilterRelevantItemsBy getItem None (getItem >> (fun t -> GetBaseClassCandidates t || GetInterfaceCandidates t)) - |> Option.map toCompletionItems - - // Completion at ' { XXX = ... } " - | Some(CompletionContext.RecordField(RecordContext.New(plid, _))) -> - // { x. } can be either record construction or computation expression. Try to get all visible record fields first - match GetClassOrRecordFieldsEnvironmentLookupResolutions(mkPos line loc, plid) |> toCompletionItems with - | [],_,_ -> - // no record fields found, return completion list as if we were outside any computation expression - GetDeclaredItems (parseResultsOpt, lineStr, origLongIdentOpt, colAtEndOfNamesAndResidue, residueOpt, lastDotPos, line, loc, filterCtors,resolveOverloads, hasTextChangedSinceLastTypecheck, false, fun() -> []) - | result -> Some(result) - - // Completion at ' { XXX = ... with ... } " - | Some(CompletionContext.RecordField(RecordContext.CopyOnUpdate(r, (plid, _)))) -> - match GetRecdFieldsForExpr(r) with - | None -> - Some (GetClassOrRecordFieldsEnvironmentLookupResolutions(mkPos line loc, plid)) - |> Option.map toCompletionItems - | Some (items, denv, m) -> - Some (List.map ItemWithNoInst items, denv, m) - |> Option.map toCompletionItems - - // Completion at ' { XXX = ... with ... } " - | Some(CompletionContext.RecordField(RecordContext.Constructor(typeName))) -> - Some(GetClassOrRecordFieldsEnvironmentLookupResolutions(mkPos line loc, [typeName])) - |> Option.map toCompletionItems - - // Completion at ' SomeMethod( ... ) ' with named arguments - | Some(CompletionContext.ParameterList (endPos, fields)) -> - let results = GetNamedParametersAndSettableFields endPos hasTextChangedSinceLastTypecheck - - let declaredItems = - GetDeclaredItems (parseResultsOpt, lineStr, origLongIdentOpt, colAtEndOfNamesAndResidue, residueOpt, lastDotPos, line, loc, filterCtors, resolveOverloads, - hasTextChangedSinceLastTypecheck, false, getAllSymbols) - - match results with - | NameResResult.Members(items, denv, m) -> - let filtered = - items - |> RemoveDuplicateItems g - |> RemoveExplicitlySuppressed g - |> List.filter (fun item -> not (fields.Contains item.Item.DisplayName)) - |> List.map (fun item -> - { ItemWithInst = item - Kind = CompletionItemKind.Argument - MinorPriority = 0 - IsOwnMember = false - Type = None - Unresolved = None }) - match declaredItems with - | None -> Some (toCompletionItems (items, denv, m)) - | Some (declItems, declaredDisplayEnv, declaredRange) -> Some (filtered @ declItems, declaredDisplayEnv, declaredRange) - | _ -> declaredItems - - | Some(CompletionContext.AttributeApplication) -> - GetDeclaredItems (parseResultsOpt, lineStr, origLongIdentOpt, colAtEndOfNamesAndResidue, residueOpt, lastDotPos, line, loc, filterCtors, resolveOverloads, hasTextChangedSinceLastTypecheck, false, getAllSymbols) - |> Option.map (fun (items, denv, m) -> - items - |> List.filter (fun cItem -> - match cItem.Item with - | Item.ModuleOrNamespaces _ -> true - | _ when IsAttribute infoReader cItem.Item -> true - | _ -> false), denv, m) - - | Some(CompletionContext.OpenDeclaration) -> - GetDeclaredItems (parseResultsOpt, lineStr, origLongIdentOpt, colAtEndOfNamesAndResidue, residueOpt, lastDotPos, line, loc, filterCtors, resolveOverloads, hasTextChangedSinceLastTypecheck, false, getAllSymbols) - |> Option.map (fun (items, denv, m) -> - items |> List.filter (fun x -> match x.Item with Item.ModuleOrNamespaces _ -> true | _ -> false), denv, m) - - // Completion at '(x: ...)" - | Some (CompletionContext.PatternType) -> - GetDeclaredItems (parseResultsOpt, lineStr, origLongIdentOpt, colAtEndOfNamesAndResidue, residueOpt, lastDotPos, line, loc, filterCtors, resolveOverloads, hasTextChangedSinceLastTypecheck, false, getAllSymbols) - |> Option.map (fun (items, denv, m) -> - items - |> List.filter (fun cItem -> - match cItem.Item with - | Item.ModuleOrNamespaces _ - | Item.Types _ - | Item.UnqualifiedType _ - | Item.ExnCase _ -> true - | _ -> false), denv, m) - - // Other completions - | cc -> - match residueOpt |> Option.bind Seq.tryHead with - | Some ''' -> - // The last token in - // let x = 'E - // is Ident with text "'E", however it's either unfinished char literal or generic parameter. - // We should not provide any completion in the former case, and we don't provide it for the latter one for now - // because providing generic parameters list is context aware, which we don't have here (yet). - None - | _ -> - let isInRangeOperator = (match cc with Some (CompletionContext.RangeOperator) -> true | _ -> false) - GetDeclaredItems (parseResultsOpt, lineStr, origLongIdentOpt, colAtEndOfNamesAndResidue, residueOpt, lastDotPos, line, loc, filterCtors,resolveOverloads, hasTextChangedSinceLastTypecheck, isInRangeOperator, getAllSymbols) - - res |> Option.map (fun (items, denv, m) -> items, denv, completionContext, m) - - /// Return 'false' if this is not a completion item valid in an interface file. - let IsValidSignatureFileItem item = - 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 - NameResolution.GetVisibleNamespacesAndModulesAtPoint ncenv nenv m ad - - /// Determines if a long ident is resolvable at a specific point. - member __.IsRelativeNameResolvable(cursorPos: pos, plid: string list, item: Item) : bool = - ErrorScope.Protect - Range.range0 - (fun () -> - /// Find items in the best naming environment. - let (nenv, ad), m = GetBestEnvForPos cursorPos - NameResolution.IsItemResolvable ncenv nenv m ad plid item) - (fun msg -> - Trace.TraceInformation(sprintf "FCS: recovering from error in IsRelativeNameResolvable: '%s'" msg) - false) - - /// Determines if a long ident is resolvable at a specific point. - member scope.IsRelativeNameResolvableFromSymbol(cursorPos: pos, plid: string list, symbol: FSharpSymbol) : bool = - scope.IsRelativeNameResolvable(cursorPos, plid, symbol.Item) - - /// Get the auto-complete items at a location - member __.GetDeclarations (ctok, parseResultsOpt, line, lineStr, partialName, getAllEntities, hasTextChangedSinceLastTypecheck) = - let isInterfaceFile = SourceFileImpl.IsInterfaceFile mainInputFileName - ErrorScope.Protect Range.range0 - (fun () -> - match GetDeclItemsForNamesAtPosition(ctok, parseResultsOpt, Some partialName.QualifyingIdents, Some partialName.PartialIdent, partialName.LastDotPos, line, lineStr, partialName.EndColumn + 1, ResolveTypeNamesToCtors, ResolveOverloads.Yes, getAllEntities, hasTextChangedSinceLastTypecheck) with - | None -> FSharpDeclarationListInfo.Empty - | Some (items, denv, ctx, m) -> - let items = if isInterfaceFile then items |> List.filter (fun x -> IsValidSignatureFileItem x.Item) else items - let getAccessibility item = FSharpSymbol.GetAccessibility (FSharpSymbol.Create(cenv, item)) - let currentNamespaceOrModule = - parseResultsOpt - |> Option.bind (fun x -> x.ParseTree) - |> Option.map (fun parsedInput -> UntypedParseImpl.GetFullNameOfSmallestModuleOrNamespaceAtPoint(parsedInput, mkPos line 0)) - let isAttributeApplication = ctx = Some CompletionContext.AttributeApplication - FSharpDeclarationListInfo.Create(infoReader,m,denv,getAccessibility,items,reactorOps,currentNamespaceOrModule,isAttributeApplication)) - (fun msg -> - Trace.TraceInformation(sprintf "FCS: recovering from error in GetDeclarations: '%s'" msg) - FSharpDeclarationListInfo.Error msg) - - /// Get the symbols for auto-complete items at a location - member __.GetDeclarationListSymbols (ctok, parseResultsOpt, line, lineStr, partialName, getAllEntities, hasTextChangedSinceLastTypecheck) = - let isInterfaceFile = SourceFileImpl.IsInterfaceFile mainInputFileName - ErrorScope.Protect Range.range0 - (fun () -> - match GetDeclItemsForNamesAtPosition(ctok, parseResultsOpt, Some partialName.QualifyingIdents, Some partialName.PartialIdent, partialName.LastDotPos, line, lineStr, partialName.EndColumn + 1, ResolveTypeNamesToCtors, ResolveOverloads.Yes, getAllEntities, hasTextChangedSinceLastTypecheck) with - | None -> List.Empty - | Some (items, denv, _, m) -> - let items = if isInterfaceFile then items |> List.filter (fun x -> IsValidSignatureFileItem x.Item) else items - - //do filtering like Declarationset - let items = items |> RemoveExplicitlySuppressedCompletionItems g - - // Sort by name. For things with the same name, - // - show types with fewer generic parameters first - // - show types before over other related items - they usually have very useful XmlDocs - let items = - items |> List.sortBy (fun d -> - let n = - match d.Item with - | Item.Types (_,(TType_app(tcref,_) :: _)) -> 1 + tcref.TyparsNoRange.Length - // Put delegate ctors after types, sorted by #typars. RemoveDuplicateItems will remove FakeInterfaceCtor and DelegateCtor if an earlier type is also reported with this name - | Item.FakeInterfaceCtor (TType_app(tcref,_)) - | Item.DelegateCtor (TType_app(tcref,_)) -> 1000 + tcref.TyparsNoRange.Length - // Put type ctors after types, sorted by #typars. RemoveDuplicateItems will remove DefaultStructCtors if a type is also reported with this name - | Item.CtorGroup (_, (cinfo :: _)) -> 1000 + 10 * cinfo.DeclaringTyconRef.TyparsNoRange.Length - | _ -> 0 - (d.Item.DisplayName,n)) - - // Remove all duplicates. We've put the types first, so this removes the DelegateCtor and DefaultStructCtor's. - let items = items |> RemoveDuplicateCompletionItems g - - // Group by compiled name for types, display name for functions - // (We don't want types with the same display name to be grouped as overloads) - let items = - items |> List.groupBy (fun d -> - match d.Item with - | Item.Types (_,(TType_app(tcref,_) :: _)) - | Item.ExnCase tcref -> tcref.LogicalName - | Item.UnqualifiedType(tcref :: _) - | Item.FakeInterfaceCtor (TType_app(tcref,_)) - | Item.DelegateCtor (TType_app(tcref,_)) -> tcref.CompiledName - | Item.CtorGroup (_, (cinfo :: _)) -> - cinfo.ApparentEnclosingTyconRef.CompiledName - | _ -> d.Item.DisplayName) - - // Filter out operators (and list) - let items = - // Check whether this item looks like an operator. - let isOpItem(nm, item: CompletionItem list) = - match item |> List.map (fun x -> x.Item) with - | [Item.Value _] - | [Item.MethodGroup(_,[_],_)] -> IsOperatorName nm - | [Item.UnionCase _] -> IsOperatorName nm - | _ -> false - - let isFSharpList nm = (nm = "[]") // list shows up as a Type and a UnionCase, only such entity with a symbolic name, but want to filter out of intellisense - - items |> List.filter (fun (nm,items) -> not (isOpItem(nm,items)) && not(isFSharpList nm)) - - let items = - // Filter out duplicate names - items |> List.map (fun (_nm,itemsWithSameName) -> - match itemsWithSameName with - | [] -> failwith "Unexpected empty bag" - | items -> - items - |> List.map (fun item -> let symbol = FSharpSymbol.Create(cenv, item.Item) - FSharpSymbolUse(g, denv, symbol, ItemOccurence.Use, m))) - - //end filtering - items) - (fun msg -> - Trace.TraceInformation(sprintf "FCS: recovering from error in GetDeclarationListSymbols: '%s'" msg) - []) - - /// Get the "reference resolution" tooltip for at a location - member __.GetReferenceResolutionStructuredToolTipText(ctok, line,col) = - - RequireCompilationThread ctok // the operations in this method need the reactor thread but the reasons why are not yet grounded - - let pos = mkPos line col - let isPosMatch(pos, ar:AssemblyReference) : bool = - let isRangeMatch = (Range.rangeContainsPos ar.Range pos) - let isNotSpecialRange = not (Range.equals ar.Range rangeStartup) && not (Range.equals ar.Range range0) && not (Range.equals ar.Range rangeCmdArgs) - let isMatch = isRangeMatch && isNotSpecialRange - isMatch - - let dataTipOfReferences() = - let matches = - match loadClosure with - | None -> [] - | Some(loadClosure) -> - loadClosure.References - |> List.map snd - |> List.concat - |> List.filter(fun ar->isPosMatch(pos, ar.originalReference)) - - match matches with - | resolved :: _ // Take the first seen - | [resolved] -> - let tip = wordL (TaggedTextOps.tagStringLiteral((resolved.prepareToolTip ()).TrimEnd([|'\n'|]))) - FSharpStructuredToolTipText.FSharpToolTipText [FSharpStructuredToolTipElement.Single(tip, FSharpXmlDoc.None)] - - | [] -> FSharpStructuredToolTipText.FSharpToolTipText [] - - ErrorScope.Protect Range.range0 - dataTipOfReferences - (fun err -> - Trace.TraceInformation(sprintf "FCS: recovering from error in GetReferenceResolutionStructuredToolTipText: '%s'" err) - FSharpToolTipText [FSharpStructuredToolTipElement.CompositionError err]) - - // GetToolTipText: return the "pop up" (or "Quick Info") text given a certain context. - member __.GetStructuredToolTipText(ctok, line, lineStr, colAtEndOfNames, names) = - let Compute() = - ErrorScope.Protect Range.range0 - (fun () -> - match GetDeclItemsForNamesAtPosition(ctok, None,Some(names),None,None,line,lineStr,colAtEndOfNames,ResolveTypeNamesToCtors,ResolveOverloads.Yes,(fun() -> []),fun _ -> false) with - | None -> FSharpToolTipText [] - | Some(items, denv, _, m) -> - FSharpToolTipText(items |> List.map (fun x -> FormatStructuredDescriptionOfItem false infoReader m denv x.ItemWithInst))) - (fun err -> - Trace.TraceInformation(sprintf "FCS: recovering from error in GetStructuredToolTipText: '%s'" err) - FSharpToolTipText [FSharpStructuredToolTipElement.CompositionError err]) - - // See devdiv bug 646520 for rationale behind truncating and caching these quick infos (they can be big!) - let key = line,colAtEndOfNames,lineStr - match getToolTipTextCache.TryGet (ctok, key) with - | Some res -> res - | None -> - let res = Compute() - getToolTipTextCache.Put(ctok, key,res) - res - - member __.GetF1Keyword (ctok, line, lineStr, colAtEndOfNames, names) : string option = - ErrorScope.Protect Range.range0 - (fun () -> - match GetDeclItemsForNamesAtPosition(ctok, None, Some names, None, None, line, lineStr, colAtEndOfNames, ResolveTypeNamesToCtors, ResolveOverloads.No,(fun() -> []), fun _ -> false) with // F1 Keywords do not distinguish between overloads - | None -> None - | Some (items: CompletionItem list, _,_, _) -> - match items with - | [] -> None - | [item] -> - GetF1Keyword g item.Item - | _ -> - // handle new Type() - let allTypes, constr, ty = - List.fold - (fun (allTypes,constr,ty) (item: CompletionItem) -> - match item.Item, constr, ty with - | (Item.Types _) as t, _, None -> allTypes, constr, Some t - | (Item.Types _), _, _ -> allTypes, constr, ty - | (Item.CtorGroup _), None, _ -> allTypes, Some item.Item, ty - | _ -> false, None, None) - (true,None,None) items - match allTypes, constr, ty with - | true, Some (Item.CtorGroup(_, _) as item), _ - -> GetF1Keyword g item - | true, _, Some ty - -> GetF1Keyword g ty - | _ -> None - ) - (fun msg -> - Trace.TraceInformation(sprintf "FCS: recovering from error in GetF1Keyword: '%s'" msg) - None) - - member __.GetMethods (ctok, line, lineStr, colAtEndOfNames, namesOpt) = - ErrorScope.Protect Range.range0 - (fun () -> - match GetDeclItemsForNamesAtPosition(ctok, None,namesOpt,None,None,line,lineStr,colAtEndOfNames,ResolveTypeNamesToCtors,ResolveOverloads.No,(fun() -> []),fun _ -> false) with - | None -> FSharpMethodGroup("",[| |]) - | Some (items, denv, _, m) -> - // GetDeclItemsForNamesAtPosition returns Items.Types and Item.CtorGroup for `new T(|)`, - // the Item.Types is not needed here as it duplicates (at best) parameterless ctor. - let ctors = items |> List.filter (fun x -> match x.Item with Item.CtorGroup _ -> true | _ -> false) - let items = - match ctors with - | [] -> items - | ctors -> ctors - FSharpMethodGroup.Create(infoReader, m, denv, items |> List.map (fun x -> x.ItemWithInst))) - (fun msg -> - Trace.TraceInformation(sprintf "FCS: recovering from error in GetMethods: '%s'" msg) - FSharpMethodGroup(msg,[| |])) - - member __.GetMethodsAsSymbols (ctok, line, lineStr, colAtEndOfNames, names) = - ErrorScope.Protect Range.range0 - (fun () -> - match GetDeclItemsForNamesAtPosition (ctok, None,Some(names), None, None,line, lineStr, colAtEndOfNames, ResolveTypeNamesToCtors, ResolveOverloads.No,(fun() -> []),fun _ -> false) with - | None | Some ([],_,_,_) -> None - | Some (items, denv, _, m) -> - let allItems = items |> List.collect (fun item -> SymbolHelpers.FlattenItems g m item.Item) - let symbols = allItems |> List.map (fun item -> FSharpSymbol.Create(cenv, item)) - Some (symbols, denv, m) - ) - (fun msg -> - Trace.TraceInformation(sprintf "FCS: recovering from error in GetMethodsAsSymbols: '%s'" msg) - None) - - member __.GetDeclarationLocation (ctok, line, lineStr, colAtEndOfNames, names, preferFlag) = - ErrorScope.Protect Range.range0 - (fun () -> - match GetDeclItemsForNamesAtPosition (ctok, None,Some(names), None, None, line, lineStr, colAtEndOfNames, ResolveTypeNamesToCtors,ResolveOverloads.Yes,(fun() -> []), fun _ -> false) with - | None - | Some ([], _, _, _) -> FSharpFindDeclResult.DeclNotFound (FSharpFindDeclFailureReason.Unknown "") - | Some (item :: _, _, _, _) -> - let getTypeVarNames (ilinfo: ILMethInfo) = - let classTypeParams = ilinfo.DeclaringTyconRef.ILTyconRawMetadata.GenericParams |> List.map (fun paramDef -> paramDef.Name) - let methodTypeParams = ilinfo.FormalMethodTypars |> List.map (fun ty -> ty.Name) - classTypeParams @ methodTypeParams |> Array.ofList - - let result = - match item.Item with - | Item.CtorGroup (_, (ILMeth (_,ilinfo,_)) :: _) -> - match ilinfo.MetadataScope with - | ILScopeRef.Assembly assemblyRef -> - let typeVarNames = getTypeVarNames ilinfo - ParamTypeSymbol.tryOfILTypes typeVarNames ilinfo.ILMethodRef.ArgTypes - |> Option.map (fun args -> - let externalSym = ExternalSymbol.Constructor (ilinfo.ILMethodRef.DeclaringTypeRef.FullName, args) - FSharpFindDeclResult.ExternalDecl (assemblyRef.Name, externalSym)) - | _ -> None - - | Item.MethodGroup (name, (ILMeth (_,ilinfo,_)) :: _, _) -> - match ilinfo.MetadataScope with - | ILScopeRef.Assembly assemblyRef -> - let typeVarNames = getTypeVarNames ilinfo - ParamTypeSymbol.tryOfILTypes typeVarNames ilinfo.ILMethodRef.ArgTypes - |> Option.map (fun args -> - let externalSym = ExternalSymbol.Method (ilinfo.ILMethodRef.DeclaringTypeRef.FullName, name, args, ilinfo.ILMethodRef.GenericArity) - FSharpFindDeclResult.ExternalDecl (assemblyRef.Name, externalSym)) - | _ -> None - - | Item.Property (name, ILProp propInfo :: _) -> - let methInfo = - if propInfo.HasGetter then Some propInfo.GetterMethod - elif propInfo.HasSetter then Some propInfo.SetterMethod - else None - - match methInfo with - | Some methInfo -> - match methInfo.MetadataScope with - | ILScopeRef.Assembly assemblyRef -> - let externalSym = ExternalSymbol.Property (methInfo.ILMethodRef.DeclaringTypeRef.FullName, name) - Some (FSharpFindDeclResult.ExternalDecl (assemblyRef.Name, externalSym)) - | _ -> None - | None -> None - - | Item.ILField (ILFieldInfo (typeInfo, fieldDef)) when not typeInfo.TyconRefOfRawMetadata.IsLocalRef -> - match typeInfo.ILScopeRef with - | ILScopeRef.Assembly assemblyRef -> - let externalSym = ExternalSymbol.Field (typeInfo.ILTypeRef.FullName, fieldDef.Name) - Some (FSharpFindDeclResult.ExternalDecl (assemblyRef.Name, externalSym)) - | _ -> None - - | Item.Event (ILEvent (ILEventInfo (typeInfo, eventDef))) when not typeInfo.TyconRefOfRawMetadata.IsLocalRef -> - match typeInfo.ILScopeRef with - | ILScopeRef.Assembly assemblyRef -> - let externalSym = ExternalSymbol.Event (typeInfo.ILTypeRef.FullName, eventDef.Name) - Some (FSharpFindDeclResult.ExternalDecl (assemblyRef.Name, externalSym)) - | _ -> None - - | Item.ImplicitOp(_, {contents = Some(TraitConstraintSln.FSMethSln(_, _vref, _))}) -> - //Item.Value(vref) - None - - | Item.Types (_, TType_app (tr, _) :: _) when tr.IsLocalRef && tr.IsTypeAbbrev -> None - - | Item.Types (_, [ AppTy g (tr, _) ]) when not tr.IsLocalRef -> - match tr.TypeReprInfo, tr.PublicPath with - | TILObjectRepr(TILObjectReprData (ILScopeRef.Assembly assemblyRef, _, _)), Some (PubPath parts) -> - let fullName = parts |> String.concat "." - Some (FSharpFindDeclResult.ExternalDecl (assemblyRef.Name, ExternalSymbol.Type fullName)) - | _ -> None - | _ -> None - match result with - | Some x -> x - | None -> - match rangeOfItem g preferFlag item.Item with - | Some itemRange -> - let projectDir = Filename.directoryName (if projectFileName = "" then mainInputFileName else projectFileName) - let range = fileNameOfItem g (Some projectDir) itemRange item.Item - mkRange range itemRange.Start itemRange.End - |> FSharpFindDeclResult.DeclFound - | None -> - match item.Item with -#if !NO_EXTENSIONTYPING -// provided items may have TypeProviderDefinitionLocationAttribute that binds them to some location - | Item.CtorGroup (name, ProvidedMeth (_) :: _ ) - | Item.MethodGroup(name, ProvidedMeth (_) :: _, _) - | Item.Property (name, ProvidedProp (_) :: _ ) -> FSharpFindDeclFailureReason.ProvidedMember name - | Item.Event ( ProvidedEvent(_) as e ) -> FSharpFindDeclFailureReason.ProvidedMember e.EventName - | Item.ILField ( ProvidedField(_) as f ) -> FSharpFindDeclFailureReason.ProvidedMember f.FieldName - | SymbolHelpers.ItemIsProvidedType g (tcref) -> FSharpFindDeclFailureReason.ProvidedType tcref.DisplayName -#endif - | _ -> FSharpFindDeclFailureReason.Unknown "" - |> FSharpFindDeclResult.DeclNotFound - ) - (fun msg -> - Trace.TraceInformation(sprintf "FCS: recovering from error in GetDeclarationLocation: '%s'" msg) - FSharpFindDeclResult.DeclNotFound (FSharpFindDeclFailureReason.Unknown msg)) - - member __.GetSymbolUseAtLocation (ctok, line, lineStr, colAtEndOfNames, names) = - ErrorScope.Protect Range.range0 - (fun () -> - match GetDeclItemsForNamesAtPosition (ctok, None,Some(names), None, None, line, lineStr, colAtEndOfNames, ResolveTypeNamesToCtors, ResolveOverloads.Yes,(fun() -> []), fun _ -> false) with - | None | Some ([], _, _, _) -> None - | Some (item :: _, denv, _, m) -> - let symbol = FSharpSymbol.Create(cenv, item.Item) - Some (symbol, denv, m) - ) - (fun msg -> - Trace.TraceInformation(sprintf "FCS: recovering from error in GetSymbolUseAtLocation: '%s'" msg) - None) - - member __.PartialAssemblySignatureForFile = - FSharpAssemblySignature(g, thisCcu, ccuSigForFile, tcImports, None, ccuSigForFile) - - member __.AccessRights = tcAccessRights - - member __.GetReferencedAssemblies() = - [ for x in tcImports.GetImportedAssemblies() do - yield FSharpAssembly(g, tcImports, x.FSharpViewOfMetadata) ] - - member __.GetFormatSpecifierLocationsAndArity() = - sSymbolUses.GetFormatSpecifierLocationsAndArity() - - member __.GetSemanticClassification(range: range option) : (range * SemanticClassificationType) [] = - ErrorScope.Protect Range.range0 - (fun () -> - let (|LegitTypeOccurence|_|) = function - | ItemOccurence.UseInType - | ItemOccurence.UseInAttribute - | ItemOccurence.Use _ - | ItemOccurence.Binding _ - | ItemOccurence.Pattern _ -> Some() - | _ -> None - - let (|OptionalArgumentAttribute|_|) ttype = - match ttype with - | TType.TType_app(tref, _) when tref.Stamp = g.attrib_OptionalArgumentAttribute.TyconRef.Stamp -> Some() - | _ -> None - - let (|KeywordIntrinsicValue|_|) (vref: ValRef) = - if valRefEq g g.raise_vref vref || - valRefEq g g.reraise_vref vref || - valRefEq g g.typeof_vref vref || - valRefEq g g.typedefof_vref vref || - valRefEq g g.sizeof_vref vref - // TODO uncomment this after `nameof` operator is implemented - // || valRefEq g g.nameof_vref vref - then Some() - else None - - let (|EnumCaseFieldInfo|_|) (rfinfo : RecdFieldInfo) = - match rfinfo.TyconRef.TypeReprInfo with - | TFSharpObjectRepr x -> - match x.fsobjmodel_kind with - | TTyconEnum -> Some () - | _ -> None - | _ -> None - - let resolutions = - match range with - | Some range -> - sResolutions.CapturedNameResolutions - |> Seq.filter (fun cnr -> rangeContainsPos range cnr.Range.Start || rangeContainsPos range cnr.Range.End) - | None -> - sResolutions.CapturedNameResolutions :> seq<_> - - let isDisposableTy (ty: TType) = - protectAssemblyExplorationNoReraise false false (fun () -> Infos.ExistsHeadTypeInEntireHierarchy g amap range0 ty g.tcref_System_IDisposable) - - let isStructTyconRef (tyconRef: TyconRef) = - let ty = generalizedTyconRef tyconRef - let underlyingTy = stripTyEqnsAndMeasureEqns g ty - isStructTy g underlyingTy - - let isValRefMutable (vref: ValRef) = - // Mutable values, ref cells, and non-inref byrefs are mutable. - vref.IsMutable - || Tastops.isRefCellTy g vref.Type - || (Tastops.isByrefTy g vref.Type && not (Tastops.isInByrefTy g vref.Type)) - - let isRecdFieldMutable (rfinfo: RecdFieldInfo) = - (rfinfo.RecdField.IsMutable && rfinfo.LiteralValue.IsNone) - || Tastops.isRefCellTy g rfinfo.RecdField.FormalType - - resolutions - |> Seq.choose (fun cnr -> - match cnr with - // 'seq' in 'seq { ... }' gets colored as keywords - | CNR(_, (Item.Value vref), ItemOccurence.Use, _, _, _, m) when valRefEq g g.seq_vref vref -> - Some (m, SemanticClassificationType.ComputationExpression) - | CNR(_, (Item.Value vref), _, _, _, _, m) when isValRefMutable vref -> - Some (m, SemanticClassificationType.MutableVar) - | CNR(_, Item.Value KeywordIntrinsicValue, ItemOccurence.Use, _, _, _, m) -> - Some (m, SemanticClassificationType.IntrinsicFunction) - | CNR(_, (Item.Value vref), _, _, _, _, m) when isFunction g vref.Type -> - if valRefEq g g.range_op_vref vref || valRefEq g g.range_step_op_vref vref then - None - elif vref.IsPropertyGetterMethod || vref.IsPropertySetterMethod then - Some (m, SemanticClassificationType.Property) - elif IsOperatorName vref.DisplayName then - Some (m, SemanticClassificationType.Operator) - else - Some (m, SemanticClassificationType.Function) - | CNR(_, Item.RecdField rfinfo, _, _, _, _, m) when isRecdFieldMutable rfinfo -> - Some (m, SemanticClassificationType.MutableVar) - | CNR(_, Item.RecdField rfinfo, _, _, _, _, m) when isFunction g rfinfo.FieldType -> - Some (m, SemanticClassificationType.Function) - | CNR(_, Item.RecdField EnumCaseFieldInfo, _, _, _, _, m) -> - Some (m, SemanticClassificationType.Enumeration) - | CNR(_, Item.MethodGroup _, _, _, _, _, m) -> - Some (m, SemanticClassificationType.Function) - // custom builders, custom operations get colored as keywords - | CNR(_, (Item.CustomBuilder _ | Item.CustomOperation _), ItemOccurence.Use, _, _, _, m) -> - Some (m, SemanticClassificationType.ComputationExpression) - // types get colored as types when they occur in syntactic types or custom attributes - // typevariables get colored as types when they occur in syntactic types custom builders, custom operations get colored as keywords - | CNR(_, Item.Types (_, [OptionalArgumentAttribute]), LegitTypeOccurence, _, _, _, _) -> None - | CNR(_, Item.CtorGroup(_, [MethInfo.FSMeth(_, OptionalArgumentAttribute, _, _)]), LegitTypeOccurence, _, _, _, _) -> None - | CNR(_, Item.Types(_, types), LegitTypeOccurence, _, _, _, m) when types |> List.exists (isInterfaceTy g) -> - Some (m, SemanticClassificationType.Interface) - | CNR(_, Item.Types(_, types), LegitTypeOccurence, _, _, _, m) when types |> List.exists (isStructTy g) -> - Some (m, SemanticClassificationType.ValueType) - | CNR(_, Item.Types(_, TType_app(tyconRef, TType_measure _ :: _) :: _), LegitTypeOccurence, _, _, _, m) when isStructTyconRef tyconRef -> - Some (m, SemanticClassificationType.ValueType) - | CNR(_, Item.Types(_, types), LegitTypeOccurence, _, _, _, m) when types |> List.exists isDisposableTy -> - Some (m, SemanticClassificationType.Disposable) - | CNR(_, Item.Types _, LegitTypeOccurence, _, _, _, m) -> - Some (m, SemanticClassificationType.ReferenceType) - | CNR(_, (Item.TypeVar _ ), LegitTypeOccurence, _, _, _, m) -> - Some (m, SemanticClassificationType.TypeArgument) - | CNR(_, Item.UnqualifiedType tyconRefs, LegitTypeOccurence, _, _, _, m) -> - if tyconRefs |> List.exists (fun tyconRef -> tyconRef.Deref.IsStructOrEnumTycon) then - Some (m, SemanticClassificationType.ValueType) - else Some (m, SemanticClassificationType.ReferenceType) - | CNR(_, Item.CtorGroup(_, minfos), LegitTypeOccurence, _, _, _, m) -> - if minfos |> List.exists (fun minfo -> isStructTy g minfo.ApparentEnclosingType) then - Some (m, SemanticClassificationType.ValueType) - else Some (m, SemanticClassificationType.ReferenceType) - | CNR(_, Item.ExnCase _, LegitTypeOccurence, _, _, _, m) -> - Some (m, SemanticClassificationType.ReferenceType) - | CNR(_, Item.ModuleOrNamespaces refs, LegitTypeOccurence, _, _, _, m) when refs |> List.exists (fun x -> x.IsModule) -> - Some (m, SemanticClassificationType.Module) - | CNR(_, (Item.ActivePatternCase _ | Item.UnionCase _ | Item.ActivePatternResult _), _, _, _, _, m) -> - Some (m, SemanticClassificationType.UnionCase) - | _ -> None) - |> Seq.toArray - |> Array.append (sSymbolUses.GetFormatSpecifierLocationsAndArity() |> Array.map (fun m -> fst m, SemanticClassificationType.Printf)) - ) - (fun msg -> - Trace.TraceInformation(sprintf "FCS: recovering from error in GetSemanticClassification: '%s'" msg) - Array.empty) - - /// The resolutions in the file - member __.ScopeResolutions = sResolutions - - /// The uses of symbols in the analyzed file - member __.ScopeSymbolUses = sSymbolUses - - member __.TcGlobals = g - - member __.TcImports = tcImports - - /// The inferred signature of the file - member __.CcuSigForFile = ccuSigForFile - - /// The assembly being analyzed - member __.ThisCcu = thisCcu - - member __.ImplementationFile = implFileOpt - - /// All open declarations in the file, including auto open modules - member __.OpenDeclarations = openDeclarations - - member __.SymbolEnv = cenv - - override __.ToString() = "TypeCheckInfo(" + mainInputFileName + ")" - -type FSharpParsingOptions = - { SourceFiles: string [] - ConditionalCompilationDefines: string list - ErrorSeverityOptions: FSharpErrorSeverityOptions - IsInteractive: bool - LightSyntax: bool option - CompilingFsLib: bool - IsExe: bool } - - member x.LastFileName = - Debug.Assert(not (Array.isEmpty x.SourceFiles), "Parsing options don't contain any file") - Array.last x.SourceFiles - - static member Default = - { SourceFiles = Array.empty - ConditionalCompilationDefines = [] - ErrorSeverityOptions = FSharpErrorSeverityOptions.Default - IsInteractive = false - LightSyntax = None - CompilingFsLib = false - IsExe = false } - - static member FromTcConfig(tcConfig: TcConfig, sourceFiles, isInteractive: bool) = - { SourceFiles = sourceFiles - ConditionalCompilationDefines = tcConfig.conditionalCompilationDefines - ErrorSeverityOptions = tcConfig.errorSeverityOptions - IsInteractive = isInteractive - LightSyntax = tcConfig.light - CompilingFsLib = tcConfig.compilingFslib - IsExe = tcConfig.target.IsExe } - - static member FromTcConfigBuidler(tcConfigB: TcConfigBuilder, sourceFiles, isInteractive: bool) = - { - SourceFiles = sourceFiles - ConditionalCompilationDefines = tcConfigB.conditionalCompilationDefines - ErrorSeverityOptions = tcConfigB.errorSeverityOptions - IsInteractive = isInteractive - LightSyntax = tcConfigB.light - CompilingFsLib = tcConfigB.compilingFslib - IsExe = tcConfigB.target.IsExe - } - -module internal Parser = - - /// Error handler for parsing & type checking while processing a single file - type ErrorHandler(reportErrors, mainInputFileName, errorSeverityOptions: FSharpErrorSeverityOptions, sourceText: ISourceText, suggestNamesForErrors: bool) = - let mutable options = errorSeverityOptions - let errorsAndWarningsCollector = new ResizeArray<_>() - let mutable errorCount = 0 - - // We'll need number of lines for adjusting error messages at EOF - let fileInfo = sourceText.GetLastCharacterPosition() - - // This function gets called whenever an error happens during parsing or checking - let diagnosticSink sev (exn: PhasedDiagnostic) = - // Sanity check here. The phase of an error should be in a phase known to the language service. - let exn = - if not(exn.IsPhaseInCompile()) then - // Reaching this point means that the error would be sticky if we let it prop up to the language service. - // Assert and recover by replacing phase with one known to the language service. - Trace.TraceInformation(sprintf "The subcategory '%s' seen in an error should not be seen by the language service" (exn.Subcategory())) - { exn with Phase = BuildPhase.TypeCheck } - else exn - if reportErrors then - let report exn = - for ei in ErrorHelpers.ReportError (options, false, mainInputFileName, fileInfo, (exn, sev), suggestNamesForErrors) do - errorsAndWarningsCollector.Add ei - if sev = FSharpErrorSeverity.Error then - errorCount <- errorCount + 1 - - match exn with -#if !NO_EXTENSIONTYPING - | { Exception = (:? TypeProviderError as tpe) } -> tpe.Iter(fun e -> report { exn with Exception = e }) -#endif - | e -> report e - - let errorLogger = - { new ErrorLogger("ErrorHandler") with - member x.DiagnosticSink (exn, isError) = diagnosticSink (if isError then FSharpErrorSeverity.Error else FSharpErrorSeverity.Warning) exn - member x.ErrorCount = errorCount } - - // Public members - member x.ErrorLogger = errorLogger - member x.CollectedDiagnostics = errorsAndWarningsCollector.ToArray() - member x.ErrorCount = errorCount - member x.ErrorSeverityOptions with set opts = options <- opts - member x.AnyErrors = errorCount > 0 - - let getLightSyntaxStatus fileName options = - let lower = String.lowercase fileName - let lightOnByDefault = List.exists (Filename.checkSuffix lower) FSharpLightSyntaxFileSuffixes - let lightSyntaxStatus = if lightOnByDefault then (options.LightSyntax <> Some false) else (options.LightSyntax = Some true) - LightSyntaxStatus(lightSyntaxStatus, true) - - let createLexerFunction fileName options lexbuf (errHandler: ErrorHandler) = - let lightSyntaxStatus = getLightSyntaxStatus fileName options - - // If we're editing a script then we define INTERACTIVE otherwise COMPILED. - // Since this parsing for intellisense we always define EDITING. - let defines = (SourceFileImpl.AdditionalDefinesForUseInEditor options.IsInteractive) @ options.ConditionalCompilationDefines - - // Note: we don't really attempt to intern strings across a large scope. - let lexResourceManager = new Lexhelp.LexResourceManager() - - // When analyzing files using ParseOneFile, i.e. for the use of editing clients, we do not apply line directives. - // TODO(pathmap): expose PathMap on the service API, and thread it through here - let lexargs = mkLexargs(fileName, defines, lightSyntaxStatus, lexResourceManager, ref [], errHandler.ErrorLogger, PathMap.empty) - let lexargs = { lexargs with applyLineDirectives = false } - - let tokenizer = LexFilter.LexFilter(lightSyntaxStatus, options.CompilingFsLib, Lexer.token lexargs true, lexbuf) - tokenizer.Lexer - - let createLexbuf sourceText = - UnicodeLexing.SourceTextAsLexbuf(sourceText) - - let matchBraces(sourceText, fileName, options: FSharpParsingOptions, userOpName: string, suggestNamesForErrors: bool) = - let delayedLogger = CapturingErrorLogger("matchBraces") - use _unwindEL = PushErrorLoggerPhaseUntilUnwind (fun _ -> delayedLogger) - use _unwindBP = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse - - Trace.TraceInformation("FCS: {0}.{1} ({2})", userOpName, "matchBraces", fileName) - - // Make sure there is an ErrorLogger installed whenever we do stuff that might record errors, even if we ultimately ignore the errors - let delayedLogger = CapturingErrorLogger("matchBraces") - use _unwindEL = PushErrorLoggerPhaseUntilUnwind (fun _ -> delayedLogger) - use _unwindBP = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse - - let matchingBraces = new ResizeArray<_>() - Lexhelp.usingLexbufForParsing(createLexbuf sourceText, fileName) (fun lexbuf -> - let errHandler = ErrorHandler(false, fileName, options.ErrorSeverityOptions, sourceText, suggestNamesForErrors) - let lexfun = createLexerFunction fileName options lexbuf errHandler - let parenTokensBalance t1 t2 = - match t1, t2 with - | (LPAREN, RPAREN) - | (LPAREN, RPAREN_IS_HERE) - | (LBRACE, RBRACE) - | (LBRACE, RBRACE_IS_HERE) - | (SIG, END) - | (STRUCT, END) - | (LBRACK_BAR, BAR_RBRACK) - | (LBRACK, RBRACK) - | (LBRACK_LESS, GREATER_RBRACK) - | (BEGIN, END) -> true - | (LQUOTE q1, RQUOTE q2) -> q1 = q2 - | _ -> false - let rec matchBraces stack = - match lexfun lexbuf, stack with - | tok2, ((tok1, m1) :: stack') when parenTokensBalance tok1 tok2 -> - matchingBraces.Add(m1, lexbuf.LexemeRange) - matchBraces stack' - | ((LPAREN | LBRACE | LBRACK | LBRACK_BAR | LQUOTE _ | LBRACK_LESS) as tok), _ -> - matchBraces ((tok, lexbuf.LexemeRange) :: stack) - | (EOF _ | LEX_FAILURE _), _ -> () - | _ -> matchBraces stack - matchBraces []) - matchingBraces.ToArray() - - let parseFile(sourceText: ISourceText, fileName, options: FSharpParsingOptions, userOpName: string, suggestNamesForErrors: bool) = - Trace.TraceInformation("FCS: {0}.{1} ({2})", userOpName, "parseFile", fileName) - let errHandler = new ErrorHandler(true, fileName, options.ErrorSeverityOptions, sourceText, suggestNamesForErrors) - use unwindEL = PushErrorLoggerPhaseUntilUnwind (fun _oldLogger -> errHandler.ErrorLogger) - use unwindBP = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse - - let parseResult = - Lexhelp.usingLexbufForParsing(createLexbuf sourceText, fileName) (fun lexbuf -> - let lexfun = createLexerFunction fileName options lexbuf errHandler - let isLastCompiland = - fileName.Equals(options.LastFileName, StringComparison.CurrentCultureIgnoreCase) || - CompileOps.IsScript(fileName) - let isExe = options.IsExe - try Some (ParseInput(lexfun, errHandler.ErrorLogger, lexbuf, None, fileName, (isLastCompiland, isExe))) - with e -> - errHandler.ErrorLogger.StopProcessingRecovery e Range.range0 // don't re-raise any exceptions, we must return None. - None) - errHandler.CollectedDiagnostics, parseResult, errHandler.AnyErrors - - /// Indicates if the type check got aborted because it is no longer relevant. - type TypeCheckAborted = Yes | No of TypeCheckInfo - - // Type check a single file against an initial context, gleaning both errors and intellisense information. - let CheckOneFile - (parseResults: FSharpParseFileResults, - sourceText: ISourceText, - mainInputFileName: string, - projectFileName: string, - tcConfig: TcConfig, - tcGlobals: TcGlobals, - tcImports: TcImports, - tcState: TcState, - moduleNamesDict: ModuleNamesDict, - loadClosure: LoadClosure option, - // These are the errors and warnings seen by the background compiler for the entire antecedent - backgroundDiagnostics: (PhasedDiagnostic * FSharpErrorSeverity)[], - reactorOps: IReactorOperations, - textSnapshotInfo : obj option, - userOpName: string, - suggestNamesForErrors: bool) = - - async { - use _logBlock = Logger.LogBlock LogCompilerFunctionId.Service_CheckOneFile - - match parseResults.ParseTree with - // When processing the following cases, we don't need to type-check - | None -> return [||], TypeCheckAborted.Yes - - // Run the type checker... - | Some parsedMainInput -> - // Initialize the error handler - let errHandler = new ErrorHandler(true, mainInputFileName, tcConfig.errorSeverityOptions, sourceText, suggestNamesForErrors) - - use _unwindEL = PushErrorLoggerPhaseUntilUnwind (fun _oldLogger -> errHandler.ErrorLogger) - use _unwindBP = PushThreadBuildPhaseUntilUnwind BuildPhase.TypeCheck - - // Apply nowarns to tcConfig (may generate errors, so ensure errorLogger is installed) - let tcConfig = ApplyNoWarnsToTcConfig (tcConfig, parsedMainInput,Path.GetDirectoryName mainInputFileName) - - // update the error handler with the modified tcConfig - errHandler.ErrorSeverityOptions <- tcConfig.errorSeverityOptions - - // Play background errors and warnings for this file. - for (err,sev) in backgroundDiagnostics do - diagnosticSink (err, (sev = FSharpErrorSeverity.Error)) - - // If additional references were brought in by the preprocessor then we need to process them - match loadClosure with - | Some loadClosure -> - // Play unresolved references for this file. - tcImports.ReportUnresolvedAssemblyReferences(loadClosure.UnresolvedReferences) - - // If there was a loadClosure, replay the errors and warnings from resolution, excluding parsing - loadClosure.LoadClosureRootFileDiagnostics |> List.iter diagnosticSink - - let fileOfBackgroundError err = (match GetRangeOfDiagnostic (fst err) with Some m-> m.FileName | None -> null) - let sameFile file hashLoadInFile = - (0 = String.Compare(hashLoadInFile, file, StringComparison.OrdinalIgnoreCase)) - - // walk the list of #loads and keep the ones for this file. - let hashLoadsInFile = - loadClosure.SourceFiles - |> List.filter(fun (_,ms) -> ms<>[]) // #loaded file, ranges of #load - - let hashLoadBackgroundDiagnostics, otherBackgroundDiagnostics = - backgroundDiagnostics - |> Array.partition (fun backgroundError -> - hashLoadsInFile - |> List.exists (fst >> sameFile (fileOfBackgroundError backgroundError))) - - // Create single errors for the #load-ed files. - // Group errors and warnings by file name. - let hashLoadBackgroundDiagnosticsGroupedByFileName = - hashLoadBackgroundDiagnostics - |> 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 (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 = 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 ] - - let message = HashLoadedSourceHasIssues(warnings,errors,rangeOfHashLoad) - if errors=[] then warning(message) - else errorR(message) - - // Replay other background errors. - for (phasedError,sev) in otherBackgroundDiagnostics do - if sev = FSharpErrorSeverity.Warning then - warning phasedError.Exception - else errorR phasedError.Exception - - | None -> - // For non-scripts, check for disallow #r and #load. - ApplyMetaCommandsFromInputToTcConfig (tcConfig, parsedMainInput,Path.GetDirectoryName mainInputFileName) |> ignore - - // A problem arises with nice name generation, which really should only - // be done in the backend, but is also done in the typechecker for better or worse. - // If we don't do this the NNG accumulates data and we get a memory leak. - tcState.NiceNameGenerator.Reset() - - // Typecheck the real input. - let sink = TcResultsSinkImpl(tcGlobals, sourceText = sourceText) - - let! ct = Async.CancellationToken - - let! resOpt = - async { - try - let checkForErrors() = (parseResults.ParseHadErrors || errHandler.ErrorCount > 0) - - let parsedMainInput, _moduleNamesDict = DeduplicateParsedInputModuleName moduleNamesDict parsedMainInput - - // Typecheck is potentially a long running operation. We chop it up here with an Eventually continuation and, at each slice, give a chance - // for the client to claim the result as obsolete and have the typecheck abort. - - let! result = - TypeCheckOneInputAndFinishEventually(checkForErrors, tcConfig, tcImports, tcGlobals, None, TcResultsSink.WithSink sink, tcState, parsedMainInput) - |> Eventually.repeatedlyProgressUntilDoneOrTimeShareOverOrCanceled maxTimeShareMilliseconds ct (fun ctok f -> f ctok) - |> Eventually.forceAsync - (fun work -> - reactorOps.EnqueueAndAwaitOpAsync(userOpName, "CheckOneFile.Fragment", mainInputFileName, - fun ctok -> - // This work is not cancellable - let res = - // Reinstall the compilation globals each time we start or restart - use unwind = new CompilationGlobalsScope (errHandler.ErrorLogger, BuildPhase.TypeCheck) - work ctok - cancellable.Return(res) - )) - - return result |> Option.map (fun ((tcEnvAtEnd, _, implFiles, ccuSigsForFiles), tcState) -> tcEnvAtEnd, implFiles, ccuSigsForFiles, tcState) - with e -> - errorR e - return Some(tcState.TcEnvFromSignatures, [], [NewEmptyModuleOrNamespaceType Namespace], tcState) - } - - let errors = errHandler.CollectedDiagnostics - - match resOpt with - | Some (tcEnvAtEnd, implFiles, ccuSigsForFiles, tcState) -> - let scope = - TypeCheckInfo(tcConfig, tcGlobals, - List.head ccuSigsForFiles, - tcState.Ccu, - tcImports, - tcEnvAtEnd.AccessRights, - projectFileName, - mainInputFileName, - sink.GetResolutions(), - sink.GetSymbolUses(), - tcEnvAtEnd.NameEnv, - loadClosure, - reactorOps, - textSnapshotInfo, - List.tryHead implFiles, - sink.GetOpenDeclarations()) - return errors, TypeCheckAborted.No scope - | None -> - return errors, TypeCheckAborted.Yes - } - type UnresolvedReferencesSet = UnresolvedReferencesSet of UnresolvedAssemblyReference list // NOTE: may be better just to move to optional arguments here @@ -1814,328 +88,10 @@ type FSharpProjectOptions = member po.ProjectDirectory = System.IO.Path.GetDirectoryName(po.ProjectFileName) override this.ToString() = "FSharpProjectOptions(" + this.ProjectFileName + ")" - -[] -type FSharpProjectContext(thisCcu: CcuThunk, assemblies: FSharpAssembly list, ad: AccessorDomain) = - - /// Get the assemblies referenced - member __.GetReferencedAssemblies() = assemblies - - member __.AccessibilityRights = FSharpAccessibilityRights(thisCcu, ad) - - -[] -// 'details' is an option because the creation of the tcGlobals etc. for the project may have failed. -type FSharpCheckProjectResults(projectFileName:string, tcConfigOption, keepAssemblyContents, errors: FSharpErrorInfo[], - details:(TcGlobals * TcImports * CcuThunk * ModuleOrNamespaceType * TcSymbolUses list * TopAttribs option * CompileOps.IRawFSharpAssemblyData option * ILAssemblyRef * AccessorDomain * TypedImplFile list option * string[]) option) = - - let getDetails() = - match details with - | None -> invalidOp ("The project has no results due to critical errors in the project options. Check the HasCriticalErrors before accessing the detailed results. Errors: " + String.concat "\n" [ for e in errors -> e.Message ]) - | Some d -> d - - let getTcConfig() = - match tcConfigOption with - | None -> invalidOp ("The project has no results due to critical errors in the project options. Check the HasCriticalErrors before accessing the detailed results. Errors: " + String.concat "\n" [ for e in errors -> e.Message ]) - | Some d -> d - - member info.Errors = errors - - member info.HasCriticalErrors = details.IsNone - - member info.AssemblySignature = - let (tcGlobals, tcImports, thisCcu, ccuSig, _tcSymbolUses, topAttribs, _tcAssemblyData, _ilAssemRef, _ad, _tcAssemblyExpr, _dependencyFiles) = getDetails() - FSharpAssemblySignature(tcGlobals, thisCcu, ccuSig, tcImports, topAttribs, ccuSig) - - member info.TypedImplementionFiles = - 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" - let (tcGlobals, tcImports, thisCcu, _ccuSig, _tcSymbolUses, _topAttribs, _tcAssemblyData, _ilAssemRef, _ad, tcAssemblyExpr, _dependencyFiles) = getDetails() - let mimpls = - match tcAssemblyExpr with - | None -> [] - | Some mimpls -> mimpls - tcGlobals, thisCcu, tcImports, mimpls - - member info.AssemblyContents = - 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" - let (tcGlobals, tcImports, thisCcu, ccuSig, _tcSymbolUses, _topAttribs, _tcAssemblyData, _ilAssemRef, _ad, tcAssemblyExpr, _dependencyFiles) = getDetails() - let mimpls = - match tcAssemblyExpr with - | None -> [] - | Some mimpls -> mimpls - FSharpAssemblyContents(tcGlobals, thisCcu, Some ccuSig, tcImports, mimpls) - - member info.GetOptimizedAssemblyContents() = - 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" - let (tcGlobals, tcImports, thisCcu, ccuSig, _tcSymbolUses, _topAttribs, _tcAssemblyData, _ilAssemRef, _ad, tcAssemblyExpr, _dependencyFiles) = getDetails() - let mimpls = - match tcAssemblyExpr with - | None -> [] - | Some mimpls -> mimpls - let outfile = "" // only used if tcConfig.writeTermsToFiles is true - let importMap = tcImports.GetImportMap() - let optEnv0 = GetInitialOptimizationEnv (tcImports, tcGlobals) - let tcConfig = getTcConfig() - let optimizedImpls, _optimizationData, _ = ApplyAllOptimizations (tcConfig, tcGlobals, (LightweightTcValForUsingInBuildMethodCall tcGlobals), outfile, importMap, false, optEnv0, thisCcu, mimpls) - let mimpls = - match optimizedImpls with - | TypedAssemblyAfterOptimization files -> - files |> List.map fst - - FSharpAssemblyContents(tcGlobals, thisCcu, Some ccuSig, tcImports, mimpls) - - // Not, this does not have to be a SyncOp, it can be called from any thread - member info.GetUsesOfSymbol(symbol:FSharpSymbol) = - let (tcGlobals, _tcImports, _thisCcu, _ccuSig, tcSymbolUses, _topAttribs, _tcAssemblyData, _ilAssemRef, _ad, _tcAssemblyExpr, _dependencyFiles) = getDetails() - - 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 - - // Not, this does not have to be a SyncOp, it can be called from any thread - member __.GetAllUsesOfAllSymbols() = - let (tcGlobals, tcImports, thisCcu, ccuSig, tcSymbolUses, _topAttribs, _tcAssemblyData, _ilAssemRef, _ad, _tcAssemblyExpr, _dependencyFiles) = getDetails() - let cenv = SymbolEnv(tcGlobals, thisCcu, Some ccuSig, tcImports) - - [| for r in tcSymbolUses do - for symbolUseChunk in r.AllUsesOfSymbols do - for symbolUse in symbolUseChunk do - if symbolUse.ItemOccurence <> ItemOccurence.RelatedText then - let symbol = FSharpSymbol.Create(cenv, symbolUse.Item) - yield FSharpSymbolUse(tcGlobals, symbolUse.DisplayEnv, symbol, symbolUse.ItemOccurence, symbolUse.Range) |] - |> async.Return - - member __.ProjectContext = - let (tcGlobals, tcImports, thisCcu, _ccuSig, _tcSymbolUses, _topAttribs, _tcAssemblyData, _ilAssemRef, ad, _tcAssemblyExpr, _dependencyFiles) = getDetails() - let assemblies = - [ for x in tcImports.GetImportedAssemblies() do - yield FSharpAssembly(tcGlobals, tcImports, x.FSharpViewOfMetadata) ] - FSharpProjectContext(thisCcu, assemblies, ad) - - member __.RawFSharpAssemblyData = - let (_tcGlobals, _tcImports, _thisCcu, _ccuSig, _tcSymbolUses, _topAttribs, tcAssemblyData, _ilAssemRef, _ad, _tcAssemblyExpr, _dependencyFiles) = getDetails() - tcAssemblyData - - member __.DependencyFiles = - let (_tcGlobals, _tcImports, _thisCcu, _ccuSig, _tcSymbolUses, _topAttribs, _tcAssemblyData, _ilAssemRef, _ad, _tcAssemblyExpr, dependencyFiles) = getDetails() - dependencyFiles - - member __.AssemblyFullName = - let (_tcGlobals, _tcImports, _thisCcu, _ccuSig, _tcSymbolUses, _topAttribs, _tcAssemblyData, ilAssemRef, _ad, _tcAssemblyExpr, _dependencyFiles) = getDetails() - ilAssemRef.QualifiedName - - override info.ToString() = "FSharpCheckProjectResults(" + projectFileName + ")" - -[] -type FSharpCheckFileResults(filename: string, errors: FSharpErrorInfo[], scopeOptX: TypeCheckInfo option, dependencyFiles: string[], builderX: IncrementalBuilder option, reactorOpsX:IReactorOperations, keepAssemblyContents: bool) = - - // This may be None initially. - let mutable details = match scopeOptX with None -> None | Some scopeX -> Some (scopeX, builderX, reactorOpsX) - - // Run an operation that needs to access a builder and be run in the reactor thread - let reactorOp userOpName opName dflt f = - async { - match details with - | None -> - return dflt - | Some (scope, _, reactor) -> - let! res = reactor.EnqueueAndAwaitOpAsync(userOpName, opName, filename, fun ctok -> f ctok scope |> cancellable.Return) - return res - } - - // Run an operation that can be called from any thread - let threadSafeOp dflt f = - match details with - | None -> dflt() - | Some (scope, _builderOpt, _ops) -> f scope - - member info.Errors = errors - - member info.HasFullTypeCheckInfo = details.IsSome - - member info.TryGetCurrentTcImports () = - match builderX with - | Some builder -> builder.TryGetCurrentTcImports () - | _ -> None - - /// Intellisense autocompletions - member info.GetDeclarationListInfo(parseResultsOpt, line, lineStr, partialName, ?getAllEntities, ?hasTextChangedSinceLastTypecheck, ?userOpName: string) = - let userOpName = defaultArg userOpName "Unknown" - let getAllEntities = defaultArg getAllEntities (fun() -> []) - let hasTextChangedSinceLastTypecheck = defaultArg hasTextChangedSinceLastTypecheck (fun _ -> false) - reactorOp userOpName "GetDeclarations" FSharpDeclarationListInfo.Empty (fun ctok scope -> - scope.GetDeclarations(ctok, parseResultsOpt, line, lineStr, partialName, getAllEntities, hasTextChangedSinceLastTypecheck)) - - member info.GetDeclarationListSymbols(parseResultsOpt, line, lineStr, partialName, ?getAllEntities, ?hasTextChangedSinceLastTypecheck, ?userOpName: string) = - let userOpName = defaultArg userOpName "Unknown" - let hasTextChangedSinceLastTypecheck = defaultArg hasTextChangedSinceLastTypecheck (fun _ -> false) - let getAllEntities = defaultArg getAllEntities (fun() -> []) - reactorOp userOpName "GetDeclarationListSymbols" List.empty (fun ctok scope -> scope.GetDeclarationListSymbols(ctok, parseResultsOpt, line, lineStr, partialName, getAllEntities, hasTextChangedSinceLastTypecheck)) - - /// Resolve the names at the given location to give a data tip - member info.GetStructuredToolTipText(line, colAtEndOfNames, lineStr, names, tokenTag, ?userOpName: string) = - let userOpName = defaultArg userOpName "Unknown" - let dflt = FSharpToolTipText [] - match tokenTagToTokenId tokenTag with - | TOKEN_IDENT -> - reactorOp userOpName "GetStructuredToolTipText" dflt (fun ctok scope -> scope.GetStructuredToolTipText(ctok, line, lineStr, colAtEndOfNames, names)) - | TOKEN_STRING | TOKEN_STRING_TEXT -> - reactorOp userOpName "GetReferenceResolutionToolTipText" dflt (fun ctok scope -> scope.GetReferenceResolutionStructuredToolTipText(ctok, line, colAtEndOfNames) ) - | _ -> - 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 - - member info.GetF1Keyword (line, colAtEndOfNames, lineStr, names, ?userOpName: string) = - let userOpName = defaultArg userOpName "Unknown" - reactorOp userOpName "GetF1Keyword" None (fun ctok scope -> - scope.GetF1Keyword (ctok, line, lineStr, colAtEndOfNames, names)) - - // Resolve the names at the given location to a set of methods - member info.GetMethods(line, colAtEndOfNames, lineStr, names, ?userOpName: string) = - let userOpName = defaultArg userOpName "Unknown" - let dflt = FSharpMethodGroup("",[| |]) - reactorOp userOpName "GetMethods" dflt (fun ctok scope -> - scope.GetMethods (ctok, line, lineStr, colAtEndOfNames, names)) - - member info.GetDeclarationLocation (line, colAtEndOfNames, lineStr, names, ?preferFlag, ?userOpName: string) = - let userOpName = defaultArg userOpName "Unknown" - let dflt = FSharpFindDeclResult.DeclNotFound (FSharpFindDeclFailureReason.Unknown "") - reactorOp userOpName "GetDeclarationLocation" dflt (fun ctok scope -> - scope.GetDeclarationLocation (ctok, line, lineStr, colAtEndOfNames, names, preferFlag)) - - member info.GetSymbolUseAtLocation (line, colAtEndOfNames, lineStr, names, ?userOpName: string) = - let userOpName = defaultArg userOpName "Unknown" - reactorOp userOpName "GetSymbolUseAtLocation" None (fun ctok scope -> - scope.GetSymbolUseAtLocation (ctok, line, lineStr, colAtEndOfNames, names) - |> Option.map (fun (sym,denv,m) -> FSharpSymbolUse(scope.TcGlobals,denv,sym,ItemOccurence.Use,m))) - - member info.GetMethodsAsSymbols (line, colAtEndOfNames, lineStr, names, ?userOpName: string) = - let userOpName = defaultArg userOpName "Unknown" - reactorOp userOpName "GetMethodsAsSymbols" None (fun ctok scope -> - scope.GetMethodsAsSymbols (ctok, line, lineStr, colAtEndOfNames, names) - |> Option.map (fun (symbols,denv,m) -> - symbols |> List.map (fun sym -> FSharpSymbolUse(scope.TcGlobals,denv,sym,ItemOccurence.Use,m)))) - - member info.GetSymbolAtLocation (line, colAtEndOfNames, lineStr, names, ?userOpName: string) = - let userOpName = defaultArg userOpName "Unknown" - reactorOp userOpName "GetSymbolAtLocation" None (fun ctok scope -> - scope.GetSymbolUseAtLocation (ctok, line, lineStr, colAtEndOfNames, names) - |> Option.map (fun (sym,_,_) -> sym)) - - member info.GetFormatSpecifierLocations() = - info.GetFormatSpecifierLocationsAndArity() |> Array.map fst - - member info.GetFormatSpecifierLocationsAndArity() = - threadSafeOp - (fun () -> [| |]) - (fun scope -> - // This operation is not asynchronous - GetFormatSpecifierLocationsAndArity can be run on the calling thread - scope.GetFormatSpecifierLocationsAndArity()) - - member __.GetSemanticClassification(range: range option) = - threadSafeOp - (fun () -> [| |]) - (fun scope -> - // This operation is not asynchronous - GetSemanticClassification can be run on the calling thread - scope.GetSemanticClassification(range)) - - member __.PartialAssemblySignature = - threadSafeOp - (fun () -> failwith "not available") - (fun scope -> - // This operation is not asynchronous - PartialAssemblySignature can be run on the calling thread - scope.PartialAssemblySignatureForFile) - - member __.ProjectContext = - threadSafeOp - (fun () -> failwith "not available") - (fun scope -> - // This operation is not asynchronous - GetReferencedAssemblies can be run on the calling thread - FSharpProjectContext(scope.ThisCcu, scope.GetReferencedAssemblies(), scope.AccessRights)) - - member __.DependencyFiles = dependencyFiles - - member info.GetAllUsesOfAllSymbolsInFile() = - threadSafeOp - (fun () -> [| |]) - (fun scope -> - let cenv = scope.SymbolEnv - [| for symbolUseChunk in scope.ScopeSymbolUses.AllUsesOfSymbols do - for symbolUse in symbolUseChunk do - if symbolUse.ItemOccurence <> ItemOccurence.RelatedText then - let symbol = FSharpSymbol.Create(cenv, 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 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) = - threadSafeOp - (fun () -> [| |]) - (fun scope -> scope.GetVisibleNamespacesAndModulesAtPosition(pos) |> List.toArray) - |> async.Return - - member info.IsRelativeNameResolvable(pos: pos, plid: string list, item: Item, ?userOpName: string) = - let userOpName = defaultArg userOpName "Unknown" - reactorOp userOpName "IsRelativeNameResolvable" true (fun ctok scope -> - RequireCompilationThread ctok - scope.IsRelativeNameResolvable(pos, plid, item)) - - member info.IsRelativeNameResolvableFromSymbol(pos: pos, plid: string list, symbol: FSharpSymbol, ?userOpName: string) = - let userOpName = defaultArg userOpName "Unknown" - reactorOp userOpName "IsRelativeNameResolvableFromSymbol" true (fun ctok scope -> - RequireCompilationThread ctok - scope.IsRelativeNameResolvableFromSymbol(pos, plid, symbol)) - - member info.GetDisplayContextForPos(pos: pos) : Async = - let userOpName = "CodeLens" - reactorOp userOpName "GetDisplayContextAtPos" None (fun ctok scope -> - DoesNotRequireCompilerThreadTokenAndCouldPossiblyBeMadeConcurrent ctok - let (nenv, _), _ = scope.GetBestDisplayEnvForPos pos - Some(FSharpDisplayContext(fun _ -> nenv.DisplayEnv))) - - 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 = SymbolEnv(scope.TcGlobals, scope.ThisCcu, Some scope.CcuSigForFile, scope.TcImports) - scope.ImplementationFile |> Option.map (fun implFile -> FSharpImplementationFileContents(cenv, implFile))) - |> Option.defaultValue None - - member info.OpenDeclarations = - scopeOptX - |> Option.map (fun scope -> - let cenv = scope.SymbolEnv - scope.OpenDeclarations |> Array.map (fun x -> FSharpOpenDeclaration(x.LongId, x.Range, (x.Modules |> List.map (fun x -> FSharpEntity(cenv, x))), x.AppliedScope, x.IsOwnNamespace))) - |> Option.defaultValue [| |] - - override info.ToString() = "FSharpCheckFileResults(" + filename + ")" - //---------------------------------------------------------------------------- // BackgroundCompiler // -[] -type FSharpCheckFileAnswer = - | Aborted - | Succeeded of FSharpCheckFileResults - - /// Callback that indicates whether a requested result has become obsolete. [] type IsResultObsolete = @@ -2145,9 +101,6 @@ type IsResultObsolete = [] module Helpers = - // Look for DLLs in the location of the service DLL first. - let defaultFSharpBinariesDir = FSharpEnvironment.BinFolderOfDefaultFSharpCompiler(Some(typeof.Assembly.Location)).Value - /// Determine whether two (fileName,options) keys are identical w.r.t. affect on checking let AreSameForChecking2((fileName1: string, options1: FSharpProjectOptions), (fileName2, options2)) = (fileName1 = fileName2) @@ -2350,9 +303,9 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC let loadClosure = scriptClosureCacheLock.AcquireLock (fun ltok -> scriptClosureCache.TryGet (ltok, options)) let! builderOpt, diagnostics = IncrementalBuilder.TryCreateBackgroundBuilderForProjectOptions - (ctok, legacyReferenceResolver, defaultFSharpBinariesDir, frameworkTcImportsCache, loadClosure, Array.toList options.SourceFiles, + (ctok, legacyReferenceResolver, FSharpCheckerResultsSettings.defaultFSharpBinariesDir, frameworkTcImportsCache, loadClosure, Array.toList options.SourceFiles, Array.toList options.OtherOptions, projectReferences, options.ProjectDirectory, - options.UseScriptResolutionRules, keepAssemblyContents, keepAllBackgroundResolutions, maxTimeShareMilliseconds, + options.UseScriptResolutionRules, keepAssemblyContents, keepAllBackgroundResolutions, FSharpCheckerResultsSettings.maxTimeShareMilliseconds, tryGetMetadataSnapshot, suggestNamesForErrors) match builderOpt with @@ -2439,28 +392,10 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC (fun (f1, o1, v1) (f2, o2, v2) -> f1 = f2 && v1 = v2 && FSharpProjectOptions.AreSameForChecking(o1, o2))) static let mutable foregroundParseCount = 0 + static let mutable foregroundTypeCheckCount = 0 - let MakeCheckFileResultsEmpty(filename, creationErrors) = - FSharpCheckFileResults (filename, creationErrors, None, [| |], None, reactorOps, keepAssemblyContents) - - let MakeCheckFileResults(filename, options:FSharpProjectOptions, builder, scope, dependencyFiles, creationErrors, parseErrors, tcErrors) = - let errors = - [| yield! creationErrors - yield! parseErrors - if options.IsIncompleteTypeCheckEnvironment then - yield! Seq.truncate maxTypeCheckErrorsOutOfProjectContext tcErrors - else - yield! tcErrors |] - - FSharpCheckFileResults (filename, errors, Some scope, dependencyFiles, Some builder, reactorOps, keepAssemblyContents) - - let MakeCheckFileAnswer(filename, tcFileResult, options:FSharpProjectOptions, builder, dependencyFiles, creationErrors, parseErrors, tcErrors) = - match tcFileResult with - | Parser.TypeCheckAborted.Yes -> FSharpCheckFileAnswer.Aborted - | Parser.TypeCheckAborted.No scope -> FSharpCheckFileAnswer.Succeeded(MakeCheckFileResults(filename, options, builder, scope, dependencyFiles, creationErrors, parseErrors, tcErrors)) - - member bc.RecordTypeCheckFileInProjectResults(filename,options,parsingOptions,parseResults,fileVersion,priorTimeStamp,checkAnswer,sourceText) = + member __.RecordTypeCheckFileInProjectResults(filename,options,parsingOptions,parseResults,fileVersion,priorTimeStamp,checkAnswer,sourceText) = match checkAnswer with | None | Some FSharpCheckFileAnswer.Aborted -> () @@ -2468,28 +403,28 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC foregroundTypeCheckCount <- foregroundTypeCheckCount + 1 parseCacheLock.AcquireLock (fun ltok -> checkFileInProjectCachePossiblyStale.Set(ltok, (filename,options),(parseResults,typedResults,fileVersion)) - checkFileInProjectCache.Set(ltok, (filename,sourceText,options),(parseResults,typedResults,fileVersion,priorTimeStamp)) + checkFileInProjectCache.Set(ltok, (filename, sourceText, options),(parseResults,typedResults,fileVersion,priorTimeStamp)) parseFileCache.Set(ltok, (filename, sourceText, parsingOptions), parseResults)) member bc.ImplicitlyStartCheckProjectInBackground(options, userOpName) = if implicitlyStartBackgroundWork then bc.CheckProjectInBackground(options, userOpName + ".ImplicitlyStartCheckProjectInBackground") - member bc.ParseFile(filename: string, sourceText: ISourceText, options: FSharpParsingOptions, userOpName: string) = + member __.ParseFile(filename: string, sourceText: ISourceText, options: FSharpParsingOptions, userOpName: string) = async { let hash = sourceText.GetHashCode() match parseCacheLock.AcquireLock(fun ltok -> parseFileCache.TryGet(ltok, (filename, hash, options))) with | Some res -> return res | None -> foregroundParseCount <- foregroundParseCount + 1 - let parseErrors, parseTreeOpt, anyErrors = Parser.parseFile(sourceText, filename, options, userOpName, suggestNamesForErrors) + let parseErrors, parseTreeOpt, anyErrors = ParseAndCheckFile.parseFile(sourceText, filename, options, userOpName, suggestNamesForErrors) let res = FSharpParseFileResults(parseErrors, parseTreeOpt, anyErrors, options.SourceFiles) parseCacheLock.AcquireLock(fun ltok -> parseFileCache.Set(ltok, (filename, hash, options), res)) return res } /// Fetch the parse information from the background compiler (which checks w.r.t. the FileSystem API) - member bc.GetBackgroundParseResultsForFileInProject(filename, options, userOpName) = + member __.GetBackgroundParseResultsForFileInProject(filename, options, userOpName) = reactor.EnqueueAndAwaitOpAsync(userOpName, "GetBackgroundParseResultsForFileInProject ", filename, fun ctok -> cancellable { let! builderOpt, creationErrors = getOrCreateBuilder (ctok, options, userOpName) @@ -2502,21 +437,21 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC } ) - member bc.GetCachedCheckFileResult(builder: IncrementalBuilder,filename,sourceText: ISourceText,options) = - // Check the cache. We can only use cached results when there is no work to do to bring the background builder up-to-date - let cachedResults = parseCacheLock.AcquireLock (fun ltok -> checkFileInProjectCache.TryGet(ltok, (filename,sourceText.GetHashCode(),options))) + member __.GetCachedCheckFileResult(builder: IncrementalBuilder, filename, sourceText: ISourceText, options) = + // Check the cache. We can only use cached results when there is no work to do to bring the background builder up-to-date + let cachedResults = parseCacheLock.AcquireLock (fun ltok -> checkFileInProjectCache.TryGet(ltok, (filename, sourceText.GetHashCode(), options))) - match cachedResults with + match cachedResults with // | Some (parseResults, checkResults, _, _) when builder.AreCheckResultsBeforeFileInProjectReady(filename) -> - | Some (parseResults, checkResults,_,priorTimeStamp) - when - (match builder.GetCheckResultsBeforeFileInProjectEvenIfStale filename with - | None -> false - | Some(tcPrior) -> - tcPrior.TimeStamp = priorTimeStamp && - builder.AreCheckResultsBeforeFileInProjectReady(filename)) -> - Some (parseResults,checkResults) - | _ -> None + | Some (parseResults, checkResults,_,priorTimeStamp) + when + (match builder.GetCheckResultsBeforeFileInProjectEvenIfStale filename with + | None -> false + | Some(tcPrior) -> + tcPrior.TimeStamp = priorTimeStamp && + builder.AreCheckResultsBeforeFileInProjectReady(filename)) -> + Some (parseResults,checkResults) + | _ -> None /// 1. Repeatedly try to get cached file check results or get file "lock". /// @@ -2559,12 +494,31 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC // Get additional script #load closure information if applicable. // For scripts, this will have been recorded by GetProjectOptionsFromScript. let loadClosure = scriptClosureCacheLock.AcquireLock (fun ltok -> scriptClosureCache.TryGet (ltok, options)) - let! tcErrors, tcFileResult = - Parser.CheckOneFile(parseResults, sourceText, fileName, options.ProjectFileName, tcPrior.TcConfig, tcPrior.TcGlobals, tcPrior.TcImports, - tcPrior.TcState, tcPrior.ModuleNamesDict, loadClosure, tcPrior.TcErrors, reactorOps, textSnapshotInfo, userOpName, suggestNamesForErrors) + let! checkAnswer = + FSharpCheckFileResults.CheckOneFile + (parseResults, + sourceText, + fileName, + options.ProjectFileName, + tcPrior.TcConfig, + tcPrior.TcGlobals, + tcPrior.TcImports, + tcPrior.TcState, + tcPrior.ModuleNamesDict, + loadClosure, + tcPrior.TcErrors, + reactorOps, + textSnapshotInfo, + userOpName, + options.IsIncompleteTypeCheckEnvironment, + builder, + Array.ofList tcPrior.TcDependencyFiles, + creationErrors, + parseResults.Errors, + keepAssemblyContents, + suggestNamesForErrors) 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, sourceText.GetHashCode()) + bc.RecordTypeCheckFileInProjectResults(fileName, options, parsingOptions, parseResults, fileVersion, tcPrior.TimeStamp, Some checkAnswer, sourceText.GetHashCode()) return checkAnswer finally let dummy = ref () @@ -2630,7 +584,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC reactor.CancelBackgroundOp() // cancel the background work, since we will start new work after we're done let! builderOpt,creationErrors = execWithReactorAsync (fun ctok -> getOrCreateBuilder (ctok, options, userOpName)) match builderOpt with - | None -> return FSharpCheckFileAnswer.Succeeded (MakeCheckFileResultsEmpty(filename, creationErrors)) + | None -> return FSharpCheckFileAnswer.Succeeded (FSharpCheckFileResults.MakeEmpty(filename, creationErrors, reactorOps, keepAssemblyContents)) | Some builder -> // Check the cache. We can only use cached results when there is no work to do to bring the background builder up-to-date let cachedResults = bc.GetCachedCheckFileResult(builder, filename, sourceText, options) @@ -2681,7 +635,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC // Do the parsing. let parsingOptions = FSharpParsingOptions.FromTcConfig(builder.TcConfig, Array.ofList (builder.SourceFiles), options.UseScriptResolutionRules) - let parseErrors, parseTreeOpt, anyErrors = Parser.parseFile (sourceText, filename, parsingOptions, userOpName, suggestNamesForErrors) + let parseErrors, parseTreeOpt, anyErrors = ParseAndCheckFile.parseFile (sourceText, filename, parsingOptions, userOpName, suggestNamesForErrors) let parseResults = FSharpParseFileResults(parseErrors, parseTreeOpt, anyErrors, builder.AllDependenciesDeprecated) let! checkResults = bc.CheckOneFileImpl(parseResults, sourceText, filename, options, textSnapshotInfo, fileVersion, builder, tcPrior, creationErrors, userOpName) @@ -2693,14 +647,14 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC } /// Fetch the check information from the background compiler (which checks w.r.t. the FileSystem API) - member bc.GetBackgroundCheckResultsForFileInProject(filename, options, userOpName) = + member __.GetBackgroundCheckResultsForFileInProject(filename, options, userOpName) = reactor.EnqueueAndAwaitOpAsync(userOpName, "GetBackgroundCheckResultsForFileInProject", filename, fun ctok -> cancellable { let! builderOpt, creationErrors = getOrCreateBuilder (ctok, options, userOpName) match builderOpt with | None -> let parseResults = FSharpParseFileResults(creationErrors, None, true, [| |]) - let typedResults = MakeCheckFileResultsEmpty(filename, creationErrors) + let typedResults = FSharpCheckFileResults.MakeEmpty(filename, creationErrors, reactorOps, keepAssemblyContents) return (parseResults, typedResults) | Some builder -> let! (parseTreeOpt, _, _, untypedErrors) = builder.GetParseResultsForFile (ctok, filename) @@ -2710,24 +664,36 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC let tcErrors = [| yield! creationErrors; yield! ErrorHelpers.CreateErrorInfos (errorOptions, false, filename, tcProj.TcErrors, suggestNamesForErrors) |] 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, - Option.get tcProj.LastestCcuSigForFile, - tcProj.TcState.Ccu, tcProj.TcImports, tcProj.TcEnvAtEnd.AccessRights, - options.ProjectFileName, filename, - List.head tcProj.TcResolutionsRev, - List.head tcProj.TcSymbolUsesRev, - tcProj.TcEnvAtEnd.NameEnv, - loadClosure, reactorOps, None, - tcProj.LatestImplementationFile, - List.head tcProj.TcOpenDeclarationsRev) - let typedResults = MakeCheckFileResults(filename, options, builder, scope, Array.ofList tcProj.TcDependencyFiles, creationErrors, parseResults.Errors, tcErrors) + let typedResults = + FSharpCheckFileResults.Make + (filename, + options.ProjectFileName, + tcProj.TcConfig, + tcProj.TcGlobals, + options.IsIncompleteTypeCheckEnvironment, + builder, + Array.ofList tcProj.TcDependencyFiles, + creationErrors, + parseResults.Errors, + tcErrors, + reactorOps, + keepAssemblyContents, + Option.get tcProj.LastestCcuSigForFile, + tcProj.TcState.Ccu, + tcProj.TcImports, + tcProj.TcEnvAtEnd.AccessRights, + List.head tcProj.TcResolutionsRev, + List.head tcProj.TcSymbolUsesRev, + tcProj.TcEnvAtEnd.NameEnv, + loadClosure, + tcProj.LatestImplementationFile, + List.head tcProj.TcOpenDeclarationsRev) return (parseResults, typedResults) }) /// Try to get recent approximate type check results for a file. - member bc.TryGetRecentCheckResultsForFile(filename: string, options:FSharpProjectOptions, sourceText: ISourceText option, _userOpName: string) = + member __.TryGetRecentCheckResultsForFile(filename: string, options:FSharpProjectOptions, sourceText: ISourceText option, _userOpName: string) = match sourceText with | Some sourceText -> parseCacheLock.AcquireLock (fun ltok -> @@ -2737,7 +703,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC | None -> parseCacheLock.AcquireLock (fun ltok -> checkFileInProjectCachePossiblyStale.TryGet(ltok,(filename,options))) /// Parse and typecheck the whole project (the implementation, called recursively as project graph is evaluated) - member private bc.ParseAndCheckProjectImpl(options, ctok, userOpName) : Cancellable = + member private __.ParseAndCheckProjectImpl(options, ctok, userOpName) : Cancellable = cancellable { let! builderOpt,creationErrors = getOrCreateBuilder (ctok, options, userOpName) match builderOpt with @@ -2755,7 +721,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC } /// Get the timestamp that would be on the output if fully built immediately - member private bc.TryGetLogicalTimeStampForProject(cache, ctok, options, userOpName: string) = + member private __.TryGetLogicalTimeStampForProject(cache, ctok, options, userOpName: string) = // NOTE: This creation of the background builder is currently run as uncancellable. Creating background builders is generally // cheap though the timestamp computations look suspicious for transitive project references. @@ -2768,7 +734,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC member bc.ParseAndCheckProject(options, userOpName) = reactor.EnqueueAndAwaitOpAsync(userOpName, "ParseAndCheckProject", options.ProjectFileName, fun ctok -> bc.ParseAndCheckProjectImpl(options, ctok, userOpName)) - member bc.GetProjectOptionsFromScript(filename, sourceText, loadedTimeStamp, otherFlags, useFsiAuxLib: bool option, useSdkRefs: bool option, assumeDotNetFramework: bool option, extraProjectInfo: obj option, optionsStamp: int64 option, userOpName) = + member __.GetProjectOptionsFromScript(filename, sourceText, loadedTimeStamp, otherFlags, useFsiAuxLib: bool option, useSdkRefs: bool option, assumeDotNetFramework: bool option, extraProjectInfo: obj option, optionsStamp: int64 option, userOpName) = reactor.EnqueueAndAwaitOpAsync (userOpName, "GetProjectOptionsFromScript", filename, fun ctok -> cancellable { use errors = new ErrorScope() @@ -2794,7 +760,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC let loadClosure = LoadClosure.ComputeClosureOfScriptText(ctok, legacyReferenceResolver, - defaultFSharpBinariesDir, filename, sourceText, + FSharpCheckerResultsSettings.defaultFSharpBinariesDir, filename, sourceText, CodeContext.Editing, useSimpleResolution, useFsiAuxLib, useSdkRefs, new Lexhelp.LexResourceManager(), applyCompilerOptions, assumeDotNetFramework, tryGetMetadataSnapshot=tryGetMetadataSnapshot, @@ -2843,7 +809,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC if startBackgroundCompileIfAlreadySeen then bc.CheckProjectInBackground(options, userOpName + ".StartBackgroundCompile")) - member bc.NotifyProjectCleaned (options : FSharpProjectOptions, userOpName) = + member __.NotifyProjectCleaned (options : FSharpProjectOptions, userOpName) = reactor.EnqueueAndAwaitOpAsync(userOpName, "NotifyProjectCleaned", options.ProjectFileName, fun ctok -> cancellable { // If there was a similar entry (as there normally will have been) then re-establish an empty builder . This @@ -2856,7 +822,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC incrementalBuildersCache.Set(ctok, options, newBuilderInfo) }) - member bc.CheckProjectInBackground (options, userOpName) = + member __.CheckProjectInBackground (options, userOpName) = reactor.SetBackgroundOp (Some (userOpName, "CheckProjectInBackground", options.ProjectFileName, (fun ctok ct -> // The creation of the background builder can't currently be cancelled match getOrCreateBuilder (ctok, options, userOpName) |> Cancellable.run ct with @@ -2870,25 +836,30 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC | ValueOrCancelled.Value v -> v | ValueOrCancelled.Cancelled _ -> false))) - member bc.StopBackgroundCompile () = + member __.StopBackgroundCompile () = reactor.SetBackgroundOp(None) - member bc.WaitForBackgroundCompile() = + member __.WaitForBackgroundCompile() = reactor.WaitForBackgroundOpCompletion() - member bc.CompleteAllQueuedOps() = + member __.CompleteAllQueuedOps() = reactor.CompleteAllQueuedOps() - member bc.Reactor = reactor - member bc.ReactorOps = reactorOps - member bc.BeforeBackgroundFileCheck = beforeFileChecked.Publish - member bc.FileParsed = fileParsed.Publish - member bc.FileChecked = fileChecked.Publish - member bc.ProjectChecked = projectChecked.Publish + member __.Reactor = reactor + + member __.ReactorOps = reactorOps + + member __.BeforeBackgroundFileCheck = beforeFileChecked.Publish + + member __.FileParsed = fileParsed.Publish - member bc.CurrentQueueLength = reactor.CurrentQueueLength + member __.FileChecked = fileChecked.Publish - member bc.ClearCachesAsync (userOpName) = + member __.ProjectChecked = projectChecked.Publish + + member __.CurrentQueueLength = reactor.CurrentQueueLength + + member __.ClearCachesAsync (userOpName) = reactor.EnqueueAndAwaitOpAsync (userOpName, "ClearCachesAsync", "", fun ctok -> parseCacheLock.AcquireLock (fun ltok -> checkFileInProjectCachePossiblyStale.Clear ltok @@ -2899,7 +870,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC scriptClosureCacheLock.AcquireLock (fun ltok -> scriptClosureCache.Clear ltok) cancellable.Return ()) - member bc.DownsizeCaches(userOpName) = + member __.DownsizeCaches(userOpName) = reactor.EnqueueAndAwaitOpAsync (userOpName, "DownsizeCaches", "", fun ctok -> parseCacheLock.AcquireLock (fun ltok -> checkFileInProjectCachePossiblyStale.Resize(ltok, keepStrongly=1) @@ -2911,25 +882,27 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC cancellable.Return ()) member __.FrameworkImportsCache = frameworkTcImportsCache + member __.ImplicitlyStartBackgroundWork with get() = implicitlyStartBackgroundWork and set v = implicitlyStartBackgroundWork <- v + static member GlobalForegroundParseCountStatistic = foregroundParseCount + static member GlobalForegroundTypeCheckCountStatistic = foregroundTypeCheckCount -//---------------------------------------------------------------------------- -// FSharpChecker -// - -[] -[] -// There is typically only one instance of this type in a Visual Studio process. -type FSharpChecker(legacyReferenceResolver, projectCacheSize, keepAssemblyContents, keepAllBackgroundResolutions, tryGetMetadataSnapshot, suggestNamesForErrors) = +[] +// There is typically only one instance of this type in an IDE process. +type FSharpChecker(legacyReferenceResolver, + projectCacheSize, + keepAssemblyContents, + keepAllBackgroundResolutions, + tryGetMetadataSnapshot, + suggestNamesForErrors) = let backgroundCompiler = BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyContents, keepAllBackgroundResolutions, tryGetMetadataSnapshot, suggestNamesForErrors) static let globalInstance = lazy FSharpChecker.Create() - - + // STATIC ROOT: FSharpLanguageServiceTestable.FSharpChecker.braceMatchCache. Most recently used cache for brace matching. Accessed on the // background UI thread, not on the compiler thread. // @@ -2937,7 +910,9 @@ type FSharpChecker(legacyReferenceResolver, projectCacheSize, keepAssemblyConten let braceMatchCache = MruCache(braceMatchCacheSize, areSimilar = AreSimilarForParsing, areSame = AreSameForParsing) let mutable maxMemoryReached = false + let mutable maxMB = maxMBDefault + let maxMemEvent = new Event() /// Instantiate an interactive checker. @@ -2955,16 +930,16 @@ type FSharpChecker(legacyReferenceResolver, projectCacheSize, keepAssemblyConten let suggestNamesForErrors = defaultArg suggestNamesForErrors false new FSharpChecker(legacyReferenceResolver, projectCacheSizeReal,keepAssemblyContents, keepAllBackgroundResolutions, tryGetMetadataSnapshot, suggestNamesForErrors) - member ic.ReferenceResolver = legacyReferenceResolver + member __.ReferenceResolver = legacyReferenceResolver - member ic.MatchBraces(filename, sourceText: ISourceText, options: FSharpParsingOptions, ?userOpName: string) = + member __.MatchBraces(filename, sourceText: ISourceText, options: FSharpParsingOptions, ?userOpName: string) = let userOpName = defaultArg userOpName "Unknown" let hash = sourceText.GetHashCode() async { match braceMatchCache.TryGet(AssumeAnyCallerThreadWithoutEvidence(), (filename, hash, options)) with | Some res -> return res | None -> - let res = Parser.matchBraces(sourceText, filename, options, userOpName, suggestNamesForErrors) + let res = ParseAndCheckFile.matchBraces(sourceText, filename, options, userOpName, suggestNamesForErrors) braceMatchCache.Set(AssumeAnyCallerThreadWithoutEvidence(), (filename, hash, options), res) return res } @@ -2989,27 +964,27 @@ type FSharpChecker(legacyReferenceResolver, projectCacheSize, keepAssemblyConten let parsingOptions, _ = ic.GetParsingOptionsFromProjectOptions(options) ic.ParseFile(filename, SourceText.ofString source, parsingOptions, userOpName) - member ic.GetBackgroundParseResultsForFileInProject (filename,options, ?userOpName: string) = + member __.GetBackgroundParseResultsForFileInProject (filename,options, ?userOpName: string) = let userOpName = defaultArg userOpName "Unknown" backgroundCompiler.GetBackgroundParseResultsForFileInProject(filename, options, userOpName) - member ic.GetBackgroundCheckResultsForFileInProject (filename,options, ?userOpName: string) = + member __.GetBackgroundCheckResultsForFileInProject (filename,options, ?userOpName: string) = let userOpName = defaultArg userOpName "Unknown" backgroundCompiler.GetBackgroundCheckResultsForFileInProject(filename,options, userOpName) /// Try to get recent approximate type check results for a file. - member ic.TryGetRecentCheckResultsForFile(filename: string, options:FSharpProjectOptions, ?sourceText, ?userOpName: string) = + member __.TryGetRecentCheckResultsForFile(filename: string, options:FSharpProjectOptions, ?sourceText, ?userOpName: string) = let userOpName = defaultArg userOpName "Unknown" backgroundCompiler.TryGetRecentCheckResultsForFile(filename,options,sourceText, userOpName) - member ic.Compile(argv: string[], ?userOpName: string) = + member __.Compile(argv: string[], ?userOpName: string) = let userOpName = defaultArg userOpName "Unknown" backgroundCompiler.Reactor.EnqueueAndAwaitOpAsync (userOpName, "Compile", "", fun ctok -> cancellable { return CompileHelpers.compileFromArgs (ctok, argv, legacyReferenceResolver, None, None) }) - member ic.Compile (ast:ParsedInput list, assemblyName:string, outFile:string, dependencies:string list, ?pdbFile:string, ?executable:bool, ?noframework:bool, ?userOpName: string) = + member __.Compile (ast:ParsedInput list, assemblyName:string, outFile:string, dependencies:string list, ?pdbFile:string, ?executable:bool, ?noframework:bool, ?userOpName: string) = let userOpName = defaultArg userOpName "Unknown" backgroundCompiler.Reactor.EnqueueAndAwaitOpAsync (userOpName, "Compile", assemblyName, fun ctok -> cancellable { @@ -3018,7 +993,7 @@ type FSharpChecker(legacyReferenceResolver, projectCacheSize, keepAssemblyConten } ) - member ic.CompileToDynamicAssembly (otherFlags: string[], execute: (TextWriter * TextWriter) option, ?userOpName: string) = + member __.CompileToDynamicAssembly (otherFlags: string[], execute: (TextWriter * TextWriter) option, ?userOpName: string) = let userOpName = defaultArg userOpName "Unknown" backgroundCompiler.Reactor.EnqueueAndAwaitOpAsync (userOpName, "CompileToDynamicAssembly", "", fun ctok -> cancellable { @@ -3046,7 +1021,7 @@ type FSharpChecker(legacyReferenceResolver, projectCacheSize, keepAssemblyConten } ) - member ic.CompileToDynamicAssembly (asts:ParsedInput list, assemblyName:string, dependencies:string list, execute: (TextWriter * TextWriter) option, ?debug:bool, ?noframework:bool, ?userOpName: string) = + member __.CompileToDynamicAssembly (asts:ParsedInput list, assemblyName:string, dependencies:string list, execute: (TextWriter * TextWriter) option, ?debug:bool, ?noframework:bool, ?userOpName: string) = let userOpName = defaultArg userOpName "Unknown" backgroundCompiler.Reactor.EnqueueAndAwaitOpAsync (userOpName, "CompileToDynamicAssembly", assemblyName, fun ctok -> cancellable { @@ -3086,7 +1061,7 @@ type FSharpChecker(legacyReferenceResolver, projectCacheSize, keepAssemblyConten member ic.InvalidateAll() = ic.ClearCaches() - member ic.ClearCachesAsync(?userOpName: string) = + member __.ClearCachesAsync(?userOpName: string) = let utok = AssumeAnyCallerThreadWithoutEvidence() let userOpName = defaultArg userOpName "Unknown" braceMatchCache.Clear(utok) @@ -3095,7 +1070,7 @@ type FSharpChecker(legacyReferenceResolver, projectCacheSize, keepAssemblyConten member ic.ClearCaches(?userOpName) = ic.ClearCachesAsync(?userOpName=userOpName) |> Async.Start // this cache clearance is not synchronous, it will happen when the background op gets run - member ic.CheckMaxMemoryReached() = + member __.CheckMaxMemoryReached() = if not maxMemoryReached && System.GC.GetTotalMemory(false) > int64 maxMB * 1024L * 1024L then Trace.TraceWarning("!!!!!!!! MAX MEMORY REACHED, DOWNSIZING F# COMPILER CACHES !!!!!!!!!!!!!!!") // If the maxMB limit is reached, drastic action is taken @@ -3117,18 +1092,18 @@ type FSharpChecker(legacyReferenceResolver, projectCacheSize, keepAssemblyConten /// This function is called when the configuration is known to have changed for reasons not encoded in the ProjectOptions. /// For example, dependent references may have been deleted or created. - member ic.InvalidateConfiguration(options: FSharpProjectOptions, ?startBackgroundCompile, ?userOpName: string) = + member __.InvalidateConfiguration(options: FSharpProjectOptions, ?startBackgroundCompile, ?userOpName: string) = let userOpName = defaultArg userOpName "Unknown" backgroundCompiler.InvalidateConfiguration(options, startBackgroundCompile, userOpName) /// This function is called when a project has been cleaned, and thus type providers should be refreshed. - member ic.NotifyProjectCleaned(options: FSharpProjectOptions, ?userOpName: string) = + member __.NotifyProjectCleaned(options: FSharpProjectOptions, ?userOpName: string) = let userOpName = defaultArg userOpName "Unknown" backgroundCompiler.NotifyProjectCleaned (options, userOpName) /// Typecheck a source code file, returning a handle to the results of the /// parse including the reconstructed types in the file. - member ic.CheckFileInProjectAllowingStaleCachedResults(parseResults:FSharpParseFileResults, filename:string, fileVersion:int, source:string, options:FSharpProjectOptions, ?textSnapshotInfo:obj, ?userOpName: string) = + member __.CheckFileInProjectAllowingStaleCachedResults(parseResults:FSharpParseFileResults, filename:string, fileVersion:int, source:string, options:FSharpProjectOptions, ?textSnapshotInfo:obj, ?userOpName: string) = let userOpName = defaultArg userOpName "Unknown" backgroundCompiler.CheckFileInProjectAllowingStaleCachedResults(parseResults,filename,fileVersion,SourceText.ofString source,options,textSnapshotInfo, userOpName) @@ -3152,11 +1127,11 @@ type FSharpChecker(legacyReferenceResolver, projectCacheSize, keepAssemblyConten backgroundCompiler.ParseAndCheckProject(options, userOpName) /// For a given script file, get the ProjectOptions implied by the #load closure - member ic.GetProjectOptionsFromScript(filename, source, ?loadedTimeStamp, ?otherFlags, ?useFsiAuxLib, ?useSdkRefs, ?assumeDotNetFramework, ?extraProjectInfo: obj, ?optionsStamp: int64, ?userOpName: string) = + member __.GetProjectOptionsFromScript(filename, source, ?loadedTimeStamp, ?otherFlags, ?useFsiAuxLib, ?useSdkRefs, ?assumeDotNetFramework, ?extraProjectInfo: obj, ?optionsStamp: int64, ?userOpName: string) = let userOpName = defaultArg userOpName "Unknown" backgroundCompiler.GetProjectOptionsFromScript(filename, source, loadedTimeStamp, otherFlags, useFsiAuxLib, useSdkRefs, assumeDotNetFramework, extraProjectInfo, optionsStamp, userOpName) - member ic.GetProjectOptionsFromCommandLineArgs(projectFileName, argv, ?loadedTimeStamp, ?extraProjectInfo: obj) = + member __.GetProjectOptionsFromCommandLineArgs(projectFileName, argv, ?loadedTimeStamp, ?extraProjectInfo: obj) = let loadedTimeStamp = defaultArg loadedTimeStamp DateTime.MaxValue // Not 'now', we don't want to force reloading { ProjectFileName = projectFileName ProjectId = None @@ -3171,7 +1146,7 @@ type FSharpChecker(legacyReferenceResolver, projectCacheSize, keepAssemblyConten ExtraProjectInfo=extraProjectInfo Stamp = None } - member ic.GetParsingOptionsFromCommandLineArgs(initialSourceFiles, argv, ?isInteractive) = + member __.GetParsingOptionsFromCommandLineArgs(initialSourceFiles, argv, ?isInteractive) = let isInteractive = defaultArg isInteractive false use errorScope = new ErrorScope() let tcConfigBuilder = TcConfigBuilder.Initial @@ -3184,7 +1159,7 @@ type FSharpChecker(legacyReferenceResolver, projectCacheSize, keepAssemblyConten ic.GetParsingOptionsFromCommandLineArgs([], argv, ?isInteractive=isInteractive) /// Begin background parsing the given project. - member ic.StartBackgroundCompile(options, ?userOpName) = + member __.StartBackgroundCompile(options, ?userOpName) = let userOpName = defaultArg userOpName "Unknown" backgroundCompiler.CheckProjectInBackground(options, userOpName) @@ -3193,37 +1168,45 @@ type FSharpChecker(legacyReferenceResolver, projectCacheSize, keepAssemblyConten ic.StartBackgroundCompile(options, ?userOpName=userOpName) /// Stop the background compile. - member ic.StopBackgroundCompile() = + member __.StopBackgroundCompile() = backgroundCompiler.StopBackgroundCompile() /// Block until the background compile finishes. // // This is for unit testing only - member ic.WaitForBackgroundCompile() = backgroundCompiler.WaitForBackgroundCompile() + member __.WaitForBackgroundCompile() = backgroundCompiler.WaitForBackgroundCompile() // Publish the ReactorOps from the background compiler for internal use member ic.ReactorOps = backgroundCompiler.ReactorOps - member ic.CurrentQueueLength = backgroundCompiler.CurrentQueueLength + member __.CurrentQueueLength = backgroundCompiler.CurrentQueueLength + + member __.BeforeBackgroundFileCheck = backgroundCompiler.BeforeBackgroundFileCheck + + member __.FileParsed = backgroundCompiler.FileParsed + + member __.FileChecked = backgroundCompiler.FileChecked + + member __.ProjectChecked = backgroundCompiler.ProjectChecked - member ic.BeforeBackgroundFileCheck = backgroundCompiler.BeforeBackgroundFileCheck - member ic.FileParsed = backgroundCompiler.FileParsed - member ic.FileChecked = backgroundCompiler.FileChecked - member ic.ProjectChecked = backgroundCompiler.ProjectChecked - member ic.ImplicitlyStartBackgroundWork with get() = backgroundCompiler.ImplicitlyStartBackgroundWork and set v = backgroundCompiler.ImplicitlyStartBackgroundWork <- v - member ic.PauseBeforeBackgroundWork with get() = Reactor.Singleton.PauseBeforeBackgroundWork and set v = Reactor.Singleton.PauseBeforeBackgroundWork <- v + member __.ImplicitlyStartBackgroundWork with get() = backgroundCompiler.ImplicitlyStartBackgroundWork and set v = backgroundCompiler.ImplicitlyStartBackgroundWork <- v + + member __.PauseBeforeBackgroundWork with get() = Reactor.Singleton.PauseBeforeBackgroundWork and set v = Reactor.Singleton.PauseBeforeBackgroundWork <- v static member GlobalForegroundParseCountStatistic = BackgroundCompiler.GlobalForegroundParseCountStatistic + static member GlobalForegroundTypeCheckCountStatistic = BackgroundCompiler.GlobalForegroundTypeCheckCountStatistic - member ic.MaxMemoryReached = maxMemEvent.Publish - member ic.MaxMemory with get() = maxMB and set v = maxMB <- v + member __.MaxMemoryReached = maxMemEvent.Publish + + member __.MaxMemory with get() = maxMB and set v = maxMB <- v static member Instance with get() = globalInstance.Force() + member internal __.FrameworkImportsCache = backgroundCompiler.FrameworkImportsCache /// Tokenize a single line, returning token information and a tokenization state represented by an integer - member x.TokenizeLine (line: string, state: FSharpTokenizerLexState) = + member __.TokenizeLine (line: string, state: FSharpTokenizerLexState) = let tokenizer = FSharpSourceTokenizer([], None) let lineTokenizer = tokenizer.CreateLineTokenizer line let mutable state = (None, state) @@ -3243,51 +1226,6 @@ type FSharpChecker(legacyReferenceResolver, projectCacheSize, keepAssemblyConten yield tokens |] tokens - -type FsiInteractiveChecker(legacyReferenceResolver, reactorOps: IReactorOperations, tcConfig: TcConfig, tcGlobals, tcImports, tcState) = - let keepAssemblyContents = false - - member __.ParseAndCheckInteraction (ctok, sourceText: ISourceText, ?userOpName: string) = - async { - let userOpName = defaultArg userOpName "Unknown" - let filename = Path.Combine(tcConfig.implicitIncludeDir, "stdin.fsx") - let suggestNamesForErrors = true // Will always be true, this is just for readability - // Note: projectSourceFiles is only used to compute isLastCompiland, and is ignored if Build.IsScript(mainInputFileName) is true (which it is in this case). - let parsingOptions = FSharpParsingOptions.FromTcConfig(tcConfig, [| filename |], true) - let parseErrors, parseTreeOpt, anyErrors = Parser.parseFile (sourceText, filename, parsingOptions, userOpName, suggestNamesForErrors) - let dependencyFiles = [| |] // interactions have no dependencies - 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.ComputeClosureOfScriptText(ctok, legacyReferenceResolver, defaultFSharpBinariesDir, filename, sourceText, CodeContext.Editing, tcConfig.useSimpleResolution, tcConfig.useFsiAuxLib, tcConfig.useSdkRefs, new Lexhelp.LexResourceManager(), applyCompilerOptions, assumeDotNetFramework, tryGetMetadataSnapshot=(fun _ -> None), reduceMemoryUsage=reduceMemoryUsage) - let! tcErrors, tcFileResult = Parser.CheckOneFile(parseResults, sourceText, filename, "project", tcConfig, tcGlobals, tcImports, tcState, Map.empty, Some loadClosure, backgroundDiagnostics, reactorOps, None, userOpName, suggestNamesForErrors) - - return - match tcFileResult with - | Parser.TypeCheckAborted.No tcFileInfo -> - let errors = [| yield! parseErrors; yield! tcErrors |] - let typeCheckResults = FSharpCheckFileResults (filename, errors, Some tcFileInfo, dependencyFiles, None, reactorOps, false) - let projectResults = - FSharpCheckProjectResults (filename, Some tcConfig, keepAssemblyContents, errors, - Some(tcGlobals, tcImports, tcFileInfo.ThisCcu, tcFileInfo.CcuSigForFile, - [tcFileInfo.ScopeSymbolUses], None, None, mkSimpleAssemblyRef "stdin", - tcState.TcEnvFromImpls.AccessRights, None, dependencyFiles)) - parseResults, typeCheckResults, projectResults - | _ -> - failwith "unexpected aborted" - } - -//---------------------------------------------------------------------------- -// CompilerEnvironment, DebuggerEnvironment -// - type CompilerEnvironment = static member BinFolderOfDefaultFSharpCompiler(?probePoint) = FSharpEnvironment.BinFolderOfDefaultFSharpCompiler(probePoint) diff --git a/src/fsharp/service/service.fsi b/src/fsharp/service/service.fsi index 737737affd..ec368942d7 100755 --- a/src/fsharp/service/service.fsi +++ b/src/fsharp/service/service.fsi @@ -8,308 +8,16 @@ namespace FSharp.Compiler.SourceCodeServices open System open System.IO -open System.Collections.Generic -open FSharp.Compiler.AbstractIL -open FSharp.Compiler.AbstractIL.IL -open FSharp.Compiler.AbstractIL.Internal.Library open FSharp.Compiler.AbstractIL.ILBinaryReader open FSharp.Compiler open FSharp.Compiler.Ast -open FSharp.Compiler.Driver -open FSharp.Compiler.ErrorLogger open FSharp.Compiler.Range -open FSharp.Compiler.TcGlobals -open FSharp.Compiler.NameResolution -open FSharp.Compiler.CompileOps -open FSharp.Compiler.Infos -open FSharp.Compiler.InfoReader -open FSharp.Compiler.Tast -open FSharp.Compiler.Tastops open FSharp.Compiler.Text -/// Represents the reason why the GetDeclarationLocation operation failed. -[] -type public FSharpFindDeclFailureReason = - - /// Generic reason: no particular information about error apart from a message - | Unknown of message: string - - /// Source code file is not available - | NoSourceCode - - /// Trying to find declaration of ProvidedType without TypeProviderDefinitionLocationAttribute - | ProvidedType of string - - /// Trying to find declaration of ProvidedMember without TypeProviderDefinitionLocationAttribute - | ProvidedMember of string - -/// Represents the result of the GetDeclarationLocation operation. -[] -type public FSharpFindDeclResult = - /// Indicates a declaration location was not found, with an additional reason - | DeclNotFound of FSharpFindDeclFailureReason - /// Indicates a declaration location was found - | DeclFound of range - /// Indicates an external declaration was found - | ExternalDecl of assembly : string * externalSym : ExternalSymbol - -/// Represents the checking context implied by the ProjectOptions -[] -type public FSharpProjectContext = - /// Get the resolution and full contents of the assemblies referenced by the project options - member GetReferencedAssemblies : unit -> FSharpAssembly list - - /// Get the accessibility rights for this project context w.r.t. InternalsVisibleTo attributes granting access to other assemblies - member AccessibilityRights : FSharpAccessibilityRights - - -[] -type public SemanticClassificationType = - | ReferenceType - | ValueType - | UnionCase - | Function - | Property - | MutableVar - | Module - | Printf - | ComputationExpression - | IntrinsicFunction - | Enumeration - | Interface - | TypeArgument - | Operator - | Disposable - -/// A handle to the results of CheckFileInProject. -[] -type public FSharpCheckFileResults = - /// The errors returned by parsing a source file. - member Errors : FSharpErrorInfo[] - - /// Get a view of the contents of the assembly up to and including the file just checked - member PartialAssemblySignature : FSharpAssemblySignature - - /// Get the resolution of the ProjectOptions - member ProjectContext : FSharpProjectContext - - /// Indicates whether type checking successfully occurred with some results returned. If false, indicates that - /// an unrecoverable error in earlier checking/parsing/resolution steps. - member HasFullTypeCheckInfo: bool - - /// Tries to get the current successful TcImports. This is only used in testing. Do not use it for other stuff. - member internal TryGetCurrentTcImports: unit -> TcImports option - - /// Indicates the set of files which must be watched to accurately track changes that affect these results, - /// Clients interested in reacting to updates to these files should watch these files and take actions as described - /// in the documentation for compiler service. - member DependencyFiles : string[] - - /// Get the items for a declaration list - /// - /// - /// If this is present, it is used to filter declarations based on location in the - /// parse tree, specifically at 'open' declarations, 'inherit' of class or interface - /// 'record field' locations and r.h.s. of 'range' operator a..b - /// - /// The line number where the completion is happening - /// - /// Partial long name. QuickParse.GetPartialLongNameEx can be used to get it. - /// - /// - /// The text of the line where the completion is happening. This is only used to make a couple - /// of adhoc corrections to completion accuracy (e.g. checking for "..") - /// - /// - /// Function that returns all entities from current and referenced assemblies. - /// - /// - /// If text has been used from a captured name resolution from the typecheck, then - /// callback to the client to check if the text has changed. If it has, then give up - /// and assume that we're going to repeat the operation later on. - /// - /// An optional string used for tracing compiler operations associated with this request. - member GetDeclarationListInfo : ParsedFileResultsOpt:FSharpParseFileResults option * line: int * lineText:string * partialName: PartialLongName * ?getAllEntities: (unit -> AssemblySymbol list) * ?hasTextChangedSinceLastTypecheck: (obj * range -> bool) * ?userOpName: string -> Async - - /// Get the items for a declaration list in FSharpSymbol format - /// - /// - /// If this is present, it is used to filter declarations based on location in the - /// parse tree, specifically at 'open' declarations, 'inherit' of class or interface - /// 'record field' locations and r.h.s. of 'range' operator a..b - /// - /// The line number where the completion is happening - /// - /// Partial long name. QuickParse.GetPartialLongNameEx can be used to get it. - /// - /// - /// The text of the line where the completion is happening. This is only used to make a couple - /// of adhoc corrections to completion accuracy (e.g. checking for "..") - /// - /// - /// Function that returns all entities from current and referenced assemblies. - /// - /// - /// If text has been used from a captured name resolution from the typecheck, then - /// callback to the client to check if the text has changed. If it has, then give up - /// and assume that we're going to repeat the operation later on. - /// - /// An optional string used for tracing compiler operations associated with this request. - member GetDeclarationListSymbols : ParsedFileResultsOpt:FSharpParseFileResults option * line: int * lineText:string * partialName: PartialLongName * ?getAllEntities: (unit -> AssemblySymbol list) * ?hasTextChangedSinceLastTypecheck: (obj * range -> bool) * ?userOpName: string -> Async - - - /// Compute a formatted tooltip for the given location - /// - /// The line number where the information is being requested. - /// The column number at the end of the identifiers where the information is being requested. - /// The text of the line where the information is being requested. - /// The identifiers at the location where the information is being requested. - /// Used to discriminate between 'identifiers', 'strings' and others. For strings, an attempt is made to give a tooltip for a #r "..." location. Use a value from FSharpTokenInfo.Tag, or FSharpTokenTag.Identifier, unless you have other information available. - /// An optional string used for tracing compiler operations associated with this request. - member GetStructuredToolTipText : line:int * colAtEndOfNames:int * lineText:string * names:string list * tokenTag:int * ?userOpName: string -> Async - - /// Compute a formatted tooltip for the given location - /// - /// The line number where the information is being requested. - /// The column number at the end of the identifiers where the information is being requested. - /// The text of the line where the information is being requested. - /// The identifiers at the location where the information is being requested. - /// Used to discriminate between 'identifiers', 'strings' and others. For strings, an attempt is made to give a tooltip for a #r "..." location. Use a value from FSharpTokenInfo.Tag, or FSharpTokenTag.Identifier, unless you have other information available. - /// An optional string used for tracing compiler operations associated with this request. - member GetToolTipText : line:int * colAtEndOfNames:int * lineText:string * names:string list * tokenTag:int * ?userOpName: string -> Async - - /// Compute the Visual Studio F1-help key identifier for the given location, based on name resolution results - /// - /// The line number where the information is being requested. - /// The column number at the end of the identifiers where the information is being requested. - /// The text of the line where the information is being requested. - /// The identifiers at the location where the information is being requested. - /// An optional string used for tracing compiler operations associated with this request. - member GetF1Keyword : line:int * colAtEndOfNames:int * lineText:string * names:string list * ?userOpName: string -> Async - - - /// Compute a set of method overloads to show in a dialog relevant to the given code location. - /// - /// The line number where the information is being requested. - /// The column number at the end of the identifiers where the information is being requested. - /// The text of the line where the information is being requested. - /// The identifiers at the location where the information is being requested. - /// An optional string used for tracing compiler operations associated with this request. - member GetMethods : line:int * colAtEndOfNames:int * lineText:string * names:string list option * ?userOpName: string -> Async - - /// Compute a set of method overloads to show in a dialog relevant to the given code location. The resulting method overloads are returned as symbols. - /// The line number where the information is being requested. - /// The column number at the end of the identifiers where the information is being requested. - /// The text of the line where the information is being requested. - /// The identifiers at the location where the information is being requested. - /// An optional string used for tracing compiler operations associated with this request. - member GetMethodsAsSymbols : line:int * colAtEndOfNames:int * lineText:string * names:string list * ?userOpName: string -> Async - - /// Resolve the names at the given location to the declaration location of the corresponding construct. - /// - /// The line number where the information is being requested. - /// The column number at the end of the identifiers where the information is being requested. - /// The text of the line where the information is being requested. - /// The identifiers at the location where the information is being requested. - /// If not given, then get the location of the symbol. If false, then prefer the location of the corresponding symbol in the implementation of the file (rather than the signature if present). If true, prefer the location of the corresponding symbol in the signature of the file (rather than the implementation). - /// An optional string used for tracing compiler operations associated with this request. - member GetDeclarationLocation : line:int * colAtEndOfNames:int * lineText:string * names:string list * ?preferFlag:bool * ?userOpName: string -> Async - - - /// Resolve the names at the given location to a use of symbol. - /// - /// The line number where the information is being requested. - /// The column number at the end of the identifiers where the information is being requested. - /// The text of the line where the information is being requested. - /// The identifiers at the location where the information is being requested. - /// An optional string used for tracing compiler operations associated with this request. - member GetSymbolUseAtLocation : line:int * colAtEndOfNames:int * lineText:string * names:string list * ?userOpName: string -> Async - - /// Get any extra colorization info that is available after the typecheck - member GetSemanticClassification : range option -> (range * SemanticClassificationType)[] - - /// Get the locations of format specifiers - [] - member GetFormatSpecifierLocations : unit -> range[] - - /// Get the locations of and number of arguments associated with format specifiers - member GetFormatSpecifierLocationsAndArity : unit -> (range*int)[] - - /// Get all textual usages of all symbols throughout the file - member GetAllUsesOfAllSymbolsInFile : unit -> Async - - /// Get the textual usages that resolved to the given symbol throughout the file - member GetUsesOfSymbolInFile : symbol:FSharpSymbol -> Async - - member internal GetVisibleNamespacesAndModulesAtPoint : pos -> Async - - /// Find the most precise display context for the given line and column. - member GetDisplayContextForPos : 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 - - /// Determines if a long ident is resolvable at a specific point. - /// 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 file, including its typechecked signatures if any. - member ImplementationFile: FSharpImplementationFileContents option - - /// Open declarations in the file, including auto open modules. - member OpenDeclarations: FSharpOpenDeclaration[] - -/// A handle to the results of CheckFileInProject. -[] -type public FSharpCheckProjectResults = - - /// The errors returned by processing the project - member Errors: FSharpErrorInfo[] - - /// Get a view of the overall signature of the assembly. Only valid to use if HasCriticalErrors is false. - member AssemblySignature: FSharpAssemblySignature - - /// Get a view of the overall contents of the assembly. Only valid to use if HasCriticalErrors is false. - member AssemblyContents: FSharpAssemblyContents - - /// Get an optimized view of the overall contents of the assembly. Only valid to use if HasCriticalErrors is false. - member GetOptimizedAssemblyContents: unit -> FSharpAssemblyContents - - /// Get the resolution of the ProjectOptions - member ProjectContext: FSharpProjectContext - - /// Get the textual usages that resolved to the given symbol throughout the project - member GetUsesOfSymbol: symbol:FSharpSymbol -> Async - - /// Get all textual usages of all symbols throughout the project - member GetAllUsesOfAllSymbols: unit -> Async - - /// Indicates if critical errors existed in the project options - member HasCriticalErrors: bool - - /// Indicates the set of files which must be watched to accurately track changes that affect these results, - /// Clients interested in reacting to updates to these files should watch these files and take actions as described - /// in the documentation for compiler service. - member DependencyFiles: string[] - /// Unused in this API type public UnresolvedReferencesSet -/// Options used to determine active --define conditionals and other options relevant to parsing files in a project -type public FSharpParsingOptions = - { - SourceFiles: string[] - ConditionalCompilationDefines: string list - ErrorSeverityOptions: FSharpErrorSeverityOptions - IsInteractive: bool - LightSyntax: bool option - CompilingFsLib: bool - IsExe: bool - } - static member Default: FSharpParsingOptions - /// A set of information describing a project or script build configuration. type public FSharpProjectOptions = { @@ -357,12 +65,6 @@ type public FSharpProjectOptions = Stamp: int64 option } -/// The result of calling TypeCheckResult including the possibility of abort and background compiler not caught up. -[] -type public FSharpCheckFileAnswer = - | Aborted // because cancellation caused an abandonment of the operation - | Succeeded of FSharpCheckFileResults - [] /// Used to parse and check F# source code. type public FSharpChecker = @@ -711,15 +413,6 @@ type public FSharpChecker = /// Tokenize an entire file, line by line member TokenizeFile: source:string -> FSharpTokenInfo [] [] - - -// An object to typecheck source in a given typechecking environment. -// Used internally to provide intellisense over F# Interactive. -type internal FsiInteractiveChecker = - internal new : ReferenceResolver.Resolver * ops: IReactorOperations * tcConfig: TcConfig * tcGlobals: TcGlobals * tcImports: TcImports * tcState: TcState -> FsiInteractiveChecker - - /// An optional string used for tracing compiler operations associated with this request. - member internal ParseAndCheckInteraction : CompilationThreadToken * sourceText:ISourceText * ?userOpName: string -> Async /// Information about the compilation environment [] diff --git a/vsintegration/Utils/LanguageServiceProfiling/Options.fs b/vsintegration/Utils/LanguageServiceProfiling/Options.fs index 07d3b5804e..8ffb41aef0 100644 --- a/vsintegration/Utils/LanguageServiceProfiling/Options.fs +++ b/vsintegration/Utils/LanguageServiceProfiling/Options.fs @@ -190,6 +190,8 @@ let FCS (repositoryDir: string) : Options = @"src\fsharp\service\ServiceUntypedParse.fs" @"src\utils\reshapedmsbuild.fs" @"src\fsharp\SimulatedMSBuildReferenceResolver.fs" + @"src\fsharp\service\FSharpCheckerResults.fsi" + @"src\fsharp\service\FSharpCheckerResults.fs" @"src\fsharp\service\service.fsi" @"src\fsharp\service\service.fs" @"src\fsharp\service\SimpleServices.fsi" From 3de631a4ba0f54953bad33661008d39fb6df7669 Mon Sep 17 00:00:00 2001 From: Will Smith Date: Thu, 6 Jun 2019 15:29:37 -0700 Subject: [PATCH 088/159] Stop calling GetHierarchy in FSharpProjectOptionsReactor (#6946) * Stop calling GetHierarchy in FSharpProjectOptionsReactor * Fixing build --- fcs/build.fsx | 2 +- .../FSharpProjectOptionsManager.fs | 101 ++++++++---------- .../LegacyProjectWorkspaceMap.fs | 2 + 3 files changed, 46 insertions(+), 59 deletions(-) diff --git a/fcs/build.fsx b/fcs/build.fsx index ec53ced9c2..cf0e0d8ded 100644 --- a/fcs/build.fsx +++ b/fcs/build.fsx @@ -67,7 +67,7 @@ let releaseDir = Path.Combine(__SOURCE_DIRECTORY__, "../artifacts/bin/fcs/Releas let release = LoadReleaseNotes (__SOURCE_DIRECTORY__ + "/RELEASE_NOTES.md") let isAppVeyorBuild = buildServer = BuildServer.AppVeyor let isJenkinsBuild = buildServer = BuildServer.Jenkins -let isVersionTag tag = Version.TryParse tag |> fst +let isVersionTag (tag: string) = Version.TryParse tag |> fst let hasRepoVersionTag = isAppVeyorBuild && AppVeyorEnvironment.RepoTag && isVersionTag AppVeyorEnvironment.RepoTagName let assemblyVersion = if hasRepoVersionTag then AppVeyorEnvironment.RepoTagName else release.NugetVersion diff --git a/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs b/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs index 51cb4bbeec..a555b47ff3 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/FSharpProjectOptionsManager.fs @@ -24,58 +24,30 @@ open Microsoft.CodeAnalysis.ExternalAccess.FSharp.LanguageServices [] module private FSharpProjectOptionsHelpers = - let mapCpsProjectToSite(workspace:VisualStudioWorkspace, project:Project, serviceProvider:System.IServiceProvider, cpsCommandLineOptions: IDictionary) = - let hier = workspace.GetHierarchy(project.Id) + let mapCpsProjectToSite(project:Project, cpsCommandLineOptions: IDictionary) = let sourcePaths, referencePaths, options = match cpsCommandLineOptions.TryGetValue(project.Id) with | true, (sourcePaths, options) -> sourcePaths, [||], options | false, _ -> [||], [||], [||] + let mutable errorReporter = Unchecked.defaultof<_> { - new IProvideProjectSite with - member x.GetProjectSite() = - let mutable errorReporter = - let reporter = ProjectExternalErrorReporter(project.Id, "FS", serviceProvider) - Some(reporter:> IVsLanguageServiceBuildErrorReporter2) - - { - new IProjectSite with - member __.Description = project.Name - member __.CompilationSourceFiles = sourcePaths - member __.CompilationOptions = - Array.concat [options; referencePaths |> Array.map(fun r -> "-r:" + r)] - member __.CompilationReferences = referencePaths - member site.CompilationBinOutputPath = site.CompilationOptions |> Array.tryPick (fun s -> if s.StartsWith("-o:") then Some s.[3..] else None) - member __.ProjectFileName = project.FilePath - member __.AdviseProjectSiteChanges(_,_) = () - member __.AdviseProjectSiteCleaned(_,_) = () - member __.AdviseProjectSiteClosed(_,_) = () - member __.IsIncompleteTypeCheckEnvironment = false - member __.TargetFrameworkMoniker = "" - member __.ProjectGuid = project.Id.Id.ToString() - member __.LoadTime = System.DateTime.Now - member __.ProjectProvider = Some (x) - member __.BuildErrorReporter with get () = errorReporter and set (v) = errorReporter <- v - } - interface IVsHierarchy with - member __.SetSite(psp) = hier.SetSite(psp) - member __.GetSite(psp) = hier.GetSite(ref psp) - member __.QueryClose(pfCanClose)= hier.QueryClose(ref pfCanClose) - member __.Close() = hier.Close() - member __.GetGuidProperty(itemid, propid, pguid) = hier.GetGuidProperty(itemid, propid, ref pguid) - member __.SetGuidProperty(itemid, propid, rguid) = hier.SetGuidProperty(itemid, propid, ref rguid) - member __.GetProperty(itemid, propid, pvar) = hier.GetProperty(itemid, propid, ref pvar) - member __.SetProperty(itemid, propid, var) = hier.SetProperty(itemid, propid, var) - member __.GetNestedHierarchy(itemid, iidHierarchyNested, ppHierarchyNested, pitemidNested) = - hier.GetNestedHierarchy(itemid, ref iidHierarchyNested, ref ppHierarchyNested, ref pitemidNested) - member __.GetCanonicalName(itemid, pbstrName) = hier.GetCanonicalName(itemid, ref pbstrName) - member __.ParseCanonicalName(pszName, pitemid) = hier.ParseCanonicalName(pszName, ref pitemid) - member __.Unused0() = hier.Unused0() - member __.AdviseHierarchyEvents(pEventSink, pdwCookie) = hier.AdviseHierarchyEvents(pEventSink, ref pdwCookie) - member __.UnadviseHierarchyEvents(dwCookie) = hier.UnadviseHierarchyEvents(dwCookie) - member __.Unused1() = hier.Unused1() - member __.Unused2() = hier.Unused2() - member __.Unused3() = hier.Unused3() - member __.Unused4() = hier.Unused4() + new IProjectSite with + member __.Description = project.Name + member __.CompilationSourceFiles = sourcePaths + member __.CompilationOptions = + Array.concat [options; referencePaths |> Array.map(fun r -> "-r:" + r)] + member __.CompilationReferences = referencePaths + member site.CompilationBinOutputPath = site.CompilationOptions |> Array.tryPick (fun s -> if s.StartsWith("-o:") then Some s.[3..] else None) + member __.ProjectFileName = project.FilePath + member __.AdviseProjectSiteChanges(_,_) = () + member __.AdviseProjectSiteCleaned(_,_) = () + member __.AdviseProjectSiteClosed(_,_) = () + member __.IsIncompleteTypeCheckEnvironment = false + member __.TargetFrameworkMoniker = "" + member __.ProjectGuid = project.Id.Id.ToString() + member __.LoadTime = System.DateTime.Now + member __.ProjectProvider = None + member __.BuildErrorReporter with get () = errorReporter and set (v) = errorReporter <- v } let hasProjectVersionChanged (oldProject: Project) (newProject: Project) = @@ -108,11 +80,13 @@ type private FSharpProjectOptionsMessage = | ClearSingleFileOptionsCache of DocumentId [] -type private FSharpProjectOptionsReactor (workspace: VisualStudioWorkspace, settings: EditorOptions, serviceProvider, checkerProvider: FSharpCheckerProvider) = +type private FSharpProjectOptionsReactor (_workspace: VisualStudioWorkspace, settings: EditorOptions, _serviceProvider, checkerProvider: FSharpCheckerProvider) = let cancellationTokenSource = new CancellationTokenSource() // Hack to store command line options from HandleCommandLineChanges - let cpsCommandLineOptions = new ConcurrentDictionary() + let cpsCommandLineOptions = ConcurrentDictionary() + + let legacyProjectSites = ConcurrentDictionary() let cache = Dictionary() let singleFileCache = Dictionary() @@ -158,6 +132,16 @@ type private FSharpProjectOptionsReactor (workspace: VisualStudioWorkspace, sett else return Some(parsingOptions, projectOptions) } + + let tryGetProjectSite (project: Project) = + // Cps + if cpsCommandLineOptions.ContainsKey project.Id then + Some (mapCpsProjectToSite(project, cpsCommandLineOptions)) + else + // Legacy + match legacyProjectSites.TryGetValue project.Id with + | true, site -> Some site + | _ -> None let rec tryComputeOptions (project: Project) = async { @@ -183,15 +167,9 @@ type private FSharpProjectOptionsReactor (workspace: VisualStudioWorkspace, sett return None else - let hier = workspace.GetHierarchy(projectId) - let projectSite = - match hier with - // Legacy - | (:? IProvideProjectSite as provideSite) -> provideSite.GetProjectSite() - // Cps - | _ -> - let provideSite = mapCpsProjectToSite(workspace, project, serviceProvider, cpsCommandLineOptions) - provideSite.GetProjectSite() + match tryGetProjectSite project with + | None -> return None + | Some projectSite -> let otherOptions = project.ProjectReferences @@ -283,6 +261,7 @@ type private FSharpProjectOptionsReactor (workspace: VisualStudioWorkspace, sett | FSharpProjectOptionsMessage.ClearOptions(projectId) -> cache.Remove(projectId) |> ignore + legacyProjectSites.TryRemove(projectId) |> ignore | FSharpProjectOptionsMessage.ClearSingleFileOptionsCache(documentId) -> singleFileCache.Remove(documentId) |> ignore } @@ -304,6 +283,9 @@ type private FSharpProjectOptionsReactor (workspace: VisualStudioWorkspace, sett member __.SetCpsCommandLineOptions(projectId, sourcePaths, options) = cpsCommandLineOptions.[projectId] <- (sourcePaths, options) + member __.SetLegacyProjectSite (projectId, projectSite) = + legacyProjectSites.[projectId] <- projectSite + member __.TryGetCachedOptionsByProjectId(projectId) = match cache.TryGetValue(projectId) with | true, result -> Some(result) @@ -344,6 +326,9 @@ type internal FSharpProjectOptionsManager | _ -> () ) + member __.SetLegacyProjectSite (projectId, projectSite) = + reactor.SetLegacyProjectSite (projectId, projectSite) + /// Clear a project from the project table member this.ClearInfoForProject(projectId:ProjectId) = reactor.ClearOptionsByProjectId(projectId) diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LegacyProjectWorkspaceMap.fs b/vsintegration/src/FSharp.Editor/LanguageService/LegacyProjectWorkspaceMap.fs index 0bf2e5c806..426ecf9a5f 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LegacyProjectWorkspaceMap.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LegacyProjectWorkspaceMap.fs @@ -46,6 +46,8 @@ type internal LegacyProjectWorkspaceMap(solution: IVsSolution, let projectId = projectContext.Id + projectInfoManager.SetLegacyProjectSite (projectId, site) + // Sync the source files in projectContext. Note that these source files are __not__ maintained in order in projectContext // as edits are made. It seems this is ok because the source file list is only used to drive roslyn per-file checking. let updatedFiles = site.CompilationSourceFiles |> wellFormedFilePathSetIgnoreCase From b101514e4c8ef65d05aa10ca2fdc3d82e3c7460d Mon Sep 17 00:00:00 2001 From: ShalokShalom Date: Fri, 7 Jun 2019 01:04:58 +0200 Subject: [PATCH 089/159] Update DEVGUIDE.md (#6950) --- DEVGUIDE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEVGUIDE.md b/DEVGUIDE.md index ec1b03afe7..36f7f2d718 100644 --- a/DEVGUIDE.md +++ b/DEVGUIDE.md @@ -4,7 +4,7 @@ Get the latest source code from the master branch by running this git command: - git clone https://github.com/Microsoft/visualfsharp.git + git clone https://github.com/dotnet/fsharp.git Before running the build scripts, ensure that you have cleaned up the visualfsharp repo by running this git command: From e835edf083f03c325626fb656c356295c344a75b Mon Sep 17 00:00:00 2001 From: ShalokShalom Date: Fri, 7 Jun 2019 16:26:17 +0200 Subject: [PATCH 090/159] Update repo name (#6951) --- TESTGUIDE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TESTGUIDE.md b/TESTGUIDE.md index 80f51322d7..ef34e6f51b 100644 --- a/TESTGUIDE.md +++ b/TESTGUIDE.md @@ -10,7 +10,7 @@ To run tests, use variations such as the following, depending on which test suit build.cmd vs test build.cmd all test -You can also submit pull requests to http://github.com/Microsoft/visualfsharp and run the tests via continuous integration. Most people do wholesale testing that way. +You can also submit pull requests to https://github.com/dotnet/fsharp and run the tests via continuous integration. Most people do wholesale testing that way. ## Prerequisites From 49082d3e85cda3a2c7f435a102a50e859951442d Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Mon, 10 Jun 2019 14:30:46 -0700 Subject: [PATCH 091/159] Removing CONTRIBUTING.md (#6958) I think this document is outdated and duplicating too much information at this point. I also think most people don't read it or know it even exists. In an effort to simplify the amount of documents we either explicitly or implicitly expect people to read, I think this can be removed. --- CONTRIBUTING.md | 132 ------------------------------------------------ 1 file changed, 132 deletions(-) delete mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 5299179bd0..0000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,132 +0,0 @@ -## Contribution Guidelines - -The Visual F# team is proud to be a contributor to F#, and urge you to join in too. F# users and the F# community are grateful for all contributions to F#. - -Besides this overview, we recommend ["A journey into the F~ compiler"](https://skillsmatter.com/skillscasts/11629-a-journey-into-the-f-sharp-compiler/), a talk by Steffen Forkmann. -For those contributing to the core of the F# compiler, we recommend ["The F# Compiler Technical Overview"](http://fsharp.github.io/2015/09/29/fsharp-compiler-guide.html) - -### Getting Started - -- Install required software -- Clone the repo \ - `git clone https://github.com/microsoft/visualfsharp.git` -- Read how to build in [DEVGUIDE.md](DEVGUIDE.md) -- Read how to run tests in [TESTGUIDE.md](TESTGUIDE.md) - -### What to Contribute? - -There are several important ways that you can contribute. We are especially grateful for early feedback on in-development features, bug reports with repro steps, bug fixes with regression test cases, cross-platform expertise and changes, documentation updates, feature tests, suggestions, comments, and ideas. - -We initially solicit contributions for - -- compiler optimizations -- compiler performance improvements -- code generation improvements -- bug fixes (see the [issues list](https://github.com/microsoft/visualfsharp/issues)) -- library improvements -- F# language and library features - -New features are welcome, but be aware that Visual F# is a high-quality programming language with high-quality tools, and we wish to keep it that way. Before embarking on an extensive feature implementation, make a proposal in a GitHub issue or on the [F# Language Suggestions](https://github.com/fsharp/fslang-suggestions) so the community can review and comment on it. - -### Issues - -When submitting issues, please use the following guidelines - -- Suggestions for the F# Language and Core library should be added and reviewed at the [F# Language Suggestions](https://github.com/fsharp/fslang-suggestions). - -- Suggestions for the Visual F# Tools should be added and reviewed at the [Visual Studio F# Tools GitHub](https://github.com/microsoft/visualfsharp). - -- New Bug Reports should always give accurate, clear steps for reproducing the bug, and all relevant details about versions, platform, etc. We suggest the following template: - - Title: <a short, clear title> - - Description: <a description of the problem> - - Repro Steps: <step by step description> - - Expected: <what is expected> - - Actual: <what you really get> - - Severity: a description on how bad it is and why - is it blocking? - - Version: Language, compiler, library, platform version - - Link: Give a link to a ZIP, log files or other files if needed - - Likely Cause: Link to the place in the code where things are likely going wrong, if possible - - Workaround: List any known workarounds - -### CLA - -Contributors are required to sign a [Contribution License Agreement](https://cla.microsoft.com/) (CLA) before any pull requests will be considered. After submitting a request via the provided form, electronically sign the CLA when you receive the email containing the link to the document. This only needs to be done once for each Microsoft OSS project you contribute to. - -### Quality and Testing - -Contributions to this repository will be rigorously policed for quality. - -All code submissions should be submitted with regression test cases, and will be subject to peer review by the community and Microsoft. The bar for contributions will be high. This will result in a higher-quality, more stable product. - -- We expect contributors to be actively involved in quality assurance. -- Partial, incomplete, or poorly-tested contributions will not be accepted. -- Contributions may be put on hold according to stability, testing, and design-coherence requirements. - -#### Mimimum Bar for Code Cleanup Pull Requests - -In addition to the above, "Code Cleanup" pull requests have the following minimum requirements: - -- There must be no chance of a behavioural change, performance degradation or regression under any reasonable reading of the code in the context of the codebase as a whole. - -- Code cleanup which is unrelated to a bug fix or feature should generally be made separate to other checkins where possible. -- Code cleanup is much more likely to be accepted towards the start of a release cycle. - -#### Mimimum Bar for Performance Improvement Pull Requests - -Performance improvement checkins have the following minimum requirements (in addition to the above) - -- Performance tests and figures must be given, either in the PR or in the notes associated with the PR. PRs without performance figures will be closed with a polite request to please add them. - -- The PR must show a reliable, substantive performance improvement that justifies the complexity introduced. For the compiler, performance improvements of ~1% are of interest. For the core library, it will depend on the routine in question. For the Visual F# tools, reactivity of the user interface will be of more interest than raw CPU performance. - -- Performance improvements should not cause performance degradation in existing code. - -#### Mimimum Bar for Bug Fix Pull Requests - -Bug fix PRs have the following minimum requirements - -- There must be a separate tracking bug entry in the public GitHub issues. A link should be given in the PR. PRs without a matching bug link will be closed with a polite request to please add it. - -- The code changes must be reasonably minimal and as low-churn, non-intrusive as possible. Unrelated cleanup should be done in separate PRs (see above), and fixes should be as small as possible. Code cleanup that is part of making a clear and accurate fix is acceptable as part of a bug fix, but care should be taken that it doesn't obscure the fix itself. For example, renaming identifiers to be clearer in a way that would have avoided the original bug is acceptable, but care must still be taken that the actual fix is still apparent and reviewable in the overall diff for the fix. - -- Thorough test cases must be included in the PR (unless tests already exist for a failing case). PRs without matching tests will be closed with a polite request to please add the tests. However, if you need help adding tests, please note this in the description of the change and people will guide you through where to add the tests. - -- Bug fix PRs should not cause performance degradation in existing code. - -#### Mimimum Bar for Feature Pull Requests - -Feature PRs have the following minimum requirements: - -- For F# Language and Library features, include a link to the [F# Language Suggestions](https://github.com/fsharp/fslang-suggestions) issue - -- For Visual F# Tools features, include a link to the [Visual F# Tools](https://github.com/microsoft/visualfsharp) issue for the feature. - -- For F# Library features, if you have made additions to the FSharp.Core library public surface area, update [the SurfaceArea tests](https://github.com/Microsoft/visualfsharp/tree/fsharp4/tests/FSharp.Core.UnitTests). - -- For F# Language and Library features, you will be asked to submit a speclet for the feature to the [F# Language Design](https://github.com/fsharp/fslang-design) GitHub repository of speclets. In some cases you will only need to do this after your feature is accepted, but for more complex features you may be asked to do this during the review of the feature. - -- Language feature implementations must take into account the expectations of typical users about the performance - impact of using the feature. For example, we should avoid the situation where using an optional language feature - which appears benign to a typical user has a large negative performance impact on code. - -- Language feature implementations should not cause performance degradation in existing code. - -### Language Evolution - -We are committed to carefully managing the evolution of the F# language. - -We actively solicit contributions related to the F# language design, but the process for handling these differs substantially from other kinds of contributions. Significant language and library change should be suggested and reviewed at the [F# Language Suggestions](https://github.com/fsharp/fslang-suggestions) repository. - -### Coding guidelines - -Although there is currently no strict set of coding or style guidelines, use common sense when contributing code - make an effort to use a similar style to nearby existing code. If you have a passion for helping us develop a set of coding guidelines that we can roll out and apply within this project, get involved and start a discussion issue. From 832f2c0412cf6bc698a1066125ce7dd7d86e97fc Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Tue, 11 Jun 2019 02:14:05 -0700 Subject: [PATCH 092/159] Remove IVT to FSharp.Build (#6970) I'm feeling spicy, so I'm doing this with GitHub's web UI. --- .../FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj | 1 - 1 file changed, 1 deletion(-) diff --git a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj index 1dfee65140..411e269504 100644 --- a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj +++ b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj @@ -40,7 +40,6 @@ - From 8e0565f594c0f25b63620b92f81c8612762cdf6f Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Tue, 11 Jun 2019 14:43:09 +0300 Subject: [PATCH 093/159] Don't stop type checking recursive module on unresolved open (#6965) Thank you --- src/fsharp/TypeChecker.fs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index a2ffbcf172..824cb2ac20 100644 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -12545,15 +12545,18 @@ let TcTyconMemberSpecs cenv env containerInfo declKind tpenv (augSpfn: SynMember let TcModuleOrNamespaceLidAndPermitAutoResolve tcSink env amap (longId: Ident list) = let ad = env.eAccessRights 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 + | Result res -> res + | Exception err -> + errorR(err); [] let TcOpenDecl tcSink (g: TcGlobals) amap m scopem env (longId: Ident list) = - let modrefs = ForceRaise (TcModuleOrNamespaceLidAndPermitAutoResolve tcSink env amap longId) + match TcModuleOrNamespaceLidAndPermitAutoResolve tcSink env amap longId with + | [] -> env + | modrefs -> // validate opened namespace names for id in longId do From e55650818551825cd387169af3353484ed9ba73a Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Tue, 11 Jun 2019 09:00:32 -0700 Subject: [PATCH 094/159] Remove IVT to fsi from FSharp.Compiler.Private (#6957) * Remove IVT to fsi from FSharp.Compiler.Private * Save the out stream * Remove IVT to fsianycpu --- .../FSharp.Compiler.Private.fsproj | 2 -- src/fsharp/fsc.fs | 8 +++++++- src/fsharp/fsi/console.fs | 1 - src/fsharp/fsi/fsimain.fs | 12 ++++++++---- src/fsharp/lib.fs | 9 --------- 5 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj index 411e269504..2a4a221870 100644 --- a/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj +++ b/src/fsharp/FSharp.Compiler.Private/FSharp.Compiler.Private.fsproj @@ -40,8 +40,6 @@ - - diff --git a/src/fsharp/fsc.fs b/src/fsharp/fsc.fs index 2715098473..e4e693e99c 100644 --- a/src/fsharp/fsc.fs +++ b/src/fsharp/fsc.fs @@ -2176,7 +2176,13 @@ let typecheckAndCompile defaultCopyFSharpCore, exiter: Exiter, errorLoggerProvider, tcImportsCapture, dynamicAssemblyCreator) = use d = new DisposablesTracker() - use e = new SaveAndRestoreConsoleEncoding() + let savedOut = System.Console.Out + use __ = + { new IDisposable with + member __.Dispose() = + try + System.Console.SetOut(savedOut) + with _ -> ()} main0(ctok, argv, legacyReferenceResolver, bannerAlreadyPrinted, reduceMemoryUsage, defaultCopyFSharpCore, exiter, errorLoggerProvider, d) |> main1 diff --git a/src/fsharp/fsi/console.fs b/src/fsharp/fsi/console.fs index aa57916df5..1ac792abc1 100644 --- a/src/fsharp/fsi/console.fs +++ b/src/fsharp/fsi/console.fs @@ -5,7 +5,6 @@ namespace FSharp.Compiler.Interactive open System open System.Text open System.Collections.Generic -open Internal.Utilities /// System.Console.ReadKey appears to return an ANSI character (not the expected the unicode character). /// When this fix flag is true, this byte is converted to a char using the System.Console.InputEncoding. diff --git a/src/fsharp/fsi/fsimain.fs b/src/fsharp/fsi/fsimain.fs index b49bea9630..c127642db7 100644 --- a/src/fsharp/fsi/fsimain.fs +++ b/src/fsharp/fsi/fsimain.fs @@ -22,10 +22,8 @@ open System.Windows.Forms #endif open FSharp.Compiler -open FSharp.Compiler.AbstractIL -open FSharp.Compiler.Lib +open FSharp.Compiler.AbstractIL open FSharp.Compiler.Interactive.Shell -open FSharp.Compiler.Interactive open FSharp.Compiler.Interactive.Shell.Settings #nowarn "55" @@ -316,7 +314,13 @@ let evaluateSession(argv: string[]) = let MainMain argv = ignore argv let argv = System.Environment.GetCommandLineArgs() - use e = new SaveAndRestoreConsoleEncoding() + let savedOut = Console.Out + use __ = + { new IDisposable with + member __.Dispose() = + try + Console.SetOut(savedOut) + with _ -> ()} #if !FX_NO_APP_DOMAINS let timesFlag = argv |> Array.exists (fun x -> x = "/times" || x = "--times") diff --git a/src/fsharp/lib.fs b/src/fsharp/lib.fs index f121639005..e7eaf9543f 100755 --- a/src/fsharp/lib.fs +++ b/src/fsharp/lib.fs @@ -23,15 +23,6 @@ let GetEnvInteger e dflt = match System.Environment.GetEnvironmentVariable(e) wi let dispose (x:System.IDisposable) = match x with null -> () | x -> x.Dispose() -type SaveAndRestoreConsoleEncoding () = - let savedOut = System.Console.Out - - interface System.IDisposable with - member this.Dispose() = - try - System.Console.SetOut(savedOut) - with _ -> () - //------------------------------------------------------------------------- // Library: bits //------------------------------------------------------------------------ From a4cbfe1ad1c6f7cf93366b173ff6413554cdfb7c Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Tue, 11 Jun 2019 13:45:06 -0700 Subject: [PATCH 095/159] enable preview LSP support in VS (#6945) * enable preview LSP support Includes plumbing and a stub for `textDocument/hover` (e.g., QuickInfo). * enable easy exclusion of the language server from VS components * Update src/fsharp/FSharp.Compiler.LanguageServer/TextDocument.fs Co-Authored-By: Phillip Carter --- VisualFSharp.sln | 15 ++++ eng/Signing.props | 8 ++ eng/Versions.props | 3 +- eng/targets/Settings.props | 4 + .../FSharp.Compiler.LanguageServer.fsproj | 20 ++++- .../JsonDUConverter.fs | 18 +++++ .../JsonOptionConverter.fs | 27 +++++++ .../LspExternalAccess.fs | 22 +++++ .../LspTypes.fs | 36 ++++++--- .../FSharp.Compiler.LanguageServer/Methods.fs | 61 ++++++++++++-- .../FSharp.Compiler.LanguageServer/Server.fs | 7 +- .../FSharp.Compiler.LanguageServer/State.fs | 14 ++++ .../TextDocument.fs | 29 +++---- ...p.Compiler.LanguageServer.UnitTests.fsproj | 1 + .../ProtocolTests.fs | 29 +++++-- .../SerializationTests.fs | 33 ++++++++ .../Source.extension.vsixmanifest | 2 + .../VisualFSharpFull/VisualFSharpFull.csproj | 34 ++++++-- .../FSharp.Editor.Helpers.csproj | 22 +++++ .../FSharp.Editor.Helpers/LanguageClient.cs | 46 +++++++++++ .../src/FSharp.Editor/Common/Constants.fs | 4 + .../src/FSharp.Editor/Common/LspService.fs | 28 +++++++ .../src/FSharp.Editor/FSharp.Editor.fsproj | 11 +++ .../LanguageService/FSharpLanguageClient.fs | 68 ++++++++++++++++ .../FSharp.Editor/Options/EditorOptions.fs | 20 ++++- .../src/FSharp.Editor/Options/UIHelpers.fs | 4 + .../QuickInfo/QuickInfoProvider.fs | 11 ++- .../FSharp.PropertiesPages.vbproj | 80 +++++-------------- .../AdvancedOptionsControl.xaml | 4 + .../FSharp.UIResources/Strings.Designer.cs | 18 +++++ .../src/FSharp.UIResources/Strings.resx | 6 ++ .../src/FSharp.UIResources/xlf/Strings.cs.xlf | 10 +++ .../src/FSharp.UIResources/xlf/Strings.de.xlf | 10 +++ .../src/FSharp.UIResources/xlf/Strings.es.xlf | 10 +++ .../src/FSharp.UIResources/xlf/Strings.fr.xlf | 10 +++ .../src/FSharp.UIResources/xlf/Strings.it.xlf | 10 +++ .../src/FSharp.UIResources/xlf/Strings.ja.xlf | 10 +++ .../src/FSharp.UIResources/xlf/Strings.ko.xlf | 10 +++ .../src/FSharp.UIResources/xlf/Strings.pl.xlf | 10 +++ .../FSharp.UIResources/xlf/Strings.pt-BR.xlf | 10 +++ .../src/FSharp.UIResources/xlf/Strings.ru.xlf | 10 +++ .../src/FSharp.UIResources/xlf/Strings.tr.xlf | 10 +++ .../xlf/Strings.zh-Hans.xlf | 10 +++ .../xlf/Strings.zh-Hant.xlf | 10 +++ 44 files changed, 698 insertions(+), 117 deletions(-) create mode 100644 eng/Signing.props create mode 100644 src/fsharp/FSharp.Compiler.LanguageServer/JsonDUConverter.fs create mode 100644 src/fsharp/FSharp.Compiler.LanguageServer/JsonOptionConverter.fs create mode 100644 src/fsharp/FSharp.Compiler.LanguageServer/LspExternalAccess.fs create mode 100644 tests/FSharp.Compiler.LanguageServer.UnitTests/SerializationTests.fs create mode 100644 vsintegration/src/FSharp.Editor.Helpers/FSharp.Editor.Helpers.csproj create mode 100644 vsintegration/src/FSharp.Editor.Helpers/LanguageClient.cs create mode 100644 vsintegration/src/FSharp.Editor/Common/LspService.fs create mode 100644 vsintegration/src/FSharp.Editor/LanguageService/FSharpLanguageClient.fs diff --git a/VisualFSharp.sln b/VisualFSharp.sln index 3df52bb473..4a1e75f446 100644 --- a/VisualFSharp.sln +++ b/VisualFSharp.sln @@ -158,6 +158,8 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.LanguageSer EndProject Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.LanguageServer.UnitTests", "tests\FSharp.Compiler.LanguageServer.UnitTests\FSharp.Compiler.LanguageServer.UnitTests.fsproj", "{AAF2D233-1C38-4090-8FFA-F7C545625E06}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FSharp.Editor.Helpers", "vsintegration\src\FSharp.Editor.Helpers\FSharp.Editor.Helpers.csproj", "{79255A92-ED00-40BA-9D64-12FCC664A976}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -912,6 +914,18 @@ Global {AAF2D233-1C38-4090-8FFA-F7C545625E06}.Release|Any CPU.Build.0 = Release|Any CPU {AAF2D233-1C38-4090-8FFA-F7C545625E06}.Release|x86.ActiveCfg = Release|Any CPU {AAF2D233-1C38-4090-8FFA-F7C545625E06}.Release|x86.Build.0 = Release|Any CPU + {79255A92-ED00-40BA-9D64-12FCC664A976}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {79255A92-ED00-40BA-9D64-12FCC664A976}.Debug|Any CPU.Build.0 = Debug|Any CPU + {79255A92-ED00-40BA-9D64-12FCC664A976}.Debug|x86.ActiveCfg = Debug|Any CPU + {79255A92-ED00-40BA-9D64-12FCC664A976}.Debug|x86.Build.0 = Debug|Any CPU + {79255A92-ED00-40BA-9D64-12FCC664A976}.Proto|Any CPU.ActiveCfg = Release|Any CPU + {79255A92-ED00-40BA-9D64-12FCC664A976}.Proto|Any CPU.Build.0 = Release|Any CPU + {79255A92-ED00-40BA-9D64-12FCC664A976}.Proto|x86.ActiveCfg = Release|Any CPU + {79255A92-ED00-40BA-9D64-12FCC664A976}.Proto|x86.Build.0 = Release|Any CPU + {79255A92-ED00-40BA-9D64-12FCC664A976}.Release|Any CPU.ActiveCfg = Release|Any CPU + {79255A92-ED00-40BA-9D64-12FCC664A976}.Release|Any CPU.Build.0 = Release|Any CPU + {79255A92-ED00-40BA-9D64-12FCC664A976}.Release|x86.ActiveCfg = Release|Any CPU + {79255A92-ED00-40BA-9D64-12FCC664A976}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -986,6 +1000,7 @@ Global {8EC30B2E-F1F9-4A98-BBB5-DD0CF6C84DDC} = {647810D0-5307-448F-99A2-E83917010DAE} {60BAFFA5-6631-4328-B044-2E012AB76DCA} = {B8DDA694-7939-42E3-95E5-265C2217C142} {AAF2D233-1C38-4090-8FFA-F7C545625E06} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449} + {79255A92-ED00-40BA-9D64-12FCC664A976} = {4C7B48D7-19AF-4AE7-9D1D-3BB289D5480D} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {48EDBBBE-C8EE-4E3C-8B19-97184A487B37} diff --git a/eng/Signing.props b/eng/Signing.props new file mode 100644 index 0000000000..da17d32fa4 --- /dev/null +++ b/eng/Signing.props @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/eng/Versions.props b/eng/Versions.props index d288bf98a9..e4ae8526a0 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -92,7 +92,7 @@ 4.3.0 4.3.0 4.3.0 - 4.4.0 + 4.5.0 $(RoslynVersion) $(RoslynVersion) @@ -115,6 +115,7 @@ 16.0.467 16.0.28727 16.0.28729 + 16.1.3121 16.0.467 16.0.467 16.0.467 diff --git a/eng/targets/Settings.props b/eng/targets/Settings.props index ae7833a18b..5d145af11c 100644 --- a/eng/targets/Settings.props +++ b/eng/targets/Settings.props @@ -7,4 +7,8 @@ $(ArtifactsBinDir) + + true + + diff --git a/src/fsharp/FSharp.Compiler.LanguageServer/FSharp.Compiler.LanguageServer.fsproj b/src/fsharp/FSharp.Compiler.LanguageServer/FSharp.Compiler.LanguageServer.fsproj index 1e0ca2f912..3180a0a52f 100644 --- a/src/fsharp/FSharp.Compiler.LanguageServer/FSharp.Compiler.LanguageServer.fsproj +++ b/src/fsharp/FSharp.Compiler.LanguageServer/FSharp.Compiler.LanguageServer.fsproj @@ -11,8 +11,11 @@ - + + + + @@ -28,4 +31,19 @@ + + + <_PublishedProjectOutputGroupFiles Include="$(PublishDir)\**" /> + + + + + + + + + diff --git a/src/fsharp/FSharp.Compiler.LanguageServer/JsonDUConverter.fs b/src/fsharp/FSharp.Compiler.LanguageServer/JsonDUConverter.fs new file mode 100644 index 0000000000..ae8575195d --- /dev/null +++ b/src/fsharp/FSharp.Compiler.LanguageServer/JsonDUConverter.fs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.LanguageServer + +open System +open FSharp.Reflection +open Newtonsoft.Json + +type JsonDUConverter() = + inherit JsonConverter() + override __.CanConvert(typ) = FSharpType.IsUnion(typ) + override __.WriteJson(writer, value, _serializer) = + writer.WriteValue(value.ToString().ToLowerInvariant()) + override __.ReadJson(reader, typ, x, serializer) = + let cases = FSharpType.GetUnionCases(typ) + let str = serializer.Deserialize(reader, typeof) :?> string + let case = cases |> Array.find (fun c -> String.Compare(c.Name, str, StringComparison.OrdinalIgnoreCase) = 0) + FSharpValue.MakeUnion(case, [||]) diff --git a/src/fsharp/FSharp.Compiler.LanguageServer/JsonOptionConverter.fs b/src/fsharp/FSharp.Compiler.LanguageServer/JsonOptionConverter.fs new file mode 100644 index 0000000000..937dda00e4 --- /dev/null +++ b/src/fsharp/FSharp.Compiler.LanguageServer/JsonOptionConverter.fs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.LanguageServer + +open System +open FSharp.Reflection +open Newtonsoft.Json + +type JsonOptionConverter() = + inherit JsonConverter() + override __.CanConvert(typ) = typ.IsGenericType && typ.GetGenericTypeDefinition() = typedefof> + override __.WriteJson(writer, value, serializer) = + let value = match value with + | null -> null + | _ -> + let _, fields = FSharpValue.GetUnionFields(value, value.GetType()) + fields.[0] + serializer.Serialize(writer, value) + override __.ReadJson(reader, typ, _, serializer) = + let innerType = typ.GetGenericArguments().[0] + let innerType = + if innerType.IsValueType then (typedefof>).MakeGenericType([|innerType|]) + else innerType + let value = serializer.Deserialize(reader, innerType) + let cases = FSharpType.GetUnionCases(typ) + if value = null then FSharpValue.MakeUnion(cases.[0], [||]) + else FSharpValue.MakeUnion(cases.[1], [|value|]) diff --git a/src/fsharp/FSharp.Compiler.LanguageServer/LspExternalAccess.fs b/src/fsharp/FSharp.Compiler.LanguageServer/LspExternalAccess.fs new file mode 100644 index 0000000000..e6fa760d1c --- /dev/null +++ b/src/fsharp/FSharp.Compiler.LanguageServer/LspExternalAccess.fs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.LanguageServer + +open StreamJsonRpc + +[] +module FunctionNames = + [] + let OptionsSet = "options/set" + +type Options = + { usePreviewTextHover: bool } + static member Default() = + { usePreviewTextHover = false } + +module Extensions = + type JsonRpc with + member jsonRpc.SetOptionsAsync (options: Options) = + async { + do! jsonRpc.InvokeAsync(OptionsSet, options) |> Async.AwaitTask + } diff --git a/src/fsharp/FSharp.Compiler.LanguageServer/LspTypes.fs b/src/fsharp/FSharp.Compiler.LanguageServer/LspTypes.fs index 7a919bc74d..97479eef26 100644 --- a/src/fsharp/FSharp.Compiler.LanguageServer/LspTypes.fs +++ b/src/fsharp/FSharp.Compiler.LanguageServer/LspTypes.fs @@ -2,8 +2,11 @@ namespace FSharp.Compiler.LanguageServer -// Interfaces as defined at https://microsoft.github.io/language-server-protocol/specification. The properties on these -// types are camlCased to match the underlying JSON properties to avoid attributes on every field: +open Newtonsoft.Json.Linq +open Newtonsoft.Json + +// Interfaces as defined at https://microsoft.github.io/language-server-protocol/specification. The properties on +// these types are camlCased to match the underlying JSON properties to avoid attributes on every field: // [] /// Represents a zero-based line and column of a text document. @@ -27,11 +30,11 @@ type DiagnosticRelatedInformation = type Diagnostic = { range: Range - severity: int + severity: int option code: string - source: string // "F#" + source: string option // "F#" message: string - relatedInformation: DiagnosticRelatedInformation[] } + relatedInformation: DiagnosticRelatedInformation[] option } static member Error = 1 static member Warning = 2 static member Information = 3 @@ -41,9 +44,23 @@ type PublishDiagnosticsParams = { uri: DocumentUri diagnostics: Diagnostic[] } -type InitializeParams = string // TODO: +type ClientCapabilities = + { workspace: JToken option // TODO: WorkspaceClientCapabilities + textDocument: JToken option // TODO: TextDocumentCapabilities + experimental: JToken option + supportsVisualStudioExtensions: bool option } + +[)>] +type Trace = + | Off + | Messages + | Verbose -// Note, this type has many more optional values that can be expanded as support is added. +type WorkspaceFolder = + { uri: DocumentUri + name: string } + +/// Note, this type has many more optional values that can be expanded as support is added. type ServerCapabilities = { hoverProvider: bool } static member DefaultCapabilities() = @@ -52,6 +69,7 @@ type ServerCapabilities = type InitializeResult = { capabilities: ServerCapabilities } +[)>] type MarkupKind = | PlainText | Markdown @@ -66,7 +84,3 @@ type Hover = type TextDocumentIdentifier = { uri: DocumentUri } - -type TextDocumentPositionParams = - { textDocument: TextDocumentIdentifier - position: Position } diff --git a/src/fsharp/FSharp.Compiler.LanguageServer/Methods.fs b/src/fsharp/FSharp.Compiler.LanguageServer/Methods.fs index 80e06e9781..d1e614cb29 100644 --- a/src/fsharp/FSharp.Compiler.LanguageServer/Methods.fs +++ b/src/fsharp/FSharp.Compiler.LanguageServer/Methods.fs @@ -2,21 +2,66 @@ namespace FSharp.Compiler.LanguageServer +open System +open System.Runtime.InteropServices +open System.Threading +open Newtonsoft.Json.Linq open StreamJsonRpc // https://microsoft.github.io/language-server-protocol/specification type Methods(state: State) = + /// Helper to run Async<'T> with a CancellationToken. + let runAsync (cancellationToken: CancellationToken) (computation: Async<'T>) = Async.StartAsTask(computation, cancellationToken=cancellationToken) + + member __.State = state + + //-------------------------------------------------------------------------- + // official LSP methods + //-------------------------------------------------------------------------- + [] - member __.Initialize (args: InitializeParams) = - async { - // note, it's important that this method is `async` because unit tests can then properly verify that the - // JSON RPC handling of async methods is correct - return ServerCapabilities.DefaultCapabilities() - } |> Async.StartAsTask + member __.Initialize + ( + processId: Nullable, + [] rootPath: string, + [] rootUri: DocumentUri, + [] initializationOptions: JToken, + capabilities: ClientCapabilities, + [] trace: string, + [] workspaceFolders: WorkspaceFolder[] + ) = + { InitializeResult.capabilities = ServerCapabilities.DefaultCapabilities() } + + [] + member __.Initialized () = () [] - member __.Shutdown() = state.DoShutdown() + member __.Shutdown(): obj = state.DoShutdown(); null + + [] + member __.Exit() = state.DoExit() + + [] + member __.cancelRequest (id: JToken) = state.DoCancel() [] - member __.TextDocumentHover (args: TextDocumentPositionParams) = TextDocument.Hover(state, args) |> Async.StartAsTask + member __.TextDocumentHover + ( + textDocument: TextDocumentIdentifier, + position: Position, + [] cancellationToken: CancellationToken + ) = + TextDocument.Hover state textDocument position |> runAsync cancellationToken + + //-------------------------------------------------------------------------- + // unofficial LSP methods that we implement separately + //-------------------------------------------------------------------------- + + [] + member __.OptionsSet + ( + options: Options + ) = + sprintf "got options %A" options |> Console.Error.WriteLine + state.Options <- options diff --git a/src/fsharp/FSharp.Compiler.LanguageServer/Server.fs b/src/fsharp/FSharp.Compiler.LanguageServer/Server.fs index 87f6d1c2ff..071ad6b226 100644 --- a/src/fsharp/FSharp.Compiler.LanguageServer/Server.fs +++ b/src/fsharp/FSharp.Compiler.LanguageServer/Server.fs @@ -8,9 +8,13 @@ open StreamJsonRpc type Server(sendingStream: Stream, receivingStream: Stream) = + let formatter = JsonMessageFormatter() + let converter = JsonOptionConverter() // special handler to convert between `Option<'T>` and `obj/null`. + do formatter.JsonSerializer.Converters.Add(converter) + let handler = new HeaderDelimitedMessageHandler(sendingStream, receivingStream, formatter) let state = State() let methods = Methods(state) - let rpc = new JsonRpc(sendingStream, receivingStream, methods) + let rpc = new JsonRpc(handler, methods) member __.StartListening() = rpc.StartListening() @@ -18,6 +22,7 @@ type Server(sendingStream: Stream, receivingStream: Stream) = member __.WaitForExitAsync() = async { do! Async.AwaitEvent (state.Shutdown) + do! Async.AwaitEvent (state.Exit) } interface IDisposable with diff --git a/src/fsharp/FSharp.Compiler.LanguageServer/State.fs b/src/fsharp/FSharp.Compiler.LanguageServer/State.fs index 53cacbb8c0..5ca2d3f845 100644 --- a/src/fsharp/FSharp.Compiler.LanguageServer/State.fs +++ b/src/fsharp/FSharp.Compiler.LanguageServer/State.fs @@ -5,8 +5,22 @@ namespace FSharp.Compiler.LanguageServer type State() = let shutdownEvent = new Event<_>() + let exitEvent = new Event<_>() + let cancelEvent = new Event<_>() [] member __.Shutdown = shutdownEvent.Publish + [] + member __.Exit = exitEvent.Publish + + [] + member __.Cancel = cancelEvent.Publish + member __.DoShutdown() = shutdownEvent.Trigger() + + member __.DoExit() = exitEvent.Trigger() + + member __.DoCancel() = cancelEvent.Trigger() + + member val Options = Options.Default() with get, set diff --git a/src/fsharp/FSharp.Compiler.LanguageServer/TextDocument.fs b/src/fsharp/FSharp.Compiler.LanguageServer/TextDocument.fs index eef57581c5..0c73796505 100644 --- a/src/fsharp/FSharp.Compiler.LanguageServer/TextDocument.fs +++ b/src/fsharp/FSharp.Compiler.LanguageServer/TextDocument.fs @@ -2,26 +2,23 @@ namespace FSharp.Compiler.LanguageServer +open System + module TextDocument = - let Hover(state: State, args: TextDocumentPositionParams) = + let Hover (state: State) (textDocument: TextDocumentIdentifier) (position: Position) = async { - return { - Hover.contents = { - MarkupContent.kind = MarkupKind.PlainText - value = "TODO" + Console.Error.WriteLine("hover at " + position.line.ToString() + "," + position.character.ToString()) + if not state.Options.usePreviewTextHover then return None + else + let startCol, endCol = + if position.character = 0 then 0, 1 + else position.character, position.character + 1 + return Some { contents = { kind = MarkupKind.PlainText + value = "serving textDocument/hover from LSP" } + range = Some { start = { line = position.line; character = startCol } + ``end`` = { line = position.line; character = endCol } } } - range = Some({ - Range.start = { - Position.line = 0 - character = 0 - } - ``end`` = { - Position.line = 0 - character = 0 - } - }) - } } let PublishDiagnostics(state: State) = diff --git a/tests/FSharp.Compiler.LanguageServer.UnitTests/FSharp.Compiler.LanguageServer.UnitTests.fsproj b/tests/FSharp.Compiler.LanguageServer.UnitTests/FSharp.Compiler.LanguageServer.UnitTests.fsproj index a5e8bdf326..78c2689eb2 100644 --- a/tests/FSharp.Compiler.LanguageServer.UnitTests/FSharp.Compiler.LanguageServer.UnitTests.fsproj +++ b/tests/FSharp.Compiler.LanguageServer.UnitTests/FSharp.Compiler.LanguageServer.UnitTests.fsproj @@ -11,6 +11,7 @@ + diff --git a/tests/FSharp.Compiler.LanguageServer.UnitTests/ProtocolTests.fs b/tests/FSharp.Compiler.LanguageServer.UnitTests/ProtocolTests.fs index 75c6e15cee..4d0a789b9c 100644 --- a/tests/FSharp.Compiler.LanguageServer.UnitTests/ProtocolTests.fs +++ b/tests/FSharp.Compiler.LanguageServer.UnitTests/ProtocolTests.fs @@ -26,15 +26,34 @@ type ProtocolTests() = startInfo.RedirectStandardOutput <- true let proc = Process.Start(startInfo) - // create a fake client + // create a fake client over stdin/stdout let client = new JsonRpc(proc.StandardInput.BaseStream, proc.StandardOutput.BaseStream) client.StartListening() // initialize - let! capabilitites = client.InvokeAsync("initialize", "") |> Async.AwaitTask - Assert.True(capabilitites.hoverProvider) + let capabilities = + { ClientCapabilities.workspace = None + textDocument = None + experimental = None + supportsVisualStudioExtensions = None } + let! result = + client.InvokeAsync( + "initialize", // method + 0, // processId + "rootPath", + "rootUri", + null, // initializationOptions + capabilities, // client capabilities + "none") // trace + |> Async.AwaitTask + Assert.True(result.capabilities.hoverProvider) + do! client.NotifyAsync("initialized") |> Async.AwaitTask - // shutdown the server - do! client.NotifyAsync("shutdown") |> Async.AwaitTask + // shutdown + let! shutdownResponse = client.InvokeAsync("shutdown") |> Async.AwaitTask + Assert.IsNull(shutdownResponse) + + // exit + do! client.NotifyAsync("exit") |> Async.AwaitTask if not (proc.WaitForExit(5000)) then failwith "Expected server process to exit." } |> Async.StartAsTask :> Task diff --git a/tests/FSharp.Compiler.LanguageServer.UnitTests/SerializationTests.fs b/tests/FSharp.Compiler.LanguageServer.UnitTests/SerializationTests.fs new file mode 100644 index 0000000000..5d8457c4e5 --- /dev/null +++ b/tests/FSharp.Compiler.LanguageServer.UnitTests/SerializationTests.fs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.LanguageServer.UnitTests + +open System +open FSharp.Compiler.LanguageServer +open NUnit.Framework +open Newtonsoft.Json + +[] +type SerializationTests() = + + let verifyRoundTrip (str: string) (typ: Type) = + let deserialized = JsonConvert.DeserializeObject(str, typ) + let roundTripped = JsonConvert.SerializeObject(deserialized) + Assert.AreEqual(str, roundTripped) + + let verifyRoundTripWithConverter (str: string) (typ: Type) (converter: JsonConverter) = + let deserialized = JsonConvert.DeserializeObject(str, typ, converter) + let roundTripped = JsonConvert.SerializeObject(deserialized, converter) + Assert.AreEqual(str, roundTripped) + + [] + member __.``Discriminated union as lower-case string``() = + verifyRoundTrip "\"plaintext\"" typeof + verifyRoundTrip "\"markdown\"" typeof + + [] + member __.``Option<'T> as obj/null``() = + verifyRoundTripWithConverter "1" typeof> (JsonOptionConverter()) + verifyRoundTripWithConverter "null" typeof> (JsonOptionConverter()) + verifyRoundTripWithConverter "{\"contents\":{\"kind\":\"plaintext\",\"value\":\"v\"},\"range\":{\"start\":{\"line\":1,\"character\":2},\"end\":{\"line\":3,\"character\":4}}}" typeof> (JsonOptionConverter()) + verifyRoundTripWithConverter "null" typeof> (JsonOptionConverter()) diff --git a/vsintegration/Vsix/VisualFSharpFull/Source.extension.vsixmanifest b/vsintegration/Vsix/VisualFSharpFull/Source.extension.vsixmanifest index 075855a061..e272923a3d 100644 --- a/vsintegration/Vsix/VisualFSharpFull/Source.extension.vsixmanifest +++ b/vsintegration/Vsix/VisualFSharpFull/Source.extension.vsixmanifest @@ -20,6 +20,7 @@ + @@ -27,6 +28,7 @@ + diff --git a/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj b/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj index cfe668403c..68b8b5e112 100644 --- a/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj +++ b/vsintegration/Vsix/VisualFSharpFull/VisualFSharpFull.csproj @@ -7,6 +7,7 @@ Microsoft\FSharp netcoreapp1.0 true + net472 @@ -40,7 +41,7 @@ All 2 True - TargetFramework=net472 + TargetFramework=$(DependencyTargetFramework) {649FA588-F02E-457C-9FCF-87E46407481E} @@ -51,7 +52,15 @@ All 2 True - TargetFramework=net472 + TargetFramework=$(DependencyTargetFramework) + + + {60BAFFA5-6631-4328-B044-2E012AB76DCA} + FSharp.Compiler.LanguageServer + PublishedProjectOutputGroup%3b + false + Build;Publish + TargetFramework=$(DependencyTargetFramework) {D5870CF0-ED51-4CBC-B3D7-6F56DA84AC06} @@ -62,7 +71,7 @@ All 2 True - TargetFramework=net472 + TargetFramework=$(DependencyTargetFramework) {2E4D67B4-522D-4CF7-97E4-BA940F0B18F3} @@ -73,7 +82,7 @@ All 2 True - TargetFramework=net472 + TargetFramework=$(DependencyTargetFramework) {DED3BBD7-53F4-428A-8C9F-27968E768605} @@ -96,7 +105,7 @@ X64 2 True - TargetFramework=net472 + TargetFramework=$(DependencyTargetFramework) {D0E98C0D-490B-4C61-9329-0862F6E87645} @@ -108,7 +117,7 @@ X86 2 True - TargetFramework=net472 + TargetFramework=$(DependencyTargetFramework) {C94C257C-3C0A-4858-B5D8-D746498D1F08} @@ -120,7 +129,7 @@ All 2 True - TargetFramework=net472 + TargetFramework=$(DependencyTargetFramework) {65e0e82a-eace-4787-8994-888674c2fe87} @@ -132,6 +141,16 @@ 2 True + + {0A3099F1-F0C7-4ADE-AB9B-526EF193A56F} + FSharp.Editor.Helpers + BuiltProjectOutputGroup%3bGetCopyToOutputDirectoryItems%3bPkgDefProjectOutputGroup%3bSatelliteDllsProjectOutputGroup%3b + DebugSymbolsProjectOutputGroup%3b + true + All + 2 + True + {c4586a06-1402-48bc-8e35-a1b8642f895b} FSharp.UIResources @@ -259,6 +278,7 @@ + diff --git a/vsintegration/src/FSharp.Editor.Helpers/FSharp.Editor.Helpers.csproj b/vsintegration/src/FSharp.Editor.Helpers/FSharp.Editor.Helpers.csproj new file mode 100644 index 0000000000..cb6cfb36cb --- /dev/null +++ b/vsintegration/src/FSharp.Editor.Helpers/FSharp.Editor.Helpers.csproj @@ -0,0 +1,22 @@ + + + + Library + net472 + + + + + + + + + + + FSharp.Editor.Helpers + $(VSAssemblyVersion) + $PackageFolder$\FSharp.Editor.Helpers.dll + + + + diff --git a/vsintegration/src/FSharp.Editor.Helpers/LanguageClient.cs b/vsintegration/src/FSharp.Editor.Helpers/LanguageClient.cs new file mode 100644 index 0000000000..87759ceef7 --- /dev/null +++ b/vsintegration/src/FSharp.Editor.Helpers/LanguageClient.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.LanguageServer.Client; +using Microsoft.VisualStudio.Threading; + +namespace Microsoft.VisualStudio.FSharp.Editor.Helpers +{ + /// + /// Exists as an abstract implementor of purely to manage the non-standard async + /// event handlers. + /// + public abstract class LanguageClient : ILanguageClient + { + public abstract string Name { get; } + + public abstract IEnumerable ConfigurationSections { get; } + + public abstract object InitializationOptions { get; } + + public abstract IEnumerable FilesToWatch { get; } + + public event AsyncEventHandler StartAsync; + +#pragma warning disable 67 // The event 'LanguageClient.StopAsync' is never used + public event AsyncEventHandler StopAsync; +#pragma warning restore 67 + + public abstract Task ActivateAsync(CancellationToken token); + + protected abstract Task DoLoadAsync(); + + public async Task OnLoadedAsync() + { + await DoLoadAsync(); + await StartAsync.InvokeAsync(this, EventArgs.Empty); + } + + public abstract Task OnServerInitializeFailedAsync(Exception e); + + public abstract Task OnServerInitializedAsync(); + } +} diff --git a/vsintegration/src/FSharp.Editor/Common/Constants.fs b/vsintegration/src/FSharp.Editor/Common/Constants.fs index ae848297b4..2c6e7c58fd 100644 --- a/vsintegration/src/FSharp.Editor/Common/Constants.fs +++ b/vsintegration/src/FSharp.Editor/Common/Constants.fs @@ -31,6 +31,10 @@ module internal FSharpConstants = /// "F#" let FSharpContentTypeName = "F#" + [] + /// ".fs" + let FSharpFileExtension = ".fs" + [] /// "F# Signature Help" let FSharpSignatureHelpContentTypeName = "F# Signature Help" diff --git a/vsintegration/src/FSharp.Editor/Common/LspService.fs b/vsintegration/src/FSharp.Editor/Common/LspService.fs new file mode 100644 index 0000000000..433f833839 --- /dev/null +++ b/vsintegration/src/FSharp.Editor/Common/LspService.fs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace Microsoft.VisualStudio.FSharp.Editor + +open System.ComponentModel.Composition +open FSharp.Compiler.LanguageServer +open FSharp.Compiler.LanguageServer.Extensions +open StreamJsonRpc + +[)>] +type LspService() = + let mutable options = Options.Default() + let mutable jsonRpc: JsonRpc option = None + + let sendOptions () = + async { + match jsonRpc with + | None -> () + | Some rpc -> do! rpc.SetOptionsAsync(options) + } + + member __.SetJsonRpc(rpc: JsonRpc) = + jsonRpc <- Some rpc + sendOptions() + + member __.SetOptions(opt: Options) = + options <- opt + sendOptions() diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index e43e61af58..8b99167f24 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -36,6 +36,10 @@ + + Common\LspExternalAccess.fs + + @@ -52,6 +56,10 @@ + + LanguageService\JsonOptionConverter.fs + + @@ -116,6 +124,7 @@ + @@ -144,6 +153,7 @@ + @@ -158,6 +168,7 @@ + diff --git a/vsintegration/src/FSharp.Editor/LanguageService/FSharpLanguageClient.fs b/vsintegration/src/FSharp.Editor/LanguageService/FSharpLanguageClient.fs new file mode 100644 index 0000000000..52f978d666 --- /dev/null +++ b/vsintegration/src/FSharp.Editor/LanguageService/FSharpLanguageClient.fs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace Microsoft.VisualStudio.FSharp.Editor.LanguageService + +open System.ComponentModel.Composition +open System.Diagnostics +open System.IO +open System.Threading +open System.Threading.Tasks +open FSharp.Compiler.LanguageServer +open Microsoft.FSharp.Control +open Microsoft.VisualStudio.FSharp.Editor +open Microsoft.VisualStudio.FSharp.Editor.Helpers +open Microsoft.VisualStudio.LanguageServer.Client +open Microsoft.VisualStudio.Utilities +open StreamJsonRpc + +// https://docs.microsoft.com/en-us/visualstudio/extensibility/adding-an-lsp-extension?view=vs-2019 + +/// Provides exports necessary to register the language client. +type FSharpContentDefinition() = + + [] + [] + [] + static member val FSharpContentTypeDefinition: ContentTypeDefinition = null with get, set + + [] + [] + [] + static member val FSharpFileExtensionDefinition: FileExtensionToContentTypeDefinition = null with get, set + +[)>] +[] +type internal FSharpLanguageClient + [] + ( + lspService: LspService + ) = + inherit LanguageClient() + override __.Name = "F# Language Service" + override this.ActivateAsync(_token: CancellationToken) = + async { + let thisAssemblyPath = Path.GetDirectoryName(this.GetType().Assembly.Location) + let serverAssemblyPath = Path.Combine(thisAssemblyPath, "Agent", "FSharp.Compiler.LanguageServer.exe") + let startInfo = ProcessStartInfo(serverAssemblyPath) + startInfo.UseShellExecute <- false + startInfo.CreateNoWindow <- true // comment to see log messages written to stderr + startInfo.RedirectStandardInput <- true + startInfo.RedirectStandardOutput <- true + let proc = new Process() + proc.StartInfo <- startInfo + return + if proc.Start() then new Connection(proc.StandardOutput.BaseStream, proc.StandardInput.BaseStream) + else null + } |> Async.StartAsTask + override __.ConfigurationSections = null + override __.FilesToWatch = null + override __.InitializationOptions = null + override __.DoLoadAsync() = Task.CompletedTask + override __.OnServerInitializeFailedAsync(_e: exn) = Task.CompletedTask + override __.OnServerInitializedAsync() = Task.CompletedTask + interface ILanguageClientCustomMessage with + member __.CustomMessageTarget = null + member __.MiddleLayer = null + member __.AttachForCustomMessageAsync(rpc: JsonRpc) = + rpc.JsonSerializer.Converters.Add(JsonOptionConverter()) // ensure we can set `'T option` values + lspService.SetJsonRpc(rpc) |> Async.StartAsTask :> Task diff --git a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs index e982d10d02..3d71e2522c 100644 --- a/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs +++ b/vsintegration/src/FSharp.Editor/Options/EditorOptions.fs @@ -3,10 +3,11 @@ namespace Microsoft.VisualStudio.FSharp.Editor open System open System.ComponentModel.Composition open System.Runtime.InteropServices +open System.Windows +open System.Windows.Controls +open FSharp.Compiler.LanguageServer open Microsoft.VisualStudio.Shell - open Microsoft.VisualStudio.FSharp.UIResources -open Microsoft.VisualStudio.Shell module DefaultTuning = let UnusedDeclarationsAnalyzerInitialDelay = 0 (* 1000 *) (* milliseconds *) @@ -91,10 +92,12 @@ type CodeLensOptions = [] type AdvancedOptions = { IsBlockStructureEnabled: bool - IsOutliningEnabled: bool } + IsOutliningEnabled: bool + UsePreviewTextHover: bool } static member Default = { IsBlockStructureEnabled = true - IsOutliningEnabled = true } + IsOutliningEnabled = true + UsePreviewTextHover = false } [] type FormattingOptions = @@ -195,6 +198,15 @@ module internal OptionsUI = inherit AbstractOptionPage() override __.CreateView() = upcast AdvancedOptionsControl() + override this.OnApply(args) = + base.OnApply(args) + async { + let lspService = this.GetService() + let settings = this.GetService() + let options = + { Options.usePreviewTextHover = settings.Advanced.UsePreviewTextHover } + do! lspService.SetOptions options + } |> Async.Start [] type internal FormattingOptionPage() = diff --git a/vsintegration/src/FSharp.Editor/Options/UIHelpers.fs b/vsintegration/src/FSharp.Editor/Options/UIHelpers.fs index 2adae7a7a4..2c16ff1027 100644 --- a/vsintegration/src/FSharp.Editor/Options/UIHelpers.fs +++ b/vsintegration/src/FSharp.Editor/Options/UIHelpers.fs @@ -57,6 +57,10 @@ module internal OptionsUIHelpers = // next time needsLoadOnNextActivate <- true + member this.GetService<'T when 'T : not struct>() = + let scm = this.Site.GetService(typeof) :?> IComponentModel + scm.GetService<'T>() + //data binding helpers let radioButtonCoverter = { new IValueConverter with diff --git a/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs b/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs index 01edaa39eb..8ac6f92918 100644 --- a/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs +++ b/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs @@ -163,7 +163,8 @@ type internal FSharpAsyncQuickInfoSource xmlMemberIndexService: IVsXMLMemberIndexService, checkerProvider:FSharpCheckerProvider, projectInfoManager:FSharpProjectOptionsManager, - textBuffer:ITextBuffer + textBuffer:ITextBuffer, + settings: EditorOptions ) = static let joinWithLineBreaks segments = @@ -205,6 +206,9 @@ type internal FSharpAsyncQuickInfoSource // This method can be called from the background thread. // Do not call IServiceProvider.GetService here. override __.GetQuickInfoItemAsync(session:IAsyncQuickInfoSession, cancellationToken:CancellationToken) : Task = + // if using LSP, just bail early + if settings.Advanced.UsePreviewTextHover then Task.FromResult(null) + else let triggerPoint = session.GetTriggerPoint(textBuffer.CurrentSnapshot) match triggerPoint.HasValue with | false -> Task.FromResult(null) @@ -269,7 +273,8 @@ type internal FSharpAsyncQuickInfoSourceProvider ( [)>] serviceProvider: IServiceProvider, checkerProvider:FSharpCheckerProvider, - projectInfoManager:FSharpProjectOptionsManager + projectInfoManager:FSharpProjectOptionsManager, + settings: EditorOptions ) = interface IAsyncQuickInfoSourceProvider with @@ -278,4 +283,4 @@ type internal FSharpAsyncQuickInfoSourceProvider // It is safe to do it here (see #4713) let statusBar = StatusBar(serviceProvider.GetService()) let xmlMemberIndexService = serviceProvider.XMLMemberIndexService - new FSharpAsyncQuickInfoSource(statusBar, xmlMemberIndexService, checkerProvider, projectInfoManager, textBuffer) :> IAsyncQuickInfoSource + new FSharpAsyncQuickInfoSource(statusBar, xmlMemberIndexService, checkerProvider, projectInfoManager, textBuffer, settings) :> IAsyncQuickInfoSource diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj index e192cccbf9..716a450a97 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/FSharp.PropertiesPages.vbproj @@ -66,44 +66,20 @@ - - Code - + - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - + + + + + + + + + - - Code - - - Code - + + @@ -114,12 +90,8 @@ True Settings.settings - - Code - - - Code - + + UserControl @@ -129,9 +101,7 @@ Form - - Code - + UserControl @@ -149,18 +119,12 @@ UserControl - - Code - + Form - - Code - - - Code - + + Form @@ -170,12 +134,8 @@ - - Code - - - Code - + + diff --git a/vsintegration/src/FSharp.UIResources/AdvancedOptionsControl.xaml b/vsintegration/src/FSharp.UIResources/AdvancedOptionsControl.xaml index 7126d6efb8..a14d4cbadf 100644 --- a/vsintegration/src/FSharp.UIResources/AdvancedOptionsControl.xaml +++ b/vsintegration/src/FSharp.UIResources/AdvancedOptionsControl.xaml @@ -24,6 +24,10 @@ + + + diff --git a/vsintegration/src/FSharp.UIResources/Strings.Designer.cs b/vsintegration/src/FSharp.UIResources/Strings.Designer.cs index eecea77c2a..661fffa569 100644 --- a/vsintegration/src/FSharp.UIResources/Strings.Designer.cs +++ b/vsintegration/src/FSharp.UIResources/Strings.Designer.cs @@ -357,6 +357,15 @@ public static string Suggest_names_for_errors_code_fix { } } + /// + /// Looks up a localized string similar to Text hover. + /// + public static string Text_hover { + get { + return ResourceManager.GetString("Text_hover", resourceCulture); + } + } + /// /// Looks up a localized string similar to Time until stale results are used (in milliseconds). /// @@ -401,5 +410,14 @@ public static string Unused_opens_code_fix { return ResourceManager.GetString("Unused_opens_code_fix", resourceCulture); } } + + /// + /// Looks up a localized string similar to (Preview) Use out of process language server. + /// + public static string Use_out_of_process_language_server { + get { + return ResourceManager.GetString("Use_out_of_process_language_server", resourceCulture); + } + } } } diff --git a/vsintegration/src/FSharp.UIResources/Strings.resx b/vsintegration/src/FSharp.UIResources/Strings.resx index 0d509d85de..f4066cf346 100644 --- a/vsintegration/src/FSharp.UIResources/Strings.resx +++ b/vsintegration/src/FSharp.UIResources/Strings.resx @@ -231,4 +231,10 @@ Suggest names for unresolved identifiers + + (Preview) Use out of process language server + + + Text hover + \ 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 2e928e6fc2..9da4f3c87a 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf @@ -102,6 +102,11 @@ _Plné podtržení + + Text hover + Text hover + + Remove unused open statements Odebrat nepoužívané otevřené výkazy @@ -192,6 +197,11 @@ Navrhovat názvy pro nerozpoznané identifikátory + + (Preview) Use out of process language server + (Preview) Use out of process language server + + \ 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 339fde70c6..594bdd6a66 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf @@ -102,6 +102,11 @@ _Durchgezogene Unterstreichung + + Text hover + Text hover + + Remove unused open statements Nicht verwendete "open"-Anweisungen entfernen @@ -192,6 +197,11 @@ Namen für nicht aufgelöste Bezeichner vorschlagen + + (Preview) Use out of process language server + (Preview) Use out of process language server + + \ 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 48a36fbec9..0dd79115a6 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf @@ -102,6 +102,11 @@ Su_brayado sólido + + Text hover + Text hover + + Remove unused open statements Quitar instrucciones open no usadas @@ -192,6 +197,11 @@ Sugerir nombres para los identificadores no resueltos + + (Preview) Use out of process language server + (Preview) Use out of process language server + + \ 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 4e987a4e39..6cd6347170 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf @@ -102,6 +102,11 @@ Soulig_nement avec un trait uni + + Text hover + Text hover + + Remove unused open statements Supprimer les instructions open inutilisées @@ -192,6 +197,11 @@ Suggérer des noms pour les identificateurs non résolus + + (Preview) Use out of process language server + (Preview) Use out of process language server + + \ 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 d2573be1ea..a053b86591 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf @@ -102,6 +102,11 @@ Sottolineatura _continua + + Text hover + Text hover + + Remove unused open statements Rimuovi istruzioni OPEN inutilizzate @@ -192,6 +197,11 @@ Suggerisci nomi per gli identificatori non risolti + + (Preview) Use out of process language server + (Preview) Use out of process language server + + \ 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 2d0b053a6e..444ceb8b6d 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf @@ -102,6 +102,11 @@ 実線の下線(_S) + + Text hover + Text hover + + Remove unused open statements 未使用の Open ステートメントを削除する @@ -192,6 +197,11 @@ 未解決の識別子の名前を提案します + + (Preview) Use out of process language server + (Preview) Use out of process language server + + \ 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 53f8a84e13..b8b14271ac 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf @@ -102,6 +102,11 @@ 실선 밑줄(_S) + + Text hover + Text hover + + Remove unused open statements 사용되지 않는 open 문 제거 @@ -192,6 +197,11 @@ 확인되지 않은 식별자의 이름 제안 + + (Preview) Use out of process language server + (Preview) Use out of process language server + + \ 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 c3a7fb1f18..e0f43b53d9 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf @@ -102,6 +102,11 @@ Podkreślenie _ciągłe + + Text hover + Text hover + + Remove unused open statements Usuń nieużywane otwarte instrukcje @@ -192,6 +197,11 @@ Sugeruj nazwy w przypadku nierozpoznanych identyfikatorów + + (Preview) Use out of process language server + (Preview) Use out of process language server + + \ 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 f5d961bacf..a23bcaf79d 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf @@ -102,6 +102,11 @@ Sublinhado _sólido + + Text hover + Text hover + + Remove unused open statements Remover instruções abertas não usadas @@ -192,6 +197,11 @@ Sugerir nomes para identificadores não resolvidos + + (Preview) Use out of process language server + (Preview) Use out of process language server + + \ 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 11f53ed12a..8a8a30892f 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf @@ -102,6 +102,11 @@ _Сплошнное подчеркивание + + Text hover + Text hover + + Remove unused open statements Удалить неиспользуемые открытые операторы @@ -192,6 +197,11 @@ Предлагать имена для неразрешенных идентификаторов + + (Preview) Use out of process language server + (Preview) Use out of process language server + + \ 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 fc87f84a73..228bd69b6c 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf @@ -102,6 +102,11 @@ _Kesintisiz alt çizgi + + Text hover + Text hover + + Remove unused open statements Kullanılmayan açık deyimleri kaldır @@ -192,6 +197,11 @@ Çözümlenmemiş tanımlayıcılar için ad öner + + (Preview) Use out of process language server + (Preview) Use out of process language server + + \ 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 546048846d..0db63d7df1 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf @@ -102,6 +102,11 @@ 实线下划线(_S) + + Text hover + Text hover + + Remove unused open statements 删除未使用的 open 语句 @@ -192,6 +197,11 @@ 为未解析标识符建议名称 + + (Preview) Use out of process language server + (Preview) Use out of process language server + + \ 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 a17f37f491..ea7c015a9d 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf @@ -102,6 +102,11 @@ 實線底線(_S) + + Text hover + Text hover + + Remove unused open statements 移除未使用的 open 陳述式 @@ -192,6 +197,11 @@ 為未解析的識別碼建議名稱 + + (Preview) Use out of process language server + (Preview) Use out of process language server + + \ No newline at end of file From 027e8c9b58bba85afef26a2869f2c805b20bb427 Mon Sep 17 00:00:00 2001 From: reacheight Date: Wed, 12 Jun 2019 00:13:29 +0300 Subject: [PATCH 096/159] fixed List.map3 misleading error message on different length lists (#6980) * fixed map3 misleading error message on different length lists * fixed previous fix bug * added map3 exception message test * fixed map3 exception message test --- src/fsharp/FSharp.Core/local.fs | 8 ++++---- .../Microsoft.FSharp.Collections/ListModule2.fs | 11 ++++++++++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/fsharp/FSharp.Core/local.fs b/src/fsharp/FSharp.Core/local.fs index 9fb452907f..0f5c69160d 100644 --- a/src/fsharp/FSharp.Core/local.fs +++ b/src/fsharp/FSharp.Core/local.fs @@ -294,16 +294,16 @@ module internal List = | [], xs2 -> invalidArgDifferentListLength "list1" "list2" xs2.Length | xs1, [] -> invalidArgDifferentListLength "list2" "list1" xs1.Length - let rec map3ToFreshConsTail cons (f:OptimizedClosures.FSharpFunc<_, _, _, _>) xs1 xs2 xs3 = + let rec map3ToFreshConsTail cons (f:OptimizedClosures.FSharpFunc<_, _, _, _>) xs1 xs2 xs3 cut = match xs1, xs2, xs3 with | [], [], [] -> setFreshConsTail cons [] | h1 :: t1, h2 :: t2, h3 :: t3 -> let cons2 = freshConsNoTail (f.Invoke(h1, h2, h3)) setFreshConsTail cons cons2 - map3ToFreshConsTail cons2 f t1 t2 t3 + map3ToFreshConsTail cons2 f t1 t2 t3 (cut + 1) | xs1, xs2, xs3 -> - invalidArg3ListsDifferent "list1" "list2" "list3" xs1.Length xs2.Length xs3.Length + invalidArg3ListsDifferent "list1" "list2" "list3" (xs1.Length + cut) (xs2.Length + cut) (xs3.Length + cut) let map3 mapping xs1 xs2 xs3 = match xs1, xs2, xs3 with @@ -311,7 +311,7 @@ module internal List = | h1 :: t1, h2 :: t2, h3 :: t3 -> let f = OptimizedClosures.FSharpFunc<_, _, _, _>.Adapt(mapping) let cons = freshConsNoTail (f.Invoke(h1, h2, h3)) - map3ToFreshConsTail cons f t1 t2 t3 + map3ToFreshConsTail cons f t1 t2 t3 1 cons | xs1, xs2, xs3 -> invalidArg3ListsDifferent "list1" "list2" "list3" xs1.Length xs2.Length xs3.Length diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ListModule2.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ListModule2.fs index 63ae937b56..342d5678bf 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ListModule2.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Collections/ListModule2.fs @@ -102,7 +102,16 @@ type ListModule02() = let longerList = [1; 2] CheckThrowsArgumentException (fun () -> List.map3 funcInt shortList shortList longerList |> ignore) CheckThrowsArgumentException (fun () -> List.map3 funcInt shortList longerList shortList |> ignore) - CheckThrowsArgumentException (fun () -> List.map3 funcInt shortList shortList longerList |> ignore) + CheckThrowsArgumentException (fun () -> List.map3 funcInt shortList shortList longerList |> ignore) + + // exception message checking + let expectedMessage = + "The lists had different lengths.\n" + + sprintf " list1.Length = %i, list2.Length = %i, list3.Length = %i" shortList.Length shortList.Length longerList.Length + + Environment.NewLine + "Parameter name: list1, list2, list3" + let ex = Assert.Throws(typeof, + (fun () -> List.map3 funcInt shortList shortList longerList |> ignore)) + Assert.AreEqual(expectedMessage, ex.Message) // empty List let resultEpt = List.map3 funcInt List.empty List.empty List.empty From bff4fffde6c760c07ecdbc4bb8447a3d54a35f49 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Wed, 12 Jun 2019 10:30:59 -0700 Subject: [PATCH 097/159] don't ship LSP in VS in `release/dev16.2` (#6983) --- eng/targets/Settings.props | 3 ++- .../Vsix/VisualFSharpFull/Source.extension.vsixmanifest | 3 +++ .../src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs | 9 +++++---- .../src/FSharp.UIResources/AdvancedOptionsControl.xaml | 3 +++ 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/eng/targets/Settings.props b/eng/targets/Settings.props index 5d145af11c..6360088320 100644 --- a/eng/targets/Settings.props +++ b/eng/targets/Settings.props @@ -8,7 +8,8 @@ - true + + false diff --git a/vsintegration/Vsix/VisualFSharpFull/Source.extension.vsixmanifest b/vsintegration/Vsix/VisualFSharpFull/Source.extension.vsixmanifest index e272923a3d..cae7539766 100644 --- a/vsintegration/Vsix/VisualFSharpFull/Source.extension.vsixmanifest +++ b/vsintegration/Vsix/VisualFSharpFull/Source.extension.vsixmanifest @@ -28,7 +28,10 @@ + + diff --git a/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs b/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs index 8ac6f92918..7b90bb3aef 100644 --- a/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs +++ b/vsintegration/src/FSharp.Editor/QuickInfo/QuickInfoProvider.fs @@ -164,7 +164,7 @@ type internal FSharpAsyncQuickInfoSource checkerProvider:FSharpCheckerProvider, projectInfoManager:FSharpProjectOptionsManager, textBuffer:ITextBuffer, - settings: EditorOptions + _settings: EditorOptions ) = static let joinWithLineBreaks segments = @@ -206,9 +206,10 @@ type internal FSharpAsyncQuickInfoSource // This method can be called from the background thread. // Do not call IServiceProvider.GetService here. override __.GetQuickInfoItemAsync(session:IAsyncQuickInfoSession, cancellationToken:CancellationToken) : Task = - // if using LSP, just bail early - if settings.Advanced.UsePreviewTextHover then Task.FromResult(null) - else + // The following lines should be disabled for branch `release/dev16.2`, enabled otherwise + //// if using LSP, just bail early + //if settings.Advanced.UsePreviewTextHover then Task.FromResult(null) + //else let triggerPoint = session.GetTriggerPoint(textBuffer.CurrentSnapshot) match triggerPoint.HasValue with | false -> Task.FromResult(null) diff --git a/vsintegration/src/FSharp.UIResources/AdvancedOptionsControl.xaml b/vsintegration/src/FSharp.UIResources/AdvancedOptionsControl.xaml index a14d4cbadf..f8dd82f7d0 100644 --- a/vsintegration/src/FSharp.UIResources/AdvancedOptionsControl.xaml +++ b/vsintegration/src/FSharp.UIResources/AdvancedOptionsControl.xaml @@ -24,10 +24,13 @@ + + From 0aeb4a056f1edd9603ce0cf139d7df4ca8c7a51e Mon Sep 17 00:00:00 2001 From: Will Smith Date: Thu, 13 Jun 2019 12:14:13 -0700 Subject: [PATCH 098/159] Roslyn Shim - Round 2 (#6734) * Added shims over document diagnostic analyzers * Shims over completions and sig help * Removed content type definitions, putting them in external access * Added shim over InlineRenameService * We are now simply using export on the diagnostic analyzers * Using shim for document highlights service * GoToDefinition implemented with shims * NavigableSymbolsService shimmed * GoToDefinitionService shimmed * NavigationBarItemService shimmmed * Shimmed NavigateToSearchService * Quick cast fix * Using FSharpGlyphTags * Removed CommentSelectionService as it is ExternalAccess now * Shimmed BlockStructureService * Trying to finish shim * Removed folder from FSharp.Editor * Update package * fixing build * Trying to fix build * match roslyn package version --- RoslynPackageVersion.txt | 2 +- eng/Versions.props | 1 + .../BlockComment/CommentSelectionService.fs | 19 -- .../CodeFix/RemoveUnusedOpens.fs | 3 +- .../src/FSharp.Editor/CodeFix/SimplifyName.fs | 5 +- .../CodeLens/FSharpCodeLensService.fs | 7 +- .../src/FSharp.Editor/Common/ContentType.fs | 20 -- .../src/FSharp.Editor/Common/RoslynHelpers.fs | 8 - .../Completion/CompletionProvider.fs | 9 +- .../Completion/CompletionService.fs | 10 +- .../Completion/CompletionUtils.fs | 3 +- .../Completion/FileSystemCompletion.fs | 138 +++++++------- .../FSharp.Editor/Completion/SignatureHelp.fs | 27 +-- .../Diagnostics/DocumentDiagnosticAnalyzer.fs | 68 +++---- .../Diagnostics/ProjectDiagnosticAnalyzer.fs | 30 +-- .../SimplifyNameDiagnosticAnalyzer.fs | 180 ++++++++---------- .../Diagnostics/UnusedDeclarationsAnalyzer.fs | 66 +++---- .../UnusedOpensDiagnosticAnalyzer.fs | 64 +++---- .../DocumentHighlightsService.fs | 16 +- .../src/FSharp.Editor/FSharp.Editor.fsproj | 3 +- .../InlineRename/InlineRenameService.fs | 36 ++-- .../LanguageService/LanguageService.fs | 2 +- .../Navigation/FindUsagesService.fs | 2 +- .../Navigation/GoToDefinition.fs | 43 ++--- .../Navigation/GoToDefinitionService.fs | 5 +- .../Navigation/NavigableSymbolsService.fs | 3 +- .../Navigation/NavigateToSearchService.fs | 94 ++++----- .../Navigation/NavigationBarItemService.fs | 33 +--- .../Structure/BlockStructureService.fs | 59 +++--- .../FSharp.LanguageService.fsproj | 1 + .../GetTypesVS.UnitTests.fsproj | 3 +- .../UnitTests/VisualFSharp.UnitTests.fsproj | 1 + 32 files changed, 413 insertions(+), 548 deletions(-) delete mode 100644 vsintegration/src/FSharp.Editor/BlockComment/CommentSelectionService.fs delete mode 100644 vsintegration/src/FSharp.Editor/Common/ContentType.fs diff --git a/RoslynPackageVersion.txt b/RoslynPackageVersion.txt index fd1d6f6d9b..cc99af6791 100644 --- a/RoslynPackageVersion.txt +++ b/RoslynPackageVersion.txt @@ -1 +1 @@ -3.1.0-beta3-19222-02 +3.2.0-beta4-19312-15 diff --git a/eng/Versions.props b/eng/Versions.props index 3cd88abc9b..258d4255ad 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -55,6 +55,7 @@ https://dotnet.myget.org/F/roslyn-tools/api/v3/index.json; https://api.nuget.org/v3/index.json; https://dotnet.myget.org/F/roslyn/api/v3/index.json; + https://dotnet.myget.org/F/roslyn-analyzers/api/v3/index.json; https://dotnet.myget.org/F/symreader-converter/api/v3/index.json; https://dotnet.myget.org/F/interactive-window/api/v3/index.json; https://myget.org/F/vs-devcore/api/v3/index.json; diff --git a/vsintegration/src/FSharp.Editor/BlockComment/CommentSelectionService.fs b/vsintegration/src/FSharp.Editor/BlockComment/CommentSelectionService.fs deleted file mode 100644 index 4c54a45a51..0000000000 --- a/vsintegration/src/FSharp.Editor/BlockComment/CommentSelectionService.fs +++ /dev/null @@ -1,19 +0,0 @@ -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/CodeFix/RemoveUnusedOpens.fs b/vsintegration/src/FSharp.Editor/CodeFix/RemoveUnusedOpens.fs index e2ccc7e22c..8b659aafb3 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/RemoveUnusedOpens.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/RemoveUnusedOpens.fs @@ -10,6 +10,7 @@ open Microsoft.CodeAnalysis.Diagnostics open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes open Microsoft.CodeAnalysis.CodeActions +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics open FSharp.Compiler.Range @@ -21,7 +22,7 @@ type internal FSharpRemoveUnusedOpensCodeFixProvider projectInfoManager: FSharpProjectOptionsManager ) = inherit CodeFixProvider() - let fixableDiagnosticIds = [IDEDiagnosticIds.RemoveUnnecessaryImportsDiagnosticId] + let fixableDiagnosticIds = [FSharpIDEDiagnosticIds.RemoveUnnecessaryImportsDiagnosticId] let createCodeFix (title: string, context: CodeFixContext) = CodeAction.Create( diff --git a/vsintegration/src/FSharp.Editor/CodeFix/SimplifyName.fs b/vsintegration/src/FSharp.Editor/CodeFix/SimplifyName.fs index aeeae1773e..a276864038 100644 --- a/vsintegration/src/FSharp.Editor/CodeFix/SimplifyName.fs +++ b/vsintegration/src/FSharp.Editor/CodeFix/SimplifyName.fs @@ -10,12 +10,13 @@ open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Diagnostics open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.CodeFixes +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics open SymbolHelpers -[] +[] type internal FSharpSimplifyNameCodeFixProvider() = inherit CodeFixProvider() - let fixableDiagnosticId = IDEDiagnosticIds.SimplifyNamesDiagnosticId + let fixableDiagnosticId = FSharpIDEDiagnosticIds.SimplifyNamesDiagnosticId override __.FixableDiagnosticIds = ImmutableArray.Create(fixableDiagnosticId) diff --git a/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs b/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs index add51361f1..21a70f89e2 100644 --- a/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs +++ b/vsintegration/src/FSharp.Editor/CodeLens/FSharpCodeLensService.fs @@ -14,6 +14,7 @@ open System.Windows.Media.Animation open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Editor.Shared.Extensions open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Classification +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor.Shared.Extensions open FSharp.Compiler open FSharp.Compiler.SourceCodeServices @@ -91,7 +92,7 @@ type internal FSharpCodeLensService logInfof "Tagged text %A" taggedText #endif let textBlock = new TextBlock(Background = Brushes.AliceBlue, Opacity = 0.0, TextTrimming = TextTrimming.None) - DependencyObjectExtensions.SetDefaultTextProperties(textBlock, formatMap.Value) + FSharpDependencyObjectExtensions.SetDefaultTextProperties(textBlock, formatMap.Value) let prefix = Documents.Run settings.CodeLens.Prefix prefix.Foreground <- SolidColorBrush(Color.FromRgb(153uy, 153uy, 153uy)) @@ -116,7 +117,7 @@ type internal FSharpCodeLensService coloredProperties.SetForeground(Color.FromRgb(153uy, 153uy, 153uy)) let run = Documents.Run text.Text - DependencyObjectExtensions.SetTextProperties (run, actualProperties) + FSharpDependencyObjectExtensions.SetTextProperties (run, actualProperties) let inl = match text with @@ -126,7 +127,7 @@ type internal FSharpCodeLensService navigation.NavigateTo nav.Range) h :> Documents.Inline | _ -> run :> _ - DependencyObjectExtensions.SetTextProperties (inl, actualProperties) + FSharpDependencyObjectExtensions.SetTextProperties (inl, actualProperties) textBlock.Inlines.Add inl diff --git a/vsintegration/src/FSharp.Editor/Common/ContentType.fs b/vsintegration/src/FSharp.Editor/Common/ContentType.fs deleted file mode 100644 index 2e92332ccb..0000000000 --- a/vsintegration/src/FSharp.Editor/Common/ContentType.fs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -namespace Microsoft.VisualStudio.FSharp.Editor - -open System.ComponentModel.Composition - -open Microsoft.CodeAnalysis.Editor -open Microsoft.VisualStudio.Utilities -open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor - -module FSharpStaticTypeDefinitions = - [] - [] - [] - let FSharpContentTypeDefinition = ContentTypeDefinition() - - [] - [] - [] - let FSharpSignatureHelpContentTypeDefinition = ContentTypeDefinition() diff --git a/vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs b/vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs index 4d66d133b7..ae8c5fe4fb 100644 --- a/vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs +++ b/vsintegration/src/FSharp.Editor/Common/RoslynHelpers.fs @@ -130,14 +130,6 @@ module internal RoslynHelpers = let StartAsyncUnitAsTask cancellationToken (computation:Async) = StartAsyncAsTask cancellationToken computation :> Task - let private TheSupportedDiagnostics = - // We are constructing our own descriptors at run-time. Compiler service is already doing error formatting and localization. - let dummyDescriptors = - [| for i in 0 .. 10000 -> DiagnosticDescriptor(sprintf "FS%04d" i, String.Empty, String.Empty, String.Empty, DiagnosticSeverity.Error, true, null, null) |] - ImmutableArray.Create(dummyDescriptors) - - let SupportedDiagnostics() = TheSupportedDiagnostics - let ConvertError(error: FSharpErrorInfo, location: Location) = // Normalize the error message into the same format that we will receive it from the compiler. // This ensures that IntelliSense and Compiler errors in the 'Error List' are de-duplicated. diff --git a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs index 989f210a19..9ec89f069d 100644 --- a/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs +++ b/vsintegration/src/FSharp.Editor/Completion/CompletionProvider.fs @@ -12,6 +12,7 @@ open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Completion open Microsoft.CodeAnalysis.Options open Microsoft.CodeAnalysis.Text +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Completion open Microsoft.VisualStudio.Shell @@ -48,7 +49,7 @@ type internal FSharpCompletionProvider |> List.filter (fun (keyword, _) -> not (PrettyNaming.IsOperatorName keyword)) |> List.sortBy (fun (keyword, _) -> keyword) |> List.mapi (fun n (keyword, description) -> - CommonCompletionItem.Create(keyword, null, CompletionItemRules.Default, Nullable Glyph.Keyword, sortText = sprintf "%06d" (1000000 + n)) + FSharpCommonCompletionItem.Create(keyword, null, CompletionItemRules.Default, Nullable Glyph.Keyword, sortText = sprintf "%06d" (1000000 + n)) .AddProperty("description", description) .AddProperty(IsKeywordPropName, "")) @@ -73,7 +74,7 @@ type internal FSharpCompletionProvider // * let xs = [1..10] <<---- Don't commit autocomplete! (same for arrays) let noCommitChars = [|' '; '='; ','; '.'; '<'; '>'; '('; ')'; '!'; ':'; '['; ']'; '|'|].ToImmutableArray() - CompletionItemRules.Default.WithCommitCharacterRule(CharacterSetModificationRule.Create(CharacterSetModificationKind.Remove, noCommitChars)) + CompletionItemRules.Default.WithCommitCharacterRules(ImmutableArray.Create (CharacterSetModificationRule.Create(CharacterSetModificationKind.Remove, noCommitChars))) static let getRules showAfterCharIsTyped = if showAfterCharIsTyped then noCommitOnSpaceRules else CompletionItemRules.Default @@ -152,7 +153,7 @@ type internal FSharpCompletionProvider | _, idents -> Array.last idents let completionItem = - CommonCompletionItem.Create(name, null, rules = getRules intellisenseOptions.ShowAfterCharIsTyped, glyph = Nullable (Microsoft.CodeAnalysis.ExternalAccess.FSharp.FSharpGlyphHelpersObsolete.Convert(glyph)), filterText = filterText) + FSharpCommonCompletionItem.Create(name, null, rules = getRules intellisenseOptions.ShowAfterCharIsTyped, glyph = Nullable glyph, filterText = filterText) .AddProperty(FullNamePropName, declarationItem.FullName) let completionItem = @@ -198,7 +199,7 @@ type internal FSharpCompletionProvider } override this.ShouldTriggerCompletion(sourceText: SourceText, caretPosition: int, trigger: CompletionTrigger, _: OptionSet) = - use _logBlock = Logger.LogBlockMessage this.Name LogEditorFunctionId.Completion_ShouldTrigger + use _logBlock = Logger.LogBlock LogEditorFunctionId.Completion_ShouldTrigger let getInfo() = let documentId = workspace.GetDocumentIdInCurrentContext(sourceText.Container) diff --git a/vsintegration/src/FSharp.Editor/Completion/CompletionService.fs b/vsintegration/src/FSharp.Editor/Completion/CompletionService.fs index ef138b72c7..6303e2498d 100644 --- a/vsintegration/src/FSharp.Editor/Completion/CompletionService.fs +++ b/vsintegration/src/FSharp.Editor/Completion/CompletionService.fs @@ -9,6 +9,7 @@ open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Completion open Microsoft.CodeAnalysis.Host open Microsoft.CodeAnalysis.Host.Mef +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Completion open Microsoft.VisualStudio.Shell @@ -26,10 +27,11 @@ type internal FSharpCompletionService let builtInProviders = ImmutableArray.Create( FSharpCompletionProvider(workspace, serviceProvider, checkerProvider, projectInfoManager, assemblyContentProvider), - HashDirectiveCompletionProvider(workspace, projectInfoManager, - [ Completion.Create("""\s*#load\s+(@?"*(?"[^"]*"?))""", [".fs"; ".fsx"], useIncludeDirectives = true) - Completion.Create("""\s*#r\s+(@?"*(?"[^"]*"?))""", [".dll"; ".exe"], useIncludeDirectives = true) - Completion.Create("""\s*#I\s+(@?"*(?"[^"]*"?))""", ["\x00"], useIncludeDirectives = false) ])) + FSharpCommonCompletionProvider.Create( + HashDirectiveCompletionProvider(workspace, projectInfoManager, + [ Completion.Create("""\s*#load\s+(@?"*(?"[^"]*"?))""", [".fs"; ".fsx"], useIncludeDirectives = true) + Completion.Create("""\s*#r\s+(@?"*(?"[^"]*"?))""", [".dll"; ".exe"], useIncludeDirectives = true) + Completion.Create("""\s*#I\s+(@?"*(?"[^"]*"?))""", ["\x00"], useIncludeDirectives = false) ]))) override this.Language = FSharpConstants.FSharpLanguageName override this.GetBuiltInProviders() = builtInProviders diff --git a/vsintegration/src/FSharp.Editor/Completion/CompletionUtils.fs b/vsintegration/src/FSharp.Editor/Completion/CompletionUtils.fs index 6691640c4f..5d210d5f36 100644 --- a/vsintegration/src/FSharp.Editor/Completion/CompletionUtils.fs +++ b/vsintegration/src/FSharp.Editor/Completion/CompletionUtils.fs @@ -8,6 +8,7 @@ open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Classification open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.Completion +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Completion open System.Globalization open FSharp.Compiler.SourceCodeServices @@ -81,7 +82,7 @@ module internal CompletionUtils = | _ -> false let isStartingNewWord (sourceText, position) = - CommonCompletionUtilities.IsStartingNewWord(sourceText, position, (fun ch -> isIdentifierStartCharacter ch), (fun ch -> isIdentifierPartCharacter ch)) + FSharpCommonCompletionUtilities.IsStartingNewWord(sourceText, position, (fun ch -> isIdentifierStartCharacter ch), (fun ch -> isIdentifierPartCharacter ch)) let shouldProvideCompletion (documentId: DocumentId, filePath: string, defines: string list, sourceText: SourceText, triggerPosition: int) : bool = let textLines = sourceText.Lines diff --git a/vsintegration/src/FSharp.Editor/Completion/FileSystemCompletion.fs b/vsintegration/src/FSharp.Editor/Completion/FileSystemCompletion.fs index e92caa22d4..d802842500 100644 --- a/vsintegration/src/FSharp.Editor/Completion/FileSystemCompletion.fs +++ b/vsintegration/src/FSharp.Editor/Completion/FileSystemCompletion.fs @@ -12,6 +12,7 @@ open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Completion open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.Classification +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Completion type internal Completion = { DirectiveRegex: Regex @@ -23,7 +24,6 @@ type internal Completion = UseIncludeDirectives = useIncludeDirectives } type internal HashDirectiveCompletionProvider(workspace: Workspace, projectInfoManager: FSharpProjectOptionsManager, completions: Completion list) = - inherit CommonCompletionProvider() let [] NetworkPath = "\\\\" let commitRules = ImmutableArray.Create(CharacterSetModificationRule.Create(CharacterSetModificationKind.Replace, '"', '\\', ',', '/')) @@ -82,75 +82,77 @@ type internal HashDirectiveCompletionProvider(workspace: Workspace, projectInfoM ) |> Seq.toList - override this.ProvideCompletionsAsync(context) = - asyncMaybe { - let document = context.Document - let position = context.Position - do! let extension = Path.GetExtension document.FilePath - Option.guard (extension = ".fsx" || extension = ".fsscript") - - let! ct = liftAsync Async.CancellationToken - let! text = document.GetTextAsync(ct) - do! Option.guard (isInStringLiteral(text, position)) - let line = text.Lines.GetLineFromPosition(position) - let lineText = text.ToString(TextSpan.FromBounds(line.Start, position)) + interface IFSharpCommonCompletionProvider with + + member this.ProvideCompletionsAsync(context) = + asyncMaybe { + let document = context.Document + let position = context.Position + do! let extension = Path.GetExtension document.FilePath + Option.guard (extension = ".fsx" || extension = ".fsscript") + + let! ct = liftAsync Async.CancellationToken + let! text = document.GetTextAsync(ct) + do! Option.guard (isInStringLiteral(text, position)) + let line = text.Lines.GetLineFromPosition(position) + let lineText = text.ToString(TextSpan.FromBounds(line.Start, position)) - let! completion, quotedPathGroup = - completions |> List.tryPick (fun completion -> - match completion.DirectiveRegex.Match lineText with - | m when m.Success -> - let quotedPathGroup = m.Groups.["literal"] - let endsWithQuote = PathCompletionUtilities.EndsWithQuote(quotedPathGroup.Value) - if endsWithQuote && (position >= line.Start + m.Length) then - None - else - Some (completion, quotedPathGroup) - | _ -> None) - - let snapshot = text.FindCorrespondingEditorTextSnapshot() + let! completion, quotedPathGroup = + completions |> List.tryPick (fun completion -> + match completion.DirectiveRegex.Match lineText with + | m when m.Success -> + let quotedPathGroup = m.Groups.["literal"] + let endsWithQuote = PathCompletionUtilities.EndsWithQuote(quotedPathGroup.Value) + if endsWithQuote && (position >= line.Start + m.Length) then + None + else + Some (completion, quotedPathGroup) + | _ -> None) + + let snapshot = text.FindCorrespondingEditorTextSnapshot() - do! Option.guard (not (isNull snapshot)) - - let extraSearchPaths = - if completion.UseIncludeDirectives then - getIncludeDirectives (text, position) - else [] - - let defaultSearchPath = Path.GetDirectoryName document.FilePath - let searchPaths = defaultSearchPath :: extraSearchPaths - - let helper = - FileSystemCompletionHelper( - Glyph.OpenFolder, - completion.AllowableExtensions |> List.tryPick getFileGlyph |> Option.defaultValue Glyph.None, - Seq.toImmutableArray searchPaths, - null, - completion.AllowableExtensions |> Seq.toImmutableArray, - rules) + do! Option.guard (not (isNull snapshot)) + + let extraSearchPaths = + if completion.UseIncludeDirectives then + getIncludeDirectives (text, position) + else [] + + let defaultSearchPath = Path.GetDirectoryName document.FilePath + let searchPaths = defaultSearchPath :: extraSearchPaths + + let helper = + FSharpFileSystemCompletionHelper( + Glyph.OpenFolder, + completion.AllowableExtensions |> List.tryPick getFileGlyph |> Option.defaultValue Glyph.None, + Seq.toImmutableArray searchPaths, + null, + completion.AllowableExtensions |> Seq.toImmutableArray, + rules) - let pathThroughLastSlash = getPathThroughLastSlash(text, position, quotedPathGroup) - let! items = helper.GetItemsAsync(pathThroughLastSlash, ct) |> Async.AwaitTask |> liftAsync - context.AddItems(items) - } - |> Async.Ignore - |> RoslynHelpers.StartAsyncUnitAsTask context.CancellationToken + let pathThroughLastSlash = getPathThroughLastSlash(text, position, quotedPathGroup) + let! items = helper.GetItemsAsync(pathThroughLastSlash, ct) |> Async.AwaitTask |> liftAsync + context.AddItems(items) + } + |> Async.Ignore + |> RoslynHelpers.StartAsyncUnitAsTask context.CancellationToken - override __.IsInsertionTrigger(text, position, _) = - // Bring up completion when the user types a quote (i.e.: #r "), or if they type a slash - // path separator character, or if they type a comma (#r "foo,version..."). - // Also, if they're starting a word. i.e. #r "c:\W - let ch = text.[position] - let isTriggerChar = - ch = '"' || ch = '\\' || ch = ',' || ch = '/' || - CommonCompletionUtilities.IsStartingNewWord(text, position, (fun x -> Char.IsLetter x), (fun x -> Char.IsLetterOrDigit x)) - isTriggerChar && isInStringLiteral(text, position) + member __.IsInsertionTrigger(text, position, _) = + // Bring up completion when the user types a quote (i.e.: #r "), or if they type a slash + // path separator character, or if they type a comma (#r "foo,version..."). + // Also, if they're starting a word. i.e. #r "c:\W + let ch = text.[position] + let isTriggerChar = + ch = '"' || ch = '\\' || ch = ',' || ch = '/' || + FSharpCommonCompletionUtilities.IsStartingNewWord(text, position, (fun x -> Char.IsLetter x), (fun x -> Char.IsLetterOrDigit x)) + isTriggerChar && isInStringLiteral(text, position) - override __.GetTextChangeAsync(selectedItem, ch, cancellationToken) = - // When we commit "\\" when the user types \ we have to adjust for the fact that the - // controller will automatically append \ after we commit. Because of that, we don't - // want to actually commit "\\" as we'll end up with "\\\". So instead we just commit - // "\" and know that controller will append "\" and give us "\\". - if selectedItem.DisplayText = NetworkPath && ch = Nullable '\\' then - Task.FromResult(Nullable(TextChange(selectedItem.Span, "\\"))) - else - base.GetTextChangeAsync(selectedItem, ch, cancellationToken) \ No newline at end of file + member __.GetTextChangeAsync(baseGetTextChangeAsync, selectedItem, ch, cancellationToken) = + // When we commit "\\" when the user types \ we have to adjust for the fact that the + // controller will automatically append \ after we commit. Because of that, we don't + // want to actually commit "\\" as we'll end up with "\\\". So instead we just commit + // "\" and know that controller will append "\" and give us "\\". + if selectedItem.DisplayText = NetworkPath && ch = Nullable '\\' then + Task.FromResult(Nullable(TextChange(selectedItem.Span, "\\"))) + else + baseGetTextChangeAsync.Invoke(selectedItem, ch, cancellationToken) \ No newline at end of file diff --git a/vsintegration/src/FSharp.Editor/Completion/SignatureHelp.fs b/vsintegration/src/FSharp.Editor/Completion/SignatureHelp.fs index 288feb9787..cde4f1d22d 100644 --- a/vsintegration/src/FSharp.Editor/Completion/SignatureHelp.fs +++ b/vsintegration/src/FSharp.Editor/Completion/SignatureHelp.fs @@ -9,6 +9,7 @@ open System.Collections.Generic open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.SignatureHelp open Microsoft.CodeAnalysis.Text +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.SignatureHelp open Microsoft.VisualStudio.Text open Microsoft.VisualStudio.Shell @@ -19,7 +20,7 @@ open FSharp.Compiler.Range open FSharp.Compiler.SourceCodeServices [] -[] +[)>] type internal FSharpSignatureHelpProvider [] ( @@ -188,7 +189,7 @@ type internal FSharpSignatureHelpProvider return Some items } - interface ISignatureHelpProvider with + interface IFSharpSignatureHelpProvider with member this.IsTriggerCharacter(c) = c ='(' || c = '<' || c = ',' member this.IsRetriggerCharacter(c) = c = ')' || c = '>' || c = '=' @@ -200,7 +201,7 @@ type internal FSharpSignatureHelpProvider let! textVersion = document.GetTextVersionAsync(cancellationToken) let triggerTypedChar = - if triggerInfo.TriggerCharacter.HasValue && triggerInfo.TriggerReason = SignatureHelpTriggerReason.TypeCharCommand then + if triggerInfo.TriggerCharacter.HasValue && triggerInfo.TriggerReason = FSharpSignatureHelpTriggerReason.TypeCharCommand then Some triggerInfo.TriggerCharacter.Value else None @@ -211,27 +212,13 @@ type internal FSharpSignatureHelpProvider |> Array.map (fun (hasParamArrayArg, doc, prefixParts, separatorParts, suffixParts, parameters, descriptionParts) -> let parameters = parameters |> Array.map (fun (paramName, isOptional, _typeText, paramDoc, displayParts) -> - SignatureHelpParameter(paramName,isOptional,documentationFactory=(fun _ -> paramDoc :> seq<_>),displayParts=displayParts)) - SignatureHelpItem(isVariadic=hasParamArrayArg, documentationFactory=(fun _ -> doc :> seq<_>),prefixParts=prefixParts,separatorParts=separatorParts,suffixParts=suffixParts,parameters=parameters,descriptionParts=descriptionParts)) + FSharpSignatureHelpParameter(paramName,isOptional,documentationFactory=(fun _ -> paramDoc :> seq<_>),displayParts=displayParts)) + FSharpSignatureHelpItem(isVariadic=hasParamArrayArg, documentationFactory=(fun _ -> doc :> seq<_>),prefixParts=prefixParts,separatorParts=separatorParts,suffixParts=suffixParts,parameters=parameters,descriptionParts=descriptionParts)) - return SignatureHelpItems(items,applicableSpan,argumentIndex,argumentCount,Option.toObj argumentName) + return FSharpSignatureHelpItems(items,applicableSpan,argumentIndex,argumentCount,Option.toObj argumentName) with ex -> Assert.Exception(ex) return! None } |> Async.map Option.toObj |> RoslynHelpers.StartAsyncAsTask cancellationToken - -open System.ComponentModel.Composition -open Microsoft.VisualStudio.Utilities -open Microsoft.VisualStudio.Text.Classification -open Microsoft.CodeAnalysis.Editor.Implementation.IntelliSense.SignatureHelp.Presentation - -// Enable colorized signature help for F# buffers - -[)>] -[] -type internal FSharpSignatureHelpClassifierProvider [] (typeMap) = - interface IClassifierProvider with - override __.GetClassifier (buffer: ITextBuffer) = - buffer.Properties.GetOrCreateSingletonProperty(fun _ -> SignatureHelpClassifier(buffer, typeMap) :> _) diff --git a/vsintegration/src/FSharp.Editor/Diagnostics/DocumentDiagnosticAnalyzer.fs b/vsintegration/src/FSharp.Editor/Diagnostics/DocumentDiagnosticAnalyzer.fs index 44b9480595..273e0bad4b 100644 --- a/vsintegration/src/FSharp.Editor/Diagnostics/DocumentDiagnosticAnalyzer.fs +++ b/vsintegration/src/FSharp.Editor/Diagnostics/DocumentDiagnosticAnalyzer.fs @@ -3,6 +3,7 @@ namespace Microsoft.VisualStudio.FSharp.Editor open System +open System.Composition open System.Collections.Immutable open System.Collections.Generic open System.Threading @@ -11,6 +12,7 @@ open System.Threading.Tasks open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Diagnostics open Microsoft.CodeAnalysis.Text +open Microsoft.CodeAnalysis.Host.Mef open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics open FSharp.Compiler @@ -22,9 +24,8 @@ type internal DiagnosticsType = | Syntax | Semantic -[] -type internal FSharpDocumentDiagnosticAnalyzer() = - inherit DocumentDiagnosticAnalyzer() +[)>] +type internal FSharpDocumentDiagnosticAnalyzer [] () = static let userOpName = "DocumentDiagnosticAnalyzer" let getChecker(document: Document) = @@ -106,40 +107,33 @@ type internal FSharpDocumentDiagnosticAnalyzer() = return results } - override __.Priority = 10 // Default = 50 + interface IFSharpDocumentDiagnosticAnalyzer with - override this.SupportedDiagnostics = RoslynHelpers.SupportedDiagnostics() - - override this.AnalyzeSyntaxAsync(document: Document, cancellationToken: CancellationToken): Task> = - let projectInfoManager = getProjectInfoManager document - asyncMaybe { - let! parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document, cancellationToken) - let! sourceText = document.GetTextAsync(cancellationToken) - let! textVersion = document.GetTextVersionAsync(cancellationToken) - return! - FSharpDocumentDiagnosticAnalyzer.GetDiagnostics(getChecker document, document.FilePath, sourceText, textVersion.GetHashCode(), parsingOptions, projectOptions, DiagnosticsType.Syntax) - |> liftAsync - } - |> Async.map (Option.defaultValue ImmutableArray.Empty) - |> RoslynHelpers.StartAsyncAsTask cancellationToken - - override this.AnalyzeSemanticsAsync(document: Document, cancellationToken: CancellationToken): Task> = - let projectInfoManager = getProjectInfoManager document - asyncMaybe { - let! parsingOptions, _, projectOptions = projectInfoManager.TryGetOptionsForDocumentOrProject(document, cancellationToken) - let! sourceText = document.GetTextAsync(cancellationToken) - let! textVersion = document.GetTextVersionAsync(cancellationToken) - if document.Project.Name <> FSharpConstants.FSharpMiscellaneousFilesName || isScriptFile document.FilePath then + member this.AnalyzeSyntaxAsync(document: Document, cancellationToken: CancellationToken): Task> = + let projectInfoManager = getProjectInfoManager document + asyncMaybe { + let! parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document, cancellationToken) + let! sourceText = document.GetTextAsync(cancellationToken) + let! textVersion = document.GetTextVersionAsync(cancellationToken) return! - FSharpDocumentDiagnosticAnalyzer.GetDiagnostics(getChecker document, document.FilePath, sourceText, textVersion.GetHashCode(), parsingOptions, projectOptions, DiagnosticsType.Semantic) + FSharpDocumentDiagnosticAnalyzer.GetDiagnostics(getChecker document, document.FilePath, sourceText, textVersion.GetHashCode(), parsingOptions, projectOptions, DiagnosticsType.Syntax) |> liftAsync - else - return ImmutableArray.Empty - } - |> Async.map (Option.defaultValue ImmutableArray.Empty) - |> RoslynHelpers.StartAsyncAsTask cancellationToken - - interface IBuiltInAnalyzer with - member __.GetAnalyzerCategory() : DiagnosticAnalyzerCategory = DiagnosticAnalyzerCategory.SemanticDocumentAnalysis - member __.OpenFileOnly _ = true - + } + |> Async.map (Option.defaultValue ImmutableArray.Empty) + |> RoslynHelpers.StartAsyncAsTask cancellationToken + + member this.AnalyzeSemanticsAsync(document: Document, cancellationToken: CancellationToken): Task> = + let projectInfoManager = getProjectInfoManager document + asyncMaybe { + let! parsingOptions, _, projectOptions = projectInfoManager.TryGetOptionsForDocumentOrProject(document, cancellationToken) + let! sourceText = document.GetTextAsync(cancellationToken) + let! textVersion = document.GetTextVersionAsync(cancellationToken) + if document.Project.Name <> FSharpConstants.FSharpMiscellaneousFilesName || isScriptFile document.FilePath then + return! + FSharpDocumentDiagnosticAnalyzer.GetDiagnostics(getChecker document, document.FilePath, sourceText, textVersion.GetHashCode(), parsingOptions, projectOptions, DiagnosticsType.Semantic) + |> liftAsync + else + return ImmutableArray.Empty + } + |> Async.map (Option.defaultValue ImmutableArray.Empty) + |> RoslynHelpers.StartAsyncAsTask cancellationToken diff --git a/vsintegration/src/FSharp.Editor/Diagnostics/ProjectDiagnosticAnalyzer.fs b/vsintegration/src/FSharp.Editor/Diagnostics/ProjectDiagnosticAnalyzer.fs index 9b67e11819..544039aa36 100644 --- a/vsintegration/src/FSharp.Editor/Diagnostics/ProjectDiagnosticAnalyzer.fs +++ b/vsintegration/src/FSharp.Editor/Diagnostics/ProjectDiagnosticAnalyzer.fs @@ -14,20 +14,20 @@ open Microsoft.CodeAnalysis.Diagnostics open Microsoft.CodeAnalysis.Host.Mef open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.SolutionCrawler +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics open FSharp.Compiler open FSharp.Compiler.SourceCodeServices open FSharp.Compiler.Range -#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 // messages while files are being edited -[] -type internal FSharpProjectDiagnosticAnalyzer() = - inherit ProjectDiagnosticAnalyzer() +[)>] +type internal FSharpProjectDiagnosticAnalyzer [] () = +#if PROJECT_ANALYSIS static member GetDiagnostics(options: FSharpProjectOptions) = async { let! checkProjectResults = FSharpLanguageService.Checker.ParseAndCheckProject(options) let results = @@ -42,13 +42,17 @@ type internal FSharpProjectDiagnosticAnalyzer() = |> Seq.toImmutableArray return results } - - override this.SupportedDiagnostics = CommonRoslynHelpers.SupportedDiagnostics() - - override this.AnalyzeProjectAsync(project: Project, cancellationToken: CancellationToken): Task> = - async { - match FSharpLanguageService.GetOptionsForProject(project.Id) with - | Some options -> return! FSharpProjectDiagnosticAnalyzer.GetDiagnostics(options) - | None -> return ImmutableArray.Empty - } |> CommonRoslynHelpers.StartAsyncAsTask cancellationToken +#endif + + interface IFSharpProjectDiagnosticAnalyzer with + + member this.AnalyzeProjectAsync(_project: Project, _cancellationToken: CancellationToken): Task> = +#if PROJECT_ANALYSIS + async { + match FSharpLanguageService.GetOptionsForProject(project.Id) with + | Some options -> return! FSharpProjectDiagnosticAnalyzer.GetDiagnostics(options) + | None -> return ImmutableArray.Empty + } |> CommonRoslynHelpers.StartAsyncAsTask cancellationToken +#else + Task.FromResult(ImmutableArray.Empty) #endif diff --git a/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs b/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs index 97235c0f1e..f90717522a 100644 --- a/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs +++ b/vsintegration/src/FSharp.Editor/Diagnostics/SimplifyNameDiagnosticAnalyzer.fs @@ -3,6 +3,7 @@ namespace rec Microsoft.VisualStudio.FSharp.Editor open System +open System.Composition open System.Collections.Immutable open System.Diagnostics open System.Threading @@ -13,15 +14,15 @@ open Microsoft.CodeAnalysis.Diagnostics open FSharp.Compiler open FSharp.Compiler.Range open System.Runtime.Caching +open Microsoft.CodeAnalysis.Host.Mef open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics type private TextVersionHash = int type private PerDocumentSavedData = { Hash: int; Diagnostics: ImmutableArray } -[] -type internal SimplifyNameDiagnosticAnalyzer() = - inherit DocumentDiagnosticAnalyzer() - +[)>] +type internal SimplifyNameDiagnosticAnalyzer [] () = + static let userOpName = "SimplifyNameDiagnosticAnalyzer" let getProjectInfoManager (document: Document) = document.Project.Solution.Workspace.Services.GetService().FSharpProjectOptionsManager let getChecker (document: Document) = document.Project.Solution.Workspace.Services.GetService().Checker @@ -30,105 +31,90 @@ type internal SimplifyNameDiagnosticAnalyzer() = // Make sure only one document is being analyzed at a time, to be nice static let guard = new SemaphoreSlim(1) - static let Descriptor = - DiagnosticDescriptor( - id = IDEDiagnosticIds.SimplifyNamesDiagnosticId, - title = SR.SimplifyName(), - messageFormat = SR.NameCanBeSimplified(), - category = DiagnosticCategory.Style, - defaultSeverity = DiagnosticSeverity.Hidden, - isEnabledByDefault = true, - customTags = FSharpDiagnosticCustomTags.Unnecessary) - static member LongIdentPropertyKey = "FullName" - override __.Priority = 100 // Default = 50 - override __.SupportedDiagnostics = ImmutableArray.Create Descriptor - override this.AnalyzeSyntaxAsync(_, _) = Task.FromResult ImmutableArray.Empty - override this.AnalyzeSemanticsAsync(document: Document, cancellationToken: CancellationToken) = - asyncMaybe { - do! Option.guard document.FSharpOptions.CodeFixes.SimplifyName - do Trace.TraceInformation("{0:n3} (start) SimplifyName", DateTime.Now.TimeOfDay.TotalSeconds) - do! Async.Sleep DefaultTuning.SimplifyNameInitialDelay |> liftAsync - let! _parsingOptions, projectOptions = getProjectInfoManager(document).TryGetOptionsForEditingDocumentOrProject(document, cancellationToken) - let! textVersion = document.GetTextVersionAsync(cancellationToken) - let textVersionHash = textVersion.GetHashCode() - let! _ = guard.WaitAsync(cancellationToken) |> Async.AwaitTask |> liftAsync - try - 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 - let! _, _, checkResults = checker.ParseAndCheckDocument(document, projectOptions, sourceText = sourceText, userOpName=userOpName) - let! symbolUses = checkResults.GetAllUsesOfAllSymbolsInFile() |> liftAsync - 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") - let partialName = QuickParse.GetPartialLongNameEx(lineStr, symbolUse.RangeAlternate.EndColumn - 1) - // `symbolUse.RangeAlternate.Start` does not point to the start of plid, it points to start of `name`, - // so we have to calculate plid's start ourselves. - let plidStartCol = symbolUse.RangeAlternate.EndColumn - partialName.PartialIdent.Length - (getPlidLength partialName.QualifyingIdents) - symbolUse, partialName.QualifyingIdents, plidStartCol, partialName.PartialIdent) - |> Array.filter (fun (_, plid, _, name) -> name <> "" && not (List.isEmpty plid)) - |> Array.groupBy (fun (symbolUse, _, plidStartCol, _) -> symbolUse.RangeAlternate.StartLine, plidStartCol) - |> Array.map (fun (_, xs) -> xs |> Array.maxBy (fun (symbolUse, _, _, _) -> symbolUse.RangeAlternate.EndColumn)) + interface IFSharpSimplifyNameDiagnosticAnalyzer with + + member this.AnalyzeSemanticsAsync(descriptor, document: Document, cancellationToken: CancellationToken) = + asyncMaybe { + do! Option.guard document.FSharpOptions.CodeFixes.SimplifyName + do Trace.TraceInformation("{0:n3} (start) SimplifyName", DateTime.Now.TimeOfDay.TotalSeconds) + do! Async.Sleep DefaultTuning.SimplifyNameInitialDelay |> liftAsync + let! _parsingOptions, projectOptions = getProjectInfoManager(document).TryGetOptionsForEditingDocumentOrProject(document, cancellationToken) + let! textVersion = document.GetTextVersionAsync(cancellationToken) + let textVersionHash = textVersion.GetHashCode() + let! _ = guard.WaitAsync(cancellationToken) |> Async.AwaitTask |> liftAsync + try + 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 + let! _, _, checkResults = checker.ParseAndCheckDocument(document, projectOptions, sourceText = sourceText, userOpName=userOpName) + let! symbolUses = checkResults.GetAllUsesOfAllSymbolsInFile() |> liftAsync + 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") + let partialName = QuickParse.GetPartialLongNameEx(lineStr, symbolUse.RangeAlternate.EndColumn - 1) + // `symbolUse.RangeAlternate.Start` does not point to the start of plid, it points to start of `name`, + // so we have to calculate plid's start ourselves. + let plidStartCol = symbolUse.RangeAlternate.EndColumn - partialName.PartialIdent.Length - (getPlidLength partialName.QualifyingIdents) + symbolUse, partialName.QualifyingIdents, plidStartCol, partialName.PartialIdent) + |> Array.filter (fun (_, plid, _, name) -> name <> "" && not (List.isEmpty plid)) + |> Array.groupBy (fun (symbolUse, _, plidStartCol, _) -> symbolUse.RangeAlternate.StartLine, plidStartCol) + |> Array.map (fun (_, xs) -> xs |> Array.maxBy (fun (symbolUse, _, _, _) -> symbolUse.RangeAlternate.EndColumn)) - for symbolUse, plid, plidStartCol, name in symbolUses do - if not symbolUse.IsFromDefinition then - let posAtStartOfName = - let r = symbolUse.RangeAlternate - if r.StartLine = r.EndLine then Range.mkPos r.StartLine (r.EndColumn - name.Length) - else r.Start + for symbolUse, plid, plidStartCol, name in symbolUses do + if not symbolUse.IsFromDefinition then + let posAtStartOfName = + let r = symbolUse.RangeAlternate + if r.StartLine = r.EndLine then Range.mkPos r.StartLine (r.EndColumn - name.Length) + else r.Start - let getNecessaryPlid (plid: string list) : Async = - let rec loop (rest: string list) (current: string list) = - async { - match rest with - | [] -> return current - | headIdent :: restPlid -> - let! res = checkResults.IsRelativeNameResolvableFromSymbol(posAtStartOfName, current, symbolUse.Symbol, userOpName=userOpName) - if res then return current - else return! loop restPlid (headIdent :: current) - } - loop (List.rev plid) [] + let getNecessaryPlid (plid: string list) : Async = + let rec loop (rest: string list) (current: string list) = + async { + match rest with + | [] -> return current + | headIdent :: restPlid -> + let! res = checkResults.IsRelativeNameResolvableFromSymbol(posAtStartOfName, current, symbolUse.Symbol, userOpName=userOpName) + if res then return current + else return! loop restPlid (headIdent :: current) + } + loop (List.rev plid) [] - do! Async.Sleep DefaultTuning.SimplifyNameEachItemDelay |> liftAsync // be less intrusive, give other work priority most of the time - let! necessaryPlid = getNecessaryPlid plid |> liftAsync + do! Async.Sleep DefaultTuning.SimplifyNameEachItemDelay |> liftAsync // be less intrusive, give other work priority most of the time + let! necessaryPlid = getNecessaryPlid plid |> liftAsync - match necessaryPlid with - | necessaryPlid when necessaryPlid = plid -> () - | necessaryPlid -> - let r = symbolUse.RangeAlternate - let necessaryPlidStartCol = r.EndColumn - name.Length - (getPlidLength necessaryPlid) + match necessaryPlid with + | necessaryPlid when necessaryPlid = plid -> () + | necessaryPlid -> + let r = symbolUse.RangeAlternate + let necessaryPlidStartCol = r.EndColumn - name.Length - (getPlidLength necessaryPlid) - let unnecessaryRange = - Range.mkRange r.FileName (Range.mkPos r.StartLine plidStartCol) (Range.mkPos r.EndLine necessaryPlidStartCol) + let unnecessaryRange = + Range.mkRange r.FileName (Range.mkPos r.StartLine plidStartCol) (Range.mkPos r.EndLine necessaryPlidStartCol) - let relativeName = (String.concat "." plid) + "." + name - result.Add( - Diagnostic.Create( - Descriptor, - RoslynHelpers.RangeToLocation(unnecessaryRange, sourceText, document.FilePath), - properties = (dict [SimplifyNameDiagnosticAnalyzer.LongIdentPropertyKey, relativeName]).ToImmutableDictionary())) + let relativeName = (String.concat "." plid) + "." + name + result.Add( + Diagnostic.Create( + descriptor, + RoslynHelpers.RangeToLocation(unnecessaryRange, sourceText, document.FilePath), + properties = (dict [SimplifyNameDiagnosticAnalyzer.LongIdentPropertyKey, relativeName]).ToImmutableDictionary())) - let diagnostics = result.ToImmutableArray() - 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 - } - |> Async.map (Option.defaultValue ImmutableArray.Empty) - |> RoslynHelpers.StartAsyncAsTask cancellationToken - - interface IBuiltInAnalyzer with - member __.OpenFileOnly _ = true - member __.GetAnalyzerCategory() = DiagnosticAnalyzerCategory.SemanticDocumentAnalysis \ No newline at end of file + let diagnostics = result.ToImmutableArray() + 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 + } + |> Async.map (Option.defaultValue ImmutableArray.Empty) + |> RoslynHelpers.StartAsyncAsTask cancellationToken diff --git a/vsintegration/src/FSharp.Editor/Diagnostics/UnusedDeclarationsAnalyzer.fs b/vsintegration/src/FSharp.Editor/Diagnostics/UnusedDeclarationsAnalyzer.fs index 58b1b139ff..ff7c43839d 100644 --- a/vsintegration/src/FSharp.Editor/Diagnostics/UnusedDeclarationsAnalyzer.fs +++ b/vsintegration/src/FSharp.Editor/Diagnostics/UnusedDeclarationsAnalyzer.fs @@ -3,6 +3,7 @@ namespace rec Microsoft.VisualStudio.FSharp.Editor open System +open System.Composition open System.Collections.Generic open System.Collections.Immutable open System.Diagnostics @@ -10,27 +11,16 @@ open System.Threading.Tasks open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Diagnostics +open Microsoft.CodeAnalysis.Host.Mef open FSharp.Compiler.SourceCodeServices open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics -[] -type internal UnusedDeclarationsAnalyzer() = - inherit DocumentDiagnosticAnalyzer() +[)>] +type internal UnusedDeclarationsAnalyzer [] () = static let userOpName = "UnusedDeclarationsAnalyzer" let getProjectInfoManager (document: Document) = document.Project.Solution.Workspace.Services.GetService().FSharpProjectOptionsManager let getChecker (document: Document) = document.Project.Solution.Workspace.Services.GetService().Checker - let [] DescriptorId = "FS1182" - - let Descriptor = - DiagnosticDescriptor( - id = DescriptorId, - title = SR.TheValueIsUnused(), - messageFormat = SR.TheValueIsUnused(), - category = DiagnosticCategory.Style, - defaultSeverity = DiagnosticSeverity.Hidden, - isEnabledByDefault = true, - customTags = FSharpDiagnosticCustomTags.Unnecessary) let isPotentiallyUnusedDeclaration (symbol: FSharpSymbol) : bool = match symbol with @@ -95,33 +85,25 @@ type internal UnusedDeclarationsAnalyzer() = //#endif unusedRanges - override __.Priority = 80 // Default = 50 - - override __.SupportedDiagnostics = ImmutableArray.Create Descriptor - - override __.AnalyzeSyntaxAsync(_, _) = Task.FromResult ImmutableArray.Empty - - override __.AnalyzeSemanticsAsync(document, cancellationToken) = - asyncMaybe { - do! Option.guard document.FSharpOptions.CodeFixes.UnusedDeclarations + interface IFSharpUnusedDeclarationsDiagnosticAnalyzer with - do Trace.TraceInformation("{0:n3} (start) UnusedDeclarationsAnalyzer", DateTime.Now.TimeOfDay.TotalSeconds) - do! Async.Sleep DefaultTuning.UnusedDeclarationsAnalyzerInitialDelay |> liftAsync // be less intrusive, give other work priority most of the time - match! getProjectInfoManager(document).TryGetOptionsForEditingDocumentOrProject(document, cancellationToken) with - | (_parsingOptions, projectOptions) -> - let! sourceText = document.GetTextAsync() - let checker = getChecker document - let! _, _, checkResults = checker.ParseAndCheckDocument(document, projectOptions, sourceText = sourceText, userOpName = userOpName) - let! allSymbolUsesInFile = checkResults.GetAllUsesOfAllSymbolsInFile() |> liftAsync - let unusedRanges = getUnusedDeclarationRanges allSymbolUsesInFile (isScriptFile document.FilePath) - return - unusedRanges - |> Seq.map (fun m -> Diagnostic.Create(Descriptor, RoslynHelpers.RangeToLocation(m, sourceText, document.FilePath))) - |> Seq.toImmutableArray - } - |> Async.map (Option.defaultValue ImmutableArray.Empty) - |> RoslynHelpers.StartAsyncAsTask cancellationToken + member __.AnalyzeSemanticsAsync(descriptor, document, cancellationToken) = + asyncMaybe { + do! Option.guard document.FSharpOptions.CodeFixes.UnusedDeclarations - interface IBuiltInAnalyzer with - member __.OpenFileOnly _ = true - member __.GetAnalyzerCategory() = DiagnosticAnalyzerCategory.SemanticDocumentAnalysis \ No newline at end of file + do Trace.TraceInformation("{0:n3} (start) UnusedDeclarationsAnalyzer", DateTime.Now.TimeOfDay.TotalSeconds) + do! Async.Sleep DefaultTuning.UnusedDeclarationsAnalyzerInitialDelay |> liftAsync // be less intrusive, give other work priority most of the time + match! getProjectInfoManager(document).TryGetOptionsForEditingDocumentOrProject(document, cancellationToken) with + | (_parsingOptions, projectOptions) -> + let! sourceText = document.GetTextAsync() + let checker = getChecker document + let! _, _, checkResults = checker.ParseAndCheckDocument(document, projectOptions, sourceText = sourceText, userOpName = userOpName) + let! allSymbolUsesInFile = checkResults.GetAllUsesOfAllSymbolsInFile() |> liftAsync + let unusedRanges = getUnusedDeclarationRanges allSymbolUsesInFile (isScriptFile document.FilePath) + return + unusedRanges + |> Seq.map (fun m -> Diagnostic.Create(descriptor, RoslynHelpers.RangeToLocation(m, sourceText, document.FilePath))) + |> Seq.toImmutableArray + } + |> Async.map (Option.defaultValue ImmutableArray.Empty) + |> RoslynHelpers.StartAsyncAsTask cancellationToken diff --git a/vsintegration/src/FSharp.Editor/Diagnostics/UnusedOpensDiagnosticAnalyzer.fs b/vsintegration/src/FSharp.Editor/Diagnostics/UnusedOpensDiagnosticAnalyzer.fs index b94f0ca09a..c79027b0df 100644 --- a/vsintegration/src/FSharp.Editor/Diagnostics/UnusedOpensDiagnosticAnalyzer.fs +++ b/vsintegration/src/FSharp.Editor/Diagnostics/UnusedOpensDiagnosticAnalyzer.fs @@ -3,6 +3,7 @@ namespace Microsoft.VisualStudio.FSharp.Editor open System +open System.Composition open System.Collections.Immutable open System.Diagnostics open System.Threading @@ -16,29 +17,16 @@ open FSharp.Compiler.Ast open FSharp.Compiler.Range open FSharp.Compiler.SourceCodeServices open Microsoft.VisualStudio.FSharp.Editor.Symbols +open Microsoft.CodeAnalysis.Host.Mef open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Diagnostics -[] -type internal UnusedOpensDiagnosticAnalyzer() = - inherit DocumentDiagnosticAnalyzer() - +[)>] +type internal UnusedOpensDiagnosticAnalyzer [] () = + let getProjectInfoManager (document: Document) = document.Project.Solution.Workspace.Services.GetService().FSharpProjectOptionsManager let getChecker (document: Document) = document.Project.Solution.Workspace.Services.GetService().Checker static let userOpName = "UnusedOpensAnalyzer" - static let Descriptor = - DiagnosticDescriptor( - id = IDEDiagnosticIds.RemoveUnnecessaryImportsDiagnosticId, - title = SR.RemoveUnusedOpens(), - messageFormat = SR.UnusedOpens(), - category = DiagnosticCategory.Style, - defaultSeverity = DiagnosticSeverity.Hidden, - isEnabledByDefault = true, - customTags = FSharpDiagnosticCustomTags.Unnecessary) - - override __.Priority = 90 // Default = 50 - override __.SupportedDiagnostics = ImmutableArray.Create Descriptor - override this.AnalyzeSyntaxAsync(_, _) = Task.FromResult ImmutableArray.Empty static member GetUnusedOpenRanges(document: Document, options, checker: FSharpChecker) : Async> = asyncMaybe { @@ -55,26 +43,24 @@ type internal UnusedOpensDiagnosticAnalyzer() = return unusedOpens } - override this.AnalyzeSemanticsAsync(document: Document, cancellationToken: CancellationToken) = - asyncMaybe { - do Trace.TraceInformation("{0:n3} (start) UnusedOpensAnalyzer", DateTime.Now.TimeOfDay.TotalSeconds) - do! Async.Sleep DefaultTuning.UnusedOpensAnalyzerInitialDelay |> liftAsync // be less intrusive, give other work priority most of the time - let! _parsingOptions, projectOptions = getProjectInfoManager(document).TryGetOptionsForEditingDocumentOrProject(document, cancellationToken) - let! sourceText = document.GetTextAsync() - let checker = getChecker document - let! unusedOpens = UnusedOpensDiagnosticAnalyzer.GetUnusedOpenRanges(document, projectOptions, checker) - - return - unusedOpens - |> List.map (fun range -> - Diagnostic.Create( - Descriptor, - RoslynHelpers.RangeToLocation(range, sourceText, document.FilePath))) - |> Seq.toImmutableArray - } - |> Async.map (Option.defaultValue ImmutableArray.Empty) - |> RoslynHelpers.StartAsyncAsTask cancellationToken + interface IFSharpUnusedOpensDiagnosticAnalyzer with - interface IBuiltInAnalyzer with - member __.OpenFileOnly _ = true - member __.GetAnalyzerCategory() = DiagnosticAnalyzerCategory.SemanticDocumentAnalysis \ No newline at end of file + member this.AnalyzeSemanticsAsync(descriptor, document: Document, cancellationToken: CancellationToken) = + asyncMaybe { + do Trace.TraceInformation("{0:n3} (start) UnusedOpensAnalyzer", DateTime.Now.TimeOfDay.TotalSeconds) + do! Async.Sleep DefaultTuning.UnusedOpensAnalyzerInitialDelay |> liftAsync // be less intrusive, give other work priority most of the time + let! _parsingOptions, projectOptions = getProjectInfoManager(document).TryGetOptionsForEditingDocumentOrProject(document, cancellationToken) + let! sourceText = document.GetTextAsync() + let checker = getChecker document + let! unusedOpens = UnusedOpensDiagnosticAnalyzer.GetUnusedOpenRanges(document, projectOptions, checker) + + return + unusedOpens + |> List.map (fun range -> + Diagnostic.Create( + descriptor, + RoslynHelpers.RangeToLocation(range, sourceText, document.FilePath))) + |> Seq.toImmutableArray + } + |> Async.map (Option.defaultValue ImmutableArray.Empty) + |> RoslynHelpers.StartAsyncAsTask cancellationToken diff --git a/vsintegration/src/FSharp.Editor/DocumentHighlights/DocumentHighlightsService.fs b/vsintegration/src/FSharp.Editor/DocumentHighlights/DocumentHighlightsService.fs index 923b5372c6..10ee653379 100644 --- a/vsintegration/src/FSharp.Editor/DocumentHighlights/DocumentHighlightsService.fs +++ b/vsintegration/src/FSharp.Editor/DocumentHighlights/DocumentHighlightsService.fs @@ -11,6 +11,7 @@ open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.DocumentHighlighting open Microsoft.CodeAnalysis.Host.Mef open Microsoft.CodeAnalysis.Text +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.DocumentHighlighting open FSharp.Compiler.SourceCodeServices open FSharp.Compiler.Range @@ -20,8 +21,7 @@ type internal FSharpHighlightSpan = TextSpan: TextSpan } override this.ToString() = sprintf "%+A" this -[] -[, FSharpConstants.FSharpLanguageName)>] +[)>] type internal FSharpDocumentHighlightsService [] (checkerProvider: FSharpCheckerProvider, projectInfoManager: FSharpProjectOptionsManager) = static let userOpName = "DocumentHighlights" @@ -72,8 +72,8 @@ type internal FSharpDocumentHighlightsService [] (checkerP |> fixInvalidSymbolSpans sourceText symbol.Ident.idText } - interface IDocumentHighlightsService with - member __.GetDocumentHighlightsAsync(document, position, _documentsToSearch, cancellationToken) : Task> = + interface IFSharpDocumentHighlightsService with + member __.GetDocumentHighlightsAsync(document, position, _documentsToSearch, cancellationToken) : Task> = asyncMaybe { let! parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document, cancellationToken) let! sourceText = document.GetTextAsync(cancellationToken) @@ -85,11 +85,11 @@ type internal FSharpDocumentHighlightsService [] (checkerP let highlightSpans = spans |> Array.map (fun span -> - let kind = if span.IsDefinition then HighlightSpanKind.Definition else HighlightSpanKind.Reference - HighlightSpan(span.TextSpan, kind)) + let kind = if span.IsDefinition then FSharpHighlightSpanKind.Definition else FSharpHighlightSpanKind.Reference + FSharpHighlightSpan(span.TextSpan, kind)) |> Seq.toImmutableArray - return ImmutableArray.Create(DocumentHighlights(document, highlightSpans)) + return ImmutableArray.Create(FSharpDocumentHighlights(document, highlightSpans)) } - |> Async.map (Option.defaultValue ImmutableArray.Empty) + |> Async.map (Option.defaultValue ImmutableArray.Empty) |> RoslynHelpers.StartAsyncAsTask(cancellationToken) diff --git a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj index 8b99167f24..77add18765 100644 --- a/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj +++ b/vsintegration/src/FSharp.Editor/FSharp.Editor.fsproj @@ -34,7 +34,6 @@ - Common\LspExternalAccess.fs @@ -94,7 +93,6 @@ - @@ -173,6 +171,7 @@ + diff --git a/vsintegration/src/FSharp.Editor/InlineRename/InlineRenameService.fs b/vsintegration/src/FSharp.Editor/InlineRename/InlineRenameService.fs index 82cccffbf1..8791c55889 100644 --- a/vsintegration/src/FSharp.Editor/InlineRename/InlineRenameService.fs +++ b/vsintegration/src/FSharp.Editor/InlineRename/InlineRenameService.fs @@ -12,6 +12,8 @@ open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Editor open Microsoft.CodeAnalysis.Host.Mef open Microsoft.CodeAnalysis.Text +open Microsoft.CodeAnalysis.ExternalAccess.FSharp +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor open FSharp.Compiler open FSharp.Compiler.Range @@ -19,9 +21,9 @@ open FSharp.Compiler.SourceCodeServices open Symbols type internal FailureInlineRenameInfo private () = - interface IInlineRenameInfo with + interface IFSharpInlineRenameInfo with member __.CanRename = false - member __.LocalizedErrorMessage = EditorFeaturesResources.You_cannot_rename_this_element + member __.LocalizedErrorMessage = FSharpEditorFeaturesResources.You_cannot_rename_this_element member __.TriggerSpan = Unchecked.defaultof<_> member __.HasOverloads = false member __.ForceRenameOverloads = true @@ -31,17 +33,17 @@ type internal FailureInlineRenameInfo private () = member __.GetFinalSymbolName _ = "" member __.GetReferenceEditSpan(_, _) = Unchecked.defaultof<_> member __.GetConflictEditSpan(_, _, _) = Nullable() - member __.FindRenameLocationsAsync(_, _) = Task.FromResult null + member __.FindRenameLocationsAsync(_, _) = Task.FromResult null member __.TryOnBeforeGlobalSymbolRenamed(_, _, _) = false member __.TryOnAfterGlobalSymbolRenamed(_, _, _) = false - static member Instance = FailureInlineRenameInfo() :> IInlineRenameInfo + static member Instance = FailureInlineRenameInfo() :> IFSharpInlineRenameInfo -type internal InlineRenameLocationSet(locations: InlineRenameLocation [], originalSolution: Solution, symbolKind: LexerSymbolKind, symbol: FSharpSymbol) = - interface IInlineRenameLocationSet with +type internal InlineRenameLocationSet(locations: FSharpInlineRenameLocation [], originalSolution: Solution, symbolKind: LexerSymbolKind, symbol: FSharpSymbol) = + interface IFSharpInlineRenameLocationSet with member __.Locations = upcast locations.ToList() - member __.GetReplacementsAsync(replacementText, _optionSet, cancellationToken) : Task = - let rec applyChanges (solution: Solution) (locationsByDocument: (Document * InlineRenameLocation list) list) = + member __.GetReplacementsAsync(replacementText, _optionSet, cancellationToken) : Task = + let rec applyChanges (solution: Solution) (locationsByDocument: (Document * FSharpInlineRenameLocation list) list) = async { match locationsByDocument with | [] -> return solution @@ -59,7 +61,7 @@ type internal InlineRenameLocationSet(locations: InlineRenameLocation [], origin | LexerSymbolKind.StaticallyResolvedTypeParameter -> replacementText | _ -> Keywords.NormalizeIdentifierBackticks replacementText return - { new IInlineRenameReplacementInfo with + { new IFSharpInlineRenameReplacementInfo with member __.NewSolution = newSolution member __.ReplacementTextValid = Tokenizer.isValidNameForSymbol(symbolKind, symbol, replacementText) member __.DocumentIds = locations |> Seq.map (fun doc -> doc.Document.Id) |> Seq.distinct @@ -90,7 +92,7 @@ type internal InlineRenameInfo SymbolHelpers.getSymbolUsesInSolution(symbolUse.Symbol, declLoc, checkFileResults, projectInfoManager, checker, document.Project.Solution, userOpName) |> Async.cache - interface IInlineRenameInfo with + interface IFSharpInlineRenameInfo with member __.CanRename = true member __.LocalizedErrorMessage = null member __.TriggerSpan = triggerSpan @@ -126,19 +128,19 @@ type internal InlineRenameInfo match RoslynHelpers.TryFSharpRangeToTextSpan(sourceText, symbolUse.RangeAlternate) with | Some span -> let textSpan = Tokenizer.fixupSpan(sourceText, span) - yield InlineRenameLocation(document, textSpan) + yield FSharpInlineRenameLocation(document, textSpan) | None -> () |] }) |> Async.Parallel |> Async.map Array.concat - return InlineRenameLocationSet(locations, document.Project.Solution, lexerSymbol.Kind, symbolUse.Symbol) :> IInlineRenameLocationSet + return InlineRenameLocationSet(locations, document.Project.Solution, lexerSymbol.Kind, symbolUse.Symbol) :> IFSharpInlineRenameLocationSet } |> RoslynHelpers.StartAsyncAsTask(cancellationToken) member __.TryOnBeforeGlobalSymbolRenamed(_workspace, _changedDocumentIDs, _replacementText) = true member __.TryOnAfterGlobalSymbolRenamed(_workspace, _changedDocumentIDs, _replacementText) = true -[, FSharpConstants.FSharpLanguageName); Shared>] +[); Shared>] type internal InlineRenameService [] ( @@ -148,7 +150,7 @@ type internal InlineRenameService static let userOpName = "InlineRename" static member GetInlineRenameInfo(checker: FSharpChecker, projectInfoManager: FSharpProjectOptionsManager, document: Document, sourceText: SourceText, position: int, - defines: string list, options: FSharpProjectOptions) : Async = + defines: string list, options: FSharpProjectOptions) : Async = asyncMaybe { let textLine = sourceText.Lines.GetLineFromPosition(position) let textLinePos = sourceText.Lines.GetLinePosition(position) @@ -161,11 +163,11 @@ type internal InlineRenameService let! span = RoslynHelpers.TryFSharpRangeToTextSpan(sourceText, symbolUse.RangeAlternate) let triggerSpan = Tokenizer.fixupSpan(sourceText, span) - return InlineRenameInfo(checker, projectInfoManager, document, triggerSpan, symbol, symbolUse, declLoc, checkFileResults) :> IInlineRenameInfo + return InlineRenameInfo(checker, projectInfoManager, document, triggerSpan, symbol, symbolUse, declLoc, checkFileResults) :> IFSharpInlineRenameInfo } - interface IEditorInlineRenameService with - member __.GetRenameInfoAsync(document: Document, position: int, cancellationToken: CancellationToken) : Task = + interface IFSharpEditorInlineRenameService with + member __.GetRenameInfoAsync(document: Document, position: int, cancellationToken: CancellationToken) : Task = asyncMaybe { let! parsingOptions, projectOptions = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document, cancellationToken) let! sourceText = document.GetTextAsync(cancellationToken) diff --git a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs index a3b7b6f758..f02f4e344b 100644 --- a/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs +++ b/vsintegration/src/FSharp.Editor/LanguageService/LanguageService.fs @@ -221,7 +221,7 @@ type internal FSharpLanguageService(package : FSharpPackage) = base.Initialize() this.Workspace.Options <- this.Workspace.Options.WithChangedOption(Completion.FSharpCompletionOptions.BlockForCompletionItems, FSharpConstants.FSharpLanguageName, false) - this.Workspace.Options <- this.Workspace.Options.WithChangedOption(Shared.Options.ServiceFeatureOnOffOptions.ClosedFileDiagnostic, FSharpConstants.FSharpLanguageName, Nullable false) + this.Workspace.Options <- this.Workspace.Options.WithChangedOption(Shared.Options.FSharpServiceFeatureOnOffOptions.ClosedFileDiagnostic, FSharpConstants.FSharpLanguageName, Nullable false) let theme = package.ComponentModel.DefaultExportProvider.GetExport().Value theme.SetColors() diff --git a/vsintegration/src/FSharp.Editor/Navigation/FindUsagesService.fs b/vsintegration/src/FSharp.Editor/Navigation/FindUsagesService.fs index 2286cd0644..f33d23b329 100644 --- a/vsintegration/src/FSharp.Editor/Navigation/FindUsagesService.fs +++ b/vsintegration/src/FSharp.Editor/Navigation/FindUsagesService.fs @@ -59,7 +59,7 @@ type internal FSharpFindUsagesService let! symbol = Tokenizer.getSymbolAtPosition(document.Id, sourceText, position, document.FilePath, defines, SymbolLookupKind.Greedy, false) let! symbolUse = checkFileResults.GetSymbolUseAtLocation(lineNumber, symbol.Ident.idRange.EndColumn, textLine, symbol.FullIsland, userOpName=userOpName) let! declaration = checkFileResults.GetDeclarationLocation (lineNumber, symbol.Ident.idRange.EndColumn, textLine, symbol.FullIsland, false, userOpName=userOpName) |> liftAsync - let tags = GlyphTags.GetTags(Microsoft.CodeAnalysis.ExternalAccess.FSharp.FSharpGlyphHelpersObsolete.Convert(Tokenizer.GetGlyphForSymbol (symbolUse.Symbol, symbol.Kind))) + let tags = FSharpGlyphTags.GetTags(Tokenizer.GetGlyphForSymbol (symbolUse.Symbol, symbol.Kind)) let declarationRange = match declaration with diff --git a/vsintegration/src/FSharp.Editor/Navigation/GoToDefinition.fs b/vsintegration/src/FSharp.Editor/Navigation/GoToDefinition.fs index 5ba172edc4..a607442e46 100644 --- a/vsintegration/src/FSharp.Editor/Navigation/GoToDefinition.fs +++ b/vsintegration/src/FSharp.Editor/Navigation/GoToDefinition.fs @@ -14,6 +14,7 @@ open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.FindSymbols open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.Navigation +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Navigation open Microsoft.VisualStudio.Shell.Interop @@ -105,16 +106,6 @@ module private ExternalSymbol = | _ -> [] -type internal FSharpNavigableItem(document: Document, textSpan: TextSpan) = - interface INavigableItem with - member __.Glyph = Glyph.BasicFile - member __.DisplayFileLocation = true - member __.IsImplicitlyDeclared = false - member __.Document = document - member __.SourceSpan = textSpan - member __.DisplayTaggedParts = ImmutableArray.Empty - member __.ChildItems = ImmutableArray.Empty - // TODO: Uncomment code when VS has a fix for updating the status bar. type internal StatusBar(statusBar: IVsStatusbar) = let mutable _searchIcon = int16 Microsoft.VisualStudio.Shell.Interop.Constants.SBAI_Find :> obj @@ -151,6 +142,9 @@ type internal StatusBar(statusBar: IVsStatusbar) = { new IDisposable with member __.Dispose() = () } //statusBar.Animation(0, &searchIcon) |> ignore } +type internal FSharpGoToDefinitionNavigableItem(document, sourceSpan) = + inherit FSharpNavigableItem(Glyph.BasicFile, ImmutableArray.Empty, document, sourceSpan) + type internal GoToDefinition(checker: FSharpChecker, projectInfoManager: FSharpProjectOptionsManager) = let userOpName = "GoToDefinition" @@ -167,7 +161,7 @@ type internal GoToDefinition(checker: FSharpChecker, projectInfoManager: FSharpP let! refSourceText = refDocument.GetTextAsync(cancellationToken) |> Async.AwaitTask match RoslynHelpers.TryFSharpRangeToTextSpan (refSourceText, range) with | None -> return None - | Some refTextSpan -> return Some (FSharpNavigableItem (refDocument, refTextSpan)) + | Some refTextSpan -> return Some (FSharpGoToDefinitionNavigableItem (refDocument, refTextSpan)) else return None } @@ -201,7 +195,7 @@ type internal GoToDefinition(checker: FSharpChecker, projectInfoManager: FSharpP let! symbolUses = checkFileResults.GetUsesOfSymbolInFile symbol |> liftAsync let! implSymbol = symbolUses |> Array.tryHead let! implTextSpan = RoslynHelpers.TryFSharpRangeToTextSpan (implSourceText, implSymbol.RangeAlternate) - return FSharpNavigableItem (implDoc, implTextSpan) + return FSharpGoToDefinitionNavigableItem (implDoc, implTextSpan) else let! targetDocument = originDocument.Project.Solution.TryGetDocumentFromFSharpRange fsSymbolUse.RangeAlternate return! rangeToNavigableItem (fsSymbolUse.RangeAlternate, targetDocument) @@ -262,7 +256,7 @@ type internal GoToDefinition(checker: FSharpChecker, projectInfoManager: FSharpP ) let! location = symbol.Locations |> Seq.tryHead - return (FSharpNavigableItem(project.GetDocument(location.SourceTree), location.SourceSpan), idRange) + return (FSharpGoToDefinitionNavigableItem(project.GetDocument(location.SourceTree), location.SourceSpan), idRange) | FSharpFindDeclResult.DeclFound targetRange -> // if goto definition is called at we are alread at the declaration location of a symbol in @@ -279,7 +273,7 @@ type internal GoToDefinition(checker: FSharpChecker, projectInfoManager: FSharpP let! targetRange = this.FindSymbolDeclarationInFile(targetSymbolUse, implFilePath, implSourceText, projectOptions, implVersion.GetHashCode()) let! implTextSpan = RoslynHelpers.TryFSharpRangeToTextSpan (implSourceText, targetRange) - let navItem = FSharpNavigableItem (implDocument, implTextSpan) + let navItem = FSharpGoToDefinitionNavigableItem (implDocument, implTextSpan) return (navItem, idRange) else // jump from implementation to the corresponding signature let! declarations = checkFileResults.GetDeclarationLocation (fcsTextLineNumber, lexerSymbol.Ident.idRange.EndColumn, textLine.ToString(), lexerSymbol.FullIsland, true, userOpName=userOpName) |> liftAsync @@ -288,7 +282,7 @@ type internal GoToDefinition(checker: FSharpChecker, projectInfoManager: FSharpP let! sigDocument = originDocument.Project.Solution.TryGetDocumentFromPath targetRange.FileName let! sigSourceText = sigDocument.GetTextAsync () |> liftTaskAsync let! sigTextSpan = RoslynHelpers.TryFSharpRangeToTextSpan (sigSourceText, targetRange) - let navItem = FSharpNavigableItem (sigDocument, sigTextSpan) + let navItem = FSharpGoToDefinitionNavigableItem (sigDocument, sigTextSpan) return (navItem, idRange) | _ -> return! None @@ -301,7 +295,7 @@ type internal GoToDefinition(checker: FSharpChecker, projectInfoManager: FSharpP let! sigTextSpan = RoslynHelpers.TryFSharpRangeToTextSpan (sigSourceText, targetRange) // if the gotodef call originated from a signature and the returned target is a signature, navigate there if isSignatureFile targetRange.FileName && preferSignature then - let navItem = FSharpNavigableItem (sigDocument, sigTextSpan) + let navItem = FSharpGoToDefinitionNavigableItem (sigDocument, sigTextSpan) return (navItem, idRange) else // we need to get an FSharpSymbol from the targetRange found in the signature // that symbol will be used to find the destination in the corresponding implementation file @@ -318,7 +312,7 @@ type internal GoToDefinition(checker: FSharpChecker, projectInfoManager: FSharpP let! targetRange = this.FindSymbolDeclarationInFile(targetSymbolUse, implFilePath, implSourceText, projectOptions, implVersion.GetHashCode()) let! implTextSpan = RoslynHelpers.TryFSharpRangeToTextSpan (implSourceText, targetRange) - let navItem = FSharpNavigableItem (implDocument, implTextSpan) + let navItem = FSharpGoToDefinitionNavigableItem (implDocument, implTextSpan) return (navItem, idRange) | _ -> return! None @@ -335,7 +329,7 @@ type internal GoToDefinition(checker: FSharpChecker, projectInfoManager: FSharpP member this.FindDefinitionsForPeekTask(originDocument: Document, position: int, cancellationToken: CancellationToken) = this.FindDefinitionAtPosition(originDocument, position) |> Async.map ( - Option.map (fun (navItem, _) -> (navItem :> INavigableItem)) + Option.map (fun (navItem, _) -> navItem :> FSharpNavigableItem) >> Option.toArray >> Array.toSeq) |> RoslynHelpers.StartAsyncAsTask cancellationToken @@ -344,31 +338,30 @@ type internal GoToDefinition(checker: FSharpChecker, projectInfoManager: FSharpP /// at the provided position in the document. member this.FindDefinitionTask(originDocument: Document, position: int, cancellationToken: CancellationToken) = this.FindDefinitionAtPosition(originDocument, position) - |> Async.map (Option.map (fun (navItem, range) -> (navItem :> INavigableItem, range))) |> RoslynHelpers.StartAsyncAsTask cancellationToken /// Navigate to the positon of the textSpan in the provided document /// used by quickinfo link navigation when the tooltip contains the correct destination range. member __.TryNavigateToTextSpan(document: Document, textSpan: TextSpan, statusBar: StatusBar) = - let navigableItem = FSharpNavigableItem(document, textSpan) :> INavigableItem + let navigableItem = FSharpGoToDefinitionNavigableItem(document, textSpan) let workspace = document.Project.Solution.Workspace - let navigationService = workspace.Services.GetService() - let options = workspace.Options.WithChangedOption(NavigationOptions.PreferProvisionalTab, true) + let navigationService = workspace.Services.GetService() + let options = workspace.Options.WithChangedOption(FSharpNavigationOptions.PreferProvisionalTab, true) let navigationSucceeded = navigationService.TryNavigateToSpan(workspace, navigableItem.Document.Id, navigableItem.SourceSpan, options) if not navigationSucceeded then statusBar.TempMessage (SR.CannotNavigateUnknown()) - member __.NavigateToItem(navigableItem: #INavigableItem, statusBar: StatusBar) = + member __.NavigateToItem(navigableItem: FSharpNavigableItem, statusBar: StatusBar) = use __ = statusBar.Animate() statusBar.Message (SR.NavigatingTo()) let workspace = navigableItem.Document.Project.Solution.Workspace - let navigationService = workspace.Services.GetService() + let navigationService = workspace.Services.GetService() // Prefer open documents in the preview tab. - let options = workspace.Options.WithChangedOption(NavigationOptions.PreferProvisionalTab, true) + let options = workspace.Options.WithChangedOption(FSharpNavigationOptions.PreferProvisionalTab, true) let result = navigationService.TryNavigateToSpan(workspace, navigableItem.Document.Id, navigableItem.SourceSpan, options) if result then diff --git a/vsintegration/src/FSharp.Editor/Navigation/GoToDefinitionService.fs b/vsintegration/src/FSharp.Editor/Navigation/GoToDefinitionService.fs index d2bcd9dd4f..1a5b1e611e 100644 --- a/vsintegration/src/FSharp.Editor/Navigation/GoToDefinitionService.fs +++ b/vsintegration/src/FSharp.Editor/Navigation/GoToDefinitionService.fs @@ -9,12 +9,13 @@ open System.Threading.Tasks open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Editor open Microsoft.CodeAnalysis.Host.Mef +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor open Microsoft.VisualStudio.Shell open Microsoft.VisualStudio.Shell.Interop open System -[, FSharpConstants.FSharpLanguageName)>] +[)>] [)>] type internal FSharpGoToDefinitionService [] @@ -26,7 +27,7 @@ type internal FSharpGoToDefinitionService let gtd = GoToDefinition(checkerProvider.Checker, projectInfoManager) let statusBar = StatusBar(ServiceProvider.GlobalProvider.GetService()) - interface IGoToDefinitionService with + interface IFSharpGoToDefinitionService with /// Invoked with Peek Definition. member __.FindDefinitionsAsync (document: Document, position: int, cancellationToken: CancellationToken) = gtd.FindDefinitionsForPeekTask(document, position, cancellationToken) diff --git a/vsintegration/src/FSharp.Editor/Navigation/NavigableSymbolsService.fs b/vsintegration/src/FSharp.Editor/Navigation/NavigableSymbolsService.fs index e433733f4d..a1022788ab 100644 --- a/vsintegration/src/FSharp.Editor/Navigation/NavigableSymbolsService.fs +++ b/vsintegration/src/FSharp.Editor/Navigation/NavigableSymbolsService.fs @@ -9,6 +9,7 @@ open System.ComponentModel.Composition open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.Navigation +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Navigation open Microsoft.VisualStudio.Language.Intellisense open Microsoft.VisualStudio.Text @@ -18,7 +19,7 @@ open Microsoft.VisualStudio.Utilities open Microsoft.VisualStudio.Shell [] -type internal FSharpNavigableSymbol(item: INavigableItem, span: SnapshotSpan, gtd: GoToDefinition, statusBar: StatusBar) = +type internal FSharpNavigableSymbol(item: FSharpNavigableItem, span: SnapshotSpan, gtd: GoToDefinition, statusBar: StatusBar) = interface INavigableSymbol with member __.Navigate(_: INavigableRelationship) = gtd.NavigateToItem(item, statusBar) diff --git a/vsintegration/src/FSharp.Editor/Navigation/NavigateToSearchService.fs b/vsintegration/src/FSharp.Editor/Navigation/NavigateToSearchService.fs index 25f33dbb75..428ca48ef6 100644 --- a/vsintegration/src/FSharp.Editor/Navigation/NavigateToSearchService.fs +++ b/vsintegration/src/FSharp.Editor/Navigation/NavigateToSearchService.fs @@ -19,39 +19,21 @@ open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.NavigateTo open Microsoft.CodeAnalysis.Navigation open Microsoft.CodeAnalysis.PatternMatching +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Navigation +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.NavigateTo open FSharp.Compiler open FSharp.Compiler.SourceCodeServices type internal NavigableItem(document: Document, sourceSpan: TextSpan, glyph: Glyph, name: string, kind: string, additionalInfo: string) = - interface INavigableItem with - member __.Glyph = glyph - /// The tagged parts to display for this item. If default, the line of text from is used. - member __.DisplayTaggedParts = ImmutableArray.Create (TaggedText(TextTags.Text, name)) - /// Return true to display the file path of and the span of when displaying this item. - member __.DisplayFileLocation = true - /// This is intended for symbols that are ordinary symbols in the language sense, and may be used by code, but that are simply declared - /// implicitly rather than with explicit language syntax. For example, a default synthesized constructor in C# when the class contains no - /// explicit constructors. - member __.IsImplicitlyDeclared = false - member __.Document = document - member __.SourceSpan = sourceSpan - member __.ChildItems = ImmutableArray.Empty + inherit FSharpNavigableItem(glyph, ImmutableArray.Create (TaggedText(TextTags.Text, name)), document, sourceSpan) + member __.Name = name member __.Kind = kind member __.AdditionalInfo = additionalInfo -type internal NavigateToSearchResult(item: NavigableItem, matchKind: NavigateToMatchKind) = - interface INavigateToSearchResult with - member __.AdditionalInformation = item.AdditionalInfo - member __.Kind = item.Kind - member __.MatchKind = matchKind - member __.IsCaseSensitive = false - member __.Name = item.Name - member __.NameMatchSpans = ImmutableArray<_>.Empty - member __.SecondarySort = null - member __.Summary = null - member __.NavigableItem = upcast item +type internal NavigateToSearchResult(item: NavigableItem, matchKind: FSharpNavigateToMatchKind) = + inherit FSharpNavigateToSearchResult(item.AdditionalInfo, item.Kind, matchKind, item.Name, item) module private Index = [] @@ -73,18 +55,18 @@ module private Index = if res = 0 then a.Offset.CompareTo(b.Offset) else res } type IIndexedNavigableItems = - abstract Find: searchValue: string -> INavigateToSearchResult [] + abstract Find: searchValue: string -> FSharpNavigateToSearchResult [] abstract AllItems: NavigableItem [] let private navigateToSearchResultComparer = - { new IEqualityComparer with - member __.Equals(x: INavigateToSearchResult, y: INavigateToSearchResult) = + { new IEqualityComparer with + member __.Equals(x: FSharpNavigateToSearchResult, y: FSharpNavigateToSearchResult) = match x, y with | null, _ | _, null -> false | _ -> x.NavigableItem.Document.Id = y.NavigableItem.Document.Id && x.NavigableItem.SourceSpan = y.NavigableItem.SourceSpan - member __.GetHashCode(x: INavigateToSearchResult) = + member __.GetHashCode(x: FSharpNavigateToSearchResult) = if isNull x then 0 else 23 * (17 * 23 + x.NavigableItem.Document.Id.GetHashCode()) + x.NavigableItem.SourceSpan.GetHashCode() } @@ -115,11 +97,11 @@ module private Index = let entry = entries.[index] let matchKind = if entry.Offset = 0 then - if entry.Length = searchValue.Length then NavigateToMatchKind.Exact - else NavigateToMatchKind.Prefix - else NavigateToMatchKind.Substring + if entry.Length = searchValue.Length then FSharpNavigateToMatchKind.Exact + else FSharpNavigateToMatchKind.Prefix + else FSharpNavigateToMatchKind.Substring let item = entry.Item - result.Add (NavigateToSearchResult(item, matchKind) :> INavigateToSearchResult) |> ignore + result.Add (NavigateToSearchResult(item, matchKind) :> FSharpNavigateToSearchResult) |> ignore // in case if there are multiple matching items binary search might return not the first one. // in this case we'll walk backwards searching for the applicable answers @@ -140,17 +122,17 @@ module private Index = module private Utils = let navigateToItemKindToRoslynKind = function - | NavigateTo.NavigableItemKind.Module -> NavigateToItemKind.Module - | NavigateTo.NavigableItemKind.ModuleAbbreviation -> NavigateToItemKind.Module - | NavigateTo.NavigableItemKind.Exception -> NavigateToItemKind.Class - | NavigateTo.NavigableItemKind.Type -> NavigateToItemKind.Class - | NavigateTo.NavigableItemKind.ModuleValue -> NavigateToItemKind.Field - | NavigateTo.NavigableItemKind.Field -> NavigateToItemKind.Field - | NavigateTo.NavigableItemKind.Property -> NavigateToItemKind.Property - | NavigateTo.NavigableItemKind.Constructor -> NavigateToItemKind.Method - | NavigateTo.NavigableItemKind.Member -> NavigateToItemKind.Method - | NavigateTo.NavigableItemKind.EnumCase -> NavigateToItemKind.EnumItem - | NavigateTo.NavigableItemKind.UnionCase -> NavigateToItemKind.EnumItem + | NavigateTo.NavigableItemKind.Module -> FSharpNavigateToItemKind.Module + | NavigateTo.NavigableItemKind.ModuleAbbreviation -> FSharpNavigateToItemKind.Module + | NavigateTo.NavigableItemKind.Exception -> FSharpNavigateToItemKind.Class + | NavigateTo.NavigableItemKind.Type -> FSharpNavigateToItemKind.Class + | NavigateTo.NavigableItemKind.ModuleValue -> FSharpNavigateToItemKind.Field + | NavigateTo.NavigableItemKind.Field -> FSharpNavigateToItemKind.Field + | NavigateTo.NavigableItemKind.Property -> FSharpNavigateToItemKind.Property + | NavigateTo.NavigableItemKind.Constructor -> FSharpNavigateToItemKind.Method + | NavigateTo.NavigableItemKind.Member -> FSharpNavigateToItemKind.Method + | NavigateTo.NavigableItemKind.EnumCase -> FSharpNavigateToItemKind.EnumItem + | NavigateTo.NavigableItemKind.UnionCase -> FSharpNavigateToItemKind.EnumItem let navigateToItemKindToGlyph = function | NavigateTo.NavigableItemKind.Module -> Glyph.ModulePublic @@ -182,7 +164,7 @@ module private Utils = type PerDocumentSavedData = { Hash: int; Items: Index.IIndexedNavigableItems } -[, FSharpConstants.FSharpLanguageName); Shared>] +[)>] type internal FSharpNavigateToSearchService [] ( @@ -190,7 +172,7 @@ type internal FSharpNavigateToSearchService projectInfoManager: FSharpProjectOptionsManager ) = - let kindsProvided = ImmutableHashSet.Create(NavigateToItemKind.Module, NavigateToItemKind.Class, NavigateToItemKind.Field, NavigateToItemKind.Property, NavigateToItemKind.Method, NavigateToItemKind.Enum, NavigateToItemKind.EnumItem) :> IImmutableSet + let kindsProvided = ImmutableHashSet.Create(FSharpNavigateToItemKind.Module, FSharpNavigateToItemKind.Class, FSharpNavigateToItemKind.Field, FSharpNavigateToItemKind.Property, FSharpNavigateToItemKind.Method, FSharpNavigateToItemKind.Enum, FSharpNavigateToItemKind.EnumItem) :> IImmutableSet // Save the backing navigation data in a memory cache held in a sliding window let itemsByDocumentId = new MemoryCache("FSharp.Editor.FSharpNavigateToSearchService") @@ -237,15 +219,15 @@ type internal FSharpNavigateToSearchService return indexedItems } let patternMatchKindToNavigateToMatchKind = function - | PatternMatchKind.Exact -> NavigateToMatchKind.Exact - | PatternMatchKind.Prefix -> NavigateToMatchKind.Prefix - | PatternMatchKind.Substring -> NavigateToMatchKind.Substring - | PatternMatchKind.CamelCase -> NavigateToMatchKind.Regular - | PatternMatchKind.Fuzzy -> NavigateToMatchKind.Regular - | _ -> NavigateToMatchKind.Regular - - interface INavigateToSearchService_RemoveInterfaceAboveAndRenameThisAfterInternalsVisibleToUsersUpdate with - member __.SearchProjectAsync(project, _priorityDocuments, searchPattern, kinds, cancellationToken) : Task> = + | PatternMatchKind.Exact -> FSharpNavigateToMatchKind.Exact + | PatternMatchKind.Prefix -> FSharpNavigateToMatchKind.Prefix + | PatternMatchKind.Substring -> FSharpNavigateToMatchKind.Substring + | PatternMatchKind.CamelCase -> FSharpNavigateToMatchKind.Regular + | PatternMatchKind.Fuzzy -> FSharpNavigateToMatchKind.Regular + | _ -> FSharpNavigateToMatchKind.Regular + + interface IFSharpNavigateToSearchService with + member __.SearchProjectAsync(project, _priorityDocuments, searchPattern, kinds, cancellationToken) : Task> = asyncMaybe { let! parsingOptions, _options = projectInfoManager.TryGetOptionsByProject(project, cancellationToken) let! items = @@ -268,7 +250,7 @@ type internal FSharpNavigateToSearchService |> Array.Parallel.collect (fun x -> patternMatcher.GetMatches(x.Name) |> Seq.map (fun pm -> - NavigateToSearchResult(x, patternMatchKindToNavigateToMatchKind pm.Kind) :> INavigateToSearchResult) + NavigateToSearchResult(x, patternMatchKindToNavigateToMatchKind pm.Kind) :> FSharpNavigateToSearchResult) |> Seq.toArray) |] return items |> Array.distinctBy (fun x -> x.NavigableItem.Document.Id, x.NavigableItem.SourceSpan) @@ -277,7 +259,7 @@ type internal FSharpNavigateToSearchService |> Async.map Seq.toImmutableArray |> RoslynHelpers.StartAsyncAsTask(cancellationToken) - member __.SearchDocumentAsync(document, searchPattern, kinds, cancellationToken) : Task> = + member __.SearchDocumentAsync(document, searchPattern, kinds, cancellationToken) : Task> = asyncMaybe { let! parsingOptions, _, _ = projectInfoManager.TryGetOptionsForDocumentOrProject(document, cancellationToken) let! items = getCachedIndexedNavigableItems(document, parsingOptions, kinds) |> liftAsync diff --git a/vsintegration/src/FSharp.Editor/Navigation/NavigationBarItemService.fs b/vsintegration/src/FSharp.Editor/Navigation/NavigationBarItemService.fs index 18115fa62f..d8edebd3ac 100644 --- a/vsintegration/src/FSharp.Editor/Navigation/NavigationBarItemService.fs +++ b/vsintegration/src/FSharp.Editor/Navigation/NavigationBarItemService.fs @@ -10,13 +10,15 @@ open Microsoft.CodeAnalysis.Editor open Microsoft.CodeAnalysis.Navigation open Microsoft.CodeAnalysis.Host.Mef open Microsoft.CodeAnalysis.Notification +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Editor +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Navigation open FSharp.Compiler.SourceCodeServices type internal NavigationBarSymbolItem(text, glyph, spans, childItems) = - inherit NavigationBarItem(text, glyph, spans, childItems) + inherit FSharpNavigationBarItem(text, glyph, spans, childItems) -[, FSharpConstants.FSharpLanguageName); Shared>] +[)>] type internal FSharpNavigationBarItemService [] ( @@ -25,10 +27,10 @@ type internal FSharpNavigationBarItemService ) = static let userOpName = "NavigationBarItem" - static let emptyResult: IList = upcast [||] + static let emptyResult: IList = upcast [||] - interface INavigationBarItemService with - member __.GetItemsAsync(document, cancellationToken) : Task> = + interface IFSharpNavigationBarItemService with + member __.GetItemsAsync(document, cancellationToken) : Task> = asyncMaybe { let! parsingOptions, _options = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document, cancellationToken) let! sourceText = document.GetTextAsync(cancellationToken) @@ -45,25 +47,10 @@ type internal FSharpNavigationBarItemService |> Array.choose (fun decl -> rangeToTextSpan(decl.Range) |> Option.map(fun textSpan -> - NavigationBarSymbolItem(decl.Name, Microsoft.CodeAnalysis.ExternalAccess.FSharp.FSharpGlyphHelpersObsolete.Convert(decl.RoslynGlyph), [| textSpan |], null) :> NavigationBarItem)) + NavigationBarSymbolItem(decl.Name, decl.RoslynGlyph, [| textSpan |], null) :> FSharpNavigationBarItem)) - NavigationBarSymbolItem(topLevelDecl.Declaration.Name, Microsoft.CodeAnalysis.ExternalAccess.FSharp.FSharpGlyphHelpersObsolete.Convert(topLevelDecl.Declaration.RoslynGlyph), [| topLevelTextSpan |], childItems) - :> NavigationBarItem)) :> IList<_> + NavigationBarSymbolItem(topLevelDecl.Declaration.Name, topLevelDecl.Declaration.RoslynGlyph, [| topLevelTextSpan |], childItems) + :> FSharpNavigationBarItem)) :> IList<_> } |> Async.map (Option.defaultValue emptyResult) |> RoslynHelpers.StartAsyncAsTask(cancellationToken) - - member __.ShowItemGrayedIfNear (_item) : bool = false - - member __.NavigateToItem(document, item, _view, _cancellationToken) = - match item.Spans |> Seq.tryHead with - | Some span -> - let workspace = document.Project.Solution.Workspace - let navigationService = workspace.Services.GetService() - - if navigationService.CanNavigateToPosition(workspace, document.Id, span.Start) then - navigationService.TryNavigateToPosition(workspace, document.Id, span.Start) |> ignore - else - let notificationService = workspace.Services.GetService() - notificationService.SendNotification(EditorFeaturesResources.The_definition_of_the_object_is_hidden, severity = NotificationSeverity.Error) - | None -> () \ 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 ab2c04ddca..996845ed51 100644 --- a/vsintegration/src/FSharp.Editor/Structure/BlockStructureService.fs +++ b/vsintegration/src/FSharp.Editor/Structure/BlockStructureService.fs @@ -10,6 +10,7 @@ open Microsoft.CodeAnalysis open Microsoft.CodeAnalysis.Host.Mef open Microsoft.CodeAnalysis.Text open Microsoft.CodeAnalysis.Structure +open Microsoft.CodeAnalysis.ExternalAccess.FSharp.Structure open FSharp.Compiler open FSharp.Compiler.SourceCodeServices @@ -17,9 +18,9 @@ open FSharp.Compiler.SourceCodeServices.Structure module internal BlockStructure = let scopeToBlockType = function - | Scope.Open -> BlockTypes.Imports + | Scope.Open -> FSharpBlockTypes.Imports | Scope.Namespace - | Scope.Module -> BlockTypes.Namespace + | Scope.Module -> FSharpBlockTypes.Namespace | Scope.Record | Scope.Interface | Scope.TypeExtension @@ -28,10 +29,10 @@ module internal BlockStructure = | Scope.ObjExpr | Scope.UnionDefn | Scope.Attribute - | Scope.Type -> BlockTypes.Type + | Scope.Type -> FSharpBlockTypes.Type | Scope.New | Scope.RecordField - | Scope.Member -> BlockTypes.Member + | Scope.Member -> FSharpBlockTypes.Member | Scope.LetOrUse | Scope.Match | Scope.MatchBang @@ -47,7 +48,7 @@ module internal BlockStructure = | Scope.TryFinally | Scope.TryInTryFinally | Scope.FinallyInTryFinally - | Scope.IfThenElse-> BlockTypes.Conditional + | Scope.IfThenElse-> FSharpBlockTypes.Conditional | Scope.Tuple | Scope.ArrayOrList | Scope.CompExprInternal @@ -58,13 +59,13 @@ module internal BlockStructure = | Scope.Val | Scope.YieldOrReturn | Scope.YieldOrReturnBang - | Scope.TryWith -> BlockTypes.Expression - | Scope.Do -> BlockTypes.Statement + | Scope.TryWith -> FSharpBlockTypes.Expression + | Scope.Do -> FSharpBlockTypes.Statement | Scope.While - | Scope.For -> BlockTypes.Loop - | Scope.HashDirective -> BlockTypes.PreprocessorRegion + | Scope.For -> FSharpBlockTypes.Loop + | Scope.HashDirective -> FSharpBlockTypes.PreprocessorRegion | Scope.Comment - | Scope.XmlDocComment -> BlockTypes.Comment + | Scope.XmlDocComment -> FSharpBlockTypes.Comment let isAutoCollapsible = function | Scope.New @@ -134,33 +135,27 @@ module internal BlockStructure = match Option.ofNullable (line.Span.Intersection textSpan) with | Some span -> sourceText.GetSubText(span).ToString()+"..." | None -> "..." - let blockType = if isBlockStructureEnabled then scopeToBlockType scopeRange.Scope else BlockTypes.Nonstructural - Some (BlockSpan(blockType, true, textSpan, hintSpan, bannerText, autoCollapse = isAutoCollapsible scopeRange.Scope)) + let blockType = if isBlockStructureEnabled then scopeToBlockType scopeRange.Scope else FSharpBlockTypes.Nonstructural + Some (FSharpBlockSpan(blockType, true, textSpan, hintSpan, bannerText, autoCollapse = isAutoCollapsible scopeRange.Scope)) | _, _ -> None ) open BlockStructure -type internal FSharpBlockStructureService(checker: FSharpChecker, projectInfoManager: FSharpProjectOptionsManager) = - inherit BlockStructureService() +[)>] +type internal FSharpBlockStructureService [] (checkerProvider: FSharpCheckerProvider, projectInfoManager: FSharpProjectOptionsManager) = - static let userOpName = "BlockStructure" + static let userOpName = "FSharpBlockStructure" - override __.Language = FSharpConstants.FSharpLanguageName + interface IFSharpBlockStructureService with - override __.GetBlockStructureAsync(document, cancellationToken) : Task = - asyncMaybe { - let! parsingOptions, _options = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document, cancellationToken) - let! sourceText = document.GetTextAsync(cancellationToken) - let! parsedInput = checker.ParseDocument(document, parsingOptions, sourceText, userOpName) - return createBlockSpans document.FSharpOptions.Advanced.IsBlockStructureEnabled sourceText parsedInput |> Seq.toImmutableArray - } - |> Async.map (Option.defaultValue ImmutableArray<_>.Empty) - |> Async.map BlockStructure - |> RoslynHelpers.StartAsyncAsTask(cancellationToken) - -[, FSharpConstants.FSharpLanguageName); Shared>] -type internal FSharpBlockStructureServiceFactory [](checkerProvider: FSharpCheckerProvider, projectInfoManager: FSharpProjectOptionsManager) = - interface ILanguageServiceFactory with - member __.CreateLanguageService(_languageServices) = - upcast FSharpBlockStructureService(checkerProvider.Checker, projectInfoManager) \ No newline at end of file + member __.GetBlockStructureAsync(document, cancellationToken) : Task = + asyncMaybe { + let! parsingOptions, _options = projectInfoManager.TryGetOptionsForEditingDocumentOrProject(document, cancellationToken) + let! sourceText = document.GetTextAsync(cancellationToken) + let! parsedInput = checkerProvider.Checker.ParseDocument(document, parsingOptions, sourceText, userOpName) + return createBlockSpans document.FSharpOptions.Advanced.IsBlockStructureEnabled sourceText parsedInput |> Seq.toImmutableArray + } + |> Async.map (Option.defaultValue ImmutableArray<_>.Empty) + |> Async.map FSharpBlockStructure + |> RoslynHelpers.StartAsyncAsTask(cancellationToken) diff --git a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj index cf72f55216..7692f24fcb 100644 --- a/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj +++ b/vsintegration/src/FSharp.LanguageService/FSharp.LanguageService.fsproj @@ -81,6 +81,7 @@ + diff --git a/vsintegration/tests/GetTypesVS.UnitTests/GetTypesVS.UnitTests.fsproj b/vsintegration/tests/GetTypesVS.UnitTests/GetTypesVS.UnitTests.fsproj index d44b41fab3..8c70a8c5e0 100644 --- a/vsintegration/tests/GetTypesVS.UnitTests/GetTypesVS.UnitTests.fsproj +++ b/vsintegration/tests/GetTypesVS.UnitTests/GetTypesVS.UnitTests.fsproj @@ -1,4 +1,4 @@ - + @@ -24,6 +24,7 @@ + diff --git a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj index 7b11fb96c6..7a0bea7701 100644 --- a/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj +++ b/vsintegration/tests/UnitTests/VisualFSharp.UnitTests.fsproj @@ -253,6 +253,7 @@ + From a24d94ecf97d0d69d4fbe6b8b10cd1f97737fff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbyn=C4=9Bk=20Sailer?= Date: Thu, 20 Jun 2019 18:21:11 +0200 Subject: [PATCH 099/159] LOC CHECKIN | Microsoft/visualfsharp release/dev16.2 | 20190620 (#7022) --- src/fsharp/FSharp.Build/xlf/FSBuild.txt.cs.xlf | 2 +- src/fsharp/FSharp.Build/xlf/FSBuild.txt.de.xlf | 2 +- src/fsharp/FSharp.Build/xlf/FSBuild.txt.es.xlf | 2 +- src/fsharp/FSharp.Build/xlf/FSBuild.txt.fr.xlf | 2 +- src/fsharp/FSharp.Build/xlf/FSBuild.txt.it.xlf | 2 +- src/fsharp/FSharp.Build/xlf/FSBuild.txt.ja.xlf | 2 +- src/fsharp/FSharp.Build/xlf/FSBuild.txt.ko.xlf | 2 +- src/fsharp/FSharp.Build/xlf/FSBuild.txt.pl.xlf | 2 +- src/fsharp/FSharp.Build/xlf/FSBuild.txt.pt-BR.xlf | 2 +- src/fsharp/FSharp.Build/xlf/FSBuild.txt.ru.xlf | 2 +- src/fsharp/FSharp.Build/xlf/FSBuild.txt.tr.xlf | 2 +- .../FSharp.Build/xlf/FSBuild.txt.zh-Hans.xlf | 2 +- .../FSharp.Build/xlf/FSBuild.txt.zh-Hant.xlf | 2 +- src/fsharp/xlf/FSComp.txt.cs.xlf | 12 ++++++------ src/fsharp/xlf/FSComp.txt.de.xlf | 12 ++++++------ src/fsharp/xlf/FSComp.txt.es.xlf | 14 +++++++------- src/fsharp/xlf/FSComp.txt.fr.xlf | 12 ++++++------ src/fsharp/xlf/FSComp.txt.it.xlf | 12 ++++++------ src/fsharp/xlf/FSComp.txt.ja.xlf | 12 ++++++------ src/fsharp/xlf/FSComp.txt.ko.xlf | 12 ++++++------ src/fsharp/xlf/FSComp.txt.pl.xlf | 12 ++++++------ src/fsharp/xlf/FSComp.txt.pt-BR.xlf | 12 ++++++------ src/fsharp/xlf/FSComp.txt.ru.xlf | 12 ++++++------ src/fsharp/xlf/FSComp.txt.tr.xlf | 12 ++++++------ src/fsharp/xlf/FSComp.txt.zh-Hans.xlf | 12 ++++++------ src/fsharp/xlf/FSComp.txt.zh-Hant.xlf | 12 ++++++------ .../Microsoft.VisualStudio.Editors.Designer.cs.xlf | 3 +-- .../Microsoft.VisualStudio.Editors.Designer.de.xlf | 3 +-- .../Microsoft.VisualStudio.Editors.Designer.es.xlf | 3 +-- .../Microsoft.VisualStudio.Editors.Designer.fr.xlf | 3 +-- .../Microsoft.VisualStudio.Editors.Designer.it.xlf | 3 +-- .../Microsoft.VisualStudio.Editors.Designer.ja.xlf | 3 +-- .../Microsoft.VisualStudio.Editors.Designer.ko.xlf | 3 +-- .../Microsoft.VisualStudio.Editors.Designer.pl.xlf | 3 +-- ...crosoft.VisualStudio.Editors.Designer.pt-BR.xlf | 3 +-- .../Microsoft.VisualStudio.Editors.Designer.ru.xlf | 3 +-- .../Microsoft.VisualStudio.Editors.Designer.tr.xlf | 3 +-- ...osoft.VisualStudio.Editors.Designer.zh-Hans.xlf | 3 +-- ...osoft.VisualStudio.Editors.Designer.zh-Hant.xlf | 3 +-- .../src/FSharp.UIResources/xlf/Strings.cs.xlf | 4 ++-- .../src/FSharp.UIResources/xlf/Strings.de.xlf | 4 ++-- .../src/FSharp.UIResources/xlf/Strings.es.xlf | 4 ++-- .../src/FSharp.UIResources/xlf/Strings.fr.xlf | 4 ++-- .../src/FSharp.UIResources/xlf/Strings.it.xlf | 4 ++-- .../src/FSharp.UIResources/xlf/Strings.ja.xlf | 4 ++-- .../src/FSharp.UIResources/xlf/Strings.ko.xlf | 4 ++-- .../src/FSharp.UIResources/xlf/Strings.pl.xlf | 4 ++-- .../src/FSharp.UIResources/xlf/Strings.pt-BR.xlf | 4 ++-- .../src/FSharp.UIResources/xlf/Strings.ru.xlf | 4 ++-- .../src/FSharp.UIResources/xlf/Strings.tr.xlf | 4 ++-- .../src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf | 4 ++-- .../src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf | 4 ++-- 52 files changed, 131 insertions(+), 144 deletions(-) diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.cs.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.cs.xlf index 64e44dc099..e34a840079 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.cs.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.cs.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + {0} pro F# {1} diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.de.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.de.xlf index 1865fb58fe..8014aa4559 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.de.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.de.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + {0} für F# {1} diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.es.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.es.xlf index 05929de603..e70e526aa7 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.es.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.es.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + {0} para F# {1} diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.fr.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.fr.xlf index 22d534392f..967ceecc6e 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.fr.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.fr.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + {0} pour F# {1} diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.it.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.it.xlf index 2e707f2508..a0c02bd765 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.it.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.it.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + {0} per F# {1} diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ja.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ja.xlf index 627dc44db2..2cbcdb1927 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ja.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ja.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + F# {1} の {0} diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ko.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ko.xlf index f337b0ad28..d007db16c3 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ko.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ko.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + F# {1}용 {0} diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.pl.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.pl.xlf index f88076689a..565fdd2b8d 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.pl.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.pl.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + {0} dla języka F# {1} diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.pt-BR.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.pt-BR.xlf index e6c5b3c601..2d6ac4cf6c 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.pt-BR.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.pt-BR.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + {0} para F# {1} diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ru.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ru.xlf index b84d44d49d..23dc6215bd 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ru.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.ru.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + {0} для F# {1} diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.tr.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.tr.xlf index 02194a2720..b56fc71590 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.tr.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.tr.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + F# {1} için {0} diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.zh-Hans.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.zh-Hans.xlf index 12ae0131cb..f514600395 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.zh-Hans.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.zh-Hans.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + F# {1} 的 {0} diff --git a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.zh-Hant.xlf b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.zh-Hant.xlf index c18392ba1d..e3f63746fa 100644 --- a/src/fsharp/FSharp.Build/xlf/FSBuild.txt.zh-Hant.xlf +++ b/src/fsharp/FSharp.Build/xlf/FSBuild.txt.zh-Hant.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + F # {1} 的 {0} diff --git a/src/fsharp/xlf/FSComp.txt.cs.xlf b/src/fsharp/xlf/FSComp.txt.cs.xlf index 3354ee57b5..4ca8437501 100644 --- a/src/fsharp/xlf/FSComp.txt.cs.xlf +++ b/src/fsharp/xlf/FSComp.txt.cs.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + {0} pro F# {1} @@ -144,7 +144,7 @@ Use reference assemblies for .NET framework references when available (Enabled by default). - Use reference assemblies for .NET framework references when available (Enabled by default). + Pro odkazy na rozhraní .NET používejte referenční sestavení, pokud jsou k dispozici (ve výchozím nastavení povolené). @@ -5549,7 +5549,7 @@ Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Deterministická sestavení podporují jenom soubory PDB typu Portable (--debug:portable nebo --debug:embedded). + Deterministické buildy podporují jenom přenositelné soubory PDB (--debug:portable nebo --debug:embedded) @@ -7164,17 +7164,17 @@ Maps physical paths to source path names output by the compiler - Maps physical paths to source path names output by the compiler + Mapuje fyzické cesty na názvy zdrojových cest z výstupu kompilátoru. --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) + Parametr --pathmap se může používat jenom s přenositelnými soubory PDB (--debug:portable nebo --debug:embedded) Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' + Neplatná mapa cest. Mapování musí být oddělená čárkami a používat formát cesta=zdrojováCesta. diff --git a/src/fsharp/xlf/FSComp.txt.de.xlf b/src/fsharp/xlf/FSComp.txt.de.xlf index 320acf4e03..1f0aa76153 100644 --- a/src/fsharp/xlf/FSComp.txt.de.xlf +++ b/src/fsharp/xlf/FSComp.txt.de.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + {0} für F# {1} @@ -144,7 +144,7 @@ Use reference assemblies for .NET framework references when available (Enabled by default). - Use reference assemblies for .NET framework references when available (Enabled by default). + Verweisassemblys für .NET Framework-Verweise verwenden, wenn verfügbar (standardmäßig aktiviert). @@ -5549,7 +5549,7 @@ Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Deterministische Builds unterstützen nur portierbare PDbs ("--debug:portable" oder "--debug:embedded"). + Deterministische Builds unterstützen nur portable PDB-Dateien (--debug:portable oder --debug:embedded) @@ -7164,17 +7164,17 @@ Maps physical paths to source path names output by the compiler - Maps physical paths to source path names output by the compiler + Ordnet der Ausgabe von Quellpfadnamen des Compilers physische Pfade zu --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) + --pathmap kann nur mit portablen PDB-Dateien verwendet werden (--debug:portable oder --debug:embedded) Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' + Ungültige Pfadzuordnung. Zuordnungen müssen durch Kommas getrennt werden und das Format 'path=sourcePath' aufweisen diff --git a/src/fsharp/xlf/FSComp.txt.es.xlf b/src/fsharp/xlf/FSComp.txt.es.xlf index b08960e486..1ac646d589 100644 --- a/src/fsharp/xlf/FSComp.txt.es.xlf +++ b/src/fsharp/xlf/FSComp.txt.es.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + {0} para F# {1} @@ -114,7 +114,7 @@ All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. - All branches of a pattern match expression must return values of the same type as the first branch, which here is '{0}'. This branch returns a value of type '{1}'. + Todas las ramas de una expresión de coincidencia de patrón deben devolver valores del mismo tipo. La primera rama devolvió un valor de tipo "{0}", pero esta rama devolvió un valor de tipo "\{1 \}". @@ -144,7 +144,7 @@ Use reference assemblies for .NET framework references when available (Enabled by default). - Use reference assemblies for .NET framework references when available (Enabled by default). + Use ensamblados de referencia para las referencias de .NET Framework cuando estén disponibles (habilitado de forma predeterminada). @@ -5549,7 +5549,7 @@ Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Las compilaciones deterministas solo admiten PDB portátiles (--debug:portable o --debug:embedded) + Las compilaciones deterministas solo admiten PDB portátiles (--Debug: portable o--Debug: embedded) @@ -7164,17 +7164,17 @@ Maps physical paths to source path names output by the compiler - Maps physical paths to source path names output by the compiler + Asigna rutas físicas de acceso a nombres de ruta de origen resultantes del compilador --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) + --pathmap solo se puede utilizar con PDB portátiles (--Debug:portable o --Debug:embedded) Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' + Mapa de ruta no válido. Las asignaciones deben estar separadas por comas y tener el formato "path=rutaOrigen" diff --git a/src/fsharp/xlf/FSComp.txt.fr.xlf b/src/fsharp/xlf/FSComp.txt.fr.xlf index f23037f6a8..f2cd73f377 100644 --- a/src/fsharp/xlf/FSComp.txt.fr.xlf +++ b/src/fsharp/xlf/FSComp.txt.fr.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + {0} pour F# {1} @@ -144,7 +144,7 @@ Use reference assemblies for .NET framework references when available (Enabled by default). - Use reference assemblies for .NET framework references when available (Enabled by default). + Utilisez des assemblys de référence pour les références .NET Framework quand ils sont disponibles (activé par défaut). @@ -5549,7 +5549,7 @@ Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Les builds déterministes ne prennent en charge que les fichiers PDB portables (--debug:portable ou --debug:embedded) + Les builds déterministes prennent seulement en charge les PDB portables (--debug:portable ou --debug:embedded) @@ -7164,17 +7164,17 @@ Maps physical paths to source path names output by the compiler - Maps physical paths to source path names output by the compiler + Mappe les chemins physiques aux noms de chemin source générés par le compilateur --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) + --pathmap peut seulement être utilisé avec des PBD portables (--debug:portable ou --debug:embedded) Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' + Mappage de chemin non valide. Les mappages doivent être séparés par des virgules et au format 'path=sourcePath' diff --git a/src/fsharp/xlf/FSComp.txt.it.xlf b/src/fsharp/xlf/FSComp.txt.it.xlf index 32637f988d..5bf595dea5 100644 --- a/src/fsharp/xlf/FSComp.txt.it.xlf +++ b/src/fsharp/xlf/FSComp.txt.it.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + {0} per F# {1} @@ -144,7 +144,7 @@ Use reference assemblies for .NET framework references when available (Enabled by default). - Use reference assemblies for .NET framework references when available (Enabled by default). + Usa gli assembly di riferimento per i riferimenti a .NET Framework quando disponibili (abilitato per impostazione predefinita). @@ -5549,7 +5549,7 @@ Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Le compilazioni deterministiche supportano solo file PDB portatili (--debug:portable o --debug:embedded) + Le compilazioni deterministiche supportano solo file PDB portatili (--debug:portable o --debug:embedded) @@ -7164,17 +7164,17 @@ Maps physical paths to source path names output by the compiler - Maps physical paths to source path names output by the compiler + Esegue il mapping dei percorsi fisici ai nomi di percorso di origine restituiti dal compilatore --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) + --pathmap può essere usato solo con file PDB portatili (--debug:portable o --debug:embedded) Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' + Mapping di percorso non valido. I mapping devono essere delimitati da virgole e specificati in formato 'percorso=percorsoOrigine' diff --git a/src/fsharp/xlf/FSComp.txt.ja.xlf b/src/fsharp/xlf/FSComp.txt.ja.xlf index 8157060c9d..bcbf7c58ed 100644 --- a/src/fsharp/xlf/FSComp.txt.ja.xlf +++ b/src/fsharp/xlf/FSComp.txt.ja.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + F# {1} の {0} @@ -144,7 +144,7 @@ Use reference assemblies for .NET framework references when available (Enabled by default). - Use reference assemblies for .NET framework references when available (Enabled by default). + 使用可能な場合は、.NET Framework リファレンスの参照アセンブリを使用します (既定で有効)。 @@ -5551,7 +5551,7 @@ Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - 決定論的ビルドはポータブル PDB のみをサポートします (--debug:portable または --debug:embedded) + 決定論的ビルドは、ポータブル PDB のみをサポートします (--debug:portable または --debug:embedded) @@ -7166,17 +7166,17 @@ Maps physical paths to source path names output by the compiler - Maps physical paths to source path names output by the compiler + 物理パスをコンパイラ出力のソース パス名にマップします --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) + --pathmap は、ポータブル PDB でのみ使用できます (--debug:portable または --debug:embedded) Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' + 無効なパス マップです。マッピングはコンマ区切りの 'path=sourcePath' 形式である必要があります diff --git a/src/fsharp/xlf/FSComp.txt.ko.xlf b/src/fsharp/xlf/FSComp.txt.ko.xlf index f642d6b444..18a4587771 100644 --- a/src/fsharp/xlf/FSComp.txt.ko.xlf +++ b/src/fsharp/xlf/FSComp.txt.ko.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + F# {1}용 {0} @@ -144,7 +144,7 @@ Use reference assemblies for .NET framework references when available (Enabled by default). - Use reference assemblies for .NET framework references when available (Enabled by default). + 기본적으로 활성화되는 참조 어셈블리를 .NET Framework 참조에 사용합니다(사용 가능한 경우). @@ -5549,7 +5549,7 @@ Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - 결정적 빌드는 이식 가능한 PDB만 지원합니다(--debug:portable 또는 --debug:embedded). + 결정적 빌드는 이식 가능한 PDB만 지원합니다(--debug:portable 또는 --debug:embedded). @@ -7164,17 +7164,17 @@ Maps physical paths to source path names output by the compiler - Maps physical paths to source path names output by the compiler + 컴파일러에서 실제 경로를 소스 경로 이름 출력에 매핑합니다. --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) + --pathmap은 이식 가능한 PDB에만 사용할 수 있습니다(--debug:portable 또는 --debug:embedded). Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' + 잘못된 경로 맵입니다. 매핑은 쉼표로 구분되어야 하며 'path=sourcePath' 형식이어야 합니다. diff --git a/src/fsharp/xlf/FSComp.txt.pl.xlf b/src/fsharp/xlf/FSComp.txt.pl.xlf index b9749bedda..69935ec943 100644 --- a/src/fsharp/xlf/FSComp.txt.pl.xlf +++ b/src/fsharp/xlf/FSComp.txt.pl.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + {0} dla języka F# {1} @@ -144,7 +144,7 @@ Use reference assemblies for .NET framework references when available (Enabled by default). - Use reference assemblies for .NET framework references when available (Enabled by default). + Użyj zestawów odwołań dla odwołań do programu .NET Framework, gdy są dostępne (domyślnie włączone). @@ -5549,7 +5549,7 @@ Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Kompilacje deterministyczne obsługują tylko przenośne pliki PDB (--debug:portable lub --debug:embedded) + Deterministyczne kompilacje obsługują tylko przenośne pliki PDB (--debug:portable lub --debug:embedded) @@ -7164,17 +7164,17 @@ Maps physical paths to source path names output by the compiler - Maps physical paths to source path names output by the compiler + Mapuje ścieżki fizyczne na wyjściowe nazwy ścieżek źródłowych z kompilatora --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) + Argumentu --pathmap można używać tylko z przenośnymi plikami PDB (--debug:portable lub --debug:embedded) Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' + Nieprawidłowe mapowanie ścieżek. Mapowania muszą być rozdzielone przecinkami i mieć format „path=sourcePath” diff --git a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf index 39537bc8cd..52c5bab6c9 100644 --- a/src/fsharp/xlf/FSComp.txt.pt-BR.xlf +++ b/src/fsharp/xlf/FSComp.txt.pt-BR.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + {0} para F# {1} @@ -144,7 +144,7 @@ Use reference assemblies for .NET framework references when available (Enabled by default). - Use reference assemblies for .NET framework references when available (Enabled by default). + Use assemblies de referência para referências do .NET Framework quando disponível (habilitado por padrão). @@ -5549,7 +5549,7 @@ Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Compilações determinísticas dão suporte somente a PDBs portáteis (--debug:portable ou --debug:embedded) + Os builds determinísticos oferecem suporte apenas para PDBs portáteis (--debug:portable ou --debug:embedded) @@ -7164,17 +7164,17 @@ Maps physical paths to source path names output by the compiler - Maps physical paths to source path names output by the compiler + Mapeia caminhos físicos para nomes de caminho de origem gerados pelo compilador --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) + --pathmap só pode ser usado com PDBs portáteis (--debug:portable ou --debug:embedded) Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' + Mapa de caminho inválido. Os mapeamentos devem ser separados por vírgulas e do formato 'path=sourcePath' diff --git a/src/fsharp/xlf/FSComp.txt.ru.xlf b/src/fsharp/xlf/FSComp.txt.ru.xlf index fcd4c723f7..a6a4d1171d 100644 --- a/src/fsharp/xlf/FSComp.txt.ru.xlf +++ b/src/fsharp/xlf/FSComp.txt.ru.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + {0} для F# {1} @@ -144,7 +144,7 @@ Use reference assemblies for .NET framework references when available (Enabled by default). - Use reference assemblies for .NET framework references when available (Enabled by default). + Использовать базовые сборки для ссылок на платформу .NET, если базовые сборки доступны (включено по умолчанию). @@ -5549,7 +5549,7 @@ Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Детерминированные сборки поддерживают только переносимые PDB-файлы (--debug:portable или --debug:embedded) + Детерминированные сборки поддерживают только переносимые PDB-файлы (--debug:portable или --debug:embedded) @@ -7164,17 +7164,17 @@ Maps physical paths to source path names output by the compiler - Maps physical paths to source path names output by the compiler + Сопоставляет физические пути с исходными путями в выходных данных компилятора --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) + Параметр --pathmap может использоваться только с переносимыми PDB-файлами (--debug:portable или --debug:embedded) Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' + Недействительная карта путей. Сопоставления должны быть разделены запятыми и должны иметь формат "path=исходный_путь" diff --git a/src/fsharp/xlf/FSComp.txt.tr.xlf b/src/fsharp/xlf/FSComp.txt.tr.xlf index 8092970883..ceb68b2207 100644 --- a/src/fsharp/xlf/FSComp.txt.tr.xlf +++ b/src/fsharp/xlf/FSComp.txt.tr.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + F# {1} için {0} @@ -144,7 +144,7 @@ Use reference assemblies for .NET framework references when available (Enabled by default). - Use reference assemblies for .NET framework references when available (Enabled by default). + Kullanılabilir olduğunda, .NET Framework başvuruları için başvuru bütünleştirilmiş kodlarını kullanın (Varsayılan olarak etkindir). @@ -5549,7 +5549,7 @@ Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - Belirleyici derlemeler yalnızca taşınabilir PDB'leri (--debug:portable veya --debug:embedded) destekler + Belirlenimci derlemeler yalnızca taşınabilir PDB'leri (--debug:portable veya --debug:embedded) destekler @@ -7164,17 +7164,17 @@ Maps physical paths to source path names output by the compiler - Maps physical paths to source path names output by the compiler + Fiziksel yolları derleyiciye göre kaynak yol adları çıkışıyla eşler --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) + --pathmap yalnızca taşınabilir PDB'ler (--debug:portable veya --debug:embedded) ile kullanılabilir Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' + Geçersiz yol eşlemesi. Eşlemeler virgülle ayrılmış ve 'path=sourcePath' biçiminde olmalıdır diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf index 1a7945d712..a1a162e0a1 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hans.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + F# {1} 的 {0} @@ -144,7 +144,7 @@ Use reference assemblies for .NET framework references when available (Enabled by default). - Use reference assemblies for .NET framework references when available (Enabled by default). + 如果可用,请对 .NET Framework 引用使用引用程序集(默认启用)。 @@ -5549,7 +5549,7 @@ Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - 确定性的生成仅支持可移植 PDB (--debug:portable 或 --debug:embedded) + 决定性生成仅支持可移植的 PDB (--debug:portable 或 --debug:embedded) @@ -7164,17 +7164,17 @@ Maps physical paths to source path names output by the compiler - Maps physical paths to source path names output by the compiler + 将物理路径映射到编译器输出的源路径名 --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) + --pathmap 只能与可移植的 PDB 一起使用(--debug:portable 或 --debug:embedded) Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' + 路径映射无效。映射必须以逗号分隔,且采用 "path=sourcePath" 格式 diff --git a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf index 0f67d46dbc..e2c21c864b 100644 --- a/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/fsharp/xlf/FSComp.txt.zh-Hant.xlf @@ -4,7 +4,7 @@ {0} for F# {1} - {0} for F# {1} + F # {1} 的 {0} @@ -144,7 +144,7 @@ Use reference assemblies for .NET framework references when available (Enabled by default). - Use reference assemblies for .NET framework references when available (Enabled by default). + 請在可行的情況下使用適用於 .NET 架構參考的參考組件 (預設會啟用)。 @@ -5549,7 +5549,7 @@ Deterministic builds only support portable PDBs (--debug:portable or --debug:embedded) - 確定性組建僅支援可攜式 PDB (--debug:portable 或 --debug:embedded) + 確定性組建僅支援可攜式 PDB (--debug:portable 或 --debug:embedded) @@ -7164,17 +7164,17 @@ Maps physical paths to source path names output by the compiler - Maps physical paths to source path names output by the compiler + 將實體路徑對應至來源路徑名稱,由編譯器輸出 --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) - --pathmap can only be used with portable PDBs (--debug:portable or --debug:embedded) + --pathmap 只能搭配可攜式 PDB 使用 (--debug:portable 或 --debug:embedded) Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' - Invalid path map. Mappings must be comma separated and of the format 'path=sourcePath' + 路徑對應無效。對應必須以逗號分隔,且格式應為 'path=sourcePath' diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.cs.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.cs.xlf index 860555f344..a678a4bcfe 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.cs.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.cs.xlf @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.de.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.de.xlf index 65b4328fdc..662133483e 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.de.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.de.xlf @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.es.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.es.xlf index 1153755c3d..41dbc88f0b 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.es.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.es.xlf @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.fr.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.fr.xlf index cd60e9f07e..0f1e16e95f 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.fr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.fr.xlf @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.it.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.it.xlf index dd58cb9a11..8902030751 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.it.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.it.xlf @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ja.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ja.xlf index bdb896a5c8..a39e49dfa0 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ja.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ja.xlf @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ko.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ko.xlf index 6f540b5425..e7191ac3c4 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ko.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ko.xlf @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pl.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pl.xlf index 73bef853b9..d0675bd2fc 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pl.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pl.xlf @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pt-BR.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pt-BR.xlf index 3e8a169348..acfade8884 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pt-BR.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.pt-BR.xlf @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ru.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ru.xlf index 2b5303d91d..355d363084 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ru.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.ru.xlf @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.tr.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.tr.xlf index 73a72b806a..86ac32f4b3 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.tr.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.tr.xlf @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hans.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hans.xlf index 474f99a3dc..0537632d5f 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hans.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hans.xlf @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hant.xlf b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hant.xlf index 16b7339b2a..17c64ffefb 100644 --- a/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hant.xlf +++ b/vsintegration/src/FSharp.ProjectSystem.PropertyPages/Resources/xlf/Microsoft.VisualStudio.Editors.Designer.zh-Hant.xlf @@ -1828,9 +1828,8 @@ CONSIDER: get this from CodeDom {0} x {1} - {0} x {1} + {0} x {1} Format string for showing a graphic's size - # {0} = width (as an integer) # {1} = height (as an integer) #Example, for a bitmap of width=123, height = 456, the English version of this string would be "123x456" diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf index 9da4f3c87a..973cdbd6e9 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.cs.xlf @@ -104,7 +104,7 @@ Text hover - Text hover + Přechod myší nad textem @@ -199,7 +199,7 @@ (Preview) Use out of process language server - (Preview) Use out of process language server + (Preview) Použít mimoprocesový jazykový server diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf index 594bdd6a66..c2defd7c40 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.de.xlf @@ -104,7 +104,7 @@ Text hover - Text hover + Texthover @@ -199,7 +199,7 @@ (Preview) Use out of process language server - (Preview) Use out of process language server + (Vorschauversion) Prozessexternen Sprachserver verwenden diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf index 0dd79115a6..2b0507a438 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.es.xlf @@ -104,7 +104,7 @@ Text hover - Text hover + Texto al pasar el puntero @@ -199,7 +199,7 @@ (Preview) Use out of process language server - (Preview) Use out of process language server + (Versión preliminar) Usar el servidor de lenguaje fuera del proceso diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf index 6cd6347170..423d9c97c8 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.fr.xlf @@ -104,7 +104,7 @@ Text hover - Text hover + Survol du texte @@ -199,7 +199,7 @@ (Preview) Use out of process language server - (Preview) Use out of process language server + (Préversion) Utiliser un serveur de langage hors processus diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf index a053b86591..a577a1e315 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.it.xlf @@ -104,7 +104,7 @@ Text hover - Text hover + Passaggio del puntatore sul testo @@ -199,7 +199,7 @@ (Preview) Use out of process language server - (Preview) Use out of process language server + (Anteprima) Usa server di linguaggio out-of-process diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf index 444ceb8b6d..de08a58854 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ja.xlf @@ -104,7 +104,7 @@ Text hover - Text hover + テキスト ホバー @@ -199,7 +199,7 @@ (Preview) Use out of process language server - (Preview) Use out of process language server + (プレビュー) プロセス外言語サーバーの使用 diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf index b8b14271ac..0651ce96fa 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ko.xlf @@ -104,7 +104,7 @@ Text hover - Text hover + 텍스트 호버 @@ -199,7 +199,7 @@ (Preview) Use out of process language server - (Preview) Use out of process language server + (미리 보기) Out of Process 언어 서버 사용 diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf index e0f43b53d9..1c6085f856 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pl.xlf @@ -104,7 +104,7 @@ Text hover - Text hover + Najechanie kursorem na tekst @@ -199,7 +199,7 @@ (Preview) Use out of process language server - (Preview) Use out of process language server + (Wersja zapoznawcza) Korzystanie z serwera języka poza procesem diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf index a23bcaf79d..2fca2b08f6 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.pt-BR.xlf @@ -104,7 +104,7 @@ Text hover - Text hover + Foco do texto @@ -199,7 +199,7 @@ (Preview) Use out of process language server - (Preview) Use out of process language server + (Versão Prévia) Usar um servidor de idioma fora do processo diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf index 8a8a30892f..de85346435 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.ru.xlf @@ -104,7 +104,7 @@ Text hover - Text hover + Текст, отображаемый при наведении @@ -199,7 +199,7 @@ (Preview) Use out of process language server - (Preview) Use out of process language server + (Предварительная версия) Использование сервера языка процессов diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf index 228bd69b6c..dd44a1a1b4 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.tr.xlf @@ -104,7 +104,7 @@ Text hover - Text hover + Metni vurgulama @@ -199,7 +199,7 @@ (Preview) Use out of process language server - (Preview) Use out of process language server + (Önizleme) İşlem dışı dil sunucusunu kullanma diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf index 0db63d7df1..ba5c37bf74 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hans.xlf @@ -104,7 +104,7 @@ Text hover - Text hover + 文本悬停 @@ -199,7 +199,7 @@ (Preview) Use out of process language server - (Preview) Use out of process language server + (预览)使用进程外语言服务器 diff --git a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf index ea7c015a9d..db714fc7bc 100644 --- a/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf +++ b/vsintegration/src/FSharp.UIResources/xlf/Strings.zh-Hant.xlf @@ -104,7 +104,7 @@ Text hover - Text hover + 文字暫留 @@ -199,7 +199,7 @@ (Preview) Use out of process language server - (Preview) Use out of process language server + (預覽) 使用處理序語言伺服器 From ecd5448d1b25ee65877f905633eab0c68180ddc1 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 1 Jul 2019 12:57:11 -0700 Subject: [PATCH 100/159] Update dependencies from https://github.com/dotnet/arcade build 20190630.1 (#7088) - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19330.1 --- NuGet.config | 2 +- eng/Version.Details.xml | 4 +- eng/common/post-build/nuget-validation.ps1 | 28 +++ eng/common/post-build/promote-build.ps1 | 53 ++++++ .../post-build/sourcelink-validation.ps1 | 28 +-- .../post-build/trigger-subscriptions.ps1 | 69 +++++++ eng/common/sdl/extract-artifact-packages.ps1 | 70 ++++++++ eng/common/sdl/packages.config | 2 +- eng/common/templates/job/execute-sdl.yml | 12 +- .../templates/job/publish-build-assets.yml | 1 - .../channels/internal-servicing.yml | 170 ++++++++++++++++++ .../channels/public-dev-release.yml | 59 ++++-- .../post-build/channels/public-release.yml | 170 ++++++++++++++++++ .../channels/public-validation-release.yml | 52 ++++-- .../templates/post-build/common-variables.yml | 9 + .../templates/post-build/post-build.yml | 24 +++ .../templates/post-build/promote-build.yml | 12 +- .../post-build/setup-maestro-vars.yml | 4 +- .../post-build/trigger-subscription.yml | 11 ++ global.json | 4 +- 20 files changed, 720 insertions(+), 64 deletions(-) create mode 100644 eng/common/post-build/nuget-validation.ps1 create mode 100644 eng/common/post-build/promote-build.ps1 create mode 100644 eng/common/post-build/trigger-subscriptions.ps1 create mode 100644 eng/common/sdl/extract-artifact-packages.ps1 create mode 100644 eng/common/templates/post-build/channels/internal-servicing.yml create mode 100644 eng/common/templates/post-build/channels/public-release.yml create mode 100644 eng/common/templates/post-build/trigger-subscription.yml diff --git a/NuGet.config b/NuGet.config index fdf6d3eda4..8f21de1b15 100644 --- a/NuGet.config +++ b/NuGet.config @@ -1,4 +1,4 @@ - + diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 309516901a..b7f5189a27 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - 9946534da4f73e6242ca105f6798ab58119c9ab0 + 89fab80685c91024c8f9e21f1c37f62580f648f8 diff --git a/eng/common/post-build/nuget-validation.ps1 b/eng/common/post-build/nuget-validation.ps1 new file mode 100644 index 0000000000..1bdced1e30 --- /dev/null +++ b/eng/common/post-build/nuget-validation.ps1 @@ -0,0 +1,28 @@ +# This script validates NuGet package metadata information using this +# tool: https://github.com/NuGet/NuGetGallery/tree/jver-verify/src/VerifyMicrosoftPackage + +param( + [Parameter(Mandatory=$true)][string] $PackagesPath, # Path to where the packages to be validated are + [Parameter(Mandatory=$true)][string] $ToolDestinationPath # Where the validation tool should be downloaded to +) + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 2.0 + +. $PSScriptRoot\..\tools.ps1 + +try { + $url = "https://raw.githubusercontent.com/NuGet/NuGetGallery/jver-verify/src/VerifyMicrosoftPackage/verify.ps1" + + New-Item -ItemType "directory" -Path ${ToolDestinationPath} -Force + + Invoke-WebRequest $url -OutFile ${ToolDestinationPath}\verify.ps1 + + & ${ToolDestinationPath}\verify.ps1 ${PackagesPath}\*.nupkg +} +catch { + Write-PipelineTaskError "NuGet package validation failed. Please check error logs." + Write-Host $_ + Write-Host $_.ScriptStackTrace + ExitWithExitCode 1 +} diff --git a/eng/common/post-build/promote-build.ps1 b/eng/common/post-build/promote-build.ps1 new file mode 100644 index 0000000000..84a608fa56 --- /dev/null +++ b/eng/common/post-build/promote-build.ps1 @@ -0,0 +1,53 @@ +param( + [Parameter(Mandatory=$true)][int] $BuildId, + [Parameter(Mandatory=$true)][int] $ChannelId, + [Parameter(Mandatory=$true)][string] $BarToken, + [string] $MaestroEndpoint = "https://maestro-prod.westus2.cloudapp.azure.com", + [string] $ApiVersion = "2019-01-16" +) + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 2.0 + +. $PSScriptRoot\..\tools.ps1 + +function Get-Headers([string]$accept, [string]$barToken) { + $headers = New-Object 'System.Collections.Generic.Dictionary[[String],[String]]' + $headers.Add('Accept',$accept) + $headers.Add('Authorization',"Bearer $barToken") + return $headers +} + +try { + $maestroHeaders = Get-Headers 'application/json' $BarToken + + # Get info about which channels the build has already been promoted to + $getBuildApiEndpoint = "$MaestroEndpoint/api/builds/${BuildId}?api-version=$ApiVersion" + $buildInfo = Invoke-WebRequest -Method Get -Uri $getBuildApiEndpoint -Headers $maestroHeaders | ConvertFrom-Json + + if (!$buildInfo) { + Write-Host "Build with BAR ID $BuildId was not found in BAR!" + ExitWithExitCode 1 + } + + # Find whether the build is already assigned to the channel or not + if ($buildInfo.channels) { + foreach ($channel in $buildInfo.channels) { + if ($channel.Id -eq $ChannelId) { + Write-Host "The build with BAR ID $BuildId is already on channel $ChannelId!" + ExitWithExitCode 0 + } + } + } + + Write-Host "Build not present in channel $ChannelId. Promoting build ... " + + $promoteBuildApiEndpoint = "$maestroEndpoint/api/channels/${ChannelId}/builds/${BuildId}?api-version=$ApiVersion" + Invoke-WebRequest -Method Post -Uri $promoteBuildApiEndpoint -Headers $maestroHeaders + Write-Host "done." +} +catch { + Write-Host "There was an error while trying to promote build '$BuildId' to channel '$ChannelId'" + Write-Host $_ + Write-Host $_.ScriptStackTrace +} diff --git a/eng/common/post-build/sourcelink-validation.ps1 b/eng/common/post-build/sourcelink-validation.ps1 index 84c97df1fc..8abd684e9e 100644 --- a/eng/common/post-build/sourcelink-validation.ps1 +++ b/eng/common/post-build/sourcelink-validation.ps1 @@ -11,13 +11,13 @@ Set-StrictMode -Version 2.0 . $PSScriptRoot\..\tools.ps1 -# Cache/HashMap (File -> Exist flag) used to consult whether a file exist +# Cache/HashMap (File -> Exist flag) used to consult whether a file exist # in the repository at a specific commit point. This is populated by inserting # all files present in the repo at a specific commit point. $global:RepoFiles = @{} $ValidatePackage = { - param( + param( [string] $PackagePath # Full path to a Symbols.NuGet package ) @@ -32,7 +32,7 @@ $ValidatePackage = { # Extensions for which we'll look for SourceLink information # For now we'll only care about Portable & Embedded PDBs $RelevantExtensions = @(".dll", ".exe", ".pdb") - + Write-Host -NoNewLine "Validating" ([System.IO.Path]::GetFileName($PackagePath)) "... " $PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath) @@ -46,13 +46,13 @@ $ValidatePackage = { try { $zip = [System.IO.Compression.ZipFile]::OpenRead($PackagePath) - $zip.Entries | + $zip.Entries | Where-Object {$RelevantExtensions -contains [System.IO.Path]::GetExtension($_.Name)} | ForEach-Object { $FileName = $_.FullName $Extension = [System.IO.Path]::GetExtension($_.Name) $FakeName = -Join((New-Guid), $Extension) - $TargetFile = Join-Path -Path $ExtractPath -ChildPath $FakeName + $TargetFile = Join-Path -Path $ExtractPath -ChildPath $FakeName # We ignore resource DLLs if ($FileName.EndsWith(".resources.dll")) { @@ -62,7 +62,7 @@ $ValidatePackage = { [System.IO.Compression.ZipFileExtensions]::ExtractToFile($_, $TargetFile, $true) $ValidateFile = { - param( + param( [string] $FullPath, # Full path to the module that has to be checked [string] $RealPath, [ref] $FailedFiles @@ -83,7 +83,7 @@ $ValidatePackage = { ForEach-Object { $Link = $_ $CommitUrl = "https://raw.githubusercontent.com/${using:GHRepoName}/${using:GHCommit}/" - + $FilePath = $Link.Replace($CommitUrl, "") $Status = 200 $Cache = $using:RepoFiles @@ -91,7 +91,7 @@ $ValidatePackage = { if ( !($Cache.ContainsKey($FilePath)) ) { try { $Uri = $Link -as [System.URI] - + # Only GitHub links are valid if ($Uri.AbsoluteURI -ne $null -and ($Uri.Host -match "github" -or $Uri.Host -match "githubusercontent")) { $Status = (Invoke-WebRequest -Uri $Link -UseBasicParsing -Method HEAD -TimeoutSec 5).StatusCode @@ -128,15 +128,15 @@ $ValidatePackage = { } } } - + &$ValidateFile $TargetFile $FileName ([ref]$FailedFiles) } } catch { - + } finally { - $zip.Dispose() + $zip.Dispose() } if ($FailedFiles -eq 0) { @@ -163,13 +163,13 @@ function ValidateSourceLinkLinks { ExitWithExitCode 1 } - $RepoTreeURL = -Join("https://api.github.com/repos/", $GHRepoName, "/git/trees/", $GHCommit, "?recursive=1") + $RepoTreeURL = -Join("http://api.github.com/repos/", $GHRepoName, "/git/trees/", $GHCommit, "?recursive=1") $CodeExtensions = @(".cs", ".vb", ".fs", ".fsi", ".fsx", ".fsscript") try { # Retrieve the list of files in the repo at that particular commit point and store them in the RepoFiles hash $Data = Invoke-WebRequest $RepoTreeURL -UseBasicParsing | ConvertFrom-Json | Select-Object -ExpandProperty tree - + foreach ($file in $Data) { $Extension = [System.IO.Path]::GetExtension($file.path) @@ -183,7 +183,7 @@ function ValidateSourceLinkLinks { Write-Host $_ ExitWithExitCode 1 } - + if (Test-Path $ExtractPath) { Remove-Item $ExtractPath -Force -Recurse -ErrorAction SilentlyContinue } diff --git a/eng/common/post-build/trigger-subscriptions.ps1 b/eng/common/post-build/trigger-subscriptions.ps1 new file mode 100644 index 0000000000..db8a839457 --- /dev/null +++ b/eng/common/post-build/trigger-subscriptions.ps1 @@ -0,0 +1,69 @@ +param( + [Parameter(Mandatory=$true)][string] $SourceRepo, + [Parameter(Mandatory=$true)][int] $ChannelId, + [string] $MaestroEndpoint = "https://maestro-prod.westus2.cloudapp.azure.com", + [string] $BarToken, + [string] $ApiVersion = "2019-01-16" +) + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 2.0 + +. $PSScriptRoot\..\tools.ps1 + +function Get-Headers([string]$accept, [string]$barToken) { + $headers = New-Object 'System.Collections.Generic.Dictionary[[String],[String]]' + $headers.Add('Accept',$accept) + $headers.Add('Authorization',"Bearer $barToken") + return $headers +} + +# Get all the $SourceRepo subscriptions +$normalizedSurceRepo = $SourceRepo.Replace('dnceng@', '') +$getSubscriptionsApiEndpoint = "$maestroEndpoint/api/subscriptions?sourceRepository=$normalizedSurceRepo&api-version=$apiVersion" +$headers = Get-Headers 'application/json' $barToken + +$subscriptions = Invoke-WebRequest -Uri $getSubscriptionsApiEndpoint -Headers $headers | ConvertFrom-Json + +if (!$subscriptions) { + Write-Host "No subscriptions found for source repo '$normalizedSurceRepo' in channel '$ChannelId'" + return +} + +$subscriptionsToTrigger = New-Object System.Collections.Generic.List[string] +$failedTriggeredSubscription = $false + +# Get all enabled subscriptions that need dependency flow on 'everyBuild' +foreach ($subscription in $subscriptions) { + if ($subscription.enabled -and $subscription.policy.updateFrequency -like 'everyBuild' -and $subscription.channel.id -eq $ChannelId) { + Write-Host "$subscription.id" + [void]$subscriptionsToTrigger.Add($subscription.id) + } +} + +foreach ($subscriptionToTrigger in $subscriptionsToTrigger) { + try { + $triggerSubscriptionApiEndpoint = "$maestroEndpoint/api/subscriptions/$subscriptionToTrigger/trigger?api-version=$apiVersion" + $headers = Get-Headers 'application/json' $BarToken + + Write-Host "Triggering subscription '$subscriptionToTrigger'..." + + Invoke-WebRequest -Uri $triggerSubscriptionApiEndpoint -Headers $headers -Method Post + + Write-Host "Subscription '$subscriptionToTrigger' triggered!" + } + catch + { + Write-Host "There was an error while triggering subscription '$subscriptionToTrigger'" + Write-Host $_ + Write-Host $_.ScriptStackTrace + $failedTriggeredSubscription = $true + } +} + +if ($failedTriggeredSubscription) { + Write-Host "At least one subscription failed to be triggered..." + ExitWithExitCode 1 +} + +Write-Host "All subscriptions were triggered successfully!" diff --git a/eng/common/sdl/extract-artifact-packages.ps1 b/eng/common/sdl/extract-artifact-packages.ps1 new file mode 100644 index 0000000000..1fdbb14329 --- /dev/null +++ b/eng/common/sdl/extract-artifact-packages.ps1 @@ -0,0 +1,70 @@ +param( + [Parameter(Mandatory=$true)][string] $InputPath, # Full path to directory where artifact packages are stored + [Parameter(Mandatory=$true)][string] $ExtractPath # Full path to directory where the packages will be extracted +) + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 2.0 +$ExtractPackage = { + param( + [string] $PackagePath # Full path to a NuGet package + ) + + if (!(Test-Path $PackagePath)) { + Write-PipelineTaskError "Input file does not exist: $PackagePath" + ExitWithExitCode 1 + } + + $RelevantExtensions = @(".dll", ".exe", ".pdb") + Write-Host -NoNewLine "Extracting" ([System.IO.Path]::GetFileName($PackagePath)) "... " + + $PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath) + $ExtractPath = Join-Path -Path $using:ExtractPath -ChildPath $PackageId + + Add-Type -AssemblyName System.IO.Compression.FileSystem + + [System.IO.Directory]::CreateDirectory($ExtractPath); + + try { + $zip = [System.IO.Compression.ZipFile]::OpenRead($PackagePath) + + $zip.Entries | + Where-Object {$RelevantExtensions -contains [System.IO.Path]::GetExtension($_.Name)} | + ForEach-Object { + $TargetFile = Join-Path -Path $ExtractPath -ChildPath $_.Name + + [System.IO.Compression.ZipFileExtensions]::ExtractToFile($_, $TargetFile, $true) + } + } + catch { + + } + finally { + $zip.Dispose() + } + } + function ExtractArtifacts { + if (!(Test-Path $InputPath)) { + Write-Host "Input Path does not exist: $InputPath" + ExitWithExitCode 0 + } + $Jobs = @() + Get-ChildItem "$InputPath\*.nupkg" | + ForEach-Object { + $Jobs += Start-Job -ScriptBlock $ExtractPackage -ArgumentList $_.FullName + } + + foreach ($Job in $Jobs) { + Wait-Job -Id $Job.Id | Receive-Job + } +} + +try { + Measure-Command { ExtractArtifacts } +} +catch { + Write-Host $_ + Write-Host $_.Exception + Write-Host $_.ScriptStackTrace + ExitWithExitCode 1 +} diff --git a/eng/common/sdl/packages.config b/eng/common/sdl/packages.config index b054737df1..fb9b712863 100644 --- a/eng/common/sdl/packages.config +++ b/eng/common/sdl/packages.config @@ -1,4 +1,4 @@  - + diff --git a/eng/common/templates/job/execute-sdl.yml b/eng/common/templates/job/execute-sdl.yml index acb4c55d73..5837f3d56d 100644 --- a/eng/common/templates/job/execute-sdl.yml +++ b/eng/common/templates/job/execute-sdl.yml @@ -20,6 +20,16 @@ jobs: downloadType: specific files matchingPattern: "**" downloadPath: $(Build.SourcesDirectory)\artifacts + - powershell: eng/common/sdl/extract-artifact-packages.ps1 + -InputPath $(Build.SourcesDirectory)\artifacts\BlobArtifacts + -ExtractPath $(Build.SourcesDirectory)\artifacts\BlobArtifacts + displayName: Extract Blob Artifacts + continueOnError: ${{ parameters.continueOnError }} + - powershell: eng/common/sdl/extract-artifact-packages.ps1 + -InputPath $(Build.SourcesDirectory)\artifacts\PackageArtifacts + -ExtractPath $(Build.SourcesDirectory)\artifacts\PackageArtifacts + displayName: Extract Package Artifacts + continueOnError: ${{ parameters.continueOnError }} - task: NuGetToolInstaller@1 displayName: 'Install NuGet.exe' - task: NuGetCommand@2 @@ -36,7 +46,7 @@ jobs: continueOnError: ${{ parameters.continueOnError }} - ${{ if eq(parameters.overrideParameters, '') }}: - powershell: eng/common/sdl/execute-all-sdl-tools.ps1 - -GuardianPackageName Microsoft.Guardian.Cli.0.3.2 + -GuardianPackageName Microsoft.Guardian.Cli.0.6.0 -NugetPackageDirectory $(Build.SourcesDirectory)\.packages -AzureDevOpsAccessToken $(dn-bot-dotnet-build-rw-code-rw) ${{ parameters.additionalParameters }} diff --git a/eng/common/templates/job/publish-build-assets.yml b/eng/common/templates/job/publish-build-assets.yml index ff7346163f..9e77ef1b54 100644 --- a/eng/common/templates/job/publish-build-assets.yml +++ b/eng/common/templates/job/publish-build-assets.yml @@ -66,7 +66,6 @@ jobs: script: | Add-Content -Path "$(Build.StagingDirectory)/ReleaseConfigs.txt" -Value $(BARBuildId) Add-Content -Path "$(Build.StagingDirectory)/ReleaseConfigs.txt" -Value "$(DefaultChannels)" - Add-Content -Path "$(Build.StagingDirectory)/ReleaseConfigs.txt" -Value $(IsInternalBuild) Add-Content -Path "$(Build.StagingDirectory)/ReleaseConfigs.txt" -Value $(IsStableBuild) - task: PublishBuildArtifacts@1 displayName: Publish ReleaseConfigs Artifact diff --git a/eng/common/templates/post-build/channels/internal-servicing.yml b/eng/common/templates/post-build/channels/internal-servicing.yml new file mode 100644 index 0000000000..808d46b17f --- /dev/null +++ b/eng/common/templates/post-build/channels/internal-servicing.yml @@ -0,0 +1,170 @@ +parameters: + enableSymbolValidation: true + +stages: +- stage: IS_Publish + dependsOn: validate + variables: + - template: ../common-variables.yml + displayName: Internal Servicing + jobs: + - template: ../setup-maestro-vars.yml + + - job: + displayName: Symbol Publishing + dependsOn: setupMaestroVars + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.InternalServicing_30_Channel_Id) + variables: + - group: DotNet-Symbol-Server-Pats + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Artifacts + inputs: + downloadType: specific files + matchingPattern: "*Artifacts*" + + - task: PowerShell@2 + displayName: Publish + inputs: + filePath: eng\common\sdk-task.ps1 + arguments: -task PublishToSymbolServers -restore -msbuildEngine dotnet + /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) + /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) + /p:PDBArtifactsDirectory='$(Build.ArtifactStagingDirectory)/PDBArtifacts/' + /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' + /p:Configuration=Release + + - job: publish_assets + displayName: Publish Assets + dependsOn: setupMaestroVars + variables: + - group: DotNet-Blob-Feed + - group: Publish-Build-Assets + - group: AzureDevOps-Artifact-Feeds-Pats + - name: BARBuildId + value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] + - name: IsStableBuild + value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ] + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.InternalServicing_30_Channel_Id) + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Package Artifacts + inputs: + buildType: current + artifactName: PackageArtifacts + + - task: DownloadBuildArtifacts@0 + displayName: Download Blob Artifacts + inputs: + buildType: current + artifactName: BlobArtifacts + + - task: DownloadBuildArtifacts@0 + displayName: Download Asset Manifests + inputs: + buildType: current + artifactName: AssetManifests + + - task: PowerShell@2 + displayName: Add Assets Location + env: + AZURE_DEVOPS_EXT_PAT: $(dn-bot-dnceng-unviersal-packages-rw) + inputs: + filePath: eng\common\sdk-task.ps1 + arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet + /p:ChannelId=$(InternalServicing_30_Channel_Id) + /p:IsStableBuild=$(IsStableBuild) + /p:IsInternalBuild=$(IsInternalBuild) + /p:RepositoryName=$(Build.Repository.Name) + /p:CommitSha=$(Build.SourceVersion) + /p:NugetPath=$(Agent.BuildDirectory)\Nuget\NuGet.exe + /p:AzdoTargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' + /p:TargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' + /p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)' + /p:BARBuildId=$(BARBuildId) + /p:MaestroApiEndpoint='https://maestro-prod.westus2.cloudapp.azure.com' + /p:BuildAssetRegistryToken='$(MaestroAccessToken)' + /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' + /p:BlobBasePath='$(Build.ArtifactStagingDirectory)\BlobArtifacts' + /p:PackageBasePath='$(Build.ArtifactStagingDirectory)\PackageArtifacts' + /p:Configuration=Release + + - task: NuGetCommand@2 + displayName: Publish Packages to AzDO Feed + condition: contains(variables['TargetAzDOFeed'], 'pkgs.visualstudio.com') + inputs: + command: push + vstsFeed: $(AzDoFeedName) + packagesToPush: $(Build.ArtifactStagingDirectory)\PackageArtifacts\*.nupkg + publishVstsFeed: $(AzDoFeedName) + + - task: PowerShell@2 + displayName: Publish Blobs to AzDO Feed + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-blobs-to-azdo.ps1 + arguments: -FeedName $(AzDoFeedName) + -SourceFolderCollection $(Build.ArtifactStagingDirectory)/BlobArtifacts/ + -PersonalAccessToken $(dn-bot-dnceng-unviersal-packages-rw) + enabled: false + + - template: ../trigger-subscription.yml + parameters: + ChannelId: ${{ variables.InternalServicing_30_Channel_Id }} + +- stage: IS_PublishValidation + displayName: Publish Validation + variables: + - template: ../common-variables.yml + jobs: + - template: ../setup-maestro-vars.yml + + - ${{ if eq(parameters.enableSymbolValidation, 'true') }}: + - job: + displayName: Symbol Availability + dependsOn: setupMaestroVars + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.InternalServicing_30_Channel_Id) + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Package Artifacts + inputs: + buildType: current + artifactName: PackageArtifacts + + - task: PowerShell@2 + displayName: Check Symbol Availability + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/post-build/symbols-validation.ps1 + arguments: -InputPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/ -ExtractPath $(Agent.BuildDirectory)/Temp/ -DotnetSymbolVersion $(SymbolToolVersion) + + - job: + displayName: Gather Drop + dependsOn: setupMaestroVars + variables: + BARBuildId: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.InternalServicing_30_Channel_Id) + pool: + vmImage: 'windows-2019' + steps: + - task: PowerShell@2 + displayName: Setup Darc CLI + inputs: + targetType: filePath + filePath: '$(Build.SourcesDirectory)/eng/common/darc-init.ps1' + + - task: PowerShell@2 + displayName: Run Darc gather-drop + inputs: + targetType: inline + script: | + darc gather-drop --non-shipping --continue-on-error --id $(BARBuildId) --output-dir $(Agent.BuildDirectory)/Temp/Drop/ --bar-uri https://maestro-prod.westus2.cloudapp.azure.com/ --password $(MaestroAccessToken) --latest-location + enabled: false + + - template: ../promote-build.yml + parameters: + ChannelId: ${{ variables.InternalServicing_30_Channel_Id }} \ No newline at end of file diff --git a/eng/common/templates/post-build/channels/public-dev-release.yml b/eng/common/templates/post-build/channels/public-dev-release.yml index c61eaa927d..79c6822db7 100644 --- a/eng/common/templates/post-build/channels/public-dev-release.yml +++ b/eng/common/templates/post-build/channels/public-dev-release.yml @@ -20,17 +20,10 @@ stages: vmImage: 'windows-2019' steps: - task: DownloadBuildArtifacts@0 - displayName: Download PDB Artifacts + displayName: Download Artifacts inputs: - buildType: current - artifactName: PDBArtifacts - continueOnError: true - - - task: DownloadBuildArtifacts@0 - displayName: Download Blob Artifacts - inputs: - buildType: current - artifactName: BlobArtifacts + downloadType: specific files + matchingPattern: "*Artifacts*" - task: PowerShell@2 displayName: Publish @@ -44,13 +37,16 @@ stages: /p:Configuration=Release - job: - displayName: Publish to Static Feed + displayName: Publish Assets dependsOn: setupMaestroVars variables: - group: DotNet-Blob-Feed - group: Publish-Build-Assets + - group: AzureDevOps-Artifact-Feeds-Pats - name: BARBuildId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] + - name: IsStableBuild + value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ] condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicDevRelease_30_Channel_Id) pool: vmImage: 'windows-2019' @@ -74,22 +70,47 @@ stages: artifactName: AssetManifests - task: PowerShell@2 - displayName: Publish + displayName: Add Assets Location + env: + AZURE_DEVOPS_EXT_PAT: $(dn-bot-dnceng-unviersal-packages-rw) inputs: filePath: eng\common\sdk-task.ps1 - arguments: -task PublishToPackageFeed -restore -msbuildEngine dotnet - /p:AccountKeyToStaticFeed='$(dotnetfeed-storage-access-key-1)' + arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet + /p:ChannelId=$(PublicDevRelease_30_Channel_Id) + /p:IsStableBuild=$(IsStableBuild) + /p:IsInternalBuild=$(IsInternalBuild) + /p:RepositoryName=$(Build.Repository.Name) + /p:CommitSha=$(Build.SourceVersion) + /p:NugetPath=$(Agent.BuildDirectory)\Nuget\NuGet.exe + /p:AzdoTargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' + /p:TargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' + /p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)' /p:BARBuildId=$(BARBuildId) /p:MaestroApiEndpoint='https://maestro-prod.westus2.cloudapp.azure.com' /p:BuildAssetRegistryToken='$(MaestroAccessToken)' /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts/' - /p:ArtifactsCategory='$(_DotNetArtifactsCategory)' - /p:OverrideAssetsWithSameName=true - /p:PassIfExistingItemIdentical=true /p:Configuration=Release + - task: NuGetCommand@2 + displayName: Publish Packages to AzDO Feed + condition: contains(variables['TargetAzDOFeed'], 'pkgs.visualstudio.com') + inputs: + command: push + vstsFeed: $(AzDoFeedName) + packagesToPush: $(Build.ArtifactStagingDirectory)\PackageArtifacts\*.nupkg + publishVstsFeed: $(AzDoFeedName) + + - task: PowerShell@2 + displayName: Publish Blobs to AzDO Feed + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-blobs-to-azdo.ps1 + arguments: -FeedName $(AzDoFeedName) + -SourceFolderCollection $(Build.ArtifactStagingDirectory)/BlobArtifacts/ + -PersonalAccessToken $(dn-bot-dnceng-unviersal-packages-rw) + enabled: false + - stage: PublishValidation displayName: Publish Validation @@ -140,6 +161,6 @@ stages: script: | darc gather-drop --non-shipping --continue-on-error --id $(BARBuildId) --output-dir $(Agent.BuildDirectory)/Temp/Drop/ --bar-uri https://maestro-prod.westus2.cloudapp.azure.com/ --password $(MaestroAccessToken) --latest-location - - template: ../promote-build.yml - parameters: + - template: ../promote-build.yml + parameters: ChannelId: ${{ variables.PublicDevRelease_30_Channel_Id }} diff --git a/eng/common/templates/post-build/channels/public-release.yml b/eng/common/templates/post-build/channels/public-release.yml new file mode 100644 index 0000000000..25923020df --- /dev/null +++ b/eng/common/templates/post-build/channels/public-release.yml @@ -0,0 +1,170 @@ +parameters: + enableSymbolValidation: true + +stages: +- stage: PubRel_Publish + dependsOn: validate + variables: + - template: ../common-variables.yml + displayName: Public Release + jobs: + - template: ../setup-maestro-vars.yml + + - job: + displayName: Symbol Publishing + dependsOn: setupMaestroVars + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicRelease_30_Channel_Id) + variables: + - group: DotNet-Symbol-Server-Pats + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Artifacts + inputs: + downloadType: specific files + matchingPattern: "*Artifacts*" + + - task: PowerShell@2 + displayName: Publish + inputs: + filePath: eng\common\sdk-task.ps1 + arguments: -task PublishToSymbolServers -restore -msbuildEngine dotnet + /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) + /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) + /p:PDBArtifactsDirectory='$(Build.ArtifactStagingDirectory)/PDBArtifacts/' + /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' + /p:Configuration=Release + + - job: publish_assets + displayName: Publish Assets + dependsOn: setupMaestroVars + variables: + - group: DotNet-Blob-Feed + - group: Publish-Build-Assets + - group: AzureDevOps-Artifact-Feeds-Pats + - name: BARBuildId + value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] + - name: IsStableBuild + value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ] + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicRelease_30_Channel_Id) + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Package Artifacts + inputs: + buildType: current + artifactName: PackageArtifacts + + - task: DownloadBuildArtifacts@0 + displayName: Download Blob Artifacts + inputs: + buildType: current + artifactName: BlobArtifacts + + - task: DownloadBuildArtifacts@0 + displayName: Download Asset Manifests + inputs: + buildType: current + artifactName: AssetManifests + + - task: PowerShell@2 + displayName: Publish + env: + AZURE_DEVOPS_EXT_PAT: $(dn-bot-dnceng-unviersal-packages-rw) + inputs: + filePath: eng\common\sdk-task.ps1 + arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet + /p:ChannelId=$(PublicRelease_30_Channel_Id) + /p:IsStableBuild=$(IsStableBuild) + /p:IsInternalBuild=$(IsInternalBuild) + /p:RepositoryName=$(Build.Repository.Name) + /p:CommitSha=$(Build.SourceVersion) + /p:NugetPath=$(Agent.BuildDirectory)/Nuget/NuGet.exe + /p:AzdoTargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' + /p:TargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' + /p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)' + /p:BARBuildId=$(BARBuildId) + /p:MaestroApiEndpoint='https://maestro-prod.westus2.cloudapp.azure.com' + /p:BuildAssetRegistryToken='$(MaestroAccessToken)' + /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' + /p:BlobBasePath='$(Build.ArtifactStagingDirectory)\BlobArtifacts' + /p:PackageBasePath='$(Build.ArtifactStagingDirectory)\PackageArtifacts' + /p:Configuration=Release + + - task: NuGetCommand@2 + displayName: Publish Packages to AzDO Feed + condition: contains(variables['TargetAzDOFeed'], 'pkgs.visualstudio.com') + inputs: + command: push + vstsFeed: $(AzDoFeedName) + packagesToPush: $(Build.ArtifactStagingDirectory)\PackageArtifacts\*.nupkg + publishVstsFeed: $(AzDoFeedName) + + - task: PowerShell@2 + displayName: Publish Blobs to AzDO Feed + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-blobs-to-azdo.ps1 + arguments: -FeedName $(AzDoFeedName) + -SourceFolderCollection $(Build.ArtifactStagingDirectory)/BlobArtifacts/ + -PersonalAccessToken $(dn-bot-dnceng-unviersal-packages-rw) + enabled: false + + - template: ../trigger-subscription.yml + parameters: + ChannelId: ${{ variables.PublicRelease_30_Channel_Id }} + +- stage: PubRel_PublishValidation + displayName: Publish Validation + variables: + - template: ../common-variables.yml + jobs: + - template: ../setup-maestro-vars.yml + + - ${{ if eq(parameters.enableSymbolValidation, 'true') }}: + - job: + displayName: Symbol Availability + dependsOn: setupMaestroVars + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicRelease_30_Channel_Id) + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Package Artifacts + inputs: + buildType: current + artifactName: PackageArtifacts + + - task: PowerShell@2 + displayName: Check Symbol Availability + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/post-build/symbols-validation.ps1 + arguments: -InputPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/ -ExtractPath $(Agent.BuildDirectory)/Temp/ -DotnetSymbolVersion $(SymbolToolVersion) + + - job: + displayName: Gather Drop + dependsOn: setupMaestroVars + variables: + BARBuildId: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicRelease_30_Channel_Id) + pool: + vmImage: 'windows-2019' + steps: + - task: PowerShell@2 + displayName: Setup Darc CLI + inputs: + targetType: filePath + filePath: '$(Build.SourcesDirectory)/eng/common/darc-init.ps1' + + - task: PowerShell@2 + displayName: Run Darc gather-drop + inputs: + targetType: inline + script: | + darc gather-drop --non-shipping --continue-on-error --id $(BARBuildId) --output-dir $(Agent.BuildDirectory)/Temp/Drop/ --bar-uri https://maestro-prod.westus2.cloudapp.azure.com/ --password $(MaestroAccessToken) --latest-location + enabled: false + + - template: ../promote-build.yml + parameters: + ChannelId: ${{ variables.PublicRelease_30_Channel_Id }} diff --git a/eng/common/templates/post-build/channels/public-validation-release.yml b/eng/common/templates/post-build/channels/public-validation-release.yml index 23725c6d62..114477d3ad 100644 --- a/eng/common/templates/post-build/channels/public-validation-release.yml +++ b/eng/common/templates/post-build/channels/public-validation-release.yml @@ -8,14 +8,17 @@ stages: - template: ../setup-maestro-vars.yml - job: - displayName: Publish to Static Feed + displayName: Publish Assets dependsOn: setupMaestroVars - condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicValidationRelease_30_Channel_Id) variables: - group: DotNet-Blob-Feed - group: Publish-Build-Assets + - group: AzureDevOps-Artifact-Feeds-Pats - name: BARBuildId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] + - name: IsStableBuild + value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ] + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicValidationRelease_30_Channel_Id) pool: vmImage: 'windows-2019' steps: @@ -38,21 +41,46 @@ stages: artifactName: AssetManifests - task: PowerShell@2 - displayName: Publish + displayName: Add Assets Location + env: + AZURE_DEVOPS_EXT_PAT: $(dn-bot-dnceng-unviersal-packages-rw) inputs: filePath: eng\common\sdk-task.ps1 - arguments: -task PublishToPackageFeed -restore -msbuildEngine dotnet - /p:AccountKeyToStaticFeed='$(dotnetfeed-storage-access-key-1)' + arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet + /p:ChannelId=$(PublicValidationRelease_30_Channel_Id) + /p:IsStableBuild=$(IsStableBuild) + /p:IsInternalBuild=$(IsInternalBuild) + /p:RepositoryName=$(Build.Repository.Name) + /p:CommitSha=$(Build.SourceVersion) + /p:NugetPath=$(Agent.BuildDirectory)\Nuget\NuGet.exe + /p:AzdoTargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' + /p:TargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' + /p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)' /p:BARBuildId=$(BARBuildId) /p:MaestroApiEndpoint='https://maestro-prod.westus2.cloudapp.azure.com' /p:BuildAssetRegistryToken='$(MaestroAccessToken)' /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' - /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' - /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts/' - /p:ArtifactsCategory='$(_DotNetArtifactsCategory)' - /p:OverrideAssetsWithSameName=true - /p:PassIfExistingItemIdentical=true + /p:BlobBasePath='$(Build.ArtifactStagingDirectory)\BlobArtifacts' + /p:PackageBasePath='$(Build.ArtifactStagingDirectory)\PackageArtifacts' /p:Configuration=Release + + - task: NuGetCommand@2 + displayName: Publish Packages to AzDO Feed + condition: contains(variables['TargetAzDOFeed'], 'pkgs.visualstudio.com') + inputs: + command: push + vstsFeed: $(AzDoFeedName) + packagesToPush: $(Build.ArtifactStagingDirectory)\PackageArtifacts\*.nupkg + publishVstsFeed: $(AzDoFeedName) + + - task: PowerShell@2 + displayName: Publish Blobs to AzDO Feed + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-blobs-to-azdo.ps1 + arguments: -FeedName $(AzDoFeedName) + -SourceFolderCollection $(Build.ArtifactStagingDirectory)/BlobArtifacts/ + -PersonalAccessToken $(dn-bot-dnceng-unviersal-packages-rw) + enabled: false - stage: PVR_PublishValidation @@ -86,6 +114,6 @@ stages: script: | darc gather-drop --non-shipping --continue-on-error --id $(BARBuildId) --output-dir $(Agent.BuildDirectory)/Temp/Drop/ --bar-uri https://maestro-prod.westus2.cloudapp.azure.com --password $(MaestroAccessToken) --latest-location - - template: ../promote-build.yml - parameters: + - template: ../promote-build.yml + parameters: ChannelId: ${{ variables.PublicValidationRelease_30_Channel_Id }} diff --git a/eng/common/templates/post-build/common-variables.yml b/eng/common/templates/post-build/common-variables.yml index 97b48d97fe..8283467352 100644 --- a/eng/common/templates/post-build/common-variables.yml +++ b/eng/common/templates/post-build/common-variables.yml @@ -5,5 +5,14 @@ variables: # .NET Tools - Validation PublicValidationRelease_30_Channel_Id: 9 + # .NET Core 3.0 Internal Servicing + InternalServicing_30_Channel_Id: 184 + + # .NET Core 3.0 Release + PublicRelease_30_Channel_Id: 19 + + # Whether the build is internal or not + IsInternalBuild: ${{ and(ne(variables['System.TeamProject'], 'public'), contains(variables['Build.SourceBranch'], 'internal')) }} + SourceLinkCLIVersion: 3.0.0 SymbolToolVersion: 1.0.1 diff --git a/eng/common/templates/post-build/post-build.yml b/eng/common/templates/post-build/post-build.yml index 2c411dd009..daa799259c 100644 --- a/eng/common/templates/post-build/post-build.yml +++ b/eng/common/templates/post-build/post-build.yml @@ -2,6 +2,7 @@ parameters: enableSourceLinkValidation: true enableSigningValidation: true enableSymbolValidation: true + enableNugetValidation: true SDLValidationParameters: enable: false params: '' @@ -11,6 +12,25 @@ stages: dependsOn: build displayName: Validate jobs: + - ${{ if eq(parameters.enableNugetValidation, 'true') }}: + - job: + displayName: NuGet Validation + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Package Artifacts + inputs: + buildType: current + artifactName: PackageArtifacts + + - task: PowerShell@2 + displayName: Validate + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/post-build/nuget-validation.ps1 + arguments: -PackagesPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/ + -ToolDestinationPath $(Agent.BuildDirectory)/Extract/ + - ${{ if eq(parameters.enableSigningValidation, 'true') }}: - job: displayName: Signing Validation @@ -65,3 +85,7 @@ stages: enableSymbolValidation: ${{ parameters.enableSymbolValidation }} - template: \eng\common\templates\post-build\channels\public-validation-release.yml + +- template: \eng\common\templates\post-build\channels\public-release.yml + +- template: \eng\common\templates\post-build\channels\internal-servicing.yml diff --git a/eng/common/templates/post-build/promote-build.yml b/eng/common/templates/post-build/promote-build.yml index d00317003b..af48b0b339 100644 --- a/eng/common/templates/post-build/promote-build.yml +++ b/eng/common/templates/post-build/promote-build.yml @@ -18,11 +18,7 @@ jobs: - task: PowerShell@2 displayName: Add Build to Channel inputs: - targetType: inline - script: | - $headers = @{ - "Accept" = "application/json" - "Authorization" = "Bearer $(MaestroAccessToken)" - } - Invoke-RestMethod -Method Post -Headers $headers -Uri https://maestro-prod.westus2.cloudapp.azure.com/api/channels/$(ChannelId)/builds/$(BARBuildId)?api-version=2019-01-16 - enabled: false + filePath: $(Build.SourcesDirectory)/eng/common/post-build/promote-build.ps1 + arguments: -BuildId $(BARBuildId) + -ChannelId $(ChannelId) + -BarToken $(MaestroAccessToken) diff --git a/eng/common/templates/post-build/setup-maestro-vars.yml b/eng/common/templates/post-build/setup-maestro-vars.yml index 0eddd6cd3b..f6120dc1e1 100644 --- a/eng/common/templates/post-build/setup-maestro-vars.yml +++ b/eng/common/templates/post-build/setup-maestro-vars.yml @@ -28,10 +28,8 @@ jobs: $Channels = "" $Content | Select -Index 1 | ForEach-Object { $Channels += "$_ ," } - $IsInternalBuild = $Content | Select -Index 2 - $IsStableBuild = $Content | Select -Index 3 + $IsStableBuild = $Content | Select -Index 2 Write-PipelineSetVariable -Name 'BARBuildId' -Value $BarId Write-PipelineSetVariable -Name 'InitialChannels' -Value "$Channels" - Write-PipelineSetVariable -Name 'IsInternalBuild' -Value $IsInternalBuild Write-PipelineSetVariable -Name 'IsStableBuild' -Value $IsStableBuild diff --git a/eng/common/templates/post-build/trigger-subscription.yml b/eng/common/templates/post-build/trigger-subscription.yml new file mode 100644 index 0000000000..65259d4e68 --- /dev/null +++ b/eng/common/templates/post-build/trigger-subscription.yml @@ -0,0 +1,11 @@ +parameters: + ChannelId: 0 + +steps: +- task: PowerShell@2 + displayName: Triggering subscriptions + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/post-build/trigger-subscriptions.ps1 + arguments: -SourceRepo $(Build.Repository.Uri) + -ChannelId ${{ parameters.ChannelId }} + -BarToken $(MaestroAccessTokenInt) \ No newline at end of file diff --git a/global.json b/global.json index 1f44c774f6..7623ed03b7 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "tools": { - "dotnet": "3.0.100-preview5-011568", + "dotnet": "3.0.100-preview6-012264", "vs": { "version": "16.1", "components": [ @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19323.4", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19330.1", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 51d4804bc631cc5c9663de63704c0e48384c8149 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 2 Jul 2019 09:02:19 -0700 Subject: [PATCH 101/159] Update dependencies from https://github.com/dotnet/arcade build 20190701.4 (#7098) - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19351.4 --- eng/Version.Details.xml | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index b7f5189a27..a9bfa2cb00 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - 89fab80685c91024c8f9e21f1c37f62580f648f8 + 1fb1e240c889cd7f6e10cb1eacd129efa3ddb4b4 diff --git a/global.json b/global.json index 7623ed03b7..e225ab15dd 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19330.1", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19351.4", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 471940ddc1863fc0d2ba888d6b2cf5d25b725d6a Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 3 Jul 2019 12:01:24 -0700 Subject: [PATCH 102/159] Update dependencies from https://github.com/dotnet/arcade build 20190702.7 (#7107) - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19352.7 --- eng/Version.Details.xml | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index a9bfa2cb00..810004aa4d 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - 1fb1e240c889cd7f6e10cb1eacd129efa3ddb4b4 + b8c190d95371e658d95a5731f4778bd3da2fa42d diff --git a/global.json b/global.json index e225ab15dd..53d05811a7 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19351.4", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19352.7", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From aaa2caae59591cef26d4b86bd21afb03e017a336 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Wed, 3 Jul 2019 22:27:09 +0200 Subject: [PATCH 103/159] Allow to set PreferredUILang from tests (#7102) --- src/fsharp/service/Reactor.fs | 13 ++++++++++++- src/fsharp/service/Reactor.fsi | 3 +++ src/fsharp/service/service.fs | 2 ++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/fsharp/service/Reactor.fs b/src/fsharp/service/Reactor.fs index bae570d0c5..cc2a6af844 100755 --- a/src/fsharp/service/Reactor.fs +++ b/src/fsharp/service/Reactor.fs @@ -35,7 +35,7 @@ type Reactor() = // We need to store the culture for the VS thread that is executing now, // so that when the reactor picks up a thread from the threadpool we can set the culture - let culture = new CultureInfo(CultureInfo.CurrentUICulture.Name) + let mutable culture = CultureInfo(CultureInfo.CurrentUICulture.Name) let mutable bgOpCts = new CancellationTokenSource() /// Mailbox dispatch function. @@ -135,6 +135,17 @@ type Reactor() = Debug.Assert(false, String.Format("unexpected failure in reactor loop {0}, restarting", e)) } + member __.SetPreferredUILang(preferredUiLang: string option) = + match preferredUiLang with + | Some s -> + culture <- CultureInfo s +#if FX_RESHAPED_GLOBALIZATION + CultureInfo.CurrentUICulture <- culture +#else + Thread.CurrentThread.CurrentUICulture <- culture +#endif + | None -> () + // [Foreground Mailbox Accessors] ----------------------------------------------------------- member r.SetBackgroundOp(bgOpOpt) = Trace.TraceInformation("Reactor: {0:n3} enqueue start background, length {1}", DateTime.Now.TimeOfDay.TotalSeconds, builder.CurrentQueueLength) diff --git a/src/fsharp/service/Reactor.fsi b/src/fsharp/service/Reactor.fsi index 5ea9572f48..3040ca65ee 100755 --- a/src/fsharp/service/Reactor.fsi +++ b/src/fsharp/service/Reactor.fsi @@ -23,6 +23,9 @@ type internal IReactorOperations = [] type internal Reactor = + /// Allows to specify the language for error messages + member SetPreferredUILang : string option -> unit + /// Set the background building function, which is called repeatedly /// until it returns 'false'. If None then no background operation is used. member SetBackgroundOp : ( (* userOpName:*) string * (* opName: *) string * (* opArg: *) string * (CompilationThreadToken -> CancellationToken -> bool)) option -> unit diff --git a/src/fsharp/service/service.fs b/src/fsharp/service/service.fs index a6590aac2f..c30d21648e 100755 --- a/src/fsharp/service/service.fs +++ b/src/fsharp/service/service.fs @@ -518,6 +518,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC keepAssemblyContents, suggestNamesForErrors) let parsingOptions = FSharpParsingOptions.FromTcConfig(tcPrior.TcConfig, Array.ofList builder.SourceFiles, options.UseScriptResolutionRules) + reactor.SetPreferredUILang tcPrior.TcConfig.preferredUiLang bc.RecordTypeCheckFileInProjectResults(fileName, options, parsingOptions, parseResults, fileVersion, tcPrior.TimeStamp, Some checkAnswer, sourceText.GetHashCode()) return checkAnswer finally @@ -635,6 +636,7 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC // Do the parsing. let parsingOptions = FSharpParsingOptions.FromTcConfig(builder.TcConfig, Array.ofList (builder.SourceFiles), options.UseScriptResolutionRules) + reactor.SetPreferredUILang tcPrior.TcConfig.preferredUiLang let parseErrors, parseTreeOpt, anyErrors = ParseAndCheckFile.parseFile (sourceText, filename, parsingOptions, userOpName, suggestNamesForErrors) let parseResults = FSharpParseFileResults(parseErrors, parseTreeOpt, anyErrors, builder.AllDependenciesDeprecated) let! checkResults = bc.CheckOneFileImpl(parseResults, sourceText, filename, options, textSnapshotInfo, fileVersion, builder, tcPrior, creationErrors, userOpName) From 750325cd2d283044110894946ebce75a97e892b3 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Thu, 4 Jul 2019 10:44:34 +0200 Subject: [PATCH 104/159] Use latest Paket (#7124) --- fcs/download-paket.ps1 | 2 +- fcs/download-paket.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fcs/download-paket.ps1 b/fcs/download-paket.ps1 index 7aa8c5ef6f..4541168012 100644 --- a/fcs/download-paket.ps1 +++ b/fcs/download-paket.ps1 @@ -1,4 +1,4 @@ -$paketurl="https://github.com/fsprojects/Paket/releases/download/5.210.1/paket.exe" +$paketurl="https://github.com/fsprojects/Paket/releases/download/5.215.0/paket.exe" $paketdir = Join-Path $PSScriptRoot ".paket" $paketpath = Join-Path $paketdir "paket.exe" diff --git a/fcs/download-paket.sh b/fcs/download-paket.sh index d2bf8524a8..2825ac4d5a 100755 --- a/fcs/download-paket.sh +++ b/fcs/download-paket.sh @@ -12,7 +12,7 @@ while [[ -h "$source" ]]; do done scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" -paketurl=https://github.com/fsprojects/Paket/releases/download/5.210.1/paket.exe +paketurl=https://github.com/fsprojects/Paket/releases/download/5.215.0/paket.exe paketdir=$scriptroot/.paket paketpath=$paketdir/paket.exe if [ ! -e "$paketpath" ]; then From 49ed59dcb6ea5c8b4ef453bd4b8f6b367f68001a Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Thu, 4 Jul 2019 20:30:44 +0300 Subject: [PATCH 105/159] Add FSharpChecker.ParseFileNoCache (#7108) * Add FSharpChecker.ParseFileNoCache * Review feedback --- src/fsharp/service/service.fs | 11 +++++++++++ src/fsharp/service/service.fsi | 27 +++++++++++++++++---------- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/src/fsharp/service/service.fs b/src/fsharp/service/service.fs index c30d21648e..18ad4a444f 100755 --- a/src/fsharp/service/service.fs +++ b/src/fsharp/service/service.fs @@ -423,6 +423,12 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC return res } + member bc.ParseFileNoCache(filename, sourceText, options, userOpName) = + async { + let parseErrors, parseTreeOpt, anyErrors = ParseAndCheckFile.parseFile(sourceText, filename, options, userOpName, false) + return FSharpParseFileResults(parseErrors, parseTreeOpt, anyErrors, options.SourceFiles) + } + /// Fetch the parse information from the background compiler (which checks w.r.t. the FileSystem API) member __.GetBackgroundParseResultsForFileInProject(filename, options, userOpName) = reactor.EnqueueAndAwaitOpAsync(userOpName, "GetBackgroundParseResultsForFileInProject ", filename, fun ctok -> @@ -961,6 +967,11 @@ type FSharpChecker(legacyReferenceResolver, ic.CheckMaxMemoryReached() backgroundCompiler.ParseFile(filename, sourceText, options, userOpName) + member ic.ParseFileNoCache(filename, sourceText, options, ?userOpName) = + let userOpName = defaultArg userOpName "Unknown" + ic.CheckMaxMemoryReached() + backgroundCompiler.ParseFileNoCache(filename, sourceText, options, userOpName) + member ic.ParseFileInProject(filename, source: string, options, ?userOpName: string) = let userOpName = defaultArg userOpName "Unknown" let parsingOptions, _ = ic.GetParsingOptionsFromProjectOptions(options) diff --git a/src/fsharp/service/service.fsi b/src/fsharp/service/service.fsi index 09d8e988a4..afab8a6b16 100755 --- a/src/fsharp/service/service.fsi +++ b/src/fsharp/service/service.fsi @@ -103,25 +103,32 @@ type public FSharpChecker = member MatchBraces: filename: string * source: string * options: FSharpProjectOptions * ?userOpName: string -> Async<(range * range)[]> /// - /// Parse a source code file, returning a handle that can be used for obtaining navigation bar information - /// To get the full information, call 'CheckFileInProject' method on the result + /// Parses a source code for a file and caches the results. Returns an AST that can be traversed for various features. /// /// - /// The filename for the file. - /// The full source for the file. + /// The path for the file. The file name is used as a module name for implicit top level modules (e.g. in scripts). + /// The source to be parsed. /// Parsing options for the project or script. /// An optional string used for tracing compiler operations associated with this request. member ParseFile: filename: string * sourceText: ISourceText * options: FSharpParsingOptions * ?userOpName: string -> Async /// - /// Parse a source code file, returning a handle that can be used for obtaining navigation bar information - /// To get the full information, call 'CheckFileInProject' method on the result - /// All files except the one being checked are read from the FileSystem API + /// Parses a source code for a file. Returns an AST that can be traversed for various features. /// /// - /// The filename for the file. - /// The full source for the file. - /// The options for the project or script, used to determine active --define conditionals and other options relevant to parsing. + /// The path for the file. The file name is also as a module name for implicit top level modules (e.g. in scripts). + /// The source to be parsed. + /// Parsing options for the project or script. + /// An optional string used for tracing compiler operations associated with this request. + member ParseFileNoCache: filename: string * sourceText: ISourceText * options: FSharpParsingOptions * ?userOpName: string -> Async + + /// + /// Parses a source code for a file. Returns an AST that can be traversed for various features. + /// + /// + /// The path for the file. The file name is also as a module name for implicit top level modules (e.g. in scripts). + /// The source to be parsed. + /// Parsing options for the project or script. /// An optional string used for tracing compiler operations associated with this request. [] member ParseFileInProject: filename: string * source: string * options: FSharpProjectOptions * ?userOpName: string -> Async From 0270a7746971014df3c8867c069e59aec8150e0f Mon Sep 17 00:00:00 2001 From: dotnet-maestro <@dotnet-maestro> Date: Thu, 4 Jul 2019 13:02:01 +0000 Subject: [PATCH 106/159] Update dependencies from https://github.com/dotnet/arcade build 20190703.19 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19353.19 --- eng/Version.Details.xml | 4 ++-- eng/common/sdl/execute-all-sdl-tools.ps1 | 8 +++++--- eng/common/sdl/run-sdl.ps1 | 12 +++++++----- global.json | 2 +- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 810004aa4d..daf1a40ab3 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - b8c190d95371e658d95a5731f4778bd3da2fa42d + 733f8297b68dd824044a77d955e62305b9dc43d5 diff --git a/eng/common/sdl/execute-all-sdl-tools.ps1 b/eng/common/sdl/execute-all-sdl-tools.ps1 index 0635f26fb6..aab7589f2c 100644 --- a/eng/common/sdl/execute-all-sdl-tools.ps1 +++ b/eng/common/sdl/execute-all-sdl-tools.ps1 @@ -22,7 +22,9 @@ Param( [string] $TsaCodebaseAdmin, # Optional: only needed if TsaOnboard is true; the aliases which are admins of the TSA codebase (e.g. DOMAIN\alias); TSA is the automated framework used to upload test results as bugs. [string] $TsaBugAreaPath, # Optional: only needed if TsaOnboard is true; the area path where TSA will file bugs in AzDO; TSA is the automated framework used to upload test results as bugs. [string] $TsaIterationPath, # Optional: only needed if TsaOnboard is true; the iteration path where TSA will file bugs in AzDO; TSA is the automated framework used to upload test results as bugs. - [string] $GuardianLoggerLevel="Standard" # Optional: the logger level for the Guardian CLI; options are Trace, Verbose, Standard, Warning, and Error + [string] $GuardianLoggerLevel="Standard", # Optional: the logger level for the Guardian CLI; options are Trace, Verbose, Standard, Warning, and Error + [string[]] $CrScanAdditionalRunConfigParams, # Optional: Additional Params to custom build a CredScan run config in the format @("xyz:abc","sdf:1") + [string[]] $PoliCheckAdditionalRunConfigParams # Optional: Additional Params to custom build a Policheck run config in the format @("xyz:abc","sdf:1") ) $ErrorActionPreference = "Stop" @@ -69,10 +71,10 @@ if ($TsaOnboard) { } if ($ArtifactToolsList -and $ArtifactToolsList.Count -gt 0) { - & $(Join-Path $PSScriptRoot "run-sdl.ps1") -GuardianCliLocation $guardianCliLocation -WorkingDirectory $ArtifactsDirectory -TargetDirectory $ArtifactsDirectory -GdnFolder $gdnFolder -ToolsList $ArtifactToolsList -AzureDevOpsAccessToken $AzureDevOpsAccessToken -UpdateBaseline $UpdateBaseline -GuardianLoggerLevel $GuardianLoggerLevel + & $(Join-Path $PSScriptRoot "run-sdl.ps1") -GuardianCliLocation $guardianCliLocation -WorkingDirectory $ArtifactsDirectory -TargetDirectory $ArtifactsDirectory -GdnFolder $gdnFolder -ToolsList $ArtifactToolsList -AzureDevOpsAccessToken $AzureDevOpsAccessToken -UpdateBaseline $UpdateBaseline -GuardianLoggerLevel $GuardianLoggerLevel -CrScanAdditionalRunConfigParams $CrScanAdditionalRunConfigParams -PoliCheckAdditionalRunConfigParams $PoliCheckAdditionalRunConfigParams } if ($SourceToolsList -and $SourceToolsList.Count -gt 0) { - & $(Join-Path $PSScriptRoot "run-sdl.ps1") -GuardianCliLocation $guardianCliLocation -WorkingDirectory $ArtifactsDirectory -TargetDirectory $SourceDirectory -GdnFolder $gdnFolder -ToolsList $SourceToolsList -AzureDevOpsAccessToken $AzureDevOpsAccessToken -UpdateBaseline $UpdateBaseline -GuardianLoggerLevel $GuardianLoggerLevel + & $(Join-Path $PSScriptRoot "run-sdl.ps1") -GuardianCliLocation $guardianCliLocation -WorkingDirectory $ArtifactsDirectory -TargetDirectory $SourceDirectory -GdnFolder $gdnFolder -ToolsList $SourceToolsList -AzureDevOpsAccessToken $AzureDevOpsAccessToken -UpdateBaseline $UpdateBaseline -GuardianLoggerLevel $GuardianLoggerLevel -CrScanAdditionalRunConfigParams $CrScanAdditionalRunConfigParams -PoliCheckAdditionalRunConfigParams $PoliCheckAdditionalRunConfigParams } if ($UpdateBaseline) { diff --git a/eng/common/sdl/run-sdl.ps1 b/eng/common/sdl/run-sdl.ps1 index e6a86d03a2..d7b8564458 100644 --- a/eng/common/sdl/run-sdl.ps1 +++ b/eng/common/sdl/run-sdl.ps1 @@ -5,7 +5,9 @@ Param( [string] $GdnFolder, [string[]] $ToolsList, [string] $UpdateBaseline, - [string] $GuardianLoggerLevel="Standard" + [string] $GuardianLoggerLevel="Standard", + [string[]] $CrScanAdditionalRunConfigParams, + [string[]] $PoliCheckAdditionalRunConfigParams ) $ErrorActionPreference = "Stop" @@ -29,8 +31,8 @@ foreach ($tool in $ToolsList) { Write-Host $tool # We have to manually configure tools that run on source to look at the source directory only if ($tool -eq "credscan") { - Write-Host "$GuardianCliLocation configure --working-directory $WorkingDirectory --tool $tool --output-path $gdnConfigFile --logger-level $GuardianLoggerLevel --noninteractive --force --args `" TargetDirectory : $TargetDirectory `"" - & $GuardianCliLocation configure --working-directory $WorkingDirectory --tool $tool --output-path $gdnConfigFile --logger-level $GuardianLoggerLevel --noninteractive --force --args " TargetDirectory : $TargetDirectory " + Write-Host "$GuardianCliLocation configure --working-directory $WorkingDirectory --tool $tool --output-path $gdnConfigFile --logger-level $GuardianLoggerLevel --noninteractive --force --args `" TargetDirectory : $TargetDirectory `" $(If ($CrScanAdditionalRunConfigParams) {$CrScanAdditionalRunConfigParams})" + & $GuardianCliLocation configure --working-directory $WorkingDirectory --tool $tool --output-path $gdnConfigFile --logger-level $GuardianLoggerLevel --noninteractive --force --args " TargetDirectory : $TargetDirectory " $(If ($CrScanAdditionalRunConfigParams) {$CrScanAdditionalRunConfigParams}) if ($LASTEXITCODE -ne 0) { Write-Host "Guardian configure for $tool failed with exit code $LASTEXITCODE." exit $LASTEXITCODE @@ -38,8 +40,8 @@ foreach ($tool in $ToolsList) { $config = $True } if ($tool -eq "policheck") { - Write-Host "$GuardianCliLocation configure --working-directory $WorkingDirectory --tool $tool --output-path $gdnConfigFile --logger-level $GuardianLoggerLevel --noninteractive --force --args `" Target : $TargetDirectory `"" - & $GuardianCliLocation configure --working-directory $WorkingDirectory --tool $tool --output-path $gdnConfigFile --logger-level $GuardianLoggerLevel --noninteractive --force --args " Target : $TargetDirectory " + Write-Host "$GuardianCliLocation configure --working-directory $WorkingDirectory --tool $tool --output-path $gdnConfigFile --logger-level $GuardianLoggerLevel --noninteractive --force --args `" Target : $TargetDirectory `" $(If ($PoliCheckAdditionalRunConfigParams) {$PoliCheckAdditionalRunConfigParams})" + & $GuardianCliLocation configure --working-directory $WorkingDirectory --tool $tool --output-path $gdnConfigFile --logger-level $GuardianLoggerLevel --noninteractive --force --args " Target : $TargetDirectory " $(If ($PoliCheckAdditionalRunConfigParams) {$PoliCheckAdditionalRunConfigParams}) if ($LASTEXITCODE -ne 0) { Write-Host "Guardian configure for $tool failed with exit code $LASTEXITCODE." exit $LASTEXITCODE diff --git a/global.json b/global.json index 53d05811a7..4fd944a3f1 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19352.7", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19353.19", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 97c236e96287b08123bb8d17eb94163e21e3a216 Mon Sep 17 00:00:00 2001 From: Kevin Malenfant Date: Fri, 5 Jul 2019 14:15:49 -0600 Subject: [PATCH 107/159] support struct tuple in leaf expression converter (#7144) --- src/fsharp/FSharp.Core/Linq.fs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/fsharp/FSharp.Core/Linq.fs b/src/fsharp/FSharp.Core/Linq.fs index 4663e6f79a..e4deedbf07 100644 --- a/src/fsharp/FSharp.Core/Linq.fs +++ b/src/fsharp/FSharp.Core/Linq.fs @@ -744,7 +744,12 @@ module LeafExpressionConverter = Expression.Lambda(dty, bodyP, vsP) |> asExpr | Patterns.NewTuple args -> - let tupTy = args |> List.map (fun arg -> arg.Type) |> Array.ofList |> Reflection.FSharpType.MakeTupleType + let tupTy = + let argTypes = args |> List.map (fun arg -> arg.Type) |> Array.ofList + if inp.Type.IsValueType then + Reflection.FSharpType.MakeStructTupleType(inp.Type.Assembly, argTypes) + else + Reflection.FSharpType.MakeTupleType(argTypes) let argsP = ConvExprsToLinq env args let rec build ty (argsP: Expression[]) = match Reflection.FSharpValue.PreComputeTupleConstructorInfo ty with From bbe5504c5fec1647ea904e808d2b8c0d791e0604 Mon Sep 17 00:00:00 2001 From: dotnet-maestro <@dotnet-maestro> Date: Fri, 5 Jul 2019 12:57:01 +0000 Subject: [PATCH 108/159] Update dependencies from https://github.com/dotnet/arcade build 20190704.2 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19354.2 --- eng/Version.Details.xml | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index daf1a40ab3..7bd629dece 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - 733f8297b68dd824044a77d955e62305b9dc43d5 + 30553c0de34454fb8da5229962501af65eb1233f diff --git a/global.json b/global.json index 4fd944a3f1..b141141136 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19353.19", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19354.2", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 5a0e95a6cee1e4ed640a9273afe7c51b93713b3d Mon Sep 17 00:00:00 2001 From: dotnet-maestro <@dotnet-maestro> Date: Sat, 6 Jul 2019 13:01:21 +0000 Subject: [PATCH 109/159] Update dependencies from https://github.com/dotnet/arcade build 20190705.2 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19355.2 --- eng/Version.Details.xml | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 7bd629dece..afc992eb6c 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - 30553c0de34454fb8da5229962501af65eb1233f + 3e0cbbc6fd6c6d45d7083ee0deb71cec7ea2d91f diff --git a/global.json b/global.json index b141141136..bddc5927b5 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19354.2", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19355.2", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 2b5d918790c83caab81a8af1e443f403e0371d18 Mon Sep 17 00:00:00 2001 From: dotnet-maestro <@dotnet-maestro> Date: Sun, 7 Jul 2019 12:54:27 +0000 Subject: [PATCH 110/159] Update dependencies from https://github.com/dotnet/arcade build 20190706.1 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19356.1 --- eng/Version.Details.xml | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index afc992eb6c..4ff4113207 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - 3e0cbbc6fd6c6d45d7083ee0deb71cec7ea2d91f + a65d0966dc28861394ce78cfdcb9d5dff370957c diff --git a/global.json b/global.json index bddc5927b5..71a3f7705a 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19355.2", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19356.1", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 941885524ea789129bd46a4a966ba55b70a563b4 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 9 Jul 2019 16:51:20 -0700 Subject: [PATCH 111/159] [master] Update dependencies from dotnet/arcade (#7162) * Update dependencies from https://github.com/dotnet/arcade build 20190708.1 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19358.1 * Update dependencies from https://github.com/dotnet/arcade build 20190709.1 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19359.1 --- eng/Version.Details.xml | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 4ff4113207..cb67136ddc 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - a65d0966dc28861394ce78cfdcb9d5dff370957c + ef3834feb8615429a58808cdcf9ad9284d767654 diff --git a/global.json b/global.json index 71a3f7705a..733aa27d45 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19356.1", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19359.1", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From d6ad536918f85b5855272d304b1e8f7439cd2bdd Mon Sep 17 00:00:00 2001 From: Will Smith Date: Tue, 9 Jul 2019 19:47:20 -0700 Subject: [PATCH 112/159] Always recover when trying to parse inline IL (#7167) (#7176) --- src/fsharp/ast.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fsharp/ast.fs b/src/fsharp/ast.fs index 3c341131fb..46bb6b1420 100644 --- a/src/fsharp/ast.fs +++ b/src/fsharp/ast.fs @@ -1982,7 +1982,7 @@ let ParseAssemblyCodeInstructions s m = try FSharp.Compiler.AbstractIL.Internal.AsciiParser.ilInstrs FSharp.Compiler.AbstractIL.Internal.AsciiLexer.token (UnicodeLexing.StringAsLexbuf s) - with RecoverableParseError -> + with _ -> errorR(Error(FSComp.SR.astParseEmbeddedILError(), m)); [| |] #endif From d344ce4110fa53c88b045eddb0cb629c0591f6b3 Mon Sep 17 00:00:00 2001 From: Will Smith Date: Wed, 10 Jul 2019 13:27:09 -0700 Subject: [PATCH 113/159] Stack overflow fixes (#7151) * Trying to fix the stack overflow case in ilxgen * Added stack guard to GenExpr * Still trying to resolve this * This resolves the stack overflow, but need to review * Adding better tests * Fixing compile and run successfully assert * One test passes * Fixing a few things * Delete fieldNames.txt * Update IlxGen.fs * Update IlxGen.fs * Update IlxGen.fs * More work on CompilerAssert * Got verifying IL working on method * Always delay gen methods when already gen'ing in one. Some small refactoring, created IlxMethodInfo type instead of using large tuples. * Better error message for stack overflow * small msg change * Simplifying some tests * Removing attempt at bringing a FSharpQA test to nunit * Fixing up seq points * More seq point tweaks * Trying to fix ilxgen * Fixing ilxgen * Using RunScript * Fix test * removed IlxMethodInfo * trivial refactor * another quick refactor --- src/fsharp/IlxGen.fs | 188 +++++++++++------- src/fsharp/lib.fs | 11 + .../core/members/ops/THIRD-PARTY-NOTICES.TXT | 24 --- 3 files changed, 130 insertions(+), 93 deletions(-) delete mode 100644 tests/fsharp/core/members/ops/THIRD-PARTY-NOTICES.TXT diff --git a/src/fsharp/IlxGen.fs b/src/fsharp/IlxGen.fs index c188b54807..74d633b9f9 100755 --- a/src/fsharp/IlxGen.fs +++ b/src/fsharp/IlxGen.fs @@ -245,6 +245,12 @@ type cenv = /// Used to apply forced inlining optimizations to witnesses generated late during codegen mutable optimizeDuringCodeGen: (Expr -> Expr) + + /// What depth are we at when generating an expression? + mutable exprRecursionDepth: int + + /// Delayed Method Generation - prevents stack overflows when we need to generate methods that are split into many methods by the optimizer. + delayedGenMethods: Queue unit> } @@ -2130,20 +2136,53 @@ let DoesGenExprStartWithSequencePoint g sp expr = FirstEmittedCodeWillBeSequencePoint g sp expr || EmitSequencePointForWholeExpr g sp expr +let ProcessSequencePointForExpr (cenv: cenv) (cgbuf: CodeGenBuffer) sp expr = + let g = cenv.g + if not (FirstEmittedCodeWillBeSequencePoint g sp expr) then + if EmitSequencePointForWholeExpr g sp expr then + CG.EmitSeqPoint cgbuf (RangeOfSequencePointForWholeExpr g expr) + elif EmitHiddenCodeMarkerForWholeExpr g sp expr then + cgbuf.EmitStartOfHiddenCode() + //------------------------------------------------------------------------- // Generate expressions //------------------------------------------------------------------------- -let rec GenExpr (cenv: cenv) (cgbuf: CodeGenBuffer) eenv sp expr sequel = +let rec GenExpr cenv cgbuf eenv sp (expr: Expr) sequel = + cenv.exprRecursionDepth <- cenv.exprRecursionDepth + 1 + + if cenv.exprRecursionDepth > 1 then + StackGuard.EnsureSufficientExecutionStack cenv.exprRecursionDepth + GenExprAux cenv cgbuf eenv sp expr sequel + else + GenExprWithStackGuard cenv cgbuf eenv sp expr sequel + + cenv.exprRecursionDepth <- cenv.exprRecursionDepth - 1 + + if cenv.exprRecursionDepth = 0 then + ProcessDelayedGenMethods cenv + +and ProcessDelayedGenMethods cenv = + while cenv.delayedGenMethods.Count > 0 do + let gen = cenv.delayedGenMethods.Dequeue () + gen cenv + +and GenExprWithStackGuard cenv cgbuf eenv sp expr sequel = + assert (cenv.exprRecursionDepth = 1) + try + GenExprAux cenv cgbuf eenv sp expr sequel + assert (cenv.exprRecursionDepth = 1) + with + | :? System.InsufficientExecutionStackException -> + error(InternalError("Expression is too large and/or complex to emit.", expr.Range)) + +and GenExprAux (cenv: cenv) (cgbuf: CodeGenBuffer) eenv sp expr sequel = let g = cenv.g let expr = stripExpr expr - if not (FirstEmittedCodeWillBeSequencePoint g sp expr) then - if EmitSequencePointForWholeExpr g sp expr then - CG.EmitSeqPoint cgbuf (RangeOfSequencePointForWholeExpr g expr) - elif EmitHiddenCodeMarkerForWholeExpr g sp expr then - cgbuf.EmitStartOfHiddenCode() + ProcessSequencePointForExpr cenv cgbuf sp expr + // A sequence expression will always match Expr.App. match (if compileSequenceExpressions then LowerCallsAndSeqs.LowerSeqExpr g cenv.amap expr else None) with | Some info -> GenSequenceExpr cenv cgbuf eenv info sequel @@ -2154,32 +2193,8 @@ let rec GenExpr (cenv: cenv) (cgbuf: CodeGenBuffer) eenv sp expr sequel = GenConstant cenv cgbuf eenv (c, m, ty) sequel | Expr.Match (spBind, exprm, tree, targets, m, ty) -> GenMatch cenv cgbuf eenv (spBind, exprm, tree, targets, m, ty) sequel - | Expr.Sequential (e1, e2, dir, spSeq, m) -> - GenSequential cenv cgbuf eenv sp (e1, e2, dir, spSeq, m) sequel | Expr.LetRec (binds, body, m, _) -> GenLetRec cenv cgbuf eenv (binds, body, m) sequel - | Expr.Let (bind, body, _, _) -> - // This case implemented here to get a guaranteed tailcall - // Make sure we generate the sequence point outside the scope of the variable - let startScope, endScope as scopeMarks = StartDelayedLocalScope "let" cgbuf - let eenv = AllocStorageForBind cenv cgbuf scopeMarks eenv bind - let spBind = GenSequencePointForBind cenv cgbuf bind - GenBindingAfterSequencePoint cenv cgbuf eenv spBind bind (Some startScope) - - // Work out if we need a sequence point for the body. For any "user" binding then the body gets SPAlways. - // For invisible compiler-generated bindings we just use "sp", unless its body is another invisible binding - // For sticky bindings arising from inlining we suppress any immediate sequence point in the body - let spBody = - match bind.SequencePointInfo with - | SequencePointAtBinding _ - | NoSequencePointAtLetBinding - | NoSequencePointAtDoBinding -> SPAlways - | NoSequencePointAtInvisibleBinding -> sp - | NoSequencePointAtStickyBinding -> SPSuppress - - // Generate the body - GenExpr cenv cgbuf eenv spBody body (EndLocalScope(sequel, endScope)) - | Expr.Lambda _ | Expr.TyLambda _ -> GenLambda cenv cgbuf eenv false None expr sequel | Expr.App (Expr.Val (vref, _, m) as v, _, tyargs, [], _) when @@ -2200,8 +2215,10 @@ let rec GenExpr (cenv: cenv) (cgbuf: CodeGenBuffer) eenv sp expr sequel = // Most generation of linear expressions is implemented routinely using tailcalls and the correct sequels. // This is because the element of expansion happens to be the final thing generated in most cases. However // for large lists we have to process the linearity separately + | Expr.Sequential _ + | Expr.Let _ | LinearOpExpr _ -> - GenLinearExpr cenv cgbuf eenv expr sequel id |> ignore + GenLinearExpr cenv cgbuf eenv sp expr sequel (* canProcessSequencePoint *) false id |> ignore | Expr.Op (op, tyargs, args, m) -> match op, args, tyargs with @@ -2515,16 +2532,63 @@ and GenAllocUnionCase cenv cgbuf eenv (c,tyargs,args,m) sequel = GenAllocUnionCaseCore cenv cgbuf eenv (c,tyargs,args.Length,m) GenSequel cenv eenv.cloc cgbuf sequel -and GenLinearExpr cenv cgbuf eenv expr sequel (contf: FakeUnit -> FakeUnit) = - match expr with - | LinearOpExpr (TOp.UnionCase c, tyargs, argsFront, argLast, m) -> +and GenLinearExpr cenv cgbuf eenv sp expr sequel canProcessSequencePoint (contf: FakeUnit -> FakeUnit) = + match stripExpr expr with + | LinearOpExpr (TOp.UnionCase c, tyargs, argsFront, argLast, m) -> GenExprs cenv cgbuf eenv argsFront - GenLinearExpr cenv cgbuf eenv argLast Continue (contf << (fun Fake -> + GenLinearExpr cenv cgbuf eenv SPSuppress argLast Continue (* canProcessSequencePoint *) true (contf << (fun Fake -> GenAllocUnionCaseCore cenv cgbuf eenv (c, tyargs, argsFront.Length + 1, m) GenSequel cenv eenv.cloc cgbuf sequel Fake)) + + | Expr.Sequential (e1, e2, specialSeqFlag, spSeq, _) -> + if canProcessSequencePoint then + ProcessSequencePointForExpr cenv cgbuf sp expr + + // Compiler generated sequential executions result in suppressions of sequence points on both + // left and right of the sequence + let spAction, spExpr = + (match spSeq with + | SequencePointsAtSeq -> SPAlways, SPAlways + | SuppressSequencePointOnExprOfSequential -> SPSuppress, sp + | SuppressSequencePointOnStmtOfSequential -> sp, SPSuppress) + match specialSeqFlag with + | NormalSeq -> + GenExpr cenv cgbuf eenv spAction e1 discard + GenLinearExpr cenv cgbuf eenv spExpr e2 sequel (* canProcessSequencePoint *) true contf + | ThenDoSeq -> + GenExpr cenv cgbuf eenv spExpr e1 Continue + GenExpr cenv cgbuf eenv spAction e2 discard + GenSequel cenv eenv.cloc cgbuf sequel + contf Fake + + | Expr.Let (bind, body, _, _) -> + if canProcessSequencePoint then + ProcessSequencePointForExpr cenv cgbuf sp expr + + // This case implemented here to get a guaranteed tailcall + // Make sure we generate the sequence point outside the scope of the variable + let startScope, endScope as scopeMarks = StartDelayedLocalScope "let" cgbuf + let eenv = AllocStorageForBind cenv cgbuf scopeMarks eenv bind + let spBind = GenSequencePointForBind cenv cgbuf bind + GenBindingAfterSequencePoint cenv cgbuf eenv spBind bind (Some startScope) + + // Work out if we need a sequence point for the body. For any "user" binding then the body gets SPAlways. + // For invisible compiler-generated bindings we just use "sp", unless its body is another invisible binding + // For sticky bindings arising from inlining we suppress any immediate sequence point in the body + let spBody = + match bind.SequencePointInfo with + | SequencePointAtBinding _ + | NoSequencePointAtLetBinding + | NoSequencePointAtDoBinding -> SPAlways + | NoSequencePointAtInvisibleBinding -> sp + | NoSequencePointAtStickyBinding -> SPSuppress + + // Generate the body + GenLinearExpr cenv cgbuf eenv spBody body (EndLocalScope(sequel, endScope)) (* canProcessSequencePoint *) true contf + | _ -> - GenExpr cenv cgbuf eenv SPSuppress expr sequel + GenExpr cenv cgbuf eenv sp expr sequel contf Fake and GenAllocRecd cenv cgbuf eenv ctorInfo (tcref,argtys,args,m) sequel = @@ -3475,28 +3539,6 @@ and GenWhileLoop cenv cgbuf eenv (spWhile, e1, e2, m) sequel = // SEQUENCE POINTS: Emit a sequence point to cover 'done' if present GenUnitThenSequel cenv eenv m eenv.cloc cgbuf sequel -//-------------------------------------------------------------------------- -// Generate seq -//-------------------------------------------------------------------------- - -and GenSequential cenv cgbuf eenv spIn (e1, e2, specialSeqFlag, spSeq, _m) sequel = - - // Compiler generated sequential executions result in suppressions of sequence points on both - // left and right of the sequence - let spAction, spExpr = - (match spSeq with - | SequencePointsAtSeq -> SPAlways, SPAlways - | SuppressSequencePointOnExprOfSequential -> SPSuppress, spIn - | SuppressSequencePointOnStmtOfSequential -> spIn, SPSuppress) - match specialSeqFlag with - | NormalSeq -> - GenExpr cenv cgbuf eenv spAction e1 discard - GenExpr cenv cgbuf eenv spExpr e2 sequel - | ThenDoSeq -> - GenExpr cenv cgbuf eenv spExpr e1 Continue - GenExpr cenv cgbuf eenv spAction e2 discard - GenSequel cenv eenv.cloc cgbuf sequel - //-------------------------------------------------------------------------- // Generate IL assembly code. // Polymorphic IL/ILX instructions may be instantiated when polymorphic code is inlined. @@ -5210,7 +5252,14 @@ and GenBindingAfterSequencePoint cenv cgbuf eenv sp (TBind(vspec, rhsExpr, _)) s let tps, ctorThisValOpt, baseValOpt, vsl, body', bodyty = IteratedAdjustArityOfLambda g cenv.amap topValInfo rhsExpr let methodVars = List.concat vsl CommitStartScope cgbuf startScopeMarkOpt - GenMethodForBinding cenv cgbuf eenv (vspec, mspec, access, paramInfos, retInfo) (topValInfo, ctorThisValOpt, baseValOpt, tps, methodVars, methodArgTys, body', bodyty) + + let ilxMethInfoArgs = + (vspec, mspec, access, paramInfos, retInfo, topValInfo, ctorThisValOpt, baseValOpt, tps, methodVars, methodArgTys, body', bodyty) + // if we have any expression recursion depth, we should delay the generation of a method to prevent stack overflows + if cenv.exprRecursionDepth > 0 then + DelayGenMethodForBinding cenv cgbuf.mgbuf eenv ilxMethInfoArgs + else + GenMethodForBinding cenv cgbuf.mgbuf eenv ilxMethInfoArgs | StaticProperty (ilGetterMethSpec, optShadowLocal) -> @@ -5649,11 +5698,10 @@ and ComputeMethodImplAttribs cenv (_v: Val) attrs = let hasAggressiveInliningImplFlag = (implflags &&& 0x0100) <> 0x0 hasPreserveSigImplFlag, hasSynchronizedImplFlag, hasNoInliningImplFlag, hasAggressiveInliningImplFlag, attrs -and GenMethodForBinding - cenv cgbuf eenv - (v: Val, mspec, access, paramInfos, retInfo) - (topValInfo, ctorThisValOpt, baseValOpt, tps, methodVars, methodArgTys, body, returnTy) = +and DelayGenMethodForBinding cenv mgbuf eenv ilxMethInfoArgs = + cenv.delayedGenMethods.Enqueue (fun cenv -> GenMethodForBinding cenv mgbuf eenv ilxMethInfoArgs) +and GenMethodForBinding cenv mgbuf eenv (v, mspec, access, paramInfos, retInfo, topValInfo, ctorThisValOpt, baseValOpt, tps, methodVars, methodArgTys, body, returnTy) = let g = cenv.g let m = v.Range let selfMethodVars, nonSelfMethodVars, compileAsInstance = @@ -5714,7 +5762,7 @@ and GenMethodForBinding else body - let ilCode = CodeGenMethodForExpr cenv cgbuf.mgbuf (SPAlways, tailCallInfo, mspec.Name, eenvForMeth, 0, bodyExpr, sequel) + let ilCode = CodeGenMethodForExpr cenv mgbuf (SPAlways, tailCallInfo, mspec.Name, eenvForMeth, 0, bodyExpr, sequel) // This is the main code generation for most methods false, MethodBody.IL ilCode, false @@ -5780,7 +5828,7 @@ and GenMethodForBinding else mdef CountMethodDef() - cgbuf.mgbuf.AddMethodDef(tref, mdef) + mgbuf.AddMethodDef(tref, mdef) match v.MemberInfo with @@ -5817,7 +5865,7 @@ and GenMethodForBinding let mdef = List.fold (fun mdef f -> f mdef) mdef flagFixups // fixup can potentially change name of reflected definition that was already recorded - patch it if necessary - cgbuf.mgbuf.ReplaceNameOfReflectedDefinition(v, mdef.Name) + mgbuf.ReplaceNameOfReflectedDefinition(v, mdef.Name) mdef else mkILGenericNonVirtualMethod (v.CompiledName g.CompilerGlobalState, access, ilMethTypars, ilParams, ilReturn, ilMethodBody) @@ -5844,7 +5892,7 @@ and GenMethodForBinding // Emit the pseudo-property as an event, but not if its a private method impl if mdef.Access <> ILMemberAccess.Private then let edef = GenEventForProperty cenv eenvForMeth mspec v ilAttrsThatGoOnPrimaryItem m returnTy - cgbuf.mgbuf.AddEventDef(tref, edef) + mgbuf.AddEventDef(tref, edef) // The method def is dropped on the floor here else @@ -5854,7 +5902,7 @@ and GenMethodForBinding let ilPropTy = GenType cenv.amap m eenvUnderMethTypeTypars.tyenv vtyp let ilArgTys = v |> ArgInfosOfPropertyVal g |> List.map fst |> GenTypes cenv.amap m eenvUnderMethTypeTypars.tyenv let ilPropDef = GenPropertyForMethodDef compileAsInstance tref mdef v memberInfo ilArgTys ilPropTy (mkILCustomAttrs ilAttrsThatGoOnPrimaryItem) compiledName - cgbuf.mgbuf.AddOrMergePropertyDef(tref, ilPropDef, m) + 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)) @@ -7668,7 +7716,9 @@ type IlxAssemblyGenerator(amap: ImportMap, tcGlobals: TcGlobals, tcVal: Constrai casApplied = casApplied intraAssemblyInfo = intraAssemblyInfo opts = codeGenOpts - optimizeDuringCodeGen = (fun x -> x) } + optimizeDuringCodeGen = (fun x -> x) + exprRecursionDepth = 0 + delayedGenMethods = Queue () } GenerateCode (cenv, anonTypeTable, ilxGenEnv, typedAssembly, assemAttribs, moduleAttribs) /// Invert the compilation of the given value and clear the storage of the value diff --git a/src/fsharp/lib.fs b/src/fsharp/lib.fs index e7eaf9543f..dfcbddc2da 100755 --- a/src/fsharp/lib.fs +++ b/src/fsharp/lib.fs @@ -536,3 +536,14 @@ module UnmanagedProcessExecutionOptions = "HeapSetInformation() returned FALSE; LastError = 0x" + GetLastError().ToString("X").PadLeft(8, '0') + ".")) +[] +module StackGuard = + + open System.Runtime.CompilerServices + + [] + let private MaxUncheckedRecursionDepth = 20 + + let EnsureSufficientExecutionStack recursionDepth = + if recursionDepth > MaxUncheckedRecursionDepth then + RuntimeHelpers.EnsureSufficientExecutionStack () \ No newline at end of file diff --git a/tests/fsharp/core/members/ops/THIRD-PARTY-NOTICES.TXT b/tests/fsharp/core/members/ops/THIRD-PARTY-NOTICES.TXT deleted file mode 100644 index 75a2788250..0000000000 --- a/tests/fsharp/core/members/ops/THIRD-PARTY-NOTICES.TXT +++ /dev/null @@ -1,24 +0,0 @@ -F# uses third-party libraries or other resources that may be -distributed under licenses different than the .NET Core software. - -Attributions and license notices for test cases originally authored by -third parties can be found in the respective test directories. - -In the event that we accidentally failed to list a required notice, please -bring it to our attention. Post an issue or email us: - - dotnet@microsoft.com - -The attached notices are provided for information only. - -License notice for Stack Overflow -------------------------------------- - -Policy: https://stackoverflow.com/help/licensing -License: https://creativecommons.org/licenses/by-sa/3.0/ - -Content: How to write a variadic function in F# emulating a similar Haskell solution? -URL: https://stackoverflow.com/questions/28243963/how-to-write-a-variadic-function-in-f-emulating-a-similar-haskell-solution/28244413#28244413 - -Question author: robkuz -- https://stackoverflow.com/users/621427/robkuz -Answer author: Gustavo -- https://stackoverflow.com/users/446822/gustavo From 619322a335a9adf72aa0190da248d24a30cceed2 Mon Sep 17 00:00:00 2001 From: dotnet-maestro <@dotnet-maestro> Date: Wed, 10 Jul 2019 12:57:06 +0000 Subject: [PATCH 114/159] Update dependencies from https://github.com/dotnet/arcade build 20190709.6 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19359.6 --- eng/Version.Details.xml | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index cb67136ddc..0c5078f9f9 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - ef3834feb8615429a58808cdcf9ad9284d767654 + 0f5dd7680174620f31c9a00cdb2ac0b0e70e631f diff --git a/global.json b/global.json index 733aa27d45..4c66387e58 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19359.1", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19359.6", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From b13b536a5c804f452ac197b8ec5bc565e5d8351b Mon Sep 17 00:00:00 2001 From: JC Aguilera Date: Wed, 10 Jul 2019 17:16:08 -0700 Subject: [PATCH 115/159] Copy sources from Versions.props to NuGet.config (#7191) --- NuGet.config | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/NuGet.config b/NuGet.config index 8f21de1b15..a8664a73c5 100644 --- a/NuGet.config +++ b/NuGet.config @@ -8,6 +8,20 @@ + + + + + + + + + + + + + + From 52c154930e7cc083df18a0c3742122e2b06fac9f Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2019 11:42:21 -0700 Subject: [PATCH 116/159] Update dependencies from https://github.com/dotnet/arcade build 20190710.8 (#7200) - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19360.8 --- eng/Version.Details.xml | 4 +- eng/common/SigningValidation.proj | 2 +- eng/common/performance/perfhelixpublish.proj | 77 ++++++++ eng/common/performance/performance-setup.ps1 | 91 +++++++++ eng/common/performance/performance-setup.sh | 176 ++++++++++++++++++ eng/common/pipeline-logging-functions.ps1 | 7 +- .../post-build/trigger-subscriptions.ps1 | 6 +- eng/common/templates/job/performance.yml | 93 +++++++++ .../channels/internal-servicing.yml | 8 +- .../channels/public-dev-release.yml | 1 + .../post-build/channels/public-release.yml | 8 +- .../channels/public-validation-release.yml | 1 + .../templates/post-build/common-variables.yml | 3 + .../templates/steps/perf-send-to-helix.yml | 66 +++++++ eng/common/tools.ps1 | 4 +- global.json | 2 +- 16 files changed, 529 insertions(+), 20 deletions(-) create mode 100644 eng/common/performance/perfhelixpublish.proj create mode 100644 eng/common/performance/performance-setup.ps1 create mode 100644 eng/common/performance/performance-setup.sh create mode 100644 eng/common/templates/job/performance.yml create mode 100644 eng/common/templates/steps/perf-send-to-helix.yml diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 0c5078f9f9..bfb72eca15 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - 0f5dd7680174620f31c9a00cdb2ac0b0e70e631f + a6ae1b637ed236354529992729af875f6c8a180a diff --git a/eng/common/SigningValidation.proj b/eng/common/SigningValidation.proj index 7045fb6fb9..3d0ac80af3 100644 --- a/eng/common/SigningValidation.proj +++ b/eng/common/SigningValidation.proj @@ -3,7 +3,7 @@ + + + $(WorkItemDirectory) + $(WorkItemCommand) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument) --artifacts $(ArtifactsDirectory) --partition-count $(PartitionCount) --partition-index %(HelixWorkItem.Index)" + 4:00 + + + + + $(WorkItemDirectory) + $(WorkItemCommand) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument) --artifacts $(ArtifactsDirectory)" + 4:00 + + + \ No newline at end of file diff --git a/eng/common/performance/performance-setup.ps1 b/eng/common/performance/performance-setup.ps1 new file mode 100644 index 0000000000..7e5441f797 --- /dev/null +++ b/eng/common/performance/performance-setup.ps1 @@ -0,0 +1,91 @@ +Param( + [string] $SourceDirectory=$env:BUILD_SOURCESDIRECTORY, + [string] $CoreRootDirectory, + [string] $Architecture="x64", + [string] $Framework="netcoreapp3.0", + [string] $CompilationMode="Tiered", + [string] $Repository=$env:BUILD_REPOSITORY_NAME, + [string] $Branch=$env:BUILD_SOURCEBRANCH, + [string] $CommitSha=$env:BUILD_SOURCEVERSION, + [string] $BuildNumber=$env:BUILD_BUILDNUMBER, + [string] $RunCategories="coreclr corefx", + [string] $Csproj="src\benchmarks\micro\MicroBenchmarks.csproj", + [string] $Kind="micro", + [switch] $Internal, + [string] $Configurations="CompilationMode=$CompilationMode" +) + +$RunFromPerformanceRepo = ($Repository -eq "dotnet/performance") +$UseCoreRun = ($CoreRootDirectory -ne [string]::Empty) + +$PayloadDirectory = (Join-Path $SourceDirectory "Payload") +$PerformanceDirectory = (Join-Path $PayloadDirectory "performance") +$WorkItemDirectory = (Join-Path $SourceDirectory "workitem") +$ExtraBenchmarkDotNetArguments = "--iterationCount 1 --warmupCount 0 --invocationCount 1 --unrollFactor 1 --strategy ColdStart --stopOnFirstError true" +$Creator = $env:BUILD_DEFINITIONNAME +$PerfLabArguments = "" +$HelixSourcePrefix = "pr" + +$Queue = "Windows.10.Amd64.ClientRS4.DevEx.15.8.Open" + +if ($Framework.StartsWith("netcoreapp")) { + $Queue = "Windows.10.Amd64.ClientRS4.Open" +} + +if ($Internal) { + $Queue = "Windows.10.Amd64.ClientRS5.Perf" + $PerfLabArguments = "--upload-to-perflab-container" + $ExtraBenchmarkDotNetArguments = "" + $Creator = "" + $HelixSourcePrefix = "official" +} + +$CommonSetupArguments="--frameworks $Framework --queue $Queue --build-number $BuildNumber --build-configs $Configurations" +$SetupArguments = "--repository https://github.com/$Repository --branch $Branch --get-perf-hash --commit-sha $CommitSha $CommonSetupArguments" + +if ($RunFromPerformanceRepo) { + $SetupArguments = "--perf-hash $CommitSha $CommonSetupArguments" + + robocopy $SourceDirectory $PerformanceDirectory /E /XD $PayloadDirectory $SourceDirectory\artifacts $SourceDirectory\.git +} +else { + git clone --branch master --depth 1 --quiet https://github.com/dotnet/performance $PerformanceDirectory +} + +if ($UseCoreRun) { + $NewCoreRoot = (Join-Path $PayloadDirectory "Core_Root") + Move-Item -Path $CoreRootDirectory -Destination $NewCoreRoot +} + +$DocsDir = (Join-Path $PerformanceDirectory "docs") +robocopy $DocsDir $WorkItemDirectory + +# Set variables that we will need to have in future steps +$ci = $true + +. "$PSScriptRoot\..\pipeline-logging-functions.ps1" + +# Directories +Write-PipelineSetVariable -Name 'PayloadDirectory' -Value "$PayloadDirectory" -IsMultiJobVariable $false +Write-PipelineSetVariable -Name 'PerformanceDirectory' -Value "$PerformanceDirectory" -IsMultiJobVariable $false +Write-PipelineSetVariable -Name 'WorkItemDirectory' -Value "$WorkItemDirectory" -IsMultiJobVariable $false + +# Script Arguments +Write-PipelineSetVariable -Name 'Python' -Value "py -3" -IsMultiJobVariable $false +Write-PipelineSetVariable -Name 'ExtraBenchmarkDotNetArguments' -Value "$ExtraBenchmarkDotNetArguments" -IsMultiJobVariable $false +Write-PipelineSetVariable -Name 'SetupArguments' -Value "$SetupArguments" -IsMultiJobVariable $false +Write-PipelineSetVariable -Name 'PerfLabArguments' -Value "$PerfLabArguments" -IsMultiJobVariable $false +Write-PipelineSetVariable -Name 'BDNCategories' -Value "$RunCategories" -IsMultiJobVariable $false +Write-PipelineSetVariable -Name 'TargetCsproj' -Value "$Csproj" -IsMultiJobVariable $false +Write-PipelineSetVariable -Name 'Kind' -Value "$Kind" -IsMultiJobVariable $false +Write-PipelineSetVariable -Name 'Architecture' -Value "$Architecture" -IsMultiJobVariable $false +Write-PipelineSetVariable -Name 'UseCoreRun' -Value "$UseCoreRun" -IsMultiJobVariable $false +Write-PipelineSetVariable -Name 'RunFromPerfRepo' -Value "$RunFromPerformanceRepo" -IsMultiJobVariable $false + +# Helix Arguments +Write-PipelineSetVariable -Name 'Creator' -Value "$Creator" -IsMultiJobVariable $false +Write-PipelineSetVariable -Name 'Queue' -Value "$Queue" -IsMultiJobVariable $false +Write-PipelineSetVariable -Name 'HelixSourcePrefix' -Value "$HelixSourcePrefix" -IsMultiJobVariable $false +Write-PipelineSetVariable -Name '_BuildConfig' -Value "$Architecture.$Kind.$Framework" -IsMultiJobVariable $false + +exit 0 \ No newline at end of file diff --git a/eng/common/performance/performance-setup.sh b/eng/common/performance/performance-setup.sh new file mode 100644 index 0000000000..126da5f76d --- /dev/null +++ b/eng/common/performance/performance-setup.sh @@ -0,0 +1,176 @@ +#!/usr/bin/env bash + +source_directory=$BUILD_SOURCESDIRECTORY +core_root_directory= +architecture=x64 +framework=netcoreapp3.0 +compilation_mode=tiered +repository=$BUILD_REPOSITORY_NAME +branch=$BUILD_SOURCEBRANCH +commit_sha=$BUILD_SOURCEVERSION +build_number=$BUILD_BUILDNUMBER +internal=false +kind="micro" +run_categories="coreclr corefx" +csproj="src\benchmarks\micro\MicroBenchmarks.csproj" +configurations= +run_from_perf_repo=false +use_core_run=true + +while (($# > 0)); do + lowerI="$(echo $1 | awk '{print tolower($0)}')" + case $lowerI in + --sourcedirectory) + source_directory=$2 + shift 2 + ;; + --corerootdirectory) + core_root_directory=$2 + shift 2 + ;; + --architecture) + architecture=$2 + shift 2 + ;; + --framework) + framework=$2 + shift 2 + ;; + --compilationmode) + compilation_mode=$2 + shift 2 + ;; + --repository) + repository=$2 + shift 2 + ;; + --branch) + branch=$2 + shift 2 + ;; + --commitsha) + commit_sha=$2 + shift 2 + ;; + --buildnumber) + build_number=$2 + shift 2 + ;; + --kind) + kind=$2 + shift 2 + ;; + --runcategories) + run_categories=$2 + shift 2 + ;; + --csproj) + csproj=$2 + shift 2 + ;; + --internal) + internal=true + shift 1 + ;; + --configurations) + configurations=$2 + shift 2 + ;; + --help) + echo "Common settings:" + echo " --corerootdirectory Directory where Core_Root exists, if running perf testing with --corerun" + echo " --architecture Architecture of the testing being run" + echo " --configurations List of key=value pairs that will be passed to perf testing infrastructure." + echo " ex: --configurations \"CompilationMode=Tiered OptimzationLevel=PGO\"" + echo " --help Print help and exit" + echo "" + echo "Advanced settings:" + echo " --framework The framework to run, if not running in master" + echo " --compliationmode The compilation mode if not passing --configurations" + echo " --sourcedirectory The directory of the sources. Defaults to env:BUILD_SOURCESDIRECTORY" + echo " --repository The name of the repository in the / format. Defaults to env:BUILD_REPOSITORY_NAME" + echo " --branch The name of the branch. Defaults to env:BUILD_SOURCEBRANCH" + echo " --commitsha The commit sha1 to run against. Defaults to env:BUILD_SOURCEVERSION" + echo " --buildnumber The build number currently running. Defaults to env:BUILD_BUILDNUMBER" + echo " --csproj The relative path to the benchmark csproj whose tests should be run. Defaults to src\benchmarks\micro\MicroBenchmarks.csproj" + echo " --kind Related to csproj. The kind of benchmarks that should be run. Defaults to micro" + echo " --runcategories Related to csproj. Categories of benchmarks to run. Defaults to \"coreclr corefx\"" + echo " --internal If the benchmarks are running as an official job." + echo "" + exit 0 + ;; + esac +done + +if [[ "$repository" == "dotnet/performance" ]]; then + run_from_perf_repo=true +fi + +if [ -z "$configurations" ]; then + configurations="CompliationMode=$compilation_mode" +fi + +if [ -z "$core_root_directory" ]; then + use_core_run=false +fi + +payload_directory=$source_directory/Payload +performance_directory=$payload_directory/performance +workitem_directory=$source_directory/workitem +extra_benchmark_dotnet_arguments="--iterationCount 1 --warmupCount 0 --invocationCount 1 --unrollFactor 1 --strategy ColdStart --stopOnFirstError true" +perflab_arguments= +queue=Ubuntu.1804.Amd64.Open +creator=$BUILD_DEFINITIONNAME +helix_source_prefix="pr" + +if [[ "$internal" == true ]]; then + perflab_arguments="--upload-to-perflab-container" + helix_source_prefix="official" + creator= + extra_benchmark_dotnet_arguments= + + if [[ "$architecture" = "arm64" ]]; then + queue=Ubuntu.1804.Arm64.Perf + else + queue=Ubuntu.1804.Amd64.Perf + fi +fi + +common_setup_arguments="--frameworks $framework --queue $queue --build-number $build_number --build-configs $configurations" +setup_arguments="--repository https://github.com/$repository --branch $branch --get-perf-hash --commit-sha $commit_sha $common_setup_arguments" + +if [[ "$run_from_perf_repo" = true ]]; then + payload_directory= + workitem_directory=$source_directory + performance_directory=$workitem_directory + setup_arguments="--perf-hash $commit_sha $common_setup_arguments" +else + git clone --branch master --depth 1 --quiet https://github.com/dotnet/performance $performance_directory + + docs_directory=$performance_directory/docs + mv $docs_directory $workitem_directory +fi + +if [[ "$use_core_run" = true ]]; then + new_core_root=$payload_directory/Core_Root + mv $core_root_directory $new_core_root +fi + +# Make sure all of our variables are available for future steps +echo "##vso[task.setvariable variable=UseCoreRun]$use_core_run" +echo "##vso[task.setvariable variable=Architecture]$architecture" +echo "##vso[task.setvariable variable=PayloadDirectory]$payload_directory" +echo "##vso[task.setvariable variable=PerformanceDirectory]$performance_directory" +echo "##vso[task.setvariable variable=WorkItemDirectory]$workitem_directory" +echo "##vso[task.setvariable variable=Queue]$queue" +echo "##vso[task.setvariable variable=SetupArguments]$setup_arguments" +echo "##vso[task.setvariable variable=Python]python3" +echo "##vso[task.setvariable variable=PerfLabArguments]$perflab_arguments" +echo "##vso[task.setvariable variable=ExtraBenchmarkDotNetArguments]$extra_benchmark_dotnet_arguments" +echo "##vso[task.setvariable variable=BDNCategories]$run_categories" +echo "##vso[task.setvariable variable=TargetCsproj]$csproj" +echo "##vso[task.setvariable variable=RunFromPerfRepo]$run_from_perf_repo" +echo "##vso[task.setvariable variable=Creator]$creator" +echo "##vso[task.setvariable variable=HelixSourcePrefix]$helix_source_prefix" +echo "##vso[task.setvariable variable=Kind]$kind" +echo "##vso[task.setvariable variable=_BuildConfig]$architecture.$kind.$framework" \ No newline at end of file diff --git a/eng/common/pipeline-logging-functions.ps1 b/eng/common/pipeline-logging-functions.ps1 index 7b61376f8a..af5f48aace 100644 --- a/eng/common/pipeline-logging-functions.ps1 +++ b/eng/common/pipeline-logging-functions.ps1 @@ -77,13 +77,14 @@ function Write-PipelineTaskError { [string]$Name, [string]$Value, [switch]$Secret, - [switch]$AsOutput) - + [switch]$AsOutput, + [bool]$IsMultiJobVariable=$true) + if($ci) { Write-LoggingCommand -Area 'task' -Event 'setvariable' -Data $Value -Properties @{ 'variable' = $Name 'isSecret' = $Secret - 'isOutput' = 'true' + 'isOutput' = $IsMultiJobVariable } -AsOutput:$AsOutput } } diff --git a/eng/common/post-build/trigger-subscriptions.ps1 b/eng/common/post-build/trigger-subscriptions.ps1 index db8a839457..1a91dab037 100644 --- a/eng/common/post-build/trigger-subscriptions.ps1 +++ b/eng/common/post-build/trigger-subscriptions.ps1 @@ -19,14 +19,14 @@ function Get-Headers([string]$accept, [string]$barToken) { } # Get all the $SourceRepo subscriptions -$normalizedSurceRepo = $SourceRepo.Replace('dnceng@', '') -$getSubscriptionsApiEndpoint = "$maestroEndpoint/api/subscriptions?sourceRepository=$normalizedSurceRepo&api-version=$apiVersion" +$normalizedSourceRepo = $SourceRepo.Replace('dnceng@', '') +$getSubscriptionsApiEndpoint = "$maestroEndpoint/api/subscriptions?sourceRepository=$normalizedSourceRepo&api-version=$apiVersion" $headers = Get-Headers 'application/json' $barToken $subscriptions = Invoke-WebRequest -Uri $getSubscriptionsApiEndpoint -Headers $headers | ConvertFrom-Json if (!$subscriptions) { - Write-Host "No subscriptions found for source repo '$normalizedSurceRepo' in channel '$ChannelId'" + Write-Host "No subscriptions found for source repo '$normalizedSourceRepo' in channel '$ChannelId'" return } diff --git a/eng/common/templates/job/performance.yml b/eng/common/templates/job/performance.yml new file mode 100644 index 0000000000..ef809253d1 --- /dev/null +++ b/eng/common/templates/job/performance.yml @@ -0,0 +1,93 @@ +parameters: + steps: [] # optional -- any additional steps that need to happen before pulling down the performance repo and sending the performance benchmarks to helix (ie building your repo) + variables: [] # optional -- list of additional variables to send to the template + jobName: '' # required -- job name + displayName: '' # optional -- display name for the job. Will use jobName if not passed + pool: '' # required -- name of the Build pool + container: '' # required -- name of the container + extraSetupParameters: '' # optional -- extra arguments to pass to the setup script + frameworks: ['netcoreapp3.0'] # optional -- list of frameworks to run against + continueOnError: 'false' # optional -- determines whether to continue the build if the step errors + dependsOn: '' # optional -- dependencies of the job + timeoutInMinutes: 320 # optional -- timeout for the job + enableTelemetry: false # optional -- enable for telemetry + +jobs: +- template: ../jobs/jobs.yml + parameters: + dependsOn: ${{ parameters.dependsOn }} + enableTelemetry: ${{ parameters.enableTelemetry }} + enablePublishBuildArtifacts: true + continueOnError: ${{ parameters.continueOnError }} + + jobs: + - job: '${{ parameters.jobName }}' + + ${{ if ne(parameters.displayName, '') }}: + displayName: '${{ parameters.displayName }}' + ${{ if eq(parameters.displayName, '') }}: + displayName: '${{ parameters.jobName }}' + + timeoutInMinutes: ${{ parameters.timeoutInMinutes }} + + variables: + + - ${{ each variable in parameters.variables }}: + - ${{ if ne(variable.name, '') }}: + - name: ${{ variable.name }} + value: ${{ variable.value }} + - ${{ if ne(variable.group, '') }}: + - group: ${{ variable.group }} + + - IsInternal: '' + - HelixApiAccessToken: '' + - HelixPreCommand: '' + + - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + - ${{ if eq(variables['Agent.Os'], 'Windows_NT') }}: + - HelixPreCommand: 'set "PERFLAB_UPLOAD_TOKEN=$(PerfCommandUploadToken)"' + - IsInternal: -Internal + - ${{ if ne(variables['Agent.Os'], 'Windows_NT') }}: + - HelixPreCommand: 'export PERFLAB_UPLOAD_TOKEN="$(PerfCommandUploadTokenLinux)"' + - IsInternal: --internal + - group: DotNet-HelixApi-Access + - group: dotnet-benchview + + workspace: + clean: all + pool: + ${{ parameters.pool }} + container: ${{ parameters.container }} + strategy: + matrix: + ${{ each framework in parameters.frameworks }}: + ${{ framework }}: + _Framework: ${{ framework }} + steps: + - checkout: self + clean: true + # Run all of the steps to setup repo + - ${{ each step in parameters.steps }}: + - ${{ step }} + - powershell: $(Build.SourcesDirectory)\eng\common\performance\performance-setup.ps1 $(IsInternal) -Framework $(_Framework) ${{ parameters.extraSetupParameters }} + displayName: Performance Setup (Windows) + condition: and(succeeded(), eq(variables['Agent.Os'], 'Windows_NT')) + continueOnError: ${{ parameters.continueOnError }} + - script: $(Build.SourcesDirectory)/eng/common/performance/performance-setup.sh $(IsInternal) --framework $(_Framework) ${{ parameters.extraSetupParameters }} + displayName: Performance Setup (Unix) + condition: and(succeeded(), ne(variables['Agent.Os'], 'Windows_NT')) + continueOnError: ${{ parameters.continueOnError }} + - script: $(Python) $(PerformanceDirectory)/scripts/ci_setup.py $(SetupArguments) + displayName: Run ci setup script + # Run perf testing in helix + - template: /eng/common/templates/steps/perf-send-to-helix.yml + parameters: + HelixSource: '$(HelixSourcePrefix)/$(Build.Repository.Name)/$(Build.SourceBranch)' # sources must start with pr/, official/, prodcon/, or agent/ + HelixType: 'test/performance/$(Kind)/$(_Framework)/$(Architecture)' + HelixAccessToken: $(HelixApiAccessToken) + HelixTargetQueues: $(Queue) + HelixPreCommands: $(HelixPreCommand) + Creator: $(Creator) + WorkItemTimeout: 4:00 # 4 hours + WorkItemDirectory: '$(WorkItemDirectory)' # WorkItemDirectory can not be empty, so we send it some docs to keep it happy + CorrelationPayloadDirectory: '$(PayloadDirectory)' # it gets checked out to a folder with shorter path than WorkItemDirectory so we can avoid file name too long exceptions \ No newline at end of file diff --git a/eng/common/templates/post-build/channels/internal-servicing.yml b/eng/common/templates/post-build/channels/internal-servicing.yml index 808d46b17f..50ad724fc0 100644 --- a/eng/common/templates/post-build/channels/internal-servicing.yml +++ b/eng/common/templates/post-build/channels/internal-servicing.yml @@ -81,10 +81,10 @@ stages: /p:IsInternalBuild=$(IsInternalBuild) /p:RepositoryName=$(Build.Repository.Name) /p:CommitSha=$(Build.SourceVersion) + /p:AzureStorageAccountName=$(ProxyBackedFeedsAccountName) + /p:AzureStorageAccountKey=$(dotnetfeed-storage-access-key-1) + /p:AzureDevOpsFeedsBaseUrl=$(dotnetfeed-internal-private-feed-url) /p:NugetPath=$(Agent.BuildDirectory)\Nuget\NuGet.exe - /p:AzdoTargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' - /p:TargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' - /p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)' /p:BARBuildId=$(BARBuildId) /p:MaestroApiEndpoint='https://maestro-prod.westus2.cloudapp.azure.com' /p:BuildAssetRegistryToken='$(MaestroAccessToken)' @@ -167,4 +167,4 @@ stages: - template: ../promote-build.yml parameters: - ChannelId: ${{ variables.InternalServicing_30_Channel_Id }} \ No newline at end of file + ChannelId: ${{ variables.InternalServicing_30_Channel_Id }} diff --git a/eng/common/templates/post-build/channels/public-dev-release.yml b/eng/common/templates/post-build/channels/public-dev-release.yml index 79c6822db7..bdc631016b 100644 --- a/eng/common/templates/post-build/channels/public-dev-release.yml +++ b/eng/common/templates/post-build/channels/public-dev-release.yml @@ -77,6 +77,7 @@ stages: filePath: eng\common\sdk-task.ps1 arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet /p:ChannelId=$(PublicDevRelease_30_Channel_Id) + /p:ArtifactsCategory=.NetCore /p:IsStableBuild=$(IsStableBuild) /p:IsInternalBuild=$(IsInternalBuild) /p:RepositoryName=$(Build.Repository.Name) diff --git a/eng/common/templates/post-build/channels/public-release.yml b/eng/common/templates/post-build/channels/public-release.yml index 25923020df..574cb1c2b9 100644 --- a/eng/common/templates/post-build/channels/public-release.yml +++ b/eng/common/templates/post-build/channels/public-release.yml @@ -81,10 +81,10 @@ stages: /p:IsInternalBuild=$(IsInternalBuild) /p:RepositoryName=$(Build.Repository.Name) /p:CommitSha=$(Build.SourceVersion) - /p:NugetPath=$(Agent.BuildDirectory)/Nuget/NuGet.exe - /p:AzdoTargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' - /p:TargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' - /p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)' + /p:AzureStorageAccountName=$(ProxyBackedFeedsAccountName) + /p:AzureStorageAccountKey=$(dotnetfeed-storage-access-key-1) + /p:AzureDevOpsFeedsBaseUrl=$(dotnetfeed-internal-private-feed-url) + /p:NugetPath=$(Agent.BuildDirectory)\Nuget\NuGet.exe /p:BARBuildId=$(BARBuildId) /p:MaestroApiEndpoint='https://maestro-prod.westus2.cloudapp.azure.com' /p:BuildAssetRegistryToken='$(MaestroAccessToken)' diff --git a/eng/common/templates/post-build/channels/public-validation-release.yml b/eng/common/templates/post-build/channels/public-validation-release.yml index 114477d3ad..f12f402ad9 100644 --- a/eng/common/templates/post-build/channels/public-validation-release.yml +++ b/eng/common/templates/post-build/channels/public-validation-release.yml @@ -48,6 +48,7 @@ stages: filePath: eng\common\sdk-task.ps1 arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet /p:ChannelId=$(PublicValidationRelease_30_Channel_Id) + /p:ArtifactsCategory=.NetCoreValidation /p:IsStableBuild=$(IsStableBuild) /p:IsInternalBuild=$(IsInternalBuild) /p:RepositoryName=$(Build.Repository.Name) diff --git a/eng/common/templates/post-build/common-variables.yml b/eng/common/templates/post-build/common-variables.yml index 8283467352..42df4ae77e 100644 --- a/eng/common/templates/post-build/common-variables.yml +++ b/eng/common/templates/post-build/common-variables.yml @@ -14,5 +14,8 @@ variables: # Whether the build is internal or not IsInternalBuild: ${{ and(ne(variables['System.TeamProject'], 'public'), contains(variables['Build.SourceBranch'], 'internal')) }} + # Storage account name for proxy-backed feeds + ProxyBackedFeedsAccountName: dotnetfeed + SourceLinkCLIVersion: 3.0.0 SymbolToolVersion: 1.0.1 diff --git a/eng/common/templates/steps/perf-send-to-helix.yml b/eng/common/templates/steps/perf-send-to-helix.yml new file mode 100644 index 0000000000..b3ea9acf1f --- /dev/null +++ b/eng/common/templates/steps/perf-send-to-helix.yml @@ -0,0 +1,66 @@ +# Please remember to update the documentation if you make changes to these parameters! +parameters: + HelixSource: 'pr/default' # required -- sources must start with pr/, official/, prodcon/, or agent/ + HelixType: 'tests/default/' # required -- Helix telemetry which identifies what type of data this is; should include "test" for clarity and must end in '/' + HelixBuild: $(Build.BuildNumber) # required -- the build number Helix will use to identify this -- automatically set to the AzDO build number + HelixTargetQueues: '' # required -- semicolon delimited list of Helix queues to test on; see https://helix.dot.net/ for a list of queues + HelixAccessToken: '' # required -- access token to make Helix API requests; should be provided by the appropriate variable group + HelixPreCommands: '' # optional -- commands to run before Helix work item execution + HelixPostCommands: '' # optional -- commands to run after Helix work item execution + WorkItemDirectory: '' # optional -- a payload directory to zip up and send to Helix; requires WorkItemCommand; incompatible with XUnitProjects + CorrelationPayloadDirectory: '' # optional -- a directory to zip up and send to Helix as a correlation payload + IncludeDotNetCli: false # optional -- true will download a version of the .NET CLI onto the Helix machine as a correlation payload; requires DotNetCliPackageType and DotNetCliVersion + DotNetCliPackageType: '' # optional -- either 'sdk' or 'runtime'; determines whether the sdk or runtime will be sent to Helix; see https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases.json + DotNetCliVersion: '' # optional -- version of the CLI to send to Helix; based on this: https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases.json + EnableXUnitReporter: false # optional -- true enables XUnit result reporting to Mission Control + WaitForWorkItemCompletion: true # optional -- true will make the task wait until work items have been completed and fail the build if work items fail. False is "fire and forget." + Creator: '' # optional -- if the build is external, use this to specify who is sending the job + DisplayNamePrefix: 'Send job to Helix' # optional -- rename the beginning of the displayName of the steps in AzDO + condition: succeeded() # optional -- condition for step to execute; defaults to succeeded() + continueOnError: false # optional -- determines whether to continue the build if the step errors; defaults to false + +steps: + - powershell: $(Build.SourcesDirectory)\eng\common\msbuild.ps1 $(Build.SourcesDirectory)\eng\common\performance\perfhelixpublish.proj /restore /t:Test /bl:$(Build.SourcesDirectory)\artifacts\log\$env:BuildConfig\SendToHelix.binlog + displayName: ${{ parameters.DisplayNamePrefix }} (Windows) + env: + BuildConfig: $(_BuildConfig) + HelixSource: ${{ parameters.HelixSource }} + HelixType: ${{ parameters.HelixType }} + HelixBuild: ${{ parameters.HelixBuild }} + HelixTargetQueues: ${{ parameters.HelixTargetQueues }} + HelixAccessToken: ${{ parameters.HelixAccessToken }} + HelixPreCommands: ${{ parameters.HelixPreCommands }} + HelixPostCommands: ${{ parameters.HelixPostCommands }} + WorkItemDirectory: ${{ parameters.WorkItemDirectory }} + CorrelationPayloadDirectory: ${{ parameters.CorrelationPayloadDirectory }} + IncludeDotNetCli: ${{ parameters.IncludeDotNetCli }} + DotNetCliPackageType: ${{ parameters.DotNetCliPackageType }} + DotNetCliVersion: ${{ parameters.DotNetCliVersion }} + EnableXUnitReporter: ${{ parameters.EnableXUnitReporter }} + WaitForWorkItemCompletion: ${{ parameters.WaitForWorkItemCompletion }} + Creator: ${{ parameters.Creator }} + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + condition: and(${{ parameters.condition }}, eq(variables['Agent.Os'], 'Windows_NT')) + continueOnError: ${{ parameters.continueOnError }} + - script: $BUILD_SOURCESDIRECTORY/eng/common/msbuild.sh $BUILD_SOURCESDIRECTORY/eng/common/performance/perfhelixpublish.proj /restore /t:Test /bl:$BUILD_SOURCESDIRECTORY/artifacts/log/$BuildConfig/SendToHelix.binlog + displayName: ${{ parameters.DisplayNamePrefix }} (Unix) + env: + BuildConfig: $(_BuildConfig) + HelixSource: ${{ parameters.HelixSource }} + HelixType: ${{ parameters.HelixType }} + HelixBuild: ${{ parameters.HelixBuild }} + HelixTargetQueues: ${{ parameters.HelixTargetQueues }} + HelixAccessToken: ${{ parameters.HelixAccessToken }} + HelixPreCommands: ${{ parameters.HelixPreCommands }} + HelixPostCommands: ${{ parameters.HelixPostCommands }} + WorkItemDirectory: ${{ parameters.WorkItemDirectory }} + CorrelationPayloadDirectory: ${{ parameters.CorrelationPayloadDirectory }} + IncludeDotNetCli: ${{ parameters.IncludeDotNetCli }} + DotNetCliPackageType: ${{ parameters.DotNetCliPackageType }} + DotNetCliVersion: ${{ parameters.DotNetCliVersion }} + EnableXUnitReporter: ${{ parameters.EnableXUnitReporter }} + WaitForWorkItemCompletion: ${{ parameters.WaitForWorkItemCompletion }} + Creator: ${{ parameters.Creator }} + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + condition: and(${{ parameters.condition }}, ne(variables['Agent.Os'], 'Windows_NT')) + continueOnError: ${{ parameters.continueOnError }} diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index 60741f0390..9abaac015f 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -84,7 +84,7 @@ function Exec-Process([string]$command, [string]$commandArgs) { return $global:LASTEXITCODE = $process.ExitCode } finally { - # If we didn't finish then an error occured or the user hit ctrl-c. Either + # If we didn't finish then an error occurred or the user hit ctrl-c. Either # way kill the process if (-not $finished) { $process.Kill() @@ -147,7 +147,7 @@ function InitializeDotNetCli([bool]$install) { # It also ensures that VS msbuild will use the downloaded sdk targets. $env:PATH = "$dotnetRoot;$env:PATH" - # Make Sure that our bootstrapped dotnet cli is avaliable in future steps of the Azure Pipelines build + # Make Sure that our bootstrapped dotnet cli is available in future steps of the Azure Pipelines build Write-PipelinePrependPath -Path $dotnetRoot Write-PipelineSetVariable -Name 'DOTNET_MULTILEVEL_LOOKUP' -Value '0' Write-PipelineSetVariable -Name 'DOTNET_SKIP_FIRST_TIME_EXPERIENCE' -Value '1' diff --git a/global.json b/global.json index 4c66387e58..60dbe5efe9 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19359.6", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19360.8", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 3d85935501cfb4269862135f31136a5e41bb1a1f Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Thu, 11 Jul 2019 20:14:51 -0700 Subject: [PATCH 117/159] Better record and value formatting in tools (#7021) * Remove semicolons from record tooltips * Update to put a space between braces * Update formatting as best I can, plus some tests I guess * More baseline updates * Anonymous records * Update anon records tests * Add vsbsl lol * Update baselines and reduce a simple filter * Update baselines maybe last time * Update fsharpqa test * make tests pass * Add formatting for values * Update tests * Update test * Update fsharpqa tests * tryit * lol * get yote * shlerp * Update tests again I guess * more update * mother of pearl * this is a real turd --- .../QuickInfoTests.fs | 6 ++--- src/fsharp/NicePrint.fs | 22 ++++++++++++------- src/utils/sformat.fs | 20 +++++++---------- 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/fcs/FSharp.Compiler.Service.Tests/QuickInfoTests.fs b/fcs/FSharp.Compiler.Service.Tests/QuickInfoTests.fs index bfa6c7df72..415079942e 100644 --- a/fcs/FSharp.Compiler.Service.Tests/QuickInfoTests.fs +++ b/fcs/FSharp.Compiler.Service.Tests/QuickInfoTests.fs @@ -154,9 +154,9 @@ module Test = let quickInfo = GetQuickInfoTextFromCode code let expected = expectedLines [ "type MyEmployee =" - " {mutable Name: string;" - " mutable Age: int;" - " mutable IsFTE: bool;}" + " { mutable Name: string" + " mutable Age: int" + " mutable IsFTE: bool }" "Full name: FsTest.MyEmployee" ] Assert.AreEqual(expected, quickInfo) () diff --git a/src/fsharp/NicePrint.fs b/src/fsharp/NicePrint.fs index 5d56543e99..2d9ea197db 100644 --- a/src/fsharp/NicePrint.fs +++ b/src/fsharp/NicePrint.fs @@ -32,8 +32,8 @@ module internal PrintUtilities = let bracketIfL x lyt = if x then bracketL lyt else lyt let squareAngleL x = LeftL.leftBracketAngle ^^ x ^^ RightL.rightBracketAngle let angleL x = sepL Literals.leftAngle ^^ x ^^ rightL Literals.rightAngle - let braceL x = leftL Literals.leftBrace ^^ x ^^ rightL Literals.rightBrace - let braceBarL x = leftL Literals.leftBraceBar ^^ x ^^ rightL Literals.rightBraceBar + let braceL x = wordL Literals.leftBrace ^^ x ^^ wordL Literals.rightBrace + let braceBarL x = wordL Literals.leftBraceBar ^^ x ^^ wordL Literals.rightBraceBar let comment str = wordL (tagText (sprintf "(* %s *)" str)) @@ -942,7 +942,7 @@ module private PrintTypes = // Layout a tuple type | TType_anon (anonInfo, tys) -> - let core = sepListL (wordL (tagPunctuation ";")) (List.map2 (fun nm ty -> wordL (tagField nm) ^^ wordL (tagPunctuation ":") ^^ layoutTypeWithInfoAndPrec denv env prec ty) (Array.toList anonInfo.SortedNames) tys) + let core = sepListL (rightL (tagPunctuation ";")) (List.map2 (fun nm ty -> wordL (tagField nm) ^^ rightL (tagPunctuation ":") ^^ layoutTypeWithInfoAndPrec denv env prec ty) (Array.toList anonInfo.SortedNames) tys) if evalAnonInfoIsStruct anonInfo then WordL.keywordStruct --- braceBarL core else @@ -1457,7 +1457,7 @@ module private TastDefinitionPrinting = let lhs = tagRecordField fld.Name |> mkNav fld.DefinitionRange - |> wordL + |> wordL let lhs = (if addAccess then layoutAccessibility denv fld.Accessibility lhs else lhs) let lhs = if fld.IsMutable then wordL (tagKeyword "mutable") --- lhs else lhs (lhs ^^ RightL.colon) --- layoutType denv fld.FormalType @@ -1738,8 +1738,15 @@ module private TastDefinitionPrinting = let denv = denv.AddAccessibility tycon.TypeReprAccessibility match repr with | TRecdRepr _ -> - let recdFieldRefL fld = layoutRecdField false denv fld ^^ rightL (tagPunctuation ";") - let recdL = tycon.TrueFieldsAsList |> List.map recdFieldRefL |> applyMaxMembers denv.maxMembers |> aboveListL |> braceL + let recdFieldRefL fld = layoutRecdField false denv fld + + let recdL = + tycon.TrueFieldsAsList + |> List.map recdFieldRefL + |> applyMaxMembers denv.maxMembers + |> aboveListL + |> braceL + Some (addMembersAsWithEnd (addReprAccessL recdL)) | TFSharpObjectRepr r -> @@ -1771,8 +1778,7 @@ module private TastDefinitionPrinting = | _ -> [] let vsprs = tycon.MembersOfFSharpTyconSorted - |> List.filter (fun v -> isNil (Option.get v.MemberInfo).ImplementedSlotSigs) - |> List.filter (fun v -> v.IsDispatchSlot) + |> List.filter (fun v -> isNil (Option.get v.MemberInfo).ImplementedSlotSigs && v.IsDispatchSlot) |> List.map (fun vref -> PrintTastMemberOrVals.prettyLayoutOfValOrMemberNoInst denv vref.Deref) let staticValsLs = tycon.TrueFieldsAsList diff --git a/src/utils/sformat.fs b/src/utils/sformat.fs index b490283f67..228f4aba39 100755 --- a/src/utils/sformat.fs +++ b/src/utils/sformat.fs @@ -759,18 +759,14 @@ namespace Microsoft.FSharp.Text.StructuredPrintfImpl // pprinter: attributes // -------------------------------------------------------------------- - let makeRecordVerticalL nameXs = - let itemL (name,xL) = let labelL = wordL name in ((labelL ^^ wordL Literals.equals)) -- (xL ^^ (rightL Literals.semicolon)) - let braceL xs = (leftL Literals.leftBrace) ^^ xs ^^ (rightL Literals.rightBrace) - braceL (aboveListL (List.map itemL nameXs)) - - // This is a more compact rendering of records - and is more like tuples - let makeRecordHorizontalL nameXs = - let itemL (name,xL) = let labelL = wordL name in ((labelL ^^ wordL Literals.equals)) -- xL - let braceL xs = (leftL Literals.leftBrace) ^^ xs ^^ (rightL Literals.rightBrace) - braceL (sepListL (rightL Literals.semicolon) (List.map itemL nameXs)) - - let makeRecordL nameXs = makeRecordVerticalL nameXs + let makeRecordL nameXs = + let itemL (name,xL) = wordL name ^^ wordL Literals.equals -- xL + let braceL xs = (wordL Literals.leftBrace) ^^ xs ^^ (wordL Literals.rightBrace) + + nameXs + |> List.map itemL + |> aboveListL + |> braceL let makePropertiesL nameXs = let itemL (name,v) = From 25bb0c60c15a7bb9e62a39fd0b090c39550be2f1 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 12 Jul 2019 06:04:23 +0100 Subject: [PATCH 118/159] fix portable PDBs for anon records (#7099) --- src/absil/ilwritepdb.fs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/absil/ilwritepdb.fs b/src/absil/ilwritepdb.fs index 260ccbe238..2a992ed485 100644 --- a/src/absil/ilwritepdb.fs +++ b/src/absil/ilwritepdb.fs @@ -403,12 +403,17 @@ let generatePortablePdb (embedAllSource: bool) (embedSourceList: string list) (s if i < 1 || offsetDelta > 0 then builder.WriteCompressedInteger offsetDelta - // Hidden-sequence-point-record - if startLine = 0xfeefee || endLine = 0xfeefee || (startColumn = 0 && endColumn = 0) + // Check for hidden-sequence-point-record + if startLine = 0xfeefee || + endLine = 0xfeefee || + (startColumn = 0 && endColumn = 0) || + ((endLine - startLine) = 0 && (endColumn - startColumn) = 0) then + // Hidden-sequence-point-record builder.WriteCompressedInteger 0 builder.WriteCompressedInteger 0 - else // Non-hidden-sequence-point-record + else + // Non-hidden-sequence-point-record let deltaLines = endLine - startLine // lines builder.WriteCompressedInteger deltaLines From 135a1ae86499807d7c06c985e8067fac7453dda2 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 12 Jul 2019 12:49:41 -0700 Subject: [PATCH 119/159] Update dependencies from https://github.com/dotnet/arcade build 20190711.7 (#7216) - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19361.7 --- eng/Version.Details.xml | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index bfb72eca15..e2195f4bc5 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - a6ae1b637ed236354529992729af875f6c8a180a + f1b09644408f45f43f5835786b3e4bdfd2e78141 diff --git a/global.json b/global.json index 60dbe5efe9..ca0cec66a7 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19360.8", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19361.7", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 7c72eb059b1b398c7478410c07521c55d107e413 Mon Sep 17 00:00:00 2001 From: Solomon Rutzky Date: Sat, 13 Jul 2019 14:59:46 -0400 Subject: [PATCH 120/159] Fix Supplementary Character / Surrogate Pair info (no code changes) (#7221) Terminology and info regarding Supplementary Characters / Surrogate Pairs is either incorrect, or at least incomplete (which then leads to incorrect statements and/or code). 1. Introduce the term "Supplementary Character" since that is often what we are dealing with, not "surrogate pairs" since that is an encoding-specific concept (UTF-16 only). 2. Add comment re: Supplementary Character code point range, which helps to explain the `elif high > 0x10 then Invalid` condition (line 173). 3. Fix URI for Unicode Standard PDF, Chapter 3, and specify the name of the section (i.e. "Surrogates") instead of the section number (i.e. 3.8) since the section number was 3.7 but is now 3.8 (line 174). 4. Add comment for definition of a valid "surrogate pair" because why make the reader guess or have to go look it up when it will never change? (line 175) 5. Correct and expand comment with example long Unicode escape sequence (line 64): `"\UDEADBEEF"` is _not_ a valid escape sequence. Usage of the `\U` escape has been misstated from the very beginning, both in this documentation as well as the C# Specification documentation, and the language references for "String" for both F# and C#: 1. `\U` is used to specify a Unicode code point (or UTF-32 code unit, which maps 1:1 with all Unicode code points, hence they are synonymous), not surrogate pairs. Hence the valid range is `00000000` - `0010FFFF`, hence the first two digits are static `0`s, and the third digit can only ever be a `0` or `1`. This escape sequence can specify either a BMP character or a Supplementary character. Supplementary characters are then encoded as a surrogate pair in UTF-16 only, not in UTF-8 or UTF-32. If you want to specify an actual surrogate pair, then use the `\u` escape, e.g. `\uD83D\uDC7D` == `\U0001F47D`. 2. Even if you could specify a surrogate pair using `\U`, "DEADBEEF" is not valid. U+DEAD is a valid surrogate, _but_ it's a low surrogate code point and cannot be specified first in the pair (meaning, at best one could use `\UxxxxDEAD`). Also, U+BEEF is _not_ a valid surrogate code point, high or low. Surrogate code points are in the range of U+D800 to U+DFFF. For more info, please see: https://sqlquantumleap.com/2019/06/26/unicode-escape-sequences-across-various-languages-and-platforms-including-supplementary-characters/#fsharp --- src/fsharp/lexhelp.fs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/fsharp/lexhelp.fs b/src/fsharp/lexhelp.fs index e966678486..fb66ac5f85 100755 --- a/src/fsharp/lexhelp.fs +++ b/src/fsharp/lexhelp.fs @@ -60,7 +60,8 @@ type lexargs = applyLineDirectives: bool pathMap: PathMap } -/// possible results of lexing a long unicode escape sequence in a string literal, e.g. "\UDEADBEEF" +/// possible results of lexing a long Unicode escape sequence in a string literal, e.g. "\U0001F47D", +/// "\U000000E7", or "\UDEADBEEF" returning SurrogatePair, SingleChar, or Invalid, respectively type LongUnicodeLexResult = | SurrogatePair of uint16 * uint16 | SingleChar of uint16 @@ -169,7 +170,9 @@ let unicodeGraphLong (s:string) = if high = 0 then SingleChar(uint16 low) // invalid encoding elif high > 0x10 then Invalid - // valid surrogate pair - see http://www.unicode.org/unicode/uni2book/ch03.pdf, section 3.7 *) + // valid supplementary character: code points U+10000 to U+10FFFF + // valid surrogate pair: see http://www.unicode.org/versions/latest/ch03.pdf , "Surrogates" section + // high-surrogate code point (U+D800 to U+DBFF) followed by low-surrogate code point (U+DC00 to U+DFFF) else let codepoint = high * 0x10000 + low let hiSurr = uint16 (0xD800 + ((codepoint - 0x10000) / 0x400)) From e6e36bb1e5c68ffb155aa500202a0218723a52b0 Mon Sep 17 00:00:00 2001 From: Will Smith Date: Sat, 13 Jul 2019 18:47:41 -0700 Subject: [PATCH 121/159] Update IlxGen.fs (#7227) --- src/fsharp/IlxGen.fs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/fsharp/IlxGen.fs b/src/fsharp/IlxGen.fs index 74d633b9f9..b77d06e508 100755 --- a/src/fsharp/IlxGen.fs +++ b/src/fsharp/IlxGen.fs @@ -2533,7 +2533,8 @@ and GenAllocUnionCase cenv cgbuf eenv (c,tyargs,args,m) sequel = GenSequel cenv eenv.cloc cgbuf sequel and GenLinearExpr cenv cgbuf eenv sp expr sequel canProcessSequencePoint (contf: FakeUnit -> FakeUnit) = - match stripExpr expr with + let expr = stripExpr expr + match expr with | LinearOpExpr (TOp.UnionCase c, tyargs, argsFront, argLast, m) -> GenExprs cenv cgbuf eenv argsFront GenLinearExpr cenv cgbuf eenv SPSuppress argLast Continue (* canProcessSequencePoint *) true (contf << (fun Fake -> From 3fcec3dce9670277e16d62a2d42019f9c4179024 Mon Sep 17 00:00:00 2001 From: dotnet-maestro <@dotnet-maestro> Date: Sat, 13 Jul 2019 12:47:20 +0000 Subject: [PATCH 122/159] Update dependencies from https://github.com/dotnet/arcade build 20190712.5 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19362.5 --- eng/Version.Details.xml | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index e2195f4bc5..55da8d6499 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - f1b09644408f45f43f5835786b3e4bdfd2e78141 + 15f50ca6a9d0b441c9927421657fb9dc91206cc9 diff --git a/global.json b/global.json index ca0cec66a7..a6d76946ba 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19361.7", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19362.5", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 004039752842c22629149d76480e4005e2463b79 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2019 11:12:26 -0700 Subject: [PATCH 123/159] [master] Update dependencies from dotnet/arcade (#7233) * Update dependencies from https://github.com/dotnet/arcade build 20190713.1 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19363.1 * Update dependencies from https://github.com/dotnet/arcade build 20190714.1 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19364.1 --- eng/Version.Details.xml | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 55da8d6499..119dfcd3a4 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - 15f50ca6a9d0b441c9927421657fb9dc91206cc9 + 0c81c2bbdc49749e9940bc8858ebd16026d51277 diff --git a/global.json b/global.json index a6d76946ba..81be3571ad 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19362.5", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19364.1", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 7ef84ae832a888bb827717ec4b879d1e9d10760d Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2019 10:23:25 -0700 Subject: [PATCH 124/159] Update dependencies from https://github.com/dotnet/arcade build 20190715.4 (#7240) - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19365.4 --- eng/Version.Details.xml | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 119dfcd3a4..19eab0f3c7 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - 0c81c2bbdc49749e9940bc8858ebd16026d51277 + fb27fd4d8a2b67d4333e33d4b898c65171c9f3c1 diff --git a/global.json b/global.json index 81be3571ad..616ab02e47 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19364.1", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19365.4", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 0e2fd0b2c834c491448c573dfddab718413c3c0e Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 17 Jul 2019 10:24:11 -0700 Subject: [PATCH 125/159] Update dependencies from https://github.com/dotnet/arcade build 20190716.4 (#7245) - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19366.4 --- eng/Version.Details.xml | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 19eab0f3c7..86d49308d4 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - fb27fd4d8a2b67d4333e33d4b898c65171c9f3c1 + 0dd5e2025f0049c133a8706f40e4463b193e5d17 diff --git a/global.json b/global.json index 616ab02e47..7d6048be9f 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19365.4", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19366.4", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 89b1ec5ecbaa57afc4349b1a77df3b46284f22c9 Mon Sep 17 00:00:00 2001 From: dotnet-maestro <@dotnet-maestro> Date: Thu, 18 Jul 2019 12:51:28 +0000 Subject: [PATCH 126/159] Update dependencies from https://github.com/dotnet/arcade build 20190717.8 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19367.8 --- eng/Version.Details.xml | 4 ++-- eng/common/init-tools-native.sh | 2 +- .../templates/post-build/channels/internal-servicing.yml | 1 + eng/common/templates/post-build/channels/public-release.yml | 1 + eng/common/tools.ps1 | 2 +- global.json | 2 +- 6 files changed, 7 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 86d49308d4..35196ac2a5 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - 0dd5e2025f0049c133a8706f40e4463b193e5d17 + 2359dc4184133defa27c8f3072622270b71b4ecf diff --git a/eng/common/init-tools-native.sh b/eng/common/init-tools-native.sh index fc72d13948..5f2e77f448 100644 --- a/eng/common/init-tools-native.sh +++ b/eng/common/init-tools-native.sh @@ -71,7 +71,7 @@ function ReadGlobalJsonNativeTools { local native_tools_list=$(echo $native_tools_section | awk -F"[{}]" '{print $2}') native_tools_list=${native_tools_list//[\" ]/} native_tools_list=${native_tools_list//,/$'\n'} - native_tools_list="$(echo -e "${native_tools_list}" | tr -d '[:space:]')" + native_tools_list="$(echo -e "${native_tools_list}" | tr -d '[[:space:]]')" local old_IFS=$IFS while read -r line; do diff --git a/eng/common/templates/post-build/channels/internal-servicing.yml b/eng/common/templates/post-build/channels/internal-servicing.yml index 50ad724fc0..648e854e0e 100644 --- a/eng/common/templates/post-build/channels/internal-servicing.yml +++ b/eng/common/templates/post-build/channels/internal-servicing.yml @@ -84,6 +84,7 @@ stages: /p:AzureStorageAccountName=$(ProxyBackedFeedsAccountName) /p:AzureStorageAccountKey=$(dotnetfeed-storage-access-key-1) /p:AzureDevOpsFeedsBaseUrl=$(dotnetfeed-internal-private-feed-url) + /p:StaticInternalFeed=$(dotnetfeed-internal-nonstable-feed-url) /p:NugetPath=$(Agent.BuildDirectory)\Nuget\NuGet.exe /p:BARBuildId=$(BARBuildId) /p:MaestroApiEndpoint='https://maestro-prod.westus2.cloudapp.azure.com' diff --git a/eng/common/templates/post-build/channels/public-release.yml b/eng/common/templates/post-build/channels/public-release.yml index 574cb1c2b9..f6a7efdfe9 100644 --- a/eng/common/templates/post-build/channels/public-release.yml +++ b/eng/common/templates/post-build/channels/public-release.yml @@ -84,6 +84,7 @@ stages: /p:AzureStorageAccountName=$(ProxyBackedFeedsAccountName) /p:AzureStorageAccountKey=$(dotnetfeed-storage-access-key-1) /p:AzureDevOpsFeedsBaseUrl=$(dotnetfeed-internal-private-feed-url) + /p:StaticInternalFeed=$(dotnetfeed-internal-nonstable-feed-url) /p:NugetPath=$(Agent.BuildDirectory)\Nuget\NuGet.exe /p:BARBuildId=$(BARBuildId) /p:MaestroApiEndpoint='https://maestro-prod.westus2.cloudapp.azure.com' diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index 9abaac015f..8fe2b11ad2 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -169,7 +169,7 @@ function InstallDotNetSdk([string] $dotnetRoot, [string] $version, [string] $arc InstallDotNet $dotnetRoot $version $architecture } -function InstallDotNet([string] $dotnetRoot, [string] $version, [string] $architecture = "", [string] $runtime = "", [bool] $skipNonVersionedFiles = $false) { $installScript = GetDotNetInstallScript $dotnetRoot +function InstallDotNet([string] $dotnetRoot, [string] $version, [string] $architecture = "", [string] $runtime = "", [bool] $skipNonVersionedFiles = $false) { $installScript = GetDotNetInstallScript $dotnetRoot $installParameters = @{ Version = $version diff --git a/global.json b/global.json index 7d6048be9f..b4297bf622 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19366.4", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19367.8", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From d4866e4a8a80f4f1c898318bb564e1937833a4a7 Mon Sep 17 00:00:00 2001 From: Faisal Alfaddaghi Date: Fri, 19 Jul 2019 20:36:19 +0300 Subject: [PATCH 127/159] Move UnitGenericAbstractType To Nunit (#7257) --- .../ErrorMessages/UnitGenericAbstactType.fs | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/fsharp/Compiler/ErrorMessages/UnitGenericAbstactType.fs diff --git a/tests/fsharp/Compiler/ErrorMessages/UnitGenericAbstactType.fs b/tests/fsharp/Compiler/ErrorMessages/UnitGenericAbstactType.fs new file mode 100644 index 0000000000..e9165a4cf6 --- /dev/null +++ b/tests/fsharp/Compiler/ErrorMessages/UnitGenericAbstactType.fs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.UnitTests + +open NUnit.Framework +open FSharp.Compiler.SourceCodeServices + +[] +module ``Unit generic abstract Type`` = + + [] + let ``Unit can not be used as return type of abstract method paramete on return type``() = + CompilerAssert.TypeCheckSingleError + """ +type EDF<'S> = + abstract member Apply : int -> 'S +type SomeEDF () = + interface EDF with + member this.Apply d = + // [ERROR] The member 'Apply' does not have the correct type to override the corresponding abstract method. + () + """ + FSharpErrorSeverity.Error + 17 + (6, 21, 6, 26) + "The member 'Apply : int -> unit' is specialized with 'unit' but 'unit' can't be used as return type of an abstract method parameterized on return type." + From bccd03159078023bdd3eaab37606cd82beabf498 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 19 Jul 2019 10:38:48 -0700 Subject: [PATCH 128/159] Update dependencies from https://github.com/dotnet/arcade build 20190718.7 (#7256) - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19368.7 --- eng/Version.Details.xml | 4 +- eng/common/pipeline-logging-functions.sh | 82 ++++++++++++++++++++++-- eng/common/tools.sh | 19 +++--- global.json | 2 +- 4 files changed, 87 insertions(+), 20 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 35196ac2a5..7a60463a0f 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - 2359dc4184133defa27c8f3072622270b71b4ecf + eecde8a8751dbe7fdb17ba4dfbd032e26f4cae7d diff --git a/eng/common/pipeline-logging-functions.sh b/eng/common/pipeline-logging-functions.sh index 6098f9a543..1c560a5061 100644 --- a/eng/common/pipeline-logging-functions.sh +++ b/eng/common/pipeline-logging-functions.sh @@ -39,11 +39,11 @@ function Write-PipelineTaskError { return fi - message_type="error" - sourcepath='' - linenumber='' - columnnumber='' - error_code='' + local message_type="error" + local sourcepath='' + local linenumber='' + local columnnumber='' + local error_code='' while [[ $# -gt 0 ]]; do opt="$(echo "${1/#--/-}" | awk '{print tolower($0)}')" @@ -76,7 +76,7 @@ function Write-PipelineTaskError { shift done - message="##vso[task.logissue" + local message="##vso[task.logissue" message="$message type=$message_type" @@ -100,3 +100,73 @@ function Write-PipelineTaskError { echo "$message" } +function Write-PipelineSetVariable { + if [[ "$ci" != true ]]; then + return + fi + + local name='' + local value='' + local secret=false + local as_output=false + local is_multi_job_variable=true + + while [[ $# -gt 0 ]]; do + opt="$(echo "${1/#--/-}" | awk '{print tolower($0)}')" + case "$opt" in + -name|-n) + name=$2 + shift + ;; + -value|-v) + value=$2 + shift + ;; + -secret|-s) + secret=true + ;; + -as_output|-a) + as_output=true + ;; + -is_multi_job_variable|-i) + is_multi_job_variable=$2 + shift + ;; + esac + shift + done + + value=${value/;/%3B} + value=${value/\\r/%0D} + value=${value/\\n/%0A} + value=${value/]/%5D} + + local message="##vso[task.setvariable variable=$name;isSecret=$secret;isOutput=$is_multi_job_variable]$value" + + if [[ "$as_output" == true ]]; then + $message + else + echo "$message" + fi +} + +function Write-PipelinePrependPath { + local prepend_path='' + + while [[ $# -gt 0 ]]; do + opt="$(echo "${1/#--/-}" | awk '{print tolower($0)}')" + case "$opt" in + -path|-p) + prepend_path=$2 + shift + ;; + esac + shift + done + + export PATH="$prepend_path:$PATH" + + if [[ "$ci" == true ]]; then + echo "##vso[task.prependpath]$prepend_path" + fi +} \ No newline at end of file diff --git a/eng/common/tools.sh b/eng/common/tools.sh index 70d92cf85a..0deb01c480 100644 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -146,14 +146,10 @@ function InitializeDotNetCli { # Add dotnet to PATH. This prevents any bare invocation of dotnet in custom # build steps from using anything other than what we've downloaded. - export PATH="$dotnet_root:$PATH" + Write-PipelinePrependPath -path "$dotnet_root" - if [[ $ci == true ]]; then - # Make Sure that our bootstrapped dotnet cli is available in future steps of the Azure Pipelines build - echo "##vso[task.prependpath]$dotnet_root" - echo "##vso[task.setvariable variable=DOTNET_MULTILEVEL_LOOKUP]0" - echo "##vso[task.setvariable variable=DOTNET_SKIP_FIRST_TIME_EXPERIENCE]1" - fi + Write-PipelineSetVariable -name "DOTNET_MULTILEVEL_LOOKUP" -value "0" + Write-PipelineSetVariable -name "DOTNET_SKIP_FIRST_TIME_EXPERIENCE" -value "1" # return value _InitializeDotNetCli="$dotnet_root" @@ -387,7 +383,8 @@ mkdir -p "$toolset_dir" mkdir -p "$temp_dir" mkdir -p "$log_dir" -if [[ $ci == true ]]; then - export TEMP="$temp_dir" - export TMP="$temp_dir" -fi +Write-PipelineSetVariable -name "Artifacts" -value "$artifacts_dir" +Write-PipelineSetVariable -name "Artifacts.Toolset" -value "$toolset_dir" +Write-PipelineSetVariable -name "Artifacts.Log" -value "$log_dir" +Write-PipelineSetVariable -name "Temp" -value "$temp_dir" +Write-PipelineSetVariable -name "TMP" -value "$temp_dir" diff --git a/global.json b/global.json index b4297bf622..78425fae2e 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19367.8", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19368.7", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From ea025178fd4b8f65bdefeee266dbbc071ecae223 Mon Sep 17 00:00:00 2001 From: Sergey Tihon Date: Fri, 19 Jul 2019 21:02:07 +0300 Subject: [PATCH 129/159] Moving TypeMismatchTests over to NUnit (#7250) * Moving TypeMismatchTests over to NUnit * ci restart --- .../ErrorMessages/UnitGenericAbstactType.fs | 27 ------------------- 1 file changed, 27 deletions(-) delete mode 100644 tests/fsharp/Compiler/ErrorMessages/UnitGenericAbstactType.fs diff --git a/tests/fsharp/Compiler/ErrorMessages/UnitGenericAbstactType.fs b/tests/fsharp/Compiler/ErrorMessages/UnitGenericAbstactType.fs deleted file mode 100644 index e9165a4cf6..0000000000 --- a/tests/fsharp/Compiler/ErrorMessages/UnitGenericAbstactType.fs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -namespace FSharp.Compiler.UnitTests - -open NUnit.Framework -open FSharp.Compiler.SourceCodeServices - -[] -module ``Unit generic abstract Type`` = - - [] - let ``Unit can not be used as return type of abstract method paramete on return type``() = - CompilerAssert.TypeCheckSingleError - """ -type EDF<'S> = - abstract member Apply : int -> 'S -type SomeEDF () = - interface EDF with - member this.Apply d = - // [ERROR] The member 'Apply' does not have the correct type to override the corresponding abstract method. - () - """ - FSharpErrorSeverity.Error - 17 - (6, 21, 6, 26) - "The member 'Apply : int -> unit' is specialized with 'unit' but 'unit' can't be used as return type of an abstract method parameterized on return type." - From 9c5a21ed849281c7a891fce9167887c08d19c42d Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Fri, 19 Jul 2019 14:44:36 -0700 Subject: [PATCH 130/159] publish pdbs in FSharp.Core.nupkg (#7255) Also publish native symbols so they can be archived later. --- azure-pipelines.yml | 306 -------------------------------------------- 1 file changed, 306 deletions(-) delete mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 2207a4792e..0000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,306 +0,0 @@ -# CI and PR triggers -trigger: -- master -- dev16.1 -- feature/* -- release/* -pr: -- master -- dev16.1 -- feature/* -- release/* - -variables: - - name: _TeamName - value: FSharp - - name: _BuildConfig - value: Release - - name: _PublishUsingPipelines - value: true - - name: _DotNetArtifactsCategory - value: .NETCore - - name: VisualStudioDropName - value: Products/$(System.TeamProject)/$(Build.Repository.Name)/$(Build.SourceBranchName)/$(Build.BuildNumber) - -# Variables defined in yml cannot be overridden at queue time; instead overridable variables must be defined in the web UI. -# Commenting out until something like this is supported: https://github.com/Microsoft/azure-pipelines-yaml/pull/129 -#variables: -#- name: SkipTests -# defaultValue: false - -jobs: - -#---------------------------------------------------------------------------------------------------------------------# -# Signed build # -#---------------------------------------------------------------------------------------------------------------------# -- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - template: /eng/common/templates/jobs/jobs.yml - parameters: - enableMicrobuild: true - enablePublishBuildArtifacts: true - enablePublishTestResults: false - enablePublishBuildAssets: true - enablePublishUsingPipelines: $(_PublishUsingPipelines) - enableTelemetry: true - helixRepo: dotnet/fsharp - jobs: - - job: Full_Signed - pool: - name: NetCoreInternal-Int-Pool - queue: buildpool.windows.10.amd64.vs2019 - timeoutInMinutes: 300 - variables: - - group: DotNet-Blob-Feed - - group: DotNet-Symbol-Server-Pats - - name: _SignType - value: Real - - name: _DotNetPublishToBlobFeed - value: true - steps: - - checkout: self - clean: true - - script: eng\CIBuild.cmd - -configuration $(_BuildConfig) - -prepareMachine - -testAll - -officialSkipTests $(SkipTests) - /p:SignType=$(_SignType) - /p:DotNetSignType=$(_SignType) - /p:MicroBuild_SigningEnabled=true - /p:OverridePackageSource=https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json - /p:TeamName=$(_TeamName) - /p:DotNetPublishBlobFeedKey=$(dotnetfeed-storage-access-key-1) - /p:DotNetPublishBlobFeedUrl=https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json - /p:DotNetPublishToBlobFeed=true - /p:DotNetPublishUsingPipelines=$(_PublishUsingPipelines) - /p:DotNetArtifactsCategory=$(_DotNetArtifactsCategory) - /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) - /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) - /p:OfficialBuildId=$(BUILD.BUILDNUMBER) - /p:PublishToSymbolServer=true - /p:VisualStudioDropName=$(VisualStudioDropName) - - task: PublishTestResults@2 - displayName: Publish Test Results - inputs: - testResultsFormat: 'NUnit' - testResultsFiles: '*.xml' - searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)' - continueOnError: true - condition: ne(variables['SkipTests'], 'true') - - task: PublishBuildArtifacts@1 - displayName: Publish Test Logs - inputs: - PathtoPublish: '$(Build.SourcesDirectory)\artifacts\TestResults\$(_BuildConfig)' - ArtifactName: 'Test Logs' - publishLocation: Container - continueOnError: true - condition: ne(variables['SkipTests'], 'true') - - task: PublishBuildArtifacts@1 - displayName: Publish Artifact Packages - inputs: - PathtoPublish: '$(Build.SourcesDirectory)\artifacts\packages\$(_BuildConfig)' - ArtifactName: 'Packages' - condition: succeeded() - - task: PublishBuildArtifacts@1 - displayName: Publish Artifact VSSetup - inputs: - PathtoPublish: '$(Build.SourcesDirectory)\artifacts\VSSetup\$(_BuildConfig)\Insertion' - ArtifactName: 'VSSetup' - condition: succeeded() - - task: PublishBuildArtifacts@1 - displayName: Publish Artifact Nightly - inputs: - PathtoPublish: '$(Build.SourcesDirectory)\artifacts\VSSetup\$(_BuildConfig)\VisualFSharpFull.vsix' - ArtifactName: 'Nightly' - condition: succeeded() - -#---------------------------------------------------------------------------------------------------------------------# -# PR builds # -#---------------------------------------------------------------------------------------------------------------------# -- ${{ if eq(variables['System.TeamProject'], 'public') }}: - - template: /eng/common/templates/jobs/jobs.yml - parameters: - enableMicrobuild: true - enablePublishBuildArtifacts: true - enablePublishTestResults: false - enablePublishBuildAssets: true - enablePublishUsingPipelines: $(_PublishUsingPipelines) - enableTelemetry: true - helixRepo: dotnet/fsharp - jobs: - - # Windows - - job: Windows - pool: - vmImage: windows-2019 - timeoutInMinutes: 120 - strategy: - maxParallel: 4 - matrix: - desktop_release: - _configuration: Release - _testKind: testDesktop - coreclr_release: - _configuration: Release - _testKind: testCoreclr - fsharpqa_release: - _configuration: Release - _testKind: testFSharpQA - vs_release: - _configuration: Release - _testKind: testVs - steps: - - checkout: self - clean: true - - script: eng\CIBuild.cmd -configuration $(_configuration) -$(_testKind) - displayName: Build / Test - - task: PublishTestResults@2 - displayName: Publish Test Results - inputs: - testResultsFormat: 'NUnit' - testResultsFiles: '*.xml' - searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_configuration)' - continueOnError: true - condition: ne(variables['_testKind'], 'testFSharpQA') - - task: PublishBuildArtifacts@1 - displayName: Publish Test Logs - inputs: - PathtoPublish: '$(Build.SourcesDirectory)\artifacts\TestResults\$(_configuration)' - ArtifactName: 'Windows $(_configuration) $(_testKind) test logs' - publishLocation: Container - continueOnError: true - condition: eq(variables['_testKind'], 'testFSharpQA') - - # Linux - - job: Linux - pool: - vmImage: ubuntu-16.04 - variables: - - name: _SignType - value: Test - steps: - - checkout: self - clean: true - - script: ./eng/cibuild.sh --configuration $(_BuildConfig) --testcoreclr - displayName: Build / Test - - task: PublishTestResults@2 - displayName: Publish Test Results - inputs: - testResultsFormat: 'NUnit' - testResultsFiles: '*.xml' - searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)' - continueOnError: true - condition: always() - - # MacOS - - job: MacOS - pool: - vmImage: macOS-10.13 - variables: - - name: _SignType - value: Test - steps: - - checkout: self - clean: true - - script: ./eng/cibuild.sh --configuration $(_BuildConfig) --testcoreclr - displayName: Build / Test - - task: PublishTestResults@2 - displayName: Publish Test Results - inputs: - testResultsFormat: 'NUnit' - testResultsFiles: '*.xml' - searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)' - continueOnError: true - condition: always() - - # Source Build Linux - - job: SourceBuild_Linux - pool: - vmImage: ubuntu-16.04 - steps: - - checkout: self - clean: true - - script: ./eng/cibuild.sh --configuration Release /p:DotNetBuildFromSource=true /p:FSharpSourceBuild=true - displayName: Build - - # Source Build Windows - - job: SourceBuild_Windows - pool: - vmImage: windows-2019 - steps: - - checkout: self - clean: true - - script: eng\CIBuild.cmd -configuration Release -noSign /p:DotNetBuildFromSource=true /p:FSharpSourceBuild=true - displayName: Build - - # Up-to-date - - job: UpToDate_Windows - pool: - vmImage: windows-2019 - steps: - - checkout: self - clean: true - - task: PowerShell@2 - displayName: Run up-to-date build check - inputs: - filePath: eng\tests\UpToDate.ps1 - arguments: -configuration $(_BuildConfig) -ci -binaryLog - -#---------------------------------------------------------------------------------------------------------------------# -# FCS builds # -#---------------------------------------------------------------------------------------------------------------------# - -- ${{ if eq(variables['System.TeamProject'], 'public') }}: - - template: /eng/common/templates/jobs/jobs.yml - parameters: - enableMicrobuild: true - enablePublishTestResults: false - enablePublishBuildAssets: true - enablePublishUsingPipelines: false - enableTelemetry: true - helixRepo: dotnet/fsharp - jobs: - - - job: Windows_FCS - pool: - vmImage: windows-2019 - variables: - - name: _SignType - value: Test - steps: - - checkout: self - clean: true - - script: fcs\build.cmd TestAndNuget - displayName: Build / Test - - task: PublishTestResults@2 - displayName: Publish Test Results - inputs: - testResultsFormat: 'NUnit' - testResultsFiles: '*.xml' - searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/Release' - continueOnError: true - condition: always() - - - job: Linux_FCS - pool: - vmImage: ubuntu-16.04 - variables: - - name: _SignType - value: Test - steps: - - checkout: self - clean: true - - script: ./fcs/build.sh Build - displayName: Build - - - job: MacOS_FCS - pool: - vmImage: macOS-10.13 - variables: - - name: _SignType - value: Test - steps: - - checkout: self - clean: true - - script: ./fcs/build.sh Build - displayName: Build From fb94219fb7b2c795f1d7220e69ce9b2315632815 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Fri, 19 Jul 2019 20:17:49 -0700 Subject: [PATCH 131/159] Enable hash algorithm selection (#7252) * Enable hash algorithm selection * Feedback * More feedback * Revert "Feedback" This reverts commit 6ab1b077b413712f552bad9b2562aeb63994ad4c. * feedback --- src/absil/ilwrite.fs | 127 +++++++++++++++++++++------------- src/absil/ilwrite.fsi | 10 +-- src/absil/ilwritepdb.fs | 129 ++++++++++++++++++++++++----------- src/absil/ilwritepdb.fsi | 12 ++-- src/fsharp/CompileOps.fs | 4 ++ src/fsharp/CompileOps.fsi | 3 + src/fsharp/CompileOptions.fs | 12 ++++ src/fsharp/FSComp.txt | 2 + src/fsharp/fsc.fs | 1 + 9 files changed, 203 insertions(+), 97 deletions(-) diff --git a/src/absil/ilwrite.fs b/src/absil/ilwrite.fs index e48c00eaf0..6d3bfc8ac0 100755 --- a/src/absil/ilwrite.fs +++ b/src/absil/ilwrite.fs @@ -3025,7 +3025,8 @@ let generateIL requiredDataFixups (desiredMetadataVersion, generatePdb, ilg : IL //===================================================================== // TABLES+BLOBS --> PHYSICAL METADATA+BLOBS //===================================================================== -let chunk sz next = ({addr=next; size=sz}, next + sz) +let chunk sz next = ({addr=next; size=sz}, next + sz) +let emptychunk next = ({addr=next; size=0}, next) let nochunk next = ({addr= 0x0;size= 0x0; }, next) let count f arr = @@ -3516,7 +3517,7 @@ let writeBytes (os: BinaryWriter) (chunk: byte[]) = os.Write(chunk, 0, chunk.Len let writeBinaryAndReportMappings (outfile, ilg: ILGlobals, pdbfile: string option, signer: ILStrongNameSigner option, portablePDB, embeddedPDB, - embedAllSource, embedSourceList, sourceLink, emitTailcalls, deterministic, showTimes, dumpDebugInfo, pathMap) + embedAllSource, embedSourceList, sourceLink, checksumAlgorithm, emitTailcalls, deterministic, showTimes, dumpDebugInfo, pathMap) modul normalizeAssemblyRefs = // Store the public key from the signer into the manifest. This means it will be written // to the binary and also acts as an indicator to leave space for delay sign @@ -3565,7 +3566,7 @@ let writeBinaryAndReportMappings (outfile, with e -> failwith ("Could not open file for writing (binary mode): " + outfile) - let pdbData, pdbOpt, debugDirectoryChunk, debugDataChunk, debugEmbeddedPdbChunk, textV2P, mappings = + let pdbData, pdbOpt, debugDirectoryChunk, debugDataChunk, debugChecksumPdbChunk, debugEmbeddedPdbChunk, debugDeterministicPdbChunk, textV2P, mappings = try let imageBaseReal = modul.ImageBase // FIXED CHOICE @@ -3670,42 +3671,61 @@ let writeBinaryAndReportMappings (outfile, let pdbOpt = match portablePDB with | true -> - let (uncompressedLength, contentId, stream) as pdbStream = - generatePortablePdb embedAllSource embedSourceList sourceLink showTimes pdbData deterministic pathMap + let (uncompressedLength, contentId, stream, algorithmName, checkSum) as pdbStream = + generatePortablePdb embedAllSource embedSourceList sourceLink checksumAlgorithm showTimes pdbData pathMap - if embeddedPDB then Some (compressPortablePdbStream uncompressedLength contentId stream) + if embeddedPDB then + let uncompressedLength, contentId, stream = compressPortablePdbStream uncompressedLength contentId stream + Some (uncompressedLength, contentId, stream, algorithmName, checkSum) else Some pdbStream | _ -> None - let debugDirectoryChunk, next = - chunk (if pdbfile = None then - 0x0 - else if embeddedPDB && portablePDB then - sizeof_IMAGE_DEBUG_DIRECTORY * 2 + let debugDirectoryChunk, next = + chunk (if pdbfile = None then + 0x0 else - sizeof_IMAGE_DEBUG_DIRECTORY + sizeof_IMAGE_DEBUG_DIRECTORY * 2 + + (if embeddedPDB then sizeof_IMAGE_DEBUG_DIRECTORY else 0) + + (if deterministic then sizeof_IMAGE_DEBUG_DIRECTORY else 0) ) next + // The debug data is given to us by the PDB writer and appears to // typically be the type of the data plus the PDB file name. We fill // this in after we've written the binary. We approximate the size according // to what PDB writers seem to require and leave extra space just in case... let debugDataJustInCase = 40 - let debugDataChunk, next = + let debugDataChunk, next = chunk (align 0x4 (match pdbfile with | None -> 0 | Some f -> (24 + System.Text.Encoding.Unicode.GetByteCount f // See bug 748444 + debugDataJustInCase))) next - let debugEmbeddedPdbChunk, next = - let streamLength = - match pdbOpt with - | Some (_, _, stream) -> int stream.Length - | None -> 0 - chunk (align 0x4 (match embeddedPDB with - | true -> 8 + streamLength - | _ -> 0 )) next + let debugChecksumPdbChunk, next = + chunk (align 0x4 (match pdbOpt with + | Some (_, _, _, algorithmName, checkSum) -> + let alg = System.Text.Encoding.UTF8.GetBytes(algorithmName) + let size = alg.Length + 1 + checkSum.Length + size + | None -> 0)) next + + let debugEmbeddedPdbChunk, next = + if embeddedPDB then + let streamLength = + match pdbOpt with + | Some (_, _, stream, _, _) -> int stream.Length + | None -> 0 + chunk (align 0x4 (match embeddedPDB with + | true -> 8 + streamLength + | _ -> 0 )) next + else + nochunk next + + let debugDeterministicPdbChunk, next = + if deterministic then emptychunk next + else nochunk next + let textSectionSize = next - textSectionAddr let nextPhys = align alignPhys (textSectionPhysLoc + textSectionSize) @@ -3804,35 +3824,39 @@ let writeBinaryAndReportMappings (outfile, if pCurrent <> pExpected then failwith ("warning: "+chunkName+" not where expected, pCurrent = "+string pCurrent+", p.addr = "+string pExpected) writeBytes os chunk - + let writePadding (os: BinaryWriter) _comment sz = if sz < 0 then failwith "writePadding: size < 0" for i = 0 to sz - 1 do os.Write 0uy - + // Now we've computed all the offsets, write the image - + write (Some msdosHeaderChunk.addr) os "msdos header" msdosHeader - + write (Some peSignatureChunk.addr) os "pe signature" [| |] - + writeInt32 os 0x4550 - + write (Some peFileHeaderChunk.addr) os "pe file header" [| |] - + if (modul.Platform = Some AMD64) then writeInt32AsUInt16 os 0x8664 // Machine - IMAGE_FILE_MACHINE_AMD64 elif isItanium then writeInt32AsUInt16 os 0x200 else writeInt32AsUInt16 os 0x014c // Machine - IMAGE_FILE_MACHINE_I386 - + writeInt32AsUInt16 os numSections - let pdbData = + let pdbData = + // Hash code, data and metadata if deterministic then - // Hash code, data and metadata - use sha = System.Security.Cryptography.SHA1.Create() // IncrementalHash is core only + use sha = + match checksumAlgorithm with + | HashAlgorithm.Sha1 -> System.Security.Cryptography.SHA1.Create() :> System.Security.Cryptography.HashAlgorithm + | HashAlgorithm.Sha256 -> System.Security.Cryptography.SHA256.Create() :> System.Security.Cryptography.HashAlgorithm + let hCode = sha.ComputeHash code let hData = sha.ComputeHash data let hMeta = sha.ComputeHash metadata @@ -3848,6 +3872,7 @@ let writeBinaryAndReportMappings (outfile, // Use last 4 bytes for timestamp - High bit set, to stop tool chains becoming confused let timestamp = int final.[16] ||| (int final.[17] <<< 8) ||| (int final.[18] <<< 16) ||| (int (final.[19] ||| 128uy) <<< 24) writeInt32 os timestamp + // Update pdbData with new guid and timestamp. Portable and embedded PDBs don't need the ModuleID // Full and PdbOnly aren't supported under deterministic builds currently, they rely on non-determinsitic Windows native code { pdbData with ModuleID = final.[0..15] ; Timestamp = timestamp } @@ -4133,10 +4158,14 @@ let writeBinaryAndReportMappings (outfile, if pdbfile.IsSome then write (Some (textV2P debugDirectoryChunk.addr)) os "debug directory" (Array.create debugDirectoryChunk.size 0x0uy) write (Some (textV2P debugDataChunk.addr)) os "debug data" (Array.create debugDataChunk.size 0x0uy) + write (Some (textV2P debugChecksumPdbChunk.addr)) os "debug checksum" (Array.create debugChecksumPdbChunk.size 0x0uy) if embeddedPDB then write (Some (textV2P debugEmbeddedPdbChunk.addr)) os "debug data" (Array.create debugEmbeddedPdbChunk.size 0x0uy) + if deterministic then + write (Some (textV2P debugDeterministicPdbChunk.addr)) os "debug deterministic" Array.empty + writePadding os "end of .text" (dataSectionPhysLoc - textSectionPhysLoc - textSectionSize) // DATA SECTION @@ -4182,7 +4211,7 @@ let writeBinaryAndReportMappings (outfile, FileSystemUtilites.setExecutablePermission outfile with _ -> () - pdbData, pdbOpt, debugDirectoryChunk, debugDataChunk, debugEmbeddedPdbChunk, textV2P, mappings + pdbData, pdbOpt, debugDirectoryChunk, debugDataChunk, debugChecksumPdbChunk, debugEmbeddedPdbChunk, debugDeterministicPdbChunk, textV2P, mappings // Looks like a finally with e -> @@ -4207,11 +4236,11 @@ let writeBinaryAndReportMappings (outfile, try let idd = match pdbOpt with - | Some (originalLength, contentId, stream) -> + | Some (originalLength, contentId, stream, algorithmName, checkSum) -> if embeddedPDB then - embedPortablePdbInfo originalLength contentId stream showTimes fpdb debugDataChunk debugEmbeddedPdbChunk + embedPortablePdbInfo originalLength contentId stream showTimes fpdb debugDataChunk debugEmbeddedPdbChunk debugDeterministicPdbChunk debugChecksumPdbChunk algorithmName checkSum embeddedPDB deterministic else - writePortablePdbInfo contentId stream showTimes fpdb pathMap debugDataChunk + writePortablePdbInfo contentId stream showTimes fpdb pathMap debugDataChunk debugDeterministicPdbChunk debugChecksumPdbChunk algorithmName checkSum embeddedPDB deterministic | None -> #if FX_NO_PDB_WRITER Array.empty @@ -4232,16 +4261,17 @@ let writeBinaryAndReportMappings (outfile, writeInt32AsUInt16 os2 i.iddMajorVersion writeInt32AsUInt16 os2 i.iddMinorVersion writeInt32 os2 i.iddType - writeInt32 os2 i.iddData.Length // IMAGE_DEBUG_DIRECTORY.SizeOfData - writeInt32 os2 i.iddChunk.addr // IMAGE_DEBUG_DIRECTORY.AddressOfRawData - writeInt32 os2 (textV2P i.iddChunk.addr) // IMAGE_DEBUG_DIRECTORY.PointerToRawData + writeInt32 os2 i.iddData.Length // IMAGE_DEBUG_DIRECTORY.SizeOfData + writeInt32 os2 i.iddChunk.addr // IMAGE_DEBUG_DIRECTORY.AddressOfRawData + writeInt32 os2 (textV2P i.iddChunk.addr) // IMAGE_DEBUG_DIRECTORY.PointerToRawData // Write the Debug Data for i in idd do - // write the debug raw data as given us by the PDB writer - os2.BaseStream.Seek (int64 (textV2P i.iddChunk.addr), SeekOrigin.Begin) |> ignore - if i.iddChunk.size < i.iddData.Length then failwith "Debug data area is not big enough. Debug info may not be usable" - writeBytes os2 i.iddData + if i.iddChunk.size <> 0 then + // write the debug raw data as given us by the PDB writer + os2.BaseStream.Seek (int64 (textV2P i.iddChunk.addr), SeekOrigin.Begin) |> ignore + if i.iddChunk.size < i.iddData.Length then failwith "Debug data area is not big enough. Debug info may not be usable" + writeBytes os2 i.iddData os2.Dispose() with e -> failwith ("Error while writing debug directory entry: "+e.Message) @@ -4250,9 +4280,7 @@ let writeBinaryAndReportMappings (outfile, with e -> reraise() - end - ignore debugDataChunk - ignore debugEmbeddedPdbChunk + end reportTime showTimes "Finalize PDB" /// Sign the binary. No further changes to binary allowed past this point! @@ -4280,9 +4308,10 @@ type options = embedAllSource: bool embedSourceList: string list sourceLink: string + checksumAlgorithm: HashAlgorithm signer: ILStrongNameSigner option - emitTailcalls : bool - deterministic : bool + emitTailcalls: bool + deterministic: bool showTimes: bool dumpDebugInfo: bool pathMap: PathMap } @@ -4290,5 +4319,5 @@ type options = let WriteILBinary (outfile, (args: options), modul, normalizeAssemblyRefs) = writeBinaryAndReportMappings (outfile, args.ilg, args.pdbfile, args.signer, args.portablePDB, args.embeddedPDB, args.embedAllSource, - args.embedSourceList, args.sourceLink, args.emitTailcalls, args.deterministic, args.showTimes, args.dumpDebugInfo, args.pathMap) modul normalizeAssemblyRefs + args.embedSourceList, args.sourceLink, args.checksumAlgorithm, args.emitTailcalls, args.deterministic, args.showTimes, args.dumpDebugInfo, args.pathMap) modul normalizeAssemblyRefs |> ignore diff --git a/src/absil/ilwrite.fsi b/src/absil/ilwrite.fsi index f1955f82a2..9dba89c9b6 100755 --- a/src/absil/ilwrite.fsi +++ b/src/absil/ilwrite.fsi @@ -1,12 +1,13 @@ // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. /// The IL Binary writer. -module internal FSharp.Compiler.AbstractIL.ILBinaryWriter +module internal FSharp.Compiler.AbstractIL.ILBinaryWriter open Internal.Utilities -open FSharp.Compiler.AbstractIL -open FSharp.Compiler.AbstractIL.Internal -open FSharp.Compiler.AbstractIL.IL +open FSharp.Compiler.AbstractIL +open FSharp.Compiler.AbstractIL.Internal +open FSharp.Compiler.AbstractIL.IL +open FSharp.Compiler.AbstractIL.ILPdbWriter [] type ILStrongNameSigner = @@ -24,6 +25,7 @@ type options = embedAllSource: bool embedSourceList: string list sourceLink: string + checksumAlgorithm: HashAlgorithm signer : ILStrongNameSigner option emitTailcalls: bool deterministic: bool diff --git a/src/absil/ilwritepdb.fs b/src/absil/ilwritepdb.fs index 2a992ed485..c1ffd69224 100644 --- a/src/absil/ilwritepdb.fs +++ b/src/absil/ilwritepdb.fs @@ -11,8 +11,9 @@ open System.Reflection open System.Reflection.Metadata open System.Reflection.Metadata.Ecma335 open System.Reflection.PortableExecutable +open System.Text open Internal.Utilities -open FSharp.Compiler.AbstractIL.IL +open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.AbstractIL.Diagnostics open FSharp.Compiler.AbstractIL.Internal.Support open FSharp.Compiler.AbstractIL.Internal.Library @@ -125,6 +126,27 @@ type idd = iddData: byte[] iddChunk: BinaryChunk } +/// The specified Hash algorithm to use on portable pdb files. +type HashAlgorithm = + | Sha1 + | Sha256 + +// Document checksum algorithms +let guidSha1 = Guid("ff1816ec-aa5e-4d10-87f7-6f4963833460") +let guidSha2 = Guid("8829d00f-11b8-4213-878b-770e8597ac16") + +let checkSum (url: string) (checksumAlgorithm: HashAlgorithm) = + try + use file = FileSystem.FileStreamReadShim url + let guid, alg = + match checksumAlgorithm with + | HashAlgorithm.Sha1 -> guidSha1, System.Security.Cryptography.SHA1.Create() :> System.Security.Cryptography.HashAlgorithm + | HashAlgorithm.Sha256 -> guidSha2, System.Security.Cryptography.SHA256.Create() :> System.Security.Cryptography.HashAlgorithm + + let checkSum = alg.ComputeHash file + Some (guid, checkSum) + with _ -> None + //--------------------------------------------------------------------- // Portable PDB Writer //--------------------------------------------------------------------- @@ -153,7 +175,7 @@ let pdbGetCvDebugInfo (mvid: byte[]) (timestamp: int32) (filepath: string) (cvCh } let pdbMagicNumber= 0x4244504dL -let pdbGetPdbDebugInfo (embeddedPDBChunk: BinaryChunk) (uncompressedLength: int64) (stream: MemoryStream) = +let pdbGetEmbeddedPdbDebugInfo (embeddedPdbChunk: BinaryChunk) (uncompressedLength: int64) (stream: MemoryStream) = let iddPdbBuffer = let buffer = Array.zeroCreate (sizeof + sizeof + int(stream.Length)) let (offset, size) = (0, sizeof) // Magic Number dword: 0x4244504dL @@ -169,28 +191,52 @@ let pdbGetPdbDebugInfo (embeddedPDBChunk: BinaryChunk) (uncompressedLength: int6 iddType = 17 // IMAGE_DEBUG_TYPE_EMBEDDEDPDB iddTimestamp = 0 iddData = iddPdbBuffer // Path name to the pdb file when built - iddChunk = embeddedPDBChunk + iddChunk = embeddedPdbChunk } -let pdbGetDebugInfo (mvid: byte[]) (timestamp: int32) (filepath: string) (cvChunk: BinaryChunk) (embeddedPDBChunk: BinaryChunk option) (uncompressedLength: int64) (stream: MemoryStream option) = - match stream, embeddedPDBChunk with - | None, _ | _, None -> [| pdbGetCvDebugInfo mvid timestamp filepath cvChunk |] - | Some s, Some chunk -> [| pdbGetCvDebugInfo mvid timestamp filepath cvChunk; pdbGetPdbDebugInfo chunk uncompressedLength s |] +let pdbChecksumDebugInfo timestamp (checksumPdbChunk: BinaryChunk) (algorithmName:string) (checksum: byte[]) = + let iddBuffer = + let alg = Encoding.UTF8.GetBytes(algorithmName) + let buffer = Array.zeroCreate (alg.Length + 1 + checksum.Length) + Buffer.BlockCopy(alg, 0, buffer, 0, alg.Length) + Buffer.BlockCopy(checksum, 0, buffer, alg.Length + 1, checksum.Length) + buffer + { iddCharacteristics = 0 // Reserved + iddMajorVersion = 1 // VersionMajor should be 1 + iddMinorVersion = 0x0100 // VersionMinor should be 0x0100 + iddType = 19 // IMAGE_DEBUG_TYPE_CHECKSUMPDB + iddTimestamp = timestamp + iddData = iddBuffer // Path name to the pdb file when built + iddChunk = checksumPdbChunk + } -// Document checksum algorithms -let guidSourceHashMD5 = System.Guid(0x406ea660u, 0x64cfus, 0x4c82us, 0xb6uy, 0xf0uy, 0x42uy, 0xd4uy, 0x81uy, 0x72uy, 0xa7uy, 0x99uy) //406ea660-64cf-4c82-b6f0-42d48172a799 -let hashSizeOfMD5 = 16 +let pdbGetPdbDebugDeterministicInfo (deterministicPdbChunk: BinaryChunk) = + { iddCharacteristics = 0 // Reserved + iddMajorVersion = 0 // VersionMajor should be 0 + iddMinorVersion = 0 // VersionMinor should be 00 + iddType = 16 // IMAGE_DEBUG_TYPE_DETERMINISTIC + iddTimestamp = 0 + iddData = Array.empty // No DATA + iddChunk = deterministicPdbChunk + } -// If the FIPS algorithm policy is enabled on the computer (e.g., for US government employees and contractors) -// then obtaining the MD5 implementation in BCL will throw. -// In this case, catch the failure, and not set a checksum. -let checkSum (url: string) = - try - use file = FileSystem.FileStreamReadShim url - use md5 = System.Security.Cryptography.MD5.Create() - let checkSum = md5.ComputeHash file - Some (guidSourceHashMD5, checkSum) - with _ -> None +let pdbGetDebugInfo (contentId: byte[]) (timestamp: int32) (filepath: string) + (cvChunk: BinaryChunk) + (embeddedPdbChunk: BinaryChunk option) + (deterministicPdbChunk: BinaryChunk) + (checksumPdbChunk: BinaryChunk) (algorithmName:string) (checksum: byte []) + (uncompressedLength: int64) (stream: MemoryStream option) + (embeddedPdb: bool) (deterministic: bool) = + [| yield pdbGetCvDebugInfo contentId timestamp filepath cvChunk + yield pdbChecksumDebugInfo timestamp checksumPdbChunk algorithmName checksum + if embeddedPdb then + match stream, embeddedPdbChunk with + | None, _ | _, None -> () + | Some s, Some chunk -> + yield pdbGetEmbeddedPdbDebugInfo chunk uncompressedLength s + if deterministic then + yield pdbGetPdbDebugDeterministicInfo deterministicPdbChunk + |] //------------------------------------------------------------------------------ // PDB Writer. The function [WritePdbInfo] abstracts the @@ -219,7 +265,7 @@ let getRowCounts tableRowCounts = tableRowCounts |> Seq.iter(fun x -> builder.Add x) builder.MoveToImmutable() -let generatePortablePdb (embedAllSource: bool) (embedSourceList: string list) (sourceLink: string) showTimes (info: PdbData) isDeterministic (pathMap: PathMap) = +let generatePortablePdb (embedAllSource: bool) (embedSourceList: string list) (sourceLink: string) checksumAlgorithm showTimes (info: PdbData) (pathMap: PathMap) = sortMethods showTimes info let externalRowCounts = getRowCounts info.TableRowCounts let docs = @@ -286,7 +332,7 @@ let generatePortablePdb (embedAllSource: bool) (embedSourceList: string list) (s metadata.SetCapacity(TableIndex.Document, docLength) for doc in docs do let handle = - match checkSum doc.File with + match checkSum doc.File checksumAlgorithm with | Some (hashAlg, checkSum) -> let dbgInfo = (serializeDocumentName doc.File, @@ -481,25 +527,28 @@ let generatePortablePdb (embedAllSource: bool) (embedSourceList: string list) (s | None -> MetadataTokens.MethodDefinitionHandle 0 | Some x -> MetadataTokens.MethodDefinitionHandle x - let deterministicIdProvider isDeterministic : System.Func, BlobContentId> = - match isDeterministic with - | false -> null - | true -> - let convert (content: IEnumerable) = - use sha = System.Security.Cryptography.SHA1.Create() // IncrementalHash is core only - let hash = content - |> Seq.collect (fun c -> c.GetBytes().Array |> sha.ComputeHash) - |> Array.ofSeq |> sha.ComputeHash - BlobContentId.FromHash hash - System.Func, BlobContentId>( convert ) - - let serializer = PortablePdbBuilder(metadata, externalRowCounts, entryPoint, deterministicIdProvider isDeterministic) + // Compute the contentId for the pdb. Always do it deterministically, since we have to compute the anyway. + // The contentId is the hash of the ID using whichever algorithm has been specified to the compiler + let mutable contentHash = Array.empty + + let algorithmName, hashAlgorithm = + match checksumAlgorithm with + | HashAlgorithm.Sha1 -> "SHA1", System.Security.Cryptography.SHA1.Create() :> System.Security.Cryptography.HashAlgorithm + | HashAlgorithm.Sha256 -> "SHA256", System.Security.Cryptography.SHA256.Create() :> System.Security.Cryptography.HashAlgorithm + let idProvider: System.Func, BlobContentId> = + let convert (content: IEnumerable) = + let contentBytes = content |> Seq.collect (fun c -> c.GetBytes()) |> Array.ofSeq + contentHash <- contentBytes |> hashAlgorithm.ComputeHash + BlobContentId.FromHash contentHash + System.Func, BlobContentId>(convert) + + let serializer = PortablePdbBuilder(metadata, externalRowCounts, entryPoint, idProvider) let blobBuilder = new BlobBuilder() let contentId= serializer.Serialize blobBuilder let portablePdbStream = new MemoryStream() blobBuilder.WriteContentTo portablePdbStream reportTime showTimes "PDB: Created" - (portablePdbStream.Length, contentId, portablePdbStream) + (portablePdbStream.Length, contentId, portablePdbStream, algorithmName, contentHash) let compressPortablePdbStream (uncompressedLength: int64) (contentId: BlobContentId) (stream: MemoryStream) = let compressedStream = new MemoryStream() @@ -507,17 +556,17 @@ let compressPortablePdbStream (uncompressedLength: int64) (contentId: BlobConten stream.WriteTo compressionStream (uncompressedLength, contentId, compressedStream) -let writePortablePdbInfo (contentId: BlobContentId) (stream: MemoryStream) showTimes fpdb pathMap cvChunk = +let writePortablePdbInfo (contentId: BlobContentId) (stream: MemoryStream) showTimes fpdb pathMap cvChunk deterministicPdbChunk checksumPdbChunk algName checksum embeddedPdb deterministicPdb = try FileSystem.FileDelete fpdb with _ -> () use pdbFile = new FileStream(fpdb, FileMode.Create, FileAccess.ReadWrite) stream.WriteTo pdbFile reportTime showTimes "PDB: Closed" - pdbGetDebugInfo (contentId.Guid.ToByteArray()) (int32 (contentId.Stamp)) (PathMap.apply pathMap fpdb) cvChunk None 0L None + pdbGetDebugInfo (contentId.Guid.ToByteArray()) (int32 (contentId.Stamp)) (PathMap.apply pathMap fpdb) cvChunk None deterministicPdbChunk checksumPdbChunk algName checksum 0L None embeddedPdb deterministicPdb -let embedPortablePdbInfo (uncompressedLength: int64) (contentId: BlobContentId) (stream: MemoryStream) showTimes fpdb cvChunk pdbChunk = +let embedPortablePdbInfo (uncompressedLength: int64) (contentId: BlobContentId) (stream: MemoryStream) showTimes fpdb cvChunk pdbChunk deterministicPdbChunk checksumPdbChunk algName checksum embeddedPdb deterministicPdb = reportTime showTimes "PDB: Closed" let fn = Path.GetFileName fpdb - pdbGetDebugInfo (contentId.Guid.ToByteArray()) (int32 (contentId.Stamp)) fn cvChunk (Some pdbChunk) uncompressedLength (Some stream) + pdbGetDebugInfo (contentId.Guid.ToByteArray()) (int32 (contentId.Stamp)) fn cvChunk (Some pdbChunk) deterministicPdbChunk checksumPdbChunk algName checksum uncompressedLength (Some stream) embeddedPdb deterministicPdb #if !FX_NO_PDB_WRITER //--------------------------------------------------------------------- diff --git a/src/absil/ilwritepdb.fsi b/src/absil/ilwritepdb.fsi index 2713d9769b..748e178a46 100644 --- a/src/absil/ilwritepdb.fsi +++ b/src/absil/ilwritepdb.fsi @@ -4,7 +4,7 @@ module internal FSharp.Compiler.AbstractIL.ILPdbWriter open Internal.Utilities -open FSharp.Compiler.AbstractIL.IL +open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.ErrorLogger open FSharp.Compiler.Range open System.Collections.Generic @@ -83,10 +83,14 @@ type idd = iddData: byte[]; iddChunk: BinaryChunk } -val generatePortablePdb : embedAllSource:bool -> embedSourceList:string list -> sourceLink: string -> showTimes:bool -> info:PdbData -> isDeterministic:bool -> pathMap:PathMap -> (int64 * BlobContentId * MemoryStream) +type HashAlgorithm = + | Sha1 + | Sha256 + +val generatePortablePdb : embedAllSource: bool -> embedSourceList: string list -> sourceLink: string -> checksumAlgorithm: HashAlgorithm -> showTimes: bool -> info: PdbData -> pathMap:PathMap -> (int64 * BlobContentId * MemoryStream * string * byte[]) val compressPortablePdbStream : uncompressedLength:int64 -> contentId:BlobContentId -> stream:MemoryStream -> (int64 * BlobContentId * MemoryStream) -val embedPortablePdbInfo : uncompressedLength:int64 -> contentId:BlobContentId -> stream:MemoryStream -> showTimes:bool -> fpdb:string -> cvChunk:BinaryChunk -> pdbChunk:BinaryChunk -> idd[] -val writePortablePdbInfo : contentId:BlobContentId -> stream:MemoryStream -> showTimes:bool -> fpdb:string -> pathMap:PathMap -> cvChunk:BinaryChunk -> idd[] +val embedPortablePdbInfo: uncompressedLength: int64 -> contentId: BlobContentId -> stream: MemoryStream -> showTimes: bool -> fpdb: string -> cvChunk: BinaryChunk -> pdbChunk: BinaryChunk -> deterministicPdbChunk: BinaryChunk -> checksumPdbChunk: BinaryChunk -> algorithmName: string -> checksum: byte[] -> embeddedPDB: bool -> deterministic: bool -> idd[] +val writePortablePdbInfo: contentId: BlobContentId -> stream: MemoryStream -> showTimes: bool -> fpdb: string -> pathMap: PathMap -> cvChunk: BinaryChunk -> deterministicPdbChunk: BinaryChunk -> checksumPdbChunk: BinaryChunk -> algorithmName: string -> checksum: byte[] -> embeddedPDB: bool -> deterministic: bool -> idd[] #if !FX_NO_PDB_WRITER val writePdbInfo : showTimes:bool -> f:string -> fpdb:string -> info:PdbData -> cvChunk:BinaryChunk -> idd[] diff --git a/src/fsharp/CompileOps.fs b/src/fsharp/CompileOps.fs index 85728909cf..5b75cf1077 100644 --- a/src/fsharp/CompileOps.fs +++ b/src/fsharp/CompileOps.fs @@ -17,6 +17,7 @@ open Internal.Utilities.Text open FSharp.Compiler.AbstractIL open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.AbstractIL.ILBinaryReader +open FSharp.Compiler.AbstractIL.ILPdbWriter open FSharp.Compiler.AbstractIL.Internal open FSharp.Compiler.AbstractIL.Internal.Library open FSharp.Compiler.AbstractIL.Extensions.ILX @@ -2100,6 +2101,7 @@ type TcConfigBuilder = mutable maxErrors: int mutable abortOnError: bool (* intended for fsi scripts that should exit on first error *) mutable baseAddress: int32 option + mutable checksumAlgorithm: HashAlgorithm #if DEBUG mutable showOptimizationData: bool #endif @@ -2231,6 +2233,7 @@ type TcConfigBuilder = maxErrors = 100 abortOnError = false baseAddress = None + checksumAlgorithm = HashAlgorithm.Sha256 delaysign = false publicsign = false @@ -2740,6 +2743,7 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) = member x.flatErrors = data.flatErrors member x.maxErrors = data.maxErrors member x.baseAddress = data.baseAddress + member x.checksumAlgorithm = data.checksumAlgorithm #if DEBUG member x.showOptimizationData = data.showOptimizationData #endif diff --git a/src/fsharp/CompileOps.fsi b/src/fsharp/CompileOps.fsi index 71bb7c6f8b..1262542cd9 100644 --- a/src/fsharp/CompileOps.fsi +++ b/src/fsharp/CompileOps.fsi @@ -10,6 +10,7 @@ open Internal.Utilities open FSharp.Compiler.AbstractIL open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.AbstractIL.ILBinaryReader +open FSharp.Compiler.AbstractIL.ILPdbWriter open FSharp.Compiler.AbstractIL.Internal.Library open FSharp.Compiler open FSharp.Compiler.TypeChecker @@ -337,6 +338,7 @@ type TcConfigBuilder = mutable maxErrors: int mutable abortOnError: bool mutable baseAddress: int32 option + mutable checksumAlgorithm: HashAlgorithm #if DEBUG mutable showOptimizationData: bool #endif @@ -497,6 +499,7 @@ type TcConfig = member maxErrors: int member baseAddress: int32 option + member checksumAlgorithm: HashAlgorithm #if DEBUG member showOptimizationData: bool #endif diff --git a/src/fsharp/CompileOptions.fs b/src/fsharp/CompileOptions.fs index 0c385cc367..e548a49e71 100755 --- a/src/fsharp/CompileOptions.fs +++ b/src/fsharp/CompileOptions.fs @@ -9,6 +9,7 @@ open System open FSharp.Compiler open FSharp.Compiler.AbstractIL open FSharp.Compiler.AbstractIL.IL +open FSharp.Compiler.AbstractIL.ILPdbWriter open FSharp.Compiler.AbstractIL.Internal.Library open FSharp.Compiler.AbstractIL.Extensions.ILX open FSharp.Compiler.AbstractIL.Diagnostics @@ -522,6 +523,7 @@ let tagFullPDBOnlyPortable = "{full|pdbonly|portable|embedded}" let tagWarnList = "" let tagSymbolList = "" let tagAddress = "
" +let tagAlgorithm = "{SHA1|SHA256}" let tagInt = "" let tagPathMap = "" let tagNone = "" @@ -933,6 +935,16 @@ let advancedFlagsFsc tcConfigB = OptionString (fun s -> tcConfigB.baseAddress <- Some(int32 s)), None, Some (FSComp.SR.optsBaseaddress())) + yield CompilerOption + ("checksumalgorithm", tagAlgorithm, + OptionString (fun s -> + tcConfigB.checksumAlgorithm <- + match s.ToUpperInvariant() with + | "SHA1" -> HashAlgorithm.Sha1 + | "SHA256" -> HashAlgorithm.Sha256 + | _ -> error(Error(FSComp.SR.optsUnknownChecksumAlgorithm s, rangeCmdArgs))), None, + Some (FSComp.SR.optsChecksumAlgorithm())) + yield noFrameworkFlag true tcConfigB yield CompilerOption diff --git a/src/fsharp/FSComp.txt b/src/fsharp/FSComp.txt index ee2b41f2e9..831597c031 100755 --- a/src/fsharp/FSComp.txt +++ b/src/fsharp/FSComp.txt @@ -878,6 +878,7 @@ optsUtf8output,"Output messages in UTF-8 encoding" optsFullpaths,"Output messages with fully qualified paths" optsLib,"Specify a directory for the include path which is used to resolve source files and assemblies (Short form: -I)" optsBaseaddress,"Base address for the library to be built" +optsChecksumAlgorithm,"Specify algorithm for calculating source file checksum stored in PDB. Supported values are: SHA1 or SHA256 (default)" optsNoframework,"Do not reference the default CLI assemblies by default" optsStandalone,"Statically link the F# library and all referenced DLLs that depend on it into the assembly being generated" optsStaticlink,"Statically link the given assembly and all referenced DLLs that depend on this assembly. Use an assembly name e.g. mylib, not a DLL name." @@ -900,6 +901,7 @@ optsHelpBannerLanguage,"- LANGUAGE -" optsHelpBannerErrsAndWarns,"- ERRORS AND WARNINGS -" 1063,optsUnknownArgumentToTheTestSwitch,"Unknown --test argument: '%s'" 1064,optsUnknownPlatform,"Unrecognized platform '%s', valid values are 'x86', 'x64', 'Itanium', 'anycpu32bitpreferred', and 'anycpu'" +1065,optsUnknownChecksumAlgorithm,"Algorithm '%s' is not supported" optsInternalNoDescription,"The command-line option '%s' is for test purposes only" optsDCLONoDescription,"The command-line option '%s' has been deprecated" optsDCLODeprecatedSuggestAlternative,"The command-line option '%s' has been deprecated. Use '%s' instead." diff --git a/src/fsharp/fsc.fs b/src/fsharp/fsc.fs index de670ab2a7..b1276c6a11 100755 --- a/src/fsharp/fsc.fs +++ b/src/fsharp/fsc.fs @@ -2145,6 +2145,7 @@ let main4 dynamicAssemblyCreator (Args (ctok, tcConfig, tcImports: TcImports, t embedAllSource = tcConfig.embedAllSource embedSourceList = tcConfig.embedSourceList sourceLink = tcConfig.sourceLink + checksumAlgorithm = tcConfig.checksumAlgorithm signer = GetStrongNameSigner signingInfo dumpDebugInfo = tcConfig.dumpDebugInfo pathMap = tcConfig.pathMap }, From de62582f85d15254fc0027dc4638afab33461611 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 20 Jul 2019 10:04:05 -0700 Subject: [PATCH 132/159] Update dependencies from https://github.com/dotnet/arcade build 20190719.2 (#7260) - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19369.2 --- eng/Version.Details.xml | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 7a60463a0f..7228968c11 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - eecde8a8751dbe7fdb17ba4dfbd032e26f4cae7d + a190d4865fe3c86a168ec49c4fc61c90c96ae051 diff --git a/global.json b/global.json index 78425fae2e..c8c5b12939 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19368.7", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19369.2", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 4cfc47d9961006e01e1802ab74b5e71e1543ef1d Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2019 09:48:39 -0700 Subject: [PATCH 133/159] Update dependencies from https://github.com/dotnet/arcade build 20190722.10 (#7268) - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19372.10 --- eng/Version.Details.xml | 4 ++-- eng/common/init-tools-native.ps1 | 8 +++++++- global.json | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 7228968c11..e278bed29a 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - a190d4865fe3c86a168ec49c4fc61c90c96ae051 + 0793e2df782efc9ccae387bc779b2549208fa4a1 diff --git a/eng/common/init-tools-native.ps1 b/eng/common/init-tools-native.ps1 index 9d18645f45..eaa05880c5 100644 --- a/eng/common/init-tools-native.ps1 +++ b/eng/common/init-tools-native.ps1 @@ -103,7 +103,13 @@ try { if ($LASTEXITCODE -Ne "0") { $errMsg = "$ToolName installation failed" if ((Get-Variable 'DoNotAbortNativeToolsInstallationOnFailure' -ErrorAction 'SilentlyContinue') -and $DoNotAbortNativeToolsInstallationOnFailure) { - Write-Warning $errMsg + $showNativeToolsWarning = $true + if ((Get-Variable 'DoNotDisplayNativeToolsInstallationWarnings' -ErrorAction 'SilentlyContinue') -and $DoNotDisplayNativeToolsInstallationWarnings) { + $showNativeToolsWarning = $false + } + if ($showNativeToolsWarning) { + Write-Warning $errMsg + } $toolInstallationFailure = $true } else { Write-Error $errMsg diff --git a/global.json b/global.json index c8c5b12939..1d496dc84b 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19369.2", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19372.10", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 90db61b544347bd526a6ce88b3cd4642712ccc35 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Wed, 24 Jul 2019 18:08:15 -0700 Subject: [PATCH 134/159] fixes issue #6832 (#7259) * fixes issue #6832 * Fix comment * Forgot to remove pdbs from fsharp.compiler.nuget * Rename Program.fs and exclude FSharpSdk from checks * Embedded doesn't need to verify tmp or obj directories. * typo * typo * Don't check FSharpSdk for hash * Make comment match code * Empty commit to force rebuild --- FSharpBuild.Directory.Build.props | 3 +- eng/Build.ps1 | 11 ++-- eng/build-utils.ps1 | 3 +- src/absil/ilwritepdb.fs | 2 +- .../buildtools/AssemblyCheck/AssemblyCheck.fs | 66 +++++++++++++++---- .../AssemblyCheck/AssemblyCheck.fsproj | 17 +++++ src/buildtools/buildtools.proj | 1 + 7 files changed, 83 insertions(+), 20 deletions(-) rename scripts/AssemblyVersionCheck.fsx => src/buildtools/AssemblyCheck/AssemblyCheck.fs (51%) create mode 100644 src/buildtools/AssemblyCheck/AssemblyCheck.fsproj diff --git a/FSharpBuild.Directory.Build.props b/FSharpBuild.Directory.Build.props index 515de9bbdc..6687fb4088 100644 --- a/FSharpBuild.Directory.Build.props +++ b/FSharpBuild.Directory.Build.props @@ -75,6 +75,7 @@ https://github.com/Microsoft/visualfsharp git + <_DotGitDir>$(RepoRoot).git <_HeadFileContent Condition="Exists('$(_DotGitDir)/HEAD')">$([System.IO.File]::ReadAllText('$(_DotGitDir)/HEAD').Trim()) @@ -87,7 +88,7 @@ $(NoWarn);FS2003 true - portable + embedded fs false true diff --git a/eng/Build.ps1 b/eng/Build.ps1 index 54e6ff5e2b..16ec587b04 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -211,13 +211,14 @@ function UpdatePath() { TestAndAddToPath "$ArtifactsDir\bin\fsiAnyCpu\$configuration\net472" } -function VerifyAssemblyVersions() { - $fsiPath = Join-Path $ArtifactsDir "bin\fsi\Proto\net472\publish\fsi.exe" +function VerifyAssemblyVersionsAndSymbols() { + $assemblyVerCheckPath = Join-Path $ArtifactsDir "Bootstrap\AssemblyCheck\AssemblyCheck.dll" # Only verify versions on CI or official build if ($ci -or $official) { - $asmVerCheckPath = "$RepoRoot\scripts" - Exec-Console $fsiPath """$asmVerCheckPath\AssemblyVersionCheck.fsx"" -- ""$ArtifactsDir""" + $dotnetPath = InitializeDotNetCli + $dotnetExe = Join-Path $dotnetPath "dotnet.exe" + Exec-Console $dotnetExe """$assemblyVerCheckPath"" ""$ArtifactsDir""" } } @@ -263,7 +264,7 @@ try { } if ($build) { - VerifyAssemblyVersions + VerifyAssemblyVersionsAndSymbols } $desktopTargetFramework = "net472" diff --git a/eng/build-utils.ps1 b/eng/build-utils.ps1 index 335379b2f7..bbfa4be68e 100644 --- a/eng/build-utils.ps1 +++ b/eng/build-utils.ps1 @@ -236,10 +236,11 @@ function Make-BootstrapBuild() { Remove-Item -re $dir -ErrorAction SilentlyContinue Create-Directory $dir - # prepare FsLex and Fsyacc + # prepare FsLex and Fsyacc and AssemblyCheck Run-MSBuild "$RepoRoot\src\buildtools\buildtools.proj" "/restore /t:Publish" -logFileName "BuildTools" -configuration $bootstrapConfiguration Copy-Item "$ArtifactsDir\bin\fslex\$bootstrapConfiguration\netcoreapp2.1\publish" -Destination "$dir\fslex" -Force -Recurse Copy-Item "$ArtifactsDir\bin\fsyacc\$bootstrapConfiguration\netcoreapp2.1\publish" -Destination "$dir\fsyacc" -Force -Recurse + Copy-Item "$ArtifactsDir\bin\AssemblyCheck\$bootstrapConfiguration\netcoreapp2.1\publish" -Destination "$dir\AssemblyCheck" -Force -Recurse # prepare compiler $projectPath = "$RepoRoot\proto.proj" diff --git a/src/absil/ilwritepdb.fs b/src/absil/ilwritepdb.fs index c1ffd69224..86b7ee9224 100644 --- a/src/absil/ilwritepdb.fs +++ b/src/absil/ilwritepdb.fs @@ -186,7 +186,7 @@ let pdbGetEmbeddedPdbDebugInfo (embeddedPdbChunk: BinaryChunk) (uncompressedLeng Buffer.BlockCopy(stream.ToArray(), 0, buffer, offset, size) buffer { iddCharacteristics = 0 // Reserved - iddMajorVersion = 0 // VersionMajor should be 0 + iddMajorVersion = 0x0100 // VersionMajor should be 0x0100 iddMinorVersion = 0x0100 // VersionMinor should be 0x0100 iddType = 17 // IMAGE_DEBUG_TYPE_EMBEDDEDPDB iddTimestamp = 0 diff --git a/scripts/AssemblyVersionCheck.fsx b/src/buildtools/AssemblyCheck/AssemblyCheck.fs similarity index 51% rename from scripts/AssemblyVersionCheck.fsx rename to src/buildtools/AssemblyCheck/AssemblyCheck.fs index 0f3816a2e6..c6bd035a67 100644 --- a/scripts/AssemblyVersionCheck.fsx +++ b/src/buildtools/AssemblyCheck/AssemblyCheck.fs @@ -1,22 +1,50 @@ -// 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. open System open System.Diagnostics open System.IO open System.Reflection +open System.Reflection.PortableExecutable open System.Text.RegularExpressions -module AssemblyVersionCheck = +module AssemblyCheck = let private versionZero = Version(0, 0, 0, 0) let private versionOne = Version(1, 0, 0, 0) let private commitHashPattern = new Regex(@"Commit Hash: ()|([0-9a-fA-F]{40})", RegexOptions.Compiled) let private devVersionPattern = new Regex(@"-(ci|dev)", RegexOptions.Compiled) - let verifyAssemblyVersions (binariesPath:string) = + let verifyEmbeddedPdb (filename:string) = + use fileStream = File.OpenRead(filename) + let reader = new PEReader(fileStream) + let mutable hasEmbeddedPdb = false + + try + for entry in reader.ReadDebugDirectory() do + match entry.Type with + | DebugDirectoryEntryType.CodeView -> + let _ = reader.ReadCodeViewDebugDirectoryData(entry) + () + + | DebugDirectoryEntryType.EmbeddedPortablePdb -> + let _ = reader.ReadEmbeddedPortablePdbDebugDirectoryData(entry) + hasEmbeddedPdb <- true + () + + | DebugDirectoryEntryType.PdbChecksum -> + let _ = reader.ReadPdbChecksumDebugDirectoryData(entry) + () + + | _ -> () + with | e -> printfn "Error validating assembly %s\nMessage: %s" filename (e.ToString()) + hasEmbeddedPdb + + let verifyAssemblies (binariesPath:string) = + let excludedAssemblies = [ "FSharp.Data.TypeProviders.dll" ] |> Set.ofList + let fsharpAssemblies = [ "FSharp*.dll" "fsc.exe" @@ -28,12 +56,17 @@ module AssemblyVersionCheck = |> List.ofSeq |> List.filter (fun p -> (Set.contains (Path.GetFileName(p)) excludedAssemblies) |> not) + let fsharpExecutingWithEmbeddedPdbs = + fsharpAssemblies + |> List.filter (fun p -> not (p.Contains(@"\Proto\") || p.Contains(@"\Bootstrap\") || p.Contains(@".resources.") || p.Contains(@"\FSharpSdk\") || p.Contains(@"\tmp\") || p.Contains(@"\obj\"))) + // verify that all assemblies have a version number other than 0.0.0.0 or 1.0.0.0 let failedVersionCheck = fsharpAssemblies |> List.filter (fun a -> let assemblyVersion = AssemblyName.GetAssemblyName(a).Version assemblyVersion = versionZero || assemblyVersion = versionOne) + if failedVersionCheck.Length > 0 then printfn "The following assemblies had a version of %A or %A" versionZero versionOne printfn "%s\r\n" <| String.Join("\r\n", failedVersionCheck) @@ -43,27 +76,36 @@ module AssemblyVersionCheck = // verify that all assemblies have a commit hash let failedCommitHash = fsharpAssemblies + |> List.filter (fun p -> not (p.Contains(@"\FSharpSdk\"))) |> List.filter (fun a -> let fileProductVersion = FileVersionInfo.GetVersionInfo(a).ProductVersion not (commitHashPattern.IsMatch(fileProductVersion) || devVersionPattern.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) else printfn "All shipping assemblies had an appropriate commit hash." + // verify that all assemblies have an embedded pdb + let failedVerifyEmbeddedPdb = + fsharpExecutingWithEmbeddedPdbs + |> List.filter (fun a -> not (verifyEmbeddedPdb a)) + + if failedVerifyEmbeddedPdb.Length > 0 then + printfn "The following assemblies don't have an embedded pdb" + printfn "%s\r\n" <| String.Join("\r\n", failedVerifyEmbeddedPdb) + else + printfn "All shipping assemblies had an embedded PDB." + // return code is the number of failures - failedVersionCheck.Length + failedCommitHash.Length + failedVersionCheck.Length + failedCommitHash.Length + failedVerifyEmbeddedPdb.Length + +[] let main (argv:string array) = if argv.Length <> 1 then - printfn "Usage: fsi.exe AssemblyVersionCheck.fsx -- path/to/binaries" + printfn "Usage: dotnet AssemblyCheck.dll -- path/to/binaries" 1 else - AssemblyVersionCheck.verifyAssemblyVersions argv.[0] - -Environment.GetCommandLineArgs() -|> Seq.skipWhile ((<>) "--") -|> Seq.skip 1 -|> Array.ofSeq -|> main + AssemblyCheck.verifyAssemblies argv.[0] diff --git a/src/buildtools/AssemblyCheck/AssemblyCheck.fsproj b/src/buildtools/AssemblyCheck/AssemblyCheck.fsproj new file mode 100644 index 0000000000..72f79d02f9 --- /dev/null +++ b/src/buildtools/AssemblyCheck/AssemblyCheck.fsproj @@ -0,0 +1,17 @@ + + + + Exe + netcoreapp2.1 + true + + + + + + + + + + + diff --git a/src/buildtools/buildtools.proj b/src/buildtools/buildtools.proj index 630bb67856..7ac48ba2a3 100644 --- a/src/buildtools/buildtools.proj +++ b/src/buildtools/buildtools.proj @@ -8,6 +8,7 @@ + From 2c22a29e83f241bce067f2cfaa9a3b978115e336 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 25 Jul 2019 17:47:38 -0700 Subject: [PATCH 135/159] [master] Update dependencies from dotnet/arcade (#7269) * Update dependencies from https://github.com/dotnet/arcade build 20190723.6 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19373.6 * Update dependencies from https://github.com/dotnet/arcade build 20190724.2 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19374.2 * Update dependencies from https://github.com/dotnet/arcade build 20190725.2 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19375.2 --- eng/Build.ps1 | 70 +++++- eng/Version.Details.xml | 4 +- eng/Versions.props | 34 +-- eng/build-utils.ps1 | 4 +- eng/build.sh | 6 +- eng/common/PSScriptAnalyzerSettings.psd1 | 11 + eng/common/PublishToPackageFeed.proj | 1 + eng/common/SigningValidation.proj | 2 +- eng/common/build.ps1 | 7 +- eng/common/build.sh | 5 + eng/common/cibuild.sh | 0 eng/common/cross/armel/tizen-build-rootfs.sh | 0 eng/common/cross/armel/tizen-fetch.sh | 6 +- eng/common/cross/build-android-rootfs.sh | 0 eng/common/cross/build-rootfs.sh | 3 +- eng/common/darc-init.ps1 | 8 +- eng/common/darc-init.sh | 0 eng/common/dotnet-install.ps1 | 11 +- eng/common/dotnet-install.sh | 0 eng/common/generate-graph-files.ps1 | 20 +- eng/common/init-tools-native.ps1 | 29 ++- eng/common/init-tools-native.sh | 2 +- eng/common/internal-feed-operations.ps1 | 135 ++++++++++ eng/common/internal-feed-operations.sh | 142 +++++++++++ eng/common/msbuild.sh | 0 eng/common/native/CommonLibrary.psm1 | 2 +- eng/common/native/common-library.sh | 0 eng/common/native/install-cmake.sh | 0 eng/common/performance/perfhelixpublish.proj | 77 ++++++ eng/common/performance/performance-setup.ps1 | 91 +++++++ eng/common/performance/performance-setup.sh | 176 +++++++++++++ eng/common/pipeline-logging-functions.ps1 | 234 ++++++++++++++++++ eng/common/pipeline-logging-functions.sh | 172 +++++++++++++ eng/common/post-build/darc-gather-drop.ps1 | 36 +++ eng/common/post-build/dotnetsymbol-init.ps1 | 29 +++ eng/common/post-build/nuget-validation.ps1 | 28 +++ eng/common/post-build/promote-build.ps1 | 53 ++++ eng/common/post-build/sourcelink-cli-init.ps1 | 29 +++ .../post-build/sourcelink-validation.ps1 | 224 +++++++++++++++++ eng/common/post-build/symbols-validation.ps1 | 186 ++++++++++++++ .../post-build/trigger-subscriptions.ps1 | 69 ++++++ eng/common/sdl/NuGet.config | 13 + eng/common/sdl/execute-all-sdl-tools.ps1 | 99 ++++++++ eng/common/sdl/extract-artifact-packages.ps1 | 70 ++++++ eng/common/sdl/init-sdl.ps1 | 48 ++++ eng/common/sdl/packages.config | 4 + eng/common/sdl/push-gdn.ps1 | 51 ++++ eng/common/sdl/run-sdl.ps1 | 67 +++++ eng/common/templates/job/execute-sdl.yml | 54 ++++ eng/common/templates/job/performance.yml | 93 +++++++ .../templates/job/publish-build-assets.yml | 14 ++ .../channels/internal-servicing.yml | 148 +++++++++++ .../channels/public-dev-release.yml | 149 +++++++++++ .../post-build/channels/public-release.yml | 148 +++++++++++ .../channels/public-validation-release.yml | 100 ++++++++ .../templates/post-build/common-variables.yml | 21 ++ .../templates/post-build/darc-gather-drop.yml | 22 ++ .../templates/post-build/post-build.yml | 91 +++++++ .../templates/post-build/promote-build.yml | 24 ++ .../post-build/setup-maestro-vars.yml | 35 +++ .../post-build/trigger-subscription.yml | 11 + .../templates/steps/perf-send-to-helix.yml | 66 +++++ eng/common/templates/steps/send-to-helix.yml | 3 + eng/common/tools.ps1 | 105 ++++---- eng/common/tools.sh | 65 +++-- global.json | 2 +- 66 files changed, 3268 insertions(+), 141 deletions(-) create mode 100644 eng/common/PSScriptAnalyzerSettings.psd1 mode change 100644 => 100755 eng/common/build.sh mode change 100644 => 100755 eng/common/cibuild.sh mode change 100644 => 100755 eng/common/cross/armel/tizen-build-rootfs.sh mode change 100644 => 100755 eng/common/cross/armel/tizen-fetch.sh mode change 100644 => 100755 eng/common/cross/build-android-rootfs.sh mode change 100644 => 100755 eng/common/cross/build-rootfs.sh mode change 100644 => 100755 eng/common/darc-init.sh mode change 100644 => 100755 eng/common/dotnet-install.sh mode change 100644 => 100755 eng/common/init-tools-native.sh create mode 100644 eng/common/internal-feed-operations.ps1 create mode 100755 eng/common/internal-feed-operations.sh mode change 100644 => 100755 eng/common/msbuild.sh mode change 100644 => 100755 eng/common/native/common-library.sh mode change 100644 => 100755 eng/common/native/install-cmake.sh create mode 100644 eng/common/performance/perfhelixpublish.proj create mode 100644 eng/common/performance/performance-setup.ps1 create mode 100755 eng/common/performance/performance-setup.sh create mode 100644 eng/common/pipeline-logging-functions.ps1 create mode 100755 eng/common/pipeline-logging-functions.sh create mode 100644 eng/common/post-build/darc-gather-drop.ps1 create mode 100644 eng/common/post-build/dotnetsymbol-init.ps1 create mode 100644 eng/common/post-build/nuget-validation.ps1 create mode 100644 eng/common/post-build/promote-build.ps1 create mode 100644 eng/common/post-build/sourcelink-cli-init.ps1 create mode 100644 eng/common/post-build/sourcelink-validation.ps1 create mode 100644 eng/common/post-build/symbols-validation.ps1 create mode 100644 eng/common/post-build/trigger-subscriptions.ps1 create mode 100644 eng/common/sdl/NuGet.config create mode 100644 eng/common/sdl/execute-all-sdl-tools.ps1 create mode 100644 eng/common/sdl/extract-artifact-packages.ps1 create mode 100644 eng/common/sdl/init-sdl.ps1 create mode 100644 eng/common/sdl/packages.config create mode 100644 eng/common/sdl/push-gdn.ps1 create mode 100644 eng/common/sdl/run-sdl.ps1 create mode 100644 eng/common/templates/job/execute-sdl.yml create mode 100644 eng/common/templates/job/performance.yml create mode 100644 eng/common/templates/post-build/channels/internal-servicing.yml create mode 100644 eng/common/templates/post-build/channels/public-dev-release.yml create mode 100644 eng/common/templates/post-build/channels/public-release.yml create mode 100644 eng/common/templates/post-build/channels/public-validation-release.yml create mode 100644 eng/common/templates/post-build/common-variables.yml create mode 100644 eng/common/templates/post-build/darc-gather-drop.yml create mode 100644 eng/common/templates/post-build/post-build.yml create mode 100644 eng/common/templates/post-build/promote-build.yml create mode 100644 eng/common/templates/post-build/setup-maestro-vars.yml create mode 100644 eng/common/templates/post-build/trigger-subscription.yml create mode 100644 eng/common/templates/steps/perf-send-to-helix.yml mode change 100644 => 100755 eng/common/tools.sh diff --git a/eng/Build.ps1 b/eng/Build.ps1 index 16ec587b04..8011827a64 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -53,6 +53,7 @@ param ( [switch]$testVs, [switch]$testAll, [string]$officialSkipTests = "false", + [switch]$noVisualStudio, [parameter(ValueFromRemainingArguments=$true)][string[]]$properties) @@ -96,6 +97,7 @@ function Print-Usage() { Write-Host " -procdump Monitor test runs with procdump" Write-Host " -prepareMachine Prepare machine for CI run, clean up processes after build" Write-Host " -useGlobalNuGetCache Use global NuGet cache." + Write-Host " -noVisualStudio Only build fsc and fsi as .NET Core applications. No Visual Studio required. '-configuration', '-verbosity', '-norestore', '-rebuild' are supported." Write-Host "" Write-Host "Command line arguments starting with '/p:' are passed through to MSBuild." } @@ -145,8 +147,19 @@ function Process-Arguments() { } function Update-Arguments() { - if (-Not (Test-Path "$ArtifactsDir\Bootstrap\fsc\fsc.exe")) { - $script:bootstrap = $True + if ($script:noVisualStudio) { + $script:bootstrapTfm = "netcoreapp2.1" + $script:msbuildEngine = "dotnet" + } + + if ($bootstrapTfm -eq "netcoreapp2.1") { + if (-Not (Test-Path "$ArtifactsDir\Bootstrap\fsc\fsc.runtimeconfig.json")) { + $script:bootstrap = $True + } + } else { + if (-Not (Test-Path "$ArtifactsDir\Bootstrap\fsc\fsc.exe") -or (Test-Path "$ArtifactsDir\Bootstrap\fsc\fsc.runtimeconfig.json")) { + $script:bootstrap = $True + } } } @@ -228,10 +241,37 @@ function TestUsingNUnit([string] $testProject, [string] $targetFramework) { $projectName = [System.IO.Path]::GetFileNameWithoutExtension($testProject) $testLogPath = "$ArtifactsDir\TestResults\$configuration\${projectName}_$targetFramework.xml" $testBinLogPath = "$LogDir\${projectName}_$targetFramework.binlog" - $args = "test $testProject --no-restore --no-build -c $configuration -f $targetFramework -v n --test-adapter-path . --logger ""nunit;LogFilePath=$testLogPath"" /bl:$testBinLogPath" + $args = "test $testProject -c $configuration -f $targetFramework -v n --test-adapter-path . --logger ""nunit;LogFilePath=$testLogPath"" /bl:$testBinLogPath" + + if (-not $noVisualStudio -or $norestore) { + $args += " --no-restore" + } + + if (-not $noVisualStudio) { + $args += " --no-build" + } + Exec-Console $dotnetExe $args } +function BuildCompiler() { + if ($bootstrapTfm -eq "netcoreapp2.1") { + $dotnetPath = InitializeDotNetCli + $dotnetExe = Join-Path $dotnetPath "dotnet.exe" + $fscProject = "$RepoRoot\src\fsharp\fsc\fsc.fsproj" + $fsiProject = "$RepoRoot\src\fsharp\fsi\fsi.fsproj" + + $argNoRestore = if ($norestore) { " --no-restore" } else { "" } + $argNoIncremental = if ($rebuild) { " --no-incremental" } else { "" } + + $args = "build $fscProject -c $configuration -v $verbosity -f netcoreapp2.1" + $argNoRestore + $argNoIncremental + Exec-Console $dotnetExe $args + + $args = "build $fsiProject -c $configuration -v $verbosity -f netcoreapp2.1" + $argNoRestore + $argNoIncremental + Exec-Console $dotnetExe $args + } +} + function Prepare-TempDir() { Copy-Item (Join-Path $RepoRoot "tests\Resources\Directory.Build.props") $TempDir Copy-Item (Join-Path $RepoRoot "tests\Resources\Directory.Build.targets") $TempDir @@ -260,7 +300,11 @@ try { } if ($restore -or $build -or $rebuild -or $pack -or $sign -or $publish) { - BuildSolution + if ($noVisualStudio) { + BuildCompiler + } else { + BuildSolution + } } if ($build) { @@ -270,7 +314,7 @@ try { $desktopTargetFramework = "net472" $coreclrTargetFramework = "netcoreapp2.1" - if ($testDesktop) { + if ($testDesktop -and -not $noVisualStudio) { TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $desktopTargetFramework TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.LanguageServer.UnitTests\FSharp.Compiler.LanguageServer.UnitTests.fsproj" -targetFramework $desktopTargetFramework TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Build.UnitTests\FSharp.Build.UnitTests.fsproj" -targetFramework $desktopTargetFramework @@ -286,7 +330,7 @@ try { TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $coreclrTargetFramework } - if ($testFSharpQA) { + if ($testFSharpQA -and -not $noVisualStudio) { Push-Location "$RepoRoot\tests\fsharpqa\source" $resultsRoot = "$ArtifactsDir\TestResults\$configuration" $resultsLog = "test-net40-fsharpqa-results.log" @@ -305,21 +349,27 @@ try { } if ($testFSharpCore) { - TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $desktopTargetFramework + if (-not $noVisualStudio) { + TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $desktopTargetFramework + } TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $coreclrTargetFramework } if ($testCompiler) { - TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $desktopTargetFramework + if (-not $noVisualStudio) { + TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $desktopTargetFramework + } TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $coreclrTargetFramework } if ($testCambridge) { - TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $desktopTargetFramework + if (-not $noVisualStudio) { + TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $desktopTargetFramework + } TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $coreclrTargetFramework } - if ($testVs) { + if ($testVs -and -not $noVisualStudio) { TestUsingNUnit -testProject "$RepoRoot\vsintegration\tests\GetTypesVS.UnitTests\GetTypesVS.UnitTests.fsproj" -targetFramework $desktopTargetFramework TestUsingNUnit -testProject "$RepoRoot\vsintegration\tests\UnitTests\VisualFSharp.UnitTests.fsproj" -targetFramework $desktopTargetFramework } diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index dcd15fa1e8..1ed95d393a 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - 670f6ee1a619a2a7c84cfdfe2a1c84fbe94e1c6b + 3dfa62fddcde597959c323d17426f215384e773a diff --git a/eng/Versions.props b/eng/Versions.props index 258d4255ad..0a5dd52ef0 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -110,26 +110,26 @@ 8.0.1 14.0.25420 - 16.0.467 - 16.0.467 + 16.1.89 + 16.1.89 1.1.4322 - 16.0.467 - 16.0.28727 - 16.0.28729 + 16.1.89 + 16.1.28916.169 + 16.1.28917.181 16.1.3121 - 16.0.467 - 16.0.467 - 16.0.467 + 16.1.89 + 16.1.89 + 16.1.89 8.0.50728 7.10.6071 - 16.0.28729 + 16.1.28917.181 8.0.50728 16.0.201-pre-g7d366164d0 2.3.6152103 14.3.25407 - 16.0.28729 - 16.0.28729 - 16.0.28729 + 16.1.28917.181 + 16.1.28917.181 + 16.1.28917.181 10.0.30319 11.0.50727 15.0.25123-Dev15Preview @@ -139,15 +139,15 @@ 10.0.30320 11.0.61031 12.0.30111 - 16.0.467 + 16.1.89 7.10.6071 8.0.50728 10.0.30320 12.0.30112 - 16.0.467 - 16.0.467 + 16.1.89 + 16.1.89 16.0.102 - 16.0.28729 + 16.1.28917.181 15.3.58 9.0.30729 16.0.2264 @@ -179,4 +179,4 @@ 5.22.2.1 2.0.187 - \ No newline at end of file + diff --git a/eng/build-utils.ps1 b/eng/build-utils.ps1 index bbfa4be68e..772de110ca 100644 --- a/eng/build-utils.ps1 +++ b/eng/build-utils.ps1 @@ -230,7 +230,7 @@ function Run-MSBuild([string]$projectFilePath, [string]$buildArgs = "", [string] # Important to not set $script:bootstrapDir here yet as we're actually in the process of # building the bootstrap. function Make-BootstrapBuild() { - Write-Host "Building bootstrap compiler" + Write-Host "Building bootstrap '$bootstrapTfm' compiler" $dir = Join-Path $ArtifactsDir "Bootstrap" Remove-Item -re $dir -ErrorAction SilentlyContinue @@ -244,7 +244,7 @@ function Make-BootstrapBuild() { # prepare compiler $projectPath = "$RepoRoot\proto.proj" - Run-MSBuild $projectPath "/restore /t:Publish" -logFileName "Bootstrap" -configuration $bootstrapConfiguration + Run-MSBuild $projectPath "/restore /t:Publish /p:TargetFramework=$bootstrapTfm;ProtoTargetFramework=$bootstrapTfm" -logFileName "Bootstrap" -configuration $bootstrapConfiguration Copy-Item "$ArtifactsDir\bin\fsc\$bootstrapConfiguration\$bootstrapTfm\publish" -Destination "$dir\fsc" -Force -Recurse Copy-Item "$ArtifactsDir\bin\fsi\$bootstrapConfiguration\$bootstrapTfm\publish" -Destination "$dir\fsi" -Force -Recurse diff --git a/eng/build.sh b/eng/build.sh index c467296d3d..fceb485349 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -176,7 +176,11 @@ function TestUsingNUnit() { projectname="${projectname%.*}" testlogpath="$artifacts_dir/TestResults/$configuration/${projectname}_$targetframework.xml" args="test \"$testproject\" --no-restore --no-build -c $configuration -f $targetframework --test-adapter-path . --logger \"nunit;LogFilePath=$testlogpath\"" - "$DOTNET_INSTALL_DIR/dotnet" $args + "$DOTNET_INSTALL_DIR/dotnet" $args || { + local exit_code=$? + echo "dotnet test failed (exit code '$exit_code')." >&2 + ExitWithExitCode $exit_code + } } function BuildSolution { diff --git a/eng/common/PSScriptAnalyzerSettings.psd1 b/eng/common/PSScriptAnalyzerSettings.psd1 new file mode 100644 index 0000000000..4c1ea7c98e --- /dev/null +++ b/eng/common/PSScriptAnalyzerSettings.psd1 @@ -0,0 +1,11 @@ +@{ + IncludeRules=@('PSAvoidUsingCmdletAliases', + 'PSAvoidUsingWMICmdlet', + 'PSAvoidUsingPositionalParameters', + 'PSAvoidUsingInvokeExpression', + 'PSUseDeclaredVarsMoreThanAssignments', + 'PSUseCmdletCorrectly', + 'PSStandardDSCFunctionsInResource', + 'PSUseIdenticalMandatoryParametersForDSC', + 'PSUseIdenticalParametersForDSC') +} \ No newline at end of file diff --git a/eng/common/PublishToPackageFeed.proj b/eng/common/PublishToPackageFeed.proj index 9120b2d212..a1b1333723 100644 --- a/eng/common/PublishToPackageFeed.proj +++ b/eng/common/PublishToPackageFeed.proj @@ -54,6 +54,7 @@ https://dotnetfeed.blob.core.windows.net/dotnet-windowsdesktop/index.json https://dotnetfeed.blob.core.windows.net/nuget-nugetclient/index.json https://dotnetfeed.blob.core.windows.net/aspnet-entityframework6/index.json + https://dotnetfeed.blob.core.windows.net/aspnet-blazor/index.json Build configuration: 'Debug' or 'Release' (short: -c)" + Write-Host " -platform Platform configuration: 'x86', 'x64' or any valid Platform value to pass to msbuild" Write-Host " -verbosity Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] (short: -v)" Write-Host " -binaryLog Output binary log (short: -bl)" Write-Host " -help Print help and exit" @@ -77,6 +79,7 @@ function Build { InitializeCustomToolset $bl = if ($binaryLog) { "/bl:" + (Join-Path $LogDir "Build.binlog") } else { "" } + $platformArg = if ($platform) { "/p:Platform=$platform" } else { "" } if ($projects) { # Re-assign properties to a new variable because PowerShell doesn't let us append properties directly for unclear reasons. @@ -88,6 +91,7 @@ function Build { MSBuild $toolsetBuildProj ` $bl ` + $platformArg ` /p:Configuration=$configuration ` /p:RepoRoot=$RepoRoot ` /p:Restore=$restore ` @@ -129,9 +133,8 @@ try { Build } catch { - Write-Host $_ - Write-Host $_.Exception Write-Host $_.ScriptStackTrace + Write-PipelineTelemetryError -Category "InitializeToolset" -Message $_ ExitWithExitCode 1 } diff --git a/eng/common/build.sh b/eng/common/build.sh old mode 100644 new mode 100755 index ce846d888d..6236fc4d38 --- a/eng/common/build.sh +++ b/eng/common/build.sh @@ -66,6 +66,7 @@ ci=false warn_as_error=true node_reuse=true binary_log=false +pipelines_log=false projects='' configuration='Debug' @@ -92,6 +93,9 @@ while [[ $# > 0 ]]; do -binarylog|-bl) binary_log=true ;; + -pipelineslog|-pl) + pipelines_log=true + ;; -restore|-r) restore=true ;; @@ -146,6 +150,7 @@ while [[ $# > 0 ]]; do done if [[ "$ci" == true ]]; then + pipelines_log=true binary_log=true node_reuse=false fi diff --git a/eng/common/cibuild.sh b/eng/common/cibuild.sh old mode 100644 new mode 100755 diff --git a/eng/common/cross/armel/tizen-build-rootfs.sh b/eng/common/cross/armel/tizen-build-rootfs.sh old mode 100644 new mode 100755 diff --git a/eng/common/cross/armel/tizen-fetch.sh b/eng/common/cross/armel/tizen-fetch.sh old mode 100644 new mode 100755 index ba16e991c7..ed70e0a86e --- a/eng/common/cross/armel/tizen-fetch.sh +++ b/eng/common/cross/armel/tizen-fetch.sh @@ -157,15 +157,15 @@ fetch_tizen_pkgs() Inform "Initialize arm base" fetch_tizen_pkgs_init standard base Inform "fetch common packages" -fetch_tizen_pkgs armv7l gcc glibc glibc-devel libicu libicu-devel +fetch_tizen_pkgs armv7l gcc glibc glibc-devel libicu libicu-devel libatomic fetch_tizen_pkgs noarch linux-glibc-devel Inform "fetch coreclr packages" -fetch_tizen_pkgs armv7l lldb lldb-devel libgcc libstdc++ libstdc++-devel libunwind libunwind-devel tizen-release lttng-ust-devel lttng-ust userspace-rcu-devel userspace-rcu +fetch_tizen_pkgs armv7l lldb lldb-devel libgcc libstdc++ libstdc++-devel libunwind libunwind-devel lttng-ust-devel lttng-ust userspace-rcu-devel userspace-rcu Inform "fetch corefx packages" fetch_tizen_pkgs armv7l libcom_err libcom_err-devel zlib zlib-devel libopenssl libopenssl-devel krb5 krb5-devel libcurl libcurl-devel Inform "Initialize standard unified" fetch_tizen_pkgs_init standard unified Inform "fetch corefx packages" -fetch_tizen_pkgs armv7l gssdp gssdp-devel +fetch_tizen_pkgs armv7l gssdp gssdp-devel tizen-release diff --git a/eng/common/cross/build-android-rootfs.sh b/eng/common/cross/build-android-rootfs.sh old mode 100644 new mode 100755 diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh old mode 100644 new mode 100755 index 34d3d2ba1f..d7d5d7d5f4 --- a/eng/common/cross/build-rootfs.sh +++ b/eng/common/cross/build-rootfs.sh @@ -181,7 +181,7 @@ if [ -z "$__RootfsDir" ] && [ ! -z "$ROOTFS_DIR" ]; then fi if [ -z "$__RootfsDir" ]; then - __RootfsDir="$__CrossDir/rootfs/$__BuildArch" + __RootfsDir="$__CrossDir/../../../.tools/rootfs/$__BuildArch" fi if [ -d "$__RootfsDir" ]; then @@ -203,6 +203,7 @@ if [[ "$__LinuxCodeName" == "alpine" ]]; then -X http://dl-cdn.alpinelinux.org/alpine/v$__AlpineVersion/main \ -X http://dl-cdn.alpinelinux.org/alpine/v$__AlpineVersion/community \ -X http://dl-cdn.alpinelinux.org/alpine/edge/testing \ + -X http://dl-cdn.alpinelinux.org/alpine/edge/main \ -U --allow-untrusted --root $__RootfsDir --arch $__AlpineArch --initdb \ add $__AlpinePackages rm -r $__ApkToolsDir diff --git a/eng/common/darc-init.ps1 b/eng/common/darc-init.ps1 index dea7cdd903..8854d979f3 100644 --- a/eng/common/darc-init.ps1 +++ b/eng/common/darc-init.ps1 @@ -11,10 +11,10 @@ function InstallDarcCli ($darcVersion) { $dotnetRoot = InitializeDotNetCli -install:$true $dotnet = "$dotnetRoot\dotnet.exe" - $toolList = Invoke-Expression "& `"$dotnet`" tool list -g" + $toolList = & "$dotnet" tool list -g if ($toolList -like "*$darcCliPackageName*") { - Invoke-Expression "& `"$dotnet`" tool uninstall $darcCliPackageName -g" + & "$dotnet" tool uninstall $darcCliPackageName -g } # If the user didn't explicitly specify the darc version, @@ -22,12 +22,12 @@ function InstallDarcCli ($darcVersion) { if (-not $darcVersion) { $darcVersion = $(Invoke-WebRequest -Uri $versionEndpoint -UseBasicParsing).Content } - + $arcadeServicesSource = 'https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json' Write-Host "Installing Darc CLI version $darcVersion..." Write-Host "You may need to restart your command window if this is the first dotnet tool you have installed." - Invoke-Expression "& `"$dotnet`" tool install $darcCliPackageName --version $darcVersion --add-source '$arcadeServicesSource' -v $verbosity -g" + & "$dotnet" tool install $darcCliPackageName --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity -g } InstallDarcCli $darcVersion diff --git a/eng/common/darc-init.sh b/eng/common/darc-init.sh old mode 100644 new mode 100755 diff --git a/eng/common/dotnet-install.ps1 b/eng/common/dotnet-install.ps1 index 5987943fd6..0b629b8301 100644 --- a/eng/common/dotnet-install.ps1 +++ b/eng/common/dotnet-install.ps1 @@ -8,9 +8,14 @@ Param( . $PSScriptRoot\tools.ps1 +$dotnetRoot = Join-Path $RepoRoot ".dotnet" + +$installdir = $dotnetRoot try { - $dotnetRoot = Join-Path $RepoRoot ".dotnet" - InstallDotNet $dotnetRoot $version $architecture $runtime $true + if ($architecture -and $architecture.Trim() -eq "x86") { + $installdir = Join-Path $installdir "x86" + } + InstallDotNet $installdir $version $architecture $runtime $true } catch { Write-Host $_ @@ -19,4 +24,4 @@ catch { ExitWithExitCode 1 } -ExitWithExitCode 0 \ No newline at end of file +ExitWithExitCode 0 diff --git a/eng/common/dotnet-install.sh b/eng/common/dotnet-install.sh old mode 100644 new mode 100755 diff --git a/eng/common/generate-graph-files.ps1 b/eng/common/generate-graph-files.ps1 index a05b84f798..b056e4c1ac 100644 --- a/eng/common/generate-graph-files.ps1 +++ b/eng/common/generate-graph-files.ps1 @@ -25,7 +25,7 @@ function CheckExitCode ([string]$stage) try { Push-Location $PSScriptRoot - + Write-Host "Installing darc..." . .\darc-init.ps1 -darcVersion $darcVersion CheckExitCode "Running darc-init" @@ -40,9 +40,9 @@ try { $darcExe = "$env:USERPROFILE\.dotnet\tools" $darcExe = Resolve-Path "$darcExe\darc.exe" - + Create-Directory $outputFolder - + # Generate 3 graph descriptions: # 1. Flat with coherency information # 2. Graphviz (dot) file @@ -51,26 +51,26 @@ try { $graphVizImageFilePath = "$outputFolder\graph.png" $normalGraphFilePath = "$outputFolder\graph-full.txt" $flatGraphFilePath = "$outputFolder\graph-flat.txt" - $baseOptions = "get-dependency-graph --github-pat $gitHubPat --azdev-pat $azdoPat --password $barToken" - + $baseOptions = @( "--github-pat", "$gitHubPat", "--azdev-pat", "$azdoPat", "--password", "$barToken" ) + if ($includeToolset) { Write-Host "Toolsets will be included in the graph..." - $baseOptions += " --include-toolset" + $baseOptions += @( "--include-toolset" ) } Write-Host "Generating standard dependency graph..." - Invoke-Expression "& `"$darcExe`" $baseOptions --output-file $normalGraphFilePath" + & "$darcExe" get-dependency-graph @baseOptions --output-file $normalGraphFilePath CheckExitCode "Generating normal dependency graph" Write-Host "Generating flat dependency graph and graphviz file..." - Invoke-Expression "& `"$darcExe`" $baseOptions --flat --coherency --graphviz $graphVizFilePath --output-file $flatGraphFilePath" + & "$darcExe" get-dependency-graph @baseOptions --flat --coherency --graphviz $graphVizFilePath --output-file $flatGraphFilePath CheckExitCode "Generating flat and graphviz dependency graph" Write-Host "Generating graph image $graphVizFilePath" $dotFilePath = Join-Path $installBin "graphviz\$graphvizVersion\release\bin\dot.exe" - Invoke-Expression "& `"$dotFilePath`" -Tpng -o'$graphVizImageFilePath' `"$graphVizFilePath`"" + & "$dotFilePath" -Tpng -o"$graphVizImageFilePath" "$graphVizFilePath" CheckExitCode "Generating graphviz image" - + Write-Host "'$graphVizFilePath', '$flatGraphFilePath', '$normalGraphFilePath' and '$graphVizImageFilePath' created!" } catch { diff --git a/eng/common/init-tools-native.ps1 b/eng/common/init-tools-native.ps1 index a4306bd37e..eaa05880c5 100644 --- a/eng/common/init-tools-native.ps1 +++ b/eng/common/init-tools-native.ps1 @@ -79,32 +79,37 @@ try { $NativeTools.PSObject.Properties | ForEach-Object { $ToolName = $_.Name $ToolVersion = $_.Value - $LocalInstallerCommand = $InstallerPath - $LocalInstallerCommand += " -ToolName $ToolName" - $LocalInstallerCommand += " -InstallPath $InstallBin" - $LocalInstallerCommand += " -BaseUri $BaseUri" - $LocalInstallerCommand += " -CommonLibraryDirectory $EngCommonBaseDir" - $LocalInstallerCommand += " -Version $ToolVersion" + $LocalInstallerArguments = @{ ToolName = "$ToolName" } + $LocalInstallerArguments += @{ InstallPath = "$InstallBin" } + $LocalInstallerArguments += @{ BaseUri = "$BaseUri" } + $LocalInstallerArguments += @{ CommonLibraryDirectory = "$EngCommonBaseDir" } + $LocalInstallerArguments += @{ Version = "$ToolVersion" } if ($Verbose) { - $LocalInstallerCommand += " -Verbose" + $LocalInstallerArguments += @{ Verbose = $True } } if (Get-Variable 'Force' -ErrorAction 'SilentlyContinue') { if($Force) { - $LocalInstallerCommand += " -Force" + $LocalInstallerArguments += @{ Force = $True } } } if ($Clean) { - $LocalInstallerCommand += " -Clean" + $LocalInstallerArguments += @{ Clean = $True } } Write-Verbose "Installing $ToolName version $ToolVersion" - Write-Verbose "Executing '$LocalInstallerCommand'" - Invoke-Expression "$LocalInstallerCommand" + Write-Verbose "Executing '$InstallerPath $LocalInstallerArguments'" + & $InstallerPath @LocalInstallerArguments if ($LASTEXITCODE -Ne "0") { $errMsg = "$ToolName installation failed" if ((Get-Variable 'DoNotAbortNativeToolsInstallationOnFailure' -ErrorAction 'SilentlyContinue') -and $DoNotAbortNativeToolsInstallationOnFailure) { - Write-Warning $errMsg + $showNativeToolsWarning = $true + if ((Get-Variable 'DoNotDisplayNativeToolsInstallationWarnings' -ErrorAction 'SilentlyContinue') -and $DoNotDisplayNativeToolsInstallationWarnings) { + $showNativeToolsWarning = $false + } + if ($showNativeToolsWarning) { + Write-Warning $errMsg + } $toolInstallationFailure = $true } else { Write-Error $errMsg diff --git a/eng/common/init-tools-native.sh b/eng/common/init-tools-native.sh old mode 100644 new mode 100755 index fc72d13948..5f2e77f448 --- a/eng/common/init-tools-native.sh +++ b/eng/common/init-tools-native.sh @@ -71,7 +71,7 @@ function ReadGlobalJsonNativeTools { local native_tools_list=$(echo $native_tools_section | awk -F"[{}]" '{print $2}') native_tools_list=${native_tools_list//[\" ]/} native_tools_list=${native_tools_list//,/$'\n'} - native_tools_list="$(echo -e "${native_tools_list}" | tr -d '[:space:]')" + native_tools_list="$(echo -e "${native_tools_list}" | tr -d '[[:space:]]')" local old_IFS=$IFS while read -r line; do diff --git a/eng/common/internal-feed-operations.ps1 b/eng/common/internal-feed-operations.ps1 new file mode 100644 index 0000000000..8b8bafd6a8 --- /dev/null +++ b/eng/common/internal-feed-operations.ps1 @@ -0,0 +1,135 @@ +param( + [Parameter(Mandatory=$true)][string] $Operation, + [string] $AuthToken, + [string] $CommitSha, + [string] $RepoName, + [switch] $IsFeedPrivate +) + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 2.0 + +. $PSScriptRoot\tools.ps1 + +# Sets VSS_NUGET_EXTERNAL_FEED_ENDPOINTS based on the "darc-int-*" feeds defined in NuGet.config. This is needed +# in build agents by CredProvider to authenticate the restore requests to internal feeds as specified in +# https://github.com/microsoft/artifacts-credprovider/blob/0f53327cd12fd893d8627d7b08a2171bf5852a41/README.md#environment-variables. This should ONLY be called from identified +# internal builds +function SetupCredProvider { + param( + [string] $AuthToken + ) + + # Install the Cred Provider NuGet plugin + Write-Host "Setting up Cred Provider NuGet plugin in the agent..." + Write-Host "Getting 'installcredprovider.ps1' from 'https://github.com/microsoft/artifacts-credprovider'..." + + $url = 'https://raw.githubusercontent.com/microsoft/artifacts-credprovider/master/helpers/installcredprovider.ps1' + + Write-Host "Writing the contents of 'installcredprovider.ps1' locally..." + Invoke-WebRequest $url -OutFile installcredprovider.ps1 + + Write-Host "Installing plugin..." + .\installcredprovider.ps1 -Force + + Write-Host "Deleting local copy of 'installcredprovider.ps1'..." + Remove-Item .\installcredprovider.ps1 + + if (-Not("$env:USERPROFILE\.nuget\plugins\netcore")) { + Write-Host "CredProvider plugin was not installed correctly!" + ExitWithExitCode 1 + } + else { + Write-Host "CredProvider plugin was installed correctly!" + } + + # Then, we set the 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS' environment variable to restore from the stable + # feeds successfully + + $nugetConfigPath = "$RepoRoot\NuGet.config" + + if (-Not (Test-Path -Path $nugetConfigPath)) { + Write-Host "NuGet.config file not found in repo's root!" + ExitWithExitCode 1 + } + + $endpoints = New-Object System.Collections.ArrayList + $nugetConfigPackageSources = Select-Xml -Path $nugetConfigPath -XPath "//packageSources/add[contains(@key, 'darc-int-')]/@value" | foreach{$_.Node.Value} + + if (($nugetConfigPackageSources | Measure-Object).Count -gt 0 ) { + foreach ($stableRestoreResource in $nugetConfigPackageSources) { + $trimmedResource = ([string]$stableRestoreResource).Trim() + [void]$endpoints.Add(@{endpoint="$trimmedResource"; password="$AuthToken"}) + } + } + + if (($endpoints | Measure-Object).Count -gt 0) { + # Create the JSON object. It should look like '{"endpointCredentials": [{"endpoint":"http://example.index.json", "username":"optional", "password":"accesstoken"}]}' + $endpointCredentials = @{endpointCredentials=$endpoints} | ConvertTo-Json -Compress + + # Create the environment variables the AzDo way + Write-LoggingCommand -Area 'task' -Event 'setvariable' -Data $endpointCredentials -Properties @{ + 'variable' = 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS' + 'issecret' = 'false' + } + + # We don't want sessions cached since we will be updating the endpoints quite frequently + Write-LoggingCommand -Area 'task' -Event 'setvariable' -Data 'False' -Properties @{ + 'variable' = 'NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED' + 'issecret' = 'false' + } + } + else + { + Write-Host "No internal endpoints found in NuGet.config" + } +} + +#Workaround for https://github.com/microsoft/msbuild/issues/4430 +function InstallDotNetSdkAndRestoreArcade { + $dotnetTempDir = "$RepoRoot\dotnet" + $dotnetSdkVersion="2.1.507" # After experimentation we know this version works when restoring the SDK (compared to 3.0.*) + $dotnet = "$dotnetTempDir\dotnet.exe" + $restoreProjPath = "$PSScriptRoot\restore.proj" + + Write-Host "Installing dotnet SDK version $dotnetSdkVersion to restore Arcade SDK..." + InstallDotNetSdk "$dotnetTempDir" "$dotnetSdkVersion" + + '' | Out-File "$restoreProjPath" + + & $dotnet restore $restoreProjPath + + Write-Host "Arcade SDK restored!" + + if (Test-Path -Path $restoreProjPath) { + Remove-Item $restoreProjPath + } + + if (Test-Path -Path $dotnetTempDir) { + Remove-Item $dotnetTempDir -Recurse + } +} + +try { + Push-Location $PSScriptRoot + + if ($Operation -like "setup") { + SetupCredProvider $AuthToken + } + elseif ($Operation -like "install-restore") { + InstallDotNetSdkAndRestoreArcade + } + else { + Write-Host "Unknown operation '$Operation'!" + ExitWithExitCode 1 + } +} +catch { + Write-Host $_ + Write-Host $_.Exception + Write-Host $_.ScriptStackTrace + ExitWithExitCode 1 +} +finally { + Pop-Location +} diff --git a/eng/common/internal-feed-operations.sh b/eng/common/internal-feed-operations.sh new file mode 100755 index 0000000000..1ff654d2ff --- /dev/null +++ b/eng/common/internal-feed-operations.sh @@ -0,0 +1,142 @@ +#!/usr/bin/env bash + +set -e + +# Sets VSS_NUGET_EXTERNAL_FEED_ENDPOINTS based on the "darc-int-*" feeds defined in NuGet.config. This is needed +# in build agents by CredProvider to authenticate the restore requests to internal feeds as specified in +# https://github.com/microsoft/artifacts-credprovider/blob/0f53327cd12fd893d8627d7b08a2171bf5852a41/README.md#environment-variables. +# This should ONLY be called from identified internal builds +function SetupCredProvider { + local authToken=$1 + + # Install the Cred Provider NuGet plugin + echo "Setting up Cred Provider NuGet plugin in the agent..."... + echo "Getting 'installcredprovider.ps1' from 'https://github.com/microsoft/artifacts-credprovider'..." + + local url="https://raw.githubusercontent.com/microsoft/artifacts-credprovider/master/helpers/installcredprovider.sh" + + echo "Writing the contents of 'installcredprovider.ps1' locally..." + local installcredproviderPath="installcredprovider.sh" + if command -v curl > /dev/null; then + curl $url > "$installcredproviderPath" + else + wget -q -O "$installcredproviderPath" "$url" + fi + + echo "Installing plugin..." + . "$installcredproviderPath" + + echo "Deleting local copy of 'installcredprovider.sh'..." + rm installcredprovider.sh + + if [ ! -d "$HOME/.nuget/plugins" ]; then + echo "CredProvider plugin was not installed correctly!" + ExitWithExitCode 1 + else + echo "CredProvider plugin was installed correctly!" + fi + + # Then, we set the 'VSS_NUGET_EXTERNAL_FEED_ENDPOINTS' environment variable to restore from the stable + # feeds successfully + + local nugetConfigPath="$repo_root/NuGet.config" + + if [ ! "$nugetConfigPath" ]; then + echo "NuGet.config file not found in repo's root!" + ExitWithExitCode 1 + fi + + local endpoints='[' + local nugetConfigPackageValues=`cat "$nugetConfigPath" | grep "key=\"darc-int-"` + local pattern="value=\"(.*)\"" + + for value in $nugetConfigPackageValues + do + if [[ $value =~ $pattern ]]; then + local endpoint="${BASH_REMATCH[1]}" + endpoints+="{\"endpoint\": \"$endpoint\", \"password\": \"$authToken\"}," + fi + done + + endpoints=${endpoints%?} + endpoints+=']' + + if [ ${#endpoints} -gt 2 ]; then + # Create the JSON object. It should look like '{"endpointCredentials": [{"endpoint":"http://example.index.json", "username":"optional", "password":"accesstoken"}]}' + local endpointCredentials="{\"endpointCredentials\": "$endpoints"}" + + echo "##vso[task.setvariable variable=VSS_NUGET_EXTERNAL_FEED_ENDPOINTS]$endpointCredentials" + echo "##vso[task.setvariable variable=NUGET_CREDENTIALPROVIDER_SESSIONTOKENCACHE_ENABLED]False" + else + echo "No internal endpoints found in NuGet.config" + fi +} + +# Workaround for https://github.com/microsoft/msbuild/issues/4430 +function InstallDotNetSdkAndRestoreArcade { + local dotnetTempDir="$repo_root/dotnet" + local dotnetSdkVersion="2.1.507" # After experimentation we know this version works when restoring the SDK (compared to 3.0.*) + local restoreProjPath="$repo_root/eng/common/restore.proj" + + echo "Installing dotnet SDK version $dotnetSdkVersion to restore Arcade SDK..." + echo "" > "$restoreProjPath" + + InstallDotNetSdk "$dotnetTempDir" "$dotnetSdkVersion" + + local res=`$dotnetTempDir/dotnet restore $restoreProjPath` + echo "Arcade SDK restored!" + + # Cleanup + if [ "$restoreProjPath" ]; then + rm "$restoreProjPath" + fi + + if [ "$dotnetTempDir" ]; then + rm -r $dotnetTempDir + fi +} + +source="${BASH_SOURCE[0]}" +operation='' +authToken='' +repoName='' + +while [[ $# > 0 ]]; do + opt="$(echo "$1" | awk '{print tolower($0)}')" + case "$opt" in + --operation) + operation=$2 + shift + ;; + --authtoken) + authToken=$2 + shift + ;; + *) + echo "Invalid argument: $1" + usage + exit 1 + ;; + esac + + shift +done + +while [[ -h "$source" ]]; do + scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + source="$(readlink "$source")" + # if $source was a relative symlink, we need to resolve it relative to the path where the + # symlink file was located + [[ $source != /* ]] && source="$scriptroot/$source" +done +scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + +. "$scriptroot/tools.sh" + +if [ "$operation" = "setup" ]; then + SetupCredProvider $authToken +elif [ "$operation" = "install-restore" ]; then + InstallDotNetSdkAndRestoreArcade +else + echo "Unknown operation '$operation'!" +fi diff --git a/eng/common/msbuild.sh b/eng/common/msbuild.sh old mode 100644 new mode 100755 diff --git a/eng/common/native/CommonLibrary.psm1 b/eng/common/native/CommonLibrary.psm1 index f286ae0cde..7a34c7e8a4 100644 --- a/eng/common/native/CommonLibrary.psm1 +++ b/eng/common/native/CommonLibrary.psm1 @@ -209,7 +209,7 @@ function New-ScriptShim { Remove-Item (Join-Path $ShimDirectory "$ShimName.exe") } - Invoke-Expression "$ShimDirectory\WinShimmer\winshimmer.exe $ShimName $ToolFilePath $ShimDirectory" + & "$ShimDirectory\WinShimmer\winshimmer.exe" $ShimName $ToolFilePath $ShimDirectory return $True } catch { diff --git a/eng/common/native/common-library.sh b/eng/common/native/common-library.sh old mode 100644 new mode 100755 diff --git a/eng/common/native/install-cmake.sh b/eng/common/native/install-cmake.sh old mode 100644 new mode 100755 diff --git a/eng/common/performance/perfhelixpublish.proj b/eng/common/performance/perfhelixpublish.proj new file mode 100644 index 0000000000..05e5f09891 --- /dev/null +++ b/eng/common/performance/perfhelixpublish.proj @@ -0,0 +1,77 @@ + + + + %HELIX_CORRELATION_PAYLOAD%\performance\scripts\benchmarks_ci.py --csproj %HELIX_CORRELATION_PAYLOAD%\performance\$(TargetCsproj) + --dotnet-versions %DOTNET_VERSION% --cli-source-info args --cli-branch %PERFLAB_BRANCH% --cli-commit-sha %PERFLAB_HASH% --cli-repository https://github.com/%PERFLAB_REPO% --cli-source-timestamp %PERFLAB_BUILDTIMESTAMP% + py -3 + %HELIX_CORRELATION_PAYLOAD%\Core_Root\CoreRun.exe + $(HelixPreCommands);call %HELIX_CORRELATION_PAYLOAD%\performance\tools\machine-setup.cmd + %HELIX_CORRELATION_PAYLOAD%\artifacts\BenchmarkDotNet.Artifacts + + + + $HELIX_CORRELATION_PAYLOAD + $(BaseDirectory)/performance + + + + $HELIX_WORKITEM_PAYLOAD + $(BaseDirectory) + + + + $(PerformanceDirectory)/scripts/benchmarks_ci.py --csproj $(PerformanceDirectory)/$(TargetCsproj) + --dotnet-versions $DOTNET_VERSION --cli-source-info args --cli-branch $PERFLAB_BRANCH --cli-commit-sha $PERFLAB_HASH --cli-repository https://github.com/$PERFLAB_REPO --cli-source-timestamp $PERFLAB_BUILDTIMESTAMP + python3 + $(BaseDirectory)/Core_Root/corerun + $(HelixPreCommands);chmod +x $(PerformanceDirectory)/tools/machine-setup.sh;. $(PerformanceDirectory)/tools/machine-setup.sh + $(BaseDirectory)/artifacts/BenchmarkDotNet.Artifacts + + + + --corerun $(CoreRun) + + + + $(Python) $(WorkItemCommand) --incremental no --architecture $(Architecture) -f $(_Framework) $(PerfLabArguments) + + + + $(WorkItemCommand) $(CliArguments) + + + + + %(Identity) + + + + + 5 + + + + + + + + + + + + + $(WorkItemDirectory) + $(WorkItemCommand) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument) --artifacts $(ArtifactsDirectory) --partition-count $(PartitionCount) --partition-index %(HelixWorkItem.Index)" + 4:00 + + + + + $(WorkItemDirectory) + $(WorkItemCommand) --bdn-arguments="--anyCategories $(BDNCategories) $(ExtraBenchmarkDotNetArguments) $(CoreRunArgument) --artifacts $(ArtifactsDirectory)" + 4:00 + + + \ No newline at end of file diff --git a/eng/common/performance/performance-setup.ps1 b/eng/common/performance/performance-setup.ps1 new file mode 100644 index 0000000000..7e5441f797 --- /dev/null +++ b/eng/common/performance/performance-setup.ps1 @@ -0,0 +1,91 @@ +Param( + [string] $SourceDirectory=$env:BUILD_SOURCESDIRECTORY, + [string] $CoreRootDirectory, + [string] $Architecture="x64", + [string] $Framework="netcoreapp3.0", + [string] $CompilationMode="Tiered", + [string] $Repository=$env:BUILD_REPOSITORY_NAME, + [string] $Branch=$env:BUILD_SOURCEBRANCH, + [string] $CommitSha=$env:BUILD_SOURCEVERSION, + [string] $BuildNumber=$env:BUILD_BUILDNUMBER, + [string] $RunCategories="coreclr corefx", + [string] $Csproj="src\benchmarks\micro\MicroBenchmarks.csproj", + [string] $Kind="micro", + [switch] $Internal, + [string] $Configurations="CompilationMode=$CompilationMode" +) + +$RunFromPerformanceRepo = ($Repository -eq "dotnet/performance") +$UseCoreRun = ($CoreRootDirectory -ne [string]::Empty) + +$PayloadDirectory = (Join-Path $SourceDirectory "Payload") +$PerformanceDirectory = (Join-Path $PayloadDirectory "performance") +$WorkItemDirectory = (Join-Path $SourceDirectory "workitem") +$ExtraBenchmarkDotNetArguments = "--iterationCount 1 --warmupCount 0 --invocationCount 1 --unrollFactor 1 --strategy ColdStart --stopOnFirstError true" +$Creator = $env:BUILD_DEFINITIONNAME +$PerfLabArguments = "" +$HelixSourcePrefix = "pr" + +$Queue = "Windows.10.Amd64.ClientRS4.DevEx.15.8.Open" + +if ($Framework.StartsWith("netcoreapp")) { + $Queue = "Windows.10.Amd64.ClientRS4.Open" +} + +if ($Internal) { + $Queue = "Windows.10.Amd64.ClientRS5.Perf" + $PerfLabArguments = "--upload-to-perflab-container" + $ExtraBenchmarkDotNetArguments = "" + $Creator = "" + $HelixSourcePrefix = "official" +} + +$CommonSetupArguments="--frameworks $Framework --queue $Queue --build-number $BuildNumber --build-configs $Configurations" +$SetupArguments = "--repository https://github.com/$Repository --branch $Branch --get-perf-hash --commit-sha $CommitSha $CommonSetupArguments" + +if ($RunFromPerformanceRepo) { + $SetupArguments = "--perf-hash $CommitSha $CommonSetupArguments" + + robocopy $SourceDirectory $PerformanceDirectory /E /XD $PayloadDirectory $SourceDirectory\artifacts $SourceDirectory\.git +} +else { + git clone --branch master --depth 1 --quiet https://github.com/dotnet/performance $PerformanceDirectory +} + +if ($UseCoreRun) { + $NewCoreRoot = (Join-Path $PayloadDirectory "Core_Root") + Move-Item -Path $CoreRootDirectory -Destination $NewCoreRoot +} + +$DocsDir = (Join-Path $PerformanceDirectory "docs") +robocopy $DocsDir $WorkItemDirectory + +# Set variables that we will need to have in future steps +$ci = $true + +. "$PSScriptRoot\..\pipeline-logging-functions.ps1" + +# Directories +Write-PipelineSetVariable -Name 'PayloadDirectory' -Value "$PayloadDirectory" -IsMultiJobVariable $false +Write-PipelineSetVariable -Name 'PerformanceDirectory' -Value "$PerformanceDirectory" -IsMultiJobVariable $false +Write-PipelineSetVariable -Name 'WorkItemDirectory' -Value "$WorkItemDirectory" -IsMultiJobVariable $false + +# Script Arguments +Write-PipelineSetVariable -Name 'Python' -Value "py -3" -IsMultiJobVariable $false +Write-PipelineSetVariable -Name 'ExtraBenchmarkDotNetArguments' -Value "$ExtraBenchmarkDotNetArguments" -IsMultiJobVariable $false +Write-PipelineSetVariable -Name 'SetupArguments' -Value "$SetupArguments" -IsMultiJobVariable $false +Write-PipelineSetVariable -Name 'PerfLabArguments' -Value "$PerfLabArguments" -IsMultiJobVariable $false +Write-PipelineSetVariable -Name 'BDNCategories' -Value "$RunCategories" -IsMultiJobVariable $false +Write-PipelineSetVariable -Name 'TargetCsproj' -Value "$Csproj" -IsMultiJobVariable $false +Write-PipelineSetVariable -Name 'Kind' -Value "$Kind" -IsMultiJobVariable $false +Write-PipelineSetVariable -Name 'Architecture' -Value "$Architecture" -IsMultiJobVariable $false +Write-PipelineSetVariable -Name 'UseCoreRun' -Value "$UseCoreRun" -IsMultiJobVariable $false +Write-PipelineSetVariable -Name 'RunFromPerfRepo' -Value "$RunFromPerformanceRepo" -IsMultiJobVariable $false + +# Helix Arguments +Write-PipelineSetVariable -Name 'Creator' -Value "$Creator" -IsMultiJobVariable $false +Write-PipelineSetVariable -Name 'Queue' -Value "$Queue" -IsMultiJobVariable $false +Write-PipelineSetVariable -Name 'HelixSourcePrefix' -Value "$HelixSourcePrefix" -IsMultiJobVariable $false +Write-PipelineSetVariable -Name '_BuildConfig' -Value "$Architecture.$Kind.$Framework" -IsMultiJobVariable $false + +exit 0 \ No newline at end of file diff --git a/eng/common/performance/performance-setup.sh b/eng/common/performance/performance-setup.sh new file mode 100755 index 0000000000..126da5f76d --- /dev/null +++ b/eng/common/performance/performance-setup.sh @@ -0,0 +1,176 @@ +#!/usr/bin/env bash + +source_directory=$BUILD_SOURCESDIRECTORY +core_root_directory= +architecture=x64 +framework=netcoreapp3.0 +compilation_mode=tiered +repository=$BUILD_REPOSITORY_NAME +branch=$BUILD_SOURCEBRANCH +commit_sha=$BUILD_SOURCEVERSION +build_number=$BUILD_BUILDNUMBER +internal=false +kind="micro" +run_categories="coreclr corefx" +csproj="src\benchmarks\micro\MicroBenchmarks.csproj" +configurations= +run_from_perf_repo=false +use_core_run=true + +while (($# > 0)); do + lowerI="$(echo $1 | awk '{print tolower($0)}')" + case $lowerI in + --sourcedirectory) + source_directory=$2 + shift 2 + ;; + --corerootdirectory) + core_root_directory=$2 + shift 2 + ;; + --architecture) + architecture=$2 + shift 2 + ;; + --framework) + framework=$2 + shift 2 + ;; + --compilationmode) + compilation_mode=$2 + shift 2 + ;; + --repository) + repository=$2 + shift 2 + ;; + --branch) + branch=$2 + shift 2 + ;; + --commitsha) + commit_sha=$2 + shift 2 + ;; + --buildnumber) + build_number=$2 + shift 2 + ;; + --kind) + kind=$2 + shift 2 + ;; + --runcategories) + run_categories=$2 + shift 2 + ;; + --csproj) + csproj=$2 + shift 2 + ;; + --internal) + internal=true + shift 1 + ;; + --configurations) + configurations=$2 + shift 2 + ;; + --help) + echo "Common settings:" + echo " --corerootdirectory Directory where Core_Root exists, if running perf testing with --corerun" + echo " --architecture Architecture of the testing being run" + echo " --configurations List of key=value pairs that will be passed to perf testing infrastructure." + echo " ex: --configurations \"CompilationMode=Tiered OptimzationLevel=PGO\"" + echo " --help Print help and exit" + echo "" + echo "Advanced settings:" + echo " --framework The framework to run, if not running in master" + echo " --compliationmode The compilation mode if not passing --configurations" + echo " --sourcedirectory The directory of the sources. Defaults to env:BUILD_SOURCESDIRECTORY" + echo " --repository The name of the repository in the / format. Defaults to env:BUILD_REPOSITORY_NAME" + echo " --branch The name of the branch. Defaults to env:BUILD_SOURCEBRANCH" + echo " --commitsha The commit sha1 to run against. Defaults to env:BUILD_SOURCEVERSION" + echo " --buildnumber The build number currently running. Defaults to env:BUILD_BUILDNUMBER" + echo " --csproj The relative path to the benchmark csproj whose tests should be run. Defaults to src\benchmarks\micro\MicroBenchmarks.csproj" + echo " --kind Related to csproj. The kind of benchmarks that should be run. Defaults to micro" + echo " --runcategories Related to csproj. Categories of benchmarks to run. Defaults to \"coreclr corefx\"" + echo " --internal If the benchmarks are running as an official job." + echo "" + exit 0 + ;; + esac +done + +if [[ "$repository" == "dotnet/performance" ]]; then + run_from_perf_repo=true +fi + +if [ -z "$configurations" ]; then + configurations="CompliationMode=$compilation_mode" +fi + +if [ -z "$core_root_directory" ]; then + use_core_run=false +fi + +payload_directory=$source_directory/Payload +performance_directory=$payload_directory/performance +workitem_directory=$source_directory/workitem +extra_benchmark_dotnet_arguments="--iterationCount 1 --warmupCount 0 --invocationCount 1 --unrollFactor 1 --strategy ColdStart --stopOnFirstError true" +perflab_arguments= +queue=Ubuntu.1804.Amd64.Open +creator=$BUILD_DEFINITIONNAME +helix_source_prefix="pr" + +if [[ "$internal" == true ]]; then + perflab_arguments="--upload-to-perflab-container" + helix_source_prefix="official" + creator= + extra_benchmark_dotnet_arguments= + + if [[ "$architecture" = "arm64" ]]; then + queue=Ubuntu.1804.Arm64.Perf + else + queue=Ubuntu.1804.Amd64.Perf + fi +fi + +common_setup_arguments="--frameworks $framework --queue $queue --build-number $build_number --build-configs $configurations" +setup_arguments="--repository https://github.com/$repository --branch $branch --get-perf-hash --commit-sha $commit_sha $common_setup_arguments" + +if [[ "$run_from_perf_repo" = true ]]; then + payload_directory= + workitem_directory=$source_directory + performance_directory=$workitem_directory + setup_arguments="--perf-hash $commit_sha $common_setup_arguments" +else + git clone --branch master --depth 1 --quiet https://github.com/dotnet/performance $performance_directory + + docs_directory=$performance_directory/docs + mv $docs_directory $workitem_directory +fi + +if [[ "$use_core_run" = true ]]; then + new_core_root=$payload_directory/Core_Root + mv $core_root_directory $new_core_root +fi + +# Make sure all of our variables are available for future steps +echo "##vso[task.setvariable variable=UseCoreRun]$use_core_run" +echo "##vso[task.setvariable variable=Architecture]$architecture" +echo "##vso[task.setvariable variable=PayloadDirectory]$payload_directory" +echo "##vso[task.setvariable variable=PerformanceDirectory]$performance_directory" +echo "##vso[task.setvariable variable=WorkItemDirectory]$workitem_directory" +echo "##vso[task.setvariable variable=Queue]$queue" +echo "##vso[task.setvariable variable=SetupArguments]$setup_arguments" +echo "##vso[task.setvariable variable=Python]python3" +echo "##vso[task.setvariable variable=PerfLabArguments]$perflab_arguments" +echo "##vso[task.setvariable variable=ExtraBenchmarkDotNetArguments]$extra_benchmark_dotnet_arguments" +echo "##vso[task.setvariable variable=BDNCategories]$run_categories" +echo "##vso[task.setvariable variable=TargetCsproj]$csproj" +echo "##vso[task.setvariable variable=RunFromPerfRepo]$run_from_perf_repo" +echo "##vso[task.setvariable variable=Creator]$creator" +echo "##vso[task.setvariable variable=HelixSourcePrefix]$helix_source_prefix" +echo "##vso[task.setvariable variable=Kind]$kind" +echo "##vso[task.setvariable variable=_BuildConfig]$architecture.$kind.$framework" \ No newline at end of file diff --git a/eng/common/pipeline-logging-functions.ps1 b/eng/common/pipeline-logging-functions.ps1 new file mode 100644 index 0000000000..af5f48aace --- /dev/null +++ b/eng/common/pipeline-logging-functions.ps1 @@ -0,0 +1,234 @@ +# Source for this file was taken from https://github.com/microsoft/azure-pipelines-task-lib/blob/11c9439d4af17e6475d9fe058e6b2e03914d17e6/powershell/VstsTaskSdk/LoggingCommandFunctions.ps1 and modified. + +# NOTE: You should not be calling these method directly as they are likely to change. Instead you should be calling the Write-Pipeline* functions defined in tools.ps1 + +$script:loggingCommandPrefix = '##vso[' +$script:loggingCommandEscapeMappings = @( # TODO: WHAT ABOUT "="? WHAT ABOUT "%"? + New-Object psobject -Property @{ Token = ';' ; Replacement = '%3B' } + New-Object psobject -Property @{ Token = "`r" ; Replacement = '%0D' } + New-Object psobject -Property @{ Token = "`n" ; Replacement = '%0A' } + New-Object psobject -Property @{ Token = "]" ; Replacement = '%5D' } +) +# TODO: BUG: Escape % ??? +# TODO: Add test to verify don't need to escape "=". + +function Write-PipelineTelemetryError { + [CmdletBinding()] + param( + [Parameter(Mandatory = $true)] + [string]$Category, + [Parameter(Mandatory = $true)] + [string]$Message, + [Parameter(Mandatory = $false)] + [string]$Type = 'error', + [string]$ErrCode, + [string]$SourcePath, + [string]$LineNumber, + [string]$ColumnNumber, + [switch]$AsOutput) + + $PSBoundParameters.Remove("Category") | Out-Null + + $Message = "(NETCORE_ENGINEERING_TELEMETRY=$Category) $Message" + $PSBoundParameters.Remove("Message") | Out-Null + $PSBoundParameters.Add("Message", $Message) + + Write-PipelineTaskError @PSBoundParameters +} + +function Write-PipelineTaskError { + [CmdletBinding()] + param( + [Parameter(Mandatory = $true)] + [string]$Message, + [Parameter(Mandatory = $false)] + [string]$Type = 'error', + [string]$ErrCode, + [string]$SourcePath, + [string]$LineNumber, + [string]$ColumnNumber, + [switch]$AsOutput) + + if(!$ci) { + if($Type -eq 'error') { + Write-Host $Message -ForegroundColor Red + return + } + elseif ($Type -eq 'warning') { + Write-Host $Message -ForegroundColor Yellow + return + } + } + + if(($Type -ne 'error') -and ($Type -ne 'warning')) { + Write-Host $Message + return + } + if(-not $PSBoundParameters.ContainsKey('Type')) { + $PSBoundParameters.Add('Type', 'error') + } + Write-LogIssue @PSBoundParameters + } + + function Write-PipelineSetVariable { + [CmdletBinding()] + param( + [Parameter(Mandatory = $true)] + [string]$Name, + [string]$Value, + [switch]$Secret, + [switch]$AsOutput, + [bool]$IsMultiJobVariable=$true) + + if($ci) { + Write-LoggingCommand -Area 'task' -Event 'setvariable' -Data $Value -Properties @{ + 'variable' = $Name + 'isSecret' = $Secret + 'isOutput' = $IsMultiJobVariable + } -AsOutput:$AsOutput + } + } + + function Write-PipelinePrependPath { + [CmdletBinding()] + param( + [Parameter(Mandatory=$true)] + [string]$Path, + [switch]$AsOutput) + if($ci) { + Write-LoggingCommand -Area 'task' -Event 'prependpath' -Data $Path -AsOutput:$AsOutput + } + } + +<######################################## +# Private functions. +########################################> +function Format-LoggingCommandData { + [CmdletBinding()] + param([string]$Value, [switch]$Reverse) + + if (!$Value) { + return '' + } + + if (!$Reverse) { + foreach ($mapping in $script:loggingCommandEscapeMappings) { + $Value = $Value.Replace($mapping.Token, $mapping.Replacement) + } + } else { + for ($i = $script:loggingCommandEscapeMappings.Length - 1 ; $i -ge 0 ; $i--) { + $mapping = $script:loggingCommandEscapeMappings[$i] + $Value = $Value.Replace($mapping.Replacement, $mapping.Token) + } + } + + return $Value +} + +function Format-LoggingCommand { + [CmdletBinding()] + param( + [Parameter(Mandatory = $true)] + [string]$Area, + [Parameter(Mandatory = $true)] + [string]$Event, + [string]$Data, + [hashtable]$Properties) + + # Append the preamble. + [System.Text.StringBuilder]$sb = New-Object -TypeName System.Text.StringBuilder + $null = $sb.Append($script:loggingCommandPrefix).Append($Area).Append('.').Append($Event) + + # Append the properties. + if ($Properties) { + $first = $true + foreach ($key in $Properties.Keys) { + [string]$value = Format-LoggingCommandData $Properties[$key] + if ($value) { + if ($first) { + $null = $sb.Append(' ') + $first = $false + } else { + $null = $sb.Append(';') + } + + $null = $sb.Append("$key=$value") + } + } + } + + # Append the tail and output the value. + $Data = Format-LoggingCommandData $Data + $sb.Append(']').Append($Data).ToString() +} + +function Write-LoggingCommand { + [CmdletBinding(DefaultParameterSetName = 'Parameters')] + param( + [Parameter(Mandatory = $true, ParameterSetName = 'Parameters')] + [string]$Area, + [Parameter(Mandatory = $true, ParameterSetName = 'Parameters')] + [string]$Event, + [Parameter(ParameterSetName = 'Parameters')] + [string]$Data, + [Parameter(ParameterSetName = 'Parameters')] + [hashtable]$Properties, + [Parameter(Mandatory = $true, ParameterSetName = 'Object')] + $Command, + [switch]$AsOutput) + + if ($PSCmdlet.ParameterSetName -eq 'Object') { + Write-LoggingCommand -Area $Command.Area -Event $Command.Event -Data $Command.Data -Properties $Command.Properties -AsOutput:$AsOutput + return + } + + $command = Format-LoggingCommand -Area $Area -Event $Event -Data $Data -Properties $Properties + if ($AsOutput) { + $command + } else { + Write-Host $command + } +} + +function Write-LogIssue { + [CmdletBinding()] + param( + [ValidateSet('warning', 'error')] + [Parameter(Mandatory = $true)] + [string]$Type, + [string]$Message, + [string]$ErrCode, + [string]$SourcePath, + [string]$LineNumber, + [string]$ColumnNumber, + [switch]$AsOutput) + + $command = Format-LoggingCommand -Area 'task' -Event 'logissue' -Data $Message -Properties @{ + 'type' = $Type + 'code' = $ErrCode + 'sourcepath' = $SourcePath + 'linenumber' = $LineNumber + 'columnnumber' = $ColumnNumber + } + if ($AsOutput) { + return $command + } + + if ($Type -eq 'error') { + $foregroundColor = $host.PrivateData.ErrorForegroundColor + $backgroundColor = $host.PrivateData.ErrorBackgroundColor + if ($foregroundColor -isnot [System.ConsoleColor] -or $backgroundColor -isnot [System.ConsoleColor]) { + $foregroundColor = [System.ConsoleColor]::Red + $backgroundColor = [System.ConsoleColor]::Black + } + } else { + $foregroundColor = $host.PrivateData.WarningForegroundColor + $backgroundColor = $host.PrivateData.WarningBackgroundColor + if ($foregroundColor -isnot [System.ConsoleColor] -or $backgroundColor -isnot [System.ConsoleColor]) { + $foregroundColor = [System.ConsoleColor]::Yellow + $backgroundColor = [System.ConsoleColor]::Black + } + } + + Write-Host $command -ForegroundColor $foregroundColor -BackgroundColor $backgroundColor +} \ No newline at end of file diff --git a/eng/common/pipeline-logging-functions.sh b/eng/common/pipeline-logging-functions.sh new file mode 100755 index 0000000000..1c560a5061 --- /dev/null +++ b/eng/common/pipeline-logging-functions.sh @@ -0,0 +1,172 @@ +#!/usr/bin/env bash + +function Write-PipelineTelemetryError { + local telemetry_category='' + local function_args=() + local message='' + while [[ $# -gt 0 ]]; do + opt="$(echo "${1/#--/-}" | awk '{print tolower($0)}')" + case "$opt" in + -category|-c) + telemetry_category=$2 + shift + ;; + -*) + function_args+=("$1 $2") + shift + ;; + *) + message=$* + ;; + esac + shift + done + + if [[ "$ci" != true ]]; then + echo "$message" >&2 + return + fi + + message="(NETCORE_ENGINEERING_TELEMETRY=$telemetry_category) $message" + function_args+=("$message") + + Write-PipelineTaskError $function_args +} + +function Write-PipelineTaskError { + if [[ "$ci" != true ]]; then + echo "$@" >&2 + return + fi + + local message_type="error" + local sourcepath='' + local linenumber='' + local columnnumber='' + local error_code='' + + while [[ $# -gt 0 ]]; do + opt="$(echo "${1/#--/-}" | awk '{print tolower($0)}')" + case "$opt" in + -type|-t) + message_type=$2 + shift + ;; + -sourcepath|-s) + sourcepath=$2 + shift + ;; + -linenumber|-ln) + linenumber=$2 + shift + ;; + -columnnumber|-cn) + columnnumber=$2 + shift + ;; + -errcode|-e) + error_code=$2 + shift + ;; + *) + break + ;; + esac + + shift + done + + local message="##vso[task.logissue" + + message="$message type=$message_type" + + if [ -n "$sourcepath" ]; then + message="$message;sourcepath=$sourcepath" + fi + + if [ -n "$linenumber" ]; then + message="$message;linenumber=$linenumber" + fi + + if [ -n "$columnnumber" ]; then + message="$message;columnnumber=$columnnumber" + fi + + if [ -n "$error_code" ]; then + message="$message;code=$error_code" + fi + + message="$message]$*" + echo "$message" +} + +function Write-PipelineSetVariable { + if [[ "$ci" != true ]]; then + return + fi + + local name='' + local value='' + local secret=false + local as_output=false + local is_multi_job_variable=true + + while [[ $# -gt 0 ]]; do + opt="$(echo "${1/#--/-}" | awk '{print tolower($0)}')" + case "$opt" in + -name|-n) + name=$2 + shift + ;; + -value|-v) + value=$2 + shift + ;; + -secret|-s) + secret=true + ;; + -as_output|-a) + as_output=true + ;; + -is_multi_job_variable|-i) + is_multi_job_variable=$2 + shift + ;; + esac + shift + done + + value=${value/;/%3B} + value=${value/\\r/%0D} + value=${value/\\n/%0A} + value=${value/]/%5D} + + local message="##vso[task.setvariable variable=$name;isSecret=$secret;isOutput=$is_multi_job_variable]$value" + + if [[ "$as_output" == true ]]; then + $message + else + echo "$message" + fi +} + +function Write-PipelinePrependPath { + local prepend_path='' + + while [[ $# -gt 0 ]]; do + opt="$(echo "${1/#--/-}" | awk '{print tolower($0)}')" + case "$opt" in + -path|-p) + prepend_path=$2 + shift + ;; + esac + shift + done + + export PATH="$prepend_path:$PATH" + + if [[ "$ci" == true ]]; then + echo "##vso[task.prependpath]$prepend_path" + fi +} \ No newline at end of file diff --git a/eng/common/post-build/darc-gather-drop.ps1 b/eng/common/post-build/darc-gather-drop.ps1 new file mode 100644 index 0000000000..9cc2f1a009 --- /dev/null +++ b/eng/common/post-build/darc-gather-drop.ps1 @@ -0,0 +1,36 @@ +param( + [Parameter(Mandatory=$true)][string] $BarBuildId, # ID of the build which assets should be downloaded + [Parameter(Mandatory=$true)][string] $MaestroAccessToken, # Token used to access Maestro API + [Parameter(Mandatory=$true)][string] $DropLocation # Where the assets should be downloaded to +) + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 2.0 + +. $PSScriptRoot\..\tools.ps1 + +try { + Write-Host "Installing DARC ..." + + . $PSScriptRoot\..\darc-init.ps1 + $exitCode = $LASTEXITCODE + + if ($exitCode -ne 0) { + Write-PipelineTaskError "Something failed while running 'darc-init.ps1'. Check for errors above. Exiting now..." + ExitWithExitCode $exitCode + } + + darc gather-drop --non-shipping ` + --continue-on-error ` + --id $BarBuildId ` + --output-dir $DropLocation ` + --bar-uri https://maestro-prod.westus2.cloudapp.azure.com/ ` + --password $MaestroAccessToken ` + --latest-location +} +catch { + Write-Host $_ + Write-Host $_.Exception + Write-Host $_.ScriptStackTrace + ExitWithExitCode 1 +} diff --git a/eng/common/post-build/dotnetsymbol-init.ps1 b/eng/common/post-build/dotnetsymbol-init.ps1 new file mode 100644 index 0000000000..e7659b98c8 --- /dev/null +++ b/eng/common/post-build/dotnetsymbol-init.ps1 @@ -0,0 +1,29 @@ +param ( + $dotnetsymbolVersion = $null +) + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 2.0 + +. $PSScriptRoot\..\tools.ps1 + +$verbosity = "minimal" + +function Installdotnetsymbol ($dotnetsymbolVersion) { + $dotnetsymbolPackageName = "dotnet-symbol" + + $dotnetRoot = InitializeDotNetCli -install:$true + $dotnet = "$dotnetRoot\dotnet.exe" + $toolList = & "$dotnet" tool list --global + + if (($toolList -like "*$dotnetsymbolPackageName*") -and ($toolList -like "*$dotnetsymbolVersion*")) { + Write-Host "dotnet-symbol version $dotnetsymbolVersion is already installed." + } + else { + Write-Host "Installing dotnet-symbol version $dotnetsymbolVersion..." + Write-Host "You may need to restart your command window if this is the first dotnet tool you have installed." + & "$dotnet" tool install $dotnetsymbolPackageName --version $dotnetsymbolVersion --verbosity $verbosity --global + } +} + +Installdotnetsymbol $dotnetsymbolVersion diff --git a/eng/common/post-build/nuget-validation.ps1 b/eng/common/post-build/nuget-validation.ps1 new file mode 100644 index 0000000000..1bdced1e30 --- /dev/null +++ b/eng/common/post-build/nuget-validation.ps1 @@ -0,0 +1,28 @@ +# This script validates NuGet package metadata information using this +# tool: https://github.com/NuGet/NuGetGallery/tree/jver-verify/src/VerifyMicrosoftPackage + +param( + [Parameter(Mandatory=$true)][string] $PackagesPath, # Path to where the packages to be validated are + [Parameter(Mandatory=$true)][string] $ToolDestinationPath # Where the validation tool should be downloaded to +) + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 2.0 + +. $PSScriptRoot\..\tools.ps1 + +try { + $url = "https://raw.githubusercontent.com/NuGet/NuGetGallery/jver-verify/src/VerifyMicrosoftPackage/verify.ps1" + + New-Item -ItemType "directory" -Path ${ToolDestinationPath} -Force + + Invoke-WebRequest $url -OutFile ${ToolDestinationPath}\verify.ps1 + + & ${ToolDestinationPath}\verify.ps1 ${PackagesPath}\*.nupkg +} +catch { + Write-PipelineTaskError "NuGet package validation failed. Please check error logs." + Write-Host $_ + Write-Host $_.ScriptStackTrace + ExitWithExitCode 1 +} diff --git a/eng/common/post-build/promote-build.ps1 b/eng/common/post-build/promote-build.ps1 new file mode 100644 index 0000000000..84a608fa56 --- /dev/null +++ b/eng/common/post-build/promote-build.ps1 @@ -0,0 +1,53 @@ +param( + [Parameter(Mandatory=$true)][int] $BuildId, + [Parameter(Mandatory=$true)][int] $ChannelId, + [Parameter(Mandatory=$true)][string] $BarToken, + [string] $MaestroEndpoint = "https://maestro-prod.westus2.cloudapp.azure.com", + [string] $ApiVersion = "2019-01-16" +) + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 2.0 + +. $PSScriptRoot\..\tools.ps1 + +function Get-Headers([string]$accept, [string]$barToken) { + $headers = New-Object 'System.Collections.Generic.Dictionary[[String],[String]]' + $headers.Add('Accept',$accept) + $headers.Add('Authorization',"Bearer $barToken") + return $headers +} + +try { + $maestroHeaders = Get-Headers 'application/json' $BarToken + + # Get info about which channels the build has already been promoted to + $getBuildApiEndpoint = "$MaestroEndpoint/api/builds/${BuildId}?api-version=$ApiVersion" + $buildInfo = Invoke-WebRequest -Method Get -Uri $getBuildApiEndpoint -Headers $maestroHeaders | ConvertFrom-Json + + if (!$buildInfo) { + Write-Host "Build with BAR ID $BuildId was not found in BAR!" + ExitWithExitCode 1 + } + + # Find whether the build is already assigned to the channel or not + if ($buildInfo.channels) { + foreach ($channel in $buildInfo.channels) { + if ($channel.Id -eq $ChannelId) { + Write-Host "The build with BAR ID $BuildId is already on channel $ChannelId!" + ExitWithExitCode 0 + } + } + } + + Write-Host "Build not present in channel $ChannelId. Promoting build ... " + + $promoteBuildApiEndpoint = "$maestroEndpoint/api/channels/${ChannelId}/builds/${BuildId}?api-version=$ApiVersion" + Invoke-WebRequest -Method Post -Uri $promoteBuildApiEndpoint -Headers $maestroHeaders + Write-Host "done." +} +catch { + Write-Host "There was an error while trying to promote build '$BuildId' to channel '$ChannelId'" + Write-Host $_ + Write-Host $_.ScriptStackTrace +} diff --git a/eng/common/post-build/sourcelink-cli-init.ps1 b/eng/common/post-build/sourcelink-cli-init.ps1 new file mode 100644 index 0000000000..9eaa25b3b5 --- /dev/null +++ b/eng/common/post-build/sourcelink-cli-init.ps1 @@ -0,0 +1,29 @@ +param ( + $sourcelinkCliVersion = $null +) + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 2.0 + +. $PSScriptRoot\..\tools.ps1 + +$verbosity = "minimal" + +function InstallSourcelinkCli ($sourcelinkCliVersion) { + $sourcelinkCliPackageName = "sourcelink" + + $dotnetRoot = InitializeDotNetCli -install:$true + $dotnet = "$dotnetRoot\dotnet.exe" + $toolList = & "$dotnet" tool list --global + + if (($toolList -like "*$sourcelinkCliPackageName*") -and ($toolList -like "*$sourcelinkCliVersion*")) { + Write-Host "SourceLink CLI version $sourcelinkCliVersion is already installed." + } + else { + Write-Host "Installing SourceLink CLI version $sourcelinkCliVersion..." + Write-Host "You may need to restart your command window if this is the first dotnet tool you have installed." + & "$dotnet" tool install $sourcelinkCliPackageName --version $sourcelinkCliVersion --verbosity $verbosity --global + } +} + +InstallSourcelinkCli $sourcelinkCliVersion diff --git a/eng/common/post-build/sourcelink-validation.ps1 b/eng/common/post-build/sourcelink-validation.ps1 new file mode 100644 index 0000000000..8abd684e9e --- /dev/null +++ b/eng/common/post-build/sourcelink-validation.ps1 @@ -0,0 +1,224 @@ +param( + [Parameter(Mandatory=$true)][string] $InputPath, # Full path to directory where Symbols.NuGet packages to be checked are stored + [Parameter(Mandatory=$true)][string] $ExtractPath, # Full path to directory where the packages will be extracted during validation + [Parameter(Mandatory=$true)][string] $GHRepoName, # GitHub name of the repo including the Org. E.g., dotnet/arcade + [Parameter(Mandatory=$true)][string] $GHCommit, # GitHub commit SHA used to build the packages + [Parameter(Mandatory=$true)][string] $SourcelinkCliVersion # Version of SourceLink CLI to use +) + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 2.0 + +. $PSScriptRoot\..\tools.ps1 + +# Cache/HashMap (File -> Exist flag) used to consult whether a file exist +# in the repository at a specific commit point. This is populated by inserting +# all files present in the repo at a specific commit point. +$global:RepoFiles = @{} + +$ValidatePackage = { + param( + [string] $PackagePath # Full path to a Symbols.NuGet package + ) + + . $using:PSScriptRoot\..\tools.ps1 + + # Ensure input file exist + if (!(Test-Path $PackagePath)) { + Write-PipelineTaskError "Input file does not exist: $PackagePath" + ExitWithExitCode 1 + } + + # Extensions for which we'll look for SourceLink information + # For now we'll only care about Portable & Embedded PDBs + $RelevantExtensions = @(".dll", ".exe", ".pdb") + + Write-Host -NoNewLine "Validating" ([System.IO.Path]::GetFileName($PackagePath)) "... " + + $PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath) + $ExtractPath = Join-Path -Path $using:ExtractPath -ChildPath $PackageId + $FailedFiles = 0 + + Add-Type -AssemblyName System.IO.Compression.FileSystem + + [System.IO.Directory]::CreateDirectory($ExtractPath); + + try { + $zip = [System.IO.Compression.ZipFile]::OpenRead($PackagePath) + + $zip.Entries | + Where-Object {$RelevantExtensions -contains [System.IO.Path]::GetExtension($_.Name)} | + ForEach-Object { + $FileName = $_.FullName + $Extension = [System.IO.Path]::GetExtension($_.Name) + $FakeName = -Join((New-Guid), $Extension) + $TargetFile = Join-Path -Path $ExtractPath -ChildPath $FakeName + + # We ignore resource DLLs + if ($FileName.EndsWith(".resources.dll")) { + return + } + + [System.IO.Compression.ZipFileExtensions]::ExtractToFile($_, $TargetFile, $true) + + $ValidateFile = { + param( + [string] $FullPath, # Full path to the module that has to be checked + [string] $RealPath, + [ref] $FailedFiles + ) + + $sourcelinkExe = "$env:USERPROFILE\.dotnet\tools" + $sourcelinkExe = Resolve-Path "$sourcelinkExe\sourcelink.exe" + $SourceLinkInfos = & $sourcelinkExe print-urls $FullPath | Out-String + + if ($LASTEXITCODE -eq 0 -and -not ([string]::IsNullOrEmpty($SourceLinkInfos))) { + $NumFailedLinks = 0 + + # We only care about Http addresses + $Matches = (Select-String '(http[s]?)(:\/\/)([^\s,]+)' -Input $SourceLinkInfos -AllMatches).Matches + + if ($Matches.Count -ne 0) { + $Matches.Value | + ForEach-Object { + $Link = $_ + $CommitUrl = "https://raw.githubusercontent.com/${using:GHRepoName}/${using:GHCommit}/" + + $FilePath = $Link.Replace($CommitUrl, "") + $Status = 200 + $Cache = $using:RepoFiles + + if ( !($Cache.ContainsKey($FilePath)) ) { + try { + $Uri = $Link -as [System.URI] + + # Only GitHub links are valid + if ($Uri.AbsoluteURI -ne $null -and ($Uri.Host -match "github" -or $Uri.Host -match "githubusercontent")) { + $Status = (Invoke-WebRequest -Uri $Link -UseBasicParsing -Method HEAD -TimeoutSec 5).StatusCode + } + else { + $Status = 0 + } + } + catch { + write-host $_ + $Status = 0 + } + } + + if ($Status -ne 200) { + if ($NumFailedLinks -eq 0) { + if ($FailedFiles.Value -eq 0) { + Write-Host + } + + Write-Host "`tFile $RealPath has broken links:" + } + + Write-Host "`t`tFailed to retrieve $Link" + + $NumFailedLinks++ + } + } + } + + if ($NumFailedLinks -ne 0) { + $FailedFiles.value++ + $global:LASTEXITCODE = 1 + } + } + } + + &$ValidateFile $TargetFile $FileName ([ref]$FailedFiles) + } + } + catch { + + } + finally { + $zip.Dispose() + } + + if ($FailedFiles -eq 0) { + Write-Host "Passed." + } + else { + Write-PipelineTaskError "$PackagePath has broken SourceLink links." + } +} + +function ValidateSourceLinkLinks { + if (!($GHRepoName -Match "^[^\s\/]+/[^\s\/]+$")) { + if (!($GHRepoName -Match "^[^\s-]+-[^\s]+$")) { + Write-PipelineTaskError "GHRepoName should be in the format / or -" + ExitWithExitCode 1 + } + else { + $GHRepoName = $GHRepoName -replace '^([^\s-]+)-([^\s]+)$', '$1/$2'; + } + } + + if (!($GHCommit -Match "^[0-9a-fA-F]{40}$")) { + Write-PipelineTaskError "GHCommit should be a 40 chars hexadecimal string" + ExitWithExitCode 1 + } + + $RepoTreeURL = -Join("http://api.github.com/repos/", $GHRepoName, "/git/trees/", $GHCommit, "?recursive=1") + $CodeExtensions = @(".cs", ".vb", ".fs", ".fsi", ".fsx", ".fsscript") + + try { + # Retrieve the list of files in the repo at that particular commit point and store them in the RepoFiles hash + $Data = Invoke-WebRequest $RepoTreeURL -UseBasicParsing | ConvertFrom-Json | Select-Object -ExpandProperty tree + + foreach ($file in $Data) { + $Extension = [System.IO.Path]::GetExtension($file.path) + + if ($CodeExtensions.Contains($Extension)) { + $RepoFiles[$file.path] = 1 + } + } + } + catch { + Write-PipelineTaskError "Problems downloading the list of files from the repo. Url used: $RepoTreeURL" + Write-Host $_ + ExitWithExitCode 1 + } + + if (Test-Path $ExtractPath) { + Remove-Item $ExtractPath -Force -Recurse -ErrorAction SilentlyContinue + } + + # Process each NuGet package in parallel + $Jobs = @() + Get-ChildItem "$InputPath\*.symbols.nupkg" | + ForEach-Object { + $Jobs += Start-Job -ScriptBlock $ValidatePackage -ArgumentList $_.FullName + } + + foreach ($Job in $Jobs) { + Wait-Job -Id $Job.Id | Receive-Job + } +} + +function CheckExitCode ([string]$stage) { + $exitCode = $LASTEXITCODE + if ($exitCode -ne 0) { + Write-PipelineTaskError "Something failed while '$stage'. Check for errors above. Exiting now..." + ExitWithExitCode $exitCode + } +} + +try { + Write-Host "Installing SourceLink CLI..." + Get-Location + . $PSScriptRoot\sourcelink-cli-init.ps1 -sourcelinkCliVersion $SourcelinkCliVersion + CheckExitCode "Running sourcelink-cli-init" + + Measure-Command { ValidateSourceLinkLinks } +} +catch { + Write-Host $_ + Write-Host $_.Exception + Write-Host $_.ScriptStackTrace + ExitWithExitCode 1 +} diff --git a/eng/common/post-build/symbols-validation.ps1 b/eng/common/post-build/symbols-validation.ps1 new file mode 100644 index 0000000000..69456854e0 --- /dev/null +++ b/eng/common/post-build/symbols-validation.ps1 @@ -0,0 +1,186 @@ +param( + [Parameter(Mandatory=$true)][string] $InputPath, # Full path to directory where NuGet packages to be checked are stored + [Parameter(Mandatory=$true)][string] $ExtractPath, # Full path to directory where the packages will be extracted during validation + [Parameter(Mandatory=$true)][string] $DotnetSymbolVersion # Version of dotnet symbol to use +) + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 2.0 + +. $PSScriptRoot\..\tools.ps1 + +Add-Type -AssemblyName System.IO.Compression.FileSystem + +function FirstMatchingSymbolDescriptionOrDefault { + param( + [string] $FullPath, # Full path to the module that has to be checked + [string] $TargetServerParam, # Parameter to pass to `Symbol Tool` indicating the server to lookup for symbols + [string] $SymbolsPath + ) + + $FileName = [System.IO.Path]::GetFileName($FullPath) + $Extension = [System.IO.Path]::GetExtension($FullPath) + + # Those below are potential symbol files that the `dotnet symbol` might + # return. Which one will be returned depend on the type of file we are + # checking and which type of file was uploaded. + + # The file itself is returned + $SymbolPath = $SymbolsPath + "\" + $FileName + + # PDB file for the module + $PdbPath = $SymbolPath.Replace($Extension, ".pdb") + + # PDB file for R2R module (created by crossgen) + $NGenPdb = $SymbolPath.Replace($Extension, ".ni.pdb") + + # DBG file for a .so library + $SODbg = $SymbolPath.Replace($Extension, ".so.dbg") + + # DWARF file for a .dylib + $DylibDwarf = $SymbolPath.Replace($Extension, ".dylib.dwarf") + + $dotnetsymbolExe = "$env:USERPROFILE\.dotnet\tools" + $dotnetsymbolExe = Resolve-Path "$dotnetsymbolExe\dotnet-symbol.exe" + + & $dotnetsymbolExe --symbols --modules --windows-pdbs $TargetServerParam $FullPath -o $SymbolsPath | Out-Null + + if (Test-Path $PdbPath) { + return "PDB" + } + elseif (Test-Path $NGenPdb) { + return "NGen PDB" + } + elseif (Test-Path $SODbg) { + return "DBG for SO" + } + elseif (Test-Path $DylibDwarf) { + return "Dwarf for Dylib" + } + elseif (Test-Path $SymbolPath) { + return "Module" + } + else { + return $null + } +} + +function CountMissingSymbols { + param( + [string] $PackagePath # Path to a NuGet package + ) + + # Ensure input file exist + if (!(Test-Path $PackagePath)) { + Write-PipelineTaskError "Input file does not exist: $PackagePath" + ExitWithExitCode 1 + } + + # Extensions for which we'll look for symbols + $RelevantExtensions = @(".dll", ".exe", ".so", ".dylib") + + # How many files are missing symbol information + $MissingSymbols = 0 + + $PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath) + $PackageGuid = New-Guid + $ExtractPath = Join-Path -Path $ExtractPath -ChildPath $PackageGuid + $SymbolsPath = Join-Path -Path $ExtractPath -ChildPath "Symbols" + + [System.IO.Compression.ZipFile]::ExtractToDirectory($PackagePath, $ExtractPath) + + Get-ChildItem -Recurse $ExtractPath | + Where-Object {$RelevantExtensions -contains $_.Extension} | + ForEach-Object { + if ($_.FullName -Match "\\ref\\") { + Write-Host "`t Ignoring reference assembly file" $_.FullName + return + } + + $SymbolsOnMSDL = FirstMatchingSymbolDescriptionOrDefault $_.FullName "--microsoft-symbol-server" $SymbolsPath + $SymbolsOnSymWeb = FirstMatchingSymbolDescriptionOrDefault $_.FullName "--internal-server" $SymbolsPath + + Write-Host -NoNewLine "`t Checking file" $_.FullName "... " + + if ($SymbolsOnMSDL -ne $null -and $SymbolsOnSymWeb -ne $null) { + Write-Host "Symbols found on MSDL (" $SymbolsOnMSDL ") and SymWeb (" $SymbolsOnSymWeb ")" + } + else { + $MissingSymbols++ + + if ($SymbolsOnMSDL -eq $null -and $SymbolsOnSymWeb -eq $null) { + Write-Host "No symbols found on MSDL or SymWeb!" + } + else { + if ($SymbolsOnMSDL -eq $null) { + Write-Host "No symbols found on MSDL!" + } + else { + Write-Host "No symbols found on SymWeb!" + } + } + } + } + + Pop-Location + + return $MissingSymbols +} + +function CheckSymbolsAvailable { + if (Test-Path $ExtractPath) { + Remove-Item $ExtractPath -Force -Recurse -ErrorAction SilentlyContinue + } + + Get-ChildItem "$InputPath\*.nupkg" | + ForEach-Object { + $FileName = $_.Name + + # These packages from Arcade-Services include some native libraries that + # our current symbol uploader can't handle. Below is a workaround until + # we get issue: https://github.com/dotnet/arcade/issues/2457 sorted. + if ($FileName -Match "Microsoft\.DotNet\.Darc\.") { + Write-Host "Ignoring Arcade-services file: $FileName" + Write-Host + return + } + elseif ($FileName -Match "Microsoft\.DotNet\.Maestro\.Tasks\.") { + Write-Host "Ignoring Arcade-services file: $FileName" + Write-Host + return + } + + Write-Host "Validating $FileName " + $Status = CountMissingSymbols "$InputPath\$FileName" + + if ($Status -ne 0) { + Write-PipelineTaskError "Missing symbols for $Status modules in the package $FileName" + ExitWithExitCode $exitCode + } + + Write-Host + } +} + +function CheckExitCode ([string]$stage) { + $exitCode = $LASTEXITCODE + if ($exitCode -ne 0) { + Write-PipelineTaskError "Something failed while '$stage'. Check for errors above. Exiting now..." + ExitWithExitCode $exitCode + } +} + +try { + Write-Host "Installing dotnet symbol ..." + Get-Location + . $PSScriptRoot\dotnetsymbol-init.ps1 -dotnetsymbolVersion $DotnetSymbolVersion + CheckExitCode "Running dotnetsymbol-init" + + CheckSymbolsAvailable +} +catch { + Write-Host $_ + Write-Host $_.Exception + Write-Host $_.ScriptStackTrace + ExitWithExitCode 1 +} diff --git a/eng/common/post-build/trigger-subscriptions.ps1 b/eng/common/post-build/trigger-subscriptions.ps1 new file mode 100644 index 0000000000..1a91dab037 --- /dev/null +++ b/eng/common/post-build/trigger-subscriptions.ps1 @@ -0,0 +1,69 @@ +param( + [Parameter(Mandatory=$true)][string] $SourceRepo, + [Parameter(Mandatory=$true)][int] $ChannelId, + [string] $MaestroEndpoint = "https://maestro-prod.westus2.cloudapp.azure.com", + [string] $BarToken, + [string] $ApiVersion = "2019-01-16" +) + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 2.0 + +. $PSScriptRoot\..\tools.ps1 + +function Get-Headers([string]$accept, [string]$barToken) { + $headers = New-Object 'System.Collections.Generic.Dictionary[[String],[String]]' + $headers.Add('Accept',$accept) + $headers.Add('Authorization',"Bearer $barToken") + return $headers +} + +# Get all the $SourceRepo subscriptions +$normalizedSourceRepo = $SourceRepo.Replace('dnceng@', '') +$getSubscriptionsApiEndpoint = "$maestroEndpoint/api/subscriptions?sourceRepository=$normalizedSourceRepo&api-version=$apiVersion" +$headers = Get-Headers 'application/json' $barToken + +$subscriptions = Invoke-WebRequest -Uri $getSubscriptionsApiEndpoint -Headers $headers | ConvertFrom-Json + +if (!$subscriptions) { + Write-Host "No subscriptions found for source repo '$normalizedSourceRepo' in channel '$ChannelId'" + return +} + +$subscriptionsToTrigger = New-Object System.Collections.Generic.List[string] +$failedTriggeredSubscription = $false + +# Get all enabled subscriptions that need dependency flow on 'everyBuild' +foreach ($subscription in $subscriptions) { + if ($subscription.enabled -and $subscription.policy.updateFrequency -like 'everyBuild' -and $subscription.channel.id -eq $ChannelId) { + Write-Host "$subscription.id" + [void]$subscriptionsToTrigger.Add($subscription.id) + } +} + +foreach ($subscriptionToTrigger in $subscriptionsToTrigger) { + try { + $triggerSubscriptionApiEndpoint = "$maestroEndpoint/api/subscriptions/$subscriptionToTrigger/trigger?api-version=$apiVersion" + $headers = Get-Headers 'application/json' $BarToken + + Write-Host "Triggering subscription '$subscriptionToTrigger'..." + + Invoke-WebRequest -Uri $triggerSubscriptionApiEndpoint -Headers $headers -Method Post + + Write-Host "Subscription '$subscriptionToTrigger' triggered!" + } + catch + { + Write-Host "There was an error while triggering subscription '$subscriptionToTrigger'" + Write-Host $_ + Write-Host $_.ScriptStackTrace + $failedTriggeredSubscription = $true + } +} + +if ($failedTriggeredSubscription) { + Write-Host "At least one subscription failed to be triggered..." + ExitWithExitCode 1 +} + +Write-Host "All subscriptions were triggered successfully!" diff --git a/eng/common/sdl/NuGet.config b/eng/common/sdl/NuGet.config new file mode 100644 index 0000000000..0c5451c114 --- /dev/null +++ b/eng/common/sdl/NuGet.config @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/eng/common/sdl/execute-all-sdl-tools.ps1 b/eng/common/sdl/execute-all-sdl-tools.ps1 new file mode 100644 index 0000000000..aab7589f2c --- /dev/null +++ b/eng/common/sdl/execute-all-sdl-tools.ps1 @@ -0,0 +1,99 @@ +Param( + [string] $GuardianPackageName, # Required: the name of guardian CLI package (not needed if GuardianCliLocation is specified) + [string] $NugetPackageDirectory, # Required: directory where NuGet packages are installed (not needed if GuardianCliLocation is specified) + [string] $GuardianCliLocation, # Optional: Direct location of Guardian CLI executable if GuardianPackageName & NugetPackageDirectory are not specified + [string] $Repository=$env:BUILD_REPOSITORY_NAME, # Required: the name of the repository (e.g. dotnet/arcade) + [string] $BranchName=$env:BUILD_SOURCEBRANCH, # Optional: name of branch or version of gdn settings; defaults to master + [string] $SourceDirectory=$env:BUILD_SOURCESDIRECTORY, # Required: the directory where source files are located + [string] $ArtifactsDirectory = (Join-Path $env:BUILD_SOURCESDIRECTORY ("artifacts")), # Required: the directory where build artifacts are located + [string] $AzureDevOpsAccessToken, # Required: access token for dnceng; should be provided via KeyVault + [string[]] $SourceToolsList, # Optional: list of SDL tools to run on source code + [string[]] $ArtifactToolsList, # Optional: list of SDL tools to run on built artifacts + [bool] $TsaPublish=$False, # Optional: true will publish results to TSA; only set to true after onboarding to TSA; TSA is the automated framework used to upload test results as bugs. + [string] $TsaBranchName=$env:BUILD_SOURCEBRANCH, # Optional: required for TSA publish; defaults to $(Build.SourceBranchName); TSA is the automated framework used to upload test results as bugs. + [string] $TsaRepositoryName=$env:BUILD_REPOSITORY_NAME, # Optional: TSA repository name; will be generated automatically if not submitted; TSA is the automated framework used to upload test results as bugs. + [string] $BuildNumber=$env:BUILD_BUILDNUMBER, # Optional: required for TSA publish; defaults to $(Build.BuildNumber) + [bool] $UpdateBaseline=$False, # Optional: if true, will update the baseline in the repository; should only be run after fixing any issues which need to be fixed + [bool] $TsaOnboard=$False, # Optional: if true, will onboard the repository to TSA; should only be run once; TSA is the automated framework used to upload test results as bugs. + [string] $TsaInstanceUrl, # Optional: only needed if TsaOnboard or TsaPublish is true; the instance-url registered with TSA; TSA is the automated framework used to upload test results as bugs. + [string] $TsaCodebaseName, # Optional: only needed if TsaOnboard or TsaPublish is true; the name of the codebase registered with TSA; TSA is the automated framework used to upload test results as bugs. + [string] $TsaProjectName, # Optional: only needed if TsaOnboard or TsaPublish is true; the name of the project registered with TSA; TSA is the automated framework used to upload test results as bugs. + [string] $TsaNotificationEmail, # Optional: only needed if TsaOnboard is true; the email(s) which will receive notifications of TSA bug filings (e.g. alias@microsoft.com); TSA is the automated framework used to upload test results as bugs. + [string] $TsaCodebaseAdmin, # Optional: only needed if TsaOnboard is true; the aliases which are admins of the TSA codebase (e.g. DOMAIN\alias); TSA is the automated framework used to upload test results as bugs. + [string] $TsaBugAreaPath, # Optional: only needed if TsaOnboard is true; the area path where TSA will file bugs in AzDO; TSA is the automated framework used to upload test results as bugs. + [string] $TsaIterationPath, # Optional: only needed if TsaOnboard is true; the iteration path where TSA will file bugs in AzDO; TSA is the automated framework used to upload test results as bugs. + [string] $GuardianLoggerLevel="Standard", # Optional: the logger level for the Guardian CLI; options are Trace, Verbose, Standard, Warning, and Error + [string[]] $CrScanAdditionalRunConfigParams, # Optional: Additional Params to custom build a CredScan run config in the format @("xyz:abc","sdf:1") + [string[]] $PoliCheckAdditionalRunConfigParams # Optional: Additional Params to custom build a Policheck run config in the format @("xyz:abc","sdf:1") +) + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 2.0 +$LASTEXITCODE = 0 + +#Replace repo names to the format of org/repo +if (!($Repository.contains('/'))) { + $RepoName = $Repository -replace '(.*?)-(.*)', '$1/$2'; +} +else{ + $RepoName = $Repository; +} + +if ($GuardianPackageName) { + $guardianCliLocation = Join-Path $NugetPackageDirectory (Join-Path $GuardianPackageName (Join-Path "tools" "guardian.cmd")) +} else { + $guardianCliLocation = $GuardianCliLocation +} + +$ValidPath = Test-Path $guardianCliLocation + +if ($ValidPath -eq $False) +{ + Write-Host "Invalid Guardian CLI Location." + exit 1 +} + +& $(Join-Path $PSScriptRoot "init-sdl.ps1") -GuardianCliLocation $guardianCliLocation -Repository $RepoName -BranchName $BranchName -WorkingDirectory $ArtifactsDirectory -AzureDevOpsAccessToken $AzureDevOpsAccessToken -GuardianLoggerLevel $GuardianLoggerLevel +$gdnFolder = Join-Path $ArtifactsDirectory ".gdn" + +if ($TsaOnboard) { + if ($TsaCodebaseName -and $TsaNotificationEmail -and $TsaCodebaseAdmin -and $TsaBugAreaPath) { + Write-Host "$guardianCliLocation tsa-onboard --codebase-name `"$TsaCodebaseName`" --notification-alias `"$TsaNotificationEmail`" --codebase-admin `"$TsaCodebaseAdmin`" --instance-url `"$TsaInstanceUrl`" --project-name `"$TsaProjectName`" --area-path `"$TsaBugAreaPath`" --iteration-path `"$TsaIterationPath`" --working-directory $ArtifactsDirectory --logger-level $GuardianLoggerLevel" + & $guardianCliLocation tsa-onboard --codebase-name "$TsaCodebaseName" --notification-alias "$TsaNotificationEmail" --codebase-admin "$TsaCodebaseAdmin" --instance-url "$TsaInstanceUrl" --project-name "$TsaProjectName" --area-path "$TsaBugAreaPath" --iteration-path "$TsaIterationPath" --working-directory $ArtifactsDirectory --logger-level $GuardianLoggerLevel + if ($LASTEXITCODE -ne 0) { + Write-Host "Guardian tsa-onboard failed with exit code $LASTEXITCODE." + exit $LASTEXITCODE + } + } else { + Write-Host "Could not onboard to TSA -- not all required values ($$TsaCodebaseName, $$TsaNotificationEmail, $$TsaCodebaseAdmin, $$TsaBugAreaPath) were specified." + exit 1 + } +} + +if ($ArtifactToolsList -and $ArtifactToolsList.Count -gt 0) { + & $(Join-Path $PSScriptRoot "run-sdl.ps1") -GuardianCliLocation $guardianCliLocation -WorkingDirectory $ArtifactsDirectory -TargetDirectory $ArtifactsDirectory -GdnFolder $gdnFolder -ToolsList $ArtifactToolsList -AzureDevOpsAccessToken $AzureDevOpsAccessToken -UpdateBaseline $UpdateBaseline -GuardianLoggerLevel $GuardianLoggerLevel -CrScanAdditionalRunConfigParams $CrScanAdditionalRunConfigParams -PoliCheckAdditionalRunConfigParams $PoliCheckAdditionalRunConfigParams +} +if ($SourceToolsList -and $SourceToolsList.Count -gt 0) { + & $(Join-Path $PSScriptRoot "run-sdl.ps1") -GuardianCliLocation $guardianCliLocation -WorkingDirectory $ArtifactsDirectory -TargetDirectory $SourceDirectory -GdnFolder $gdnFolder -ToolsList $SourceToolsList -AzureDevOpsAccessToken $AzureDevOpsAccessToken -UpdateBaseline $UpdateBaseline -GuardianLoggerLevel $GuardianLoggerLevel -CrScanAdditionalRunConfigParams $CrScanAdditionalRunConfigParams -PoliCheckAdditionalRunConfigParams $PoliCheckAdditionalRunConfigParams +} + +if ($UpdateBaseline) { + & (Join-Path $PSScriptRoot "push-gdn.ps1") -Repository $RepoName -BranchName $BranchName -GdnFolder $GdnFolder -AzureDevOpsAccessToken $AzureDevOpsAccessToken -PushReason "Update baseline" +} + +if ($TsaPublish) { + if ($TsaBranchName -and $BuildNumber) { + if (-not $TsaRepositoryName) { + $TsaRepositoryName = "$($Repository)-$($BranchName)" + } + Write-Host "$guardianCliLocation tsa-publish --all-tools --repository-name `"$TsaRepositoryName`" --branch-name `"$TsaBranchName`" --build-number `"$BuildNumber`" --codebase-name `"$TsaCodebaseName`" --notification-alias `"$TsaNotificationEmail`" --codebase-admin `"$TsaCodebaseAdmin`" --instance-url `"$TsaInstanceUrl`" --project-name `"$TsaProjectName`" --area-path `"$TsaBugAreaPath`" --iteration-path `"$TsaIterationPath`" --working-directory $SourceDirectory --logger-level $GuardianLoggerLevel" + & $guardianCliLocation tsa-publish --all-tools --repository-name "$TsaRepositoryName" --branch-name "$TsaBranchName" --build-number "$BuildNumber" --codebase-name "$TsaCodebaseName" --notification-alias "$TsaNotificationEmail" --codebase-admin "$TsaCodebaseAdmin" --instance-url "$TsaInstanceUrl" --project-name "$TsaProjectName" --area-path "$TsaBugAreaPath" --iteration-path "$TsaIterationPath" --working-directory $ArtifactsDirectory --logger-level $GuardianLoggerLevel + if ($LASTEXITCODE -ne 0) { + Write-Host "Guardian tsa-publish failed with exit code $LASTEXITCODE." + exit $LASTEXITCODE + } + } else { + Write-Host "Could not publish to TSA -- not all required values ($$TsaBranchName, $$BuildNumber) were specified." + exit 1 + } +} diff --git a/eng/common/sdl/extract-artifact-packages.ps1 b/eng/common/sdl/extract-artifact-packages.ps1 new file mode 100644 index 0000000000..1fdbb14329 --- /dev/null +++ b/eng/common/sdl/extract-artifact-packages.ps1 @@ -0,0 +1,70 @@ +param( + [Parameter(Mandatory=$true)][string] $InputPath, # Full path to directory where artifact packages are stored + [Parameter(Mandatory=$true)][string] $ExtractPath # Full path to directory where the packages will be extracted +) + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 2.0 +$ExtractPackage = { + param( + [string] $PackagePath # Full path to a NuGet package + ) + + if (!(Test-Path $PackagePath)) { + Write-PipelineTaskError "Input file does not exist: $PackagePath" + ExitWithExitCode 1 + } + + $RelevantExtensions = @(".dll", ".exe", ".pdb") + Write-Host -NoNewLine "Extracting" ([System.IO.Path]::GetFileName($PackagePath)) "... " + + $PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath) + $ExtractPath = Join-Path -Path $using:ExtractPath -ChildPath $PackageId + + Add-Type -AssemblyName System.IO.Compression.FileSystem + + [System.IO.Directory]::CreateDirectory($ExtractPath); + + try { + $zip = [System.IO.Compression.ZipFile]::OpenRead($PackagePath) + + $zip.Entries | + Where-Object {$RelevantExtensions -contains [System.IO.Path]::GetExtension($_.Name)} | + ForEach-Object { + $TargetFile = Join-Path -Path $ExtractPath -ChildPath $_.Name + + [System.IO.Compression.ZipFileExtensions]::ExtractToFile($_, $TargetFile, $true) + } + } + catch { + + } + finally { + $zip.Dispose() + } + } + function ExtractArtifacts { + if (!(Test-Path $InputPath)) { + Write-Host "Input Path does not exist: $InputPath" + ExitWithExitCode 0 + } + $Jobs = @() + Get-ChildItem "$InputPath\*.nupkg" | + ForEach-Object { + $Jobs += Start-Job -ScriptBlock $ExtractPackage -ArgumentList $_.FullName + } + + foreach ($Job in $Jobs) { + Wait-Job -Id $Job.Id | Receive-Job + } +} + +try { + Measure-Command { ExtractArtifacts } +} +catch { + Write-Host $_ + Write-Host $_.Exception + Write-Host $_.ScriptStackTrace + ExitWithExitCode 1 +} diff --git a/eng/common/sdl/init-sdl.ps1 b/eng/common/sdl/init-sdl.ps1 new file mode 100644 index 0000000000..26e01c0673 --- /dev/null +++ b/eng/common/sdl/init-sdl.ps1 @@ -0,0 +1,48 @@ +Param( + [string] $GuardianCliLocation, + [string] $Repository, + [string] $BranchName="master", + [string] $WorkingDirectory, + [string] $AzureDevOpsAccessToken, + [string] $GuardianLoggerLevel="Standard" +) + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 2.0 +$LASTEXITCODE = 0 + +# Construct basic auth from AzDO access token; construct URI to the repository's gdn folder stored in that repository; construct location of zip file +$encodedPat = [Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(":$AzureDevOpsAccessToken")) +$escapedRepository = [Uri]::EscapeDataString("/$Repository/$BranchName/.gdn") +$uri = "https://dev.azure.com/dnceng/internal/_apis/git/repositories/sdl-tool-cfg/Items?path=$escapedRepository&versionDescriptor[versionOptions]=0&`$format=zip&api-version=5.0-preview.1" +$zipFile = "$WorkingDirectory/gdn.zip" + +Add-Type -AssemblyName System.IO.Compression.FileSystem +$gdnFolder = (Join-Path $WorkingDirectory ".gdn") +Try +{ + # We try to download the zip; if the request fails (e.g. the file doesn't exist), we catch it and init guardian instead + Write-Host "Downloading gdn folder from internal config repostiory..." + Invoke-WebRequest -Headers @{ "Accept"="application/zip"; "Authorization"="Basic $encodedPat" } -Uri $uri -OutFile $zipFile + if (Test-Path $gdnFolder) { + # Remove the gdn folder if it exists (it shouldn't unless there's too much caching; this is just in case) + Remove-Item -Force -Recurse $gdnFolder + } + [System.IO.Compression.ZipFile]::ExtractToDirectory($zipFile, $WorkingDirectory) + Write-Host $gdnFolder +} Catch [System.Net.WebException] { + # if the folder does not exist, we'll do a guardian init and push it to the remote repository + Write-Host "Initializing Guardian..." + Write-Host "$GuardianCliLocation init --working-directory $WorkingDirectory --logger-level $GuardianLoggerLevel" + & $GuardianCliLocation init --working-directory $WorkingDirectory --logger-level $GuardianLoggerLevel + if ($LASTEXITCODE -ne 0) { + Write-Error "Guardian init failed with exit code $LASTEXITCODE." + } + # We create the mainbaseline so it can be edited later + Write-Host "$GuardianCliLocation baseline --working-directory $WorkingDirectory --name mainbaseline" + & $GuardianCliLocation baseline --working-directory $WorkingDirectory --name mainbaseline + if ($LASTEXITCODE -ne 0) { + Write-Error "Guardian baseline failed with exit code $LASTEXITCODE." + } + & $(Join-Path $PSScriptRoot "push-gdn.ps1") -Repository $Repository -BranchName $BranchName -GdnFolder $gdnFolder -AzureDevOpsAccessToken $AzureDevOpsAccessToken -PushReason "Initialize gdn folder" +} \ No newline at end of file diff --git a/eng/common/sdl/packages.config b/eng/common/sdl/packages.config new file mode 100644 index 0000000000..fb9b712863 --- /dev/null +++ b/eng/common/sdl/packages.config @@ -0,0 +1,4 @@ + + + + diff --git a/eng/common/sdl/push-gdn.ps1 b/eng/common/sdl/push-gdn.ps1 new file mode 100644 index 0000000000..79c707d6d8 --- /dev/null +++ b/eng/common/sdl/push-gdn.ps1 @@ -0,0 +1,51 @@ +Param( + [string] $Repository, + [string] $BranchName="master", + [string] $GdnFolder, + [string] $AzureDevOpsAccessToken, + [string] $PushReason +) + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 2.0 +$LASTEXITCODE = 0 + +# We create the temp directory where we'll store the sdl-config repository +$sdlDir = Join-Path $env:TEMP "sdl" +if (Test-Path $sdlDir) { + Remove-Item -Force -Recurse $sdlDir +} + +Write-Host "git clone https://dnceng:`$AzureDevOpsAccessToken@dev.azure.com/dnceng/internal/_git/sdl-tool-cfg $sdlDir" +git clone https://dnceng:$AzureDevOpsAccessToken@dev.azure.com/dnceng/internal/_git/sdl-tool-cfg $sdlDir +if ($LASTEXITCODE -ne 0) { + Write-Error "Git clone failed with exit code $LASTEXITCODE." +} +# We copy the .gdn folder from our local run into the git repository so it can be committed +$sdlRepositoryFolder = Join-Path (Join-Path (Join-Path $sdlDir $Repository) $BranchName) ".gdn" +if (Get-Command Robocopy) { + Robocopy /S $GdnFolder $sdlRepositoryFolder +} else { + rsync -r $GdnFolder $sdlRepositoryFolder +} +# cd to the sdl-config directory so we can run git there +Push-Location $sdlDir +# git add . --> git commit --> git push +Write-Host "git add ." +git add . +if ($LASTEXITCODE -ne 0) { + Write-Error "Git add failed with exit code $LASTEXITCODE." +} +Write-Host "git -c user.email=`"dn-bot@microsoft.com`" -c user.name=`"Dotnet Bot`" commit -m `"$PushReason for $Repository/$BranchName`"" +git -c user.email="dn-bot@microsoft.com" -c user.name="Dotnet Bot" commit -m "$PushReason for $Repository/$BranchName" +if ($LASTEXITCODE -ne 0) { + Write-Error "Git commit failed with exit code $LASTEXITCODE." +} +Write-Host "git push" +git push +if ($LASTEXITCODE -ne 0) { + Write-Error "Git push failed with exit code $LASTEXITCODE." +} + +# Return to the original directory +Pop-Location \ No newline at end of file diff --git a/eng/common/sdl/run-sdl.ps1 b/eng/common/sdl/run-sdl.ps1 new file mode 100644 index 0000000000..d7b8564458 --- /dev/null +++ b/eng/common/sdl/run-sdl.ps1 @@ -0,0 +1,67 @@ +Param( + [string] $GuardianCliLocation, + [string] $WorkingDirectory, + [string] $TargetDirectory, + [string] $GdnFolder, + [string[]] $ToolsList, + [string] $UpdateBaseline, + [string] $GuardianLoggerLevel="Standard", + [string[]] $CrScanAdditionalRunConfigParams, + [string[]] $PoliCheckAdditionalRunConfigParams +) + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 2.0 +$LASTEXITCODE = 0 + +# We store config files in the r directory of .gdn +Write-Host $ToolsList +$gdnConfigPath = Join-Path $GdnFolder "r" +$ValidPath = Test-Path $GuardianCliLocation + +if ($ValidPath -eq $False) +{ + Write-Host "Invalid Guardian CLI Location." + exit 1 +} + +foreach ($tool in $ToolsList) { + $gdnConfigFile = Join-Path $gdnConfigPath "$tool-configure.gdnconfig" + $config = $False + Write-Host $tool + # We have to manually configure tools that run on source to look at the source directory only + if ($tool -eq "credscan") { + Write-Host "$GuardianCliLocation configure --working-directory $WorkingDirectory --tool $tool --output-path $gdnConfigFile --logger-level $GuardianLoggerLevel --noninteractive --force --args `" TargetDirectory : $TargetDirectory `" $(If ($CrScanAdditionalRunConfigParams) {$CrScanAdditionalRunConfigParams})" + & $GuardianCliLocation configure --working-directory $WorkingDirectory --tool $tool --output-path $gdnConfigFile --logger-level $GuardianLoggerLevel --noninteractive --force --args " TargetDirectory : $TargetDirectory " $(If ($CrScanAdditionalRunConfigParams) {$CrScanAdditionalRunConfigParams}) + if ($LASTEXITCODE -ne 0) { + Write-Host "Guardian configure for $tool failed with exit code $LASTEXITCODE." + exit $LASTEXITCODE + } + $config = $True + } + if ($tool -eq "policheck") { + Write-Host "$GuardianCliLocation configure --working-directory $WorkingDirectory --tool $tool --output-path $gdnConfigFile --logger-level $GuardianLoggerLevel --noninteractive --force --args `" Target : $TargetDirectory `" $(If ($PoliCheckAdditionalRunConfigParams) {$PoliCheckAdditionalRunConfigParams})" + & $GuardianCliLocation configure --working-directory $WorkingDirectory --tool $tool --output-path $gdnConfigFile --logger-level $GuardianLoggerLevel --noninteractive --force --args " Target : $TargetDirectory " $(If ($PoliCheckAdditionalRunConfigParams) {$PoliCheckAdditionalRunConfigParams}) + if ($LASTEXITCODE -ne 0) { + Write-Host "Guardian configure for $tool failed with exit code $LASTEXITCODE." + exit $LASTEXITCODE + } + $config = $True + } + + Write-Host "$GuardianCliLocation run --working-directory $WorkingDirectory --tool $tool --baseline mainbaseline --update-baseline $UpdateBaseline --logger-level $GuardianLoggerLevel --config $gdnConfigFile $config" + if ($config) { + & $GuardianCliLocation run --working-directory $WorkingDirectory --tool $tool --baseline mainbaseline --update-baseline $UpdateBaseline --logger-level $GuardianLoggerLevel --config $gdnConfigFile + if ($LASTEXITCODE -ne 0) { + Write-Host "Guardian run for $tool using $gdnConfigFile failed with exit code $LASTEXITCODE." + exit $LASTEXITCODE + } + } else { + & $GuardianCliLocation run --working-directory $WorkingDirectory --tool $tool --baseline mainbaseline --update-baseline $UpdateBaseline --logger-level $GuardianLoggerLevel + if ($LASTEXITCODE -ne 0) { + Write-Host "Guardian run for $tool failed with exit code $LASTEXITCODE." + exit $LASTEXITCODE + } + } +} + diff --git a/eng/common/templates/job/execute-sdl.yml b/eng/common/templates/job/execute-sdl.yml new file mode 100644 index 0000000000..5837f3d56d --- /dev/null +++ b/eng/common/templates/job/execute-sdl.yml @@ -0,0 +1,54 @@ +parameters: + overrideParameters: '' # Optional: to override values for parameters. + additionalParameters: '' # Optional: parameters that need user specific values eg: '-SourceToolsList @("abc","def") -ArtifactToolsList @("ghi","jkl")' + continueOnError: false # optional: determines whether to continue the build if the step errors; + dependsOn: '' # Optional: dependencies of the job + +jobs: +- job: Run_SDL + dependsOn: ${{ parameters.dependsOn }} + displayName: Run SDL tool + variables: + - group: DotNet-VSTS-Bot + steps: + - checkout: self + clean: true + - task: DownloadBuildArtifacts@0 + displayName: Download Build Artifacts + inputs: + buildType: current + downloadType: specific files + matchingPattern: "**" + downloadPath: $(Build.SourcesDirectory)\artifacts + - powershell: eng/common/sdl/extract-artifact-packages.ps1 + -InputPath $(Build.SourcesDirectory)\artifacts\BlobArtifacts + -ExtractPath $(Build.SourcesDirectory)\artifacts\BlobArtifacts + displayName: Extract Blob Artifacts + continueOnError: ${{ parameters.continueOnError }} + - powershell: eng/common/sdl/extract-artifact-packages.ps1 + -InputPath $(Build.SourcesDirectory)\artifacts\PackageArtifacts + -ExtractPath $(Build.SourcesDirectory)\artifacts\PackageArtifacts + displayName: Extract Package Artifacts + continueOnError: ${{ parameters.continueOnError }} + - task: NuGetToolInstaller@1 + displayName: 'Install NuGet.exe' + - task: NuGetCommand@2 + displayName: 'Install Guardian' + inputs: + restoreSolution: $(Build.SourcesDirectory)\eng\common\sdl\packages.config + feedsToUse: config + nugetConfigPath: $(Build.SourcesDirectory)\eng\common\sdl\NuGet.config + externalFeedCredentials: GuardianConnect + restoreDirectory: $(Build.SourcesDirectory)\.packages + - ${{ if ne(parameters.overrideParameters, '') }}: + - powershell: eng/common/sdl/execute-all-sdl-tools.ps1 ${{ parameters.overrideParameters }} + displayName: Execute SDL + continueOnError: ${{ parameters.continueOnError }} + - ${{ if eq(parameters.overrideParameters, '') }}: + - powershell: eng/common/sdl/execute-all-sdl-tools.ps1 + -GuardianPackageName Microsoft.Guardian.Cli.0.6.0 + -NugetPackageDirectory $(Build.SourcesDirectory)\.packages + -AzureDevOpsAccessToken $(dn-bot-dotnet-build-rw-code-rw) + ${{ parameters.additionalParameters }} + displayName: Execute SDL + continueOnError: ${{ parameters.continueOnError }} diff --git a/eng/common/templates/job/performance.yml b/eng/common/templates/job/performance.yml new file mode 100644 index 0000000000..ef809253d1 --- /dev/null +++ b/eng/common/templates/job/performance.yml @@ -0,0 +1,93 @@ +parameters: + steps: [] # optional -- any additional steps that need to happen before pulling down the performance repo and sending the performance benchmarks to helix (ie building your repo) + variables: [] # optional -- list of additional variables to send to the template + jobName: '' # required -- job name + displayName: '' # optional -- display name for the job. Will use jobName if not passed + pool: '' # required -- name of the Build pool + container: '' # required -- name of the container + extraSetupParameters: '' # optional -- extra arguments to pass to the setup script + frameworks: ['netcoreapp3.0'] # optional -- list of frameworks to run against + continueOnError: 'false' # optional -- determines whether to continue the build if the step errors + dependsOn: '' # optional -- dependencies of the job + timeoutInMinutes: 320 # optional -- timeout for the job + enableTelemetry: false # optional -- enable for telemetry + +jobs: +- template: ../jobs/jobs.yml + parameters: + dependsOn: ${{ parameters.dependsOn }} + enableTelemetry: ${{ parameters.enableTelemetry }} + enablePublishBuildArtifacts: true + continueOnError: ${{ parameters.continueOnError }} + + jobs: + - job: '${{ parameters.jobName }}' + + ${{ if ne(parameters.displayName, '') }}: + displayName: '${{ parameters.displayName }}' + ${{ if eq(parameters.displayName, '') }}: + displayName: '${{ parameters.jobName }}' + + timeoutInMinutes: ${{ parameters.timeoutInMinutes }} + + variables: + + - ${{ each variable in parameters.variables }}: + - ${{ if ne(variable.name, '') }}: + - name: ${{ variable.name }} + value: ${{ variable.value }} + - ${{ if ne(variable.group, '') }}: + - group: ${{ variable.group }} + + - IsInternal: '' + - HelixApiAccessToken: '' + - HelixPreCommand: '' + + - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + - ${{ if eq(variables['Agent.Os'], 'Windows_NT') }}: + - HelixPreCommand: 'set "PERFLAB_UPLOAD_TOKEN=$(PerfCommandUploadToken)"' + - IsInternal: -Internal + - ${{ if ne(variables['Agent.Os'], 'Windows_NT') }}: + - HelixPreCommand: 'export PERFLAB_UPLOAD_TOKEN="$(PerfCommandUploadTokenLinux)"' + - IsInternal: --internal + - group: DotNet-HelixApi-Access + - group: dotnet-benchview + + workspace: + clean: all + pool: + ${{ parameters.pool }} + container: ${{ parameters.container }} + strategy: + matrix: + ${{ each framework in parameters.frameworks }}: + ${{ framework }}: + _Framework: ${{ framework }} + steps: + - checkout: self + clean: true + # Run all of the steps to setup repo + - ${{ each step in parameters.steps }}: + - ${{ step }} + - powershell: $(Build.SourcesDirectory)\eng\common\performance\performance-setup.ps1 $(IsInternal) -Framework $(_Framework) ${{ parameters.extraSetupParameters }} + displayName: Performance Setup (Windows) + condition: and(succeeded(), eq(variables['Agent.Os'], 'Windows_NT')) + continueOnError: ${{ parameters.continueOnError }} + - script: $(Build.SourcesDirectory)/eng/common/performance/performance-setup.sh $(IsInternal) --framework $(_Framework) ${{ parameters.extraSetupParameters }} + displayName: Performance Setup (Unix) + condition: and(succeeded(), ne(variables['Agent.Os'], 'Windows_NT')) + continueOnError: ${{ parameters.continueOnError }} + - script: $(Python) $(PerformanceDirectory)/scripts/ci_setup.py $(SetupArguments) + displayName: Run ci setup script + # Run perf testing in helix + - template: /eng/common/templates/steps/perf-send-to-helix.yml + parameters: + HelixSource: '$(HelixSourcePrefix)/$(Build.Repository.Name)/$(Build.SourceBranch)' # sources must start with pr/, official/, prodcon/, or agent/ + HelixType: 'test/performance/$(Kind)/$(_Framework)/$(Architecture)' + HelixAccessToken: $(HelixApiAccessToken) + HelixTargetQueues: $(Queue) + HelixPreCommands: $(HelixPreCommand) + Creator: $(Creator) + WorkItemTimeout: 4:00 # 4 hours + WorkItemDirectory: '$(WorkItemDirectory)' # WorkItemDirectory can not be empty, so we send it some docs to keep it happy + CorrelationPayloadDirectory: '$(PayloadDirectory)' # it gets checked out to a folder with shorter path than WorkItemDirectory so we can avoid file name too long exceptions \ No newline at end of file diff --git a/eng/common/templates/job/publish-build-assets.yml b/eng/common/templates/job/publish-build-assets.yml index 620bd3c62e..9e77ef1b54 100644 --- a/eng/common/templates/job/publish-build-assets.yml +++ b/eng/common/templates/job/publish-build-assets.yml @@ -59,6 +59,20 @@ jobs: /p:Configuration=$(_BuildConfig) condition: ${{ parameters.condition }} continueOnError: ${{ parameters.continueOnError }} + - task: powershell@2 + displayName: Create ReleaseConfigs Artifact + inputs: + targetType: inline + script: | + Add-Content -Path "$(Build.StagingDirectory)/ReleaseConfigs.txt" -Value $(BARBuildId) + Add-Content -Path "$(Build.StagingDirectory)/ReleaseConfigs.txt" -Value "$(DefaultChannels)" + Add-Content -Path "$(Build.StagingDirectory)/ReleaseConfigs.txt" -Value $(IsStableBuild) + - task: PublishBuildArtifacts@1 + displayName: Publish ReleaseConfigs Artifact + inputs: + PathtoPublish: '$(Build.StagingDirectory)/ReleaseConfigs.txt' + PublishLocation: Container + ArtifactName: ReleaseConfigs - ${{ if eq(parameters.enablePublishBuildArtifacts, 'true') }}: - task: PublishBuildArtifacts@1 displayName: Publish Logs to VSTS diff --git a/eng/common/templates/post-build/channels/internal-servicing.yml b/eng/common/templates/post-build/channels/internal-servicing.yml new file mode 100644 index 0000000000..5c07b66926 --- /dev/null +++ b/eng/common/templates/post-build/channels/internal-servicing.yml @@ -0,0 +1,148 @@ +parameters: + enableSymbolValidation: true + +stages: +- stage: IS_Publish + dependsOn: validate + variables: + - template: ../common-variables.yml + displayName: Internal Servicing + jobs: + - template: ../setup-maestro-vars.yml + + - job: + displayName: Symbol Publishing + dependsOn: setupMaestroVars + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.InternalServicing_30_Channel_Id) + variables: + - group: DotNet-Symbol-Server-Pats + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Artifacts + inputs: + downloadType: specific files + matchingPattern: "*Artifacts*" + + - task: PowerShell@2 + displayName: Publish + inputs: + filePath: eng\common\sdk-task.ps1 + arguments: -task PublishToSymbolServers -restore -msbuildEngine dotnet + /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) + /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) + /p:PDBArtifactsDirectory='$(Build.ArtifactStagingDirectory)/PDBArtifacts/' + /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' + /p:Configuration=Release + + - job: publish_assets + displayName: Publish Assets + dependsOn: setupMaestroVars + variables: + - group: DotNet-Blob-Feed + - group: Publish-Build-Assets + - group: AzureDevOps-Artifact-Feeds-Pats + - name: BARBuildId + value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] + - name: IsStableBuild + value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ] + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.InternalServicing_30_Channel_Id) + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Package Artifacts + inputs: + buildType: current + artifactName: PackageArtifacts + + - task: DownloadBuildArtifacts@0 + displayName: Download Blob Artifacts + inputs: + buildType: current + artifactName: BlobArtifacts + + - task: DownloadBuildArtifacts@0 + displayName: Download Asset Manifests + inputs: + buildType: current + artifactName: AssetManifests + + - task: PowerShell@2 + displayName: Add Assets Location + env: + AZURE_DEVOPS_EXT_PAT: $(dn-bot-dnceng-unviersal-packages-rw) + inputs: + filePath: eng\common\sdk-task.ps1 + arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet + /p:ChannelId=$(InternalServicing_30_Channel_Id) + /p:IsStableBuild=$(IsStableBuild) + /p:IsInternalBuild=$(IsInternalBuild) + /p:RepositoryName=$(Build.Repository.Name) + /p:CommitSha=$(Build.SourceVersion) + /p:AzureStorageAccountName=$(ProxyBackedFeedsAccountName) + /p:AzureStorageAccountKey=$(dotnetfeed-storage-access-key-1) + /p:AzureDevOpsFeedsBaseUrl=$(dotnetfeed-internal-private-feed-url) + /p:StaticInternalFeed=$(dotnetfeed-internal-nonstable-feed-url) + /p:NugetPath=$(Agent.BuildDirectory)\Nuget\NuGet.exe + /p:BARBuildId=$(BARBuildId) + /p:MaestroApiEndpoint='https://maestro-prod.westus2.cloudapp.azure.com' + /p:BuildAssetRegistryToken='$(MaestroAccessToken)' + /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' + /p:BlobBasePath='$(Build.ArtifactStagingDirectory)\BlobArtifacts' + /p:PackageBasePath='$(Build.ArtifactStagingDirectory)\PackageArtifacts' + /p:Configuration=Release + + - task: NuGetCommand@2 + displayName: Publish Packages to AzDO Feed + condition: contains(variables['TargetAzDOFeed'], 'pkgs.visualstudio.com') + inputs: + command: push + vstsFeed: $(AzDoFeedName) + packagesToPush: $(Build.ArtifactStagingDirectory)\PackageArtifacts\*.nupkg + publishVstsFeed: $(AzDoFeedName) + + - task: PowerShell@2 + displayName: Publish Blobs to AzDO Feed + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-blobs-to-azdo.ps1 + arguments: -FeedName $(AzDoFeedName) + -SourceFolderCollection $(Build.ArtifactStagingDirectory)/BlobArtifacts/ + -PersonalAccessToken $(dn-bot-dnceng-unviersal-packages-rw) + enabled: false + + - template: ../trigger-subscription.yml + parameters: + ChannelId: ${{ variables.InternalServicing_30_Channel_Id }} + +- stage: IS_PublishValidation + displayName: Publish Validation + variables: + - template: ../common-variables.yml + jobs: + - template: ../setup-maestro-vars.yml + + - ${{ if eq(parameters.enableSymbolValidation, 'true') }}: + - job: + displayName: Symbol Availability + dependsOn: setupMaestroVars + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.InternalServicing_30_Channel_Id) + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Package Artifacts + inputs: + buildType: current + artifactName: PackageArtifacts + + - task: PowerShell@2 + displayName: Check Symbol Availability + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/post-build/symbols-validation.ps1 + arguments: -InputPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/ -ExtractPath $(Agent.BuildDirectory)/Temp/ -DotnetSymbolVersion $(SymbolToolVersion) + + - template: ../promote-build.yml + parameters: + ChannelId: ${{ variables.InternalServicing_30_Channel_Id }} diff --git a/eng/common/templates/post-build/channels/public-dev-release.yml b/eng/common/templates/post-build/channels/public-dev-release.yml new file mode 100644 index 0000000000..b46b069923 --- /dev/null +++ b/eng/common/templates/post-build/channels/public-dev-release.yml @@ -0,0 +1,149 @@ +parameters: + enableSymbolValidation: true + +stages: +- stage: Publish + dependsOn: validate + variables: + - template: ../common-variables.yml + displayName: Developer Channel + jobs: + - template: ../setup-maestro-vars.yml + + - job: + displayName: Symbol Publishing + dependsOn: setupMaestroVars + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicDevRelease_30_Channel_Id) + variables: + - group: DotNet-Symbol-Server-Pats + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Artifacts + inputs: + downloadType: specific files + matchingPattern: "*Artifacts*" + + - task: PowerShell@2 + displayName: Publish + inputs: + filePath: eng\common\sdk-task.ps1 + arguments: -task PublishToSymbolServers -restore -msbuildEngine dotnet + /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) + /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) + /p:PDBArtifactsDirectory='$(Build.ArtifactStagingDirectory)/PDBArtifacts/' + /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' + /p:Configuration=Release + + - job: + displayName: Publish Assets + dependsOn: setupMaestroVars + variables: + - group: DotNet-Blob-Feed + - group: Publish-Build-Assets + - group: AzureDevOps-Artifact-Feeds-Pats + - name: BARBuildId + value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] + - name: IsStableBuild + value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ] + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicDevRelease_30_Channel_Id) + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Package Artifacts + inputs: + buildType: current + artifactName: PackageArtifacts + + - task: DownloadBuildArtifacts@0 + displayName: Download Blob Artifacts + inputs: + buildType: current + artifactName: BlobArtifacts + + - task: DownloadBuildArtifacts@0 + displayName: Download Asset Manifests + inputs: + buildType: current + artifactName: AssetManifests + + - task: PowerShell@2 + displayName: Add Assets Location + env: + AZURE_DEVOPS_EXT_PAT: $(dn-bot-dnceng-unviersal-packages-rw) + inputs: + filePath: eng\common\sdk-task.ps1 + arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet + /p:ChannelId=$(PublicDevRelease_30_Channel_Id) + /p:ArtifactsCategory=.NetCore + /p:IsStableBuild=$(IsStableBuild) + /p:IsInternalBuild=$(IsInternalBuild) + /p:RepositoryName=$(Build.Repository.Name) + /p:CommitSha=$(Build.SourceVersion) + /p:NugetPath=$(Agent.BuildDirectory)\Nuget\NuGet.exe + /p:AzdoTargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' + /p:TargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' + /p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)' + /p:BARBuildId=$(BARBuildId) + /p:MaestroApiEndpoint='https://maestro-prod.westus2.cloudapp.azure.com' + /p:BuildAssetRegistryToken='$(MaestroAccessToken)' + /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' + /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' + /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts/' + /p:Configuration=Release + + - task: NuGetCommand@2 + displayName: Publish Packages to AzDO Feed + condition: contains(variables['TargetAzDOFeed'], 'pkgs.visualstudio.com') + inputs: + command: push + vstsFeed: $(AzDoFeedName) + packagesToPush: $(Build.ArtifactStagingDirectory)\PackageArtifacts\*.nupkg + publishVstsFeed: $(AzDoFeedName) + + - task: PowerShell@2 + displayName: Publish Blobs to AzDO Feed + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-blobs-to-azdo.ps1 + arguments: -FeedName $(AzDoFeedName) + -SourceFolderCollection $(Build.ArtifactStagingDirectory)/BlobArtifacts/ + -PersonalAccessToken $(dn-bot-dnceng-unviersal-packages-rw) + enabled: false + + +- stage: PublishValidation + displayName: Publish Validation + variables: + - template: ../common-variables.yml + jobs: + - template: ../setup-maestro-vars.yml + + - ${{ if eq(parameters.enableSymbolValidation, 'true') }}: + - job: + displayName: Symbol Availability + dependsOn: setupMaestroVars + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicDevRelease_30_Channel_Id) + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Package Artifacts + inputs: + buildType: current + artifactName: PackageArtifacts + + - task: PowerShell@2 + displayName: Check Symbol Availability + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/post-build/symbols-validation.ps1 + arguments: -InputPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/ -ExtractPath $(Agent.BuildDirectory)/Temp/ -DotnetSymbolVersion $(SymbolToolVersion) + + - template: ../darc-gather-drop.yml + parameters: + ChannelId: ${{ variables.PublicDevRelease_30_Channel_Id }} + + - template: ../promote-build.yml + parameters: + ChannelId: ${{ variables.PublicDevRelease_30_Channel_Id }} diff --git a/eng/common/templates/post-build/channels/public-release.yml b/eng/common/templates/post-build/channels/public-release.yml new file mode 100644 index 0000000000..a31d37139b --- /dev/null +++ b/eng/common/templates/post-build/channels/public-release.yml @@ -0,0 +1,148 @@ +parameters: + enableSymbolValidation: true + +stages: +- stage: PubRel_Publish + dependsOn: validate + variables: + - template: ../common-variables.yml + displayName: Public Release + jobs: + - template: ../setup-maestro-vars.yml + + - job: + displayName: Symbol Publishing + dependsOn: setupMaestroVars + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicRelease_30_Channel_Id) + variables: + - group: DotNet-Symbol-Server-Pats + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Artifacts + inputs: + downloadType: specific files + matchingPattern: "*Artifacts*" + + - task: PowerShell@2 + displayName: Publish + inputs: + filePath: eng\common\sdk-task.ps1 + arguments: -task PublishToSymbolServers -restore -msbuildEngine dotnet + /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) + /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) + /p:PDBArtifactsDirectory='$(Build.ArtifactStagingDirectory)/PDBArtifacts/' + /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' + /p:Configuration=Release + + - job: publish_assets + displayName: Publish Assets + dependsOn: setupMaestroVars + variables: + - group: DotNet-Blob-Feed + - group: Publish-Build-Assets + - group: AzureDevOps-Artifact-Feeds-Pats + - name: BARBuildId + value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] + - name: IsStableBuild + value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ] + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicRelease_30_Channel_Id) + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Package Artifacts + inputs: + buildType: current + artifactName: PackageArtifacts + + - task: DownloadBuildArtifacts@0 + displayName: Download Blob Artifacts + inputs: + buildType: current + artifactName: BlobArtifacts + + - task: DownloadBuildArtifacts@0 + displayName: Download Asset Manifests + inputs: + buildType: current + artifactName: AssetManifests + + - task: PowerShell@2 + displayName: Publish + env: + AZURE_DEVOPS_EXT_PAT: $(dn-bot-dnceng-unviersal-packages-rw) + inputs: + filePath: eng\common\sdk-task.ps1 + arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet + /p:ChannelId=$(PublicRelease_30_Channel_Id) + /p:IsStableBuild=$(IsStableBuild) + /p:IsInternalBuild=$(IsInternalBuild) + /p:RepositoryName=$(Build.Repository.Name) + /p:CommitSha=$(Build.SourceVersion) + /p:AzureStorageAccountName=$(ProxyBackedFeedsAccountName) + /p:AzureStorageAccountKey=$(dotnetfeed-storage-access-key-1) + /p:AzureDevOpsFeedsBaseUrl=$(dotnetfeed-internal-private-feed-url) + /p:StaticInternalFeed=$(dotnetfeed-internal-nonstable-feed-url) + /p:NugetPath=$(Agent.BuildDirectory)\Nuget\NuGet.exe + /p:BARBuildId=$(BARBuildId) + /p:MaestroApiEndpoint='https://maestro-prod.westus2.cloudapp.azure.com' + /p:BuildAssetRegistryToken='$(MaestroAccessToken)' + /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' + /p:BlobBasePath='$(Build.ArtifactStagingDirectory)\BlobArtifacts' + /p:PackageBasePath='$(Build.ArtifactStagingDirectory)\PackageArtifacts' + /p:Configuration=Release + + - task: NuGetCommand@2 + displayName: Publish Packages to AzDO Feed + condition: contains(variables['TargetAzDOFeed'], 'pkgs.visualstudio.com') + inputs: + command: push + vstsFeed: $(AzDoFeedName) + packagesToPush: $(Build.ArtifactStagingDirectory)\PackageArtifacts\*.nupkg + publishVstsFeed: $(AzDoFeedName) + + - task: PowerShell@2 + displayName: Publish Blobs to AzDO Feed + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-blobs-to-azdo.ps1 + arguments: -FeedName $(AzDoFeedName) + -SourceFolderCollection $(Build.ArtifactStagingDirectory)/BlobArtifacts/ + -PersonalAccessToken $(dn-bot-dnceng-unviersal-packages-rw) + enabled: false + + - template: ../trigger-subscription.yml + parameters: + ChannelId: ${{ variables.PublicRelease_30_Channel_Id }} + +- stage: PubRel_PublishValidation + displayName: Publish Validation + variables: + - template: ../common-variables.yml + jobs: + - template: ../setup-maestro-vars.yml + + - ${{ if eq(parameters.enableSymbolValidation, 'true') }}: + - job: + displayName: Symbol Availability + dependsOn: setupMaestroVars + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicRelease_30_Channel_Id) + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Package Artifacts + inputs: + buildType: current + artifactName: PackageArtifacts + + - task: PowerShell@2 + displayName: Check Symbol Availability + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/post-build/symbols-validation.ps1 + arguments: -InputPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/ -ExtractPath $(Agent.BuildDirectory)/Temp/ -DotnetSymbolVersion $(SymbolToolVersion) + + - template: ../promote-build.yml + parameters: + ChannelId: ${{ variables.PublicRelease_30_Channel_Id }} diff --git a/eng/common/templates/post-build/channels/public-validation-release.yml b/eng/common/templates/post-build/channels/public-validation-release.yml new file mode 100644 index 0000000000..02dae0937d --- /dev/null +++ b/eng/common/templates/post-build/channels/public-validation-release.yml @@ -0,0 +1,100 @@ +stages: +- stage: PVR_Publish + dependsOn: validate + variables: + - template: ../common-variables.yml + displayName: Validation Channel + jobs: + - template: ../setup-maestro-vars.yml + + - job: + displayName: Publish Assets + dependsOn: setupMaestroVars + variables: + - group: DotNet-Blob-Feed + - group: Publish-Build-Assets + - group: AzureDevOps-Artifact-Feeds-Pats + - name: BARBuildId + value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] + - name: IsStableBuild + value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ] + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicValidationRelease_30_Channel_Id) + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Package Artifacts + inputs: + buildType: current + artifactName: PackageArtifacts + + - task: DownloadBuildArtifacts@0 + displayName: Download Blob Artifacts + inputs: + buildType: current + artifactName: BlobArtifacts + + - task: DownloadBuildArtifacts@0 + displayName: Download Asset Manifests + inputs: + buildType: current + artifactName: AssetManifests + + - task: PowerShell@2 + displayName: Add Assets Location + env: + AZURE_DEVOPS_EXT_PAT: $(dn-bot-dnceng-unviersal-packages-rw) + inputs: + filePath: eng\common\sdk-task.ps1 + arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet + /p:ChannelId=$(PublicValidationRelease_30_Channel_Id) + /p:ArtifactsCategory=.NetCoreValidation + /p:IsStableBuild=$(IsStableBuild) + /p:IsInternalBuild=$(IsInternalBuild) + /p:RepositoryName=$(Build.Repository.Name) + /p:CommitSha=$(Build.SourceVersion) + /p:NugetPath=$(Agent.BuildDirectory)\Nuget\NuGet.exe + /p:AzdoTargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' + /p:TargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' + /p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)' + /p:BARBuildId=$(BARBuildId) + /p:MaestroApiEndpoint='https://maestro-prod.westus2.cloudapp.azure.com' + /p:BuildAssetRegistryToken='$(MaestroAccessToken)' + /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' + /p:BlobBasePath='$(Build.ArtifactStagingDirectory)\BlobArtifacts' + /p:PackageBasePath='$(Build.ArtifactStagingDirectory)\PackageArtifacts' + /p:Configuration=Release + + - task: NuGetCommand@2 + displayName: Publish Packages to AzDO Feed + condition: contains(variables['TargetAzDOFeed'], 'pkgs.visualstudio.com') + inputs: + command: push + vstsFeed: $(AzDoFeedName) + packagesToPush: $(Build.ArtifactStagingDirectory)\PackageArtifacts\*.nupkg + publishVstsFeed: $(AzDoFeedName) + + - task: PowerShell@2 + displayName: Publish Blobs to AzDO Feed + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-blobs-to-azdo.ps1 + arguments: -FeedName $(AzDoFeedName) + -SourceFolderCollection $(Build.ArtifactStagingDirectory)/BlobArtifacts/ + -PersonalAccessToken $(dn-bot-dnceng-unviersal-packages-rw) + enabled: false + + +- stage: PVR_PublishValidation + displayName: Publish Validation + variables: + - template: ../common-variables.yml + jobs: + - template: ../setup-maestro-vars.yml + + - template: ../darc-gather-drop.yml + parameters: + ChannelId: ${{ variables.PublicValidationRelease_30_Channel_Id }} + + - template: ../promote-build.yml + parameters: + ChannelId: ${{ variables.PublicValidationRelease_30_Channel_Id }} diff --git a/eng/common/templates/post-build/common-variables.yml b/eng/common/templates/post-build/common-variables.yml new file mode 100644 index 0000000000..42df4ae77e --- /dev/null +++ b/eng/common/templates/post-build/common-variables.yml @@ -0,0 +1,21 @@ +variables: + # .NET Core 3 Dev + PublicDevRelease_30_Channel_Id: 3 + + # .NET Tools - Validation + PublicValidationRelease_30_Channel_Id: 9 + + # .NET Core 3.0 Internal Servicing + InternalServicing_30_Channel_Id: 184 + + # .NET Core 3.0 Release + PublicRelease_30_Channel_Id: 19 + + # Whether the build is internal or not + IsInternalBuild: ${{ and(ne(variables['System.TeamProject'], 'public'), contains(variables['Build.SourceBranch'], 'internal')) }} + + # Storage account name for proxy-backed feeds + ProxyBackedFeedsAccountName: dotnetfeed + + SourceLinkCLIVersion: 3.0.0 + SymbolToolVersion: 1.0.1 diff --git a/eng/common/templates/post-build/darc-gather-drop.yml b/eng/common/templates/post-build/darc-gather-drop.yml new file mode 100644 index 0000000000..e0a9f0a6d2 --- /dev/null +++ b/eng/common/templates/post-build/darc-gather-drop.yml @@ -0,0 +1,22 @@ +parameters: + ChannelId: 0 + +jobs: +- job: gatherDrop + displayName: Gather Drop + dependsOn: setupMaestroVars + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], ${{ parameters.ChannelId }}) + variables: + - group: Publish-Build-Assets + - name: BARBuildId + value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] + pool: + vmImage: 'windows-2019' + steps: + - task: PowerShell@2 + displayName: Darc gather-drop + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/post-build/darc-gather-drop.ps1 + arguments: -BarBuildId $(BARBuildId) + -DropLocation $(Agent.BuildDirectory)/Temp/Drop/ + -MaestroAccessToken $(MaestroAccessToken) diff --git a/eng/common/templates/post-build/post-build.yml b/eng/common/templates/post-build/post-build.yml new file mode 100644 index 0000000000..daa799259c --- /dev/null +++ b/eng/common/templates/post-build/post-build.yml @@ -0,0 +1,91 @@ +parameters: + enableSourceLinkValidation: true + enableSigningValidation: true + enableSymbolValidation: true + enableNugetValidation: true + SDLValidationParameters: + enable: false + params: '' + +stages: +- stage: validate + dependsOn: build + displayName: Validate + jobs: + - ${{ if eq(parameters.enableNugetValidation, 'true') }}: + - job: + displayName: NuGet Validation + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Package Artifacts + inputs: + buildType: current + artifactName: PackageArtifacts + + - task: PowerShell@2 + displayName: Validate + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/post-build/nuget-validation.ps1 + arguments: -PackagesPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/ + -ToolDestinationPath $(Agent.BuildDirectory)/Extract/ + + - ${{ if eq(parameters.enableSigningValidation, 'true') }}: + - job: + displayName: Signing Validation + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Package Artifacts + inputs: + buildType: current + artifactName: PackageArtifacts + + - task: PowerShell@2 + displayName: Validate + inputs: + filePath: eng\common\sdk-task.ps1 + arguments: -task SigningValidation -restore -msbuildEngine dotnet + /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts' + /p:Configuration=Release + + - ${{ if eq(parameters.enableSourceLinkValidation, 'true') }}: + - job: + displayName: SourceLink Validation + variables: + - template: common-variables.yml + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Blob Artifacts + inputs: + buildType: current + artifactName: BlobArtifacts + + - task: PowerShell@2 + displayName: Validate + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/post-build/sourcelink-validation.ps1 + arguments: -InputPath $(Build.ArtifactStagingDirectory)/BlobArtifacts/ + -ExtractPath $(Agent.BuildDirectory)/Extract/ + -GHRepoName $(Build.Repository.Name) + -GHCommit $(Build.SourceVersion) + -SourcelinkCliVersion $(SourceLinkCLIVersion) + + - ${{ if eq(parameters.SDLValidationParameters.enable, 'true') }}: + - template: /eng/common/templates/job/execute-sdl.yml + parameters: + additionalParameters: ${{ parameters.SDLValidationParameters.params }} + +- template: \eng\common\templates\post-build\channels\public-dev-release.yml + parameters: + enableSymbolValidation: ${{ parameters.enableSymbolValidation }} + +- template: \eng\common\templates\post-build\channels\public-validation-release.yml + +- template: \eng\common\templates\post-build\channels\public-release.yml + +- template: \eng\common\templates\post-build\channels\internal-servicing.yml diff --git a/eng/common/templates/post-build/promote-build.yml b/eng/common/templates/post-build/promote-build.yml new file mode 100644 index 0000000000..af48b0b339 --- /dev/null +++ b/eng/common/templates/post-build/promote-build.yml @@ -0,0 +1,24 @@ +parameters: + ChannelId: 0 + +jobs: +- job: + displayName: Promote Build + dependsOn: setupMaestroVars + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], ${{ parameters.ChannelId }}) + variables: + - name: BARBuildId + value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] + - name: ChannelId + value: ${{ parameters.ChannelId }} + - group: Publish-Build-Assets + pool: + vmImage: 'windows-2019' + steps: + - task: PowerShell@2 + displayName: Add Build to Channel + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/post-build/promote-build.ps1 + arguments: -BuildId $(BARBuildId) + -ChannelId $(ChannelId) + -BarToken $(MaestroAccessToken) diff --git a/eng/common/templates/post-build/setup-maestro-vars.yml b/eng/common/templates/post-build/setup-maestro-vars.yml new file mode 100644 index 0000000000..f6120dc1e1 --- /dev/null +++ b/eng/common/templates/post-build/setup-maestro-vars.yml @@ -0,0 +1,35 @@ +jobs: +- job: setupMaestroVars + displayName: Setup Maestro Vars + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Release Configs + inputs: + buildType: current + artifactName: ReleaseConfigs + + - task: PowerShell@2 + name: setReleaseVars + displayName: Set Release Configs Vars + inputs: + targetType: inline + script: | + # This is needed to make Write-PipelineSetVariable works in this context + $ci = $true + + . "$(Build.SourcesDirectory)/eng/common/tools.ps1" + + $Content = Get-Content "$(Build.StagingDirectory)/ReleaseConfigs/ReleaseConfigs.txt" + + $BarId = $Content | Select -Index 0 + + $Channels = "" + $Content | Select -Index 1 | ForEach-Object { $Channels += "$_ ," } + + $IsStableBuild = $Content | Select -Index 2 + + Write-PipelineSetVariable -Name 'BARBuildId' -Value $BarId + Write-PipelineSetVariable -Name 'InitialChannels' -Value "$Channels" + Write-PipelineSetVariable -Name 'IsStableBuild' -Value $IsStableBuild diff --git a/eng/common/templates/post-build/trigger-subscription.yml b/eng/common/templates/post-build/trigger-subscription.yml new file mode 100644 index 0000000000..3915cdcd1a --- /dev/null +++ b/eng/common/templates/post-build/trigger-subscription.yml @@ -0,0 +1,11 @@ +parameters: + ChannelId: 0 + +steps: +- task: PowerShell@2 + displayName: Triggering subscriptions + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/post-build/trigger-subscriptions.ps1 + arguments: -SourceRepo $(Build.Repository.Uri) + -ChannelId ${{ parameters.ChannelId }} + -BarToken $(MaestroAccessToken) diff --git a/eng/common/templates/steps/perf-send-to-helix.yml b/eng/common/templates/steps/perf-send-to-helix.yml new file mode 100644 index 0000000000..b3ea9acf1f --- /dev/null +++ b/eng/common/templates/steps/perf-send-to-helix.yml @@ -0,0 +1,66 @@ +# Please remember to update the documentation if you make changes to these parameters! +parameters: + HelixSource: 'pr/default' # required -- sources must start with pr/, official/, prodcon/, or agent/ + HelixType: 'tests/default/' # required -- Helix telemetry which identifies what type of data this is; should include "test" for clarity and must end in '/' + HelixBuild: $(Build.BuildNumber) # required -- the build number Helix will use to identify this -- automatically set to the AzDO build number + HelixTargetQueues: '' # required -- semicolon delimited list of Helix queues to test on; see https://helix.dot.net/ for a list of queues + HelixAccessToken: '' # required -- access token to make Helix API requests; should be provided by the appropriate variable group + HelixPreCommands: '' # optional -- commands to run before Helix work item execution + HelixPostCommands: '' # optional -- commands to run after Helix work item execution + WorkItemDirectory: '' # optional -- a payload directory to zip up and send to Helix; requires WorkItemCommand; incompatible with XUnitProjects + CorrelationPayloadDirectory: '' # optional -- a directory to zip up and send to Helix as a correlation payload + IncludeDotNetCli: false # optional -- true will download a version of the .NET CLI onto the Helix machine as a correlation payload; requires DotNetCliPackageType and DotNetCliVersion + DotNetCliPackageType: '' # optional -- either 'sdk' or 'runtime'; determines whether the sdk or runtime will be sent to Helix; see https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases.json + DotNetCliVersion: '' # optional -- version of the CLI to send to Helix; based on this: https://raw.githubusercontent.com/dotnet/core/master/release-notes/releases.json + EnableXUnitReporter: false # optional -- true enables XUnit result reporting to Mission Control + WaitForWorkItemCompletion: true # optional -- true will make the task wait until work items have been completed and fail the build if work items fail. False is "fire and forget." + Creator: '' # optional -- if the build is external, use this to specify who is sending the job + DisplayNamePrefix: 'Send job to Helix' # optional -- rename the beginning of the displayName of the steps in AzDO + condition: succeeded() # optional -- condition for step to execute; defaults to succeeded() + continueOnError: false # optional -- determines whether to continue the build if the step errors; defaults to false + +steps: + - powershell: $(Build.SourcesDirectory)\eng\common\msbuild.ps1 $(Build.SourcesDirectory)\eng\common\performance\perfhelixpublish.proj /restore /t:Test /bl:$(Build.SourcesDirectory)\artifacts\log\$env:BuildConfig\SendToHelix.binlog + displayName: ${{ parameters.DisplayNamePrefix }} (Windows) + env: + BuildConfig: $(_BuildConfig) + HelixSource: ${{ parameters.HelixSource }} + HelixType: ${{ parameters.HelixType }} + HelixBuild: ${{ parameters.HelixBuild }} + HelixTargetQueues: ${{ parameters.HelixTargetQueues }} + HelixAccessToken: ${{ parameters.HelixAccessToken }} + HelixPreCommands: ${{ parameters.HelixPreCommands }} + HelixPostCommands: ${{ parameters.HelixPostCommands }} + WorkItemDirectory: ${{ parameters.WorkItemDirectory }} + CorrelationPayloadDirectory: ${{ parameters.CorrelationPayloadDirectory }} + IncludeDotNetCli: ${{ parameters.IncludeDotNetCli }} + DotNetCliPackageType: ${{ parameters.DotNetCliPackageType }} + DotNetCliVersion: ${{ parameters.DotNetCliVersion }} + EnableXUnitReporter: ${{ parameters.EnableXUnitReporter }} + WaitForWorkItemCompletion: ${{ parameters.WaitForWorkItemCompletion }} + Creator: ${{ parameters.Creator }} + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + condition: and(${{ parameters.condition }}, eq(variables['Agent.Os'], 'Windows_NT')) + continueOnError: ${{ parameters.continueOnError }} + - script: $BUILD_SOURCESDIRECTORY/eng/common/msbuild.sh $BUILD_SOURCESDIRECTORY/eng/common/performance/perfhelixpublish.proj /restore /t:Test /bl:$BUILD_SOURCESDIRECTORY/artifacts/log/$BuildConfig/SendToHelix.binlog + displayName: ${{ parameters.DisplayNamePrefix }} (Unix) + env: + BuildConfig: $(_BuildConfig) + HelixSource: ${{ parameters.HelixSource }} + HelixType: ${{ parameters.HelixType }} + HelixBuild: ${{ parameters.HelixBuild }} + HelixTargetQueues: ${{ parameters.HelixTargetQueues }} + HelixAccessToken: ${{ parameters.HelixAccessToken }} + HelixPreCommands: ${{ parameters.HelixPreCommands }} + HelixPostCommands: ${{ parameters.HelixPostCommands }} + WorkItemDirectory: ${{ parameters.WorkItemDirectory }} + CorrelationPayloadDirectory: ${{ parameters.CorrelationPayloadDirectory }} + IncludeDotNetCli: ${{ parameters.IncludeDotNetCli }} + DotNetCliPackageType: ${{ parameters.DotNetCliPackageType }} + DotNetCliVersion: ${{ parameters.DotNetCliVersion }} + EnableXUnitReporter: ${{ parameters.EnableXUnitReporter }} + WaitForWorkItemCompletion: ${{ parameters.WaitForWorkItemCompletion }} + Creator: ${{ parameters.Creator }} + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + condition: and(${{ parameters.condition }}, ne(variables['Agent.Os'], 'Windows_NT')) + continueOnError: ${{ parameters.continueOnError }} diff --git a/eng/common/templates/steps/send-to-helix.yml b/eng/common/templates/steps/send-to-helix.yml index d1ce577db5..05df886f55 100644 --- a/eng/common/templates/steps/send-to-helix.yml +++ b/eng/common/templates/steps/send-to-helix.yml @@ -5,6 +5,7 @@ parameters: HelixBuild: $(Build.BuildNumber) # required -- the build number Helix will use to identify this -- automatically set to the AzDO build number HelixTargetQueues: '' # required -- semicolon delimited list of Helix queues to test on; see https://helix.dot.net/ for a list of queues HelixAccessToken: '' # required -- access token to make Helix API requests; should be provided by the appropriate variable group + HelixConfiguration: '' # optional -- additional property attached to a job HelixPreCommands: '' # optional -- commands to run before Helix work item execution HelixPostCommands: '' # optional -- commands to run after Helix work item execution WorkItemDirectory: '' # optional -- a payload directory to zip up and send to Helix; requires WorkItemCommand; incompatible with XUnitProjects @@ -35,6 +36,7 @@ steps: HelixSource: ${{ parameters.HelixSource }} HelixType: ${{ parameters.HelixType }} HelixBuild: ${{ parameters.HelixBuild }} + HelixConfiguration: ${{ parameters.HelixConfiguration }} HelixTargetQueues: ${{ parameters.HelixTargetQueues }} HelixAccessToken: ${{ parameters.HelixAccessToken }} HelixPreCommands: ${{ parameters.HelixPreCommands }} @@ -64,6 +66,7 @@ steps: HelixSource: ${{ parameters.HelixSource }} HelixType: ${{ parameters.HelixType }} HelixBuild: ${{ parameters.HelixBuild }} + HelixConfiguration: ${{ parameters.HelixConfiguration }} HelixTargetQueues: ${{ parameters.HelixTargetQueues }} HelixAccessToken: ${{ parameters.HelixAccessToken }} HelixPreCommands: ${{ parameters.HelixPreCommands }} diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index 9ca177b82a..8fe2b11ad2 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -35,7 +35,7 @@ # Specifies which msbuild engine to use for build: 'vs', 'dotnet' or unspecified (determined based on presence of tools.vs in global.json). [string]$msbuildEngine = if (Test-Path variable:msbuildEngine) { $msbuildEngine } else { $null } -# True to attempt using .NET Core already that meets requirements specified in global.json +# True to attempt using .NET Core already that meets requirements specified in global.json # installed on the machine instead of downloading one. [bool]$useInstalledDotNetCli = if (Test-Path variable:useInstalledDotNetCli) { $useInstalledDotNetCli } else { $true } @@ -76,7 +76,7 @@ function Exec-Process([string]$command, [string]$commandArgs) { $finished = $false try { - while (-not $process.WaitForExit(100)) { + while (-not $process.WaitForExit(100)) { # Non-blocking loop done to allow ctr-c interrupts } @@ -84,7 +84,7 @@ function Exec-Process([string]$command, [string]$commandArgs) { return $global:LASTEXITCODE = $process.ExitCode } finally { - # If we didn't finish then an error occured or the user hit ctrl-c. Either + # If we didn't finish then an error occurred or the user hit ctrl-c. Either # way kill the process if (-not $finished) { $process.Kill() @@ -134,7 +134,7 @@ function InitializeDotNetCli([bool]$install) { if ($install) { InstallDotNetSdk $dotnetRoot $dotnetSdkVersion } else { - Write-Host "Unable to find dotnet with SDK version '$dotnetSdkVersion'" -ForegroundColor Red + Write-PipelineTelemetryError -Category "InitializeToolset" -Message "Unable to find dotnet with SDK version '$dotnetSdkVersion'" ExitWithExitCode 1 } } @@ -147,12 +147,10 @@ function InitializeDotNetCli([bool]$install) { # It also ensures that VS msbuild will use the downloaded sdk targets. $env:PATH = "$dotnetRoot;$env:PATH" - if ($ci) { - # Make Sure that our bootstrapped dotnet cli is avaliable in future steps of the Azure Pipelines build - Write-Host "##vso[task.prependpath]$dotnetRoot" - Write-Host "##vso[task.setvariable variable=DOTNET_MULTILEVEL_LOOKUP]0" - Write-Host "##vso[task.setvariable variable=DOTNET_SKIP_FIRST_TIME_EXPERIENCE]1" - } + # Make Sure that our bootstrapped dotnet cli is available in future steps of the Azure Pipelines build + Write-PipelinePrependPath -Path $dotnetRoot + Write-PipelineSetVariable -Name 'DOTNET_MULTILEVEL_LOOKUP' -Value '0' + Write-PipelineSetVariable -Name 'DOTNET_SKIP_FIRST_TIME_EXPERIENCE' -Value '1' return $global:_DotNetInstallDir = $dotnetRoot } @@ -171,7 +169,7 @@ function InstallDotNetSdk([string] $dotnetRoot, [string] $version, [string] $arc InstallDotNet $dotnetRoot $version $architecture } -function InstallDotNet([string] $dotnetRoot, [string] $version, [string] $architecture = "", [string] $runtime = "", [bool] $skipNonVersionedFiles = $false) { $installScript = GetDotNetInstallScript $dotnetRoot +function InstallDotNet([string] $dotnetRoot, [string] $version, [string] $architecture = "", [string] $runtime = "", [bool] $skipNonVersionedFiles = $false) { $installScript = GetDotNetInstallScript $dotnetRoot $installParameters = @{ Version = $version @@ -184,13 +182,13 @@ function InstallDotNet([string] $dotnetRoot, [string] $version, [string] $archit & $installScript @installParameters if ($lastExitCode -ne 0) { - Write-Host "Failed to install dotnet cli (exit code '$lastExitCode')." -ForegroundColor Red + Write-PipelineTelemetryError -Category "InitializeToolset" -Message "Failed to install dotnet cli (exit code '$lastExitCode')." ExitWithExitCode $lastExitCode } } # -# Locates Visual Studio MSBuild installation. +# Locates Visual Studio MSBuild installation. # The preference order for MSBuild to use is as follows: # # 1. MSBuild from an active VS command prompt @@ -207,13 +205,17 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements = if (!$vsRequirements) { $vsRequirements = $GlobalJson.tools.vs } $vsMinVersionStr = if ($vsRequirements.version) { $vsRequirements.version } else { "15.9" } - $vsMinVersion = [Version]::new($vsMinVersionStr) + $vsMinVersion = [Version]::new($vsMinVersionStr) # Try msbuild command available in the environment. if ($env:VSINSTALLDIR -ne $null) { $msbuildCmd = Get-Command "msbuild.exe" -ErrorAction SilentlyContinue if ($msbuildCmd -ne $null) { - if ($msbuildCmd.Version -ge $vsMinVersion) { + # Workaround for https://github.com/dotnet/roslyn/issues/35793 + # Due to this issue $msbuildCmd.Version returns 0.0.0.0 for msbuild.exe 16.2+ + $msbuildVersion = [Version]::new((Get-Item $msbuildCmd.Path).VersionInfo.ProductVersion.Split(@('-', '+'))[0]) + + if ($msbuildVersion -ge $vsMinVersion) { return $global:_MSBuildExe = $msbuildCmd.Path } @@ -252,7 +254,7 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements = function InitializeVisualStudioEnvironmentVariables([string] $vsInstallDir, [string] $vsMajorVersion) { $env:VSINSTALLDIR = $vsInstallDir Set-Item "env:VS$($vsMajorVersion)0COMNTOOLS" (Join-Path $vsInstallDir "Common7\Tools\") - + $vsSdkInstallDir = Join-Path $vsInstallDir "VSSDK\" if (Test-Path $vsSdkInstallDir) { Set-Item "env:VSSDK$($vsMajorVersion)0Install" $vsSdkInstallDir @@ -287,13 +289,13 @@ function InitializeXCopyMSBuild([string]$packageVersion, [bool]$install) { # Locates Visual Studio instance that meets the minimal requirements specified by tools.vs object in global.json. # # The following properties of tools.vs are recognized: -# "version": "{major}.{minor}" +# "version": "{major}.{minor}" # Two part minimal VS version, e.g. "15.9", "16.0", etc. -# "components": ["componentId1", "componentId2", ...] +# "components": ["componentId1", "componentId2", ...] # Array of ids of workload components that must be available in the VS instance. # See e.g. https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-enterprise?view=vs-2017 # -# Returns JSON describing the located VS instance (same format as returned by vswhere), +# Returns JSON describing the located VS instance (same format as returned by vswhere), # or $null if no instance meeting the requirements is found on the machine. # function LocateVisualStudio([object]$vsRequirements = $null){ @@ -313,8 +315,8 @@ function LocateVisualStudio([object]$vsRequirements = $null){ } if (!$vsRequirements) { $vsRequirements = $GlobalJson.tools.vs } - $args = @("-latest", "-prerelease", "-format", "json", "-requires", "Microsoft.Component.MSBuild") - + $args = @("-latest", "-prerelease", "-format", "json", "-requires", "Microsoft.Component.MSBuild", "-products", "*") + if (Get-Member -InputObject $vsRequirements -Name "version") { $args += "-version" $args += $vsRequirements.version @@ -324,7 +326,7 @@ function LocateVisualStudio([object]$vsRequirements = $null){ foreach ($component in $vsRequirements.components) { $args += "-requires" $args += $component - } + } } $vsInfo =& $vsWhereExe $args | ConvertFrom-Json @@ -354,7 +356,7 @@ function InitializeBuildTool() { if ($msbuildEngine -eq "dotnet") { if (!$dotnetRoot) { - Write-Host "/global.json must specify 'tools.dotnet'." -ForegroundColor Red + Write-PipelineTelemetryError -Category "InitializeToolset" -Message "/global.json must specify 'tools.dotnet'." ExitWithExitCode 1 } @@ -363,13 +365,13 @@ function InitializeBuildTool() { try { $msbuildPath = InitializeVisualStudioMSBuild -install:$restore } catch { - Write-Host $_ -ForegroundColor Red + Write-PipelineTelemetryError -Category "InitializeToolset" -Message $_ ExitWithExitCode 1 } $buildTool = @{ Path = $msbuildPath; Command = ""; Tool = "vs"; Framework = "net472" } } else { - Write-Host "Unexpected value of -msbuildEngine: '$msbuildEngine'." -ForegroundColor Red + Write-PipelineTelemetryError -Category "InitializeToolset" -Message "Unexpected value of -msbuildEngine: '$msbuildEngine'." ExitWithExitCode 1 } @@ -381,12 +383,12 @@ function GetDefaultMSBuildEngine() { if (Get-Member -InputObject $GlobalJson.tools -Name "vs") { return "vs" } - + if (Get-Member -InputObject $GlobalJson.tools -Name "dotnet") { return "dotnet" } - Write-Host "-msbuildEngine must be specified, or /global.json must specify 'tools.dotnet' or 'tools.vs'." -ForegroundColor Red + Write-PipelineTelemetryError -Category "InitializeToolset" -Message "-msbuildEngine must be specified, or /global.json must specify 'tools.dotnet' or 'tools.vs'." ExitWithExitCode 1 } @@ -411,11 +413,13 @@ function GetSdkTaskProject([string]$taskName) { function InitializeNativeTools() { if (Get-Member -InputObject $GlobalJson -Name "native-tools") { - $nativeArgs="" + $nativeArgs= @{} if ($ci) { - $nativeArgs = "-InstallDirectory $ToolsDir" + $nativeArgs = @{ + InstallDirectory = "$ToolsDir" + } } - Invoke-Expression "& `"$PSScriptRoot/init-tools-native.ps1`" $nativeArgs" + & "$PSScriptRoot/init-tools-native.ps1" @nativeArgs } } @@ -437,7 +441,7 @@ function InitializeToolset() { } if (-not $restore) { - Write-Host "Toolset version $toolsetVersion has not been restored." -ForegroundColor Red + Write-PipelineTelemetryError -Category "InitializeToolset" -Message "Toolset version $toolsetVersion has not been restored." ExitWithExitCode 1 } @@ -497,11 +501,13 @@ function MSBuild() { function MSBuild-Core() { if ($ci) { if (!$binaryLog) { - throw "Binary log must be enabled in CI build." + Write-PipelineTaskError -Message "Binary log must be enabled in CI build." + ExitWithExitCode 1 } if ($nodeReuse) { - throw "Node reuse must be disabled in CI build." + Write-PipelineTaskError -Message "Node reuse must be disabled in CI build." + ExitWithExitCode 1 } } @@ -509,8 +515,8 @@ function MSBuild-Core() { $cmdArgs = "$($buildTool.Command) /m /nologo /clp:Summary /v:$verbosity /nr:$nodeReuse /p:ContinuousIntegrationBuild=$ci" - if ($warnAsError) { - $cmdArgs += " /warnaserror /p:TreatWarningsAsErrors=true" + if ($warnAsError) { + $cmdArgs += " /warnaserror /p:TreatWarningsAsErrors=true" } foreach ($arg in $args) { @@ -518,29 +524,29 @@ function MSBuild-Core() { $cmdArgs += " `"$arg`"" } } - + $exitCode = Exec-Process $buildTool.Path $cmdArgs if ($exitCode -ne 0) { - Write-Host "Build failed." -ForegroundColor Red + Write-PipelineTaskError -Message "Build failed." $buildLog = GetMSBuildBinaryLogCommandLineArgument $args - if ($buildLog -ne $null) { - Write-Host "See log: $buildLog" -ForegroundColor DarkGray + if ($buildLog -ne $null) { + Write-Host "See log: $buildLog" -ForegroundColor DarkGray } ExitWithExitCode $exitCode } } -function GetMSBuildBinaryLogCommandLineArgument($arguments) { +function GetMSBuildBinaryLogCommandLineArgument($arguments) { foreach ($argument in $arguments) { if ($argument -ne $null) { $arg = $argument.Trim() if ($arg.StartsWith("/bl:", "OrdinalIgnoreCase")) { return $arg.Substring("/bl:".Length) - } - + } + if ($arg.StartsWith("/binaryLogger:", "OrdinalIgnoreCase")) { return $arg.Substring("/binaryLogger:".Length) } @@ -550,6 +556,8 @@ function GetMSBuildBinaryLogCommandLineArgument($arguments) { return $null } +. $PSScriptRoot\pipeline-logging-functions.ps1 + $RepoRoot = Resolve-Path (Join-Path $PSScriptRoot "..\..") $EngRoot = Resolve-Path (Join-Path $PSScriptRoot "..") $ArtifactsDir = Join-Path $RepoRoot "artifacts" @@ -565,11 +573,8 @@ Create-Directory $ToolsetDir Create-Directory $TempDir Create-Directory $LogDir -if ($ci) { - Write-Host "##vso[task.setvariable variable=Artifacts]$ArtifactsDir" - Write-Host "##vso[task.setvariable variable=Artifacts.Toolset]$ToolsetDir" - Write-Host "##vso[task.setvariable variable=Artifacts.Log]$LogDir" - - $env:TEMP = $TempDir - $env:TMP = $TempDir -} +Write-PipelineSetVariable -Name 'Artifacts' -Value $ArtifactsDir +Write-PipelineSetVariable -Name 'Artifacts.Toolset' -Value $ToolsetDir +Write-PipelineSetVariable -Name 'Artifacts.Log' -Value $LogDir +Write-PipelineSetVariable -Name 'TEMP' -Value $TempDir +Write-PipelineSetVariable -Name 'TMP' -Value $TempDir diff --git a/eng/common/tools.sh b/eng/common/tools.sh old mode 100644 new mode 100755 index df3eb8bce0..0deb01c480 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -1,8 +1,20 @@ +#!/usr/bin/env bash + # Initialize variables if they aren't already defined. # CI mode - set to true on CI server for PR validation build or official build. ci=${ci:-false} +# Set to true to use the pipelines logger which will enable Azure logging output. +# https://github.com/Microsoft/azure-pipelines-tasks/blob/master/docs/authoring/commands.md +# This flag is meant as a temporary opt-opt for the feature while validate it across +# our consumers. It will be deleted in the future. +if [[ "$ci" == true ]]; then + pipelines_log=${pipelines_log:-true} +else + pipelines_log=${pipelines_log:-false} +fi + # Build configuration. Common values include 'Debug' and 'Release', but the repository may use other names. configuration=${configuration:-'Debug'} @@ -65,7 +77,7 @@ function ReadGlobalVersion { local pattern="\"$key\" *: *\"(.*)\"" if [[ ! $line =~ $pattern ]]; then - echo "Error: Cannot find \"$key\" in $global_json_file" >&2 + Write-PipelineTelemetryError -category 'InitializeTools' "Error: Cannot find \"$key\" in $global_json_file" ExitWithExitCode 1 fi @@ -126,7 +138,7 @@ function InitializeDotNetCli { if [[ "$install" == true ]]; then InstallDotNetSdk "$dotnet_root" "$dotnet_sdk_version" else - echo "Unable to find dotnet with SDK version '$dotnet_sdk_version'" >&2 + Write-PipelineTelemetryError -category 'InitializeToolset' "Unable to find dotnet with SDK version '$dotnet_sdk_version'" ExitWithExitCode 1 fi fi @@ -134,14 +146,10 @@ function InitializeDotNetCli { # Add dotnet to PATH. This prevents any bare invocation of dotnet in custom # build steps from using anything other than what we've downloaded. - export PATH="$dotnet_root:$PATH" + Write-PipelinePrependPath -path "$dotnet_root" - if [[ $ci == true ]]; then - # Make Sure that our bootstrapped dotnet cli is avaliable in future steps of the Azure Pipelines build - echo "##vso[task.prependpath]$dotnet_root" - echo "##vso[task.setvariable variable=DOTNET_MULTILEVEL_LOOKUP]0" - echo "##vso[task.setvariable variable=DOTNET_SKIP_FIRST_TIME_EXPERIENCE]1" - fi + Write-PipelineSetVariable -name "DOTNET_MULTILEVEL_LOOKUP" -value "0" + Write-PipelineSetVariable -name "DOTNET_SKIP_FIRST_TIME_EXPERIENCE" -value "1" # return value _InitializeDotNetCli="$dotnet_root" @@ -179,7 +187,7 @@ function InstallDotNet { fi bash "$install_script" --version $version --install-dir "$root" $archArg $runtimeArg $skipNonVersionedFilesArg || { local exit_code=$? - echo "Failed to install dotnet SDK (exit code '$exit_code')." >&2 + Write-PipelineTelemetryError -category 'InitializeToolset' "Failed to install dotnet SDK (exit code '$exit_code')." ExitWithExitCode $exit_code } } @@ -216,6 +224,7 @@ function InitializeBuildTool { # return values _InitializeBuildTool="$_InitializeDotNetCli/dotnet" _InitializeBuildToolCommand="msbuild" + _InitializeBuildToolFramework="netcoreapp2.1" } function GetNuGetPackageCachePath { @@ -264,7 +273,7 @@ function InitializeToolset { fi if [[ "$restore" != true ]]; then - echo "Toolset version $toolsetVersion has not been restored." >&2 + Write-PipelineTelemetryError -category 'InitializeToolset' "Toolset version $toolset_version has not been restored." ExitWithExitCode 2 fi @@ -276,12 +285,12 @@ function InitializeToolset { fi echo '' > "$proj" - MSBuild "$proj" $bl /t:__WriteToolsetLocation /clp:ErrorsOnly\;NoSummary /p:__ToolsetLocationOutputFile="$toolset_location_file" + MSBuild-Core "$proj" $bl /t:__WriteToolsetLocation /clp:ErrorsOnly\;NoSummary /p:__ToolsetLocationOutputFile="$toolset_location_file" local toolset_build_proj=`cat "$toolset_location_file"` if [[ ! -a "$toolset_build_proj" ]]; then - echo "Invalid toolset path: $toolset_build_proj" >&2 + Write-PipelineTelemetryError -category 'InitializeToolset' "Invalid toolset path: $toolset_build_proj" ExitWithExitCode 3 fi @@ -304,14 +313,27 @@ function StopProcesses { } function MSBuild { + local args=$@ + if [[ "$pipelines_log" == true ]]; then + InitializeBuildTool + InitializeToolset + local toolset_dir="${_InitializeToolset%/*}" + local logger_path="$toolset_dir/$_InitializeBuildToolFramework/Microsoft.DotNet.Arcade.Sdk.dll" + args=( "${args[@]}" "-logger:$logger_path" ) + fi + + MSBuild-Core ${args[@]} +} + +function MSBuild-Core { if [[ "$ci" == true ]]; then if [[ "$binary_log" != true ]]; then - echo "Binary log must be enabled in CI build." >&2 + Write-PipelineTaskError "Binary log must be enabled in CI build." ExitWithExitCode 1 fi if [[ "$node_reuse" == true ]]; then - echo "Node reuse must be disabled in CI build." >&2 + Write-PipelineTaskError "Node reuse must be disabled in CI build." ExitWithExitCode 1 fi fi @@ -325,7 +347,7 @@ function MSBuild { "$_InitializeBuildTool" "$_InitializeBuildToolCommand" /m /nologo /clp:Summary /v:$verbosity /nr:$node_reuse $warnaserror_switch /p:TreatWarningsAsErrors=$warn_as_error /p:ContinuousIntegrationBuild=$ci "$@" || { local exit_code=$? - echo "Build failed (exit code '$exit_code')." >&2 + Write-PipelineTaskError "Build failed (exit code '$exit_code')." ExitWithExitCode $exit_code } } @@ -333,6 +355,8 @@ function MSBuild { ResolvePath "${BASH_SOURCE[0]}" _script_dir=`dirname "$_ResolvePath"` +. "$_script_dir/pipeline-logging-functions.sh" + eng_root=`cd -P "$_script_dir/.." && pwd` repo_root=`cd -P "$_script_dir/../.." && pwd` artifacts_dir="$repo_root/artifacts" @@ -359,7 +383,8 @@ mkdir -p "$toolset_dir" mkdir -p "$temp_dir" mkdir -p "$log_dir" -if [[ $ci == true ]]; then - export TEMP="$temp_dir" - export TMP="$temp_dir" -fi \ No newline at end of file +Write-PipelineSetVariable -name "Artifacts" -value "$artifacts_dir" +Write-PipelineSetVariable -name "Artifacts.Toolset" -value "$toolset_dir" +Write-PipelineSetVariable -name "Artifacts.Log" -value "$log_dir" +Write-PipelineSetVariable -name "Temp" -value "$temp_dir" +Write-PipelineSetVariable -name "TMP" -value "$temp_dir" diff --git a/global.json b/global.json index 1d496dc84b..ef694a9855 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19372.10", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19375.2", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From b1435b9563d3a70e7c1859bcda31625e44b63c4e Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 26 Jul 2019 12:37:13 -0700 Subject: [PATCH 136/159] Update dependencies from https://github.com/dotnet/arcade build 20190725.15 (#7282) - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19375.15 --- eng/Version.Details.xml | 4 +-- eng/common/init-tools-native.ps1 | 2 +- eng/common/native/CommonLibrary.psm1 | 33 +++++++++++++++++-- .../channels/public-dev-release.yml | 2 +- .../channels/public-validation-release.yml | 2 +- eng/common/tools.sh | 4 +-- global.json | 2 +- 7 files changed, 39 insertions(+), 10 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 1ed95d393a..7a0a634b41 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - 3dfa62fddcde597959c323d17426f215384e773a + ef1c110152df0d500fffb87878a86f88d1ca5295 diff --git a/eng/common/init-tools-native.ps1 b/eng/common/init-tools-native.ps1 index eaa05880c5..8cf18bcfeb 100644 --- a/eng/common/init-tools-native.ps1 +++ b/eng/common/init-tools-native.ps1 @@ -98,7 +98,7 @@ try { } Write-Verbose "Installing $ToolName version $ToolVersion" - Write-Verbose "Executing '$InstallerPath $LocalInstallerArguments'" + Write-Verbose "Executing '$InstallerPath $($LocalInstallerArguments.Keys.ForEach({"-$_ '$($LocalInstallerArguments.$_)'"}) -join ' ')'" & $InstallerPath @LocalInstallerArguments if ($LASTEXITCODE -Ne "0") { $errMsg = "$ToolName installation failed" diff --git a/eng/common/native/CommonLibrary.psm1 b/eng/common/native/CommonLibrary.psm1 index 7a34c7e8a4..2a08d5246e 100644 --- a/eng/common/native/CommonLibrary.psm1 +++ b/eng/common/native/CommonLibrary.psm1 @@ -59,9 +59,38 @@ function DownloadAndExtract { -Verbose:$Verbose if ($UnzipStatus -Eq $False) { - Write-Error "Unzip failed" - return $False + # Retry Download one more time with Force=true + $DownloadRetryStatus = CommonLibrary\Get-File -Uri $Uri ` + -Path $TempToolPath ` + -DownloadRetries 1 ` + -RetryWaitTimeInSeconds $RetryWaitTimeInSeconds ` + -Force:$True ` + -Verbose:$Verbose + + if ($DownloadRetryStatus -Eq $False) { + Write-Error "Last attempt of download failed as well" + return $False + } + + # Retry unzip again one more time with Force=true + $UnzipRetryStatus = CommonLibrary\Expand-Zip -ZipPath $TempToolPath ` + -OutputDirectory $InstallDirectory ` + -Force:$True ` + -Verbose:$Verbose + if ($UnzipRetryStatus -Eq $False) + { + Write-Error "Last attempt of unzip failed as well" + # Clean up partial zips and extracts + if (Test-Path $TempToolPath) { + Remove-Item $TempToolPath -Force + } + if (Test-Path $InstallDirectory) { + Remove-Item $InstallDirectory -Force -Recurse + } + return $False + } } + return $True } diff --git a/eng/common/templates/post-build/channels/public-dev-release.yml b/eng/common/templates/post-build/channels/public-dev-release.yml index b46b069923..4eaa6e4ff0 100644 --- a/eng/common/templates/post-build/channels/public-dev-release.yml +++ b/eng/common/templates/post-build/channels/public-dev-release.yml @@ -77,7 +77,7 @@ stages: filePath: eng\common\sdk-task.ps1 arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet /p:ChannelId=$(PublicDevRelease_30_Channel_Id) - /p:ArtifactsCategory=.NetCore + /p:ArtifactsCategory=$(_DotNetArtifactsCategory) /p:IsStableBuild=$(IsStableBuild) /p:IsInternalBuild=$(IsInternalBuild) /p:RepositoryName=$(Build.Repository.Name) diff --git a/eng/common/templates/post-build/channels/public-validation-release.yml b/eng/common/templates/post-build/channels/public-validation-release.yml index 02dae0937d..8c4d8f6ef3 100644 --- a/eng/common/templates/post-build/channels/public-validation-release.yml +++ b/eng/common/templates/post-build/channels/public-validation-release.yml @@ -48,7 +48,7 @@ stages: filePath: eng\common\sdk-task.ps1 arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet /p:ChannelId=$(PublicValidationRelease_30_Channel_Id) - /p:ArtifactsCategory=.NetCoreValidation + /p:ArtifactsCategory=$(_DotNetArtifactsCategory) /p:IsStableBuild=$(IsStableBuild) /p:IsInternalBuild=$(IsInternalBuild) /p:RepositoryName=$(Build.Repository.Name) diff --git a/eng/common/tools.sh b/eng/common/tools.sh index 0deb01c480..738bb5669d 100755 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -77,7 +77,7 @@ function ReadGlobalVersion { local pattern="\"$key\" *: *\"(.*)\"" if [[ ! $line =~ $pattern ]]; then - Write-PipelineTelemetryError -category 'InitializeTools' "Error: Cannot find \"$key\" in $global_json_file" + Write-PipelineTelemetryError -category 'InitializeToolset' "Error: Cannot find \"$key\" in $global_json_file" ExitWithExitCode 1 fi @@ -245,7 +245,7 @@ function InitializeNativeTools() { then local nativeArgs="" if [[ "$ci" == true ]]; then - nativeArgs="-InstallDirectory $tools_dir" + nativeArgs="--installDirectory $tools_dir" fi "$_script_dir/init-tools-native.sh" $nativeArgs fi diff --git a/global.json b/global.json index ef694a9855..67df8eb153 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19375.2", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19375.15", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 16aea555ca0d69de4c124b9f2f3932a5de0a9433 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Sat, 27 Jul 2019 19:25:06 +0100 Subject: [PATCH 137/159] code cleanup prior to optional interop improvements (#7276) * add test cases we need to make work * cleanup method call argument processing --- src/fsharp/ConstraintSolver.fs | 2 +- src/fsharp/MethodCalls.fs | 451 ++++++++++++++++++++++----- src/fsharp/TastOps.fs | 35 ++- src/fsharp/TastOps.fsi | 11 +- src/fsharp/TypeChecker.fs | 553 +++++++++------------------------ 5 files changed, 564 insertions(+), 488 deletions(-) diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index 94c28b76e5..9829ebe047 100755 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -1931,7 +1931,7 @@ and SolveTypeIsNonNullableValueType (csenv: ConstraintSolverEnv) ndeep m2 trace | _ -> let underlyingTy = stripTyEqnsAndMeasureEqns g ty if isStructTy g underlyingTy then - if isAppTy g underlyingTy && tyconRefEq g g.system_Nullable_tcref (tcrefOfAppTy g underlyingTy) then + if isNullableTy g underlyingTy then return! ErrorD (ConstraintSolverError(FSComp.SR.csTypeParameterCannotBeNullable(), m, m)) else return! ErrorD (ConstraintSolverError(FSComp.SR.csGenericConstructRequiresStructType(NicePrint.minimalStringOfType denv ty), m, m2)) diff --git a/src/fsharp/MethodCalls.fs b/src/fsharp/MethodCalls.fs index 5a8d66c875..895f2d1f72 100644 --- a/src/fsharp/MethodCalls.fs +++ b/src/fsharp/MethodCalls.fs @@ -20,6 +20,7 @@ open FSharp.Compiler.Tastops.DebugPrint open FSharp.Compiler.TcGlobals open FSharp.Compiler.TypeRelations open FSharp.Compiler.AttributeChecking +open Internal.Utilities #if !NO_EXTENSIONTYPING open FSharp.Compiler.ExtensionTyping @@ -151,7 +152,9 @@ let AdjustCalledArgType (infoReader: InfoReader) isConstraint (calledArg: Called mkRefCellTy g (destByrefTy g calledArgTy) else - // If the called method argument is a delegate type, then the caller may provide a function + // If the called method argument is a delegate type, and the caller is known to be a function type, then the caller may provide a function + // If the called method argument is an Expression type, and the caller is known to be a function type, then the caller may provide a T + // If the called method argument is an [] Quotations.Expr, and the caller is not known to be a quoted expression type, then the caller may provide a T let calledArgTy = let adjustDelegateTy calledTy = let (SigOfFunctionForDelegate(_, delArgTys, _, fty)) = GetSigOfFunctionForDelegate infoReader calledTy m AccessibleFromSomewhere @@ -178,14 +181,18 @@ let AdjustCalledArgType (infoReader: InfoReader) isConstraint (calledArg: Called else calledArgTy // Adjust the called argument type to take into account whether the caller's argument is M(?arg=Some(3)) or M(arg=1) - // If the called method argument is optional with type Option, then the caller may provide a T, unless their argument is propagating-optional (i.e. isOptCallerArg) + // If the called method argument is Callee-side optional with type Option, and the caller argument is not explicitly optional (callerArg.IsOptional), then the caller may provide a T + // If the called method argument is Caller-side optional with type Nullable, and the caller argument is not explicitly optional (callerArg.IsOptional), then the caller may provide a T let calledArgTy = match calledArg.OptArgInfo with - | NotOptional -> calledArgTy + | NotOptional -> calledArgTy | CalleeSide when not callerArg.IsOptional && isOptionTy g calledArgTy -> destOptionTy g calledArgTy - | CalleeSide | CallerSide _ -> calledArgTy - calledArgTy - + // This will be added in https://github.com/dotnet/fsharp/pull/7276 + //| CallerSide _ when not callerArg.IsOptional && isNullableTy g calledArgTy -> destNullableTy g calledArgTy + | CalleeSide + | CallerSide _ -> calledArgTy + + calledArgTy //------------------------------------------------------------------------- // CalledMeth @@ -540,6 +547,351 @@ let ExamineMethodForLambdaPropagation (x: CalledMeth) = else None +//------------------------------------------------------------------------- +// Adjust caller arguments as part of building a method call +//------------------------------------------------------------------------- + +/// Build a call to the System.Object constructor taking no arguments, +let BuildObjCtorCall (g: TcGlobals) m = + let ilMethRef = (mkILCtorMethSpecForTy(g.ilg.typ_Object, [])).MethodRef + Expr.Op (TOp.ILCall (false, false, false, false, CtorValUsedAsSuperInit, false, true, ilMethRef, [], [], [g.obj_ty]), [], [], m) + +/// Implements the elaborated form of adhoc conversions from functions to delegates at member callsites +let BuildNewDelegateExpr (eventInfoOpt: EventInfo option, g, amap, delegateTy, invokeMethInfo: MethInfo, delArgTys, f, fty, m) = + let slotsig = invokeMethInfo.GetSlotSig(amap, m) + let delArgVals, expr = + let topValInfo = ValReprInfo([], List.replicate (max 1 (List.length delArgTys)) ValReprInfo.unnamedTopArg, ValReprInfo.unnamedRetVal) + + // Try to pull apart an explicit lambda and use it directly + // Don't do this in the case where we're adjusting the arguments of a function used to build a .NET-compatible event handler + let lambdaContents = + if Option.isSome eventInfoOpt then + None + else + tryDestTopLambda g amap topValInfo (f, fty) + + match lambdaContents with + | None -> + + if List.exists (isByrefTy g) delArgTys then + error(Error(FSComp.SR.tcFunctionRequiresExplicitLambda(List.length delArgTys), m)) + + let delArgVals = delArgTys |> List.mapi (fun i argty -> fst (mkCompGenLocal m ("delegateArg" + string i) argty)) + let expr = + let args = + match eventInfoOpt with + | Some einfo -> + match delArgVals with + | [] -> error(nonStandardEventError einfo.EventName m) + | h :: _ when not (isObjTy g h.Type) -> error(nonStandardEventError einfo.EventName m) + | h :: t -> [exprForVal m h; mkRefTupledVars g m t] + | None -> + if isNil delArgTys then [mkUnit g m] else List.map (exprForVal m) delArgVals + mkApps g ((f, fty), [], args, m) + delArgVals, expr + + | Some _ -> + let _, _, _, vsl, body, _ = IteratedAdjustArityOfLambda g amap topValInfo f + List.concat vsl, body + + let meth = TObjExprMethod(slotsig, [], [], [delArgVals], expr, m) + mkObjExpr(delegateTy, None, BuildObjCtorCall g m, [meth], [], m) + +let CoerceFromFSharpFuncToDelegate g amap infoReader ad callerArgTy m callerArgExpr delegateTy = + let (SigOfFunctionForDelegate(invokeMethInfo, delArgTys, _, _)) = GetSigOfFunctionForDelegate infoReader delegateTy m ad + BuildNewDelegateExpr (None, g, amap, delegateTy, invokeMethInfo, delArgTys, callerArgExpr, callerArgTy, m) + +// Handle adhoc argument conversions +let AdjustCallerArgExprForCoercions (g: TcGlobals) amap infoReader ad isOutArg calledArgTy (reflArgInfo: ReflectedArgInfo) callerArgTy m callerArgExpr = + + if isByrefTy g calledArgTy && isRefCellTy g callerArgTy then + None, Expr.Op (TOp.RefAddrGet false, [destRefCellTy g callerArgTy], [callerArgExpr], m) + +#if IMPLICIT_ADDRESS_OF + elif isInByrefTy g calledArgTy && not (isByrefTy g callerArgTy) then + let wrap, callerArgExprAddress, _readonly, _writeonly = mkExprAddrOfExpr g true false NeverMutates callerArgExpr None m + Some wrap, callerArgExprAddress +#endif + + elif isDelegateTy g calledArgTy && isFunTy g callerArgTy then + None, CoerceFromFSharpFuncToDelegate g amap infoReader ad callerArgTy m callerArgExpr calledArgTy + + elif isLinqExpressionTy g calledArgTy && isDelegateTy g (destLinqExpressionTy g calledArgTy) && isFunTy g callerArgTy then + let delegateTy = destLinqExpressionTy g calledArgTy + let expr = CoerceFromFSharpFuncToDelegate g amap infoReader ad callerArgTy m callerArgExpr delegateTy + None, mkCallQuoteToLinqLambdaExpression g m delegateTy (Expr.Quote (expr, ref None, false, m, mkQuotedExprTy g delegateTy)) + + // auto conversions to quotations (to match auto conversions to LINQ expressions) + elif reflArgInfo.AutoQuote && isQuotedExprTy g calledArgTy && not (isQuotedExprTy g callerArgTy) then + match reflArgInfo with + | ReflectedArgInfo.Quote true -> + None, mkCallLiftValueWithDefn g m calledArgTy callerArgExpr + | ReflectedArgInfo.Quote false -> + None, Expr.Quote (callerArgExpr, ref None, false, m, calledArgTy) + | ReflectedArgInfo.None -> failwith "unreachable" // unreachable due to reflArgInfo.AutoQuote condition + + // Note: out args do not need to be coerced + elif isOutArg then + None, callerArgExpr + + // Note: not all these casts are reported in quotations + else + None, mkCoerceIfNeeded g calledArgTy callerArgTy callerArgExpr + +// Handle CallerSide optional arguments. +// +// CallerSide optional arguments are largely for COM interop, e.g. to PIA assemblies for Word etc. +// As a result we follow the VB and C# behavior here. +// +// "1. If the parameter is statically typed as System.Object and does not have a value, then there are four cases: +// a. The parameter is marked with MarshalAs(IUnknown), MarshalAs(Interface), or MarshalAs(IDispatch). In this case we pass null. +// b. Else if the parameter is marked with IUnknownConstantAttribute. In this case we pass new System.Runtime.InteropServices.UnknownWrapper(null) +// c. Else if the parameter is marked with IDispatchConstantAttribute. In this case we pass new System.Runtime.InteropServices.DispatchWrapper(null) +// d. Else, we will pass Missing.Value. +// 2. Otherwise, if there is a value attribute, then emit the default value. +// 3. Otherwise, we emit default(T). +// 4. Finally, we apply conversions from the value to the parameter type. This is where the nullable conversions take place for VB. +// - VB allows you to mark ref parameters as optional. The semantics of this is that we create a temporary +// with type = type of parameter, load the optional value to it, and call the method. +// - VB also allows you to mark arrays with Nothing as the optional value. +// - VB also allows you to pass intrinsic values as optional values to parameters +// typed as Object. What we do in this case is we box the intrinsic value." +// +let AdjustOptionalCallerArgExprs tcFieldInit eCallerMemberName g (calledMeth: CalledMeth<_>) mItem mMethExpr = + + let assignedNamedArgs = calledMeth.ArgSets |> List.collect (fun argSet -> argSet.AssignedNamedArgs) + let unnamedCalledArgs = calledMeth.ArgSets |> List.collect (fun argSet -> argSet.UnnamedCalledArgs) + let unnamedCallerArgs = calledMeth.ArgSets |> List.collect (fun argSet -> argSet.UnnamedCallerArgs) + let unnamedArgs = + (unnamedCalledArgs, unnamedCallerArgs) ||> List.map2 (fun called caller -> + { NamedArgIdOpt = None; CalledArg=called; CallerArg=caller }) + + let emptyPreBinder (e: Expr) = e + + // Adjust all the optional arguments that require a default value to be inserted into the call + let optArgs, optArgPreBinder = + (emptyPreBinder, calledMeth.UnnamedCalledOptArgs) ||> List.mapFold (fun wrapper calledArg -> + let calledArgTy = calledArg.CalledArgumentType + let wrapper2, expr = + match calledArg.OptArgInfo with + | NotOptional -> + error(InternalError("Unexpected NotOptional", mItem)) + + | CallerSide dfltVal -> + + let rec build currCalledArgTy currDfltVal = + match currDfltVal with + | MissingValue -> + // Add an I_nop if this is an initonly field to make sure we never recognize it as an lvalue. See mkExprAddrOfExpr. + emptyPreBinder, mkAsmExpr ([ mkNormalLdsfld (fspec_Missing_Value g); AI_nop ], [], [], [currCalledArgTy], mMethExpr) + + | DefaultValue -> + emptyPreBinder, mkDefault(mMethExpr, currCalledArgTy) + + | Constant fieldInit -> + match currCalledArgTy with + | NullableTy g inst when fieldInit <> ILFieldInit.Null -> + let nullableTy = mkILNonGenericBoxedTy(g.FindSysILTypeRef "System.Nullable`1") + let ctor = mkILCtorMethSpecForTy(nullableTy, [ILType.TypeVar 0us]).MethodRef + let ctorArgs = [Expr.Const (tcFieldInit mMethExpr fieldInit, mMethExpr, inst)] + emptyPreBinder, Expr.Op (TOp.ILCall (false, false, true, true, NormalValUse, false, false, ctor, [inst], [], [currCalledArgTy]), [], ctorArgs, mMethExpr) + | ByrefTy g inst -> + build inst (PassByRef(inst, currDfltVal)) + | _ -> + match calledArg.CallerInfo, eCallerMemberName with + | CallerLineNumber, _ when typeEquiv g currCalledArgTy g.int_ty -> + emptyPreBinder, Expr.Const (Const.Int32(mMethExpr.StartLine), mMethExpr, currCalledArgTy) + | CallerFilePath, _ when typeEquiv g currCalledArgTy g.string_ty -> + let fileName = mMethExpr.FileName |> FileSystem.GetFullPathShim |> PathMap.apply g.pathMap + emptyPreBinder, Expr.Const (Const.String fileName, mMethExpr, currCalledArgTy) + | CallerMemberName, Some callerName when (typeEquiv g currCalledArgTy g.string_ty) -> + emptyPreBinder, Expr.Const (Const.String callerName, mMethExpr, currCalledArgTy) + | _ -> + emptyPreBinder, Expr.Const (tcFieldInit mMethExpr fieldInit, mMethExpr, currCalledArgTy) + + | WrapperForIDispatch -> + match g.TryFindSysILTypeRef "System.Runtime.InteropServices.DispatchWrapper" with + | None -> error(Error(FSComp.SR.fscSystemRuntimeInteropServicesIsRequired(), mMethExpr)) + | Some tref -> + let ty = mkILNonGenericBoxedTy tref + let mref = mkILCtorMethSpecForTy(ty, [g.ilg.typ_Object]).MethodRef + let expr = Expr.Op (TOp.ILCall (false, false, false, true, NormalValUse, false, false, mref, [], [], [g.obj_ty]), [], [mkDefault(mMethExpr, currCalledArgTy)], mMethExpr) + emptyPreBinder, expr + + | WrapperForIUnknown -> + match g.TryFindSysILTypeRef "System.Runtime.InteropServices.UnknownWrapper" with + | None -> error(Error(FSComp.SR.fscSystemRuntimeInteropServicesIsRequired(), mMethExpr)) + | Some tref -> + let ty = mkILNonGenericBoxedTy tref + let mref = mkILCtorMethSpecForTy(ty, [g.ilg.typ_Object]).MethodRef + let expr = Expr.Op (TOp.ILCall (false, false, false, true, NormalValUse, false, false, mref, [], [], [g.obj_ty]), [], [mkDefault(mMethExpr, currCalledArgTy)], mMethExpr) + emptyPreBinder, expr + + | PassByRef (ty, dfltVal2) -> + let v, _ = mkCompGenLocal mMethExpr "defaultByrefArg" ty + let wrapper2, rhs = build currCalledArgTy dfltVal2 + (wrapper2 >> mkCompGenLet mMethExpr v rhs), mkValAddr mMethExpr false (mkLocalValRef v) + build calledArgTy dfltVal + + | CalleeSide -> + let calledNonOptTy = + if isOptionTy g calledArgTy then + destOptionTy g calledArgTy + else + calledArgTy // should be unreachable + + match calledArg.CallerInfo, eCallerMemberName with + | CallerLineNumber, _ when typeEquiv g calledNonOptTy g.int_ty -> + let lineExpr = Expr.Const(Const.Int32 mMethExpr.StartLine, mMethExpr, calledNonOptTy) + emptyPreBinder, mkSome g calledNonOptTy lineExpr mMethExpr + | CallerFilePath, _ when typeEquiv g calledNonOptTy g.string_ty -> + let fileName = mMethExpr.FileName |> FileSystem.GetFullPathShim |> PathMap.apply g.pathMap + let filePathExpr = Expr.Const (Const.String(fileName), mMethExpr, calledNonOptTy) + emptyPreBinder, mkSome g calledNonOptTy filePathExpr mMethExpr + | CallerMemberName, Some(callerName) when typeEquiv g calledNonOptTy g.string_ty -> + let memberNameExpr = Expr.Const (Const.String callerName, mMethExpr, calledNonOptTy) + emptyPreBinder, mkSome g calledNonOptTy memberNameExpr mMethExpr + | _ -> + emptyPreBinder, mkNone g calledNonOptTy mMethExpr + + // Combine the variable allocators (if any) + let wrapper = (wrapper >> wrapper2) + let callerArg = CallerArg(calledArgTy, mMethExpr, false, expr) + { NamedArgIdOpt = None; CalledArg = calledArg; CallerArg = callerArg }, wrapper) + + // Adjust all the optional arguments + let wrapOptionalArg (assignedArg: AssignedCalledArg<_>) = + let (CallerArg(callerArgTy, m, isOptCallerArg, callerArgExpr)) = assignedArg.CallerArg + match assignedArg.CalledArg.OptArgInfo with + | NotOptional -> + if isOptCallerArg then errorR(Error(FSComp.SR.tcFormalArgumentIsNotOptional(), m)) + assignedArg + | _ -> + let callerArgExpr2 = + match assignedArg.CalledArg.OptArgInfo with + | CallerSide _ -> + if isOptCallerArg then + // M(?x=bopt) when M(A) --> M(?x=bopt.Value) for caller-side + // STRUCT OPTIONS: if we allow struct options as optional arguments then we should take + // the address correctly. + mkUnionCaseFieldGetUnprovenViaExprAddr (callerArgExpr, mkSomeCase g, [destOptionTy g callerArgTy], 0, m) + else + // M(x=b) when M(A) --> M(?x=b) for caller-side + callerArgExpr + + | CalleeSide -> + if isOptCallerArg then + // M(?x=bopt) when M(A) --> M(?x=Some(bopt.Value)) + callerArgExpr + else + // M(x=b) when M(A) --> M(?x=Some(b :> A)) + let calledArgTy = assignedArg.CalledArg.CalledArgumentType + if isOptionTy g calledArgTy then + let calledNonOptTy = destOptionTy g calledArgTy + mkSome g calledNonOptTy (mkCoerceIfNeeded g calledNonOptTy callerArgTy callerArgExpr) m + else + callerArgExpr // should be unreachable + + | _ -> failwith "Unreachable" + { assignedArg with CallerArg=CallerArg(tyOfExpr g callerArgExpr2, m, isOptCallerArg, callerArgExpr2) } + + let adjustedNormalUnnamedArgs = List.map wrapOptionalArg unnamedArgs + let adjustedAssignedNamedArgs = List.map wrapOptionalArg assignedNamedArgs + + optArgs, optArgPreBinder, adjustedNormalUnnamedArgs, adjustedAssignedNamedArgs + +/// Adjust any 'out' arguments, passing in the address of a mutable local +let AdjustOutCallerArgExprs g (calledMeth: CalledMeth<_>) mMethExpr = + calledMeth.UnnamedCalledOutArgs |> List.map (fun calledArg -> + let calledArgTy = calledArg.CalledArgumentType + let outArgTy = destByrefTy g calledArgTy + let outv, outArgExpr = mkMutableCompGenLocal mMethExpr PrettyNaming.outArgCompilerGeneratedName outArgTy // mutable! + let expr = mkDefault (mMethExpr, outArgTy) + let callerArg = CallerArg (calledArgTy, mMethExpr, false, mkValAddr mMethExpr false (mkLocalValRef outv)) + let outArg = { NamedArgIdOpt=None;CalledArg=calledArg;CallerArg=callerArg } + outArg, outArgExpr, mkCompGenBind outv expr) + |> List.unzip3 + +let AdjustParamArrayCallerArgExprs g amap infoReader ad (calledMeth: CalledMeth<_>) mMethExpr = + let argSets = calledMeth.ArgSets + + let paramArrayCallerArgs = argSets |> List.collect (fun argSet -> argSet.ParamArrayCallerArgs) + match calledMeth.ParamArrayCalledArgOpt with + | None -> + [], [] + | Some paramArrayCalledArg -> + let paramArrayCalledArgElementType = destArrayTy g paramArrayCalledArg.CalledArgumentType + + let paramArrayPreBinders, es = + paramArrayCallerArgs + |> List.map (fun callerArg -> + let (CallerArg(callerArgTy, m, isOutArg, callerArgExpr)) = callerArg + AdjustCallerArgExprForCoercions g amap infoReader ad isOutArg paramArrayCalledArgElementType paramArrayCalledArg.ReflArgInfo callerArgTy m callerArgExpr) + |> List.unzip + + let arg = + [ { NamedArgIdOpt = None + CalledArg=paramArrayCalledArg + CallerArg=CallerArg(paramArrayCalledArg.CalledArgumentType, mMethExpr, false, Expr.Op (TOp.Array, [paramArrayCalledArgElementType], es, mMethExpr)) } ] + paramArrayPreBinders, arg + +/// Build the argument list for a method call. Adjust for param array, optional arguments, byref arguments and coercions. +/// For example, if you pass an F# reference cell to a byref then we must get the address of the +/// contents of the ref. Likewise lots of adjustments are made for optional arguments etc. +let AdjustCallerArgExprs tcFieldInit eCallerMemberName g amap infoReader ad (calledMeth: CalledMeth<_>) objArgs lambdaVars mItem mMethExpr = + let calledMethInfo = calledMeth.Method + + // Some of the code below must allocate temporary variables or bind other variables to particular values. + // As usual we represent variable allocators by expr -> expr functions + // which we then use to wrap the whole expression. These will either do nothing or pre-bind a variable. It doesn't + // matter what order they are applied in as long as they are all composed together. + let emptyPreBinder (e: Expr) = e + + // For unapplied 'e.M' we first evaluate 'e' outside the lambda, i.e. 'let v = e in (fun arg -> v.M(arg))' + let objArgPreBinder, objArgs = + match objArgs, lambdaVars with + | [objArg], Some _ -> + if calledMethInfo.IsExtensionMember && calledMethInfo.ObjArgNeedsAddress(amap, mMethExpr) then + error(Error(FSComp.SR.tcCannotPartiallyApplyExtensionMethodForByref(calledMethInfo.DisplayName), mMethExpr)) + let objArgTy = tyOfExpr g objArg + let v, ve = mkCompGenLocal mMethExpr "objectArg" objArgTy + (fun body -> mkCompGenLet mMethExpr v objArg body), [ve] + | _ -> + emptyPreBinder, objArgs + + // Handle param array and optional arguments + let paramArrayPreBinders, paramArrayArgs = + AdjustParamArrayCallerArgExprs g amap infoReader ad calledMeth mMethExpr + + let optArgs, optArgPreBinder, adjustedNormalUnnamedArgs, adjustedFinalAssignedNamedArgs = + AdjustOptionalCallerArgExprs tcFieldInit eCallerMemberName g calledMeth mItem mMethExpr + + let outArgs, outArgExprs, outArgTmpBinds = + AdjustOutCallerArgExprs g calledMeth mMethExpr + + let allArgs = + adjustedNormalUnnamedArgs @ + adjustedFinalAssignedNamedArgs @ + paramArrayArgs @ + optArgs @ + outArgs + + let allArgs = + allArgs |> List.sortBy (fun x -> x.Position) + + let allArgsPreBinders, allArgsCoerced = + allArgs + |> List.map (fun assignedArg -> + let isOutArg = assignedArg.CalledArg.IsOutArg + let reflArgInfo = assignedArg.CalledArg.ReflArgInfo + let calledArgTy = assignedArg.CalledArg.CalledArgumentType + let (CallerArg(callerArgTy, m, _, e)) = assignedArg.CallerArg + + AdjustCallerArgExprForCoercions g amap infoReader ad isOutArg calledArgTy reflArgInfo callerArgTy m e) + |> List.unzip + + objArgPreBinder, objArgs, allArgsPreBinders, allArgs, allArgsCoerced, optArgPreBinder, paramArrayPreBinders, outArgExprs, outArgTmpBinds + //------------------------------------------------------------------------- // Additional helpers for building method calls and doing TAST generation //------------------------------------------------------------------------- @@ -573,27 +925,30 @@ let ComputeConstrainedCallInfo g amap m (objArgs, minfo: MethInfo) = | _ -> None - /// 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 wrap, objArgs = + match objArgs with | [objArgExpr] -> + let hasCallInfo = ccallInfo.IsSome let mustTakeAddress = hasCallInfo || minfo.ObjArgNeedsAddress(amap, m) let objArgTy = tyOfExpr g objArgExpr - let wrap, objArgExpr', isReadOnly, _isWriteOnly = mkExprAddrOfExpr g mustTakeAddress hasCallInfo isMutable objArgExpr None m + + let wrap, objArgExprAddr, isReadOnly, _isWriteOnly = + 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' = + let objArgExprCoerced = if not hasCallInfo && not (TypeDefinitelySubsumesTypeNoCoercion 0 g amap m minfo.ApparentEnclosingType objArgTy) then - mkCoerceExpr(objArgExpr', minfo.ApparentEnclosingType, m, objArgTy) + mkCoerceExpr(objArgExprAddr, minfo.ApparentEnclosingType, m, objArgTy) else - objArgExpr' + objArgExprAddr // Check to see if the extension member uses the extending type as a byref. // If so, make sure we don't allow readonly/immutable values to be passed byref from an extension member. @@ -605,7 +960,7 @@ let TakeObjAddrForMethodCall g amap (minfo: MethInfo) isMutable m objArgs f = errorR(Error(FSComp.SR.tcCannotCallExtensionMethodInrefToByref(minfo.DisplayName), m))) - wrap, [objArgExpr'] + wrap, [objArgExprCoerced] | _ -> id, objArgs @@ -616,11 +971,6 @@ let TakeObjAddrForMethodCall g amap (minfo: MethInfo) isMutable m objArgs f = // Build method calls. //------------------------------------------------------------------------- -//------------------------------------------------------------------------- -// Build calls -//------------------------------------------------------------------------- - - /// Build an expression node that is a call to a .NET method. let BuildILMethInfoCall g amap m isProp (minfo: ILMethInfo) valUseFlags minst direct args = let valu = isStructTy g minfo.ApparentEnclosingType @@ -638,11 +988,6 @@ let BuildILMethInfoCall g amap m isProp (minfo: ILMethInfo) valUseFlags minst di Expr.Op (TOp.ILCall (useCallvirt, isProtected, valu, newobj, valUseFlags, isProp, isDllImport, ilMethRef, minfo.DeclaringTypeInst, minst, retTy), [], args, m), exprTy -/// Build a call to the System.Object constructor taking no arguments, -let BuildObjCtorCall (g: TcGlobals) m = - let ilMethRef = (mkILCtorMethSpecForTy(g.ilg.typ_Object, [])).MethodRef - Expr.Op (TOp.ILCall (false, false, false, false, CtorValUsedAsSuperInit, false, true, ilMethRef, [], [], [g.obj_ty]), [], [], m) - /// Build a call to an F# method. /// @@ -825,55 +1170,6 @@ let BuildMethodCall tcVal g amap isMutable m isProp minfo valUseFlags minst objA errorR(Error(FSComp.SR.tcDefaultStructConstructorCall(), m)) mkDefault (m, ty), ty) -//------------------------------------------------------------------------- -// Build delegate constructions (lambdas/functions to delegates) -//------------------------------------------------------------------------- - -/// Implements the elaborated form of adhoc conversions from functions to delegates at member callsites -let BuildNewDelegateExpr (eventInfoOpt: EventInfo option, g, amap, delegateTy, invokeMethInfo: MethInfo, delArgTys, f, fty, m) = - let slotsig = invokeMethInfo.GetSlotSig(amap, m) - let delArgVals, expr = - let topValInfo = ValReprInfo([], List.replicate (max 1 (List.length delArgTys)) ValReprInfo.unnamedTopArg, ValReprInfo.unnamedRetVal) - - // Try to pull apart an explicit lambda and use it directly - // Don't do this in the case where we're adjusting the arguments of a function used to build a .NET-compatible event handler - let lambdaContents = - if Option.isSome eventInfoOpt then - None - else - tryDestTopLambda g amap topValInfo (f, fty) - - match lambdaContents with - | None -> - - if List.exists (isByrefTy g) delArgTys then - error(Error(FSComp.SR.tcFunctionRequiresExplicitLambda(List.length delArgTys), m)) - - let delArgVals = delArgTys |> List.mapi (fun i argty -> fst (mkCompGenLocal m ("delegateArg" + string i) argty)) - let expr = - let args = - match eventInfoOpt with - | Some einfo -> - match delArgVals with - | [] -> error(nonStandardEventError einfo.EventName m) - | h :: _ when not (isObjTy g h.Type) -> error(nonStandardEventError einfo.EventName m) - | h :: t -> [exprForVal m h; mkRefTupledVars g m t] - | None -> - if isNil delArgTys then [mkUnit g m] else List.map (exprForVal m) delArgVals - mkApps g ((f, fty), [], args, m) - delArgVals, expr - - | Some _ -> - let _, _, _, vsl, body, _ = IteratedAdjustArityOfLambda g amap topValInfo f - List.concat vsl, body - - let meth = TObjExprMethod(slotsig, [], [], [delArgVals], expr, m) - mkObjExpr(delegateTy, None, BuildObjCtorCall g m, [meth], [], m) - -let CoerceFromFSharpFuncToDelegate g amap infoReader ad callerArgTy m callerArgExpr delegateTy = - let (SigOfFunctionForDelegate(invokeMethInfo, delArgTys, _, _)) = GetSigOfFunctionForDelegate infoReader delegateTy m ad - BuildNewDelegateExpr (None, g, amap, delegateTy, invokeMethInfo, delArgTys, callerArgExpr, callerArgTy, m) - //------------------------------------------------------------------------- // Import provided expressions @@ -972,11 +1268,14 @@ module ProvidedMethodCalls = st loop inputType - let convertProvidedExpressionToExprAndWitness tcVal (thisArg: Expr option, - allArgs: Exprs, - paramVars: Tainted[], - g, amap, mut, isProp, isSuperInit, m, - expr: Tainted) = + let convertProvidedExpressionToExprAndWitness + tcVal + (thisArg: Expr option, + allArgs: Exprs, + paramVars: Tainted[], + g, amap, mut, isProp, isSuperInit, m, + expr: Tainted) = + let varConv = // note: using paramVars.Length as assumed initial size, but this might not // be the optimal value; this wasn't checked before obsoleting Dictionary.ofList diff --git a/src/fsharp/TastOps.fs b/src/fsharp/TastOps.fs index 00fb9a0827..c638d9a864 100644 --- a/src/fsharp/TastOps.fs +++ b/src/fsharp/TastOps.fs @@ -839,16 +839,6 @@ let tryNiceEntityRefOfTyOption ty = | TType_app (tcref, _) -> Some tcref | TType_measure (Measure.Con tcref) -> Some tcref | _ -> None - -let (|NullableTy|_|) g ty = - match tryAppTy g ty with - | ValueSome (tcref, [tyarg]) when tyconRefEq g tcref g.system_Nullable_tcref -> Some tyarg - | _ -> None - -let (|StripNullableTy|) g ty = - match tryAppTy g ty with - | ValueSome (tcref, [tyarg]) when tyconRefEq g tcref g.system_Nullable_tcref -> tyarg - | _ -> ty let mkInstForAppTy g ty = match tryAppTy g ty with @@ -3125,6 +3115,31 @@ let destOptionTy g ty = | ValueSome ty -> ty | ValueNone -> failwith "destOptionTy: not an option type" +let isNullableTy (g: TcGlobals) ty = + match tryDestAppTy g ty with + | ValueNone -> false + | ValueSome tcref -> tyconRefEq g g.system_Nullable_tcref tcref + +let tryDestNullableTy g ty = + match argsOfAppTy g ty with + | [ty1] when isNullableTy g ty -> ValueSome ty1 + | _ -> ValueNone + +let destNullableTy g ty = + match tryDestNullableTy g ty with + | ValueSome ty -> ty + | ValueNone -> failwith "destNullableTy: not a Nullable type" + +let (|NullableTy|_|) g ty = + match tryAppTy g ty with + | ValueSome (tcref, [tyarg]) when tyconRefEq g tcref g.system_Nullable_tcref -> Some tyarg + | _ -> None + +let (|StripNullableTy|) g ty = + match tryDestNullableTy g ty with + | ValueSome tyarg -> tyarg + | _ -> ty + let isLinqExpressionTy g ty = match tryDestAppTy g ty with | ValueNone -> false diff --git a/src/fsharp/TastOps.fsi b/src/fsharp/TastOps.fsi index 8c71736a84..b0743de853 100755 --- a/src/fsharp/TastOps.fsi +++ b/src/fsharp/TastOps.fsi @@ -1388,7 +1388,7 @@ val mkVoidPtrTy : TcGlobals -> TType /// Build a single-dimensional array type val mkArrayType : TcGlobals -> TType -> TType -/// Determine is a type is an option type +/// Determine if a type is an option type val isOptionTy : TcGlobals -> TType -> bool /// Take apart an option type @@ -1397,6 +1397,15 @@ val destOptionTy : TcGlobals -> TType -> TType /// Try to take apart an option type val tryDestOptionTy : TcGlobals -> TType -> ValueOption +/// Determine is a type is a System.Nullable type +val isNullableTy : TcGlobals -> TType -> bool + +/// Try to take apart a System.Nullable type +val tryDestNullableTy: TcGlobals -> TType -> ValueOption + +/// Take apart a System.Nullable type +val destNullableTy: TcGlobals -> TType -> TType + /// Determine if a type is a System.Linq.Expression type val isLinqExpressionTy : TcGlobals -> TType -> bool diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index ae464f1575..70bb0f6b21 100644 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -9671,75 +9671,74 @@ and TcMethodApplication // In one case (the second "single named item" rule) we delay the application of a // argument until we've produced a lambda that detuples an input tuple let curriedCallerArgsOpt, unnamedDelayedCallerArgExprOpt, exprTy = - match curriedCallerArgs with - | [] -> - None, None, exprTy - | _ -> - let unnamedCurriedCallerArgs, namedCurriedCallerArgs = curriedCallerArgs |> List.map GetMethodArgs |> List.unzip + match curriedCallerArgs with + | [] -> + None, None, exprTy + | _ -> + let unnamedCurriedCallerArgs, namedCurriedCallerArgs = curriedCallerArgs |> List.map GetMethodArgs |> List.unzip - // There is an mismatch when _uses_ of indexed property setters in the tc.fs code that calls this function. - // The arguments are passed as if they are curried with arity [numberOfIndexParameters;1], however in the TAST, indexed property setters - // are uncurried and have arity [numberOfIndexParameters+1]. - // - // Here we work around this mismatch by crunching all property argument lists to uncirred form. - // Ideally the problem needs to be solved at its root cause at the callsites to this function - let unnamedCurriedCallerArgs, namedCurriedCallerArgs = - if isProp then - [List.concat unnamedCurriedCallerArgs], [List.concat namedCurriedCallerArgs] - else - unnamedCurriedCallerArgs, namedCurriedCallerArgs + // There is an mismatch when _uses_ of indexed property setters in the tc.fs code that calls this function. + // The arguments are passed as if they are curried with arity [numberOfIndexParameters;1], however in the TAST, indexed property setters + // are uncurried and have arity [numberOfIndexParameters+1]. + // + // Here we work around this mismatch by crunching all property argument lists to uncirred form. + // Ideally the problem needs to be solved at its root cause at the callsites to this function + let unnamedCurriedCallerArgs, namedCurriedCallerArgs = + if isProp then + [List.concat unnamedCurriedCallerArgs], [List.concat namedCurriedCallerArgs] + else + unnamedCurriedCallerArgs, namedCurriedCallerArgs - let MakeUnnamedCallerArgInfo x = (x, GetNewInferenceTypeForMethodArg cenv env tpenv x, x.Range) - - // "single named item" rule. This is where we have a single accessible method - // member x.M(arg1) - // being used with - // x.M (x, y) - // Without this rule this requires - // x.M ((x, y)) - match candidates with - | [calledMeth] - when (namedCurriedCallerArgs |> List.forall isNil && - let curriedCalledArgs = calledMeth.GetParamAttribs(cenv.amap, mItem) - curriedCalledArgs.Length = 1 && - curriedCalledArgs.Head.Length = 1 && - curriedCalledArgs.Head.Head |> isSimpleFormalArg) -> - let unnamedCurriedCallerArgs = curriedCallerArgs |> List.map (MakeUnnamedCallerArgInfo >> List.singleton) - let namedCurriedCallerArgs = namedCurriedCallerArgs |> List.map (fun _ -> []) - (Some (unnamedCurriedCallerArgs, namedCurriedCallerArgs), None, exprTy) - - // "single named item" rule. This is where we have a single accessible method - // member x.M(arg1, arg2) - // being used with - // x.M p - // We typecheck this as if it has been written "(fun (v1, v2) -> x.M(v1, v2)) p" - // Without this rule this requires - // x.M (fst p, snd p) - | [calledMeth] - when (namedCurriedCallerArgs |> List.forall isNil && - unnamedCurriedCallerArgs.Length = 1 && - unnamedCurriedCallerArgs.Head.Length = 1 && - let curriedCalledArgs = calledMeth.GetParamAttribs(cenv.amap, mItem) - curriedCalledArgs.Length = 1 && - curriedCalledArgs.Head.Length > 1 && - curriedCalledArgs.Head |> List.forall isSimpleFormalArg) -> - - // The call lambda has function type - let exprTy = mkFunTy (NewInferenceType ()) exprTy + let MakeUnnamedCallerArgInfo x = (x, GetNewInferenceTypeForMethodArg cenv env tpenv x, x.Range) + + // "single named item" rule. This is where we have a single accessible method + // member x.M(arg1) + // being used with + // x.M (x, y) + // Without this rule this requires + // x.M ((x, y)) + match candidates with + | [calledMeth] + when (namedCurriedCallerArgs |> List.forall isNil && + let curriedCalledArgs = calledMeth.GetParamAttribs(cenv.amap, mItem) + curriedCalledArgs.Length = 1 && + curriedCalledArgs.Head.Length = 1 && + curriedCalledArgs.Head.Head |> isSimpleFormalArg) -> + let unnamedCurriedCallerArgs = curriedCallerArgs |> List.map (MakeUnnamedCallerArgInfo >> List.singleton) + let namedCurriedCallerArgs = namedCurriedCallerArgs |> List.map (fun _ -> []) + (Some (unnamedCurriedCallerArgs, namedCurriedCallerArgs), None, exprTy) + + // "single named item" rule. This is where we have a single accessible method + // member x.M(arg1, arg2) + // being used with + // x.M p + // We typecheck this as if it has been written "(fun (v1, v2) -> x.M(v1, v2)) p" + // Without this rule this requires + // x.M (fst p, snd p) + | [calledMeth] + when (namedCurriedCallerArgs |> List.forall isNil && + unnamedCurriedCallerArgs.Length = 1 && + unnamedCurriedCallerArgs.Head.Length = 1 && + let curriedCalledArgs = calledMeth.GetParamAttribs(cenv.amap, mItem) + curriedCalledArgs.Length = 1 && + curriedCalledArgs.Head.Length > 1 && + curriedCalledArgs.Head |> List.forall isSimpleFormalArg) -> + + // The call lambda has function type + let exprTy = mkFunTy (NewInferenceType ()) exprTy - (None, Some unnamedCurriedCallerArgs.Head.Head, exprTy) + (None, Some unnamedCurriedCallerArgs.Head.Head, exprTy) - | _ -> - let unnamedCurriedCallerArgs = unnamedCurriedCallerArgs |> List.mapSquared MakeUnnamedCallerArgInfo - let namedCurriedCallerArgs = namedCurriedCallerArgs |> List.mapSquared (fun (isOpt, nm, x) -> - let ty = GetNewInferenceTypeForMethodArg cenv env tpenv x - // #435263: compiler crash with .net optional parameters and F# optional syntax - // named optional arguments should always have option type - let ty = if isOpt then mkOptionTy denv.g ty else ty - nm, isOpt, x, ty, x.Range - ) - - (Some (unnamedCurriedCallerArgs, namedCurriedCallerArgs), None, exprTy) + | _ -> + let unnamedCurriedCallerArgs = unnamedCurriedCallerArgs |> List.mapSquared MakeUnnamedCallerArgInfo + let namedCurriedCallerArgs = namedCurriedCallerArgs |> List.mapSquared (fun (isOpt, nm, x) -> + let ty = GetNewInferenceTypeForMethodArg cenv env tpenv x + // #435263: compiler crash with .net optional parameters and F# optional syntax + // named optional arguments should always have option type + let ty = if isOpt then mkOptionTy denv.g ty else ty + nm, isOpt, x, ty, x.Range) + + (Some (unnamedCurriedCallerArgs, namedCurriedCallerArgs), None, exprTy) let CalledMethHasSingleArgumentGroupOfThisLength n (calledMeth: MethInfo) = @@ -9983,21 +9982,12 @@ and TcMethodApplication let finalCalledMethInfo = finalCalledMeth.Method let finalCalledMethInst = finalCalledMeth.CalledTyArgs - let finalArgSets = finalCalledMeth.ArgSets let finalAssignedItemSetters = finalCalledMeth.AssignedItemSetters - let finalCalledPropInfoOpt = finalCalledMeth.AssociatedPropertyInfo let finalAttributeAssignedNamedItems = finalCalledMeth.AttributeAssignedNamedArgs - let finalUnnamedCalledOptArgs = finalCalledMeth.UnnamedCalledOptArgs - let finalUnnamedCalledOutArgs = finalCalledMeth.UnnamedCalledOutArgs - let finalAssignedNamedArgs = finalArgSets |> List.collect (fun argSet -> argSet.AssignedNamedArgs) - let finalParamArrayCallerArgs = finalArgSets |> List.collect (fun argSet -> argSet.ParamArrayCallerArgs) - let finalUnnamedCalledArgs = finalArgSets |> List.collect (fun argSet -> argSet.UnnamedCalledArgs) - let finalUnnamedCallerArgs = finalArgSets |> List.collect (fun argSet -> argSet.UnnamedCallerArgs) - // STEP 4. Check the attributes on the method and the corresponding event/property, if any - finalCalledPropInfoOpt |> Option.iter (fun pinfo -> CheckPropInfoAttributes pinfo mItem |> CommitOperationResult) + finalCalledMeth.AssociatedPropertyInfo |> Option.iter (fun pinfo -> CheckPropInfoAttributes pinfo mItem |> CommitOperationResult) let isInstance = not (isNil objArgs) MethInfoChecks cenv.g cenv.amap isInstance tyargsOpt objArgs ad mItem finalCalledMethInfo @@ -10026,266 +10016,13 @@ and TcMethodApplication | _ -> () end - if (finalArgSets |> List.existsi (fun i argSet -> argSet.UnnamedCalledArgs |> List.existsi (fun j ca -> ca.Position <> (i, j)))) then + if (finalCalledMeth.ArgSets |> List.existsi (fun i argSet -> argSet.UnnamedCalledArgs |> List.existsi (fun j ca -> ca.Position <> (i, j)))) then errorR(Deprecated(FSComp.SR.tcUnnamedArgumentsDoNotFormPrefix(), mMethExpr)) + /// STEP 5. Build the argument list. Adjust for optional arguments, byref arguments and coercions. - // STEP 5. Build the argument list. Adjust for optional arguments, byref arguments and coercions. - // For example, if you pass an F# reference cell to a byref then we must get the address of the - // contents of the ref. Likewise lots of adjustments are made for optional arguments etc. - - // Some of the code below must allocate temporary variables or bind other variables to particular values. - // As usual we represent variable allocators by expr -> expr functions - // which we then use to wrap the whole expression. These will either do nothing or pre-bind a variable. It doesn't - // matter what order they are applied in as long as they are all composed together. - let emptyPreBinder (e: Expr) = e - - // For unapplied 'e.M' we first evaluate 'e' outside the lambda, i.e. 'let v = e in (fun arg -> v.M(arg))' - let objArgPreBinder, objArgs = - match objArgs, lambdaVars with - | [objArg], Some _ -> - if finalCalledMethInfo.IsExtensionMember && finalCalledMethInfo.ObjArgNeedsAddress(cenv.amap, mMethExpr) then - error(Error(FSComp.SR.tcCannotPartiallyApplyExtensionMethodForByref(finalCalledMethInfo.DisplayName), mMethExpr)) - let objArgTy = tyOfExpr cenv.g objArg - let v, ve = mkCompGenLocal mMethExpr "objectArg" objArgTy - (fun body -> mkCompGenLet mMethExpr v objArg body), [ve] - | _ -> - emptyPreBinder, objArgs - - // Handle adhoc argument conversions - let coerceExpr isOutArg calledArgTy (reflArgInfo: ReflectedArgInfo) callerArgTy m callerArgExpr = - let g = cenv.g - - if isByrefTy g calledArgTy && isRefCellTy g callerArgTy then - None, Expr.Op (TOp.RefAddrGet false, [destRefCellTy g callerArgTy], [callerArgExpr], m) - -#if IMPLICIT_ADDRESS_OF - elif isInByrefTy g calledArgTy && not (isByrefTy cenv.g callerArgTy) then - let wrap, callerArgExprAddress, _readonly, _writeonly = mkExprAddrOfExpr g true false NeverMutates callerArgExpr None m - Some wrap, callerArgExprAddress -#endif - - elif isDelegateTy cenv.g calledArgTy && isFunTy cenv.g callerArgTy then - None, CoerceFromFSharpFuncToDelegate cenv.g cenv.amap cenv.infoReader ad callerArgTy m callerArgExpr calledArgTy - - elif isLinqExpressionTy cenv.g calledArgTy && isDelegateTy cenv.g (destLinqExpressionTy cenv.g calledArgTy) && isFunTy cenv.g callerArgTy then - let delegateTy = destLinqExpressionTy cenv.g calledArgTy - let expr = CoerceFromFSharpFuncToDelegate cenv.g cenv.amap cenv.infoReader ad callerArgTy m callerArgExpr delegateTy - None, mkCallQuoteToLinqLambdaExpression cenv.g m delegateTy (Expr.Quote (expr, ref None, false, m, mkQuotedExprTy cenv.g delegateTy)) - - // auto conversions to quotations (to match auto conversions to LINQ expressions) - elif reflArgInfo.AutoQuote && isQuotedExprTy cenv.g calledArgTy && not (isQuotedExprTy cenv.g callerArgTy) then - match reflArgInfo with - | ReflectedArgInfo.Quote true -> - None, mkCallLiftValueWithDefn cenv.g m calledArgTy callerArgExpr - | ReflectedArgInfo.Quote false -> - None, Expr.Quote (callerArgExpr, ref None, false, m, calledArgTy) - | ReflectedArgInfo.None -> failwith "unreachable" // unreachable due to reflArgInfo.AutoQuote condition - - // Note: out args do not need to be coerced - elif isOutArg then - None, callerArgExpr - - // Note: not all these casts are reported in quotations - else - None, mkCoerceIfNeeded cenv.g calledArgTy callerArgTy callerArgExpr - - // Handle param array and optional arguments - let optArgPreBinder, paramArrayPreBinders, allArgs, outArgExprs, outArgTmpBinds = - - let normalUnnamedArgs = - (finalUnnamedCalledArgs, finalUnnamedCallerArgs) ||> List.map2 (fun called caller -> { NamedArgIdOpt = None; CalledArg=called; CallerArg=caller }) - - let paramArrayPreBinders, paramArrayArgs = - match finalCalledMeth.ParamArrayCalledArgOpt with - | None -> - [], [] - | Some paramArrayCalledArg -> - let paramArrayCalledArgElementType = destArrayTy cenv.g paramArrayCalledArg.CalledArgumentType - - let paramArrayPreBinders, es = - finalParamArrayCallerArgs - |> List.map (fun callerArg -> - let (CallerArg(callerArgTy, m, isOutArg, callerArgExpr)) = callerArg - coerceExpr isOutArg paramArrayCalledArgElementType paramArrayCalledArg.ReflArgInfo callerArgTy m callerArgExpr) - |> List.unzip - - let arg = - [ { NamedArgIdOpt = None - CalledArg=paramArrayCalledArg - CallerArg=CallerArg(paramArrayCalledArg.CalledArgumentType, mMethExpr, false, Expr.Op (TOp.Array, [paramArrayCalledArgElementType], es, mMethExpr)) } ] - paramArrayPreBinders, arg - - // CLEANUP: Move all this code into some isolated file, e.g. "optional.fs" - // - // Handle CallerSide optional arguments. - // - // CallerSide optional arguments are largely for COM interop, e.g. to PIA assemblies for Word etc. - // As a result we follow the VB and C# behavior here. - // - // "1. If the parameter is statically typed as System.Object and does not have a value, then there are four cases: - // a. The parameter is marked with MarshalAs(IUnknown), MarshalAs(Interface), or MarshalAs(IDispatch). In this case we pass null. - // b. Else if the parameter is marked with IUnknownConstantAttribute. In this case we pass new System.Runtime.InteropServices.UnknownWrapper(null) - // c. Else if the parameter is marked with IDispatchConstantAttribute. In this case we pass new System.Runtime.InteropServices.DispatchWrapper(null) - // d. Else, we will pass Missing.Value. - // 2. Otherwise, if there is a value attribute, then emit the default value. - // 3. Otherwise, we emit default(T). - // 4. Finally, we apply conversions from the value to the parameter type. This is where the nullable conversions take place for VB. - // - VB allows you to mark ref parameters as optional. The semantics of this is that we create a temporary - // with type = type of parameter, load the optional value to it, and call the method. - // - VB also allows you to mark arrays with Nothing as the optional value. - // - VB also allows you to pass intrinsic values as optional values to parameters - // typed as Object. What we do in this case is we box the intrinsic value." - // - let optArgs, optArgPreBinder = - (emptyPreBinder, finalUnnamedCalledOptArgs) ||> List.mapFold (fun wrapper calledArg -> - let calledArgTy = calledArg.CalledArgumentType - let wrapper2, expr = - match calledArg.OptArgInfo with - | NotOptional -> - error(InternalError("Unexpected NotOptional", mItem)) - | CallerSide dfltVal -> - let rec build currCalledArgTy currDfltVal = - match currDfltVal with - | MissingValue -> - // Add an I_nop if this is an initonly field to make sure we never recognize it as an lvalue. See mkExprAddrOfExpr. - emptyPreBinder, mkAsmExpr ([ mkNormalLdsfld (fspec_Missing_Value cenv.g); AI_nop ], [], [], [currCalledArgTy], mMethExpr) - | DefaultValue -> - emptyPreBinder, mkDefault(mMethExpr, currCalledArgTy) - | Constant fieldInit -> - match currCalledArgTy with - | NullableTy cenv.g inst when fieldInit <> ILFieldInit.Null -> - let nullableTy = mkILNonGenericBoxedTy(cenv.g.FindSysILTypeRef "System.Nullable`1") - let ctor = mkILCtorMethSpecForTy(nullableTy, [ILType.TypeVar 0us]).MethodRef - let ctorArgs = [Expr.Const (TcFieldInit mMethExpr fieldInit, mMethExpr, inst)] - emptyPreBinder, Expr.Op (TOp.ILCall (false, false, true, true, NormalValUse, false, false, ctor, [inst], [], [currCalledArgTy]), [], ctorArgs, mMethExpr) - | ByrefTy cenv.g inst -> - build inst (PassByRef(inst, currDfltVal)) - | _ -> - match calledArg.CallerInfo, env.eCallerMemberName with - | CallerLineNumber, _ when typeEquiv cenv.g currCalledArgTy cenv.g.int_ty -> - emptyPreBinder, Expr.Const (Const.Int32(mMethExpr.StartLine), mMethExpr, currCalledArgTy) - | CallerFilePath, _ when typeEquiv cenv.g currCalledArgTy cenv.g.string_ty -> - let fileName = mMethExpr.FileName |> FileSystem.GetFullPathShim |> PathMap.apply cenv.g.pathMap - emptyPreBinder, Expr.Const (Const.String fileName, mMethExpr, currCalledArgTy) - | CallerMemberName, Some callerName when (typeEquiv cenv.g currCalledArgTy cenv.g.string_ty) -> - emptyPreBinder, Expr.Const (Const.String callerName, mMethExpr, currCalledArgTy) - | _ -> - emptyPreBinder, Expr.Const (TcFieldInit mMethExpr fieldInit, mMethExpr, currCalledArgTy) - - | WrapperForIDispatch -> - match cenv.g.TryFindSysILTypeRef "System.Runtime.InteropServices.DispatchWrapper" with - | None -> error(Error(FSComp.SR.fscSystemRuntimeInteropServicesIsRequired(), mMethExpr)) - | Some tref -> - let ty = mkILNonGenericBoxedTy tref - let mref = mkILCtorMethSpecForTy(ty, [cenv.g.ilg.typ_Object]).MethodRef - let expr = Expr.Op (TOp.ILCall (false, false, false, true, NormalValUse, false, false, mref, [], [], [cenv.g.obj_ty]), [], [mkDefault(mMethExpr, currCalledArgTy)], mMethExpr) - emptyPreBinder, expr - | WrapperForIUnknown -> - match cenv.g.TryFindSysILTypeRef "System.Runtime.InteropServices.UnknownWrapper" with - | None -> error(Error(FSComp.SR.fscSystemRuntimeInteropServicesIsRequired(), mMethExpr)) - | Some tref -> - let ty = mkILNonGenericBoxedTy tref - let mref = mkILCtorMethSpecForTy(ty, [cenv.g.ilg.typ_Object]).MethodRef - let expr = Expr.Op (TOp.ILCall (false, false, false, true, NormalValUse, false, false, mref, [], [], [cenv.g.obj_ty]), [], [mkDefault(mMethExpr, currCalledArgTy)], mMethExpr) - emptyPreBinder, expr - | PassByRef (ty, dfltVal2) -> - let v, _ = mkCompGenLocal mMethExpr "defaultByrefArg" ty - let wrapper2, rhs = build currCalledArgTy dfltVal2 - (wrapper2 >> mkCompGenLet mMethExpr v rhs), mkValAddr mMethExpr false (mkLocalValRef v) - build calledArgTy dfltVal - | CalleeSide -> - let calledNonOptTy = - if isOptionTy cenv.g calledArgTy then - destOptionTy cenv.g calledArgTy - else - calledArgTy // should be unreachable - - match calledArg.CallerInfo, env.eCallerMemberName with - | CallerLineNumber, _ when typeEquiv cenv.g calledNonOptTy cenv.g.int_ty -> - let lineExpr = Expr.Const(Const.Int32 mMethExpr.StartLine, mMethExpr, calledNonOptTy) - emptyPreBinder, mkSome cenv.g calledNonOptTy lineExpr mMethExpr - | CallerFilePath, _ when typeEquiv cenv.g calledNonOptTy cenv.g.string_ty -> - let fileName = mMethExpr.FileName |> FileSystem.GetFullPathShim |> PathMap.apply cenv.g.pathMap - let filePathExpr = Expr.Const (Const.String(fileName), mMethExpr, calledNonOptTy) - emptyPreBinder, mkSome cenv.g calledNonOptTy filePathExpr mMethExpr - | CallerMemberName, Some(callerName) when typeEquiv cenv.g calledNonOptTy cenv.g.string_ty -> - let memberNameExpr = Expr.Const (Const.String callerName, mMethExpr, calledNonOptTy) - emptyPreBinder, mkSome cenv.g calledNonOptTy memberNameExpr mMethExpr - | _ -> - emptyPreBinder, mkNone cenv.g calledNonOptTy mMethExpr - - // Combine the variable allocators (if any) - let wrapper = (wrapper >> wrapper2) - let callerArg = CallerArg(calledArgTy, mMethExpr, false, expr) - { NamedArgIdOpt = None; CalledArg = calledArg; CallerArg = callerArg }, wrapper) - - - // Handle optional arguments - let wrapOptionalArg (assignedArg: AssignedCalledArg<_>) = - let (CallerArg(callerArgTy, m, isOptCallerArg, expr)) = assignedArg.CallerArg - match assignedArg.CalledArg.OptArgInfo with - | NotOptional -> - if isOptCallerArg then errorR(Error(FSComp.SR.tcFormalArgumentIsNotOptional(), m)) - assignedArg - | _ -> - let expr = - match assignedArg.CalledArg.OptArgInfo with - | CallerSide _ -> - if isOptCallerArg then - // STRUCT OPTIONS: if we allow struct options as optional arguments then we should take - // the address correctly. - mkUnionCaseFieldGetUnprovenViaExprAddr (expr, mkSomeCase cenv.g, [destOptionTy cenv.g callerArgTy], 0, m) - else - expr - | CalleeSide -> - if isOptCallerArg then - // M(?x=bopt) when M(A) --> M(?x=Some(b.Value)) - expr - else - // M(x=b) when M(A) --> M(?x=Some(b :> A)) - let calledArgTy = assignedArg.CalledArg.CalledArgumentType - if isOptionTy cenv.g calledArgTy then - let calledNonOptTy = destOptionTy cenv.g calledArgTy - mkSome cenv.g calledNonOptTy (mkCoerceIfNeeded cenv.g calledNonOptTy callerArgTy expr) m - else - expr // should be unreachable - - | _ -> failwith "Unreachable" - { assignedArg with CallerArg=CallerArg((tyOfExpr cenv.g expr), m, isOptCallerArg, expr) } - - let outArgsAndExprs, outArgTmpBinds = - finalUnnamedCalledOutArgs |> List.map (fun calledArg -> - let calledArgTy = calledArg.CalledArgumentType - let outArgTy = destByrefTy cenv.g calledArgTy - let outv, outArgExpr = mkMutableCompGenLocal mMethExpr PrettyNaming.outArgCompilerGeneratedName outArgTy // mutable! - let expr = mkDefault(mMethExpr, outArgTy) - let callerArg = CallerArg(calledArgTy, mMethExpr, false, mkValAddr mMethExpr false (mkLocalValRef outv)) - let outArg = { NamedArgIdOpt=None;CalledArg=calledArg;CallerArg=callerArg } - (outArg, outArgExpr), mkCompGenBind outv expr) - |> List.unzip - - let outArgs, outArgExprs = List.unzip outArgsAndExprs - - let allArgs = - List.map wrapOptionalArg normalUnnamedArgs @ - List.map wrapOptionalArg finalAssignedNamedArgs @ - paramArrayArgs @ - optArgs @ - outArgs - - let allArgs = - allArgs |> List.sortBy (fun x -> x.Position) - - optArgPreBinder, paramArrayPreBinders, allArgs, outArgExprs, outArgTmpBinds - - let coerce (assignedArg: AssignedCalledArg<_>) = - let isOutArg = assignedArg.CalledArg.IsOutArg - let reflArgInfo = assignedArg.CalledArg.ReflArgInfo - let calledArgTy = assignedArg.CalledArg.CalledArgumentType - let (CallerArg(callerArgTy, m, _, e)) = assignedArg.CallerArg - - coerceExpr isOutArg calledArgTy reflArgInfo callerArgTy m e + let objArgPreBinder, objArgs, allArgsPreBinders, allArgs, allArgsCoerced, optArgPreBinder, paramArrayPreBinders, outArgExprs, outArgTmpBinds = + AdjustCallerArgExprs TcFieldInit env.eCallerMemberName cenv.g cenv.amap cenv.infoReader ad finalCalledMeth objArgs lambdaVars mItem mMethExpr // Record the resolution of the named argument for the Language Service allArgs |> List.iter (fun assignedArg -> @@ -10295,84 +10032,61 @@ and TcMethodApplication let item = Item.ArgName (defaultArg assignedArg.CalledArg.NameOpt id, assignedArg.CalledArg.CalledArgumentType, Some(ArgumentContainer.Method finalCalledMethInfo)) CallNameResolutionSink cenv.tcSink (id.idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Use, env.DisplayEnv, ad)) - let allArgsPreBinders, allArgsCoerced = List.map coerce allArgs |> List.unzip - // Make the call expression - let expr, exprty = + /// STEP 6. Build the call expression, then adjust for byref-returns, out-parameters-as-tuples, post-hoc property assignments, methods-as-first-class-value, + /// + + let callExpr0, exprty = BuildPossiblyConditionalMethodCall cenv env mut mMethExpr isProp finalCalledMethInfo isSuperInit finalCalledMethInst objArgs allArgsCoerced // Handle byref returns - let expr = + let callExpr1 = // byref-typed returns get implicitly dereferenced - let vty = tyOfExpr cenv.g expr + let vty = tyOfExpr cenv.g callExpr0 if isByrefTy cenv.g vty then let v, _ = mkCompGenLocal mMethExpr "byrefReturn" vty - mkCompGenLet mMethExpr v expr (mkAddrGet mMethExpr (mkLocalValRef v)) + mkCompGenLet mMethExpr v callExpr0 (mkAddrGet mMethExpr (mkLocalValRef v)) else - expr + callExpr0 // Bind "out" parameters as part of the result tuple - let expr, exprty = + let callExpr2, exprty = + let expr = callExpr1 if isNil outArgTmpBinds then expr, exprty else let outArgTys = outArgExprs |> List.map (tyOfExpr cenv.g) - let expr = if isUnitTy cenv.g exprty then mkCompGenSequential mMethExpr expr (mkRefTupled cenv.g mMethExpr outArgExprs outArgTys) - else mkRefTupled cenv.g mMethExpr (expr :: outArgExprs) (exprty :: outArgTys) + let expr = + if isUnitTy cenv.g exprty then + mkCompGenSequential mMethExpr expr (mkRefTupled cenv.g mMethExpr outArgExprs outArgTys) + else + mkRefTupled cenv.g mMethExpr (expr :: outArgExprs) (exprty :: outArgTys) let expr = mkLetsBind mMethExpr outArgTmpBinds expr expr, tyOfExpr cenv.g expr // Handle post-hoc property assignments - let setterExprPrebinders, expr = - if isCheckingAttributeCall then - [], expr - elif isNil finalAssignedItemSetters then - [], expr - else - // This holds the result of the call - let objv, objExpr = mkMutableCompGenLocal mMethExpr "returnVal" exprty // mutable in case it's a struct - // This expression mutates the properties on the result of the call - let setterExprPrebinders, propSetExpr = - (mkUnit cenv.g mMethExpr, finalAssignedItemSetters) ||> List.mapFold (fun acc (AssignedItemSetter(id, setter, CallerArg(callerArgTy, m, isOptCallerArg, argExpr))) -> - if isOptCallerArg then error(Error(FSComp.SR.tcInvalidOptionalAssignmentToPropertyOrField(), m)) - - let argExprPrebinder, action, defnItem = - match setter with - | AssignedPropSetter (pinfo, pminfo, pminst) -> - MethInfoChecks cenv.g cenv.amap true None [objExpr] ad m pminfo - let calledArgTy = List.head (List.head (pminfo.GetParamTypes(cenv.amap, m, pminst))) - let argExprPrebinder, argExpr = coerceExpr false calledArgTy ReflectedArgInfo.None callerArgTy m argExpr - let mut = (if isStructTy cenv.g (tyOfExpr cenv.g objExpr) then DefinitelyMutates else PossiblyMutates) - let action = BuildPossiblyConditionalMethodCall cenv env mut m true pminfo NormalValUse pminst [objExpr] [argExpr] |> fst - argExprPrebinder, action, Item.Property (pinfo.PropertyName, [pinfo]) - - | AssignedILFieldSetter finfo -> - // Get or set instance IL field - ILFieldInstanceChecks cenv.g cenv.amap ad m finfo - let calledArgTy = finfo.FieldType (cenv.amap, m) - let argExprPrebinder, argExpr = coerceExpr false calledArgTy ReflectedArgInfo.None callerArgTy m argExpr - let action = BuildILFieldSet cenv.g m objExpr finfo argExpr - argExprPrebinder, action, Item.ILField finfo - - | AssignedRecdFieldSetter rfinfo -> - RecdFieldInstanceChecks cenv.g cenv.amap ad m rfinfo - let calledArgTy = rfinfo.FieldType - CheckRecdFieldMutation m denv rfinfo - let argExprPrebinder, argExpr = coerceExpr false calledArgTy ReflectedArgInfo.None callerArgTy m argExpr - let action = BuildRecdFieldSet cenv.g m objExpr rfinfo argExpr - argExprPrebinder, action, Item.RecdField rfinfo - - // Record the resolution for the Language Service - let item = Item.SetterArg (id, defnItem) - CallNameResolutionSink cenv.tcSink (id.idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Use, env.DisplayEnv, ad) - - argExprPrebinder, mkCompGenSequential m acc action) - - // now put them together - let expr = mkCompGenLet mMethExpr objv expr (mkCompGenSequential mMethExpr propSetExpr objExpr) - setterExprPrebinders, expr - - // Build the lambda expression if any - let expr = + let setterExprPrebinders, callExpr3 = + let expr = callExpr2 + if isCheckingAttributeCall then + [], expr + elif isNil finalAssignedItemSetters then + [], expr + else + // This holds the result of the call + let objv, objExpr = mkMutableCompGenLocal mMethExpr "returnVal" exprty // mutable in case it's a struct + + // Build the expression that mutates the properties on the result of the call + let setterExprPrebinders, propSetExpr = + (mkUnit cenv.g mMethExpr, finalAssignedItemSetters) ||> List.mapFold (fun acc assignedItemSetter -> + let argExprPrebinder, action, m = TcSetterArgExpr cenv env denv objExpr ad assignedItemSetter + argExprPrebinder, mkCompGenSequential m acc action) + + // now put them together + let expr = mkCompGenLet mMethExpr objv expr (mkCompGenSequential mMethExpr propSetExpr objExpr) + setterExprPrebinders, expr + + // Build the lambda expression if any, if the method is used as a first-class value + let callExpr4 = + let expr = callExpr3 match lambdaVars with | None -> expr | Some curriedLambdaVars -> @@ -10382,7 +10096,8 @@ and TcMethodApplication | _ -> mkMultiLambda mMethExpr vs (expr, tyOfExpr cenv.g expr) List.foldBack mkLambda curriedLambdaVars expr - let expr, tpenv = + let callExpr5, tpenv = + let expr = callExpr4 match unnamedDelayedCallerArgExprOpt with | Some synArgExpr -> match lambdaVars with @@ -10395,15 +10110,53 @@ and TcMethodApplication expr, tpenv // Apply the PreBinders, if any - let expr = (expr, setterExprPrebinders) ||> List.fold (fun expr argPreBinder -> match argPreBinder with None -> expr | Some f -> f expr) - let expr = (expr, paramArrayPreBinders) ||> List.fold (fun expr argPreBinder -> match argPreBinder with None -> expr | Some f -> f expr) - let expr = (expr, allArgsPreBinders) ||> List.fold (fun expr argPreBinder -> match argPreBinder with None -> expr | Some f -> f expr) + let callExpr6 = + let expr = callExpr5 + let expr = (expr, setterExprPrebinders) ||> List.fold (fun expr argPreBinder -> match argPreBinder with None -> expr | Some f -> f expr) + let expr = (expr, paramArrayPreBinders) ||> List.fold (fun expr argPreBinder -> match argPreBinder with None -> expr | Some f -> f expr) + let expr = (expr, allArgsPreBinders) ||> List.fold (fun expr argPreBinder -> match argPreBinder with None -> expr | Some f -> f expr) - let expr = optArgPreBinder expr - let expr = objArgPreBinder expr + let expr = optArgPreBinder expr + let expr = objArgPreBinder expr + expr - (expr, finalAttributeAssignedNamedItems, delayed), tpenv + (callExpr6, finalAttributeAssignedNamedItems, delayed), tpenv +and TcSetterArgExpr cenv env denv objExpr ad (AssignedItemSetter(id, setter, CallerArg(callerArgTy, m, isOptCallerArg, argExpr))) = + if isOptCallerArg then error(Error(FSComp.SR.tcInvalidOptionalAssignmentToPropertyOrField(), m)) + + let argExprPrebinder, action, defnItem = + match setter with + | AssignedPropSetter (pinfo, pminfo, pminst) -> + MethInfoChecks cenv.g cenv.amap true None [objExpr] ad m pminfo + let calledArgTy = List.head (List.head (pminfo.GetParamTypes(cenv.amap, m, pminst))) + let argExprPrebinder, argExpr = MethodCalls.AdjustCallerArgExprForCoercions cenv.g cenv.amap cenv.infoReader ad false calledArgTy ReflectedArgInfo.None callerArgTy m argExpr + let mut = (if isStructTy cenv.g (tyOfExpr cenv.g objExpr) then DefinitelyMutates else PossiblyMutates) + let action = BuildPossiblyConditionalMethodCall cenv env mut m true pminfo NormalValUse pminst [objExpr] [argExpr] |> fst + argExprPrebinder, action, Item.Property (pinfo.PropertyName, [pinfo]) + + | AssignedILFieldSetter finfo -> + // Get or set instance IL field + ILFieldInstanceChecks cenv.g cenv.amap ad m finfo + let calledArgTy = finfo.FieldType (cenv.amap, m) + let argExprPrebinder, argExpr = MethodCalls.AdjustCallerArgExprForCoercions cenv.g cenv.amap cenv.infoReader ad false calledArgTy ReflectedArgInfo.None callerArgTy m argExpr + let action = BuildILFieldSet cenv.g m objExpr finfo argExpr + argExprPrebinder, action, Item.ILField finfo + + | AssignedRecdFieldSetter rfinfo -> + RecdFieldInstanceChecks cenv.g cenv.amap ad m rfinfo + let calledArgTy = rfinfo.FieldType + CheckRecdFieldMutation m denv rfinfo + let argExprPrebinder, argExpr = MethodCalls.AdjustCallerArgExprForCoercions cenv.g cenv.amap cenv.infoReader ad false calledArgTy ReflectedArgInfo.None callerArgTy m argExpr + let action = BuildRecdFieldSet cenv.g m objExpr rfinfo argExpr + argExprPrebinder, action, Item.RecdField rfinfo + + // Record the resolution for the Language Service + let item = Item.SetterArg (id, defnItem) + CallNameResolutionSink cenv.tcSink (id.idRange, env.NameEnv, item, item, emptyTyparInst, ItemOccurence.Use, env.DisplayEnv, ad) + + argExprPrebinder, action, m + and TcUnnamedMethodArgs cenv env lambdaPropagationInfo tpenv args = List.mapiFoldSquared (TcUnnamedMethodArg cenv env) (lambdaPropagationInfo, tpenv) args From efcd1087c257fa981c3714e894baf5d903240a99 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 27 Jul 2019 11:26:05 -0700 Subject: [PATCH 138/159] Update dependencies from https://github.com/dotnet/arcade build 20190726.18 (#7285) - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19376.18 --- eng/Version.Details.xml | 4 +- eng/common/post-build/darc-gather-drop.ps1 | 17 ++-- eng/common/post-build/nuget-validation.ps1 | 5 +- eng/common/post-build/post-build-utils.ps1 | 90 +++++++++++++++++++ eng/common/post-build/promote-build.ps1 | 37 ++++---- eng/common/post-build/setup-maestro-vars.ps1 | 26 ++++++ .../post-build/sourcelink-validation.ps1 | 31 ++++--- eng/common/post-build/symbols-validation.ps1 | 29 +++--- .../post-build/trigger-subscriptions.ps1 | 48 ++++------ .../channels/internal-servicing.yml | 5 +- .../channels/public-dev-release.yml | 5 +- .../post-build/channels/public-release.yml | 5 +- .../channels/public-validation-release.yml | 9 +- .../templates/post-build/common-variables.yml | 34 +++++-- .../templates/post-build/darc-gather-drop.yml | 5 +- .../templates/post-build/post-build.yml | 5 +- .../templates/post-build/promote-build.yml | 5 +- .../post-build/setup-maestro-vars.yml | 21 +---- .../post-build/trigger-subscription.yml | 4 +- global.json | 2 +- 20 files changed, 246 insertions(+), 141 deletions(-) create mode 100644 eng/common/post-build/post-build-utils.ps1 create mode 100644 eng/common/post-build/setup-maestro-vars.ps1 diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 7a0a634b41..0893278ac1 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - ef1c110152df0d500fffb87878a86f88d1ca5295 + 316481e57ee5e6acbbf2401eb6778a1d3d48d25b diff --git a/eng/common/post-build/darc-gather-drop.ps1 b/eng/common/post-build/darc-gather-drop.ps1 index 9cc2f1a009..93a0bd8328 100644 --- a/eng/common/post-build/darc-gather-drop.ps1 +++ b/eng/common/post-build/darc-gather-drop.ps1 @@ -1,13 +1,12 @@ param( - [Parameter(Mandatory=$true)][string] $BarBuildId, # ID of the build which assets should be downloaded - [Parameter(Mandatory=$true)][string] $MaestroAccessToken, # Token used to access Maestro API - [Parameter(Mandatory=$true)][string] $DropLocation # Where the assets should be downloaded to + [Parameter(Mandatory=$true)][int] $BarBuildId, # ID of the build which assets should be downloaded + [Parameter(Mandatory=$true)][string] $DropLocation, # Where the assets should be downloaded to + [Parameter(Mandatory=$true)][string] $MaestroApiAccessToken, # Token used to access Maestro API + [Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = "https://maestro-prod.westus2.cloudapp.azure.com", # Maestro API URL + [Parameter(Mandatory=$false)][string] $MaestroApiVersion = "2019-01-16" # Version of Maestro API to use ) -$ErrorActionPreference = "Stop" -Set-StrictMode -Version 2.0 - -. $PSScriptRoot\..\tools.ps1 +. $PSScriptRoot\post-build-utils.ps1 try { Write-Host "Installing DARC ..." @@ -24,8 +23,8 @@ try { --continue-on-error ` --id $BarBuildId ` --output-dir $DropLocation ` - --bar-uri https://maestro-prod.westus2.cloudapp.azure.com/ ` - --password $MaestroAccessToken ` + --bar-uri $MaestroApiEndpoint ` + --password $MaestroApiAccessToken ` --latest-location } catch { diff --git a/eng/common/post-build/nuget-validation.ps1 b/eng/common/post-build/nuget-validation.ps1 index 1bdced1e30..78ed0d540f 100644 --- a/eng/common/post-build/nuget-validation.ps1 +++ b/eng/common/post-build/nuget-validation.ps1 @@ -6,10 +6,7 @@ param( [Parameter(Mandatory=$true)][string] $ToolDestinationPath # Where the validation tool should be downloaded to ) -$ErrorActionPreference = "Stop" -Set-StrictMode -Version 2.0 - -. $PSScriptRoot\..\tools.ps1 +. $PSScriptRoot\post-build-utils.ps1 try { $url = "https://raw.githubusercontent.com/NuGet/NuGetGallery/jver-verify/src/VerifyMicrosoftPackage/verify.ps1" diff --git a/eng/common/post-build/post-build-utils.ps1 b/eng/common/post-build/post-build-utils.ps1 new file mode 100644 index 0000000000..551ae113f8 --- /dev/null +++ b/eng/common/post-build/post-build-utils.ps1 @@ -0,0 +1,90 @@ +# Most of the functions in this file require the variables `MaestroApiEndPoint`, +# `MaestroApiVersion` and `MaestroApiAccessToken` to be globally available. + +$ErrorActionPreference = "Stop" +Set-StrictMode -Version 2.0 + +# `tools.ps1` checks $ci to perform some actions. Since the post-build +# scripts don't necessarily execute in the same agent that run the +# build.ps1/sh script this variable isn't automatically set. +$ci = $true +. $PSScriptRoot\..\tools.ps1 + +function Create-MaestroApiRequestHeaders([string]$ContentType = "application/json") { + Validate-MaestroVars + + $headers = New-Object 'System.Collections.Generic.Dictionary[[String],[String]]' + $headers.Add('Accept', $ContentType) + $headers.Add('Authorization',"Bearer $MaestroApiAccessToken") + return $headers +} + +function Get-MaestroChannel([int]$ChannelId) { + Validate-MaestroVars + + $apiHeaders = Create-MaestroApiRequestHeaders + $apiEndpoint = "$MaestroApiEndPoint/api/channels/${ChannelId}?api-version=$MaestroApiVersion" + + $result = try { Invoke-WebRequest -Method Get -Uri $apiEndpoint -Headers $apiHeaders | ConvertFrom-Json } catch { Write-Host "Error: $_" } + return $result +} + +function Get-MaestroBuild([int]$BuildId) { + Validate-MaestroVars + + $apiHeaders = Create-MaestroApiRequestHeaders -AuthToken $MaestroApiAccessToken + $apiEndpoint = "$MaestroApiEndPoint/api/builds/${BuildId}?api-version=$MaestroApiVersion" + + $result = try { return Invoke-WebRequest -Method Get -Uri $apiEndpoint -Headers $apiHeaders | ConvertFrom-Json } catch { Write-Host "Error: $_" } + return $result +} + +function Get-MaestroSubscriptions([string]$SourceRepository, [int]$ChannelId) { + Validate-MaestroVars + + $SourceRepository = [System.Web.HttpUtility]::UrlEncode($SourceRepository) + $apiHeaders = Create-MaestroApiRequestHeaders -AuthToken $MaestroApiAccessToken + $apiEndpoint = "$MaestroApiEndPoint/api/subscriptions?sourceRepository=$SourceRepository&channelId=$ChannelId&api-version=$MaestroApiVersion" + + $result = try { Invoke-WebRequest -Method Get -Uri $apiEndpoint -Headers $apiHeaders | ConvertFrom-Json } catch { Write-Host "Error: $_" } + return $result +} + +function Trigger-Subscription([string]$SubscriptionId) { + Validate-MaestroVars + + $apiHeaders = Create-MaestroApiRequestHeaders -AuthToken $MaestroApiAccessToken + $apiEndpoint = "$MaestroApiEndPoint/api/subscriptions/$SubscriptionId/trigger?api-version=$MaestroApiVersion" + Invoke-WebRequest -Uri $apiEndpoint -Headers $apiHeaders -Method Post | Out-Null +} + +function Assign-BuildToChannel([int]$BuildId, [int]$ChannelId) { + Validate-MaestroVars + + $apiHeaders = Create-MaestroApiRequestHeaders -AuthToken $MaestroApiAccessToken + $apiEndpoint = "$MaestroApiEndPoint/api/channels/${ChannelId}/builds/${BuildId}?api-version=$MaestroApiVersion" + Invoke-WebRequest -Method Post -Uri $apiEndpoint -Headers $apiHeaders | Out-Null +} + +function Validate-MaestroVars { + try { + Get-Variable MaestroApiEndPoint -Scope Global | Out-Null + Get-Variable MaestroApiVersion -Scope Global | Out-Null + Get-Variable MaestroApiAccessToken -Scope Global | Out-Null + + if (!($MaestroApiEndPoint -Match "^http[s]?://maestro-(int|prod).westus2.cloudapp.azure.com$")) { + Write-PipelineTaskError "MaestroApiEndPoint is not a valid Maestro URL. '$MaestroApiEndPoint'" + ExitWithExitCode 1 + } + + if (!($MaestroApiVersion -Match "^[0-9]{4}-[0-9]{2}-[0-9]{2}$")) { + Write-PipelineTaskError "MaestroApiVersion does not match a version string in the format yyyy-MM-DD. '$MaestroApiVersion'" + ExitWithExitCode 1 + } + } + catch { + Write-PipelineTaskError "Error: Variables `MaestroApiEndPoint`, `MaestroApiVersion` and `MaestroApiAccessToken` are required while using this script." + Write-Host $_ + ExitWithExitCode 1 + } +} diff --git a/eng/common/post-build/promote-build.ps1 b/eng/common/post-build/promote-build.ps1 index 84a608fa56..e5ae85f251 100644 --- a/eng/common/post-build/promote-build.ps1 +++ b/eng/common/post-build/promote-build.ps1 @@ -1,30 +1,25 @@ param( [Parameter(Mandatory=$true)][int] $BuildId, [Parameter(Mandatory=$true)][int] $ChannelId, - [Parameter(Mandatory=$true)][string] $BarToken, - [string] $MaestroEndpoint = "https://maestro-prod.westus2.cloudapp.azure.com", - [string] $ApiVersion = "2019-01-16" + [Parameter(Mandatory=$true)][string] $MaestroApiAccessToken, + [Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = "https://maestro-prod.westus2.cloudapp.azure.com", + [Parameter(Mandatory=$false)][string] $MaestroApiVersion = "2019-01-16" ) -$ErrorActionPreference = "Stop" -Set-StrictMode -Version 2.0 - -. $PSScriptRoot\..\tools.ps1 - -function Get-Headers([string]$accept, [string]$barToken) { - $headers = New-Object 'System.Collections.Generic.Dictionary[[String],[String]]' - $headers.Add('Accept',$accept) - $headers.Add('Authorization',"Bearer $barToken") - return $headers -} +. $PSScriptRoot\post-build-utils.ps1 try { - $maestroHeaders = Get-Headers 'application/json' $BarToken + # Check that the channel we are going to promote the build to exist + $channelInfo = Get-MaestroChannel -ChannelId $ChannelId - # Get info about which channels the build has already been promoted to - $getBuildApiEndpoint = "$MaestroEndpoint/api/builds/${BuildId}?api-version=$ApiVersion" - $buildInfo = Invoke-WebRequest -Method Get -Uri $getBuildApiEndpoint -Headers $maestroHeaders | ConvertFrom-Json + if (!$channelInfo) { + Write-Host "Channel with BAR ID $ChannelId was not found in BAR!" + ExitWithExitCode 1 + } + # Get info about which channels the build has already been promoted to + $buildInfo = Get-MaestroBuild -BuildId $BuildId + if (!$buildInfo) { Write-Host "Build with BAR ID $BuildId was not found in BAR!" ExitWithExitCode 1 @@ -40,10 +35,10 @@ try { } } - Write-Host "Build not present in channel $ChannelId. Promoting build ... " + Write-Host "Promoting build '$BuildId' to channel '$ChannelId'." + + Assign-BuildToChannel -BuildId $BuildId -ChannelId $ChannelId - $promoteBuildApiEndpoint = "$maestroEndpoint/api/channels/${ChannelId}/builds/${BuildId}?api-version=$ApiVersion" - Invoke-WebRequest -Method Post -Uri $promoteBuildApiEndpoint -Headers $maestroHeaders Write-Host "done." } catch { diff --git a/eng/common/post-build/setup-maestro-vars.ps1 b/eng/common/post-build/setup-maestro-vars.ps1 new file mode 100644 index 0000000000..d7f64dc63c --- /dev/null +++ b/eng/common/post-build/setup-maestro-vars.ps1 @@ -0,0 +1,26 @@ +param( + [Parameter(Mandatory=$true)][string] $ReleaseConfigsPath # Full path to ReleaseConfigs.txt asset +) + +. $PSScriptRoot\post-build-utils.ps1 + +try { + $Content = Get-Content $ReleaseConfigsPath + + $BarId = $Content | Select -Index 0 + + $Channels = "" + $Content | Select -Index 1 | ForEach-Object { $Channels += "$_ ," } + + $IsStableBuild = $Content | Select -Index 2 + + Write-PipelineSetVariable -Name 'BARBuildId' -Value $BarId + Write-PipelineSetVariable -Name 'InitialChannels' -Value "$Channels" + Write-PipelineSetVariable -Name 'IsStableBuild' -Value $IsStableBuild +} +catch { + Write-Host $_ + Write-Host $_.Exception + Write-Host $_.ScriptStackTrace + ExitWithExitCode 1 +} diff --git a/eng/common/post-build/sourcelink-validation.ps1 b/eng/common/post-build/sourcelink-validation.ps1 index 8abd684e9e..41e01ae6e6 100644 --- a/eng/common/post-build/sourcelink-validation.ps1 +++ b/eng/common/post-build/sourcelink-validation.ps1 @@ -6,10 +6,7 @@ param( [Parameter(Mandatory=$true)][string] $SourcelinkCliVersion # Version of SourceLink CLI to use ) -$ErrorActionPreference = "Stop" -Set-StrictMode -Version 2.0 - -. $PSScriptRoot\..\tools.ps1 +. $PSScriptRoot\post-build-utils.ps1 # Cache/HashMap (File -> Exist flag) used to consult whether a file exist # in the repository at a specific commit point. This is populated by inserting @@ -200,21 +197,27 @@ function ValidateSourceLinkLinks { } } -function CheckExitCode ([string]$stage) { - $exitCode = $LASTEXITCODE - if ($exitCode -ne 0) { - Write-PipelineTaskError "Something failed while '$stage'. Check for errors above. Exiting now..." - ExitWithExitCode $exitCode +function InstallSourcelinkCli { + $sourcelinkCliPackageName = "sourcelink" + + $dotnetRoot = InitializeDotNetCli -install:$true + $dotnet = "$dotnetRoot\dotnet.exe" + $toolList = & "$dotnet" tool list --global + + if (($toolList -like "*$sourcelinkCliPackageName*") -and ($toolList -like "*$sourcelinkCliVersion*")) { + Write-Host "SourceLink CLI version $sourcelinkCliVersion is already installed." + } + else { + Write-Host "Installing SourceLink CLI version $sourcelinkCliVersion..." + Write-Host "You may need to restart your command window if this is the first dotnet tool you have installed." + & "$dotnet" tool install $sourcelinkCliPackageName --version $sourcelinkCliVersion --verbosity "minimal" --global } } try { - Write-Host "Installing SourceLink CLI..." - Get-Location - . $PSScriptRoot\sourcelink-cli-init.ps1 -sourcelinkCliVersion $SourcelinkCliVersion - CheckExitCode "Running sourcelink-cli-init" + InstallSourcelinkCli - Measure-Command { ValidateSourceLinkLinks } + ValidateSourceLinkLinks } catch { Write-Host $_ diff --git a/eng/common/post-build/symbols-validation.ps1 b/eng/common/post-build/symbols-validation.ps1 index 69456854e0..d5ec51b150 100644 --- a/eng/common/post-build/symbols-validation.ps1 +++ b/eng/common/post-build/symbols-validation.ps1 @@ -4,10 +4,7 @@ param( [Parameter(Mandatory=$true)][string] $DotnetSymbolVersion # Version of dotnet symbol to use ) -$ErrorActionPreference = "Stop" -Set-StrictMode -Version 2.0 - -. $PSScriptRoot\..\tools.ps1 +. $PSScriptRoot\post-build-utils.ps1 Add-Type -AssemblyName System.IO.Compression.FileSystem @@ -162,19 +159,25 @@ function CheckSymbolsAvailable { } } -function CheckExitCode ([string]$stage) { - $exitCode = $LASTEXITCODE - if ($exitCode -ne 0) { - Write-PipelineTaskError "Something failed while '$stage'. Check for errors above. Exiting now..." - ExitWithExitCode $exitCode +function Installdotnetsymbol { + $dotnetsymbolPackageName = "dotnet-symbol" + + $dotnetRoot = InitializeDotNetCli -install:$true + $dotnet = "$dotnetRoot\dotnet.exe" + $toolList = & "$dotnet" tool list --global + + if (($toolList -like "*$dotnetsymbolPackageName*") -and ($toolList -like "*$dotnetsymbolVersion*")) { + Write-Host "dotnet-symbol version $dotnetsymbolVersion is already installed." + } + else { + Write-Host "Installing dotnet-symbol version $dotnetsymbolVersion..." + Write-Host "You may need to restart your command window if this is the first dotnet tool you have installed." + & "$dotnet" tool install $dotnetsymbolPackageName --version $dotnetsymbolVersion --verbosity "minimal" --global } } try { - Write-Host "Installing dotnet symbol ..." - Get-Location - . $PSScriptRoot\dotnetsymbol-init.ps1 -dotnetsymbolVersion $DotnetSymbolVersion - CheckExitCode "Running dotnetsymbol-init" + Installdotnetsymbol CheckSymbolsAvailable } diff --git a/eng/common/post-build/trigger-subscriptions.ps1 b/eng/common/post-build/trigger-subscriptions.ps1 index 1a91dab037..926d5b4551 100644 --- a/eng/common/post-build/trigger-subscriptions.ps1 +++ b/eng/common/post-build/trigger-subscriptions.ps1 @@ -1,33 +1,20 @@ -param( +param( [Parameter(Mandatory=$true)][string] $SourceRepo, [Parameter(Mandatory=$true)][int] $ChannelId, - [string] $MaestroEndpoint = "https://maestro-prod.westus2.cloudapp.azure.com", - [string] $BarToken, - [string] $ApiVersion = "2019-01-16" + [Parameter(Mandatory=$true)][string] $MaestroApiAccessToken, + [Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = "https://maestro-prod.westus2.cloudapp.azure.com", + [Parameter(Mandatory=$false)][string] $MaestroApiVersion = "2019-01-16" ) -$ErrorActionPreference = "Stop" -Set-StrictMode -Version 2.0 - -. $PSScriptRoot\..\tools.ps1 - -function Get-Headers([string]$accept, [string]$barToken) { - $headers = New-Object 'System.Collections.Generic.Dictionary[[String],[String]]' - $headers.Add('Accept',$accept) - $headers.Add('Authorization',"Bearer $barToken") - return $headers -} +. $PSScriptRoot\post-build-utils.ps1 # Get all the $SourceRepo subscriptions $normalizedSourceRepo = $SourceRepo.Replace('dnceng@', '') -$getSubscriptionsApiEndpoint = "$maestroEndpoint/api/subscriptions?sourceRepository=$normalizedSourceRepo&api-version=$apiVersion" -$headers = Get-Headers 'application/json' $barToken - -$subscriptions = Invoke-WebRequest -Uri $getSubscriptionsApiEndpoint -Headers $headers | ConvertFrom-Json +$subscriptions = Get-MaestroSubscriptions -SourceRepository $normalizedSourceRepo -ChannelId $ChannelId if (!$subscriptions) { Write-Host "No subscriptions found for source repo '$normalizedSourceRepo' in channel '$ChannelId'" - return + ExitWithExitCode 0 } $subscriptionsToTrigger = New-Object System.Collections.Generic.List[string] @@ -36,21 +23,18 @@ $failedTriggeredSubscription = $false # Get all enabled subscriptions that need dependency flow on 'everyBuild' foreach ($subscription in $subscriptions) { if ($subscription.enabled -and $subscription.policy.updateFrequency -like 'everyBuild' -and $subscription.channel.id -eq $ChannelId) { - Write-Host "$subscription.id" + Write-Host "Should trigger this subscription: $subscription.id" [void]$subscriptionsToTrigger.Add($subscription.id) } } foreach ($subscriptionToTrigger in $subscriptionsToTrigger) { try { - $triggerSubscriptionApiEndpoint = "$maestroEndpoint/api/subscriptions/$subscriptionToTrigger/trigger?api-version=$apiVersion" - $headers = Get-Headers 'application/json' $BarToken - - Write-Host "Triggering subscription '$subscriptionToTrigger'..." + Write-Host "Triggering subscription '$subscriptionToTrigger'." - Invoke-WebRequest -Uri $triggerSubscriptionApiEndpoint -Headers $headers -Method Post + Trigger-Subscription -SubscriptionId $subscriptionToTrigger - Write-Host "Subscription '$subscriptionToTrigger' triggered!" + Write-Host "done." } catch { @@ -61,9 +45,13 @@ foreach ($subscriptionToTrigger in $subscriptionsToTrigger) { } } -if ($failedTriggeredSubscription) { +if ($subscriptionsToTrigger.Count -eq 0) { + Write-Host "No subscription matched source repo '$normalizedSourceRepo' and channel ID '$ChannelId'." +} +elseif ($failedTriggeredSubscription) { Write-Host "At least one subscription failed to be triggered..." ExitWithExitCode 1 } - -Write-Host "All subscriptions were triggered successfully!" +else { + Write-Host "All subscriptions were triggered successfully!" +} diff --git a/eng/common/templates/post-build/channels/internal-servicing.yml b/eng/common/templates/post-build/channels/internal-servicing.yml index 5c07b66926..12fd2b4653 100644 --- a/eng/common/templates/post-build/channels/internal-servicing.yml +++ b/eng/common/templates/post-build/channels/internal-servicing.yml @@ -41,7 +41,6 @@ stages: dependsOn: setupMaestroVars variables: - group: DotNet-Blob-Feed - - group: Publish-Build-Assets - group: AzureDevOps-Artifact-Feeds-Pats - name: BARBuildId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] @@ -87,8 +86,8 @@ stages: /p:StaticInternalFeed=$(dotnetfeed-internal-nonstable-feed-url) /p:NugetPath=$(Agent.BuildDirectory)\Nuget\NuGet.exe /p:BARBuildId=$(BARBuildId) - /p:MaestroApiEndpoint='https://maestro-prod.westus2.cloudapp.azure.com' - /p:BuildAssetRegistryToken='$(MaestroAccessToken)' + /p:MaestroApiEndpoint='$(MaestroApiEndPoint)' + /p:BuildAssetRegistryToken='$(MaestroApiAccessToken)' /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' /p:BlobBasePath='$(Build.ArtifactStagingDirectory)\BlobArtifacts' /p:PackageBasePath='$(Build.ArtifactStagingDirectory)\PackageArtifacts' diff --git a/eng/common/templates/post-build/channels/public-dev-release.yml b/eng/common/templates/post-build/channels/public-dev-release.yml index 4eaa6e4ff0..b0f085b142 100644 --- a/eng/common/templates/post-build/channels/public-dev-release.yml +++ b/eng/common/templates/post-build/channels/public-dev-release.yml @@ -41,7 +41,6 @@ stages: dependsOn: setupMaestroVars variables: - group: DotNet-Blob-Feed - - group: Publish-Build-Assets - group: AzureDevOps-Artifact-Feeds-Pats - name: BARBuildId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] @@ -87,8 +86,8 @@ stages: /p:TargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' /p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)' /p:BARBuildId=$(BARBuildId) - /p:MaestroApiEndpoint='https://maestro-prod.westus2.cloudapp.azure.com' - /p:BuildAssetRegistryToken='$(MaestroAccessToken)' + /p:MaestroApiEndpoint='$(MaestroApiEndPoint)' + /p:BuildAssetRegistryToken='$(MaestroApiAccessToken)' /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts/' diff --git a/eng/common/templates/post-build/channels/public-release.yml b/eng/common/templates/post-build/channels/public-release.yml index a31d37139b..4c63fb43f0 100644 --- a/eng/common/templates/post-build/channels/public-release.yml +++ b/eng/common/templates/post-build/channels/public-release.yml @@ -41,7 +41,6 @@ stages: dependsOn: setupMaestroVars variables: - group: DotNet-Blob-Feed - - group: Publish-Build-Assets - group: AzureDevOps-Artifact-Feeds-Pats - name: BARBuildId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] @@ -87,8 +86,8 @@ stages: /p:StaticInternalFeed=$(dotnetfeed-internal-nonstable-feed-url) /p:NugetPath=$(Agent.BuildDirectory)\Nuget\NuGet.exe /p:BARBuildId=$(BARBuildId) - /p:MaestroApiEndpoint='https://maestro-prod.westus2.cloudapp.azure.com' - /p:BuildAssetRegistryToken='$(MaestroAccessToken)' + /p:MaestroApiEndpoint='$(MaestroApiEndPoint)' + /p:BuildAssetRegistryToken='$(MaestroApiAccessToken)' /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' /p:BlobBasePath='$(Build.ArtifactStagingDirectory)\BlobArtifacts' /p:PackageBasePath='$(Build.ArtifactStagingDirectory)\PackageArtifacts' diff --git a/eng/common/templates/post-build/channels/public-validation-release.yml b/eng/common/templates/post-build/channels/public-validation-release.yml index 8c4d8f6ef3..1089ac5fa6 100644 --- a/eng/common/templates/post-build/channels/public-validation-release.yml +++ b/eng/common/templates/post-build/channels/public-validation-release.yml @@ -12,7 +12,6 @@ stages: dependsOn: setupMaestroVars variables: - group: DotNet-Blob-Feed - - group: Publish-Build-Assets - group: AzureDevOps-Artifact-Feeds-Pats - name: BARBuildId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] @@ -48,7 +47,7 @@ stages: filePath: eng\common\sdk-task.ps1 arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet /p:ChannelId=$(PublicValidationRelease_30_Channel_Id) - /p:ArtifactsCategory=$(_DotNetArtifactsCategory) + /p:ArtifactsCategory=$(_DotNetValidationArtifactsCategory) /p:IsStableBuild=$(IsStableBuild) /p:IsInternalBuild=$(IsInternalBuild) /p:RepositoryName=$(Build.Repository.Name) @@ -58,13 +57,13 @@ stages: /p:TargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' /p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)' /p:BARBuildId=$(BARBuildId) - /p:MaestroApiEndpoint='https://maestro-prod.westus2.cloudapp.azure.com' - /p:BuildAssetRegistryToken='$(MaestroAccessToken)' + /p:MaestroApiEndpoint='$(MaestroApiEndPoint)' + /p:BuildAssetRegistryToken='$(MaestroApiAccessToken)' /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' /p:BlobBasePath='$(Build.ArtifactStagingDirectory)\BlobArtifacts' /p:PackageBasePath='$(Build.ArtifactStagingDirectory)\PackageArtifacts' /p:Configuration=Release - + - task: NuGetCommand@2 displayName: Publish Packages to AzDO Feed condition: contains(variables['TargetAzDOFeed'], 'pkgs.visualstudio.com') diff --git a/eng/common/templates/post-build/common-variables.yml b/eng/common/templates/post-build/common-variables.yml index 42df4ae77e..bd0bc5e4da 100644 --- a/eng/common/templates/post-build/common-variables.yml +++ b/eng/common/templates/post-build/common-variables.yml @@ -1,21 +1,39 @@ variables: + - group: Publish-Build-Assets + # .NET Core 3 Dev - PublicDevRelease_30_Channel_Id: 3 + - name: PublicDevRelease_30_Channel_Id + value: 3 # .NET Tools - Validation - PublicValidationRelease_30_Channel_Id: 9 + - name: PublicValidationRelease_30_Channel_Id + value: 9 # .NET Core 3.0 Internal Servicing - InternalServicing_30_Channel_Id: 184 + - name: InternalServicing_30_Channel_Id + value: 184 # .NET Core 3.0 Release - PublicRelease_30_Channel_Id: 19 + - name: PublicRelease_30_Channel_Id + value: 19 # Whether the build is internal or not - IsInternalBuild: ${{ and(ne(variables['System.TeamProject'], 'public'), contains(variables['Build.SourceBranch'], 'internal')) }} + - name: IsInternalBuild + value: ${{ and(ne(variables['System.TeamProject'], 'public'), contains(variables['Build.SourceBranch'], 'internal')) }} # Storage account name for proxy-backed feeds - ProxyBackedFeedsAccountName: dotnetfeed + - name: ProxyBackedFeedsAccountName + value: dotnetfeed + + # Default Maestro++ API Endpoint and API Version + - name: MaestroApiEndPoint + value: "https://maestro-prod.westus2.cloudapp.azure.com" + - name: MaestroApiAccessToken + value: $(MaestroAccessToken) + - name: MaestroApiVersion + value: "2019-01-16" - SourceLinkCLIVersion: 3.0.0 - SymbolToolVersion: 1.0.1 + - name: SourceLinkCLIVersion + value: 3.0.0 + - name: SymbolToolVersion + value: 1.0.1 diff --git a/eng/common/templates/post-build/darc-gather-drop.yml b/eng/common/templates/post-build/darc-gather-drop.yml index e0a9f0a6d2..f4e3bfcf5c 100644 --- a/eng/common/templates/post-build/darc-gather-drop.yml +++ b/eng/common/templates/post-build/darc-gather-drop.yml @@ -7,7 +7,6 @@ jobs: dependsOn: setupMaestroVars condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], ${{ parameters.ChannelId }}) variables: - - group: Publish-Build-Assets - name: BARBuildId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] pool: @@ -19,4 +18,6 @@ jobs: filePath: $(Build.SourcesDirectory)/eng/common/post-build/darc-gather-drop.ps1 arguments: -BarBuildId $(BARBuildId) -DropLocation $(Agent.BuildDirectory)/Temp/Drop/ - -MaestroAccessToken $(MaestroAccessToken) + -MaestroApiAccessToken $(MaestroApiAccessToken) + -MaestroApiEndPoint $(MaestroApiEndPoint) + -MaestroApiVersion $(MaestroApiVersion) diff --git a/eng/common/templates/post-build/post-build.yml b/eng/common/templates/post-build/post-build.yml index daa799259c..0872db4ed9 100644 --- a/eng/common/templates/post-build/post-build.yml +++ b/eng/common/templates/post-build/post-build.yml @@ -7,9 +7,12 @@ parameters: enable: false params: '' + # Which stages should finish execution before post-build stages start + dependsOn: [build] + stages: - stage: validate - dependsOn: build + dependsOn: ${{ parameters.dependsOn }} displayName: Validate jobs: - ${{ if eq(parameters.enableNugetValidation, 'true') }}: diff --git a/eng/common/templates/post-build/promote-build.yml b/eng/common/templates/post-build/promote-build.yml index af48b0b339..9387c583b3 100644 --- a/eng/common/templates/post-build/promote-build.yml +++ b/eng/common/templates/post-build/promote-build.yml @@ -11,7 +11,6 @@ jobs: value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] - name: ChannelId value: ${{ parameters.ChannelId }} - - group: Publish-Build-Assets pool: vmImage: 'windows-2019' steps: @@ -21,4 +20,6 @@ jobs: filePath: $(Build.SourcesDirectory)/eng/common/post-build/promote-build.ps1 arguments: -BuildId $(BARBuildId) -ChannelId $(ChannelId) - -BarToken $(MaestroAccessToken) + -MaestroApiAccessToken $(MaestroApiAccessToken) + -MaestroApiEndPoint $(MaestroApiEndPoint) + -MaestroApiVersion $(MaestroApiVersion) diff --git a/eng/common/templates/post-build/setup-maestro-vars.yml b/eng/common/templates/post-build/setup-maestro-vars.yml index f6120dc1e1..56242b068e 100644 --- a/eng/common/templates/post-build/setup-maestro-vars.yml +++ b/eng/common/templates/post-build/setup-maestro-vars.yml @@ -14,22 +14,5 @@ jobs: name: setReleaseVars displayName: Set Release Configs Vars inputs: - targetType: inline - script: | - # This is needed to make Write-PipelineSetVariable works in this context - $ci = $true - - . "$(Build.SourcesDirectory)/eng/common/tools.ps1" - - $Content = Get-Content "$(Build.StagingDirectory)/ReleaseConfigs/ReleaseConfigs.txt" - - $BarId = $Content | Select -Index 0 - - $Channels = "" - $Content | Select -Index 1 | ForEach-Object { $Channels += "$_ ," } - - $IsStableBuild = $Content | Select -Index 2 - - Write-PipelineSetVariable -Name 'BARBuildId' -Value $BarId - Write-PipelineSetVariable -Name 'InitialChannels' -Value "$Channels" - Write-PipelineSetVariable -Name 'IsStableBuild' -Value $IsStableBuild + filePath: $(Build.SourcesDirectory)/eng/common/post-build/setup-maestro-vars.ps1 + arguments: -ReleaseConfigsPath '$(Build.StagingDirectory)/ReleaseConfigs/ReleaseConfigs.txt' diff --git a/eng/common/templates/post-build/trigger-subscription.yml b/eng/common/templates/post-build/trigger-subscription.yml index 3915cdcd1a..da669030da 100644 --- a/eng/common/templates/post-build/trigger-subscription.yml +++ b/eng/common/templates/post-build/trigger-subscription.yml @@ -8,4 +8,6 @@ steps: filePath: $(Build.SourcesDirectory)/eng/common/post-build/trigger-subscriptions.ps1 arguments: -SourceRepo $(Build.Repository.Uri) -ChannelId ${{ parameters.ChannelId }} - -BarToken $(MaestroAccessToken) + -MaestroApiAccessToken $(MaestroAccessToken) + -MaestroApiEndPoint $(MaestroApiEndPoint) + -MaestroApiVersion $(MaestroApiVersion) diff --git a/global.json b/global.json index 67df8eb153..2e6618dad5 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19375.15", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19376.18", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From cac4cf81096755d46d0830f284143b2f36403222 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 29 Jul 2019 10:42:20 -0700 Subject: [PATCH 139/159] [master] Update dependencies from dotnet/arcade (#7287) * Update dependencies from https://github.com/dotnet/arcade build 20190727.2 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19377.2 * Update dependencies from https://github.com/dotnet/arcade build 20190728.1 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19378.1 --- eng/Version.Details.xml | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 0893278ac1..8a78856321 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - 316481e57ee5e6acbbf2401eb6778a1d3d48d25b + a8e982d3bac01d8f4f91a4c57191147570079448 diff --git a/global.json b/global.json index 2e6618dad5..fe2ea05490 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19376.18", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19378.1", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From e4505d766bb0832a4872f6193f3f7ef6702b7c97 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Wed, 31 Jul 2019 14:54:36 -0600 Subject: [PATCH 140/159] exclude FSharp.Compiler.LanguageServer from source build (#7304) --- .../FSharp.Compiler.LanguageServer.fsproj | 1 + .../FSharp.Compiler.LanguageServer.UnitTests.fsproj | 1 + 2 files changed, 2 insertions(+) diff --git a/src/fsharp/FSharp.Compiler.LanguageServer/FSharp.Compiler.LanguageServer.fsproj b/src/fsharp/FSharp.Compiler.LanguageServer/FSharp.Compiler.LanguageServer.fsproj index 3180a0a52f..48e2c5104a 100644 --- a/src/fsharp/FSharp.Compiler.LanguageServer/FSharp.Compiler.LanguageServer.fsproj +++ b/src/fsharp/FSharp.Compiler.LanguageServer/FSharp.Compiler.LanguageServer.fsproj @@ -8,6 +8,7 @@ netcoreapp2.1 true Implements the Language Server Protocol (LSP) for F#. + true diff --git a/tests/FSharp.Compiler.LanguageServer.UnitTests/FSharp.Compiler.LanguageServer.UnitTests.fsproj b/tests/FSharp.Compiler.LanguageServer.UnitTests/FSharp.Compiler.LanguageServer.UnitTests.fsproj index 78c2689eb2..a9df8d199e 100644 --- a/tests/FSharp.Compiler.LanguageServer.UnitTests/FSharp.Compiler.LanguageServer.UnitTests.fsproj +++ b/tests/FSharp.Compiler.LanguageServer.UnitTests/FSharp.Compiler.LanguageServer.UnitTests.fsproj @@ -7,6 +7,7 @@ Library true nunit + true From a2edefb75b584009965a359743a2f97c14809722 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 31 Jul 2019 13:55:30 -0700 Subject: [PATCH 141/159] [master] Update dependencies from dotnet/arcade (#7295) * Update dependencies from https://github.com/dotnet/arcade build 20190729.29 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19379.29 * Update dependencies from https://github.com/dotnet/arcade build 20190730.3 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19380.3 --- eng/Version.Details.xml | 4 ++-- eng/common/sdl/packages.config | 2 +- eng/common/templates/job/execute-sdl.yml | 2 +- global.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 8a78856321..92b380533f 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - a8e982d3bac01d8f4f91a4c57191147570079448 + def377f94747dac91482aad67b33a1c011ffc770 diff --git a/eng/common/sdl/packages.config b/eng/common/sdl/packages.config index fb9b712863..3f97ac2f16 100644 --- a/eng/common/sdl/packages.config +++ b/eng/common/sdl/packages.config @@ -1,4 +1,4 @@  - + diff --git a/eng/common/templates/job/execute-sdl.yml b/eng/common/templates/job/execute-sdl.yml index 5837f3d56d..f657a4dc91 100644 --- a/eng/common/templates/job/execute-sdl.yml +++ b/eng/common/templates/job/execute-sdl.yml @@ -46,7 +46,7 @@ jobs: continueOnError: ${{ parameters.continueOnError }} - ${{ if eq(parameters.overrideParameters, '') }}: - powershell: eng/common/sdl/execute-all-sdl-tools.ps1 - -GuardianPackageName Microsoft.Guardian.Cli.0.6.0 + -GuardianPackageName Microsoft.Guardian.Cli.0.7.1 -NugetPackageDirectory $(Build.SourcesDirectory)\.packages -AzureDevOpsAccessToken $(dn-bot-dotnet-build-rw-code-rw) ${{ parameters.additionalParameters }} diff --git a/global.json b/global.json index fe2ea05490..341cf08499 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19378.1", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19380.3", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 81d0e624ee8e78cc7c05ca02ab4741a996405365 Mon Sep 17 00:00:00 2001 From: Will Smith Date: Thu, 1 Aug 2019 17:03:12 -0700 Subject: [PATCH 142/159] Added some utilities that will be helpful for testing (#7321) --- eng/Build.ps1 | 20 ++++++++++++++++++++ eng/Versions.props | 5 ++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/eng/Build.ps1 b/eng/Build.ps1 index 8011827a64..1372df4e5f 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -277,6 +277,25 @@ function Prepare-TempDir() { Copy-Item (Join-Path $RepoRoot "tests\Resources\Directory.Build.targets") $TempDir } +function EnablePreviewSdks() { + if (Test-Path variable:global:_MSBuildExe) { + return + } + $vsInfo = LocateVisualStudio + if ($vsInfo -eq $null) { + # Preview SDKs are allowed when no Visual Studio instance is installed + return + } + + $vsId = $vsInfo.instanceId + $vsMajorVersion = $vsInfo.installationVersion.Split('.')[0] + + $instanceDir = Join-Path ${env:USERPROFILE} "AppData\Local\Microsoft\VisualStudio\$vsMajorVersion.0_$vsId" + Create-Directory $instanceDir + $sdkFile = Join-Path $instanceDir "sdk.txt" + 'UsePreviews=True' | Set-Content $sdkFile +} + try { Process-Arguments @@ -288,6 +307,7 @@ try { if ($ci) { Prepare-TempDir + EnablePreviewSdks # enable us to build netcoreapp2.1 binaries $global:_DotNetInstallDir = Join-Path $RepoRoot ".dotnet" diff --git a/eng/Versions.props b/eng/Versions.props index 0a5dd52ef0..4a8ca4fbc4 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -100,6 +100,8 @@ $(RoslynVersion) $(RoslynVersion) $(RoslynVersion) + $(RoslynVersion) + 2.0.17 $(RoslynVersion) 16.0.461 @@ -166,7 +168,8 @@ 1.0.30 8.0.0-alpha 2.7.0 - 2.0.3 + 3.0.0-preview-27318-01 + 3.0.0-preview-27318-01 15.8.0 1.0.0 4.3.0 From ef99bf408ebf6a5349a5b43b4ec7422fe93d2019 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 1 Aug 2019 17:15:13 -0700 Subject: [PATCH 143/159] Update dependencies from https://github.com/dotnet/arcade build 20190731.19 (#7320) - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19381.19 --- eng/Version.Details.xml | 4 +- eng/common/init-tools-native.sh | 4 +- eng/common/native/install-cmake-test.sh | 117 ++++++++++++++++++++++++ eng/common/native/install-cmake.sh | 2 +- eng/common/templates/job/job.yml | 6 +- global.json | 2 +- 6 files changed, 128 insertions(+), 7 deletions(-) create mode 100755 eng/common/native/install-cmake-test.sh diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 92b380533f..e94e911d91 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - def377f94747dac91482aad67b33a1c011ffc770 + 48787606d809963cc800151cbfbefe0a74ae74b4 diff --git a/eng/common/init-tools-native.sh b/eng/common/init-tools-native.sh index 5f2e77f448..4dafaaca13 100755 --- a/eng/common/init-tools-native.sh +++ b/eng/common/init-tools-native.sh @@ -70,8 +70,7 @@ function ReadGlobalJsonNativeTools { # Only extract the contents of the object. local native_tools_list=$(echo $native_tools_section | awk -F"[{}]" '{print $2}') native_tools_list=${native_tools_list//[\" ]/} - native_tools_list=${native_tools_list//,/$'\n'} - native_tools_list="$(echo -e "${native_tools_list}" | tr -d '[[:space:]]')" + native_tools_list=$( echo "$native_tools_list" | sed 's/\s//g' | sed 's/,/\n/g' ) local old_IFS=$IFS while read -r line; do @@ -108,6 +107,7 @@ else installer_command+=" --baseuri $base_uri" installer_command+=" --installpath $install_bin" installer_command+=" --version $tool_version" + echo $installer_command if [[ $force = true ]]; then installer_command+=" --force" diff --git a/eng/common/native/install-cmake-test.sh b/eng/common/native/install-cmake-test.sh new file mode 100755 index 0000000000..53ddf4e686 --- /dev/null +++ b/eng/common/native/install-cmake-test.sh @@ -0,0 +1,117 @@ +#!/usr/bin/env bash + +source="${BASH_SOURCE[0]}" +scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" + +. $scriptroot/common-library.sh + +base_uri= +install_path= +version= +clean=false +force=false +download_retries=5 +retry_wait_time_seconds=30 + +while (($# > 0)); do + lowerI="$(echo $1 | awk '{print tolower($0)}')" + case $lowerI in + --baseuri) + base_uri=$2 + shift 2 + ;; + --installpath) + install_path=$2 + shift 2 + ;; + --version) + version=$2 + shift 2 + ;; + --clean) + clean=true + shift 1 + ;; + --force) + force=true + shift 1 + ;; + --downloadretries) + download_retries=$2 + shift 2 + ;; + --retrywaittimeseconds) + retry_wait_time_seconds=$2 + shift 2 + ;; + --help) + echo "Common settings:" + echo " --baseuri Base file directory or Url wrom which to acquire tool archives" + echo " --installpath Base directory to install native tool to" + echo " --clean Don't install the tool, just clean up the current install of the tool" + echo " --force Force install of tools even if they previously exist" + echo " --help Print help and exit" + echo "" + echo "Advanced settings:" + echo " --downloadretries Total number of retry attempts" + echo " --retrywaittimeseconds Wait time between retry attempts in seconds" + echo "" + exit 0 + ;; + esac +done + +tool_name="cmake-test" +tool_os=$(GetCurrentOS) +tool_folder=$(echo $tool_os | awk '{print tolower($0)}') +tool_arch="x86_64" +tool_name_moniker="$tool_name-$version-$tool_os-$tool_arch" +tool_install_directory="$install_path/$tool_name/$version" +tool_file_path="$tool_install_directory/$tool_name_moniker/bin/$tool_name" +shim_path="$install_path/$tool_name.sh" +uri="${base_uri}/$tool_folder/$tool_name/$tool_name_moniker.tar.gz" + +# Clean up tool and installers +if [[ $clean = true ]]; then + echo "Cleaning $tool_install_directory" + if [[ -d $tool_install_directory ]]; then + rm -rf $tool_install_directory + fi + + echo "Cleaning $shim_path" + if [[ -f $shim_path ]]; then + rm -rf $shim_path + fi + + tool_temp_path=$(GetTempPathFileName $uri) + echo "Cleaning $tool_temp_path" + if [[ -f $tool_temp_path ]]; then + rm -rf $tool_temp_path + fi + + exit 0 +fi + +# Install tool +if [[ -f $tool_file_path ]] && [[ $force = false ]]; then + echo "$tool_name ($version) already exists, skipping install" + exit 0 +fi + +DownloadAndExtract $uri $tool_install_directory $force $download_retries $retry_wait_time_seconds + +if [[ $? != 0 ]]; then + echo "Installation failed" >&2 + exit 1 +fi + +# Generate Shim +# Always rewrite shims so that we are referencing the expected version +NewScriptShim $shim_path $tool_file_path true + +if [[ $? != 0 ]]; then + echo "Shim generation failed" >&2 + exit 1 +fi + +exit 0 \ No newline at end of file diff --git a/eng/common/native/install-cmake.sh b/eng/common/native/install-cmake.sh index 293af6017d..5f1a182fa9 100755 --- a/eng/common/native/install-cmake.sh +++ b/eng/common/native/install-cmake.sh @@ -69,7 +69,7 @@ tool_name_moniker="$tool_name-$version-$tool_os-$tool_arch" tool_install_directory="$install_path/$tool_name/$version" tool_file_path="$tool_install_directory/$tool_name_moniker/bin/$tool_name" shim_path="$install_path/$tool_name.sh" -uri="${base_uri}/$tool_folder/cmake/$tool_name_moniker.tar.gz" +uri="${base_uri}/$tool_folder/$tool_name/$tool_name_moniker.tar.gz" # Clean up tool and installers if [[ $clean = true ]]; then diff --git a/eng/common/templates/job/job.yml b/eng/common/templates/job/job.yml index 1814e0ab61..8db456bb7f 100644 --- a/eng/common/templates/job/job.yml +++ b/eng/common/templates/job/job.yml @@ -37,6 +37,9 @@ parameters: # Optional: Enable publishing to the build asset registry enablePublishBuildAssets: false + # Optional: Prevent gather/push manifest from executing when using publishing pipelines + enablePublishUsingPipelines: false + # Optional: Include PublishTestResults task enablePublishTestResults: false @@ -187,7 +190,7 @@ jobs: continueOnError: true condition: always() - - ${{ if and(eq(parameters.enablePublishBuildAssets, true), ne(variables['_PublishUsingPipelines'], 'true'), eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + - ${{ if and(eq(parameters.enablePublishBuildAssets, true), ne(parameters.enablePublishUsingPipelines, 'true'), eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - task: CopyFiles@2 displayName: Gather Asset Manifests inputs: @@ -195,6 +198,7 @@ jobs: TargetFolder: '$(Build.StagingDirectory)/AssetManifests' continueOnError: ${{ parameters.continueOnError }} condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true')) + - task: PublishBuildArtifacts@1 displayName: Push Asset Manifests inputs: diff --git a/global.json b/global.json index 341cf08499..0a08d8518b 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19380.3", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19381.19", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 419ea48fdc4fde999f1c0eedef31d4e2d08b5773 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 2 Aug 2019 02:15:22 +0100 Subject: [PATCH 144/159] debug formatting (#7196) * debug formatting * whitespace * whitespace * Update DetupleArgs.fs --- src/absil/ilreflect.fs | 2 + src/absil/ilwrite.fs | 1 + src/fsharp/ConstraintSolver.fs | 107 ++++++++++++++++++++++-------- src/fsharp/DetupleArgs.fs | 16 +++-- src/fsharp/FindUnsolved.fs | 2 + src/fsharp/IlxGen.fs | 19 +++++- src/fsharp/Optimizer.fs | 4 ++ src/fsharp/PostInferenceChecks.fs | 21 +++++- src/fsharp/TypeChecker.fs | 2 +- src/fsharp/autobox.fs | 2 + src/ilx/EraseClosures.fs | 14 +++- 11 files changed, 153 insertions(+), 37 deletions(-) diff --git a/src/absil/ilreflect.fs b/src/absil/ilreflect.fs index f1afa06c48..fa49d64c9e 100755 --- a/src/absil/ilreflect.fs +++ b/src/absil/ilreflect.fs @@ -327,6 +327,8 @@ type cenv = generatePdb: bool resolveAssemblyRef: (ILAssemblyRef -> Choice option) } + override x.ToString() = "" + /// Convert an Abstract IL type reference to Reflection.Emit System.Type value. // This ought to be an adequate substitute for this whole function, but it needs // to be thoroughly tested. diff --git a/src/absil/ilwrite.fs b/src/absil/ilwrite.fs index 6d3bfc8ac0..e9978c3de5 100755 --- a/src/absil/ilwrite.fs +++ b/src/absil/ilwrite.fs @@ -605,6 +605,7 @@ type cenv = member cenv.GetCode() = cenv.codeChunks.Close() + override x.ToString() = "" let FindOrAddSharedRow (cenv: cenv) tbl x = cenv.GetTable(tbl).FindOrAddSharedEntry x diff --git a/src/fsharp/ConstraintSolver.fs b/src/fsharp/ConstraintSolver.fs index 9829ebe047..1cb860abae 100755 --- a/src/fsharp/ConstraintSolver.fs +++ b/src/fsharp/ConstraintSolver.fs @@ -64,10 +64,10 @@ let compgenId = mkSynId range0 unassignedTyparName let NewCompGenTypar (kind, rigid, staticReq, dynamicReq, error) = NewTypar(kind, rigid, Typar(compgenId, staticReq, true), error, dynamicReq, [], false, false) -let anon_id m = mkSynId m unassignedTyparName +let AnonTyparId m = mkSynId m unassignedTyparName let NewAnonTypar (kind, m, rigid, var, dyn) = - NewTypar (kind, rigid, Typar(anon_id m, var, true), false, dyn, [], false, false) + NewTypar (kind, rigid, Typar(AnonTyparId m, var, true), false, dyn, [], false, false) let NewNamedInferenceMeasureVar (_m, rigid, var, id) = NewTypar(TyparKind.Measure, rigid, Typar(id, var, false), false, TyparDynamicReq.No, [], false, false) @@ -104,6 +104,7 @@ let FreshenAndFixupTypars m rigid fctps tinst tpsorig = tps, renaming, tinst let FreshenTypeInst m tpsorig = FreshenAndFixupTypars m TyparRigidity.Flexible [] [] tpsorig + let FreshMethInst m fctps tinst tpsorig = FreshenAndFixupTypars m TyparRigidity.Flexible fctps tinst tpsorig let FreshenTypars m tpsorig = @@ -126,62 +127,95 @@ let FreshenMethInfo m (minfo: MethInfo) = [] /// Information about the context of a type equation. type ContextInfo = + /// No context was given. | NoContext + /// The type equation comes from an IF expression. | IfExpression of range + /// The type equation comes from an omitted else branch. | OmittedElseBranch of range + /// The type equation comes from a type check of the result of an else branch. | ElseBranchResult of range + /// The type equation comes from the verification of record fields. | RecordFields + /// The type equation comes from the verification of a tuple in record fields. | TupleInRecordFields + /// The type equation comes from a list or array constructor | CollectionElement of bool * range + /// The type equation comes from a return in a computation expression. + | ReturnInComputationExpression + /// The type equation comes from a yield in a computation expression. | YieldInComputationExpression + /// The type equation comes from a runtime type test. | RuntimeTypeTest of bool + /// The type equation comes from an downcast where a upcast could be used. | DowncastUsedInsteadOfUpcast of bool + /// The type equation comes from a return type of a pattern match clause (not the first clause). | FollowingPatternMatchClause of range + /// The type equation comes from a pattern match guard. | PatternMatchGuard of range + /// The type equation comes from a sequence expression. | SequenceExpression of TType -exception ConstraintSolverTupleDiffLengths of displayEnv: DisplayEnv * TType list * TType list * range * range -exception ConstraintSolverInfiniteTypes of displayEnv: DisplayEnv * contextInfo: ContextInfo * TType * TType * range * range -exception ConstraintSolverTypesNotInEqualityRelation of displayEnv: DisplayEnv * TType * TType * range * range * ContextInfo +exception ConstraintSolverTupleDiffLengths of displayEnv: DisplayEnv * TType list * TType list * range * range + +exception ConstraintSolverInfiniteTypes of displayEnv: DisplayEnv * contextInfo: ContextInfo * TType * TType * range * range + +exception ConstraintSolverTypesNotInEqualityRelation of displayEnv: DisplayEnv * TType * TType * range * range * ContextInfo + exception ConstraintSolverTypesNotInSubsumptionRelation of displayEnv: DisplayEnv * TType * TType * range * range -exception ConstraintSolverMissingConstraint of displayEnv: DisplayEnv * Tast.Typar * Tast.TyparConstraint * range * range -exception ConstraintSolverError of string * range * range -exception ConstraintSolverRelatedInformation of string option * range * exn -exception ErrorFromApplyingDefault of tcGlobals: TcGlobals * displayEnv: DisplayEnv * Tast.Typar * TType * exn * range -exception ErrorFromAddingTypeEquation of tcGlobals: TcGlobals * displayEnv: DisplayEnv * TType * TType * exn * range +exception ConstraintSolverMissingConstraint of displayEnv: DisplayEnv * Tast.Typar * Tast.TyparConstraint * range * range + +exception ConstraintSolverError of string * range * range + +exception ConstraintSolverRelatedInformation of string option * range * exn + +exception ErrorFromApplyingDefault of tcGlobals: TcGlobals * displayEnv: DisplayEnv * Tast.Typar * TType * exn * range + +exception ErrorFromAddingTypeEquation of tcGlobals: TcGlobals * displayEnv: DisplayEnv * TType * TType * exn * range + exception ErrorsFromAddingSubsumptionConstraint of tcGlobals: TcGlobals * displayEnv: DisplayEnv * TType * TType * exn * ContextInfo * range -exception ErrorFromAddingConstraint of displayEnv: DisplayEnv * exn * range -exception PossibleOverload of displayEnv: DisplayEnv * string * exn * range -exception UnresolvedOverloading of displayEnv: DisplayEnv * exn list * string * range -exception UnresolvedConversionOperator of displayEnv: DisplayEnv * TType * TType * range + +exception ErrorFromAddingConstraint of displayEnv: DisplayEnv * exn * range + +exception PossibleOverload of displayEnv: DisplayEnv * string * exn * range + +exception UnresolvedOverloading of displayEnv: DisplayEnv * exn list * string * range + +exception UnresolvedConversionOperator of displayEnv: DisplayEnv * TType * TType * range let GetPossibleOverloads amap m denv (calledMethGroup: (CalledMeth<_> * exn) list) = - calledMethGroup |> List.map (fun (cmeth, e) -> PossibleOverload(denv, NicePrint.stringOfMethInfo amap m denv cmeth.Method, e, m)) + calledMethGroup |> List.map (fun (cmeth, e) -> + PossibleOverload(denv, NicePrint.stringOfMethInfo amap m denv cmeth.Method, e, m)) type TcValF = (ValRef -> ValUseFlag -> TType list -> range -> Expr * TType) type ConstraintSolverState = { g: TcGlobals + amap: Import.ImportMap + InfoReader: InfoReader + + /// The function used to freshen values we encounter during trait constraint solving TcVal: TcValF + /// This table stores all unsolved, ungeneralized trait constraints, indexed by free type variable. /// That is, there will be one entry in this table for each free type variable in /// each outstanding, unsolved, ungeneralized trait constraint. Constraints are removed from the table and resolved @@ -196,20 +230,29 @@ type ConstraintSolverState = InfoReader = infoReader TcVal = tcVal } - type ConstraintSolverEnv = { SolverState: ConstraintSolverState + eContextInfo: ContextInfo + MatchingOnly: bool + m: range + EquivEnv: TypeEquivEnv + DisplayEnv: DisplayEnv } + member csenv.InfoReader = csenv.SolverState.InfoReader + member csenv.g = csenv.SolverState.g + member csenv.amap = csenv.SolverState.amap + override csenv.ToString() = " @ " + csenv.m.ToString() + let MakeConstraintSolverEnv contextInfo css m denv = { SolverState = css m = m @@ -219,11 +262,6 @@ let MakeConstraintSolverEnv contextInfo css m denv = EquivEnv = TypeEquivEnv.Empty DisplayEnv = denv } - -//------------------------------------------------------------------------- -// Occurs check -//------------------------------------------------------------------------- - /// Check whether a type variable occurs in the r.h.s. of a type, e.g. to catch /// infinite equations such as /// 'a = list<'a> @@ -287,9 +325,13 @@ let isDecimalTy g ty = typeEquivAux EraseMeasures g g.decimal_ty ty let IsNonDecimalNumericOrIntegralEnumType g ty = isIntegerOrIntegerEnumTy g ty || isFpTy g ty + let IsNumericOrIntegralEnumType g ty = IsNonDecimalNumericOrIntegralEnumType g ty || isDecimalTy g ty + let IsNonDecimalNumericType g ty = isIntegerTy g ty || isFpTy g ty + let IsNumericType g ty = IsNonDecimalNumericType g ty || isDecimalTy g ty + let IsRelationalType g ty = IsNumericType g ty || isStringTy g ty || isCharTy g ty || isBoolTy g ty // Get measure of type, float<_> or float32<_> or decimal<_> but not float=float<1> or float32=float32<1> or decimal=decimal<1> @@ -386,8 +428,11 @@ let ShowAccessDomain ad = // Solve exception NonRigidTypar of displayEnv: DisplayEnv * string option * range * TType * TType * range + exception LocallyAbortOperationThatFailsToResolveOverload + exception LocallyAbortOperationThatLosesAbbrevs + let localAbortD = ErrorD LocallyAbortOperationThatLosesAbbrevs /// Return true if we would rather unify this variable v1 := v2 than vice versa @@ -652,7 +697,6 @@ let NormalizeExponentsInTypeScheme uvars ty = SubstMeasure v (Measure.RationalPower (Measure.Var v', DivRational OneRational expGcd)) v') - // We normalize unit-of-measure-polymorphic type schemes. There // are three reasons for doing this: // (1) to present concise and consistent type schemes to the programmer @@ -732,8 +776,6 @@ let rec SolveTyparEqualsType (csenv: ConstraintSolverEnv) ndeep m2 (trace: Optio // Record a entry in the undo trace if one is provided trace.Exec (fun () -> r.typar_solution <- Some ty) (fun () -> r.typar_solution <- None) - (* dprintf "setting typar %d to type %s at %a\n" r.Stamp ((DebugPrint.showType ty)) outputRange m; *) - // Only solve constraints if this is not an error var if r.IsFromError then () else // Check to see if this type variable is relevant to any trait constraints. @@ -745,15 +787,17 @@ let rec SolveTyparEqualsType (csenv: ConstraintSolverEnv) ndeep m2 (trace: Optio | _ -> failwith "SolveTyparEqualsType" } - /// Apply the constraints on 'typar' to the type 'ty' and solveTypMeetsTyparConstraints (csenv: ConstraintSolverEnv) ndeep m2 trace ty (r: Typar) = trackErrors { let g = csenv.g + // Propagate compat flex requirements from 'tp' to 'ty' do! SolveTypIsCompatFlex csenv trace r.IsCompatFlex ty + // Propagate dynamic requirements from 'tp' to 'ty' do! SolveTypDynamicReq csenv trace r.DynamicReq ty + // Propagate static requirements from 'tp' to 'ty' do! SolveTypStaticReq csenv trace r.StaticReq ty @@ -899,6 +943,7 @@ and SolveTypeSubsumesType (csenv: ConstraintSolverEnv) ndeep m2 (trace: Optional let amap = csenv.amap let aenv = csenv.EquivEnv let denv = csenv.DisplayEnv + match sty1, sty2 with | TType_var tp1, _ -> match aenv.EquivTypars.TryFind tp1 with @@ -914,15 +959,19 @@ and SolveTypeSubsumesType (csenv: ConstraintSolverEnv) ndeep m2 (trace: Optional | TType_tuple (tupInfo1, l1), TType_tuple (tupInfo2, l2) -> if evalTupInfoIsStruct tupInfo1 <> evalTupInfoIsStruct tupInfo2 then ErrorD (ConstraintSolverError(FSComp.SR.tcTupleStructMismatch(), csenv.m, m2)) else SolveTypeEqualsTypeEqns csenv ndeep m2 trace cxsln l1 l2 (* nb. can unify since no variance *) + | TType_anon (anonInfo1, l1), TType_anon (anonInfo2, l2) -> SolveAnonInfoEqualsAnonInfo csenv m2 anonInfo1 anonInfo2 ++ (fun () -> SolveTypeEqualsTypeEqns csenv ndeep m2 trace cxsln l1 l2) (* nb. can unify since no variance *) + | TType_fun (d1, r1), TType_fun (d2, r2) -> SolveFunTypeEqn csenv ndeep m2 trace cxsln d1 d2 r1 r2 (* nb. can unify since no variance *) + | TType_measure ms1, TType_measure ms2 -> UnifyMeasures csenv trace ms1 ms2 // Enforce the identities float=float<1>, float32=float32<1> and decimal=decimal<1> | (_, TType_app (tc2, [ms])) when (tc2.IsMeasureableReprTycon && typeEquiv csenv.g sty1 (reduceTyconRefMeasureableOrProvided csenv.g tc2 [ms])) -> SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m2 trace cxsln ms (TType_measure Measure.One) + | (TType_app (tc2, [ms]), _) when (tc2.IsMeasureableReprTycon && typeEquiv csenv.g sty2 (reduceTyconRefMeasureableOrProvided csenv.g tc2 [ms])) -> SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m2 trace cxsln ms (TType_measure Measure.One) @@ -973,6 +1022,7 @@ and SolveTypeSubsumesType (csenv: ConstraintSolverEnv) ndeep m2 (trace: Optional let ty2arg = destArrayTy g ty2 SolveTypeEqualsTypeKeepAbbrevsWithCxsln csenv ndeep m2 trace cxsln ty1arg ty2arg | _ -> error(InternalError("destArrayTy", m)) + | _ -> // D :> Head<_> --> C :> Head<_> for the // first interface or super-class C supported by D which @@ -991,7 +1041,6 @@ and SolveTypeSubsumesTypeKeepAbbrevs csenv ndeep m2 trace cxsln ty1 ty2 = // Solve and record non-equality constraints //------------------------------------------------------------------------- - and SolveTyparSubtypeOfType (csenv: ConstraintSolverEnv) ndeep m2 trace tp ty1 = let g = csenv.g if isObjTy g ty1 then CompleteD @@ -1052,7 +1101,7 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload | _ -> do! ErrorD (ConstraintSolverError(FSComp.SR.csExpectedArguments(), m, m2)) // Trait calls are only supported on pseudo type (variables) for e in tys do - do! SolveTypStaticReq csenv trace HeadTypeStaticReq e + do! SolveTypStaticReq csenv trace HeadTypeStaticReq e let argtys = if memFlags.IsInstance then List.tail argtys else argtys @@ -1108,14 +1157,18 @@ and SolveMemberConstraint (csenv: ConstraintSolverEnv) ignoreUnresolvedOverload do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 (mkAppTy tcref [TType_measure ms2]) do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty (mkAppTy tcref [TType_measure (Measure.Prod(ms1, if nm = "op_Multiply" then ms2 else Measure.Inv ms2))]) return TTraitBuiltIn + | _ -> + match GetMeasureOfType g argty2 with | Some (tcref, ms2) -> let ms1 = freshMeasure () do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty1 (mkAppTy tcref [TType_measure ms1]) do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty (mkAppTy tcref [TType_measure (Measure.Prod(ms1, if nm = "op_Multiply" then ms2 else Measure.Inv ms2))]) return TTraitBuiltIn + | _ -> + do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace argty2 argty1 do! SolveTypeEqualsTypeKeepAbbrevs csenv ndeep m2 trace rty argty1 return TTraitBuiltIn diff --git a/src/fsharp/DetupleArgs.fs b/src/fsharp/DetupleArgs.fs index 8ae41acb31..b15bae8f24 100755 --- a/src/fsharp/DetupleArgs.fs +++ b/src/fsharp/DetupleArgs.fs @@ -644,17 +644,26 @@ let hasTransfrom penv f = Zmap.tryFind f penv.transforms *) type env = - { eg : TcGlobals - prefix : string - m : Range.range } + { + eg: TcGlobals + + prefix: string + + m: Range.range + } + + override __.ToString() = "" let suffixE env s = {env with prefix = env.prefix + s} + let rangeE env m = {env with m = m} let push b bs = b :: bs + let pushL xs bs = xs@bs let newLocal env ty = mkCompGenLocal env.m env.prefix ty + let newLocalN env i ty = mkCompGenLocal env.m (env.prefix + string i) ty let noEffectExpr env bindings x = @@ -712,7 +721,6 @@ and collapseArgs env bindings n (callPattern) args = | _ts :: _tss, [] -> internalError "collapseArgs: CallPattern longer than callsite args. REPORT BUG" - //------------------------------------------------------------------------- // pass - app fixup //------------------------------------------------------------------------- diff --git a/src/fsharp/FindUnsolved.fs b/src/fsharp/FindUnsolved.fs index ac64aa6c1d..d11a128417 100755 --- a/src/fsharp/FindUnsolved.fs +++ b/src/fsharp/FindUnsolved.fs @@ -21,6 +21,8 @@ type cenv = denv: DisplayEnv mutable unsolved: Typars } + override x.ToString() = "" + /// Walk types, collecting type variables let accTy cenv _env ty = let normalizedTy = tryNormalizeMeasureInType cenv.g ty diff --git a/src/fsharp/IlxGen.fs b/src/fsharp/IlxGen.fs index 6b66a6a8ab..5e61742fd9 100755 --- a/src/fsharp/IlxGen.fs +++ b/src/fsharp/IlxGen.fs @@ -253,6 +253,8 @@ type cenv = delayedGenMethods: Queue unit> } + override x.ToString() = "" + let mkTypeOfExpr cenv m ilty = let g = cenv.g @@ -771,17 +773,26 @@ and NamedLocalIlxClosureInfo = | NamedLocalIlxClosureInfoGenerator of (IlxGenEnv -> IlxClosureInfo) | NamedLocalIlxClosureInfoGenerated of IlxClosureInfo + override __.ToString() = "" + /// Indicates the overall representation decisions for all the elements of a namespace of module and ModuleStorage = - { Vals: Lazy> - SubModules: Lazy> } + { + Vals: Lazy> + + SubModules: Lazy> + } + + override __.ToString() = "" /// Indicate whether a call to the value can be implemented as /// a branch. At the moment these are only used for generating branch calls back to /// the entry label of the method currently being generated when a direct tailcall is /// made in the method itself. and BranchCallItem = + | BranchCallClosure of ArityInfo + | BranchCallMethod of // Argument counts for compiled form of F# method or value ArityInfo * @@ -793,6 +804,8 @@ and BranchCallItem = int * // num obj args int + + override __.ToString() = "" /// Represents a place we can branch to and Mark = @@ -837,6 +850,8 @@ and IlxGenEnv = isInLoop: bool } + override __.ToString() = "" + let SetIsInLoop isInLoop eenv = if eenv.isInLoop = isInLoop then eenv else { eenv with isInLoop = isInLoop } diff --git a/src/fsharp/Optimizer.fs b/src/fsharp/Optimizer.fs index ecc24b9131..cfa1a9a49d 100644 --- a/src/fsharp/Optimizer.fs +++ b/src/fsharp/Optimizer.fs @@ -380,6 +380,8 @@ type cenv = casApplied : Dictionary } + override x.ToString() = "" + type IncrementalOptimizationEnv = { /// An identifier to help with name generation latestBoundId: Ident option @@ -415,6 +417,8 @@ type IncrementalOptimizationEnv = localExternalVals = LayeredMap.Empty globalModuleInfos = LayeredMap.Empty } + override x.ToString() = "" + //------------------------------------------------------------------------- // IsPartialExprVal - is the expr fully known? //------------------------------------------------------------------------- diff --git a/src/fsharp/PostInferenceChecks.fs b/src/fsharp/PostInferenceChecks.fs index b6a286c5d7..d6ad0cdf64 100755 --- a/src/fsharp/PostInferenceChecks.fs +++ b/src/fsharp/PostInferenceChecks.fs @@ -93,7 +93,10 @@ type env = returnScope : int /// Are we in an app expression (Expr.App)? - isInAppExpr: bool } + isInAppExpr: bool + } + + override __.ToString() = "" let BindTypar env (tp: Typar) = { env with @@ -183,23 +186,39 @@ let CombineLimits limits = type cenv = { boundVals: Dictionary // really a hash set + limitVals: Dictionary + mutable potentialUnboundUsesOfVals: StampMap + mutable anonRecdTypes: StampMap + g: TcGlobals + amap: Import.ImportMap + /// For reading metadata infoReader: InfoReader + internalsVisibleToPaths : CompilationPath list + denv: DisplayEnv + viewCcu : CcuThunk + reportErrors: bool + isLastCompiland : bool*bool + isInternalTestSpanStackReferring: bool + // outputs mutable usesQuotations : bool + mutable entryPointGiven: bool } + override x.ToString() = "" + /// Check if the value is an argument of a function let IsValArgument env (v: Val) = env.argVals.ContainsVal v diff --git a/src/fsharp/TypeChecker.fs b/src/fsharp/TypeChecker.fs index 70bb0f6b21..7610c4f209 100644 --- a/src/fsharp/TypeChecker.fs +++ b/src/fsharp/TypeChecker.fs @@ -534,7 +534,7 @@ type cenv = conditionalDefines = conditionalDefines isInternalTestSpanStackReferring = isInternalTestSpanStackReferring } - override __.ToString() = "cenv(...)" + override __.ToString() = "" let CopyAndFixupTypars m rigid tpsorig = ConstraintSolver.FreshenAndFixupTypars m rigid [] [] tpsorig diff --git a/src/fsharp/autobox.fs b/src/fsharp/autobox.fs index da6b5c1d64..8c7036e72c 100644 --- a/src/fsharp/autobox.fs +++ b/src/fsharp/autobox.fs @@ -18,6 +18,8 @@ type cenv = { g: TcGlobals amap: Import.ImportMap } + override x.ToString() = "" + /// Find all the mutable locals that escape a method, function or lambda expression let DecideEscapes syntacticArgs body = let cantBeFree v = diff --git a/src/ilx/EraseClosures.fs b/src/ilx/EraseClosures.fs index 3ba574b9ba..ca0dbfcdf8 100755 --- a/src/ilx/EraseClosures.fs +++ b/src/ilx/EraseClosures.fs @@ -116,12 +116,22 @@ let mkFuncTypeRef n = [IlxSettings.ilxNamespace () + ".OptimizedClosures"], "FSharpFunc`"+ string (n + 1)) type cenv = - { ilg:ILGlobals + { + ilg:ILGlobals + tref_Func: ILTypeRef[] + mkILTyFuncTy: ILType + addFieldGeneratedAttrs: ILFieldDef -> ILFieldDef + addFieldNeverAttrs: ILFieldDef -> ILFieldDef - addMethodGeneratedAttrs: ILMethodDef -> ILMethodDef } + + addMethodGeneratedAttrs: ILMethodDef -> ILMethodDef + } + + override __.ToString() = "" + let addMethodGeneratedAttrsToTypeDef cenv (tdef: ILTypeDef) = tdef.With(methods = (tdef.Methods.AsList |> List.map (fun md -> md |> cenv.addMethodGeneratedAttrs) |> mkILMethods)) From 9778955a7ddf7606e3b0e96806506a09589e8e5b Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 2 Aug 2019 11:43:00 -0700 Subject: [PATCH 145/159] Update dependencies from https://github.com/dotnet/arcade build 20190801.23 (#7342) - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19401.23 --- eng/Version.Details.xml | 4 ++-- .../templates/post-build/channels/internal-servicing.yml | 6 +++--- .../templates/post-build/channels/public-dev-release.yml | 6 +++--- .../templates/post-build/channels/public-release.yml | 6 +++--- .../post-build/channels/public-validation-release.yml | 2 +- eng/common/tools.ps1 | 9 ++++++++- eng/common/tools.sh | 6 +++++- global.json | 2 +- 8 files changed, 26 insertions(+), 15 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index e94e911d91..ba0cbcb94f 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - 48787606d809963cc800151cbfbefe0a74ae74b4 + 941d6497356e00ea6b2bc35a22a67f4ecf988fd6 diff --git a/eng/common/templates/post-build/channels/internal-servicing.yml b/eng/common/templates/post-build/channels/internal-servicing.yml index 12fd2b4653..dc065ab308 100644 --- a/eng/common/templates/post-build/channels/internal-servicing.yml +++ b/eng/common/templates/post-build/channels/internal-servicing.yml @@ -13,7 +13,7 @@ stages: - job: displayName: Symbol Publishing dependsOn: setupMaestroVars - condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.InternalServicing_30_Channel_Id) + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.InternalServicing_30_Channel_Id)) variables: - group: DotNet-Symbol-Server-Pats pool: @@ -46,7 +46,7 @@ stages: value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] - name: IsStableBuild value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ] - condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.InternalServicing_30_Channel_Id) + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.InternalServicing_30_Channel_Id)) pool: vmImage: 'windows-2019' steps: @@ -126,7 +126,7 @@ stages: - job: displayName: Symbol Availability dependsOn: setupMaestroVars - condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.InternalServicing_30_Channel_Id) + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.InternalServicing_30_Channel_Id)) pool: vmImage: 'windows-2019' steps: diff --git a/eng/common/templates/post-build/channels/public-dev-release.yml b/eng/common/templates/post-build/channels/public-dev-release.yml index b0f085b142..771dcf4ef8 100644 --- a/eng/common/templates/post-build/channels/public-dev-release.yml +++ b/eng/common/templates/post-build/channels/public-dev-release.yml @@ -13,7 +13,7 @@ stages: - job: displayName: Symbol Publishing dependsOn: setupMaestroVars - condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicDevRelease_30_Channel_Id) + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.PublicDevRelease_30_Channel_Id)) variables: - group: DotNet-Symbol-Server-Pats pool: @@ -46,7 +46,7 @@ stages: value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] - name: IsStableBuild value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ] - condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicDevRelease_30_Channel_Id) + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.PublicDevRelease_30_Channel_Id)) pool: vmImage: 'windows-2019' steps: @@ -123,7 +123,7 @@ stages: - job: displayName: Symbol Availability dependsOn: setupMaestroVars - condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicDevRelease_30_Channel_Id) + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.PublicDevRelease_30_Channel_Id)) pool: vmImage: 'windows-2019' steps: diff --git a/eng/common/templates/post-build/channels/public-release.yml b/eng/common/templates/post-build/channels/public-release.yml index 4c63fb43f0..00108bd3f8 100644 --- a/eng/common/templates/post-build/channels/public-release.yml +++ b/eng/common/templates/post-build/channels/public-release.yml @@ -13,7 +13,7 @@ stages: - job: displayName: Symbol Publishing dependsOn: setupMaestroVars - condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicRelease_30_Channel_Id) + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.PublicRelease_30_Channel_Id)) variables: - group: DotNet-Symbol-Server-Pats pool: @@ -46,7 +46,7 @@ stages: value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] - name: IsStableBuild value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ] - condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicRelease_30_Channel_Id) + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.PublicRelease_30_Channel_Id)) pool: vmImage: 'windows-2019' steps: @@ -126,7 +126,7 @@ stages: - job: displayName: Symbol Availability dependsOn: setupMaestroVars - condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicRelease_30_Channel_Id) + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.PublicRelease_30_Channel_Id)) pool: vmImage: 'windows-2019' steps: diff --git a/eng/common/templates/post-build/channels/public-validation-release.yml b/eng/common/templates/post-build/channels/public-validation-release.yml index 1089ac5fa6..f64184da9f 100644 --- a/eng/common/templates/post-build/channels/public-validation-release.yml +++ b/eng/common/templates/post-build/channels/public-validation-release.yml @@ -17,7 +17,7 @@ stages: value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] - name: IsStableBuild value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ] - condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], variables.PublicValidationRelease_30_Channel_Id) + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.PublicValidationRelease_30_Channel_Id)) pool: vmImage: 'windows-2019' steps: diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index 8fe2b11ad2..9c12b1b4fd 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -39,6 +39,10 @@ # installed on the machine instead of downloading one. [bool]$useInstalledDotNetCli = if (Test-Path variable:useInstalledDotNetCli) { $useInstalledDotNetCli } else { $true } +# Enable repos to use a particular version of the on-line dotnet-install scripts. +# default URL: https://dot.net/v1/dotnet-install.ps1 +[string]$dotnetInstallScriptVersion = if (Test-Path variable:dotnetInstallScriptVersion) { $dotnetInstallScriptVersion } else { "v1" } + # True to use global NuGet cache instead of restoring packages to repository-local directory. [bool]$useGlobalNuGetCache = if (Test-Path variable:useGlobalNuGetCache) { $useGlobalNuGetCache } else { !$ci } @@ -159,7 +163,7 @@ function GetDotNetInstallScript([string] $dotnetRoot) { $installScript = Join-Path $dotnetRoot "dotnet-install.ps1" if (!(Test-Path $installScript)) { Create-Directory $dotnetRoot - Invoke-WebRequest "https://dot.net/v1/dotnet-install.ps1" -OutFile $installScript + Invoke-WebRequest "https://dot.net/$dotnetInstallScriptVersion/dotnet-install.ps1" -OutFile $installScript } return $installScript @@ -518,6 +522,9 @@ function MSBuild-Core() { if ($warnAsError) { $cmdArgs += " /warnaserror /p:TreatWarningsAsErrors=true" } + else { + $cmdArgs += " /p:TreatWarningsAsErrors=false" + } foreach ($arg in $args) { if ($arg -ne $null -and $arg.Trim() -ne "") { diff --git a/eng/common/tools.sh b/eng/common/tools.sh index 738bb5669d..3af9be6157 100755 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -45,6 +45,10 @@ warn_as_error=${warn_as_error:-true} # installed on the machine instead of downloading one. use_installed_dotnet_cli=${use_installed_dotnet_cli:-true} +# Enable repos to use a particular version of the on-line dotnet-install scripts. +# default URL: https://dot.net/v1/dotnet-install.sh +dotnetInstallScriptVersion=${dotnetInstallScriptVersion:-'v1'} + # True to use global NuGet cache instead of restoring packages to repository-local directory. if [[ "$ci" == true ]]; then use_global_nuget_cache=${use_global_nuget_cache:-false} @@ -195,7 +199,7 @@ function InstallDotNet { function GetDotNetInstallScript { local root=$1 local install_script="$root/dotnet-install.sh" - local install_script_url="https://dot.net/v1/dotnet-install.sh" + local install_script_url="https://dot.net/$dotnetInstallScriptVersion/dotnet-install.sh" if [[ ! -a "$install_script" ]]; then mkdir -p "$root" diff --git a/global.json b/global.json index 0a08d8518b..f4f794adc6 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19381.19", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19401.23", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 4a309721780cdf657839fe07583c60ea871c2897 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 3 Aug 2019 11:31:01 -0700 Subject: [PATCH 146/159] Update dependencies from https://github.com/dotnet/arcade build 20190802.16 (#7351) - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19402.16 --- eng/Version.Details.xml | 4 +- .../post-build/channels/netcore-dev-5.yml | 148 ++++++++++++++++++ .../channels/netcore-tools-latest.yml | 148 ++++++++++++++++++ .../templates/post-build/common-variables.yml | 8 + .../templates/post-build/darc-gather-drop.yml | 2 +- .../templates/post-build/post-build.yml | 8 + .../templates/post-build/promote-build.yml | 2 +- global.json | 2 +- 8 files changed, 317 insertions(+), 5 deletions(-) create mode 100644 eng/common/templates/post-build/channels/netcore-dev-5.yml create mode 100644 eng/common/templates/post-build/channels/netcore-tools-latest.yml diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index ba0cbcb94f..fffe234f24 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - 941d6497356e00ea6b2bc35a22a67f4ecf988fd6 + d8457f6ba527aef165ff6fb0aded44bf8123ce83 diff --git a/eng/common/templates/post-build/channels/netcore-dev-5.yml b/eng/common/templates/post-build/channels/netcore-dev-5.yml new file mode 100644 index 0000000000..f2b0cfb269 --- /dev/null +++ b/eng/common/templates/post-build/channels/netcore-dev-5.yml @@ -0,0 +1,148 @@ +parameters: + enableSymbolValidation: true + +stages: +- stage: NetCore_Dev5_Publish + dependsOn: validate + variables: + - template: ../common-variables.yml + displayName: .NET Core 5 Dev Channel + jobs: + - template: ../setup-maestro-vars.yml + + - job: + displayName: Symbol Publishing + dependsOn: setupMaestroVars + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.NetCore_5_Dev_Channel_Id)) + variables: + - group: DotNet-Symbol-Server-Pats + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Artifacts + inputs: + downloadType: specific files + matchingPattern: "*Artifacts*" + + - task: PowerShell@2 + displayName: Publish + inputs: + filePath: eng\common\sdk-task.ps1 + arguments: -task PublishToSymbolServers -restore -msbuildEngine dotnet + /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) + /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) + /p:PDBArtifactsDirectory='$(Build.ArtifactStagingDirectory)/PDBArtifacts/' + /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' + /p:Configuration=Release + + - job: + displayName: Publish Assets + dependsOn: setupMaestroVars + variables: + - group: DotNet-Blob-Feed + - group: AzureDevOps-Artifact-Feeds-Pats + - name: BARBuildId + value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] + - name: IsStableBuild + value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ] + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.NetCore_5_Dev_Channel_Id)) + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Package Artifacts + inputs: + buildType: current + artifactName: PackageArtifacts + + - task: DownloadBuildArtifacts@0 + displayName: Download Blob Artifacts + inputs: + buildType: current + artifactName: BlobArtifacts + + - task: DownloadBuildArtifacts@0 + displayName: Download Asset Manifests + inputs: + buildType: current + artifactName: AssetManifests + + - task: PowerShell@2 + displayName: Add Assets Location + env: + AZURE_DEVOPS_EXT_PAT: $(dn-bot-dnceng-unviersal-packages-rw) + inputs: + filePath: eng\common\sdk-task.ps1 + arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet + /p:ChannelId=$(NetCore_5_Dev_Channel_Id) + /p:ArtifactsCategory=$(_DotNetArtifactsCategory) + /p:IsStableBuild=$(IsStableBuild) + /p:IsInternalBuild=$(IsInternalBuild) + /p:RepositoryName=$(Build.Repository.Name) + /p:CommitSha=$(Build.SourceVersion) + /p:NugetPath=$(Agent.BuildDirectory)\Nuget\NuGet.exe + /p:AzdoTargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' + /p:TargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' + /p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)' + /p:BARBuildId=$(BARBuildId) + /p:MaestroApiEndpoint='$(MaestroApiEndPoint)' + /p:BuildAssetRegistryToken='$(MaestroApiAccessToken)' + /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' + /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' + /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts/' + /p:Configuration=Release + + - task: NuGetCommand@2 + displayName: Publish Packages to AzDO Feed + condition: contains(variables['TargetAzDOFeed'], 'pkgs.visualstudio.com') + inputs: + command: push + vstsFeed: $(AzDoFeedName) + packagesToPush: $(Build.ArtifactStagingDirectory)\PackageArtifacts\*.nupkg + publishVstsFeed: $(AzDoFeedName) + + - task: PowerShell@2 + displayName: Publish Blobs to AzDO Feed + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-blobs-to-azdo.ps1 + arguments: -FeedName $(AzDoFeedName) + -SourceFolderCollection $(Build.ArtifactStagingDirectory)/BlobArtifacts/ + -PersonalAccessToken $(dn-bot-dnceng-unviersal-packages-rw) + enabled: false + + +- stage: NetCore_Dev5_PublishValidation + displayName: Publish Validation + variables: + - template: ../common-variables.yml + jobs: + - template: ../setup-maestro-vars.yml + + - ${{ if eq(parameters.enableSymbolValidation, 'true') }}: + - job: + displayName: Symbol Availability + dependsOn: setupMaestroVars + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.NetCore_5_Dev_Channel_Id)) + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Package Artifacts + inputs: + buildType: current + artifactName: PackageArtifacts + + - task: PowerShell@2 + displayName: Check Symbol Availability + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/post-build/symbols-validation.ps1 + arguments: -InputPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/ -ExtractPath $(Agent.BuildDirectory)/Temp/ -DotnetSymbolVersion $(SymbolToolVersion) + + - template: ../darc-gather-drop.yml + parameters: + ChannelId: ${{ variables.NetCore_5_Dev_Channel_Id }} + + - template: ../promote-build.yml + parameters: + ChannelId: ${{ variables.NetCore_5_Dev_Channel_Id }} diff --git a/eng/common/templates/post-build/channels/netcore-tools-latest.yml b/eng/common/templates/post-build/channels/netcore-tools-latest.yml new file mode 100644 index 0000000000..fd6c09b227 --- /dev/null +++ b/eng/common/templates/post-build/channels/netcore-tools-latest.yml @@ -0,0 +1,148 @@ +parameters: + enableSymbolValidation: true + +stages: +- stage: NetCore_Tools_Latest_Publish + dependsOn: validate + variables: + - template: ../common-variables.yml + displayName: .NET Tools - Latest + jobs: + - template: ../setup-maestro-vars.yml + + - job: + displayName: Symbol Publishing + dependsOn: setupMaestroVars + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.NetCore_Tools_Latest_Channel_Id)) + variables: + - group: DotNet-Symbol-Server-Pats + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Artifacts + inputs: + downloadType: specific files + matchingPattern: "*Artifacts*" + + - task: PowerShell@2 + displayName: Publish + inputs: + filePath: eng\common\sdk-task.ps1 + arguments: -task PublishToSymbolServers -restore -msbuildEngine dotnet + /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) + /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) + /p:PDBArtifactsDirectory='$(Build.ArtifactStagingDirectory)/PDBArtifacts/' + /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' + /p:Configuration=Release + + - job: + displayName: Publish Assets + dependsOn: setupMaestroVars + variables: + - group: DotNet-Blob-Feed + - group: AzureDevOps-Artifact-Feeds-Pats + - name: BARBuildId + value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] + - name: IsStableBuild + value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.IsStableBuild'] ] + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.NetCore_Tools_Latest_Channel_Id)) + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Package Artifacts + inputs: + buildType: current + artifactName: PackageArtifacts + + - task: DownloadBuildArtifacts@0 + displayName: Download Blob Artifacts + inputs: + buildType: current + artifactName: BlobArtifacts + + - task: DownloadBuildArtifacts@0 + displayName: Download Asset Manifests + inputs: + buildType: current + artifactName: AssetManifests + + - task: PowerShell@2 + displayName: Add Assets Location + env: + AZURE_DEVOPS_EXT_PAT: $(dn-bot-dnceng-unviersal-packages-rw) + inputs: + filePath: eng\common\sdk-task.ps1 + arguments: -task PublishArtifactsInManifest -restore -msbuildEngine dotnet + /p:ChannelId=$(NetCore_Tools_Latest_Channel_Id) + /p:ArtifactsCategory=$(_DotNetArtifactsCategory) + /p:IsStableBuild=$(IsStableBuild) + /p:IsInternalBuild=$(IsInternalBuild) + /p:RepositoryName=$(Build.Repository.Name) + /p:CommitSha=$(Build.SourceVersion) + /p:NugetPath=$(Agent.BuildDirectory)\Nuget\NuGet.exe + /p:AzdoTargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' + /p:TargetFeedPAT='$(dn-bot-dnceng-unviersal-packages-rw)' + /p:AzureStorageTargetFeedPAT='$(dotnetfeed-storage-access-key-1)' + /p:BARBuildId=$(BARBuildId) + /p:MaestroApiEndpoint='$(MaestroApiEndPoint)' + /p:BuildAssetRegistryToken='$(MaestroApiAccessToken)' + /p:ManifestsBasePath='$(Build.ArtifactStagingDirectory)/AssetManifests/' + /p:BlobBasePath='$(Build.ArtifactStagingDirectory)/BlobArtifacts/' + /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts/' + /p:Configuration=Release + + - task: NuGetCommand@2 + displayName: Publish Packages to AzDO Feed + condition: contains(variables['TargetAzDOFeed'], 'pkgs.visualstudio.com') + inputs: + command: push + vstsFeed: $(AzDoFeedName) + packagesToPush: $(Build.ArtifactStagingDirectory)\PackageArtifacts\*.nupkg + publishVstsFeed: $(AzDoFeedName) + + - task: PowerShell@2 + displayName: Publish Blobs to AzDO Feed + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/post-build/publish-blobs-to-azdo.ps1 + arguments: -FeedName $(AzDoFeedName) + -SourceFolderCollection $(Build.ArtifactStagingDirectory)/BlobArtifacts/ + -PersonalAccessToken $(dn-bot-dnceng-unviersal-packages-rw) + enabled: false + + +- stage: NetCore_Tools_Latest_PublishValidation + displayName: Publish Validation + variables: + - template: ../common-variables.yml + jobs: + - template: ../setup-maestro-vars.yml + + - ${{ if eq(parameters.enableSymbolValidation, 'true') }}: + - job: + displayName: Symbol Availability + dependsOn: setupMaestroVars + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', variables.NetCore_Tools_Latest_Channel_Id)) + pool: + vmImage: 'windows-2019' + steps: + - task: DownloadBuildArtifacts@0 + displayName: Download Package Artifacts + inputs: + buildType: current + artifactName: PackageArtifacts + + - task: PowerShell@2 + displayName: Check Symbol Availability + inputs: + filePath: $(Build.SourcesDirectory)/eng/common/post-build/symbols-validation.ps1 + arguments: -InputPath $(Build.ArtifactStagingDirectory)/PackageArtifacts/ -ExtractPath $(Agent.BuildDirectory)/Temp/ -DotnetSymbolVersion $(SymbolToolVersion) + + - template: ../darc-gather-drop.yml + parameters: + ChannelId: ${{ variables.NetCore_Tools_Latest_Channel_Id }} + + - template: ../promote-build.yml + parameters: + ChannelId: ${{ variables.NetCore_Tools_Latest_Channel_Id }} diff --git a/eng/common/templates/post-build/common-variables.yml b/eng/common/templates/post-build/common-variables.yml index bd0bc5e4da..52a74487fd 100644 --- a/eng/common/templates/post-build/common-variables.yml +++ b/eng/common/templates/post-build/common-variables.yml @@ -5,10 +5,18 @@ variables: - name: PublicDevRelease_30_Channel_Id value: 3 + # .NET Core 5 Dev + - name: NetCore_5_Dev_Channel_Id + value: 131 + # .NET Tools - Validation - name: PublicValidationRelease_30_Channel_Id value: 9 + # .NET Tools - Latest + - name: NetCore_Tools_Latest_Channel_Id + value: 2 + # .NET Core 3.0 Internal Servicing - name: InternalServicing_30_Channel_Id value: 184 diff --git a/eng/common/templates/post-build/darc-gather-drop.yml b/eng/common/templates/post-build/darc-gather-drop.yml index f4e3bfcf5c..3268ccaa55 100644 --- a/eng/common/templates/post-build/darc-gather-drop.yml +++ b/eng/common/templates/post-build/darc-gather-drop.yml @@ -5,7 +5,7 @@ jobs: - job: gatherDrop displayName: Gather Drop dependsOn: setupMaestroVars - condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], ${{ parameters.ChannelId }}) + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', ${{ parameters.ChannelId }})) variables: - name: BARBuildId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] diff --git a/eng/common/templates/post-build/post-build.yml b/eng/common/templates/post-build/post-build.yml index 0872db4ed9..33db50ce26 100644 --- a/eng/common/templates/post-build/post-build.yml +++ b/eng/common/templates/post-build/post-build.yml @@ -83,10 +83,18 @@ stages: parameters: additionalParameters: ${{ parameters.SDLValidationParameters.params }} +- template: \eng\common\templates\post-build\channels\netcore-dev-5.yml + parameters: + enableSymbolValidation: ${{ parameters.enableSymbolValidation }} + - template: \eng\common\templates\post-build\channels\public-dev-release.yml parameters: enableSymbolValidation: ${{ parameters.enableSymbolValidation }} +- template: \eng\common\templates\post-build\channels\netcore-tools-latest.yml + parameters: + enableSymbolValidation: ${{ parameters.enableSymbolValidation }} + - template: \eng\common\templates\post-build\channels\public-validation-release.yml - template: \eng\common\templates\post-build\channels\public-release.yml diff --git a/eng/common/templates/post-build/promote-build.yml b/eng/common/templates/post-build/promote-build.yml index 9387c583b3..6b479c3b82 100644 --- a/eng/common/templates/post-build/promote-build.yml +++ b/eng/common/templates/post-build/promote-build.yml @@ -5,7 +5,7 @@ jobs: - job: displayName: Promote Build dependsOn: setupMaestroVars - condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], ${{ parameters.ChannelId }}) + condition: contains(dependencies.setupMaestroVars.outputs['setReleaseVars.InitialChannels'], format('[{0}]', ${{ parameters.ChannelId }})) variables: - name: BARBuildId value: $[ dependencies.setupMaestroVars.outputs['setReleaseVars.BARBuildId'] ] diff --git a/global.json b/global.json index f4f794adc6..6897ff9d70 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19401.23", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19402.16", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From e32086ba879be508e199584777ca7d41df6492b5 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 5 Aug 2019 11:18:28 -0700 Subject: [PATCH 147/159] [master] Update dependencies from dotnet/arcade (#7355) * Update dependencies from https://github.com/dotnet/arcade build 20190803.1 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19403.1 * Update dependencies from https://github.com/dotnet/arcade build 20190804.1 - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19404.1 --- eng/Version.Details.xml | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index fffe234f24..813969ce5f 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - d8457f6ba527aef165ff6fb0aded44bf8123ce83 + b1c2f33f0cef32d1df6e7f388017fd6761d3fcad diff --git a/global.json b/global.json index 6897ff9d70..8ffd380808 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19402.16", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19404.1", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 5e09a298b2d10249f936de3c6b27328ab8a20265 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Tue, 6 Aug 2019 09:09:32 -0700 Subject: [PATCH 148/159] Update dependencies from https://github.com/dotnet/arcade build 20190805.9 (#7360) - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19405.9 --- eng/Version.Details.xml | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 813969ce5f..c9996fa71f 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - b1c2f33f0cef32d1df6e7f388017fd6761d3fcad + 44ccf0f527de559b07f9ad955a47ec97f03f2146 diff --git a/global.json b/global.json index 8ffd380808..f9f09157ec 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19404.1", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19405.9", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 9c56c3fb2a2a9c0debf840682e2671ab128704f1 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 7 Aug 2019 09:27:16 -0700 Subject: [PATCH 149/159] Update dependencies from https://github.com/dotnet/arcade build 20190806.7 (#7364) - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19406.7 --- eng/Version.Details.xml | 4 ++-- eng/common/templates/post-build/post-build.yml | 1 + global.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index c9996fa71f..7e04a39de9 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - 44ccf0f527de559b07f9ad955a47ec97f03f2146 + c155e609f88491128e1a66d09f413062f3344d4b diff --git a/eng/common/templates/post-build/post-build.yml b/eng/common/templates/post-build/post-build.yml index 33db50ce26..aba0b0fcaf 100644 --- a/eng/common/templates/post-build/post-build.yml +++ b/eng/common/templates/post-build/post-build.yml @@ -52,6 +52,7 @@ stages: filePath: eng\common\sdk-task.ps1 arguments: -task SigningValidation -restore -msbuildEngine dotnet /p:PackageBasePath='$(Build.ArtifactStagingDirectory)/PackageArtifacts' + /p:SignCheckExclusionsFile='$(Build.SourcesDirectory)/eng/SignCheckExclusionsFile.txt' /p:Configuration=Release - ${{ if eq(parameters.enableSourceLinkValidation, 'true') }}: diff --git a/global.json b/global.json index f9f09157ec..c6130250f1 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19405.9", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19406.7", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 430101259bba41c67f4cc3872f36ccc8a846e5d9 Mon Sep 17 00:00:00 2001 From: Eugene Auduchinok Date: Thu, 8 Aug 2019 05:28:14 +0300 Subject: [PATCH 150/159] Make DoesIdentifierNeedQuotation public (#7365) --- src/fsharp/lexhelp.fs | 2 +- src/fsharp/lexhelp.fsi | 1 + src/fsharp/service/ServiceLexing.fs | 1 + src/fsharp/service/ServiceLexing.fsi | 3 +++ 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/fsharp/lexhelp.fs b/src/fsharp/lexhelp.fs index fb66ac5f85..6a9a6430cb 100755 --- a/src/fsharp/lexhelp.fs +++ b/src/fsharp/lexhelp.fs @@ -351,7 +351,7 @@ module Keywords = | _ -> IdentifierToken args lexbuf s - let inline private DoesIdentifierNeedQuotation (s : string) : bool = + let DoesIdentifierNeedQuotation (s : string) : bool = not (String.forall IsIdentifierPartCharacter s) // if it has funky chars || s.Length > 0 && (not(IsIdentifierFirstCharacter s.[0])) // or if it starts with a non-(letter-or-underscore) || keywordTable.ContainsKey s // or if it's a language keyword like "type" diff --git a/src/fsharp/lexhelp.fsi b/src/fsharp/lexhelp.fsi index 0ccb18d0db..f75ecd392d 100755 --- a/src/fsharp/lexhelp.fsi +++ b/src/fsharp/lexhelp.fsi @@ -69,6 +69,7 @@ exception IndentationProblem of string * Range.range module Keywords = val KeywordOrIdentifierToken : lexargs -> UnicodeLexing.Lexbuf -> string -> Parser.token val IdentifierToken : lexargs -> UnicodeLexing.Lexbuf -> string -> Parser.token + val DoesIdentifierNeedQuotation : string -> bool val QuoteIdentifierIfNeeded : string -> string val NormalizeIdentifierBackticks : string -> string val keywordNames : string list diff --git a/src/fsharp/service/ServiceLexing.fs b/src/fsharp/service/ServiceLexing.fs index 93427382d9..d91cb1f66a 100644 --- a/src/fsharp/service/ServiceLexing.fs +++ b/src/fsharp/service/ServiceLexing.fs @@ -783,6 +783,7 @@ type FSharpSourceTokenizer(defineConstants: string list, filename: string option module Keywords = open FSharp.Compiler.Lexhelp.Keywords + let DoesIdentifierNeedQuotation s = DoesIdentifierNeedQuotation s let QuoteIdentifierIfNeeded s = QuoteIdentifierIfNeeded s let NormalizeIdentifierBackticks s = NormalizeIdentifierBackticks s let KeywordsWithDescription = keywordsWithDescription diff --git a/src/fsharp/service/ServiceLexing.fsi b/src/fsharp/service/ServiceLexing.fsi index 84fa2e571a..85e18f171c 100755 --- a/src/fsharp/service/ServiceLexing.fsi +++ b/src/fsharp/service/ServiceLexing.fsi @@ -243,6 +243,9 @@ module internal TestExpose = val TokenInfo : Parser.token -> (FSharpTokenColorKind * FSharpTokenCharKind * FSharpTokenTriggerClass) module Keywords = + /// Checks if adding backticks to identifier is needed. + val DoesIdentifierNeedQuotation : string -> bool + /// Add backticks if the identifier is a keyword. val QuoteIdentifierIfNeeded : string -> string From 454eb419dc807a222b408be978bc199cccf35d33 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Thu, 8 Aug 2019 09:01:15 -0700 Subject: [PATCH 151/159] Update dependencies from https://github.com/dotnet/arcade build 20190807.9 (#7368) - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19407.9 --- eng/Version.Details.xml | 4 ++-- eng/common/templates/job/execute-sdl.yml | 2 ++ global.json | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 7e04a39de9..7f2a151da6 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - c155e609f88491128e1a66d09f413062f3344d4b + 77597ba7f484bef24368d966b7fe91fe38ec973b diff --git a/eng/common/templates/job/execute-sdl.yml b/eng/common/templates/job/execute-sdl.yml index f657a4dc91..91621cf88f 100644 --- a/eng/common/templates/job/execute-sdl.yml +++ b/eng/common/templates/job/execute-sdl.yml @@ -10,6 +10,8 @@ jobs: displayName: Run SDL tool variables: - group: DotNet-VSTS-Bot + pool: + name: Hosted VS2017 steps: - checkout: self clean: true diff --git a/global.json b/global.json index c6130250f1..914aa37a7d 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19406.7", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19407.9", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From d4761ed0b1807be6a17addfbd14559a4b40b36d6 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Thu, 8 Aug 2019 14:35:19 -0700 Subject: [PATCH 152/159] update build definition to use stages (#7361) * update build definition to use stages * disable arcade NuGet package validation --- azure-pipelines.yml | 306 -------------------------------------------- 1 file changed, 306 deletions(-) delete mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 2207a4792e..0000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,306 +0,0 @@ -# CI and PR triggers -trigger: -- master -- dev16.1 -- feature/* -- release/* -pr: -- master -- dev16.1 -- feature/* -- release/* - -variables: - - name: _TeamName - value: FSharp - - name: _BuildConfig - value: Release - - name: _PublishUsingPipelines - value: true - - name: _DotNetArtifactsCategory - value: .NETCore - - name: VisualStudioDropName - value: Products/$(System.TeamProject)/$(Build.Repository.Name)/$(Build.SourceBranchName)/$(Build.BuildNumber) - -# Variables defined in yml cannot be overridden at queue time; instead overridable variables must be defined in the web UI. -# Commenting out until something like this is supported: https://github.com/Microsoft/azure-pipelines-yaml/pull/129 -#variables: -#- name: SkipTests -# defaultValue: false - -jobs: - -#---------------------------------------------------------------------------------------------------------------------# -# Signed build # -#---------------------------------------------------------------------------------------------------------------------# -- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - - template: /eng/common/templates/jobs/jobs.yml - parameters: - enableMicrobuild: true - enablePublishBuildArtifacts: true - enablePublishTestResults: false - enablePublishBuildAssets: true - enablePublishUsingPipelines: $(_PublishUsingPipelines) - enableTelemetry: true - helixRepo: dotnet/fsharp - jobs: - - job: Full_Signed - pool: - name: NetCoreInternal-Int-Pool - queue: buildpool.windows.10.amd64.vs2019 - timeoutInMinutes: 300 - variables: - - group: DotNet-Blob-Feed - - group: DotNet-Symbol-Server-Pats - - name: _SignType - value: Real - - name: _DotNetPublishToBlobFeed - value: true - steps: - - checkout: self - clean: true - - script: eng\CIBuild.cmd - -configuration $(_BuildConfig) - -prepareMachine - -testAll - -officialSkipTests $(SkipTests) - /p:SignType=$(_SignType) - /p:DotNetSignType=$(_SignType) - /p:MicroBuild_SigningEnabled=true - /p:OverridePackageSource=https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json - /p:TeamName=$(_TeamName) - /p:DotNetPublishBlobFeedKey=$(dotnetfeed-storage-access-key-1) - /p:DotNetPublishBlobFeedUrl=https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json - /p:DotNetPublishToBlobFeed=true - /p:DotNetPublishUsingPipelines=$(_PublishUsingPipelines) - /p:DotNetArtifactsCategory=$(_DotNetArtifactsCategory) - /p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) - /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) - /p:OfficialBuildId=$(BUILD.BUILDNUMBER) - /p:PublishToSymbolServer=true - /p:VisualStudioDropName=$(VisualStudioDropName) - - task: PublishTestResults@2 - displayName: Publish Test Results - inputs: - testResultsFormat: 'NUnit' - testResultsFiles: '*.xml' - searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)' - continueOnError: true - condition: ne(variables['SkipTests'], 'true') - - task: PublishBuildArtifacts@1 - displayName: Publish Test Logs - inputs: - PathtoPublish: '$(Build.SourcesDirectory)\artifacts\TestResults\$(_BuildConfig)' - ArtifactName: 'Test Logs' - publishLocation: Container - continueOnError: true - condition: ne(variables['SkipTests'], 'true') - - task: PublishBuildArtifacts@1 - displayName: Publish Artifact Packages - inputs: - PathtoPublish: '$(Build.SourcesDirectory)\artifacts\packages\$(_BuildConfig)' - ArtifactName: 'Packages' - condition: succeeded() - - task: PublishBuildArtifacts@1 - displayName: Publish Artifact VSSetup - inputs: - PathtoPublish: '$(Build.SourcesDirectory)\artifacts\VSSetup\$(_BuildConfig)\Insertion' - ArtifactName: 'VSSetup' - condition: succeeded() - - task: PublishBuildArtifacts@1 - displayName: Publish Artifact Nightly - inputs: - PathtoPublish: '$(Build.SourcesDirectory)\artifacts\VSSetup\$(_BuildConfig)\VisualFSharpFull.vsix' - ArtifactName: 'Nightly' - condition: succeeded() - -#---------------------------------------------------------------------------------------------------------------------# -# PR builds # -#---------------------------------------------------------------------------------------------------------------------# -- ${{ if eq(variables['System.TeamProject'], 'public') }}: - - template: /eng/common/templates/jobs/jobs.yml - parameters: - enableMicrobuild: true - enablePublishBuildArtifacts: true - enablePublishTestResults: false - enablePublishBuildAssets: true - enablePublishUsingPipelines: $(_PublishUsingPipelines) - enableTelemetry: true - helixRepo: dotnet/fsharp - jobs: - - # Windows - - job: Windows - pool: - vmImage: windows-2019 - timeoutInMinutes: 120 - strategy: - maxParallel: 4 - matrix: - desktop_release: - _configuration: Release - _testKind: testDesktop - coreclr_release: - _configuration: Release - _testKind: testCoreclr - fsharpqa_release: - _configuration: Release - _testKind: testFSharpQA - vs_release: - _configuration: Release - _testKind: testVs - steps: - - checkout: self - clean: true - - script: eng\CIBuild.cmd -configuration $(_configuration) -$(_testKind) - displayName: Build / Test - - task: PublishTestResults@2 - displayName: Publish Test Results - inputs: - testResultsFormat: 'NUnit' - testResultsFiles: '*.xml' - searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_configuration)' - continueOnError: true - condition: ne(variables['_testKind'], 'testFSharpQA') - - task: PublishBuildArtifacts@1 - displayName: Publish Test Logs - inputs: - PathtoPublish: '$(Build.SourcesDirectory)\artifacts\TestResults\$(_configuration)' - ArtifactName: 'Windows $(_configuration) $(_testKind) test logs' - publishLocation: Container - continueOnError: true - condition: eq(variables['_testKind'], 'testFSharpQA') - - # Linux - - job: Linux - pool: - vmImage: ubuntu-16.04 - variables: - - name: _SignType - value: Test - steps: - - checkout: self - clean: true - - script: ./eng/cibuild.sh --configuration $(_BuildConfig) --testcoreclr - displayName: Build / Test - - task: PublishTestResults@2 - displayName: Publish Test Results - inputs: - testResultsFormat: 'NUnit' - testResultsFiles: '*.xml' - searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)' - continueOnError: true - condition: always() - - # MacOS - - job: MacOS - pool: - vmImage: macOS-10.13 - variables: - - name: _SignType - value: Test - steps: - - checkout: self - clean: true - - script: ./eng/cibuild.sh --configuration $(_BuildConfig) --testcoreclr - displayName: Build / Test - - task: PublishTestResults@2 - displayName: Publish Test Results - inputs: - testResultsFormat: 'NUnit' - testResultsFiles: '*.xml' - searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)' - continueOnError: true - condition: always() - - # Source Build Linux - - job: SourceBuild_Linux - pool: - vmImage: ubuntu-16.04 - steps: - - checkout: self - clean: true - - script: ./eng/cibuild.sh --configuration Release /p:DotNetBuildFromSource=true /p:FSharpSourceBuild=true - displayName: Build - - # Source Build Windows - - job: SourceBuild_Windows - pool: - vmImage: windows-2019 - steps: - - checkout: self - clean: true - - script: eng\CIBuild.cmd -configuration Release -noSign /p:DotNetBuildFromSource=true /p:FSharpSourceBuild=true - displayName: Build - - # Up-to-date - - job: UpToDate_Windows - pool: - vmImage: windows-2019 - steps: - - checkout: self - clean: true - - task: PowerShell@2 - displayName: Run up-to-date build check - inputs: - filePath: eng\tests\UpToDate.ps1 - arguments: -configuration $(_BuildConfig) -ci -binaryLog - -#---------------------------------------------------------------------------------------------------------------------# -# FCS builds # -#---------------------------------------------------------------------------------------------------------------------# - -- ${{ if eq(variables['System.TeamProject'], 'public') }}: - - template: /eng/common/templates/jobs/jobs.yml - parameters: - enableMicrobuild: true - enablePublishTestResults: false - enablePublishBuildAssets: true - enablePublishUsingPipelines: false - enableTelemetry: true - helixRepo: dotnet/fsharp - jobs: - - - job: Windows_FCS - pool: - vmImage: windows-2019 - variables: - - name: _SignType - value: Test - steps: - - checkout: self - clean: true - - script: fcs\build.cmd TestAndNuget - displayName: Build / Test - - task: PublishTestResults@2 - displayName: Publish Test Results - inputs: - testResultsFormat: 'NUnit' - testResultsFiles: '*.xml' - searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults/Release' - continueOnError: true - condition: always() - - - job: Linux_FCS - pool: - vmImage: ubuntu-16.04 - variables: - - name: _SignType - value: Test - steps: - - checkout: self - clean: true - - script: ./fcs/build.sh Build - displayName: Build - - - job: MacOS_FCS - pool: - vmImage: macOS-10.13 - variables: - - name: _SignType - value: Test - steps: - - checkout: self - clean: true - - script: ./fcs/build.sh Build - displayName: Build From aed915a54dfff683afffb21f9321a0bddb3350e5 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Thu, 8 Aug 2019 16:58:20 -0700 Subject: [PATCH 153/159] Netcoreapp3 (#7359) * Use netcoresdk 3.0 * Use appdomain and load context * temp * Execute in appdomain, or assemblyloadcontext * fscore * linux * Try to publish test logs from Linux/MacOS * Copy paste error * netcoreapp3 * feedback --- NuGet.config | 8 +++ eng/Build.ps1 | 6 +- eng/build.sh | 2 +- .../FSharp.Compiler.LanguageServer.fsproj | 4 +- .../Directory.Build.props | 9 --- ...p.Compiler.LanguageServer.UnitTests.fsproj | 27 --------- .../ProtocolTests.fs | 59 ------------------- .../SerializationTests.fs | 33 ----------- 8 files changed, 14 insertions(+), 134 deletions(-) delete mode 100644 tests/FSharp.Compiler.LanguageServer.UnitTests/Directory.Build.props delete mode 100644 tests/FSharp.Compiler.LanguageServer.UnitTests/FSharp.Compiler.LanguageServer.UnitTests.fsproj delete mode 100644 tests/FSharp.Compiler.LanguageServer.UnitTests/ProtocolTests.fs delete mode 100644 tests/FSharp.Compiler.LanguageServer.UnitTests/SerializationTests.fs diff --git a/NuGet.config b/NuGet.config index a8664a73c5..02fa667590 100644 --- a/NuGet.config +++ b/NuGet.config @@ -22,6 +22,14 @@ + + + + + + + + diff --git a/eng/Build.ps1 b/eng/Build.ps1 index 1372df4e5f..75f0178b7d 100644 --- a/eng/Build.ps1 +++ b/eng/Build.ps1 @@ -174,7 +174,7 @@ function BuildSolution() { $officialBuildId = if ($official) { $env:BUILD_BUILDNUMBER } else { "" } $toolsetBuildProj = InitializeToolset $quietRestore = !$ci - $testTargetFrameworks = if ($testCoreClr) { "netcoreapp2.1" } else { "" } + $testTargetFrameworks = if ($testCoreClr) { "netcoreapp3.0" } else { "" } # Do not set the property to true explicitly, since that would override value projects might set. $suppressExtensionDeployment = if (!$deployExtensions) { "/p:DeployExtension=false" } else { "" } @@ -309,7 +309,7 @@ try { Prepare-TempDir EnablePreviewSdks - # enable us to build netcoreapp2.1 binaries + # enable us to build netcoreapp2.1 product binaries $global:_DotNetInstallDir = Join-Path $RepoRoot ".dotnet" InstallDotNetSdk $global:_DotNetInstallDir $GlobalJson.tools.dotnet InstallDotNetSdk $global:_DotNetInstallDir "2.1.503" @@ -332,7 +332,7 @@ try { } $desktopTargetFramework = "net472" - $coreclrTargetFramework = "netcoreapp2.1" + $coreclrTargetFramework = "netcoreapp3.0" if ($testDesktop -and -not $noVisualStudio) { TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $desktopTargetFramework diff --git a/eng/build.sh b/eng/build.sh index fceb485349..e806856c55 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -269,7 +269,7 @@ InstallDotNetSdk $_InitializeDotNetCli 2.1.503 BuildSolution if [[ "$test_core_clr" == true ]]; then - coreclrtestframework=netcoreapp2.1 + coreclrtestframework=netcoreapp3.0 TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.UnitTests/FSharp.Compiler.UnitTests.fsproj" --targetframework $coreclrtestframework TestUsingNUnit --testproject "$repo_root/tests/FSharp.Compiler.LanguageServer.UnitTests/FSharp.Compiler.LanguageServer.UnitTests.fsproj" --targetframework $coreclrtestframework TestUsingNUnit --testproject "$repo_root/tests/FSharp.Build.UnitTests/FSharp.Build.UnitTests.fsproj" --targetframework $coreclrtestframework diff --git a/src/fsharp/FSharp.Compiler.LanguageServer/FSharp.Compiler.LanguageServer.fsproj b/src/fsharp/FSharp.Compiler.LanguageServer/FSharp.Compiler.LanguageServer.fsproj index 48e2c5104a..fd6e517e54 100644 --- a/src/fsharp/FSharp.Compiler.LanguageServer/FSharp.Compiler.LanguageServer.fsproj +++ b/src/fsharp/FSharp.Compiler.LanguageServer/FSharp.Compiler.LanguageServer.fsproj @@ -4,8 +4,8 @@ Exe .exe - net472;netcoreapp2.1 - netcoreapp2.1 + net472;netcoreapp3.0 + netcoreapp3.0 true Implements the Language Server Protocol (LSP) for F#. true diff --git a/tests/FSharp.Compiler.LanguageServer.UnitTests/Directory.Build.props b/tests/FSharp.Compiler.LanguageServer.UnitTests/Directory.Build.props deleted file mode 100644 index 7cd41381b5..0000000000 --- a/tests/FSharp.Compiler.LanguageServer.UnitTests/Directory.Build.props +++ /dev/null @@ -1,9 +0,0 @@ - - - - true - - - - - diff --git a/tests/FSharp.Compiler.LanguageServer.UnitTests/FSharp.Compiler.LanguageServer.UnitTests.fsproj b/tests/FSharp.Compiler.LanguageServer.UnitTests/FSharp.Compiler.LanguageServer.UnitTests.fsproj deleted file mode 100644 index a9df8d199e..0000000000 --- a/tests/FSharp.Compiler.LanguageServer.UnitTests/FSharp.Compiler.LanguageServer.UnitTests.fsproj +++ /dev/null @@ -1,27 +0,0 @@ - - - - - net472;netcoreapp2.1 - netcoreapp2.1 - Library - true - nunit - true - - - - - - - - - - - - - - - - - diff --git a/tests/FSharp.Compiler.LanguageServer.UnitTests/ProtocolTests.fs b/tests/FSharp.Compiler.LanguageServer.UnitTests/ProtocolTests.fs deleted file mode 100644 index 4d0a789b9c..0000000000 --- a/tests/FSharp.Compiler.LanguageServer.UnitTests/ProtocolTests.fs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -namespace FSharp.Compiler.LanguageServer.UnitTests - -open System.Diagnostics -open System.Threading.Tasks -open FSharp.Compiler.LanguageServer -open NUnit.Framework -open StreamJsonRpc - -[] -type ProtocolTests() = - -#if !NETCOREAPP - // The `netcoreapp2.1` version of `FSharp.Compiler.LanguageServer.exe` can't be run without a `publish` step so - // we're artificially restricting this test to the full framework. - [] -#endif - member __.``Server consuming stdin and stdout``() = - async { - // start server as a console app - let serverAssemblyPath = typeof.Assembly.Location - let startInfo = ProcessStartInfo(serverAssemblyPath) - startInfo.UseShellExecute <- false - startInfo.RedirectStandardInput <- true - startInfo.RedirectStandardOutput <- true - let proc = Process.Start(startInfo) - - // create a fake client over stdin/stdout - let client = new JsonRpc(proc.StandardInput.BaseStream, proc.StandardOutput.BaseStream) - client.StartListening() - - // initialize - let capabilities = - { ClientCapabilities.workspace = None - textDocument = None - experimental = None - supportsVisualStudioExtensions = None } - let! result = - client.InvokeAsync( - "initialize", // method - 0, // processId - "rootPath", - "rootUri", - null, // initializationOptions - capabilities, // client capabilities - "none") // trace - |> Async.AwaitTask - Assert.True(result.capabilities.hoverProvider) - do! client.NotifyAsync("initialized") |> Async.AwaitTask - - // shutdown - let! shutdownResponse = client.InvokeAsync("shutdown") |> Async.AwaitTask - Assert.IsNull(shutdownResponse) - - // exit - do! client.NotifyAsync("exit") |> Async.AwaitTask - if not (proc.WaitForExit(5000)) then failwith "Expected server process to exit." - } |> Async.StartAsTask :> Task diff --git a/tests/FSharp.Compiler.LanguageServer.UnitTests/SerializationTests.fs b/tests/FSharp.Compiler.LanguageServer.UnitTests/SerializationTests.fs deleted file mode 100644 index 5d8457c4e5..0000000000 --- a/tests/FSharp.Compiler.LanguageServer.UnitTests/SerializationTests.fs +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. - -namespace FSharp.Compiler.LanguageServer.UnitTests - -open System -open FSharp.Compiler.LanguageServer -open NUnit.Framework -open Newtonsoft.Json - -[] -type SerializationTests() = - - let verifyRoundTrip (str: string) (typ: Type) = - let deserialized = JsonConvert.DeserializeObject(str, typ) - let roundTripped = JsonConvert.SerializeObject(deserialized) - Assert.AreEqual(str, roundTripped) - - let verifyRoundTripWithConverter (str: string) (typ: Type) (converter: JsonConverter) = - let deserialized = JsonConvert.DeserializeObject(str, typ, converter) - let roundTripped = JsonConvert.SerializeObject(deserialized, converter) - Assert.AreEqual(str, roundTripped) - - [] - member __.``Discriminated union as lower-case string``() = - verifyRoundTrip "\"plaintext\"" typeof - verifyRoundTrip "\"markdown\"" typeof - - [] - member __.``Option<'T> as obj/null``() = - verifyRoundTripWithConverter "1" typeof> (JsonOptionConverter()) - verifyRoundTripWithConverter "null" typeof> (JsonOptionConverter()) - verifyRoundTripWithConverter "{\"contents\":{\"kind\":\"plaintext\",\"value\":\"v\"},\"range\":{\"start\":{\"line\":1,\"character\":2},\"end\":{\"line\":3,\"character\":4}}}" typeof> (JsonOptionConverter()) - verifyRoundTripWithConverter "null" typeof> (JsonOptionConverter()) From ebd69e352dcc8da3a1f416e9979d758208001114 Mon Sep 17 00:00:00 2001 From: "Brett V. Forsgren" Date: Thu, 8 Aug 2019 19:52:46 -0700 Subject: [PATCH 154/159] move attribution of F# Software Foundation to package description (#7370) Due to internal package publishing policies, the author of a package published via a Microsoft account must be exactly 'Microsoft'. To preserve attribution to the F# Software Foundation, mention is made in the tag of FSharp.Core. --- eng/targets/Settings.props | 1 - src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.csproj | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/eng/targets/Settings.props b/eng/targets/Settings.props index 6360088320..3290288182 100644 --- a/eng/targets/Settings.props +++ b/eng/targets/Settings.props @@ -2,7 +2,6 @@ MIT - Microsoft and F# Software Foundation Visual F# Compiler FSharp functional programming $(ArtifactsBinDir) diff --git a/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.csproj b/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.csproj index fd2d5162c7..512bfaad70 100644 --- a/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.csproj +++ b/src/fsharp/FSharp.Core.nuget/FSharp.Core.nuget.csproj @@ -6,7 +6,7 @@ FSharp.Core FSharp.Core.nuspec true - FSharp.Core redistributables from Visual F# Tools version $(FSPackageMajorVersion) For F# $(FSCoreMajorVersion) + FSharp.Core redistributables from Visual F# Tools version $(FSPackageMajorVersion) For F# $(FSCoreMajorVersion). Contains code from the F# Software Foundation. From f194eb0208ed7a8171699c8356393aaa760a7847 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 9 Aug 2019 17:19:05 +0000 Subject: [PATCH 155/159] Update dependencies from https://github.com/dotnet/arcade build 20190808.13 (#7371) - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19408.13 --- NuGet.config | 2 -- eng/Version.Details.xml | 4 ++-- global.json | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/NuGet.config b/NuGet.config index 02fa667590..df85afb048 100644 --- a/NuGet.config +++ b/NuGet.config @@ -22,8 +22,6 @@ - - diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 7f2a151da6..e812a2affc 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - 77597ba7f484bef24368d966b7fe91fe38ec973b + 524bb3e06ffd5b483a3c71a8f670b7a4bd2c232a diff --git a/global.json b/global.json index 914aa37a7d..d59ddadcfd 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19407.9", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19408.13", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 3dd4fefac57beb027487d4c8cba48554eeee6ad8 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 10 Aug 2019 08:40:32 -0700 Subject: [PATCH 156/159] Update dependencies from https://github.com/dotnet/arcade build 20190809.8 (#7382) - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19409.8 --- eng/Version.Details.xml | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index e812a2affc..cffeec3d9f 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - 524bb3e06ffd5b483a3c71a8f670b7a4bd2c232a + f22982a641aa6f29585b6ab1de85912814a00bac diff --git a/global.json b/global.json index d59ddadcfd..8e9cc09f23 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19408.13", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19409.8", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 8b0bb8e7cb7c8a4ad937ecf0d27d12b56498b606 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sun, 11 Aug 2019 10:20:36 -0700 Subject: [PATCH 157/159] Update dependencies from https://github.com/dotnet/arcade build 20190810.2 (#7385) - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19410.2 --- eng/Version.Details.xml | 4 ++-- global.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index cffeec3d9f..848ec45335 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -3,9 +3,9 @@ - + https://github.com/dotnet/arcade - f22982a641aa6f29585b6ab1de85912814a00bac + e2f5f0f5c20a1fef71845795b09066a5cd892a7e diff --git a/global.json b/global.json index 8e9cc09f23..42b7fded08 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19409.8", + "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19410.2", "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19069.2" } } From 8a850b405337e55f6c018c1eb660a910e21ec5a7 Mon Sep 17 00:00:00 2001 From: Chet Husk Date: Sun, 11 Aug 2019 17:14:44 -0500 Subject: [PATCH 158/159] add release notes --- fcs/RELEASE_NOTES.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/fcs/RELEASE_NOTES.md b/fcs/RELEASE_NOTES.md index 35476348dd..e8f9a0280d 100644 --- a/fcs/RELEASE_NOTES.md +++ b/fcs/RELEASE_NOTES.md @@ -1,3 +1,15 @@ +#### 31.0.0 + * Integrate dotnet/fsharp from 5a8f454a1 to 05c558a61 + * Notable changes include: + * Removal of the `Microsoft.FSharp.Compiler.SourceCodeServices` namespace + * A new API for determining if an identifier needs to be quoted is available: `FSharp.Compiler.LexHelp.Keywords.DoesIdentifierNeedQuotation` + * Enhancements to the correctness of PDBs, especially with anonymous records + * Better string formatting of records and values + * More stack overflow fixes in the compiler + * Inline IL parsing error handling + * `LeafExpressionConverter` handles struct tuples + * `FSharpChecker` now can parse a file without caching: `ParseFileNoCache` + #### 30.0.0 * Integrate dotnet/fsharp from 25560f477 to 5a8f454a1 * Notable improvements include: @@ -5,7 +17,6 @@ * FCS APIs for FSComp and Implement Interface * line directive handling * improved performance when computing quick fix suggestions - #### 29.0.1 * Fix versioning of the assembly From c53a00673939b884824efa728a6b355072088892 Mon Sep 17 00:00:00 2001 From: Chet Husk Date: Sun, 11 Aug 2019 17:28:17 -0500 Subject: [PATCH 159/159] Fix release notes/shell cli incompatibility --- fcs/RELEASE_NOTES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fcs/RELEASE_NOTES.md b/fcs/RELEASE_NOTES.md index e8f9a0280d..73164bb892 100644 --- a/fcs/RELEASE_NOTES.md +++ b/fcs/RELEASE_NOTES.md @@ -3,7 +3,7 @@ * Notable changes include: * Removal of the `Microsoft.FSharp.Compiler.SourceCodeServices` namespace * A new API for determining if an identifier needs to be quoted is available: `FSharp.Compiler.LexHelp.Keywords.DoesIdentifierNeedQuotation` - * Enhancements to the correctness of PDBs, especially with anonymous records + * Enhancements to the correctness of PDBs * Better string formatting of records and values * More stack overflow fixes in the compiler * Inline IL parsing error handling