diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index a9bfa2cb001..810004aa4d7 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/fcs/download-paket.ps1 b/fcs/download-paket.ps1 index 7aa8c5ef6f7..4541168012b 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 d2bf8524a89..2825ac4d5ae 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 diff --git a/global.json b/global.json index e225ab15ddc..53d05811a7f 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" } } diff --git a/src/fsharp/service/Reactor.fs b/src/fsharp/service/Reactor.fs index dd307ca13e1..f879e5133f9 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. @@ -131,6 +131,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 5ea9572f48f..3040ca65eee 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 1c6d8e8fb32..e45488e9fe9 100644 --- a/src/fsharp/service/service.fs +++ b/src/fsharp/service/service.fs @@ -519,6 +519,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 @@ -636,6 +637,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) diff --git a/tests/fsharp/Compiler/CompilerAssert.fs b/tests/fsharp/Compiler/CompilerAssert.fs index 46f202db266..2f3b600ff01 100644 --- a/tests/fsharp/Compiler/CompilerAssert.fs +++ b/tests/fsharp/Compiler/CompilerAssert.fs @@ -25,7 +25,7 @@ module CompilerAssert = ProjectId = None SourceFiles = [|"test.fs"|] #if !NETCOREAPP - OtherOptions = [||] + OtherOptions = [|"--preferreduilang:en-US";|] #else OtherOptions = // Hack: Currently a hack to get the runtime assemblies for netcore in order to compile. @@ -36,8 +36,7 @@ module CompilerAssert = |> Seq.toArray |> Array.filter (fun x -> x.ToLowerInvariant().Contains("system.") || x.ToLowerInvariant().EndsWith("netstandard.dll")) |> Array.map (fun x -> sprintf "-r:%s" x) - Array.append [|"--targetprofile:netcore"; "--noframework"|] assemblies - + Array.append [|"--preferreduilang:en-US"; "--targetprofile:netcore"; "--noframework"|] assemblies #endif ReferencedProjects = [||] IsIncompleteTypeCheckEnvironment = false @@ -55,25 +54,26 @@ module CompilerAssert = lock lockObj <| fun () -> let parseResults, fileAnswer = checker.ParseAndCheckFileInProject("test.fs", 0, SourceText.ofString source, defaultProjectOptions) |> Async.RunSynchronously - Assert.True(parseResults.Errors.Length = 0, sprintf "Parse errors: %A" parseResults.Errors) + Assert.IsEmpty(parseResults.Errors, sprintf "Parse errors: %A" parseResults.Errors) match fileAnswer with | FSharpCheckFileAnswer.Aborted _ -> Assert.Fail("Type Checker Aborted") | FSharpCheckFileAnswer.Succeeded(typeCheckResults) -> - Assert.True(typeCheckResults.Errors.Length = 0, sprintf "Type Check errors: %A" typeCheckResults.Errors) + Assert.IsEmpty(typeCheckResults.Errors, sprintf "Type Check errors: %A" typeCheckResults.Errors) + let TypeCheckSingleError (source: string) (expectedErrorNumber: int) (expectedErrorRange: int * int * int * int) (expectedErrorMsg: string) = lock lockObj <| fun () -> let parseResults, fileAnswer = checker.ParseAndCheckFileInProject("test.fs", 0, SourceText.ofString source, defaultProjectOptions) |> Async.RunSynchronously - Assert.True(parseResults.Errors.Length = 0, sprintf "Parse errors: %A" parseResults.Errors) + Assert.IsEmpty(parseResults.Errors, sprintf "Parse errors: %A" parseResults.Errors) match fileAnswer with | FSharpCheckFileAnswer.Aborted _ -> Assert.Fail("Type Checker Aborted") | FSharpCheckFileAnswer.Succeeded(typeCheckResults) -> - Assert.True(typeCheckResults.Errors.Length = 1, sprintf "Expected one type check error: %A" typeCheckResults.Errors) + Assert.AreEqual(1, typeCheckResults.Errors.Length, sprintf "Expected one type check error: %A" typeCheckResults.Errors) typeCheckResults.Errors |> Array.iter (fun info -> Assert.AreEqual(FSharpErrorSeverity.Error, info.Severity)