Skip to content

Commit 4e668b4

Browse files
committed
fixes to integration
1 parent 07ef38e commit 4e668b4

File tree

16 files changed

+96
-77
lines changed

16 files changed

+96
-77
lines changed

RELEASE_NOTES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#### 8.0.0
2+
* Integrate fsharp\fsharp and Microsoft\visualfsharp to c494a9cab525dbd89585f7b733ea5310471a8001
3+
14
#### 7.0.0
25
* Integrate fsharp\fsharp and Microsoft\visualfsharp to 835b79c041f9032fceeceb39f680e0662cba92ec
36

build.fsx

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Target "GenerateFSIStrings" (fun _ ->
8989
// |> ignore
9090
)
9191

92-
Target "Build" (fun _ ->
92+
Target "Build.NetFx" (fun _ ->
9393
netFrameworks
9494
|> List.iter (fun framework ->
9595
!! (project + ".sln")
@@ -124,7 +124,7 @@ Target "SourceLink" (fun _ ->
124124
// --------------------------------------------------------------------------------------
125125
// Run the unit tests using test runner
126126

127-
Target "RunTests" (fun _ ->
127+
Target "RunTests.NetFx" (fun _ ->
128128
!! (if isAppVeyorBuild then "./bin/v4.5/FSharp.Compiler.Service.Tests.dll"
129129
else "./bin/**/FSharp.Compiler.Service.Tests.dll")
130130
|> NUnit (fun p ->
@@ -138,7 +138,7 @@ Target "RunTests" (fun _ ->
138138
// --------------------------------------------------------------------------------------
139139
// Build a NuGet package
140140

141-
Target "NuGet" (fun _ ->
141+
Target "NuGet.NetFx" (fun _ ->
142142
Paket.Pack (fun p ->
143143
{ p with
144144
TemplateFile = "nuget/FSharp.Compiler.Service.template"
@@ -294,15 +294,17 @@ Target "Nuget.AddNetCore" (fun _ ->
294294
// --------------------------------------------------------------------------------------
295295
// Run all targets by default. Invoke 'build <Target>' to override
296296

297-
Target "Prepare" DoNothing
298-
Target "PrepareRelease" DoNothing
299297
Target "Release" DoNothing
300298
Target "CreatePackage" DoNothing
299+
Target "NuGet" DoNothing
301300
Target "All" DoNothing
302301
Target "All.NetCore" DoNothing
302+
Target "All.NetFx" DoNothing
303303

304304
"Clean"
305+
=?> ("BuildVersion", isAppVeyorBuild)
305306
==> "AssemblyInfo"
307+
==> "GenerateFSIStrings"
306308
==> "CodeGen.NetCore"
307309
==> "Build.NetCore"
308310
==> "RunTests.NetCore"
@@ -312,17 +314,21 @@ Target "All.NetCore" DoNothing
312314
=?> ("BuildVersion", isAppVeyorBuild)
313315
==> "AssemblyInfo"
314316
==> "GenerateFSIStrings"
315-
==> "Prepare"
316-
==> "Build"
317-
==> "RunTests"
317+
==> "Build.NetFx"
318+
==> "RunTests.NetFx"
319+
==> "All.NetFx"
320+
321+
"All.NetFx"
318322
=?> ("All.NetCore", isDotnetSDKInstalled)
319323
==> "All"
320324

325+
"NuGet.NetFx"
326+
=?> ("Nuget.AddNetCore", isDotnetSDKInstalled)
327+
==> "NuGet"
328+
321329
"All"
322-
==> "PrepareRelease"
323330
==> "SourceLink"
324331
==> "NuGet"
325-
=?> ("Nuget.AddNetCore", isDotnetSDKInstalled)
326332
==> "CreatePackage"
327333
==> "GitHubRelease"
328334
==> "PublishNuGet"

samples/Tokenizer/Program.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
open Microsoft.FSharp.Compiler.SourceCodeServices
22

3-
let sourceTok = FSharpSourceTokenizer([], "C:\\test.fsx")
3+
let sourceTok = FSharpSourceTokenizer([], Some "C:\\test.fsx")
44

55
let tokenizeLines (lines:string[]) =
66
[ let state = ref 0L

src/absil/il.fs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -739,17 +739,17 @@ type ILFieldSpec =
739739
// Debug info.
740740
// --------------------------------------------------------------------
741741

742-
type Guid = byte[]
742+
type ILGuid = byte[]
743743

744744
type ILPlatform =
745745
| X86
746746
| AMD64
747747
| IA64
748748

749749
type ILSourceDocument =
750-
{ sourceLanguage: Guid option;
751-
sourceVendor: Guid option;
752-
sourceDocType: Guid option;
750+
{ sourceLanguage: ILGuid option;
751+
sourceVendor: ILGuid option;
752+
sourceDocType: ILGuid option;
753753
sourceFile: string; }
754754
static member Create(language,vendor,docType,file) =
755755
{ sourceLanguage=language;
@@ -1083,7 +1083,7 @@ type ILFieldInit =
10831083
[<RequireQualifiedAccess; StructuralEquality; StructuralComparison>]
10841084
type ILNativeType =
10851085
| Empty
1086-
| Custom of Guid * string * string * byte[] (* guid,nativeTypeName,custMarshallerName,cookieString *)
1086+
| Custom of ILGuid * string * string * byte[] (* guid,nativeTypeName,custMarshallerName,cookieString *)
10871087
| FixedSysString of int32
10881088
| FixedArray of int32
10891089
| Currency
@@ -4141,7 +4141,7 @@ let rec unscopeILTypeSpecQuick (tspec:ILTypeSpec) =
41414141
let tref = tspec.TypeRef
41424142
let tinst = tspec.GenericArgs
41434143
let qtref = qunscope_tref tref
4144-
if ILList.isEmpty tinst && Option.isNone qtref then
4144+
if List.isEmpty tinst && Option.isNone qtref then
41454145
None (* avoid reallocation in the common case *)
41464146
else
41474147
match qtref with
@@ -4171,11 +4171,11 @@ and unscopeILType typ =
41714171
| x -> x
41724172

41734173
and unscopeILTypes i =
4174-
if ILList.isEmpty i then i
4175-
else ILList.map unscopeILType i
4174+
if List.isEmpty i then i
4175+
else List.map unscopeILType i
41764176

41774177
and unscopeILCallSig csig =
4178-
mkILCallSigRaw (csig.CallingConv,unscopeILTypes csig.ArgTypes,unscopeILType csig.ReturnType)
4178+
mkILCallSig (csig.CallingConv,unscopeILTypes csig.ArgTypes,unscopeILType csig.ReturnType)
41794179

41804180
let resolveILMethodRefWithRescope r td (mref:ILMethodRef) =
41814181
let args = mref.ArgTypes

src/absil/il.fsi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ type PrimaryAssembly =
5656
// ====================================================================
5757

5858
// Guids (Note: consider adjusting these to the System.Guid type)
59-
type Guid = byte[]
59+
type ILGuid = byte[]
6060

6161
[<StructuralEquality; StructuralComparison>]
6262
type ILPlatform =
@@ -68,10 +68,10 @@ type ILPlatform =
6868
/// points and some other locations.
6969
[<Sealed>]
7070
type ILSourceDocument =
71-
static member Create : language: Guid option * vendor: Guid option * documentType: Guid option * file: string -> ILSourceDocument
72-
member Language: Guid option
73-
member Vendor: Guid option
74-
member DocumentType: Guid option
71+
static member Create : language: ILGuid option * vendor: ILGuid option * documentType: ILGuid option * file: string -> ILSourceDocument
72+
member Language: ILGuid option
73+
member Vendor: ILGuid option
74+
member DocumentType: ILGuid option
7575
member File: string
7676

7777

@@ -738,7 +738,7 @@ type ILNativeVariant =
738738
[<RequireQualifiedAccess; StructuralEquality; StructuralComparison>]
739739
type ILNativeType =
740740
| Empty
741-
| Custom of Guid * string * string * byte[] (* guid,nativeTypeName,custMarshallerName,cookieString *)
741+
| Custom of ILGuid * string * string * byte[] (* guid,nativeTypeName,custMarshallerName,cookieString *)
742742
| FixedSysString of int32
743743
| FixedArray of int32
744744
| Currency

src/fsharp/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,6 @@
118118
<Compile Include="..\..\utils\reshapedreflection.fs">
119119
<Link>Reshaped/reshapedreflection.fs</Link>
120120
</Compile>
121-
<Compile Include="..\..\utils\reshapedmsbuild.fs">
122-
<Link>Reshaped/reshapedmsbuild.fs</Link>
123-
</Compile>
124121
<Compile Include="..\..\utils\sformat.fsi">
125122
<Link>ErrorText/sformat.fsi</Link>
126123
</Compile>
@@ -229,11 +226,8 @@
229226
<Compile Include="..\ErrorLogger.fs">
230227
<Link>ErrorLogging/ErrorLogger.fs</Link>
231228
</Compile>
232-
<Compile Include="..\ReferenceResolution.fsi">
233-
<Link>ReferenceResolution/ReferenceResolution.fsi</Link>
234-
</Compile>
235-
<Compile Include="..\ReferenceResolution.fs">
236-
<Link>ReferenceResolution/ReferenceResolution.fs</Link>
229+
<Compile Include="..\ReferenceResolver.fs">
230+
<Link>ReferenceResolution/ReferenceResolver.fs</Link>
237231
</Compile>
238232
<FsLex Include="..\..\absil\illex.fsl">
239233
<OtherFlags>--lexlib Internal.Utilities.Text.Lexing</OtherFlags>
@@ -607,8 +601,11 @@
607601
<Compile Include="..\vs\ServiceUntypedParse.fs">
608602
<Link>Service/ServiceUntypedParse.fs</Link>
609603
</Compile>
604+
<Compile Include="..\..\utils\reshapedmsbuild.fs">
605+
<Link>Service/reshapedmsbuild.fs</Link>
606+
</Compile>
610607
<Compile Include="..\MSBuildReferenceResolver.fs">
611-
<Link>MSBuildReferenceResolver.fs</Link>
608+
<Link>Service/MSBuildReferenceResolver.fs</Link>
612609
</Compile>
613610
<Compile Include="..\vs\service.fsi">
614611
<Link>Service/service.fsi</Link>

src/fsharp/FSharp.Compiler.Service/project.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"FSComp.fs",
1111
"FSIstrings.fs",
1212
"../../utils/reshapedreflection.fs",
13-
"../../utils/reshapedmsbuild.fs",
1413
"../../utils/sformat.fsi",
1514
"../../utils/sformat.fs",
1615
"../sr.fsi",
@@ -26,7 +25,6 @@
2625
"../../utils/EditDistance.fs",
2726
"../../utils/TaggedCollections.fsi",
2827
"../../utils/TaggedCollections.fs",
29-
"../FlatList.fs",
3028
"../QueueList.fs",
3129
"../../absil/ildiag.fsi",
3230
"../../absil/ildiag.fs",
@@ -48,8 +46,7 @@
4846
"../range.fsi",
4947
"../range.fs",
5048
"../ErrorLogger.fs",
51-
"../ReferenceResolution.fsi",
52-
"../ReferenceResolution.fs",
49+
"../ReferenceResolver.fs",
5350
"../../absil/il.fsi",
5451
"../../absil/il.fs",
5552
"../../absil/ilx.fsi",
@@ -169,6 +166,8 @@
169166
"../vs/ServiceParamInfoLocations.fs",
170167
"../vs/ServiceUntypedParse.fsi",
171168
"../vs/ServiceUntypedParse.fs",
169+
"../../utils/reshapedmsbuild.fs",
170+
"../MSBuildReferenceResolver.fs",
172171
"../vs/service.fsi",
173172
"../vs/service.fs",
174173
"../vs/SimpleServices.fsi",

src/fsharp/MSBuildReferenceResolver.fs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,6 @@ module internal MSBuildReferenceResolver =
336336
item
337337
|]
338338
#endif
339-
let rawFileNamePath = if allowRawFileName then ["{RawFileName}"] else []
340339

341340
rar.SearchPaths <- searchPaths |> Array.ofList
342341

src/fsharp/fsc.fs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1952,9 +1952,9 @@ let main1(tcGlobals, tcImports: TcImports, frameworkTcImports, generatedCcu, typ
19521952

19531953

19541954
// set up typecheck for given AST without parsing any command line parameters
1955-
let main1OfAst (openBinariesInMemory, assemblyName, target, outfile, pdbFile, dllReferences, noframework, exiter, errorLoggerProvider: ErrorLoggerProvider, inputs : ParsedInput list) =
1955+
let main1OfAst (referenceResolver, openBinariesInMemory, assemblyName, target, outfile, pdbFile, dllReferences, noframework, exiter, errorLoggerProvider: ErrorLoggerProvider, inputs : ParsedInput list) =
19561956

1957-
let tcConfigB = TcConfigBuilder.CreateNew(defaultFSharpBinariesDir, (*optimizeForMemory*) false, Directory.GetCurrentDirectory(), isInteractive=false, isInvalidationSupported=false)
1957+
let tcConfigB = TcConfigBuilder.CreateNew(referenceResolver, defaultFSharpBinariesDir, (*optimizeForMemory*) false, Directory.GetCurrentDirectory(), isInteractive=false, isInvalidationSupported=false)
19581958
tcConfigB.openBinariesInMemory <- openBinariesInMemory
19591959
tcConfigB.framework <- not noframework
19601960
// Preset: --optimize+ -g --tailcalls+ (see 4505)
@@ -2136,7 +2136,7 @@ let main4 dynamicAssemblyCreator (Args(tcConfig, errorLogger:ErrorLogger, ilGlob
21362136
let pdbfile = pdbfile |> Option.map (expandFileNameIfNeeded tcConfig >> FileSystem.GetFullPathShim)
21372137
match dynamicAssemblyCreator with
21382138
| None -> FileWriter.EmitIL (tcConfig,ilGlobals,errorLogger,outfile,pdbfile,ilxMainModule,signingInfo,exiter)
2139-
| Some da -> da (tcConfig,ilGlobals,errorLogger,outfile,pdbfile,ilxMainModule,signingInfo);
2139+
| Some da -> da (ilGlobals,outfile,ilxMainModule)
21402140

21412141
AbortOnError(errorLogger, tcConfig, exiter)
21422142

@@ -2161,8 +2161,8 @@ let typecheckAndCompile(argv,referenceResolver,bannerAlreadyPrinted,openBinaries
21612161
|> main4 dynamicAssemblyCreator
21622162

21632163

2164-
let compileOfAst (openBinariesInMemory, assemblyName, target, outFile, pdbFile, dllReferences, noframework, exiter, errorLoggerProvider, inputs, tcImportsCapture, dynamicAssemblyCreator) =
2165-
main1OfAst (openBinariesInMemory, assemblyName, target, outFile, pdbFile, dllReferences, noframework, exiter, errorLoggerProvider, inputs)
2164+
let compileOfAst (referenceResolver, openBinariesInMemory, assemblyName, target, outFile, pdbFile, dllReferences, noframework, exiter, errorLoggerProvider, inputs, tcImportsCapture, dynamicAssemblyCreator) =
2165+
main1OfAst (referenceResolver, openBinariesInMemory, assemblyName, target, outFile, pdbFile, dllReferences, noframework, exiter, errorLoggerProvider, inputs)
21662166
|> main2
21672167
|> main2b (tcImportsCapture, dynamicAssemblyCreator)
21682168
|> main3

src/fsharp/fsc.fsi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ val mainCompile :
4747
exiter: Exiter *
4848
loggerProvider: ErrorLoggerProvider *
4949
tcImportsCapture: (TcImports -> unit) option *
50-
dynamicAssemblyCreator: (TcConfig * ILGlobals * ErrorLogger * string * string option * ILModuleDef * SigningInfo -> unit) option
50+
dynamicAssemblyCreator: (ILGlobals * string * ILModuleDef -> unit) option
5151
-> unit
5252

5353
val compileOfAst :
@@ -63,7 +63,7 @@ val compileOfAst :
6363
loggerProvider: ErrorLoggerProvider *
6464
inputs:ParsedInput list *
6565
tcImportsCapture : (TcImports -> unit) option *
66-
dynamicAssemblyCreator: (TcConfig * ILGlobals * ErrorLogger * string * string option * ILModuleDef * SigningInfo -> unit) option
66+
dynamicAssemblyCreator: (ILGlobals * string * ILModuleDef -> unit) option
6767
-> unit
6868

6969
//---------------------------------------------------------------------------

0 commit comments

Comments
 (0)