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

Commit0095fde

Browse files
dsymeKevinRansom
authored andcommitted
Fix de-duplication of module names in ParseAndCheckFileInProject (FCS bugfsharp#819) (#3700)
* fix de-duplication of individual files* bump fcs version
1 parent72e28fe commit0095fde

File tree

9 files changed

+31
-21
lines changed

9 files changed

+31
-21
lines changed

‎fcs/README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ which does things like:
6060
Yu can push the packages if you have permissions, either automatically using``build Release`` or manually
6161

6262
set APIKEY=...
63-
.nuget\nuget.exe push Release\FSharp.Compiler.Service.16.0.2.nupkg %APIKEY% -Source https://nuget.org
64-
.nuget\nuget.exe push Release\FSharp.Compiler.Service.MSBuild.v12.16.0.2.nupkg %APIKEY% -Source https://nuget.org
65-
.nuget\nuget.exe push Release\FSharp.Compiler.Service.ProjectCracker.16.0.2.nupkg %APIKEY% -Source https://nuget.org
63+
.nuget\nuget.exe push Release\FSharp.Compiler.Service.16.0.3.nupkg %APIKEY% -Source https://nuget.org
64+
.nuget\nuget.exe push Release\FSharp.Compiler.Service.MSBuild.v12.16.0.3.nupkg %APIKEY% -Source https://nuget.org
65+
.nuget\nuget.exe push Release\FSharp.Compiler.Service.ProjectCracker.16.0.3.nupkg %APIKEY% -Source https://nuget.org
6666

6767

6868
###Use of Paket and FAKE

‎fcs/RELEASE_NOTES.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
####16.0.3
2+
*[File name deduplication not working with ParseAndCheckFileInProject](https://github.com/fsharp/FSharp.Compiler.Service/issues/819)
3+
14
####16.0.2
25
*[ProjectCracker returns*.fsi files in FSharpProjectOptions.SourceFiles array](https://github.com/fsharp/FSharp.Compiler.Service/pull/812)
36

‎fcs/fcs.props‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<ProjectToolsVersion="4.0"DefaultTargets="Build"xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
44
<PropertyGroup>
55

6-
<VersionPrefix>16.0.2</VersionPrefix>
6+
<VersionPrefix>16.0.3</VersionPrefix>
77
<!-- FSharp.Compiler.Tools is currently only used to get a working FSI.EXE to execute some scripts during the build-->
88
<!-- The LKG FSI.EXE requires MSBuild 15 to be installed, which is painful-->
99
<FsiToolPath>$(FSharpSourcesRoot)\..\packages\FSharp.Compiler.Tools.4.1.27\tools</FsiToolPath>

‎fcs/nuget/FSharp.Compiler.Service.MSBuild.v12.nuspec‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<description>Adds legacy MSBuild 12.0 support to the F# compiler services package for resolving references such as #r "System, Version=4.1.0.0,..."</description>
66
<language>en-US</language>
77
<requireLicenseAcceptance>false</requireLicenseAcceptance>
8-
<version>16.0.2</version>
8+
<version>16.0.3</version>
99
<authors>Microsoft Corporation and F# community contributors</authors>
1010
<licenseUrl>https://github.com/fsharp/FSharp.Compiler.Service/blob/master/LICENSE</licenseUrl>
1111
<projectUrl>https://github.com/fsharp/FSharp.Compiler.Service</projectUrl>
@@ -14,7 +14,7 @@
1414
<summary>F# compiler services for creating IDE tools, language extensions and for F# embedding.</summary>
1515
<dependencies>
1616
<grouptargetFramework="net45">
17-
<dependencyid="FSharp.Compiler.Service"version="16.0.2" />
17+
<dependencyid="FSharp.Compiler.Service"version="16.0.3" />
1818
</group>
1919
</dependencies>
2020
</metadata>

‎fcs/nuget/FSharp.Compiler.Service.ProjectCracker.nuspec‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<description>The F# compiler services package contains a custom build of the F# compiler that exposes additional functionality for implementing F# language bindings, additional tools based on the compiler or refactoring tools. The package also includes F# interactive service that can be used for embedding F# scripting into your applications.</description>
66
<language>en-US</language>
77
<requireLicenseAcceptance>false</requireLicenseAcceptance>
8-
<version>16.0.2</version>
8+
<version>16.0.3</version>
99
<authors>Microsoft Corporation and F# community contributors</authors>
1010
<licenseUrl>https://github.com/fsharp/FSharp.Compiler.Service/blob/master/LICENSE</licenseUrl>
1111
<projectUrl>https://github.com/fsharp/FSharp.Compiler.Service</projectUrl>
@@ -14,7 +14,7 @@
1414
<summary>F# compiler services for creating IDE tools, language extensions and for F# embedding.</summary>
1515
<dependencies>
1616
<grouptargetFramework="net45">
17-
<dependencyid="FSharp.Compiler.Service"version="16.0.2" />
17+
<dependencyid="FSharp.Compiler.Service"version="16.0.3" />
1818
</group>
1919
</dependencies>
2020
</metadata>

‎fcs/nuget/FSharp.Compiler.Service.nuspec‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<description>The F# compiler services package contains a custom build of the F# compiler that exposes additional functionality for implementing F# language bindings, additional tools based on the compiler or refactoring tools. The package also includes F# interactive service that can be used for embedding F# scripting into your applications.</description>
66
<language>en-US</language>
77
<requireLicenseAcceptance>false</requireLicenseAcceptance>
8-
<version>16.0.2</version>
8+
<version>16.0.3</version>
99
<authors>Microsoft Corporation and F# community contributors</authors>
1010
<licenseUrl>https://github.com/fsharp/FSharp.Compiler.Service/blob/master/LICENSE</licenseUrl>
1111
<projectUrl>https://github.com/fsharp/FSharp.Compiler.Service</projectUrl>

‎src/fsharp/vs/IncrementalBuild.fs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1622,6 +1622,9 @@ type IncrementalBuilder(tcGlobals, frameworkTcImports, nonFrameworkAssemblyInput
16221622
memberbuilder.GetCheckResultsAfterLastFileInProject(ctok:CompilationThreadToken)=
16231623
builder.GetCheckResultsBeforeSlotInProject(ctok, builder.GetSlotsCount())
16241624

1625+
memberbuilder.DeduplicateParsedInputModuleNameInProject(input)=
1626+
DeduplicateParsedInputModuleName moduleNamesDict input
1627+
16251628
member__.GetCheckResultsAndImplementationsForProject(ctok:CompilationThreadToken)=
16261629
cancellable{
16271630
letcache= TimeStampCache(defaultTimeStamp)

‎src/fsharp/vs/IncrementalBuild.fsi‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,8 @@ type internal IncrementalBuilder =
142142
// TODO: make this an Eventually(which can be scheduled) or an Async(which can be cancelled)
143143
member GetCheckResultsAndImplementationsForProject: CompilationThreadToken-> Cancellable<PartialCheckResults* IL.ILAssemblyRef* IRawFSharpAssemblyData option* TypedImplFile list option>
144144

145+
member DeduplicateParsedInputModuleNameInProject: Ast.ParsedInput-> Ast.ParsedInput
146+
145147
/// Get the logical time stamp that is associated with the output of the project if it were gully built immediately
146148
member GetLogicalTimeStampForProject: TimeStampCache* CompilationThreadToken-> DateTime
147149

‎src/fsharp/vs/service.fs‎

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2387,8 +2387,8 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC
23872387
| Some res->return res
23882388
| None->
23892389
foregroundParseCount<- foregroundParseCount+1
2390-
letparseErrors,inputOpt,anyErrors= Parser.parseFile(source, filename, options, userOpName)
2391-
letres= FSharpParseFileResults(parseErrors,inputOpt, anyErrors, options.SourceFiles)
2390+
letparseErrors,parseTreeOpt,anyErrors= Parser.parseFile(source, filename, options, userOpName)
2391+
letres= FSharpParseFileResults(parseErrors,parseTreeOpt, anyErrors, options.SourceFiles)
23922392
parseCacheLock.AcquireLock(fun ltok-> parseFileCache.Set(ltok,(filename, source, options), res))
23932393
return res
23942394
}
@@ -2402,9 +2402,9 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC
24022402
match builderOptwith
24032403
| None->return FSharpParseFileResults(List.toArray creationErrors, None,true,[||])
24042404
| Some builder->
2405-
let!inputOpt,_,_,parseErrors= builder.GetParseResultsForFile(ctok, filename)
2405+
let!parseTreeOpt,_,_,parseErrors= builder.GetParseResultsForFile(ctok, filename)
24062406
leterrors=[|yield! creationErrors;yield! ErrorHelpers.CreateErrorInfos(builder.TcConfig.errorSeverityOptions,false, filename, parseErrors)|]
2407-
return FSharpParseFileResults(errors= errors, input=inputOpt, parseHadErrors=false, dependencyFiles= builder.AllDependenciesDeprecated)
2407+
return FSharpParseFileResults(errors= errors, input=parseTreeOpt, parseHadErrors=false, dependencyFiles= builder.AllDependenciesDeprecated)
24082408
}
24092409
)
24102410

@@ -2548,7 +2548,9 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC
25482548
|_->
25492549
Trace.TraceInformation("FCS: {0}.{1} ({2})", userOpName,"CheckFileInProject.CacheMiss", filename)
25502550
let!tcPrior= execWithReactorAsync<|fun ctok-> builder.GetCheckResultsBeforeFileInProject(ctok, filename)
2551-
let!checkAnswer= bc.CheckOneFileImpl(parseResults, source, filename, options, textSnapshotInfo, fileVersion, builder, tcPrior, creationErrors, userOpName)
2551+
letparseTreeOpt= parseResults.ParseTree|> Option.map builder.DeduplicateParsedInputModuleNameInProject
2552+
letparseResultsAterDeDuplication= FSharpParseFileResults(parseResults.Errors, parseTreeOpt, parseResults.ParseHadErrors, parseResults.DependencyFiles)
2553+
let!checkAnswer= bc.CheckOneFileImpl(parseResultsAterDeDuplication, source, filename, options, textSnapshotInfo, fileVersion, builder, tcPrior, creationErrors, userOpName)
25522554
return checkAnswer
25532555
finally
25542556
bc.ImplicitlyStartCheckProjectInBackground(options, userOpName)
@@ -2581,9 +2583,9 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC
25812583

25822584
// Do the parsing.
25832585
letparsingOptions= FSharpParsingOptions.FromTcConfig(builder.TcConfig, Array.ofList(builder.SourceFiles))
2584-
letparseErrors,inputOpt,anyErrors= Parser.parseFile(source, filename, parsingOptions, userOpName)
2585-
2586-
letparseResults= FSharpParseFileResults(parseErrors,inputOpt, anyErrors, builder.AllDependenciesDeprecated)
2586+
letparseErrors,parseTreeOpt,anyErrors= Parser.parseFile(source, filename, parsingOptions, userOpName)
2587+
letparseTreeOpt= parseTreeOpt|> Option.map builder.DeduplicateParsedInputModuleNameInProject
2588+
letparseResults= FSharpParseFileResults(parseErrors,parseTreeOpt, anyErrors, builder.AllDependenciesDeprecated)
25872589
let!checkResults= bc.CheckOneFileImpl(parseResults, source, filename, options, textSnapshotInfo, fileVersion, builder, tcPrior, creationErrors, userOpName)
25882590
return parseResults, checkResults
25892591
finally
@@ -2602,12 +2604,12 @@ type BackgroundCompiler(legacyReferenceResolver, projectCacheSize, keepAssemblyC
26022604
lettypedResults= MakeCheckFileResultsEmpty(filename, creationErrors)
26032605
return(parseResults, typedResults)
26042606
| Some builder->
2605-
let!(inputOpt,_,_,untypedErrors)= builder.GetParseResultsForFile(ctok, filename)
2607+
let!(parseTreeOpt,_,_,untypedErrors)= builder.GetParseResultsForFile(ctok, filename)
26062608
let!tcProj= builder.GetCheckResultsAfterFileInProject(ctok, filename)
26072609
leterrorOptions= builder.TcConfig.errorSeverityOptions
26082610
letuntypedErrors=[|yield! creationErrors;yield! ErrorHelpers.CreateErrorInfos(errorOptions,false, filename, untypedErrors)|]
26092611
lettcErrors=[|yield! creationErrors;yield! ErrorHelpers.CreateErrorInfos(errorOptions,false, filename, tcProj.Errors)|]
2610-
letparseResults= FSharpParseFileResults(errors= untypedErrors, input=inputOpt, parseHadErrors=false, dependencyFiles= builder.AllDependenciesDeprecated)
2612+
letparseResults= FSharpParseFileResults(errors= untypedErrors, input=parseTreeOpt, parseHadErrors=false, dependencyFiles= builder.AllDependenciesDeprecated)
26112613
letloadClosure= scriptClosureCacheLock.AcquireLock(fun ltok-> scriptClosureCache.TryGet(ltok, options))
26122614
letscope=
26132615
TypeCheckInfo(tcProj.TcConfig, tcProj.TcGlobals, tcProj.TcState.PartialAssemblySignature, tcProj.TcState.Ccu, tcProj.TcImports, tcProj.TcEnvAtEnd.AccessRights,
@@ -3143,9 +3145,9 @@ type FsiInteractiveChecker(legacyReferenceResolver, reactorOps: IReactorOperatio
31433145
letfilename= Path.Combine(tcConfig.implicitIncludeDir,"stdin.fsx")
31443146
// Note: projectSourceFiles is only used to compute isLastCompiland, and is ignored if Build.IsScript(mainInputFileName) is true (which it is in this case).
31453147
letparsingOptions= FSharpParsingOptions.FromTcConfig(tcConfig,[| filename|])
3146-
letparseErrors,inputOpt,anyErrors= Parser.parseFile(source, filename, parsingOptions, userOpName)
3148+
letparseErrors,parseTreeOpt,anyErrors= Parser.parseFile(source, filename, parsingOptions, userOpName)
31473149
letdependencyFiles=[||]// interactions have no dependencies
3148-
letparseResults= FSharpParseFileResults(parseErrors,inputOpt, parseHadErrors= anyErrors, dependencyFiles= dependencyFiles)
3150+
letparseResults= FSharpParseFileResults(parseErrors,parseTreeOpt, parseHadErrors= anyErrors, dependencyFiles= dependencyFiles)
31493151

31503152
letbackgroundDiagnostics=[]
31513153

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp