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

Commit602daf8

Browse files
authored
Another go at --- Map workspace to iprojectsite (#3564)
* Saved* SDK editor support* Address merge issues* Feedback* reduce delta* invalidate ide when a new file is discovered* Go faster stripes* feedback + refactor* tryFindIndex* Cleanup + Ensure that FSharp.Core.BuildFromSource.proj works at designtime* final clean up* label for HandleCommandLineChanges* ensure some buildfromsource porojects load
1 parent4769a92 commit602daf8

File tree

9 files changed

+177
-59
lines changed

9 files changed

+177
-59
lines changed

‎src/FSharpSource.BuildFromSource.targets‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
<TargetName="CopyAndSubstituteTextFiles"
3939
BeforeTargets="Compile"
4040
Inputs="@(CopyAndSubstituteText)"
41-
Outputs="@(CopyAndSubstituteText->'$(OutDir)%(TargetFilename)')" >
41+
Outputs="@(CopyAndSubstituteText->'$(OutDir)%(TargetFilename)')"
42+
Condition="'$(DesignTimeBuild)' != 'true'">
4243

4344
<ItemGroup>
4445
<ResultsInclude="@(CopyAndSubstituteText->'$(OutDir)%(TargetFilename)')">

‎src/buildfromsource.cmd‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if ERRORLEVEL 1 echo Error: failed && goto :failure
2020
rem build and pack tools
2121
dotnet restore%__scriptpath%fsharp\FSharp.Compiler.nuget\FSharp.Compiler.nuget.BuildFromSource.fsproj
2222
ifERRORLEVEL1echo Error: failed&&goto :failure
23-
dotnet pack%__scriptpath%fsharp\FSharp.Compiler.nuget\FSharp.Compiler.nuget.BuildFromSource.fsproj -crelease
23+
dotnet pack%__scriptpath%fsharp\FSharp.Compiler.nuget\FSharp.Compiler.nuget.BuildFromSource.fsproj -cdebug
2424
ifERRORLEVEL1echo Error: failed&&goto :failure
2525

2626
goto :success
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
22

33
namespaceMicrosoft.FSharp
4-
openSystem.Reflection
5-
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo("VisualFSharp.Unittests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")>]
6-
74

5+
[<assembly:System.Runtime.CompilerServices.InternalsVisibleTo("VisualFSharp.Unittests, PublicKey=002400000480000094000000060200000024000052534131000400000100010007D1FA57C4AED9F0A32E84AA0FAEFD0DE9E8FD6AEC8F87FB03766C834C99921EB23BE79AD9D5DCC1DD9AD236132102900B723CF980957FC4E177108FC607774F29E8320E92EA05ECE4E821C0A5EFE8F1645C4C0C93C1AB99285D622CAA652C1DFAD63D745D6F2DE5F17E5EAF0FC4963D261C8A12436518206DC093344D5AD293")>]
86
do()
9-

‎src/fsharp/FSharp.Core/FSharp.Core.BuildFromSource.fsproj‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<OtherFlags>$(OtherFlags) --warnon:1182 --compiling-fslib --compiling-fslib-40 --maxerrors:20 --extraoptimizationloops:1</OtherFlags>
1414
</PropertyGroup>
1515

16-
<Import Project ="$(MSBuildThisFileDirectory)..\..\FSharpSource.BuildFromSource.targets" />
16+
<ImportProject="$(MSBuildThisFileDirectory)..\..\FSharpSource.BuildFromSource.targets" />
1717
<ItemGroup>
1818
<EmbeddedResourceInclude="FSCore.resx">
1919
<Link>FSCore.resx</Link>
@@ -212,7 +212,7 @@
212212
<!-- NOTE: The optdata and sigdata files are no longer needed by the F# compiler (the information is-->
213213
<!-- integrated as resources into more recent FSharp.Core.dll's. However they are still produced to-->
214214
<!-- allow older versions of the F# compiler to reference more recent FSharp.Core packages-->
215-
<TargetName="CopyToBuiltBin"BeforeTargets="AfterCompile"AfterTargets="CoreCompile" >
215+
<TargetName="CopyToBuiltBin"BeforeTargets="AfterCompile"AfterTargets="CoreCompile"Condition="'$(DesignTimeBuild)' != 'true'">
216216
<ItemGroup>
217217
<BuiltProjectOutputGroupKeyOutputInclude="$(IntermediateOutputPath)/FSharp.Core.sigdata" />
218218
<BuiltProjectOutputGroupKeyOutputInclude="$(IntermediateOutputPath)/FSharp.Core.optdata" />

‎src/fsharp/fsi/fsi.fs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2468,7 +2468,6 @@ type FsiEvaluationSession (fsi: FsiEvaluationSessionHostConfig, argv:string[], i
24682468
do tcConfigB.resolutionEnvironment<- ResolutionEnvironment.EditingOrCompilationfalse
24692469
do tcConfigB.useSimpleResolution<-true
24702470
do SetTargetProfile tcConfigB"netcore"// always assume System.Runtime codegen
2471-
//do SetTargetProfile tcConfigB "privatecorelib" // always assume System.Private.CoreLib codegen
24722471
#endif
24732472

24742473
// Preset: --optimize+ -g --tailcalls+ (see 4505)

‎src/fsharp/vs/IncrementalBuild.fs‎

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1681,8 +1681,11 @@ type IncrementalBuilder(tcGlobals,frameworkTcImports, nonFrameworkAssemblyInputs
16811681
/// CreateIncrementalBuilder (for background type checking). Note that fsc.fs also
16821682
/// creates an incremental builder used by the command line compiler.
16831683
static memberTryCreateBackgroundBuilderForProjectOptions(ctok,legacyReferenceResolver,defaultFSharpBinariesDir,frameworkTcImportsCache:FrameworkImportsCache,loadClosureOpt:LoadClosure option,sourceFiles:string list,commandLineArgs:string list,projectReferences,projectDirectory,useScriptResolutionRules,keepAssemblyContents,keepAllBackgroundResolutions,maxTimeShareMilliseconds)=
1684+
lettargetProfileSwitch="--targetprofile:"
1685+
letuseSimpleResolutionSwitch="--simpleresolution"
1686+
16841687
cancellable{
1685-
1688+
16861689
// Trap and report warnings and errors from creation.
16871690
use errorScope=new ErrorScope()
16881691
let!builderOpt=
@@ -1695,23 +1698,38 @@ type IncrementalBuilder(tcGlobals,frameworkTcImports, nonFrameworkAssemblyInputs
16951698

16961699
/// Create a type-check configuration
16971700
lettcConfigB,sourceFilesNew=
1698-
1701+
1702+
letgetSwitchValue switchstring=
1703+
match commandLineArgs|> Seq.tryFindIndex(fun s-> s.StartsWith(switchstring))with
1704+
| Some idx-> Some(commandLineArgs.[idx].Substring(switchstring.Length))
1705+
|_-> None
1706+
16991707
// see also fsc.fs:runFromCommandLineToImportingAssemblies(), as there are many similarities to where the PS creates a tcConfigB
17001708
lettcConfigB= TcConfigBuilder.CreateNew(legacyReferenceResolver, defaultFSharpBinariesDir, implicitIncludeDir=projectDirectory, optimizeForMemory=true, isInteractive=false, isInvalidationSupported=true, defaultCopyFSharpCore=false)
1709+
17011710
// The following uses more memory but means we don't take read-exclusions on the DLLs we reference
17021711
// Could detect well-known assemblies--ie System.dll--and open them with read-locks
17031712
tcConfigB.openBinariesInMemory<-true
17041713

17051714
tcConfigB.resolutionEnvironment<-(ReferenceResolver.ResolutionEnvironment.EditingOrCompilationtrue)
1706-
1715+
17071716
tcConfigB.conditionalCompilationDefines<-
17081717
letdefine=if useScriptResolutionRulesthen"INTERACTIVE"else"COMPILED"
17091718
define::tcConfigB.conditionalCompilationDefines
17101719

17111720
tcConfigB.projectReferences<- projectReferences
1721+
17121722
#if COMPILER_SERVICE_ASSUMES_DOTNETCORE_COMPILATION
17131723
tcConfigB.useSimpleResolution<-true// turn off msbuild resolution
1724+
#else
1725+
tcConfigB.useSimpleResolution<-(getSwitchValue useSimpleResolutionSwitch)|> Option.isSome
17141726
#endif
1727+
match(getSwitchValue targetProfileSwitch)with
1728+
| Some v->
1729+
let_s= v
1730+
CompileOptions.SetTargetProfile tcConfigB v
1731+
| None->()
1732+
17151733
// Apply command-line arguments and collect more source files if they are in the arguments
17161734
letsourceFilesNew=
17171735
try
@@ -1725,12 +1743,16 @@ type IncrementalBuilder(tcGlobals,frameworkTcImports, nonFrameworkAssemblyInputs
17251743

17261744
// Never open PDB files for the language service, even if --standalone is specified
17271745
tcConfigB.openDebugInformationForLaterStaticLinking<-false
1728-
1746+
match commandLineArgs|> Seq.tryFind(fun s-> s.StartsWith(targetProfileSwitch))with
1747+
| Some arg->
1748+
letprofile= arg.Substring(targetProfileSwitch.Length)
1749+
CompileOptions.SetTargetProfile tcConfigB profile
1750+
|_->()
17291751
tcConfigB, sourceFilesNew
17301752

17311753
match loadClosureOptwith
1732-
| Some loadClosure->
1733-
letdllReferences=
1754+
| Some loadClosure->
1755+
letdllReferences=
17341756
[for referencein tcConfigB.referencedDLLsdo
17351757
// If there's (one or more) resolutions of closure references then yield them all
17361758
match loadClosure.References|> List.tryFind(fun(resolved,_)->resolved=reference.Text)with

‎src/fsharp/vs/service.fs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3139,7 +3139,7 @@ type FsiInteractiveChecker(legacyReferenceResolver, reactorOps: IReactorOperatio
31393139

31403140
letloadClosure= LoadClosure.ComputeClosureOfSourceText(ctok, legacyReferenceResolver, defaultFSharpBinariesDir, filename, source, CodeContext.Editing, tcConfig.useSimpleResolution, tcConfig.useFsiAuxLib,new Lexhelp.LexResourceManager(), applyCompilerOptions, assumeDotNetFramework)
31413141
let!tcErrors,tcFileResult= Parser.CheckOneFile(parseResults, source, filename,"project", tcConfig, tcGlobals, tcImports, tcState, Some loadClosure, backgroundDiagnostics, reactorOps,(fun()->true), None, userOpName)
3142-
3142+
31433143
return
31443144
match tcFileResultwith
31453145
| Parser.TypeCheckAborted.No scope->
@@ -3150,7 +3150,7 @@ type FsiInteractiveChecker(legacyReferenceResolver, reactorOps: IReactorOperatio
31503150
|_->
31513151
failwith"unexpected aborted"
31523152
}
3153-
3153+
31543154
//----------------------------------------------------------------------------
31553155
// CompilerEnvironment, DebuggerEnvironment
31563156
//

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp