Skip to content
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
dbccb1c
Merge pull request #6641 from Microsoft/merges/dev16.1-to-dev16.2
Apr 27, 2019
e3e148c
update vs minor version (#6649)
brettfo Apr 29, 2019
046491a
Merge pull request #6642 from Microsoft/merges/master-to-dev16.2
brettfo Apr 29, 2019
34c27d3
Merge pull request #6651 from Microsoft/merges/master-to-dev16.2
Apr 30, 2019
ef3fc2e
Merge remote-tracking branch 'upstream/master' into merges/master-to-…
brettfo Apr 30, 2019
35c5f78
Merge pull request #6658 from Microsoft/merges/master-to-dev16.2
May 1, 2019
267fa06
Merge pull request #6663 from Microsoft/merges/master-to-dev16.2
May 2, 2019
1185538
Merge pull request #6670 from Microsoft/merges/master-to-dev16.2
May 3, 2019
0f93a32
Merge pull request #6683 from Microsoft/merges/master-to-dev16.2
May 3, 2019
485db82
Merge pull request #6682 from Microsoft/merges/dev16.1-to-dev16.2
May 4, 2019
8cc3c7e
Merge pull request #6692 from microsoft/merges/master-to-dev16.2
May 7, 2019
bdf1bec
Merge pull request #6696 from microsoft/merges/master-to-dev16.2
May 7, 2019
2f7ce9e
Merge pull request #6704 from microsoft/merges/master-to-dev16.2
May 10, 2019
1e6bb28
Merge pull request #6708 from microsoft/merges/master-to-dev16.2
May 10, 2019
732b6d0
Merge pull request #6713 from microsoft/merges/master-to-dev16.2
May 13, 2019
5ade74b
Merge pull request #6719 from microsoft/merges/master-to-dev16.2
May 13, 2019
d697eac
Merge pull request #6720 from microsoft/merges/master-to-dev16.2
May 13, 2019
e8102e4
Merge pull request #6726 from microsoft/merges/master-to-dev16.2
May 14, 2019
52c75b3
Update Versions.props
KevinRansom May 14, 2019
90895fd
Merge remote-tracking branch 'upstream/master' into merges/master-to-…
brettfo May 15, 2019
62e9d32
Merge pull request #6736 from microsoft/merges/master-to-release/dev16.2
May 15, 2019
a45d839
Merge pull request #6743 from dotnet/merges/master-to-release/dev16.2
May 16, 2019
eab5ba5
Merge pull request #6757 from dotnet/merges/master-to-release/dev16.2
May 17, 2019
c865d96
Merge pull request #6762 from dotnet/merges/master-to-release/dev16.2
May 17, 2019
0b12961
Merge pull request #6773 from dotnet/merges/master-to-release/dev16.2
May 18, 2019
12313b2
Merge pull request #6787 from dotnet/merges/master-to-release/dev16.2
May 21, 2019
22ecba8
Merge pull request #6792 from dotnet/merges/master-to-release/dev16.2
brettfo May 21, 2019
ca554b0
Merge pull request #6798 from dotnet/merges/master-to-release/dev16.2
May 22, 2019
d6da7ce
Merge pull request #6821 from dotnet/merges/master-to-release/dev16.2
May 23, 2019
808f232
Merge pull request #6834 from dotnet/merges/master-to-release/dev16.2
May 24, 2019
6b02b74
Merge pull request #6852 from dotnet/merges/master-to-release/dev16.2
May 25, 2019
cb51737
Merge branch 'release/dev16.2' into merges/master-to-release/dev16.2
KevinRansom May 27, 2019
42c125e
Merge pull request #6878 from dotnet/merges/master-to-release/dev16.2
May 27, 2019
00cbd3f
Fixed uninitialized mutable locals inside loops (#6899)
TIHan May 31, 2019
f96a2f6
Merge branch 'release/dev16.2' into merges/master-to-release/dev16.2
brettfo Jun 1, 2019
c31566c
Merge pull request #6894 from dotnet/merges/master-to-release/dev16.2
Jun 1, 2019
431fdea
Merge pull request #6918 from dotnet/merges/master-to-release/dev16.2
Jun 2, 2019
3de631a
Stop calling GetHierarchy in FSharpProjectOptionsReactor (#6946)
TIHan Jun 6, 2019
3040aa2
Merge pull request #6982 from dotnet/merges/master-to-release/dev16.2
brettfo Jun 12, 2019
bff4fff
don't ship LSP in VS in `release/dev16.2` (#6983)
brettfo Jun 12, 2019
0aeb4a0
Roslyn Shim - Round 2 (#6734)
TIHan Jun 13, 2019
a24d94e
LOC CHECKIN | Microsoft/visualfsharp release/dev16.2 | 20190620 (#7022)
v-zbsail Jun 20, 2019
a67156b
Merge branch 'master' into merges/release/dev16.2-to-master
brettfo Jul 24, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .vsconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"version": "1.0",
"components": [
"Microsoft.VisualStudio.Component.CoreEditor",
"Microsoft.VisualStudio.Workload.CoreEditor",
"Microsoft.VisualStudio.Component.NuGet",
"Microsoft.Net.Component.4.6.1.TargetingPack",
"Microsoft.VisualStudio.Component.Roslyn.Compiler",
"Microsoft.VisualStudio.Component.Roslyn.LanguageServices",
"Microsoft.VisualStudio.Component.FSharp",
"Microsoft.Net.Core.Component.SDK.2.1",
"Microsoft.NetCore.ComponentGroup.DevelopmentTools.2.1",
"Microsoft.Net.Component.4.7.2.SDK",
"Microsoft.Net.Component.4.7.2.TargetingPack",
"Microsoft.Net.ComponentGroup.DevelopmentPrerequisites",
"Microsoft.Component.MSBuild",
"Microsoft.VisualStudio.Component.TextTemplating",
"Microsoft.VisualStudio.Component.SQL.CLR",
"Microsoft.VisualStudio.Component.ManagedDesktop.Core",
"Microsoft.Net.Component.4.6.TargetingPack",
"Component.Microsoft.VisualStudio.LiveShare",
"Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites",
"Microsoft.VisualStudio.Component.Debugger.JustInTime",
"Microsoft.VisualStudio.Component.FSharp.Desktop",
"Microsoft.VisualStudio.Workload.ManagedDesktop",
"Microsoft.VisualStudio.Component.VSSDK",
"Microsoft.VisualStudio.ComponentGroup.VisualStudioExtension.Prerequisites",
"Microsoft.VisualStudio.Workload.VisualStudioExtension"
]
}
2 changes: 0 additions & 2 deletions DEVGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ To build and test Visual F# IDE Tools, install these requirements:
- Launch the Visual Studio Installer
- Under the **"Windows"** workload, select **".NET desktop development"**
- Select the optional component **"F# desktop language support"**
- Under the **"Mobile & Gaming"** workload, select **"Mobile development with .NET"**
- Under the **"Other Toolsets"** workload, select **"Visual Studio extension development"**
- On the **"Individual Components"** tab, select **".NET Framework 4.7.2 SDK"** and **".NET Framework 4.7.2 targeting pack"**

Steps to build:

Expand Down
21 changes: 15 additions & 6 deletions eng/Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ param (
[switch]$warnAsError = $true,
[switch][Alias('test')]$testDesktop,
[switch]$testCoreClr,
[switch]$testFSharpQA,
[switch]$testCambridge,
[switch]$testCompiler,
[switch]$testFSharpCore,
[switch]$testFSharpQA,
[switch]$testVs,
[switch]$testAll,

Expand Down Expand Up @@ -75,10 +77,12 @@ function Print-Usage() {
Write-Host ""
Write-Host "Test actions"
Write-Host " -testAll Run all tests"
Write-Host " -testCambridge Run Cambridge tests"
Write-Host " -testCompiler Run FSharpCompiler unit tests"
Write-Host " -testDesktop Run tests against full .NET Framework"
Write-Host " -testCoreClr Run tests against CoreCLR"
Write-Host " -testFSharpQA Run F# Cambridge tests"
Write-Host " -testFSharpCore Run FSharpCore unit tests"
Write-Host " -testFSharpQA Run F# Cambridge tests"
Write-Host " -testVs Run F# editor unit tests"
Write-Host ""
Write-Host "Advanced settings:"
Expand Down Expand Up @@ -279,16 +283,21 @@ try {
}

if ($testFSharpCore) {
Write-Host "Environment Variables"
Get-Childitem Env:
TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $desktopTargetFramework
TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Core.UnitTests\FSharp.Core.UnitTests.fsproj" -targetFramework $coreclrTargetFramework
}

if ($testCompiler) {
TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $desktopTargetFramework
TestUsingNUnit -testProject "$RepoRoot\tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj" -targetFramework $coreclrTargetFramework
}

if ($testCambridge) {
TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $desktopTargetFramework
TestUsingNUnit -testProject "$RepoRoot\tests\fsharp\FSharpSuite.Tests.fsproj" -targetFramework $coreclrTargetFramework
}

if ($testVs) {
Write-Host "Environment Variables"
Get-Childitem Env:
TestUsingNUnit -testProject "$RepoRoot\vsintegration\tests\GetTypesVS.UnitTests\GetTypesVS.UnitTests.fsproj" -targetFramework $desktopTargetFramework
TestUsingNUnit -testProject "$RepoRoot\vsintegration\tests\UnitTests\VisualFSharp.UnitTests.fsproj" -targetFramework $desktopTargetFramework
}
Expand Down
15 changes: 15 additions & 0 deletions fcs/FSharp.Compiler.Service/FSharp.Compiler.Service.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@
<Compile Include="$(FSharpSourcesRoot)/utils/prim-parsing.fs">
<Link>LexYaccRuntime/prim-parsing.fs</Link>
</Compile>
<Compile Include="$(FSharpSourcesRoot)/utils/PathMap.fsi">
<Link>Utilities/PathMap.fsi</Link>
</Compile>
<Compile Include="$(FSharpSourcesRoot)/utils/PathMap.fs">
<Link>Utilities/PathMap.fs</Link>
</Compile>
<Compile Include="$(FSharpSourcesRoot)/utils/ResizeArray.fsi">
<Link>Utilities/ResizeArray.fsi</Link>
</Compile>
Expand Down Expand Up @@ -428,6 +434,9 @@
<Compile Include="$(FSharpSourcesRoot)/fsharp/CheckFormatStrings.fs">
<Link>Logic/CheckFormatStrings.fs</Link>
</Compile>
<Compile Include="$(FSharpSourcesRoot)/fsharp/FindUnsolved.fsi">
<Link>Logic/FindUnsolved.fsi</Link>
</Compile>
<Compile Include="$(FSharpSourcesRoot)/fsharp/FindUnsolved.fs">
<Link>Logic/FindUnsolved.fs</Link>
</Compile>
Expand Down Expand Up @@ -467,9 +476,15 @@
<Compile Include="$(FSharpSourcesRoot)/fsharp/InnerLambdasToTopLevelFuncs.fs">
<Link>Optimize/InnerLambdasToTopLevelFuncs.fs</Link>
</Compile>
<Compile Include="$(FSharpSourcesRoot)/fsharp/LowerCallsAndSeqs.fsi">
<Link>Optimize/LowerCallsAndSeqs.fsi</Link>
</Compile>
<Compile Include="$(FSharpSourcesRoot)/fsharp/LowerCallsAndSeqs.fs">
<Link>Optimize/LowerCallsAndSeqs.fs</Link>
</Compile>
<Compile Include="$(FSharpSourcesRoot)/fsharp/autobox.fsi">
<Link>Optimize/autobox.fsi</Link>
</Compile>
<Compile Include="$(FSharpSourcesRoot)/fsharp/autobox.fs">
<Link>Optimize/autobox.fs</Link>
</Compile>
Expand Down
4 changes: 2 additions & 2 deletions fcs/docsrc/content/filesystem.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ let B = File1.A + File1.A"""
interface IFileSystem with
// Implement the service to open files for reading and writing
member __.FileStreamReadShim(fileName) =
match files.TryGetValue(fileName) with
match files.TryGetValue fileName with
| true, text -> new MemoryStream(Encoding.UTF8.GetBytes(text)) :> Stream
| _ -> defaultFileSystem.FileStreamReadShim(fileName)

Expand All @@ -52,7 +52,7 @@ let B = File1.A + File1.A"""
defaultFileSystem.FileStreamWriteExistingShim(fileName)

member __.ReadAllBytesShim(fileName) =
match files.TryGetValue(fileName) with
match files.TryGetValue fileName with
| true, text -> Encoding.UTF8.GetBytes(text)
| _ -> defaultFileSystem.ReadAllBytesShim(fileName)

Expand Down
4 changes: 2 additions & 2 deletions fcs/docsrc/content/ja/filesystem.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ let B = File1.A + File1.A"""
interface IFileSystem with
// 読み取りおよび書き込み用にファイルをオープンする機能を実装
member __.FileStreamReadShim(fileName) =
match files.TryGetValue(fileName) with
match files.TryGetValue fileName with
| true, text -> new MemoryStream(Encoding.UTF8.GetBytes(text)) :> Stream
| _ -> defaultFileSystem.FileStreamReadShim(fileName)

Expand All @@ -55,7 +55,7 @@ let B = File1.A + File1.A"""
defaultFileSystem.FileStreamWriteExistingShim(fileName)

member __.ReadAllBytesShim(fileName) =
match files.TryGetValue(fileName) with
match files.TryGetValue fileName with
| true, text -> Encoding.UTF8.GetBytes(text)
| _ -> defaultFileSystem.ReadAllBytesShim(fileName)

Expand Down
23 changes: 10 additions & 13 deletions src/absil/illib.fs
Original file line number Diff line number Diff line change
Expand Up @@ -985,15 +985,13 @@ type MemoizationTable<'T, 'U>(compute: 'T -> 'U, keyComparer: IEqualityComparer<

member t.Apply x =
if (match canMemoize with None -> true | Some f -> f x) then
let mutable res = Unchecked.defaultof<'U>
let ok = table.TryGetValue(x, &res)
if ok then res
else
match table.TryGetValue x with
| true, res -> res
| _ ->
lock table (fun () ->
let mutable res = Unchecked.defaultof<'U>
let ok = table.TryGetValue(x, &res)
if ok then res
else
match table.TryGetValue x with
| true, res -> res
| _ ->
let res = compute x
table.[x] <- res
res)
Expand Down Expand Up @@ -1074,11 +1072,10 @@ module Tables =
let memoize f =
let t = new Dictionary<_, _>(1000, HashIdentity.Structural)
fun x ->
let mutable res = Unchecked.defaultof<_>
if t.TryGetValue(x, &res) then
res
else
res <- f x
match t.TryGetValue x with
| true, res -> res
| _ ->
let res = f x
t.[x] <- res
res

Expand Down
9 changes: 4 additions & 5 deletions src/absil/ilread.fs
Original file line number Diff line number Diff line change
Expand Up @@ -903,12 +903,11 @@ let mkCacheInt32 lowMem _inbase _nm _sz =
| null -> cache := new Dictionary<int32, _>(11)
| _ -> ()
!cache
let mutable res = Unchecked.defaultof<_>
let ok = cache.TryGetValue(idx, &res)
if ok then
match cache.TryGetValue idx with
| true, res ->
incr count
res
else
| _ ->
let res = f idx
cache.[idx] <- res
res
Expand Down Expand Up @@ -4048,7 +4047,7 @@ let OpenILModuleReader fileName opts =
let cacheResult2 =
// can't used a cached entry when reading PDBs, since it makes the returned object IDisposable
if keyOk && opts.pdbDirPath.IsNone then
ilModuleReaderCache2.TryGetValue(key)
ilModuleReaderCache2.TryGetValue key
else
false, Unchecked.defaultof<_>

Expand Down
29 changes: 13 additions & 16 deletions src/absil/ilreflect.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1500,18 +1500,18 @@ let enablePInvoke = true
// but we can run on Netcoreapp3.0 so ... use reflection to invoke the api, when we are executing on netcoreapp3.0
let definePInvokeMethod =
typeof<TypeBuilder>.GetMethod("DefinePInvokeMethod", [|
typeof<string>;
typeof<string>;
typeof<string>;
typeof<System.Reflection.MethodAttributes>;
typeof<System.Reflection.CallingConventions>;
typeof<Type>;
typeof<Type[]>;
typeof<Type[]>;
typeof<Type[]>;
typeof<Type[][]>;
typeof<Type[][]>;
typeof<System.Runtime.InteropServices.CallingConvention>;
typeof<string>
typeof<string>
typeof<string>
typeof<System.Reflection.MethodAttributes>
typeof<System.Reflection.CallingConventions>
typeof<Type>
typeof<Type[]>
typeof<Type[]>
typeof<Type[]>
typeof<Type[][]>
typeof<Type[][]>
typeof<System.Runtime.InteropServices.CallingConvention>
typeof<System.Runtime.InteropServices.CharSet> |])

let enablePInvoke = definePInvokeMethod <> null
Expand Down Expand Up @@ -2003,9 +2003,6 @@ let createTypeRef (visited: Dictionary<_, _>, created: Dictionary<_, _>) emEnv t
visited.[tref] <- true
let tdef = envGetTypeDef emEnv tref
if verbose2 then dprintf "- traversing type %s\n" typB.FullName
#if FX_NO_APP_DOMAINS
traverseTypeDef tref tdef
#else
// This looks like a special case (perhaps bogus) of the dependency logic above, where
// we require the type r.Name, though with "nestingToProbe" being the enclosing types of the
// type being defined.
Expand All @@ -2029,7 +2026,7 @@ let createTypeRef (visited: Dictionary<_, _>, created: Dictionary<_, _>) emEnv t
traverseTypeDef tref tdef
finally
System.AppDomain.CurrentDomain.remove_TypeResolve typeCreationHandler
#endif

// At this point, we've done everything we can to prepare the type for loading by eagerly forcing the
// load of other types. Everything else is up to the implementation of System.Reflection.Emit.
if not (created.ContainsKey tref) then
Expand Down
31 changes: 16 additions & 15 deletions src/absil/ilwrite.fs
Original file line number Diff line number Diff line change
Expand Up @@ -464,10 +464,9 @@ type MetadataTable<'T> =
#if DEBUG
tbl.lookups <- tbl.lookups + 1
#endif
let mutable res = Unchecked.defaultof<_>
let ok = tbl.dict.TryGetValue(x, &res)
if ok then res
else tbl.AddSharedEntry x
match tbl.dict.TryGetValue x with
| true, res -> res
| _ -> tbl.AddSharedEntry x


/// This is only used in one special place - see further below.
Expand Down Expand Up @@ -769,11 +768,12 @@ let rec GetTypeRefAsTypeRefRow cenv (tref: ILTypeRef) =
SharedRow [| ResolutionScope (rs1, rs2); nelem; nselem |]

and GetTypeRefAsTypeRefIdx cenv tref =
let mutable res = 0
if cenv.trefCache.TryGetValue(tref, &res) then res else
let res = FindOrAddSharedRow cenv TableNames.TypeRef (GetTypeRefAsTypeRefRow cenv tref)
cenv.trefCache.[tref] <- res
res
match cenv.trefCache.TryGetValue tref with
| true, res -> res
| _ ->
let res = FindOrAddSharedRow cenv TableNames.TypeRef (GetTypeRefAsTypeRefRow cenv tref)
cenv.trefCache.[tref] <- res
res

and GetTypeDescAsTypeRefIdx cenv (scoref, enc, n) =
GetTypeRefAsTypeRefIdx cenv (mkILNestedTyRef (scoref, enc, n))
Expand Down Expand Up @@ -3515,8 +3515,8 @@ let writeDirectory os dict =
let writeBytes (os: BinaryWriter) (chunk: byte[]) = os.Write(chunk, 0, chunk.Length)

let writeBinaryAndReportMappings (outfile,
ilg: ILGlobals, pdbfile: string option, signer: ILStrongNameSigner option, portablePDB, embeddedPDB,
embedAllSource, embedSourceList, sourceLink, emitTailcalls, deterministic, showTimes, dumpDebugInfo )
ilg: ILGlobals, pdbfile: string option, signer: ILStrongNameSigner option, portablePDB, embeddedPDB,
embedAllSource, embedSourceList, sourceLink, emitTailcalls, deterministic, showTimes, dumpDebugInfo, pathMap)
modul normalizeAssemblyRefs =
// Store the public key from the signer into the manifest. This means it will be written
// to the binary and also acts as an indicator to leave space for delay sign
Expand Down Expand Up @@ -3671,7 +3671,7 @@ let writeBinaryAndReportMappings (outfile,
match portablePDB with
| true ->
let (uncompressedLength, contentId, stream) as pdbStream =
generatePortablePdb embedAllSource embedSourceList sourceLink showTimes pdbData deterministic
generatePortablePdb embedAllSource embedSourceList sourceLink showTimes pdbData deterministic pathMap

if embeddedPDB then Some (compressPortablePdbStream uncompressedLength contentId stream)
else Some pdbStream
Expand Down Expand Up @@ -4211,7 +4211,7 @@ let writeBinaryAndReportMappings (outfile,
if embeddedPDB then
embedPortablePdbInfo originalLength contentId stream showTimes fpdb debugDataChunk debugEmbeddedPdbChunk
else
writePortablePdbInfo contentId stream showTimes fpdb debugDataChunk
writePortablePdbInfo contentId stream showTimes fpdb pathMap debugDataChunk
| None ->
#if FX_NO_PDB_WRITER
Array.empty<idd>
Expand Down Expand Up @@ -4284,10 +4284,11 @@ type options =
emitTailcalls : bool
deterministic : bool
showTimes: bool
dumpDebugInfo: bool }
dumpDebugInfo: bool
pathMap: PathMap }

let WriteILBinary (outfile, (args: options), modul, normalizeAssemblyRefs) =
writeBinaryAndReportMappings (outfile,
args.ilg, args.pdbfile, args.signer, args.portablePDB, args.embeddedPDB, args.embedAllSource,
args.embedSourceList, args.sourceLink, args.emitTailcalls, args.deterministic, args.showTimes, args.dumpDebugInfo) modul normalizeAssemblyRefs
args.embedSourceList, args.sourceLink, args.emitTailcalls, args.deterministic, args.showTimes, args.dumpDebugInfo, args.pathMap) modul normalizeAssemblyRefs
|> ignore
4 changes: 3 additions & 1 deletion src/absil/ilwrite.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/// The IL Binary writer.
module internal FSharp.Compiler.AbstractIL.ILBinaryWriter

open Internal.Utilities
open FSharp.Compiler.AbstractIL
open FSharp.Compiler.AbstractIL.Internal
open FSharp.Compiler.AbstractIL.IL
Expand All @@ -27,7 +28,8 @@ type options =
emitTailcalls: bool
deterministic: bool
showTimes : bool
dumpDebugInfo : bool }
dumpDebugInfo : bool
pathMap : PathMap }

/// Write a binary to the file system. Extra configuration parameters can also be specified.
val WriteILBinary: filename: string * options: options * input: ILModuleDef * (ILAssemblyRef -> ILAssemblyRef) -> unit
Loading