Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite2168fa

Browse files
authored
Enable preferreduilang for fsi (#4253)
* Add support for --preferreduilang in fsi.exe* Prefereduiculture for fsi* Remove dead code
1 parent5728b68 commite2168fa

File tree

8 files changed

+6
-60
lines changed

8 files changed

+6
-60
lines changed

‎src/FSharpSource.Profiles.targets‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<ProjectToolsVersion="4.0"DefaultTargets="Build"xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
44

55
<PropertyGroupCondition="'$(TargetDotnetProfile)'=='net40'">
6-
<DefineConstants>$(DefineConstants);PREFERRED_UI_LANG</DefineConstants>
76
<DefineConstants>$(DefineConstants);ENABLE_MONO_SUPPORT</DefineConstants>
87
<DefineConstants>$(DefineConstants);BE_SECURITY_TRANSPARENT</DefineConstants>
98
<DefineConstants>$(DefineConstants);FX_LCIDFROMCODEPAGE</DefineConstants>
@@ -15,7 +14,6 @@
1514
<PropertyGroupCondition="'$(TargetDotnetProfile)'=='coreclr'">
1615
<DefineConstants>$(DefineConstants);FX_PORTABLE_OR_NETSTANDARD</DefineConstants>
1716
<DefineConstants>$(DefineConstants);NETSTANDARD1_6</DefineConstants>
18-
<DefineConstants>$(DefineConstants);PREFERRED_UI_LANG</DefineConstants>
1917
<DefineConstants>$(DefineConstants);FX_NO_APP_DOMAINS</DefineConstants>
2018
<DefineConstants>$(DefineConstants);FX_NO_ARRAY_LONG_LENGTH</DefineConstants>
2119
<DefineConstants>$(DefineConstants);FX_NO_BEGINEND_READWRITE</DefineConstants>

‎src/fsharp/CompileOps.fs‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2287,9 +2287,7 @@ type TcConfigBuilder =
22872287
mutable optSettings:Optimizer.OptimizationSettings
22882288
mutable emitTailcalls:bool
22892289
mutable deterministic:bool
2290-
#if PREFERRED_UI_LANG
22912290
mutable preferredUiLang:string option
2292-
#endif
22932291
mutable lcid:int option
22942292
mutable productNameForBannerText:string
22952293
/// show the MS (c) notice, e.g. with help or fsi?
@@ -2448,9 +2446,7 @@ type TcConfigBuilder =
24482446
optSettings= Optimizer.OptimizationSettings.Defaults
24492447
emitTailcalls=true
24502448
deterministic=false
2451-
#if PREFERRED_UI_LANG
24522449
preferredUiLang= None
2453-
#endif
24542450
lcid= None
24552451
// See bug 6071 for product banner spec
24562452
productNameForBannerText= FSComp.SR.buildProductName(FSharpEnvironment.FSharpBannerVersion)
@@ -2914,9 +2910,7 @@ type TcConfig private (data : TcConfigBuilder, validate:bool) =
29142910
memberx.optSettings= data.optSettings
29152911
memberx.emitTailcalls= data.emitTailcalls
29162912
memberx.deterministic= data.deterministic
2917-
#if PREFERRED_UI_LANG
29182913
memberx.preferredUiLang= data.preferredUiLang
2919-
#endif
29202914
memberx.lcid= data.lcid
29212915
memberx.optsOn= data.optsOn
29222916
memberx.productNameForBannerText= data.productNameForBannerText

‎src/fsharp/CompileOps.fsi‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,7 @@ type TcConfigBuilder =
331331
mutable optSettings:Optimizer.OptimizationSettings
332332
mutable emitTailcalls:bool
333333
mutable deterministic:bool
334-
#if PREFERRED_UI_LANG
335334
mutable preferredUiLang:string option
336-
#endif
337335
mutable lcid:int option
338336
mutable productNameForBannerText:string
339337
mutable showBanner:bool
@@ -481,11 +479,7 @@ type TcConfig =
481479
member optSettings: Optimizer.OptimizationSettings
482480
member emitTailcalls: bool
483481
member deterministic: bool
484-
#if PREFERRED_UI_LANG
485482
member preferredUiLang: string option
486-
#else
487-
member lcid: int option
488-
#endif
489483
member optsOn: bool
490484
member productNameForBannerText: string
491485
member showBanner: bool

‎src/fsharp/CompileOptions.fs‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -739,10 +739,8 @@ let codePageFlag (tcConfigB : TcConfigBuilder) =
739739
tcConfigB.inputCodePage<- Some(n)), None,
740740
Some(FSComp.SR.optsCodepage()))
741741

742-
#if PREFERRED_UI_LANG
743742
letpreferredUiLang(tcConfigB:TcConfigBuilder)=
744743
CompilerOption("preferreduilang", tagString, OptionString(fun s-> tcConfigB.preferredUiLang<- Some(s)), None, Some(FSComp.SR.optsPreferredUiLang()))
745-
#endif
746744

747745
letutf8OutputFlag(tcConfigB:TcConfigBuilder)=
748746
CompilerOption("utf8output", tagNone, OptionUnit(fun()-> tcConfigB.utf8output<-true), None,
@@ -771,9 +769,7 @@ let advancedFlagsBoth tcConfigB =
771769
[
772770
yield codePageFlag tcConfigB
773771
yield utf8OutputFlag tcConfigB
774-
#if PREFERRED_UI_LANG
775772
yield preferredUiLang tcConfigB
776-
#endif
777773
yield fullPathsFlag tcConfigB
778774
yield libFlag tcConfigB
779775
yield CompilerOption("simpleresolution",
@@ -849,11 +845,7 @@ let testFlag tcConfigB =
849845
letvsSpecificFlags(tcConfigB:TcConfigBuilder)=
850846
[ CompilerOption("vserrors", tagNone, OptionUnit(fun()-> tcConfigB.errorStyle<- ErrorStyle.VSErrors), None, None)
851847
CompilerOption("validate-type-providers", tagNone, OptionUnit(id), None, None)// preserved for compatibility's sake, no longer has any effect
852-
#if PREFERRED_UI_LANG
853848
CompilerOption("LCID", tagInt, OptionInt(fun _n->()), None, None)
854-
#else
855-
CompilerOption("LCID", tagInt, OptionInt(fun n-> tcConfigB.lcid<- Some(n)), None, None)
856-
#endif
857849
CompilerOption("flaterrors", tagNone, OptionUnit(fun()-> tcConfigB.flatErrors<-true), None, None)
858850
CompilerOption("sqmsessionguid", tagNone, OptionString(fun s-> tcConfigB.sqmSessionGuid<-try System.Guid(s)|> Somewith e-> None), None, None)
859851
CompilerOption("gccerrors", tagNone, OptionUnit(fun()-> tcConfigB.errorStyle<- ErrorStyle.GccErrors), None, None)

‎src/fsharp/fsc.fs‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,19 +1635,13 @@ let main0(ctok, argv, legacyReferenceResolver, bannerAlreadyPrinted, openBinarie
16351635
letdirectoryBuildingFrom= Directory.GetCurrentDirectory()
16361636
letsetProcessThreadLocals tcConfigB=
16371637
tcConfigB.openBinariesInMemory<- openBinariesInMemory
1638-
#if PREFERRED_UI_LANG
16391638
match tcConfigB.preferredUiLangwith
16401639
#if FX_RESHAPED_GLOBALIZATION
16411640
| Some s-> System.Globalization.CultureInfo.CurrentUICulture<-new System.Globalization.CultureInfo(s)
16421641
#else
16431642
| Some s-> Thread.CurrentThread.CurrentUICulture<-new System.Globalization.CultureInfo(s)
16441643
#endif
16451644
| None->()
1646-
#else
1647-
match tcConfigB.lcidwith
1648-
| Some n-> Thread.CurrentThread.CurrentUICulture<-new CultureInfo(n)
1649-
| None->()
1650-
#endif
16511645
if tcConfigB.utf8outputthen
16521646
Console.OutputEncoding<- Encoding.UTF8
16531647

‎src/fsharp/fsi/fsi.fs‎

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2419,19 +2419,6 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i
24192419
// We later switch to doing interaction-by-interaction processing on the "event loop" thread.
24202420
letctokStartup= AssumeCompilationThreadWithoutEvidence()
24212421

2422-
#if FX_LCIDFROMCODEPAGE
2423-
2424-
// See Bug 735819
2425-
letlcidFromCodePage=
2426-
if(Console.OutputEncoding.CodePage<>65001)&&
2427-
(Console.OutputEncoding.CodePage<> Thread.CurrentThread.CurrentUICulture.TextInfo.OEMCodePage)&&
2428-
(Console.OutputEncoding.CodePage<> Thread.CurrentThread.CurrentUICulture.TextInfo.ANSICodePage)then
2429-
Thread.CurrentThread.CurrentUICulture<-new CultureInfo("en-US")
2430-
Some1033
2431-
else
2432-
None
2433-
#endif
2434-
24352422
lettimeReporter= FsiTimeReporter(outWriter)
24362423

24372424
#if!FX_RESHAPED_CONSOLE
@@ -2494,19 +2481,14 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i
24942481
letfsiOptions= FsiCommandLineOptions(fsi, argv, tcConfigB, fsiConsoleOutput)
24952482
letfsiConsolePrompt= FsiConsolePrompt(fsiOptions, fsiConsoleOutput)
24962483

2497-
// Check if we have a codepage from the console
2498-
#if FX_LCIDFROMCODEPAGE
24992484
do
2500-
match fsiOptions.FsiLCIDwith
2501-
| Some_->()
2502-
| None-> tcConfigB.lcid<- lcidFromCodePage
2503-
2504-
// Set the ui culture
2505-
do
2506-
match fsiOptions.FsiLCIDwith
2507-
| Some(n)-> Thread.CurrentThread.CurrentUICulture<-new CultureInfo(n)
2508-
| None->()
2485+
match tcConfigB.preferredUiLangwith
2486+
#if FX_RESHAPED_GLOBALIZATION
2487+
| Some s-> System.Globalization.CultureInfo.CurrentUICulture<-new System.Globalization.CultureInfo(s)
2488+
#else
2489+
| Some s-> Thread.CurrentThread.CurrentUICulture<-new System.Globalization.CultureInfo(s)
25092490
#endif
2491+
| None->()
25102492

25112493
#if!FX_NO_SERVERCODEPAGES
25122494
do

‎vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectNode.cs‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3277,16 +3277,9 @@ internal virtual BuildSubmission DoMSBuildSubmission(BuildKind buildKind, string
32773277

32783278
projectInstance.SetProperty("UTFOutput","true");
32793279

3280-
#ifFX_PREFERRED_UI_LANG
32813280
// The CoreCLR build of FSC will use the CultureName since lcid doesn't apply very well
32823281
// so that the errors reported by fsc.exe are in the right locale
32833282
projectInstance.SetProperty("PREFERREDUILANG",System.Threading.Thread.CurrentThread.CurrentUICulture.Name);
3284-
#else
3285-
// When building, we need to set the flags for the fsc.exe that we spawned
3286-
// so that the errors reported by fsc.exe are in the right locale
3287-
projectInstance.SetProperty("LCID",System.Threading.Thread.CurrentThread.CurrentUICulture.LCID.ToString());
3288-
#endif
3289-
32903283
this.BuildProject.ProjectCollection.HostServices.SetNodeAffinity(projectInstance.FullPath,NodeAffinity.InProc);
32913284
BuildRequestDatarequestData=newBuildRequestData(projectInstance,targetsToBuild,this.BuildProject.ProjectCollection.HostServices,BuildRequestDataFlags.ReplaceExistingProjectInstance);
32923285
submission=BuildManager.DefaultBuildManager.PendBuildRequest(requestData);

‎vsintegration/src/FSharp.ProjectSystem.Base/Project/ProjectSystem.Base.csproj‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
<DefineConstants>$(DefineConstants);CODE_ANALYSIS</DefineConstants>
2323
<AsmmetaDependsOnMSBuildInVS>true</AsmmetaDependsOnMSBuildInVS>
2424
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
25-
<DefineConstants>$(DefineConstants);FX_PREFERRED_UI_LANG</DefineConstants>
2625
<TargetFrameworkProfile>
2726
</TargetFrameworkProfile>
2827
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp